@onekeyfe/hd-web-sdk 0.1.41 → 0.1.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ /*! For license information please see iframe.aa7e2f1305ebf0ba8c60.js.LICENSE.txt */
2
+ (()=>{var __webpack_modules__={7408:(e,t,r)=>{"use strict";var i,n=r(6139).Promise,s="object"==typeof Reflect?Reflect:null,o=s&&"function"==typeof s.apply?s.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};i=s&&"function"==typeof s.ownKeys?s.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}e.exports=u,e.exports.once=function(e,t){return new n((function(r,i){function n(r){e.removeListener(t,s),i(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",n),r([].slice.call(arguments))}v(e,t,s,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,n)}))},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var d=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function p(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function c(e,t,r,i){var n,s,o,a;if(l(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]),void 0===o)o=s[t]=r,++e._eventsCount;else if("function"==typeof o?o=s[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=p(e))>0&&o.length>n&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,a=u,console&&console.warn&&console.warn(a)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=h.bind(i);return n.listener=r,i.wrapFn=n,n}function y(e,t,r){var i=e._events;if(void 0===i)return[];var n=i[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(n):m(n,n.length)}function g(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),i=0;i<t;++i)r[i]=e[i];return r}function v(e,t,r,i){if("function"==typeof e.on)i.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function n(s){i.once&&e.removeEventListener(t,n),r(s)}))}}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");d=e}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},u.prototype.getMaxListeners=function(){return p(this)},u.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,n=this._events;if(void 0!==n)i=i&&void 0===n.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=n[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var d=u.length,l=m(u,d);for(r=0;r<d;++r)o(l[r],this,t)}return!0},u.prototype.addListener=function(e,t){return c(this,e,t,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(e,t){return c(this,e,t,!0)},u.prototype.once=function(e,t){return l(t),this.on(e,f(this,e,t)),this},u.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,f(this,e,t)),this},u.prototype.removeListener=function(e,t){var r,i,n,s,o;if(l(t),void 0===(i=this._events))return this;if(void 0===(r=i[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,n),1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(e){var t,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var n,s=Object.keys(r);for(i=0;i<s.length;++i)"removeListener"!==(n=s[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},u.prototype.listeners=function(e){return y(this,e,!0)},u.prototype.rawListeners=function(e){return y(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},u.prototype.listenerCount=g,u.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},6781:(e,t,r)=>{"use strict";var i=r(6139).Promise;e.exports=function(e,t){for(var r=new Array(arguments.length-1),n=0,s=2,o=!0;s<arguments.length;)r[n++]=arguments[s++];return new i((function(i,s){r[n]=function(e){if(o)if(o=!1,e)s(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];i.apply(null,t)}};try{e.apply(t||null,r)}catch(e){o&&(o=!1,s(e))}}))}},7026:(e,t)=>{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var i=new Array(64),n=new Array(123),s=0;s<64;)n[i[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;r.encode=function(e,t,r){for(var n,s=null,o=[],a=0,u=0;t<r;){var d=e[t++];switch(u){case 0:o[a++]=i[d>>2],n=(3&d)<<4,u=1;break;case 1:o[a++]=i[n|d>>4],n=(15&d)<<2,u=2;break;case 2:o[a++]=i[n|d>>6],o[a++]=i[63&d],u=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0)}return u&&(o[a++]=i[n],o[a++]=61,1===u&&(o[a++]=61)),s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};var o="invalid encoding";r.decode=function(e,t,r){for(var i,s=r,a=0,u=0;u<e.length;){var d=e.charCodeAt(u++);if(61===d&&a>1)break;if(void 0===(d=n[d]))throw Error(o);switch(a){case 0:i=d,a=1;break;case 1:t[r++]=i<<2|(48&d)>>4,i=d,a=2;break;case 2:t[r++]=(15&i)<<4|(60&d)>>2,i=d,a=3;break;case 3:t[r++]=(3&i)<<6|d,a=0}}if(1===a)throw Error(o);return r-s},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},1706:e=>{"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var i=[];function n(e){if("string"!=typeof e){var r=s();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var o=Object.keys(e),a=new Array(o.length+1),u=new Array(o.length),d=0;d<o.length;)a[d]=o[d],u[d]=e[o[d++]];return a[d]=r,Function.apply(null,a).apply(null,u)}return Function(r)()}for(var l=new Array(arguments.length-1),p=0;p<l.length;)l[p]=arguments[++p];if(p=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=l[p++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),p!==l.length)throw Error("parameter count mismatch");return i.push(e),n}function s(t){return"function "+(t||r||"")+"("+(e&&e.join(",")||"")+"){\n "+i.join("\n ")+"\n}"}return n.toString=s,n}e.exports=t,t.verbose=!1},5570:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],i=0;i<r.length;)r[i].fn===t?r.splice(i,1):++i;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],i=1;i<arguments.length;)r.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,r)}return this}},4641:(e,t,r)=>{"use strict";e.exports=s;var i=r(6781),n=r(6116)("fs");function s(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&n&&n.readFile?n.readFile(e,(function(i,n){return i&&"undefined"!=typeof XMLHttpRequest?s.xhr(e,t,r):i?r(i):r(null,t.binary?n:n.toString("utf8"))})):s.xhr(e,t,r):i(s,this,e,t)}s.xhr=function(e,t,r){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===i.readyState){if(0!==i.status&&200!==i.status)return r(Error("status "+i.status));if(t.binary){var e=i.response;if(!e){e=[];for(var n=0;n<i.responseText.length;++n)e.push(255&i.responseText.charCodeAt(n))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,i.responseText)}},t.binary&&("overrideMimeType"in i&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.responseType="arraybuffer"),i.open("GET",e),i.send()}},5298:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),i=128===r[3];function n(e,i,n){t[0]=e,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3]}function s(e,i,n){t[0]=e,i[n]=r[3],i[n+1]=r[2],i[n+2]=r[1],i[n+3]=r[0]}function o(e,i){return r[0]=e[i],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],t[0]}function a(e,i){return r[3]=e[i],r[2]=e[i+1],r[1]=e[i+2],r[0]=e[i+3],t[0]}e.writeFloatLE=i?n:s,e.writeFloatBE=i?s:n,e.readFloatLE=i?o:a,e.readFloatBE=i?a:o}():function(){function t(e,t,r,i){var n=t<0?1:0;if(n&&(t=-t),0===t)e(1/t>0?0:2147483648,r,i);else if(isNaN(t))e(2143289344,r,i);else if(t>34028234663852886e22)e((n<<31|2139095040)>>>0,r,i);else if(t<11754943508222875e-54)e((n<<31|Math.round(t/1401298464324817e-60))>>>0,r,i);else{var s=Math.floor(Math.log(t)/Math.LN2);e((n<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,r,i)}}function o(e,t,r){var i=e(t,r),n=2*(i>>31)+1,s=i>>>23&255,o=8388607&i;return 255===s?o?NaN:n*(1/0):0===s?1401298464324817e-60*n*o:n*Math.pow(2,s-150)*(o+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,i),e.readFloatLE=o.bind(null,n),e.readFloatBE=o.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),i=128===r[7];function n(e,i,n){t[0]=e,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3],i[n+4]=r[4],i[n+5]=r[5],i[n+6]=r[6],i[n+7]=r[7]}function s(e,i,n){t[0]=e,i[n]=r[7],i[n+1]=r[6],i[n+2]=r[5],i[n+3]=r[4],i[n+4]=r[3],i[n+5]=r[2],i[n+6]=r[1],i[n+7]=r[0]}function o(e,i){return r[0]=e[i],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],r[4]=e[i+4],r[5]=e[i+5],r[6]=e[i+6],r[7]=e[i+7],t[0]}function a(e,i){return r[7]=e[i],r[6]=e[i+1],r[5]=e[i+2],r[4]=e[i+3],r[3]=e[i+4],r[2]=e[i+5],r[1]=e[i+6],r[0]=e[i+7],t[0]}e.writeDoubleLE=i?n:s,e.writeDoubleBE=i?s:n,e.readDoubleLE=i?o:a,e.readDoubleBE=i?a:o}():function(){function t(e,t,r,i,n,s){var o=i<0?1:0;if(o&&(i=-i),0===i)e(0,n,s+t),e(1/i>0?0:2147483648,n,s+r);else if(isNaN(i))e(0,n,s+t),e(2146959360,n,s+r);else if(i>17976931348623157e292)e(0,n,s+t),e((o<<31|2146435072)>>>0,n,s+r);else{var a;if(i<22250738585072014e-324)e((a=i/5e-324)>>>0,n,s+t),e((o<<31|a/4294967296)>>>0,n,s+r);else{var u=Math.floor(Math.log(i)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(a=i*Math.pow(2,-u))>>>0,n,s+t),e((o<<31|u+1023<<20|1048576*a&1048575)>>>0,n,s+r)}}}function o(e,t,r,i,n){var s=e(i,n+t),o=e(i,n+r),a=2*(o>>31)+1,u=o>>>20&2047,d=4294967296*(1048575&o)+s;return 2047===u?d?NaN:a*(1/0):0===u?5e-324*a*d:a*Math.pow(2,u-1075)*(d+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,i,4,0),e.readDoubleLE=o.bind(null,n,0,4),e.readDoubleBE=o.bind(null,s,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function i(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function n(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},6116:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},2659:(e,t)=>{"use strict";var r=t,i=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},n=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=i(e),n="";r&&(n=t.shift()+"/");for(var s=0;s<t.length;)".."===t[s]?s>0&&".."!==t[s-1]?t.splice(--s,2):r?t.splice(s,1):++s:"."===t[s]?t.splice(s,1):++s;return n+t.join("/")};r.resolve=function(e,t,r){return r||(t=n(t)),i(t)?t:(r||(e=n(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?n(e+"/"+t):t)}},804:e=>{"use strict";e.exports=function(e,t,r){var i=r||8192,n=i>>>1,s=null,o=i;return function(r){if(r<1||r>n)return e(r);o+r>i&&(s=e(i),o=0);var a=t.call(s,o,o+=r);return 7&o&&(o=1+(7|o)),a}}},7958:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(i+1))?(++i,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var i,n=null,s=[],o=0;t<r;)(i=e[t++])<128?s[o++]=i:i>191&&i<224?s[o++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[o++]=55296+(i>>10),s[o++]=56320+(1023&i)):s[o++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,s)),o=0);return n?(o&&n.push(String.fromCharCode.apply(String,s.slice(0,o))),n.join("")):String.fromCharCode.apply(String,s.slice(0,o))},r.write=function(e,t,r){for(var i,n,s=r,o=0;o<e.length;++o)(i=e.charCodeAt(o))<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&56320==(64512&(n=e.charCodeAt(o+1)))?(i=65536+((1023&i)<<10)+(1023&n),++o,t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128);return r-s}},9644:(e,t,r)=>{e.exports=r(5644)},353:(e,t,r)=>{"use strict";var i=r(6139).Promise,n=r(3044),s=r(6955),o=r(2233),a=r(8030),u=r(7948),d=r(1875),l=r(842),p=r(8560),c=r(1218),h=r(8047),f=r(738);e.exports=function(e){return new i((function(t,r){var i,y=e.data,g=e.headers,m=e.responseType;function v(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}n.isFormData(y)&&n.isStandardBrowserEnv()&&delete g["Content-Type"];var _=new XMLHttpRequest;if(e.auth){var b=e.auth.username||"",T=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";g.Authorization="Basic "+btoa(b+":"+T)}var E=u(e.baseURL,e.url);function w(){if(_){var i="getAllResponseHeaders"in _?d(_.getAllResponseHeaders()):null,n={data:m&&"text"!==m&&"json"!==m?_.response:_.responseText,status:_.status,statusText:_.statusText,headers:i,config:e,request:_};s((function(e){t(e),v()}),(function(e){r(e),v()}),n),_=null}}if(_.open(e.method.toUpperCase(),a(E,e.params,e.paramsSerializer),!0),_.timeout=e.timeout,"onloadend"in _?_.onloadend=w:_.onreadystatechange=function(){_&&4===_.readyState&&(0!==_.status||_.responseURL&&0===_.responseURL.indexOf("file:"))&&setTimeout(w)},_.onabort=function(){_&&(r(new c("Request aborted",c.ECONNABORTED,e,_)),_=null)},_.onerror=function(){r(new c("Network Error",c.ERR_NETWORK,e,_,_)),_=null},_.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",i=e.transitional||p;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new c(t,i.clarifyTimeoutError?c.ETIMEDOUT:c.ECONNABORTED,e,_)),_=null},n.isStandardBrowserEnv()){var S=(e.withCredentials||l(E))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;S&&(g[e.xsrfHeaderName]=S)}"setRequestHeader"in _&&n.forEach(g,(function(e,t){void 0===y&&"content-type"===t.toLowerCase()?delete g[t]:_.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(_.withCredentials=!!e.withCredentials),m&&"json"!==m&&(_.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&_.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&_.upload&&_.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(i=function(e){_&&(r(!e||e&&e.type?new h:e),_.abort(),_=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i))),y||(y=null);var A=f(E);A&&-1===["http","https","file"].indexOf(A)?r(new c("Unsupported protocol "+A+":",c.ERR_BAD_REQUEST,e)):_.send(y)}))}},5644:(e,t,r)=>{"use strict";var i=r(6139).Promise,n=r(3044),s=r(3644),o=r(2215),a=r(2937),u=function e(t){var r=new o(t),i=s(o.prototype.request,r);return n.extend(i,o.prototype,r),n.extend(i,r),i.create=function(r){return e(a(t,r))},i}(r(663));u.Axios=o,u.CanceledError=r(8047),u.CancelToken=r(4089),u.isCancel=r(8041),u.VERSION=r(9241).version,u.toFormData=r(9027),u.AxiosError=r(1218),u.Cancel=u.CanceledError,u.all=function(e){return i.all(e)},u.spread=r(783),u.isAxiosError=r(5587),e.exports=u,e.exports.default=u},4089:(e,t,r)=>{"use strict";var i=r(6139).Promise,n=r(8047);function s(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new i((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,i=r._listeners.length;for(t=0;t<i;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new i((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}s.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},s.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},s.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},s.source=function(){var e;return{token:new s((function(t){e=t})),cancel:e}},e.exports=s},8047:(e,t,r)=>{"use strict";var i=r(1218);function n(e){i.call(this,null==e?"canceled":e,i.ERR_CANCELED),this.name="CanceledError"}r(3044).inherits(n,i,{__CANCEL__:!0}),e.exports=n},8041:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},2215:(e,t,r)=>{"use strict";var i=r(6139).Promise,n=r(3044),s=r(8030),o=r(946),a=r(6895),u=r(2937),d=r(7948),l=r(7525),p=l.validators;function c(e){this.defaults=e,this.interceptors={request:new o,response:new o}}c.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=u(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&l.assertOptions(r,{silentJSONParsing:p.transitional(p.boolean),forcedJSONParsing:p.transitional(p.boolean),clarifyTimeoutError:p.transitional(p.boolean)},!1);var n=[],s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var o,d=[];if(this.interceptors.response.forEach((function(e){d.push(e.fulfilled,e.rejected)})),!s){var c=[a,void 0];for(Array.prototype.unshift.apply(c,n),c=c.concat(d),o=i.resolve(t);c.length;)o=o.then(c.shift(),c.shift());return o}for(var h=t;n.length;){var f=n.shift(),y=n.shift();try{h=f(h)}catch(e){y(e);break}}try{o=a(h)}catch(e){return i.reject(e)}for(;d.length;)o=o.then(d.shift(),d.shift());return o},c.prototype.getUri=function(e){e=u(this.defaults,e);var t=d(e.baseURL,e.url);return s(t,e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,r){return this.request(u(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){function t(t){return function(r,i,n){return this.request(u(n||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}c.prototype[e]=t(),c.prototype[e+"Form"]=t(!0)})),e.exports=c},1218:(e,t,r)=>{"use strict";var i=r(3044);function n(e,t,r,i,n){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),n&&(this.response=n)}i.inherits(n,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var s=n.prototype,o={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){o[e]={value:e}})),Object.defineProperties(n,o),Object.defineProperty(s,"isAxiosError",{value:!0}),n.from=function(e,t,r,o,a,u){var d=Object.create(s);return i.toFlatObject(e,d,(function(e){return e!==Error.prototype})),n.call(d,e.message,t,r,o,a),d.name=e.name,u&&Object.assign(d,u),d},e.exports=n},946:(e,t,r)=>{"use strict";var i=r(3044);function n(){this.handlers=[]}n.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},n.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},n.prototype.forEach=function(e){i.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=n},7948:(e,t,r)=>{"use strict";var i=r(9192),n=r(8762);e.exports=function(e,t){return e&&!i(t)?n(e,t):t}},6895:(e,t,r)=>{"use strict";var i=r(6139).Promise,n=r(3044),s=r(8556),o=r(8041),a=r(663),u=r(8047);function d(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new u}e.exports=function(e){return d(e),e.headers=e.headers||{},e.data=s.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return d(e),t.data=s.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(d(e),t&&t.response&&(t.response.data=s.call(e,t.response.data,t.response.headers,e.transformResponse))),i.reject(t)}))}},2937:(e,t,r)=>{"use strict";var i=r(3044);e.exports=function(e,t){t=t||{};var r={};function n(e,t){return i.isPlainObject(e)&&i.isPlainObject(t)?i.merge(e,t):i.isPlainObject(t)?i.merge({},t):i.isArray(t)?t.slice():t}function s(r){return i.isUndefined(t[r])?i.isUndefined(e[r])?void 0:n(void 0,e[r]):n(e[r],t[r])}function o(e){if(!i.isUndefined(t[e]))return n(void 0,t[e])}function a(r){return i.isUndefined(t[r])?i.isUndefined(e[r])?void 0:n(void 0,e[r]):n(void 0,t[r])}function u(r){return r in t?n(e[r],t[r]):r in e?n(void 0,e[r]):void 0}var d={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u};return i.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=d[e]||s,n=t(e);i.isUndefined(n)&&t!==u||(r[e]=n)})),r}},6955:(e,t,r)=>{"use strict";var i=r(1218);e.exports=function(e,t,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new i("Request failed with status code "+r.status,[i.ERR_BAD_REQUEST,i.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}},8556:(e,t,r)=>{"use strict";var i=r(3044),n=r(663);e.exports=function(e,t,r){var s=this||n;return i.forEach(r,(function(r){e=r.call(s,e,t)})),e}},663:(e,t,r)=>{"use strict";var i=r(4406),n=r(3044),s=r(8868),o=r(1218),a=r(8560),u=r(9027),d={"Content-Type":"application/x-www-form-urlencoded"};function l(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var p,c={transitional:a,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==i&&"[object process]"===Object.prototype.toString.call(i))&&(p=r(353)),p),transformRequest:[function(e,t){if(s(t,"Accept"),s(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e))return e;if(n.isArrayBufferView(e))return e.buffer;if(n.isURLSearchParams(e))return l(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,i=n.isObject(e),o=t&&t["Content-Type"];if((r=n.isFileList(e))||i&&"multipart/form-data"===o){var a=this.env&&this.env.FormData;return u(r?{"files[]":e}:e,a&&new a)}return i||"application/json"===o?(l(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(0,JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||c.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw o.from(e,o.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:r(4684)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(d)})),e.exports=c},8560:e=>{"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},9241:e=>{e.exports={version:"0.27.2"}},3644:e=>{"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),i=0;i<r.length;i++)r[i]=arguments[i];return e.apply(t,r)}}},8030:(e,t,r)=>{"use strict";var i=r(3044);function n(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var s;if(r)s=r(t);else if(i.isURLSearchParams(t))s=t.toString();else{var o=[];i.forEach(t,(function(e,t){null!=e&&(i.isArray(e)?t+="[]":e=[e],i.forEach(e,(function(e){i.isDate(e)?e=e.toISOString():i.isObject(e)&&(e=JSON.stringify(e)),o.push(n(t)+"="+n(e))})))})),s=o.join("&")}if(s){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}},8762:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},2233:(e,t,r)=>{"use strict";var i=r(3044);e.exports=i.isStandardBrowserEnv()?{write:function(e,t,r,n,s,o){var a=[];a.push(e+"="+encodeURIComponent(t)),i.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),i.isString(n)&&a.push("path="+n),i.isString(s)&&a.push("domain="+s),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},9192:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},5587:(e,t,r)=>{"use strict";var i=r(3044);e.exports=function(e){return i.isObject(e)&&!0===e.isAxiosError}},842:(e,t,r)=>{"use strict";var i=r(3044);e.exports=i.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var i=e;return t&&(r.setAttribute("href",i),i=r.href),r.setAttribute("href",i),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){var r=i.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},8868:(e,t,r)=>{"use strict";var i=r(3044);e.exports=function(e,t){i.forEach(e,(function(r,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[i])}))}},4684:e=>{e.exports=null},1875:(e,t,r)=>{"use strict";var i=r(3044),n=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,s,o={};return e?(i.forEach(e.split("\n"),(function(e){if(s=e.indexOf(":"),t=i.trim(e.substr(0,s)).toLowerCase(),r=i.trim(e.substr(s+1)),t){if(o[t]&&n.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}})),o):o}},738:e=>{"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},783:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},9027:(e,t,r)=>{"use strict";var i=r(8834).Buffer,n=r(3044);e.exports=function(e,t){t=t||new FormData;var r=[];function s(e){return null===e?"":n.isDate(e)?e.toISOString():n.isArrayBuffer(e)||n.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):i.from(e):e}return function e(i,o){if(n.isPlainObject(i)||n.isArray(i)){if(-1!==r.indexOf(i))throw Error("Circular reference detected in "+o);r.push(i),n.forEach(i,(function(r,i){if(!n.isUndefined(r)){var a,u=o?o+"."+i:i;if(r&&!o&&"object"==typeof r)if(n.endsWith(i,"{}"))r=JSON.stringify(r);else if(n.endsWith(i,"[]")&&(a=n.toArray(r)))return void a.forEach((function(e){!n.isUndefined(e)&&t.append(u,s(e))}));e(r,u)}})),r.pop()}else t.append(o,s(i))}(e),t}},7525:(e,t,r)=>{"use strict";var i=r(9241).version,n=r(1218),s={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){s[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var o={};s.transitional=function(e,t,r){function s(e,t){return"[Axios v"+i+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,i,a){if(!1===e)throw new n(s(i," has been removed"+(t?" in "+t:"")),n.ERR_DEPRECATED);return t&&!o[i]&&(o[i]=!0,console.warn(s(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,a)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new n("options must be an object",n.ERR_BAD_OPTION_VALUE);for(var i=Object.keys(e),s=i.length;s-- >0;){var o=i[s],a=t[o];if(a){var u=e[o],d=void 0===u||a(u,o,e);if(!0!==d)throw new n("option "+o+" must be "+d,n.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new n("Unknown option "+o,n.ERR_BAD_OPTION)}},validators:s}},3044:(e,t,r)=>{"use strict";var i,n=r(3644),s=Object.prototype.toString,o=(i=Object.create(null),function(e){var t=s.call(e);return i[t]||(i[t]=t.slice(8,-1).toLowerCase())});function a(e){return e=e.toLowerCase(),function(t){return o(t)===e}}function u(e){return Array.isArray(e)}function d(e){return void 0===e}var l=a("ArrayBuffer");function p(e){return null!==e&&"object"==typeof e}function c(e){if("object"!==o(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var h=a("Date"),f=a("File"),y=a("Blob"),g=a("FileList");function m(e){return"[object Function]"===s.call(e)}var v=a("URLSearchParams");function _(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),u(e))for(var r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.call(null,e[n],n,e)}var b,T=(b="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return b&&e instanceof b});e.exports={isArray:u,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||s.call(e)===t||m(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:p,isPlainObject:c,isUndefined:d,isDate:h,isFile:f,isBlob:y,isFunction:m,isStream:function(e){return p(e)&&m(e.pipe)},isURLSearchParams:v,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:_,merge:function e(){var t={};function r(r,i){c(t[i])&&c(r)?t[i]=e(t[i],r):c(r)?t[i]=e({},r):u(r)?t[i]=r.slice():t[i]=r}for(var i=0,n=arguments.length;i<n;i++)_(arguments[i],r);return t},extend:function(e,t,r){return _(t,(function(t,i){e[i]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,i){e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r){var i,n,s,o={};t=t||{};do{for(n=(i=Object.getOwnPropertyNames(e)).length;n-- >0;)o[s=i[n]]||(t[s]=e[s],o[s]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:a,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var i=e.indexOf(t,r);return-1!==i&&i===r},toArray:function(e){if(!e)return null;var t=e.length;if(d(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:T,isFileList:g}},5766:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],i=t[1];return 3*(r+i)/4-i},t.toByteArray=function(e){var t,r,s=u(e),o=s[0],a=s[1],d=new n(function(e,t,r){return 3*(t+r)/4-r}(0,o,a)),l=0,p=a>0?o-4:o;for(r=0;r<p;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],d[l++]=t>>16&255,d[l++]=t>>8&255,d[l++]=255&t;return 2===a&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,d[l++]=255&t),1===a&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,d[l++]=t>>8&255,d[l++]=255&t),d},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,s=[],o=16383,a=0,u=i-n;a<u;a+=o)s.push(d(e,a,a+o>u?u:a+o));return 1===n?(t=e[i-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[i-2]<<8)+e[i-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),s.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=s.length;o<a;++o)r[o]=s[o],i[s.charCodeAt(o)]=o;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function d(e,t,i){for(var n,s,o=[],a=t;a<i;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(r[(s=n)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},6391:function(e,t,r){var i;!function(n){"use strict";var s,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,u=Math.floor,d="[BigNumber Error] ",l=d+"Number primitive has more than 15 significant digits: ",p=1e14,c=14,h=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],y=1e7,g=1e9;function m(e){var t=0|e;return e>0||e===t?t:t-1}function v(e){for(var t,r,i=1,n=e.length,s=e[0]+"";i<n;){for(t=e[i++]+"",r=c-t.length;r--;t="0"+t);s+=t}for(n=s.length;48===s.charCodeAt(--n););return s.slice(0,n+1||1)}function _(e,t){var r,i,n=e.c,s=t.c,o=e.s,a=t.s,u=e.e,d=t.e;if(!o||!a)return null;if(r=n&&!n[0],i=s&&!s[0],r||i)return r?i?0:-a:o;if(o!=a)return o;if(r=o<0,i=u==d,!n||!s)return i?0:!n^r?1:-1;if(!i)return u>d^r?1:-1;for(a=(u=n.length)<(d=s.length)?u:d,o=0;o<a;o++)if(n[o]!=s[o])return n[o]>s[o]^r?1:-1;return u==d?0:u>d^r?1:-1}function b(e,t,r,i){if(e<t||e>r||e!==u(e))throw Error(d+(i||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function T(e){var t=e.c.length-1;return m(e.e/c)==t&&e.c[t]%2!=0}function E(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function w(e,t,r){var i,n;if(t<0){for(n=r+".";++t;n+=r);e=n+e}else if(++t>(i=e.length)){for(n=r,t-=i;--t;n+=r);e+=n}else t<i&&(e=e.slice(0,t)+"."+e.slice(t));return e}s=function e(t){var r,i,n,s,S,A,R,O,I,x,C=G.prototype={constructor:G,toString:null,valueOf:null},M=new G(1),k=20,N=4,D=-7,P=21,q=-1e7,L=1e7,B=!1,F=1,j=0,U={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function G(e,t){var r,s,a,d,p,f,y,g,m=this;if(!(m instanceof G))return new G(e,t);if(null==t){if(e&&!0===e._isBigNumber)return m.s=e.s,void(!e.c||e.e>L?m.c=m.e=null:e.e<q?m.c=[m.e=0]:(m.e=e.e,m.c=e.c.slice()));if((f="number"==typeof e)&&0*e==0){if(m.s=1/e<0?(e=-e,-1):1,e===~~e){for(d=0,p=e;p>=10;p/=10,d++);return void(d>L?m.c=m.e=null:(m.e=d,m.c=[e]))}g=String(e)}else{if(!o.test(g=String(e)))return n(m,g,f);m.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(d=g.indexOf("."))>-1&&(g=g.replace(".","")),(p=g.search(/e/i))>0?(d<0&&(d=p),d+=+g.slice(p+1),g=g.substring(0,p)):d<0&&(d=g.length)}else{if(b(t,2,H.length,"Base"),10==t&&$)return X(m=new G(e),k+m.e+1,N);if(g=String(e),f="number"==typeof e){if(0*e!=0)return n(m,g,f,t);if(m.s=1/e<0?(g=g.slice(1),-1):1,G.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else m.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=H.slice(0,t),d=p=0,y=g.length;p<y;p++)if(r.indexOf(s=g.charAt(p))<0){if("."==s){if(p>d){d=y;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,p=-1,d=0;continue}return n(m,String(e),f,t)}f=!1,(d=(g=i(g,t,10,m.s)).indexOf("."))>-1?g=g.replace(".",""):d=g.length}for(p=0;48===g.charCodeAt(p);p++);for(y=g.length;48===g.charCodeAt(--y););if(g=g.slice(p,++y)){if(y-=p,f&&G.DEBUG&&y>15&&(e>h||e!==u(e)))throw Error(l+m.s*e);if((d=d-p-1)>L)m.c=m.e=null;else if(d<q)m.c=[m.e=0];else{if(m.e=d,m.c=[],p=(d+1)%c,d<0&&(p+=c),p<y){for(p&&m.c.push(+g.slice(0,p)),y-=c;p<y;)m.c.push(+g.slice(p,p+=c));p=c-(g=g.slice(p)).length}else p-=y;for(;p--;g+="0");m.c.push(+g)}}else m.c=[m.e=0]}function z(e,t,r,i){var n,s,o,a,u;if(null==r?r=N:b(r,0,8),!e.c)return e.toString();if(n=e.c[0],o=e.e,null==t)u=v(e.c),u=1==i||2==i&&(o<=D||o>=P)?E(u,o):w(u,o,"0");else if(s=(e=X(new G(e),t,r)).e,a=(u=v(e.c)).length,1==i||2==i&&(t<=s||s<=D)){for(;a<t;u+="0",a++);u=E(u,s)}else if(t-=o,u=w(u,s,"0"),s+1>a){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=s-a)>0)for(s+1==a&&(u+=".");t--;u+="0");return e.s<0&&n?"-"+u:u}function W(e,t){for(var r,i=1,n=new G(e[0]);i<e.length;i++){if(!(r=new G(e[i])).s){n=r;break}t.call(n,r)&&(n=r)}return n}function V(e,t,r){for(var i=1,n=t.length;!t[--n];t.pop());for(n=t[0];n>=10;n/=10,i++);return(r=i+r*c-1)>L?e.c=e.e=null:r<q?e.c=[e.e=0]:(e.e=r,e.c=t),e}function X(e,t,r,i){var n,s,o,d,l,h,y,g=e.c,m=f;if(g){e:{for(n=1,d=g[0];d>=10;d/=10,n++);if((s=t-n)<0)s+=c,o=t,y=(l=g[h=0])/m[n-o-1]%10|0;else if((h=a((s+1)/c))>=g.length){if(!i)break e;for(;g.length<=h;g.push(0));l=y=0,n=1,o=(s%=c)-c+1}else{for(l=d=g[h],n=1;d>=10;d/=10,n++);y=(o=(s%=c)-c+n)<0?0:l/m[n-o-1]%10|0}if(i=i||t<0||null!=g[h+1]||(o<0?l:l%m[n-o-1]),i=r<4?(y||i)&&(0==r||r==(e.s<0?3:2)):y>5||5==y&&(4==r||i||6==r&&(s>0?o>0?l/m[n-o]:0:g[h-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,i?(t-=e.e+1,g[0]=m[(c-t%c)%c],e.e=-t||0):g[0]=e.e=0,e;if(0==s?(g.length=h,d=1,h--):(g.length=h+1,d=m[c-s],g[h]=o>0?u(l/m[n-o]%m[o])*d:0),i)for(;;){if(0==h){for(s=1,o=g[0];o>=10;o/=10,s++);for(o=g[0]+=d,d=1;o>=10;o/=10,d++);s!=d&&(e.e++,g[0]==p&&(g[0]=1));break}if(g[h]+=d,g[h]!=p)break;g[h--]=0,d=1}for(s=g.length;0===g[--s];g.pop());}e.e>L?e.c=e.e=null:e.e<q&&(e.c=[e.e=0])}return e}function K(e){var t,r=e.e;return null===r?e.toString():(t=v(e.c),t=r<=D||r>=P?E(t,r):w(t,r,"0"),e.s<0?"-"+t:t)}return G.clone=e,G.ROUND_UP=0,G.ROUND_DOWN=1,G.ROUND_CEIL=2,G.ROUND_FLOOR=3,G.ROUND_HALF_UP=4,G.ROUND_HALF_DOWN=5,G.ROUND_HALF_EVEN=6,G.ROUND_HALF_CEIL=7,G.ROUND_HALF_FLOOR=8,G.EUCLID=9,G.config=G.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(d+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(b(r=e[t],0,g,t),k=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(b(r=e[t],0,8,t),N=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(b(r[0],-g,0,t),b(r[1],0,g,t),D=r[0],P=r[1]):(b(r,-g,g,t),D=-(P=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)b(r[0],-g,-1,t),b(r[1],1,g,t),q=r[0],L=r[1];else{if(b(r,-g,g,t),!r)throw Error(d+t+" cannot be zero: "+r);q=-(L=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(d+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw B=!r,Error(d+"crypto unavailable");B=r}else B=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(b(r=e[t],0,9,t),F=r),e.hasOwnProperty(t="POW_PRECISION")&&(b(r=e[t],0,g,t),j=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(d+t+" not an object: "+r);U=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(d+t+" invalid: "+r);$="0123456789"==r.slice(0,10),H=r}}return{DECIMAL_PLACES:k,ROUNDING_MODE:N,EXPONENTIAL_AT:[D,P],RANGE:[q,L],CRYPTO:B,MODULO_MODE:F,POW_PRECISION:j,FORMAT:U,ALPHABET:H}},G.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!G.DEBUG)return!0;var t,r,i=e.c,n=e.e,s=e.s;e:if("[object Array]"=={}.toString.call(i)){if((1===s||-1===s)&&n>=-g&&n<=g&&n===u(n)){if(0===i[0]){if(0===n&&1===i.length)return!0;break e}if((t=(n+1)%c)<1&&(t+=c),String(i[0]).length==t){for(t=0;t<i.length;t++)if((r=i[t])<0||r>=p||r!==u(r))break e;if(0!==r)return!0}}}else if(null===i&&null===n&&(null===s||1===s||-1===s))return!0;throw Error(d+"Invalid BigNumber: "+e)},G.maximum=G.max=function(){return W(arguments,C.lt)},G.minimum=G.min=function(){return W(arguments,C.gt)},G.random=(s=9007199254740992,S=Math.random()*s&2097151?function(){return u(Math.random()*s)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,n,s,o=0,l=[],p=new G(M);if(null==e?e=k:b(e,0,g),n=a(e/c),B)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(n*=2));o<n;)(s=131072*t[o]+(t[o+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(l.push(s%1e14),o+=2);o=n/2}else{if(!crypto.randomBytes)throw B=!1,Error(d+"crypto unavailable");for(t=crypto.randomBytes(n*=7);o<n;)(s=281474976710656*(31&t[o])+1099511627776*t[o+1]+4294967296*t[o+2]+16777216*t[o+3]+(t[o+4]<<16)+(t[o+5]<<8)+t[o+6])>=9e15?crypto.randomBytes(7).copy(t,o):(l.push(s%1e14),o+=7);o=n/7}if(!B)for(;o<n;)(s=S())<9e15&&(l[o++]=s%1e14);for(n=l[--o],e%=c,n&&e&&(s=f[c-e],l[o]=u(n/s)*s);0===l[o];l.pop(),o--);if(o<0)l=[i=0];else{for(i=-1;0===l[0];l.splice(0,1),i-=c);for(o=1,s=l[0];s>=10;s/=10,o++);o<c&&(i-=c-o)}return p.e=i,p.c=l,p}),G.sum=function(){for(var e=1,t=arguments,r=new G(t[0]);e<t.length;)r=r.plus(t[e++]);return r},i=function(){var e="0123456789";function t(e,t,r,i){for(var n,s,o=[0],a=0,u=e.length;a<u;){for(s=o.length;s--;o[s]*=t);for(o[0]+=i.indexOf(e.charAt(a++)),n=0;n<o.length;n++)o[n]>r-1&&(null==o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}return function(i,n,s,o,a){var u,d,l,p,c,h,f,y,g=i.indexOf("."),m=k,_=N;for(g>=0&&(p=j,j=0,i=i.replace(".",""),h=(y=new G(n)).pow(i.length-g),j=p,y.c=t(w(v(h.c),h.e,"0"),10,s,e),y.e=y.c.length),l=p=(f=t(i,n,s,a?(u=H,e):(u=e,H))).length;0==f[--p];f.pop());if(!f[0])return u.charAt(0);if(g<0?--l:(h.c=f,h.e=l,h.s=o,f=(h=r(h,y,m,_,s)).c,c=h.r,l=h.e),g=f[d=l+m+1],p=s/2,c=c||d<0||null!=f[d+1],c=_<4?(null!=g||c)&&(0==_||_==(h.s<0?3:2)):g>p||g==p&&(4==_||c||6==_&&1&f[d-1]||_==(h.s<0?8:7)),d<1||!f[0])i=c?w(u.charAt(1),-m,u.charAt(0)):u.charAt(0);else{if(f.length=d,c)for(--s;++f[--d]>s;)f[d]=0,d||(++l,f=[1].concat(f));for(p=f.length;!f[--p];);for(g=0,i="";g<=p;i+=u.charAt(f[g++]));i=w(i,l,u.charAt(0))}return i}}(),r=function(){function e(e,t,r){var i,n,s,o,a=0,u=e.length,d=t%y,l=t/y|0;for(e=e.slice();u--;)a=((n=d*(s=e[u]%y)+(i=l*s+(o=e[u]/y|0)*d)%y*y+a)/r|0)+(i/y|0)+l*o,e[u]=n%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,i){var n,s;if(r!=i)s=r>i?1:-1;else for(n=s=0;n<r;n++)if(e[n]!=t[n]){s=e[n]>t[n]?1:-1;break}return s}function r(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r]<t[r]?1:0,e[r]=n*i+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(i,n,s,o,a){var d,l,h,f,y,g,v,_,b,T,E,w,S,A,R,O,I,x=i.s==n.s?1:-1,C=i.c,M=n.c;if(!(C&&C[0]&&M&&M[0]))return new G(i.s&&n.s&&(C?!M||C[0]!=M[0]:M)?C&&0==C[0]||!M?0*x:x/0:NaN);for(b=(_=new G(x)).c=[],x=s+(l=i.e-n.e)+1,a||(a=p,l=m(i.e/c)-m(n.e/c),x=x/c|0),h=0;M[h]==(C[h]||0);h++);if(M[h]>(C[h]||0)&&l--,x<0)b.push(1),f=!0;else{for(A=C.length,O=M.length,h=0,x+=2,(y=u(a/(M[0]+1)))>1&&(M=e(M,y,a),C=e(C,y,a),O=M.length,A=C.length),S=O,E=(T=C.slice(0,O)).length;E<O;T[E++]=0);I=M.slice(),I=[0].concat(I),R=M[0],M[1]>=a/2&&R++;do{if(y=0,(d=t(M,T,O,E))<0){if(w=T[0],O!=E&&(w=w*a+(T[1]||0)),(y=u(w/R))>1)for(y>=a&&(y=a-1),v=(g=e(M,y,a)).length,E=T.length;1==t(g,T,v,E);)y--,r(g,O<v?I:M,v,a),v=g.length,d=1;else 0==y&&(d=y=1),v=(g=M.slice()).length;if(v<E&&(g=[0].concat(g)),r(T,g,E,a),E=T.length,-1==d)for(;t(M,T,O,E)<1;)y++,r(T,O<E?I:M,E,a),E=T.length}else 0===d&&(y++,T=[0]);b[h++]=y,T[0]?T[E++]=C[S]||0:(T=[C[S]],E=1)}while((S++<A||null!=T[0])&&x--);f=null!=T[0],b[0]||b.splice(0,1)}if(a==p){for(h=1,x=b[0];x>=10;x/=10,h++);X(_,s+(_.e=h+l*c-1)+1,o,f)}else _.e=l,_.r=+f;return _}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,R=/^([^.]+)\.$/,O=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,i){var n,s=r?t:t.replace(x,"");if(I.test(s))e.s=isNaN(s)?null:s<0?-1:1;else{if(!r&&(s=s.replace(A,(function(e,t,r){return n="x"==(r=r.toLowerCase())?16:"b"==r?2:8,i&&i!=n?e:t})),i&&(n=i,s=s.replace(R,"$1").replace(O,"0.$1")),t!=s))return new G(s,n);if(G.DEBUG)throw Error(d+"Not a"+(i?" base "+i:"")+" number: "+t);e.s=null}e.c=e.e=null},C.absoluteValue=C.abs=function(){var e=new G(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return _(this,new G(e,t))},C.decimalPlaces=C.dp=function(e,t){var r,i,n,s=this;if(null!=e)return b(e,0,g),null==t?t=N:b(t,0,8),X(new G(s),e+s.e+1,t);if(!(r=s.c))return null;if(i=((n=r.length-1)-m(this.e/c))*c,n=r[n])for(;n%10==0;n/=10,i--);return i<0&&(i=0),i},C.dividedBy=C.div=function(e,t){return r(this,new G(e,t),k,N)},C.dividedToIntegerBy=C.idiv=function(e,t){return r(this,new G(e,t),0,1)},C.exponentiatedBy=C.pow=function(e,t){var r,i,n,s,o,l,p,h,f=this;if((e=new G(e)).c&&!e.isInteger())throw Error(d+"Exponent not an integer: "+K(e));if(null!=t&&(t=new G(t)),o=e.e>14,!f.c||!f.c[0]||1==f.c[0]&&!f.e&&1==f.c.length||!e.c||!e.c[0])return h=new G(Math.pow(+K(f),o?2-T(e):+K(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new G(NaN);(i=!l&&f.isInteger()&&t.isInteger())&&(f=f.mod(t))}else{if(e.e>9&&(f.e>0||f.e<-1||(0==f.e?f.c[0]>1||o&&f.c[1]>=24e7:f.c[0]<8e13||o&&f.c[0]<=9999975e7)))return s=f.s<0&&T(e)?-0:0,f.e>-1&&(s=1/s),new G(l?1/s:s);j&&(s=a(j/c+2))}for(o?(r=new G(.5),l&&(e.s=1),p=T(e)):p=(n=Math.abs(+K(e)))%2,h=new G(M);;){if(p){if(!(h=h.times(f)).c)break;s?h.c.length>s&&(h.c.length=s):i&&(h=h.mod(t))}if(n){if(0===(n=u(n/2)))break;p=n%2}else if(X(e=e.times(r),e.e+1,1),e.e>14)p=T(e);else{if(0==(n=+K(e)))break;p=n%2}f=f.times(f),s?f.c&&f.c.length>s&&(f.c.length=s):i&&(f=f.mod(t))}return i?h:(l&&(h=M.div(h)),t?h.mod(t):s?X(h,j,N,void 0):h)},C.integerValue=function(e){var t=new G(this);return null==e?e=N:b(e,0,8),X(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return 0===_(this,new G(e,t))},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return _(this,new G(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return 1===(t=_(this,new G(e,t)))||0===t},C.isInteger=function(){return!!this.c&&m(this.e/c)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return _(this,new G(e,t))<0},C.isLessThanOrEqualTo=C.lte=function(e,t){return-1===(t=_(this,new G(e,t)))||0===t},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.minus=function(e,t){var r,i,n,s,o=this,a=o.s;if(t=(e=new G(e,t)).s,!a||!t)return new G(NaN);if(a!=t)return e.s=-t,o.plus(e);var u=o.e/c,d=e.e/c,l=o.c,h=e.c;if(!u||!d){if(!l||!h)return l?(e.s=-t,e):new G(h?o:NaN);if(!l[0]||!h[0])return h[0]?(e.s=-t,e):new G(l[0]?o:3==N?-0:0)}if(u=m(u),d=m(d),l=l.slice(),a=u-d){for((s=a<0)?(a=-a,n=l):(d=u,n=h),n.reverse(),t=a;t--;n.push(0));n.reverse()}else for(i=(s=(a=l.length)<(t=h.length))?a:t,a=t=0;t<i;t++)if(l[t]!=h[t]){s=l[t]<h[t];break}if(s&&(n=l,l=h,h=n,e.s=-e.s),(t=(i=h.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=p-1;i>a;){if(l[--i]<h[i]){for(r=i;r&&!l[--r];l[r]=t);--l[r],l[i]+=p}l[i]-=h[i]}for(;0==l[0];l.splice(0,1),--d);return l[0]?V(e,l,d):(e.s=3==N?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,t){var i,n,s=this;return e=new G(e,t),!s.c||!e.s||e.c&&!e.c[0]?new G(NaN):!e.c||s.c&&!s.c[0]?new G(s):(9==F?(n=e.s,e.s=1,i=r(s,e,0,3),e.s=n,i.s*=n):i=r(s,e,0,F),(e=s.minus(i.times(e))).c[0]||1!=F||(e.s=s.s),e)},C.multipliedBy=C.times=function(e,t){var r,i,n,s,o,a,u,d,l,h,f,g,v,_,b,T=this,E=T.c,w=(e=new G(e,t)).c;if(!(E&&w&&E[0]&&w[0]))return!T.s||!e.s||E&&!E[0]&&!w||w&&!w[0]&&!E?e.c=e.e=e.s=null:(e.s*=T.s,E&&w?(e.c=[0],e.e=0):e.c=e.e=null),e;for(i=m(T.e/c)+m(e.e/c),e.s*=T.s,(u=E.length)<(h=w.length)&&(v=E,E=w,w=v,n=u,u=h,h=n),n=u+h,v=[];n--;v.push(0));for(_=p,b=y,n=h;--n>=0;){for(r=0,f=w[n]%b,g=w[n]/b|0,s=n+(o=u);s>n;)r=((d=f*(d=E[--o]%b)+(a=g*d+(l=E[o]/b|0)*f)%b*b+v[s]+r)/_|0)+(a/b|0)+g*l,v[s--]=d%_;v[s]=r}return r?++i:v.splice(0,1),V(e,v,i)},C.negated=function(){var e=new G(this);return e.s=-e.s||null,e},C.plus=function(e,t){var r,i=this,n=i.s;if(t=(e=new G(e,t)).s,!n||!t)return new G(NaN);if(n!=t)return e.s=-t,i.minus(e);var s=i.e/c,o=e.e/c,a=i.c,u=e.c;if(!s||!o){if(!a||!u)return new G(n/0);if(!a[0]||!u[0])return u[0]?e:new G(a[0]?i:0*n)}if(s=m(s),o=m(o),a=a.slice(),n=s-o){for(n>0?(o=s,r=u):(n=-n,r=a),r.reverse();n--;r.push(0));r.reverse()}for((n=a.length)-(t=u.length)<0&&(r=u,u=a,a=r,t=n),n=0;t;)n=(a[--t]=a[t]+u[t]+n)/p|0,a[t]=p===a[t]?0:a[t]%p;return n&&(a=[n].concat(a),++o),V(e,a,o)},C.precision=C.sd=function(e,t){var r,i,n,s=this;if(null!=e&&e!==!!e)return b(e,1,g),null==t?t=N:b(t,0,8),X(new G(s),e,t);if(!(r=s.c))return null;if(i=(n=r.length-1)*c+1,n=r[n]){for(;n%10==0;n/=10,i--);for(n=r[0];n>=10;n/=10,i++);}return e&&s.e+1>i&&(i=s.e+1),i},C.shiftedBy=function(e){return b(e,-9007199254740991,h),this.times("1e"+e)},C.squareRoot=C.sqrt=function(){var e,t,i,n,s,o=this,a=o.c,u=o.s,d=o.e,l=k+4,p=new G("0.5");if(1!==u||!a||!a[0])return new G(!u||u<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(u=Math.sqrt(+K(o)))||u==1/0?(((t=v(a)).length+d)%2==0&&(t+="0"),u=Math.sqrt(+t),d=m((d+1)/2)-(d<0||d%2),i=new G(t=u==1/0?"5e"+d:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+d)):i=new G(u+""),i.c[0])for((u=(d=i.e)+l)<3&&(u=0);;)if(s=i,i=p.times(s.plus(r(o,s,l,1))),v(s.c).slice(0,u)===(t=v(i.c)).slice(0,u)){if(i.e<d&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(n||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(X(i,i.e+k+2,1),e=!i.times(i).eq(o));break}if(!n&&(X(s,s.e+k+2,0),s.times(s).eq(o))){i=s;break}l+=4,u+=4,n=1}return X(i,i.e+k+1,N,e)},C.toExponential=function(e,t){return null!=e&&(b(e,0,g),e++),z(this,e,t,1)},C.toFixed=function(e,t){return null!=e&&(b(e,0,g),e=e+this.e+1),z(this,e,t)},C.toFormat=function(e,t,r){var i,n=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=U;else if("object"!=typeof r)throw Error(d+"Argument not an object: "+r);if(i=n.toFixed(e,t),n.c){var s,o=i.split("."),a=+r.groupSize,u=+r.secondaryGroupSize,l=r.groupSeparator||"",p=o[0],c=o[1],h=n.s<0,f=h?p.slice(1):p,y=f.length;if(u&&(s=a,a=u,u=s,y-=s),a>0&&y>0){for(s=y%a||a,p=f.substr(0,s);s<y;s+=a)p+=l+f.substr(s,a);u>0&&(p+=l+f.slice(s)),h&&(p="-"+p)}i=c?p+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?c.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):c):p}return(r.prefix||"")+i+(r.suffix||"")},C.toFraction=function(e){var t,i,n,s,o,a,u,l,p,h,y,g,m=this,_=m.c;if(null!=e&&(!(u=new G(e)).isInteger()&&(u.c||1!==u.s)||u.lt(M)))throw Error(d+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+K(u));if(!_)return new G(m);for(t=new G(M),p=i=new G(M),n=l=new G(M),g=v(_),o=t.e=g.length-m.e-1,t.c[0]=f[(a=o%c)<0?c+a:a],e=!e||u.comparedTo(t)>0?o>0?t:p:u,a=L,L=1/0,u=new G(g),l.c[0]=0;h=r(u,t,0,1),1!=(s=i.plus(h.times(n))).comparedTo(e);)i=n,n=s,p=l.plus(h.times(s=p)),l=s,t=u.minus(h.times(s=t)),u=s;return s=r(e.minus(i),n,0,1),l=l.plus(s.times(p)),i=i.plus(s.times(n)),l.s=p.s=m.s,y=r(p,n,o*=2,N).minus(m).abs().comparedTo(r(l,i,o,N).minus(m).abs())<1?[p,n]:[l,i],L=a,y},C.toNumber=function(){return+K(this)},C.toPrecision=function(e,t){return null!=e&&b(e,1,g),z(this,e,t,2)},C.toString=function(e){var t,r=this,n=r.s,s=r.e;return null===s?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=s<=D||s>=P?E(v(r.c),s):w(v(r.c),s,"0"):10===e&&$?t=w(v((r=X(new G(r),k+s+1,N)).c),r.e,"0"):(b(e,2,H.length,"Base"),t=i(w(v(r.c),s,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},C.valueOf=C.toJSON=function(){return K(this)},C._isBigNumber=!0,null!=t&&G.set(t),G}(),s.default=s.BigNumber=s,void 0===(i=function(){return s}.call(t,r,t,e))||(e.exports=i)}()},8834:(e,t,r)=>{"use strict";var i=r(5766),n=r(2333),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;var o=2147483647;function a(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(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 p(e)}return d(e,t,r)}function d(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|y(e,t),i=a(r),n=i.write(e,t);return n!==r&&(i=i.slice(0,n)),i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(U(e,Uint8Array)){var t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(U(e,ArrayBuffer)||e&&U(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(U(e,SharedArrayBuffer)||e&&U(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return u.from(i,t,r);var n=function(e){if(u.isBuffer(e)){var t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||H(e.length)?a(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.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 l(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 p(e){return l(e),a(e<0?0:0|f(e))}function c(e){for(var t=e.length<0?0:0|f(e.length),r=a(t),i=0;i<t;i+=1)r[i]=255&e[i];return r}function h(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 i;return i=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(i,u.prototype),i}function f(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||U(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,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(e).length;default:if(n)return i?-1:B(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var i=!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 C(this,t,r);case"utf8":case"utf-8":return R(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function m(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function v(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=u.from(t,i)),u.isBuffer(t))return 0===t.length?-1:_(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):_(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function _(e,t,r,i,n){var s,o=1,a=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,a/=2,u/=2,r/=2}function d(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var l=-1;for(s=r;s<a;s++)if(d(e,s)===d(t,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===u)return l*o}else-1!==l&&(s-=s-l),l=-1}else for(r+u>a&&(r=a-u),s=r;s>=0;s--){for(var p=!0,c=0;c<u;c++)if(d(e,s+c)!==d(t,c)){p=!1;break}if(p)return s}return-1}function b(e,t,r,i){r=Number(r)||0;var n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;var s=t.length;i>s/2&&(i=s/2);for(var o=0;o<i;++o){var a=parseInt(t.substr(2*o,2),16);if(H(a))return o;e[r+o]=a}return o}function T(e,t,r,i){return j(B(t,e.length-r),e,r,i)}function E(e,t,r,i){return j(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function w(e,t,r,i){return j(F(t),e,r,i)}function S(e,t,r,i){return j(function(e,t){for(var r,i,n,s=[],o=0;o<e.length&&!((t-=2)<0);++o)i=(r=e.charCodeAt(o))>>8,n=r%256,s.push(n),s.push(i);return s}(t,e.length-r),e,r,i)}function A(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function R(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n<r;){var s,o,a,u,d=e[n],l=null,p=d>239?4:d>223?3:d>191?2:1;if(n+p<=r)switch(p){case 1:d<128&&(l=d);break;case 2:128==(192&(s=e[n+1]))&&(u=(31&d)<<6|63&s)>127&&(l=u);break;case 3:s=e[n+1],o=e[n+2],128==(192&s)&&128==(192&o)&&(u=(15&d)<<12|(63&s)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:s=e[n+1],o=e[n+2],a=e[n+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(u=(15&d)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,p=1):l>65535&&(l-=65536,i.push(l>>>10&1023|55296),l=56320|1023&l),i.push(l),n+=p}return function(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);for(var r="",i=0;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=O));return r}(i)}t.kMaxLength=o,u.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.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(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return d(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return p(e)},u.allocUnsafeSlow=function(e){return p(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(U(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),U(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.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,i=t.length,n=0,s=Math.min(r,i);n<s;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},u.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}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var i=u.allocUnsafe(t),n=0;for(r=0;r<e.length;++r){var s=e[r];if(U(s,Uint8Array))n+s.length>i.length?u.from(s).copy(i,n):Uint8Array.prototype.set.call(i,s,n);else{if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,n)}n+=s.length}return i},u.byteLength=y,u.prototype._isBuffer=!0,u.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)m(this,t,t+1);return this},u.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)m(this,t,t+3),m(this,t+1,t+2);return this},u.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)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?R(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(u.prototype[s]=u.prototype.inspect),u.prototype.compare=function(e,t,r,i,n){if(U(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.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===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(this===e)return 0;for(var s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0),a=Math.min(s,o),d=this.slice(i,n),l=e.slice(t,r),p=0;p<a;++p)if(d[p]!==l[p]){s=d[p],o=l[p];break}return s<o?-1:o<s?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},u.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=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===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return T(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function I(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;n<r;++n)i+=String.fromCharCode(127&e[n]);return i}function x(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function C(e,t,r){var i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var n="",s=t;s<r;++s)n+=$[e[s]];return n}function M(e,t,r){for(var i=e.slice(t,r),n="",s=0;s<i.length-1;s+=2)n+=String.fromCharCode(i[s]+256*i[s+1]);return n}function k(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 N(e,t,r,i,n,s){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<s)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function D(e,t,r,i,n,s){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(e,t,r,i,s){return t=+t,r>>>=0,s||D(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function q(e,t,r,i,s){return t=+t,r>>>=0,s||D(e,0,r,8),n.write(e,t,r,i,52,8),r+8}u.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 i=this.subarray(e,t);return Object.setPrototypeOf(i,u.prototype),i},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);for(var i=this[e],n=1,s=0;++s<t&&(n*=256);)i+=this[e+s]*n;return i},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);for(var i=this[e+--t],n=1;t>0&&(n*=256);)i+=this[e+--t]*n;return i},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);for(var i=this[e],n=1,s=0;++s<t&&(n*=256);)i+=this[e+s]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);for(var i=t,n=1,s=this[e+--i];i>0&&(n*=256);)s+=this[e+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*t)),s},u.prototype.readInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||k(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||k(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||k(e,4,this.length),n.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||k(e,4,this.length),n.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||k(e,8,this.length),n.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||k(e,8,this.length),n.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||N(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[t]=255&e;++s<r&&(n*=256);)this[t+s]=e/n&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||N(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,s=1;for(this[t+n]=255&e;--n>=0&&(s*=256);)this[t+n]=e/s&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(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},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(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},u.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}var s=0,o=1,a=0;for(this[t]=255&e;++s<r&&(o*=256);)e<0&&0===a&&0!==this[t+s-1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}var s=r-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(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},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(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},u.prototype.writeFloatLE=function(e,t,r){return P(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return P(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return q(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return q(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,i){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);var n=i-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,i):Uint8Array.prototype.set.call(e,this.subarray(r,i),t),n},u.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var n=e.charCodeAt(0);("utf8"===i&&n<128||"latin1"===i)&&(e=n)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var s;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{var o=u.isBuffer(e)?e:u.from(e,i),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-t;++s)this[s+t]=o[s%a]}return this};var L=/[^+/0-9A-Za-z-_]/g;function B(e,t){var r;t=t||1/0;for(var i=e.length,n=null,s=[],o=0;o<i;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.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;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function F(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,i){for(var n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function U(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!=e}var $=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()},9396:function(e,t,r){var i,n,s;n=[r(6874)],i=function(e){"use strict";var t=function(e,r,n){if(void 0===e&&(e=t.DEFAULT_CAPACITY),void 0===r&&(r=t.DEFAULT_ENDIAN),void 0===n&&(n=t.DEFAULT_NOASSERT),!n){if((e|=0)<0)throw RangeError("Illegal capacity");r=!!r,n=!!n}this.buffer=0===e?i:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=r,this.noAssert=n};t.VERSION="5.0.1",t.LITTLE_ENDIAN=!0,t.BIG_ENDIAN=!1,t.DEFAULT_CAPACITY=16,t.DEFAULT_ENDIAN=t.BIG_ENDIAN,t.DEFAULT_NOASSERT=!1,t.Long=e||null;var r=t.prototype;r.__isByteBuffer__,Object.defineProperty(r,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var i=new ArrayBuffer(0),n=String.fromCharCode;function s(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function o(){var e=[],t=[];return function(){if(0===arguments.length)return t.join("")+n.apply(String,e);e.length+arguments.length>1024&&(t.push(n.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}function a(e,t,r,i,n){var s,o,a=8*n-i-1,u=(1<<a)-1,d=u>>1,l=-7,p=r?n-1:0,c=r?-1:1,h=e[t+p];for(p+=c,s=h&(1<<-l)-1,h>>=-l,l+=a;l>0;s=256*s+e[t+p],p+=c,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=i;l>0;o=256*o+e[t+p],p+=c,l-=8);if(0===s)s=1-d;else{if(s===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,i),s-=d}return(h?-1:1)*o*Math.pow(2,s-i)}function u(e,t,r,i,n,s){var o,a,u,d=8*s-n-1,l=(1<<d)-1,p=l>>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:s-1,f=i?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+p>=1?c/u:c*Math.pow(2,1-p))*u>=2&&(o++,u/=2),o+p>=l?(a=0,o=l):o+p>=1?(a=(t*u-1)*Math.pow(2,n),o+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,n),o=0));n>=8;e[r+h]=255&a,h+=f,a/=256,n-=8);for(o=o<<n|a,d+=n;d>0;e[r+h]=255&o,h+=f,o/=256,d-=8);e[r+h-f]|=128*y}t.accessor=function(){return Uint8Array},t.allocate=function(e,r,i){return new t(e,r,i)},t.concat=function(e,r,i,n){"boolean"!=typeof r&&"string"==typeof r||(n=i,i=r,r=void 0);for(var s,o=0,a=0,u=e.length;a<u;++a)t.isByteBuffer(e[a])||(e[a]=t.wrap(e[a],r)),(s=e[a].limit-e[a].offset)>0&&(o+=s);if(0===o)return new t(0,i,n);var d,l=new t(o,i,n);for(a=0;a<u;)(s=(d=e[a++]).limit-d.offset)<=0||(l.view.set(d.view.subarray(d.offset,d.limit),l.offset),l.offset+=s);return l.limit=l.offset,l.offset=0,l},t.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},t.type=function(){return ArrayBuffer},t.wrap=function(e,i,n,s){if("string"!=typeof i&&(s=n,n=i,i=void 0),"string"==typeof e)switch(void 0===i&&(i="utf8"),i){case"base64":return t.fromBase64(e,n);case"hex":return t.fromHex(e,n);case"binary":return t.fromBinary(e,n);case"utf8":return t.fromUTF8(e,n);case"debug":return t.fromDebug(e,n);default:throw Error("Unsupported encoding: "+i)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var o;if(t.isByteBuffer(e))return(o=r.clone.call(e)).markedOffset=-1,o;if(e instanceof Uint8Array)o=new t(0,n,s),e.length>0&&(o.buffer=e.buffer,o.offset=e.byteOffset,o.limit=e.byteOffset+e.byteLength,o.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)o=new t(0,n,s),e.byteLength>0&&(o.buffer=e,o.offset=0,o.limit=e.byteLength,o.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");(o=new t(e.length,n,s)).limit=e.length;for(var a=0;a<e.length;++a)o.view[a]=e[a]}return o},r.writeBitSet=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i,n=t,s=e.length,o=s>>3,a=0;for(t+=this.writeVarint32(s,t);o--;)i=1&!!e[a++]|(1&!!e[a++])<<1|(1&!!e[a++])<<2|(1&!!e[a++])<<3|(1&!!e[a++])<<4|(1&!!e[a++])<<5|(1&!!e[a++])<<6|(1&!!e[a++])<<7,this.writeByte(i,t++);if(a<s){var u=0;for(i=0;a<s;)i|=(1&!!e[a++])<<u++;this.writeByte(i,t++)}return r?(this.offset=t,this):t-n},r.readBitSet=function(e){var t=void 0===e;t&&(e=this.offset);var r,i=this.readVarint32(e),n=i.value,s=n>>3,o=0,a=[];for(e+=i.length;s--;)r=this.readByte(e++),a[o++]=!!(1&r),a[o++]=!!(2&r),a[o++]=!!(4&r),a[o++]=!!(8&r),a[o++]=!!(16&r),a[o++]=!!(32&r),a[o++]=!!(64&r),a[o++]=!!(128&r);if(o<n){var u=0;for(r=this.readByte(e++);o<n;)a[o++]=!!(r>>u++&1)}return t&&(this.offset=e),a},r.readBytes=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}var i=this.slice(t,t+e);return r&&(this.offset+=e),i},r.writeBytes=r.append,r.writeInt8=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeByte=r.writeInt8,r.readInt8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=this.view[e];return 128==(128&r)&&(r=-(255-r+1)),t&&(this.offset+=1),r},r.readByte=r.readInt8,r.writeUint8=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeUInt8=r.writeUint8,r.readUint8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=this.view[e];return t&&(this.offset+=1),r},r.readUInt8=r.readUint8,r.writeInt16=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},r.writeShort=r.writeInt16,r.readInt16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),32768==(32768&r)&&(r=-(65535-r+1)),t&&(this.offset+=2),r},r.readShort=r.readInt16,r.writeUint16=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},r.writeUInt16=r.writeUint16,r.readUint16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),t&&(this.offset+=2),r},r.readUInt16=r.readUint16,r.writeInt32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeInt=r.writeInt32,r.readInt32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),r|=0,t&&(this.offset+=4),r},r.readInt=r.readInt32,r.writeUint32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeUInt32=r.writeUint32,r.readUint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),t&&(this.offset+=4),r},r.readUInt32=r.readUint32,e&&(r.writeInt64=function(t,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var n=this.buffer.byteLength;r>n&&this.resize((n*=2)>r?n:r),r-=8;var s=t.low,o=t.high;return this.littleEndian?(this.view[r+3]=s>>>24&255,this.view[r+2]=s>>>16&255,this.view[r+1]=s>>>8&255,this.view[r]=255&s,r+=4,this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o):(this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o,r+=4,this.view[r]=s>>>24&255,this.view[r+1]=s>>>16&255,this.view[r+2]=s>>>8&255,this.view[r+3]=255&s),i&&(this.offset+=8),this},r.writeLong=r.writeInt64,r.readInt64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var i=0,n=0;this.littleEndian?(i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0,t+=4,n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0,t+=4,i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0);var s=new e(i,n,!1);return r&&(this.offset+=8),s},r.readLong=r.readInt64,r.writeUint64=function(t,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var n=this.buffer.byteLength;r>n&&this.resize((n*=2)>r?n:r),r-=8;var s=t.low,o=t.high;return this.littleEndian?(this.view[r+3]=s>>>24&255,this.view[r+2]=s>>>16&255,this.view[r+1]=s>>>8&255,this.view[r]=255&s,r+=4,this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o):(this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o,r+=4,this.view[r]=s>>>24&255,this.view[r+1]=s>>>16&255,this.view[r+2]=s>>>8&255,this.view[r+3]=255&s),i&&(this.offset+=8),this},r.writeUInt64=r.writeUint64,r.readUint64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var i=0,n=0;this.littleEndian?(i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0,t+=4,n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0,t+=4,i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0);var s=new e(i,n,!0);return r&&(this.offset+=8),s},r.readUInt64=r.readUint64),r.writeFloat32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=4,u(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},r.writeFloat=r.writeFloat32,r.readFloat32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=a(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),r},r.readFloat=r.readFloat32,r.writeFloat64=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=8;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=8,u(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},r.writeDouble=r.writeFloat64,r.readFloat64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var r=a(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),r},r.readDouble=r.readFloat64,t.MAX_VARINT32_BYTES=5,t.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},t.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},t.zigZagDecode32=function(e){return e>>>1^-(1&e)|0},r.writeVarint32=function(e,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var n,s=t.calculateVarint32(e);r+=s;var o=this.buffer.byteLength;for(r>o&&this.resize((o*=2)>r?o:r),r-=s,e>>>=0;e>=128;)n=127&e|128,this.view[r++]=n,e>>>=7;return this.view[r++]=e,i?(this.offset=r,this):s},r.writeVarint32ZigZag=function(e,r){return this.writeVarint32(t.zigZagEncode32(e),r)},r.readVarint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,i=0,n=0;do{if(!this.noAssert&&e>this.limit){var s=Error("Truncated");throw s.truncated=!0,s}r=this.view[e++],i<5&&(n|=(127&r)<<7*i),++i}while(0!=(128&r));return n|=0,t?(this.offset=e,n):{value:n,length:i}},r.readVarint32ZigZag=function(e){var r=this.readVarint32(e);return"object"==typeof r?r.value=t.zigZagDecode32(r.value):r=t.zigZagDecode32(r),r},e&&(t.MAX_VARINT64_BYTES=10,t.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var r=t.toInt()>>>0,i=t.shiftRightUnsigned(28).toInt()>>>0,n=t.shiftRightUnsigned(56).toInt()>>>0;return 0==n?0==i?r<16384?r<128?1:2:r<1<<21?3:4:i<16384?i<128?5:6:i<1<<21?7:8:n<128?9:10},t.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},t.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},r.writeVarint64=function(r,i){var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"==typeof r)r=e.fromNumber(r);else if("string"==typeof r)r=e.fromString(r);else if(!(r&&r instanceof e))throw TypeError("Illegal value: "+r+" (not an integer or Long)");if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}"number"==typeof r?r=e.fromNumber(r,!1):"string"==typeof r?r=e.fromString(r,!1):!1!==r.unsigned&&(r=r.toSigned());var s=t.calculateVarint64(r),o=r.toInt()>>>0,a=r.shiftRightUnsigned(28).toInt()>>>0,u=r.shiftRightUnsigned(56).toInt()>>>0;i+=s;var d=this.buffer.byteLength;switch(i>d&&this.resize((d*=2)>i?d:i),i-=s,s){case 10:this.view[i+9]=u>>>7&1;case 9:this.view[i+8]=9!==s?128|u:127&u;case 8:this.view[i+7]=8!==s?a>>>21|128:a>>>21&127;case 7:this.view[i+6]=7!==s?a>>>14|128:a>>>14&127;case 6:this.view[i+5]=6!==s?a>>>7|128:a>>>7&127;case 5:this.view[i+4]=5!==s?128|a:127&a;case 4:this.view[i+3]=4!==s?o>>>21|128:o>>>21&127;case 3:this.view[i+2]=3!==s?o>>>14|128:o>>>14&127;case 2:this.view[i+1]=2!==s?o>>>7|128:o>>>7&127;case 1:this.view[i]=1!==s?128|o:127&o}return n?(this.offset+=s,this):s},r.writeVarint64ZigZag=function(e,r){return this.writeVarint64(t.zigZagEncode64(e),r)},r.readVarint64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var i=t,n=0,s=0,o=0,a=0;if(n=127&(a=this.view[t++]),128&a&&(n|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(n|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(n|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(s=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(o=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[t++]))<<7,128&a||this.noAssert&&void 0===a))))))))))throw Error("Buffer overrun");var u=e.fromBits(n|s<<28,s>>>4|o<<24,!1);return r?(this.offset=t,u):{value:u,length:t-i}},r.readVarint64ZigZag=function(r){var i=this.readVarint64(r);return i&&i.value instanceof e?i.value=t.zigZagDecode64(i.value):i=t.zigZagDecode64(i),i}),r.writeCString=function(e,t){var r=void 0===t;r&&(t=this.offset);var i,n=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(i=0;i<n;++i)if(0===e.charCodeAt(i))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}n=l.calculateUTF16asUTF8(s(e))[1],t+=n+1;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=n+1,l.encodeUTF16toUTF8(s(e),function(e){this.view[t++]=e}.bind(this)),this.view[t++]=0,r?(this.offset=t,this):n},r.readCString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,i=e,n=-1;return l.decodeUTF8toUTF16(function(){if(0===n)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(n=this.view[e++])?null:n}.bind(this),r=o(),!0),t?(this.offset=e,r()):{string:r(),length:e-i}},r.writeIString=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i,n=t;i=l.calculateUTF16asUTF8(s(e),this.noAssert)[1],t+=4+i;var o=this.buffer.byteLength;if(t>o&&this.resize((o*=2)>t?o:t),t-=4+i,this.littleEndian?(this.view[t+3]=i>>>24&255,this.view[t+2]=i>>>16&255,this.view[t+1]=i>>>8&255,this.view[t]=255&i):(this.view[t]=i>>>24&255,this.view[t+1]=i>>>16&255,this.view[t+2]=i>>>8&255,this.view[t+3]=255&i),t+=4,l.encodeUTF16toUTF8(s(e),function(e){this.view[t++]=e}.bind(this)),t!==n+4+i)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+i));return r?(this.offset=t,this):t-n},r.readIString=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var i=e,n=this.readUint32(e),s=this.readUTF8String(n,t.METRICS_BYTES,e+=4);return e+=s.length,r?(this.offset=e,s.string):{string:s.string,length:e-i}},t.METRICS_CHARS="c",t.METRICS_BYTES="b",r.writeUTF8String=function(e,t){var r,i=void 0===t;if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var n=t;r=l.calculateUTF16asUTF8(s(e))[1],t+=r;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=r,l.encodeUTF16toUTF8(s(e),function(e){this.view[t++]=e}.bind(this)),i?(this.offset=t,this):t-n},r.writeString=r.writeUTF8String,t.calculateUTF8Chars=function(e){return l.calculateUTF16asUTF8(s(e))[0]},t.calculateUTF8Bytes=function(e){return l.calculateUTF16asUTF8(s(e))[1]},t.calculateString=t.calculateUTF8Bytes,r.readUTF8String=function(e,r,i){"number"==typeof r&&(i=r,r=void 0);var n=void 0===i;if(n&&(i=this.offset),void 0===r&&(r=t.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}var s,a=0,u=i;if(r===t.METRICS_CHARS){if(s=o(),l.decodeUTF8(function(){return a<e&&i<this.limit?this.view[i++]:null}.bind(this),(function(e){++a,l.UTF8toUTF16(e,s)})),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return n?(this.offset=i,s()):{string:s(),length:i-u}}if(r===t.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+"+e+") <= "+this.buffer.byteLength)}var d=i+e;if(l.decodeUTF8toUTF16(function(){return i<d?this.view[i++]:null}.bind(this),s=o(),this.noAssert),i!==d)throw RangeError("Illegal range: Truncated data, "+i+" == "+d);return n?(this.offset=i,s()):{string:s(),length:i-u}}throw TypeError("Unsupported metrics: "+r)},r.readString=r.readUTF8String,r.writeVString=function(e,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var n,o,a=r;n=l.calculateUTF16asUTF8(s(e),this.noAssert)[1],o=t.calculateVarint32(n),r+=o+n;var u=this.buffer.byteLength;if(r>u&&this.resize((u*=2)>r?u:r),r-=o+n,r+=this.writeVarint32(n,r),l.encodeUTF16toUTF8(s(e),function(e){this.view[r++]=e}.bind(this)),r!==a+n+o)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+n+o));return i?(this.offset=r,this):r-a},r.readVString=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var i=e,n=this.readVarint32(e),s=this.readUTF8String(n.value,t.METRICS_BYTES,e+=n.length);return e+=s.length,r?(this.offset=e,s.string):{string:s.string,length:e-i}},r.append=function(e,r,i){"number"!=typeof r&&"string"==typeof r||(i=r,r=void 0);var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var s=e.limit-e.offset;if(s<=0)return this;i+=s;var o=this.buffer.byteLength;return i>o&&this.resize((o*=2)>i?o:i),i-=s,this.view.set(e.view.subarray(e.offset,e.limit),i),e.offset+=s,n&&(this.offset+=s),this},r.appendTo=function(e,t){return e.append(this,t),this},r.assert=function(e){return this.noAssert=!e,this},r.capacity=function(){return this.buffer.byteLength},r.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},r.clone=function(e){var r=new t(0,this.littleEndian,this.noAssert);return e?(r.buffer=new ArrayBuffer(this.buffer.byteLength),r.view=new Uint8Array(r.buffer)):(r.buffer=this.buffer,r.view=this.view),r.offset=this.offset,r.markedOffset=this.markedOffset,r.limit=this.limit,r},r.compact=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var r=t-e;if(0===r)return this.buffer=i,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var n=new ArrayBuffer(r),s=new Uint8Array(n);return s.set(this.view.subarray(e,t)),this.buffer=n,this.view=s,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=r,this},r.copy=function(e,r){if(void 0===e&&(e=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,e<0||e>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+r+" <= "+this.buffer.byteLength)}if(e===r)return new t(0,this.littleEndian,this.noAssert);var i=r-e,n=new t(i,this.littleEndian,this.noAssert);return n.offset=0,n.limit=i,n.markedOffset>=0&&(n.markedOffset-=e),this.copyTo(n,0,e,r),n},r.copyTo=function(e,r,i,n){var s,o;if(!this.noAssert&&!t.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(r=(o=void 0===r)?e.offset:0|r,i=(s=void 0===i)?this.offset:0|i,n=void 0===n?this.limit:0|n,r<0||r>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+r+" <= "+e.buffer.byteLength);if(i<0||n>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+i+" <= "+this.buffer.byteLength);var a=n-i;return 0===a?e:(e.ensureCapacity(r+a),e.view.set(this.view.subarray(i,n),r),s&&(this.offset+=a),o&&(e.offset+=a),this)},r.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},r.fill=function(e,t,r){var i=void 0===t;if(i&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t>=r)return this;for(;t<r;)this.view[t++]=e;return i&&(this.offset=t),this},r.flip=function(){return this.limit=this.offset,this.offset=0,this},r.mark=function(e){if(e=void 0===e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},r.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},r.LE=function(e){return this.littleEndian=void 0===e||!!e,this},r.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},r.prepend=function(e,r,i){"number"!=typeof r&&"string"==typeof r||(i=r,r=void 0);var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var s=e.limit-e.offset;if(s<=0)return this;var o=s-i;if(o>0){var a=new ArrayBuffer(this.buffer.byteLength+o),u=new Uint8Array(a);u.set(this.view.subarray(i,this.buffer.byteLength),s),this.buffer=a,this.view=u,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,i+=o}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),i-s),e.offset=e.limit,n&&(this.offset-=s),this},r.prependTo=function(e,t){return e.prepend(this,t),this},r.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},r.remaining=function(){return this.limit-this.offset},r.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},r.resize=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),r=new Uint8Array(t);r.set(this.view),this.buffer=t,this.view=r}return this},r.reverse=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t||Array.prototype.reverse.call(this.view.subarray(e,t)),this},r.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},r.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r=this.clone();return r.offset=e,r.limit=t,r},r.toBuffer=function(e){var t=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(!e&&0===t&&r===this.buffer.byteLength)return this.buffer;if(t===r)return i;var n=new ArrayBuffer(r-t);return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t,r),0),n},r.toArrayBuffer=r.toBuffer,r.toString=function(e,t,r){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(r=t=e="utf8"),e){case"utf8":return this.toUTF8(t,r);case"base64":return this.toBase64(t,r);case"hex":return this.toHex(t,r);case"binary":return this.toBinary(t,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var d=function(){for(var e={},t=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],r=[],i=0,n=t.length;i<n;++i)r[t[i]]=i;return e.encode=function(e,r){for(var i,n;null!==(i=e());)r(t[i>>2&63]),n=(3&i)<<4,null!==(i=e())?(r(t[63&((n|=i>>4&15)|i>>4&15)]),n=(15&i)<<2,null!==(i=e())?(r(t[63&(n|i>>6&3)]),r(t[63&i])):(r(t[63&n]),r(61))):(r(t[63&n]),r(61),r(61))},e.decode=function(e,t){var i,n,s;function o(e){throw Error("Illegal character code: "+e)}for(;null!==(i=e());)if(void 0===(n=r[i])&&o(i),null!==(i=e())&&(void 0===(s=r[i])&&o(i),t(n<<2>>>0|(48&s)>>4),null!==(i=e()))){if(void 0===(n=r[i])){if(61===i)break;o(i)}if(t((15&s)<<4>>>0|(60&n)>>2),null!==(i=e())){if(void 0===(s=r[i])){if(61===i)break;o(i)}t((3&n)<<6>>>0|s)}}},e.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},e}();r.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return d.encode(function(){return e<t?this.view[e++]:null}.bind(this),r=o()),r()},t.fromBase64=function(e,r){if("string"!=typeof e)throw TypeError("str");var i=new t(e.length/4*3,r),n=0;return d.decode(s(e),(function(e){i.view[n++]=e})),i.limit=n,i},t.btoa=function(e){return t.fromBinary(e).toBase64()},t.atob=function(e){return t.fromBase64(e).toBinary()},r.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var r=[],i=[];e<t;)r.push(this.view[e++]),r.length>=1024&&(i.push(String.fromCharCode.apply(String,r)),r=[]);return i.join("")+String.fromCharCode.apply(String,r)},t.fromBinary=function(e,r){if("string"!=typeof e)throw TypeError("str");for(var i,n=0,s=e.length,o=new t(s,r);n<s;){if((i=e.charCodeAt(n))>255)throw RangeError("illegal char code: "+i);o.view[n++]=i}return o.limit=s,o},r.toDebug=function(e){for(var t,r=-1,i=this.buffer.byteLength,n="",s="",o="";r<i;){if(-1!==r&&(n+=(t=this.view[r])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(s+=t>32&&t<127?String.fromCharCode(t):".")),++r,e&&r>0&&r%16==0&&r!==i){for(;n.length<51;)n+=" ";o+=n+s+"\n",n=s=""}r===this.offset&&r===this.limit?n+=r===this.markedOffset?"!":"|":r===this.offset?n+=r===this.markedOffset?"[":"<":r===this.limit?n+=r===this.markedOffset?"]":">":n+=r===this.markedOffset?"'":e||0!==r&&r!==i?" ":""}if(e&&" "!==n){for(;n.length<51;)n+=" ";o+=n+s+"\n"}return e?o:n},t.fromDebug=function(e,r,i){for(var n,s,o=e.length,a=new t((o+1)/3|0,r,i),u=0,d=0,l=!1,p=!1,c=!1,h=!1,f=!1;u<o;){switch(n=e.charAt(u++)){case"!":if(!i){if(p||c||h){f=!0;break}p=c=h=!0}a.offset=a.markedOffset=a.limit=d,l=!1;break;case"|":if(!i){if(p||h){f=!0;break}p=h=!0}a.offset=a.limit=d,l=!1;break;case"[":if(!i){if(p||c){f=!0;break}p=c=!0}a.offset=a.markedOffset=d,l=!1;break;case"<":if(!i){if(p){f=!0;break}p=!0}a.offset=d,l=!1;break;case"]":if(!i){if(h||c){f=!0;break}h=c=!0}a.limit=a.markedOffset=d,l=!1;break;case">":if(!i){if(h){f=!0;break}h=!0}a.limit=d,l=!1;break;case"'":if(!i){if(c){f=!0;break}c=!0}a.markedOffset=d,l=!1;break;case" ":l=!1;break;default:if(!i&&l){f=!0;break}if(s=parseInt(n+e.charAt(u++),16),!i&&(isNaN(s)||s<0||s>255))throw TypeError("Illegal str: Not a debug encoded string");a.view[d++]=s,l=!0}if(f)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!i){if(!p||!h)throw TypeError("Illegal str: Missing offset or limit");if(d<a.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+d+" < "+o)}return a},r.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var r,i=new Array(t-e);e<t;)(r=this.view[e++])<16?i.push("0",r.toString(16)):i.push(r.toString(16));return i.join("")},t.fromHex=function(e,r,i){if(!i){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var n,s=e.length,o=new t(s/2|0,r),a=0,u=0;a<s;a+=2){if(n=parseInt(e.substring(a,a+2),16),!i&&(!isFinite(n)||n<0||n>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[u++]=n}return o.limit=u,o};var l=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<128?t(127&r):r<2048?(t(r>>6&31|192),t(63&r|128)):r<65536?(t(r>>12&15|224),t(r>>6&63|128),t(63&r|128)):(t(r>>18&7|240),t(r>>12&63|128),t(r>>6&63|128),t(63&r|128)),r=null},decodeUTF8:function(e,t){for(var r,i,n,s,o=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(r=e());)if(0==(128&r))t(r);else if(192==(224&r))null===(i=e())&&o([r,i]),t((31&r)<<6|63&i);else if(224==(240&r))(null===(i=e())||null===(n=e()))&&o([r,i,n]),t((15&r)<<12|(63&i)<<6|63&n);else{if(240!=(248&r))throw RangeError("Illegal starting byte: "+r);(null===(i=e())||null===(n=e())||null===(s=e()))&&o([r,i,n,s]),t((7&r)<<18|(63&i)<<12|(63&n)<<6|63&s)}},UTF16toUTF8:function(e,t){for(var r,i=null;null!==(r=null!==i?i:e());)r>=55296&&r<=57343&&null!==(i=e())&&i>=56320&&i<=57343?(t(1024*(r-55296)+i-56320+65536),i=null):t(r);null!==i&&t(i)},UTF8toUTF16:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<=65535?t(r):(t(55296+((r-=65536)>>10)),t(r%1024+56320)),r=null},encodeUTF16toUTF8:function(t,r){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,r)}))},decodeUTF8toUTF16:function(t,r){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,r)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,r=0;null!==(t=e());)r+=t<128?1:t<2048?2:t<65536?3:4;return r},calculateUTF16asUTF8:function(t){var r=0,i=0;return e.UTF16toUTF8(t,(function(e){++r,i+=e<128?1:e<2048?2:e<65536?3:4})),[r,i]}};return e}();return r.toUTF8=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{l.decodeUTF8toUTF16(function(){return e<t?this.view[e++]:null}.bind(this),r=o())}catch(r){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},t.fromUTF8=function(e,r,i){if(!i&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var n=new t(l.calculateUTF16asUTF8(s(e),!0)[1],r,i),o=0;return l.encodeUTF16toUTF8(s(e),(function(e){n.view[o++]=e})),n.limit=o,n},t},void 0===(s=i.apply(t,n))||(e.exports=s)},6874:function(e,t){var r,i;void 0===(i="function"==typeof(r=function(){"use strict";function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var r={},i={};function n(e,t){var n,s,a;return t?(a=0<=(e>>>=0)&&e<256)&&(s=i[e])?s:(n=o(e,(0|e)<0?-1:0,!0),a&&(i[e]=n),n):(a=-128<=(e|=0)&&e<128)&&(s=r[e])?s:(n=o(e,e<0?-1:0,!1),a&&(r[e]=n),n)}function s(e,t){if(isNaN(e)||!isFinite(e))return t?y:f;if(t){if(e<0)return y;if(e>=p)return b}else{if(e<=-c)return T;if(e+1>=c)return _}return e<0?s(-e,t).neg():o(e%l|0,e/l|0,t)}function o(t,r,i){return new e(t,r,i)}e.fromInt=n,e.fromNumber=s,e.fromBits=o;var a=Math.pow;function u(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return f;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return u(e.substring(1),t,r).neg();for(var n=s(a(r,8)),o=f,d=0;d<e.length;d+=8){var l=Math.min(8,e.length-d),p=parseInt(e.substring(d,d+l),r);if(l<8){var c=s(a(r,l));o=o.mul(c).add(s(p))}else o=(o=o.mul(n)).add(s(p))}return o.unsigned=t,o}function d(t){return t instanceof e?t:"number"==typeof t?s(t):"string"==typeof t?u(t):o(t.low,t.high,t.unsigned)}e.fromString=u,e.fromValue=d;var l=4294967296,p=l*l,c=p/2,h=n(1<<24),f=n(0);e.ZERO=f;var y=n(0,!0);e.UZERO=y;var g=n(1);e.ONE=g;var m=n(1,!0);e.UONE=m;var v=n(-1);e.NEG_ONE=v;var _=o(-1,2147483647,!1);e.MAX_VALUE=_;var b=o(-1,-1,!0);e.MAX_UNSIGNED_VALUE=b;var T=o(0,-2147483648,!1);e.MIN_VALUE=T;var E=e.prototype;return E.toInt=function(){return this.unsigned?this.low>>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},E.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(T)){var t=s(e),r=this.div(t),i=r.mul(t).sub(this);return r.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=s(a(e,6),this.unsigned),o=this,u="";;){var d=o.div(n),l=(o.sub(d.mul(n)).toInt()>>>0).toString(e);if((o=d).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},E.isZero=function(){return 0===this.high&&0===this.low},E.isNegative=function(){return!this.unsigned&&this.high<0},E.isPositive=function(){return this.unsigned||this.high>=0},E.isOdd=function(){return 1==(1&this.low)},E.isEven=function(){return 0==(1&this.low)},E.equals=function(e){return t(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},E.eq=E.equals,E.notEquals=function(e){return!this.eq(e)},E.neq=E.notEquals,E.lessThan=function(e){return this.comp(e)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(e){return this.comp(e)<=0},E.lte=E.lessThanOrEqual,E.greaterThan=function(e){return this.comp(e)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(e){return this.comp(e)>=0},E.gte=E.greaterThanOrEqual,E.compare=function(e){if(t(e)||(e=d(e)),this.eq(e))return 0;var r=this.isNegative(),i=e.isNegative();return r&&!i?-1:!r&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(g)},E.neg=E.negate,E.add=function(e){t(e)||(e=d(e));var r=this.high>>>16,i=65535&this.high,n=this.low>>>16,s=65535&this.low,a=e.high>>>16,u=65535&e.high,l=e.low>>>16,p=0,c=0,h=0,f=0;return h+=(f+=s+(65535&e.low))>>>16,c+=(h+=n+l)>>>16,p+=(c+=i+u)>>>16,p+=r+a,o((h&=65535)<<16|(f&=65535),(p&=65535)<<16|(c&=65535),this.unsigned)},E.subtract=function(e){return t(e)||(e=d(e)),this.add(e.neg())},E.sub=E.subtract,E.multiply=function(e){if(this.isZero())return f;if(t(e)||(e=d(e)),e.isZero())return f;if(this.eq(T))return e.isOdd()?T:f;if(e.eq(T))return this.isOdd()?T:f;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(h)&&e.lt(h))return s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,n=this.low>>>16,a=65535&this.low,u=e.high>>>16,l=65535&e.high,p=e.low>>>16,c=65535&e.low,y=0,g=0,m=0,v=0;return m+=(v+=a*c)>>>16,g+=(m+=n*c)>>>16,m&=65535,g+=(m+=a*p)>>>16,y+=(g+=i*c)>>>16,g&=65535,y+=(g+=n*p)>>>16,g&=65535,y+=(g+=a*l)>>>16,y+=r*c+i*p+n*l+a*u,o((m&=65535)<<16|(v&=65535),(y&=65535)<<16|(g&=65535),this.unsigned)},E.mul=E.multiply,E.divide=function(e){if(t(e)||(e=d(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?y:f;var r,i,n;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return m;n=y}else{if(this.eq(T))return e.eq(g)||e.eq(v)?T:e.eq(T)?g:(r=this.shr(1).div(e).shl(1)).eq(f)?e.isNegative()?g:v:(i=this.sub(e.mul(r)),n=r.add(i.div(e)));if(e.eq(T))return this.unsigned?y:f;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();n=f}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),u=o<=48?1:a(2,o-48),l=s(r),p=l.mul(e);p.isNegative()||p.gt(i);)p=(l=s(r-=u,this.unsigned)).mul(e);l.isZero()&&(l=g),n=n.add(l),i=i.sub(p)}return n},E.div=E.divide,E.modulo=function(e){return t(e)||(e=d(e)),this.sub(this.div(e).mul(e))},E.mod=E.modulo,E.not=function(){return o(~this.low,~this.high,this.unsigned)},E.and=function(e){return t(e)||(e=d(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},E.or=function(e){return t(e)||(e=d(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},E.xor=function(e){return t(e)||(e=d(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},E.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):o(0,this.low<<e-32,this.unsigned)},E.shl=E.shiftLeft,E.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var r=this.high;return e<32?o(this.low>>>e|r<<32-e,r>>>e,this.unsigned):o(32===e?r:r>>>e-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},E.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},E.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?r.apply(t,[]):r)||(e.exports=i)},6139:function(e,t,r){var i=r(4406);e.exports=function(){"use strict";function e(e){return"function"==typeof e}var t=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},n=0,s=void 0,o=void 0,a=function(e,t){f[n]=e,f[n+1]=t,2===(n+=2)&&(o?o(y):b())};var u="undefined"!=typeof window?window:void 0,d=u||{},l=d.MutationObserver||d.WebKitMutationObserver,p="undefined"==typeof self&&void 0!==i&&"[object process]"==={}.toString.call(i),c="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var e=setTimeout;return function(){return e(y,1)}}var f=new Array(1e3);function y(){for(var e=0;e<n;e+=2)(0,f[e])(f[e+1]),f[e]=void 0,f[e+1]=void 0;n=0}var g,m,v,_,b=void 0;function T(e,t){var r=this,i=new this.constructor(S);void 0===i[w]&&P(i);var n=r._state;if(n){var s=arguments[n-1];a((function(){return N(n,i,s,r._result)}))}else M(r,i,e,t);return i}function E(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(S);return O(t,e),t}b=p?function(){return i.nextTick(y)}:l?(m=0,v=new l(y),_=document.createTextNode(""),v.observe(_,{characterData:!0}),function(){_.data=m=++m%2}):c?((g=new MessageChannel).port1.onmessage=y,function(){return g.port2.postMessage(0)}):void 0===u?function(){try{var e=Function("return this")().require("vertx");return void 0!==(s=e.runOnLoop||e.runOnContext)?function(){s(y)}:h()}catch(e){return h()}}():h();var w=Math.random().toString(36).substring(2);function S(){}var A=void 0;function R(t,r,i){r.constructor===t.constructor&&i===T&&r.constructor.resolve===E?function(e,t){1===t._state?x(e,t._result):2===t._state?C(e,t._result):M(t,void 0,(function(t){return O(e,t)}),(function(t){return C(e,t)}))}(t,r):void 0===i?x(t,r):e(i)?function(e,t,r){a((function(e){var i=!1,n=function(e,t,r,i){try{e.call(t,r,i)}catch(e){return e}}(r,t,(function(r){i||(i=!0,t!==r?O(e,r):x(e,r))}),(function(t){i||(i=!0,C(e,t))}),e._label);!i&&n&&(i=!0,C(e,n))}),e)}(t,r,i):x(t,r)}function O(e,t){if(e===t)C(e,new TypeError("You cannot resolve a promise with itself"));else if(n=typeof(i=t),null===i||"object"!==n&&"function"!==n)x(e,t);else{var r=void 0;try{r=t.then}catch(t){return void C(e,t)}R(e,t,r)}var i,n}function I(e){e._onerror&&e._onerror(e._result),k(e)}function x(e,t){e._state===A&&(e._result=t,e._state=1,0!==e._subscribers.length&&a(k,e))}function C(e,t){e._state===A&&(e._state=2,e._result=t,a(I,e))}function M(e,t,r,i){var n=e._subscribers,s=n.length;e._onerror=null,n[s]=t,n[s+1]=r,n[s+2]=i,0===s&&e._state&&a(k,e)}function k(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var i=void 0,n=void 0,s=e._result,o=0;o<t.length;o+=3)i=t[o],n=t[o+r],i?N(r,i,n,s):n(s);e._subscribers.length=0}}function N(t,r,i,n){var s=e(i),o=void 0,a=void 0,u=!0;if(s){try{o=i(n)}catch(e){u=!1,a=e}if(r===o)return void C(r,new TypeError("A promises callback cannot return that same promise."))}else o=n;r._state!==A||(s&&u?O(r,o):!1===u?C(r,a):1===t?x(r,o):2===t&&C(r,o))}var D=0;function P(e){e[w]=D++,e._state=void 0,e._result=void 0,e._subscribers=[]}var q=function(){function e(e,r){this._instanceConstructor=e,this.promise=new e(S),this.promise[w]||P(this.promise),t(r)?(this.length=r.length,this._remaining=r.length,this._result=new Array(this.length),0===this.length?x(this.promise,this._result):(this.length=this.length||0,this._enumerate(r),0===this._remaining&&x(this.promise,this._result))):C(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;this._state===A&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,i=r.resolve;if(i===E){var n=void 0,s=void 0,o=!1;try{n=e.then}catch(e){o=!0,s=e}if(n===T&&e._state!==A)this._settledAt(e._state,t,e._result);else if("function"!=typeof n)this._remaining--,this._result[t]=e;else if(r===L){var a=new r(S);o?C(a,s):R(a,e,n),this._willSettleAt(a,t)}else this._willSettleAt(new r((function(t){return t(e)})),t)}else this._willSettleAt(i(e),t)},e.prototype._settledAt=function(e,t,r){var i=this.promise;i._state===A&&(this._remaining--,2===e?C(i,r):this._result[t]=r),0===this._remaining&&x(i,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;M(e,void 0,(function(e){return r._settledAt(1,t,e)}),(function(e){return r._settledAt(2,t,e)}))},e}();var L=function(){function t(e){this[w]=D++,this._result=this._state=void 0,this._subscribers=[],S!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t((function(t){O(e,t)}),(function(t){C(e,t)}))}catch(t){C(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var r=this,i=r.constructor;return e(t)?r.then((function(e){return i.resolve(t()).then((function(){return e}))}),(function(e){return i.resolve(t()).then((function(){throw e}))})):r.then(t,t)},t}();return L.prototype.then=T,L.all=function(e){return new q(this,e).promise},L.race=function(e){var r=this;return t(e)?new r((function(t,i){for(var n=e.length,s=0;s<n;s++)r.resolve(e[s]).then(t,i)})):new r((function(e,t){return t(new TypeError("You must pass an array to race."))}))},L.resolve=E,L.reject=function(e){var t=new this(S);return C(t,e),t},L._setScheduler=function(e){o=e},L._setAsap=function(e){a=e},L._asap=a,L.polyfill=function(){var e=void 0;if(void 0!==r.g)e=r.g;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var i=null;try{i=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===i&&!t.cast)return}e.Promise=L},L.Promise=L,L}()},6920:e=>{e.exports=o,o.default=o,o.stable=l,o.stableStringify=l;var t="[...]",r="[Circular]",i=[],n=[];function s(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function o(e,t,r,o){var a;void 0===o&&(o=s()),u(e,"",0,[],void 0,0,o);try{a=0===n.length?JSON.stringify(e,t,r):JSON.stringify(e,c(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==i.length;){var d=i.pop();4===d.length?Object.defineProperty(d[0],d[1],d[3]):d[0][d[1]]=d[2]}}return a}function a(e,t,r,s){var o=Object.getOwnPropertyDescriptor(s,r);void 0!==o.get?o.configurable?(Object.defineProperty(s,r,{value:e}),i.push([s,r,t,o])):n.push([t,r,e]):(s[r]=e,i.push([s,r,t]))}function u(e,i,n,s,o,d,l){var p;if(d+=1,"object"==typeof e&&null!==e){for(p=0;p<s.length;p++)if(s[p]===e)return void a(r,e,i,o);if(void 0!==l.depthLimit&&d>l.depthLimit)return void a(t,e,i,o);if(void 0!==l.edgesLimit&&n+1>l.edgesLimit)return void a(t,e,i,o);if(s.push(e),Array.isArray(e))for(p=0;p<e.length;p++)u(e[p],p,p,s,e,d,l);else{var c=Object.keys(e);for(p=0;p<c.length;p++){var h=c[p];u(e[h],h,p,s,e,d,l)}}s.pop()}}function d(e,t){return e<t?-1:e>t?1:0}function l(e,t,r,o){void 0===o&&(o=s());var a,u=p(e,"",0,[],void 0,0,o)||e;try{a=0===n.length?JSON.stringify(u,t,r):JSON.stringify(u,c(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==i.length;){var d=i.pop();4===d.length?Object.defineProperty(d[0],d[1],d[3]):d[0][d[1]]=d[2]}}return a}function p(e,n,s,o,u,l,c){var h;if(l+=1,"object"==typeof e&&null!==e){for(h=0;h<o.length;h++)if(o[h]===e)return void a(r,e,n,u);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==c.depthLimit&&l>c.depthLimit)return void a(t,e,n,u);if(void 0!==c.edgesLimit&&s+1>c.edgesLimit)return void a(t,e,n,u);if(o.push(e),Array.isArray(e))for(h=0;h<e.length;h++)p(e[h],h,h,o,e,l,c);else{var f={},y=Object.keys(e).sort(d);for(h=0;h<y.length;h++){var g=y[h];p(e[g],g,h,o,e,l,c),f[g]=e[g]}if(void 0===u)return f;i.push([u,n,e]),u[n]=f}o.pop()}}function c(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(n.length>0)for(var i=0;i<n.length;i++){var s=n[i];if(s[1]===t&&s[0]===r){r=s[2],n.splice(i,1);break}}return e.call(this,t,r)}}},2333:(e,t)=>{t.read=function(e,t,r,i,n){var s,o,a=8*n-i-1,u=(1<<a)-1,d=u>>1,l=-7,p=r?n-1:0,c=r?-1:1,h=e[t+p];for(p+=c,s=h&(1<<-l)-1,h>>=-l,l+=a;l>0;s=256*s+e[t+p],p+=c,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=i;l>0;o=256*o+e[t+p],p+=c,l-=8);if(0===s)s=1-d;else{if(s===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,i),s-=d}return(h?-1:1)*o*Math.pow(2,s-i)},t.write=function(e,t,r,i,n,s){var o,a,u,d=8*s-n-1,l=(1<<d)-1,p=l>>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:s-1,f=i?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+p>=1?c/u:c*Math.pow(2,1-p))*u>=2&&(o++,u/=2),o+p>=l?(a=0,o=l):o+p>=1?(a=(t*u-1)*Math.pow(2,n),o+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,n),o=0));n>=8;e[r+h]=255&a,h+=f,a/=256,n-=8);for(o=o<<n|a,d+=n;d>0;e[r+h]=255&o,h+=f,o/=256,d-=8);e[r+h-f]|=128*y}},1965:(module,exports,__webpack_require__)=>{var process=__webpack_require__(4406),__WEBPACK_AMD_DEFINE_RESULT__;(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=__webpack_require__.g:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,AMD=__webpack_require__.amdO,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(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e,t){return function(r){return new Sha256(t,!0).update(r)[e]()}},createMethod=function(e){var t=createOutputMethod("hex",e);NODE_JS&&(t=nodeWrap(t,e)),t.create=function(){return new Sha256(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<OUTPUT_TYPES.length;++r){var i=OUTPUT_TYPES[r];t[i]=createOutputMethod(i,e)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(e){if("string"==typeof e)return crypto.createHash(algorithm).update(e,"utf8").digest("hex");if(null==e)throw new Error(ERROR);return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(e)).digest("hex"):method(e)};return nodeMethod},createHmacOutputMethod=function(e,t){return function(r,i){return new HmacSha256(r,t,!0).update(i)[e]()}},createHmacMethod=function(e){var t=createHmacOutputMethod("hex",e);t.create=function(t){return new HmacSha256(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<OUTPUT_TYPES.length;++r){var i=OUTPUT_TYPES[r];t[i]=createHmacOutputMethod(i,e)}return t};function Sha256(e,t){t?(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],e?(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=e}function HmacSha256(e,t,r){var i,n=typeof e;if("string"===n){var s,o=[],a=e.length,u=0;for(i=0;i<a;++i)(s=e.charCodeAt(i))<128?o[u++]=s:s<2048?(o[u++]=192|s>>6,o[u++]=128|63&s):s<55296||s>=57344?(o[u++]=224|s>>12,o[u++]=128|s>>6&63,o[u++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++i)),o[u++]=240|s>>18,o[u++]=128|s>>12&63,o[u++]=128|s>>6&63,o[u++]=128|63&s);e=o}else{if("object"!==n)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw new Error(ERROR)}e.length>64&&(e=new Sha256(t,!0).update(e).array());var d=[],l=[];for(i=0;i<64;++i){var p=e[i]||0;d[i]=92^p,l[i]=54^p}Sha256.call(this,t,r),this.update(l),this.oKeyPad=d,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(e){if(!this.finalized){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw new Error(ERROR);t=!0}for(var i,n,s=0,o=e.length,a=this.blocks;s<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),t)for(n=this.start;s<o&&n<64;++s)a[n>>2]|=e[s]<<SHIFT[3&n++];else for(n=this.start;s<o&&n<64;++s)(i=e.charCodeAt(s))<128?a[n>>2]|=i<<SHIFT[3&n++]:i<2048?(a[n>>2]|=(192|i>>6)<<SHIFT[3&n++],a[n>>2]|=(128|63&i)<<SHIFT[3&n++]):i<55296||i>=57344?(a[n>>2]|=(224|i>>12)<<SHIFT[3&n++],a[n>>2]|=(128|i>>6&63)<<SHIFT[3&n++],a[n>>2]|=(128|63&i)<<SHIFT[3&n++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++s)),a[n>>2]|=(240|i>>18)<<SHIFT[3&n++],a[n>>2]|=(128|i>>12&63)<<SHIFT[3&n++],a[n>>2]|=(128|i>>6&63)<<SHIFT[3&n++],a[n>>2]|=(128|63&i)<<SHIFT[3&n++]);this.lastByteIndex=n,this.bytes+=n-this.start,n>=64?(this.block=a[16],this.start=n-64,this.hash(),this.hashed=!0):this.start=n}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 e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var e,t,r,i,n,s,o,a,u,d=this.h0,l=this.h1,p=this.h2,c=this.h3,h=this.h4,f=this.h5,y=this.h6,g=this.h7,m=this.blocks;for(e=16;e<64;++e)t=((n=m[e-15])>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,r=((n=m[e-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,m[e]=m[e-16]+t+m[e-7]+r<<0;for(u=l&p,e=0;e<64;e+=4)this.first?(this.is224?(s=300032,g=(n=m[0]-1413257819)-150054599<<0,c=n+24177077<<0):(s=704751109,g=(n=m[0]-210244248)-1521486534<<0,c=n+143694565<<0),this.first=!1):(t=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),i=(s=d&l)^d&p^u,g=c+(n=g+(r=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&f^~h&y)+K[e]+m[e])<<0,c=n+(t+i)<<0),t=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),i=(o=c&d)^c&l^s,y=p+(n=y+(r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&h^~g&f)+K[e+1]+m[e+1])<<0,t=((p=n+(t+i)<<0)>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),i=(a=p&c)^p&d^o,f=l+(n=f+(r=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&g^~y&h)+K[e+2]+m[e+2])<<0,t=((l=n+(t+i)<<0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),i=(u=l&p)^l&c^a,h=d+(n=h+(r=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&y^~f&g)+K[e+3]+m[e+3])<<0,d=n+(t+i)<<0;this.h0=this.h0+d<<0,this.h1=this.h1+l<<0,this.h2=this.h2+p<<0,this.h3=this.h3+c<<0,this.h4=this.h4+h<<0,this.h5=this.h5+f<<0,this.h6=this.h6+y<<0,this.h7=this.h7+g<<0},Sha256.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,i=this.h3,n=this.h4,s=this.h5,o=this.h6,a=this.h7,u=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[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[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[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[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+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[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||(u+=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]),u},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,i=this.h3,n=this.h4,s=this.h5,o=this.h6,a=this.h7,u=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,n>>24&255,n>>16&255,n>>8&255,255&n,s>>24&255,s>>16&255,s>>8&255,255&s,o>>24&255,o>>16&255,o>>8&255,255&o];return this.is224||u.push(a>>24&255,a>>16&255,a>>8&255,255&a),u},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),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&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()},857:(e,t,r)=>{var i=r(7772).Symbol;e.exports=i},3366:(e,t,r)=>{var i=r(857),n=r(2107),s=r(7157),o=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?n(e):s(e)}},1242:(e,t,r)=>{var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},7353:(e,t,r)=>{var i=r(241)(Object.getPrototypeOf,Object);e.exports=i},2107:(e,t,r)=>{var i=r(857),n=Object.prototype,s=n.hasOwnProperty,o=n.toString,a=i?i.toStringTag:void 0;e.exports=function(e){var t=s.call(e,a),r=e[a];try{e[a]=void 0;var i=!0}catch(e){}var n=o.call(e);return i&&(t?e[a]=r:delete e[a]),n}},7157:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},241:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},7772:(e,t,r)=>{var i=r(1242),n="object"==typeof self&&self&&self.Object===Object&&self,s=i||n||Function("return this")();e.exports=s},6152:e=>{var t=Array.isArray;e.exports=t},1049:(e,t,r)=>{var i=r(3366),n=r(9259);e.exports=function(e){if(!n(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},9259:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5125:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},7030:(e,t,r)=>{var i=r(3366),n=r(7353),s=r(5125),o=Function.prototype,a=Object.prototype,u=o.toString,d=a.hasOwnProperty,l=u.call(Object);e.exports=function(e){if(!s(e)||"[object Object]"!=i(e))return!1;var t=n(e);if(null===t)return!0;var r=d.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==l}},5505:(e,t,r)=>{var i=r(3366),n=r(6152),s=r(5125);e.exports=function(e){return"string"==typeof e||!n(e)&&s(e)&&"[object String]"==i(e)}},7808:e=>{e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function i(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=i;var n={},s={};function o(e,t){var r,i,o;return t?(o=0<=(e>>>=0)&&e<256)&&(i=s[e])?i:(r=u(e,(0|e)<0?-1:0,!0),o&&(s[e]=r),r):(o=-128<=(e|=0)&&e<128)&&(i=n[e])?i:(r=u(e,e<0?-1:0,!1),o&&(n[e]=r),r)}function a(e,t){if(isNaN(e))return t?m:g;if(t){if(e<0)return m;if(e>=h)return E}else{if(e<=-f)return w;if(e+1>=f)return T}return e<0?a(-e,t).neg():u(e%c|0,e/c|0,t)}function u(e,t,i){return new r(e,t,i)}r.fromInt=o,r.fromNumber=a,r.fromBits=u;var d=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return l(e.substring(1),t,r).neg();for(var n=a(d(r,8)),s=g,o=0;o<e.length;o+=8){var u=Math.min(8,e.length-o),p=parseInt(e.substring(o,o+u),r);if(u<8){var c=a(d(r,u));s=s.mul(c).add(a(p))}else s=(s=s.mul(n)).add(a(p))}return s.unsigned=t,s}function p(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?l(e,t):u(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=l,r.fromValue=p;var c=4294967296,h=c*c,f=h/2,y=o(1<<24),g=o(0);r.ZERO=g;var m=o(0,!0);r.UZERO=m;var v=o(1);r.ONE=v;var _=o(1,!0);r.UONE=_;var b=o(-1);r.NEG_ONE=b;var T=u(-1,2147483647,!1);r.MAX_VALUE=T;var E=u(-1,-1,!0);r.MAX_UNSIGNED_VALUE=E;var w=u(0,-2147483648,!1);r.MIN_VALUE=w;var S=r.prototype;S.toInt=function(){return this.unsigned?this.low>>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},S.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(w)){var t=a(e),r=this.div(t),i=r.mul(t).sub(this);return r.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=a(d(e,6),this.unsigned),s=this,o="";;){var u=s.div(n),l=(s.sub(u.mul(n)).toInt()>>>0).toString(e);if((s=u).isZero())return l+o;for(;l.length<6;)l="0"+l;o=""+l+o}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},S.isZero=function(){return 0===this.high&&0===this.low},S.eqz=S.isZero,S.isNegative=function(){return!this.unsigned&&this.high<0},S.isPositive=function(){return this.unsigned||this.high>=0},S.isOdd=function(){return 1==(1&this.low)},S.isEven=function(){return 0==(1&this.low)},S.equals=function(e){return i(e)||(e=p(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},S.eq=S.equals,S.notEquals=function(e){return!this.eq(e)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(e){return this.comp(e)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(e){return this.comp(e)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(e){return this.comp(e)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(e){return this.comp(e)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(e){if(i(e)||(e=p(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(v)},S.neg=S.negate,S.add=function(e){i(e)||(e=p(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,s=65535&this.low,o=e.high>>>16,a=65535&e.high,d=e.low>>>16,l=0,c=0,h=0,f=0;return h+=(f+=s+(65535&e.low))>>>16,c+=(h+=n+d)>>>16,l+=(c+=r+a)>>>16,l+=t+o,u((h&=65535)<<16|(f&=65535),(l&=65535)<<16|(c&=65535),this.unsigned)},S.subtract=function(e){return i(e)||(e=p(e)),this.add(e.neg())},S.sub=S.subtract,S.multiply=function(e){if(this.isZero())return g;if(i(e)||(e=p(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(w))return e.isOdd()?w:g;if(e.eq(w))return this.isOdd()?w:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(y)&&e.lt(y))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,s=this.low>>>16,o=65535&this.low,d=e.high>>>16,l=65535&e.high,c=e.low>>>16,h=65535&e.low,f=0,m=0,v=0,_=0;return v+=(_+=o*h)>>>16,m+=(v+=s*h)>>>16,v&=65535,m+=(v+=o*c)>>>16,f+=(m+=n*h)>>>16,m&=65535,f+=(m+=s*c)>>>16,m&=65535,f+=(m+=o*l)>>>16,f+=r*h+n*c+s*l+o*d,u((v&=65535)<<16|(_&=65535),(f&=65535)<<16|(m&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(e){if(i(e)||(e=p(e)),e.isZero())throw Error("division by zero");var r,n,s;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?m:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return m;if(e.gt(this.shru(1)))return _;s=m}else{if(this.eq(w))return e.eq(v)||e.eq(b)?w:e.eq(w)?v:(r=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?v:b:(n=this.sub(e.mul(r)),s=r.add(n.div(e)));if(e.eq(w))return this.unsigned?m:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=g}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),l=o<=48?1:d(2,o-48),c=a(r),h=c.mul(e);h.isNegative()||h.gt(n);)h=(c=a(r-=l,this.unsigned)).mul(e);c.isZero()&&(c=v),s=s.add(c),n=n.sub(h)}return s},S.div=S.divide,S.modulo=function(e){return i(e)||(e=p(e)),t?u((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return u(~this.low,~this.high,this.unsigned)},S.and=function(e){return i(e)||(e=p(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},S.or=function(e){return i(e)||(e=p(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},S.xor=function(e){return i(e)||(e=p(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},S.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):u(0,this.low<<e-32,this.unsigned)},S.shl=S.shiftLeft,S.shiftRight=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},S.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},S.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,i){return i?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},7105:(e,t,r)=>{"use strict";const i=r(8006),n=Symbol("max"),s=Symbol("length"),o=Symbol("lengthCalculator"),a=Symbol("allowStale"),u=Symbol("maxAge"),d=Symbol("dispose"),l=Symbol("noDisposeOnSet"),p=Symbol("lruList"),c=Symbol("cache"),h=Symbol("updateAgeOnGet"),f=()=>1,y=(e,t,r)=>{const i=e[c].get(t);if(i){const t=i.value;if(g(e,t)){if(v(e,i),!e[a])return}else r&&(e[h]&&(i.value.now=Date.now()),e[p].unshiftNode(i));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[u])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[u]&&r>e[u]},m=e=>{if(e[s]>e[n])for(let t=e[p].tail;e[s]>e[n]&&null!==t;){const r=t.prev;v(e,t),t=r}},v=(e,t)=>{if(t){const r=t.value;e[d]&&e[d](r.key,r.value),e[s]-=r.length,e[c].delete(r.key),e[p].removeNode(t)}};class _{constructor(e,t,r,i,n){this.key=e,this.value=t,this.length=r,this.now=i,this.maxAge=n||0}}const b=(e,t,r,i)=>{let n=r.value;g(e,n)&&(v(e,r),e[a]||(n=void 0)),n&&t.call(i,n.value,n.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[n]=e.max||1/0;const t=e.length||f;if(this[o]="function"!=typeof t?f:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[u]=e.maxAge||0,this[d]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[h]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[n]=e||1/0,m(this)}get max(){return this[n]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[u]=e,m(this)}get maxAge(){return this[u]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[o]&&(this[o]=e,this[s]=0,this[p].forEach((e=>{e.length=this[o](e.value,e.key),this[s]+=e.length}))),m(this)}get lengthCalculator(){return this[o]}get length(){return this[s]}get itemCount(){return this[p].length}rforEach(e,t){t=t||this;for(let r=this[p].tail;null!==r;){const i=r.prev;b(this,e,r,t),r=i}}forEach(e,t){t=t||this;for(let r=this[p].head;null!==r;){const i=r.next;b(this,e,r,t),r=i}}keys(){return this[p].toArray().map((e=>e.key))}values(){return this[p].toArray().map((e=>e.value))}reset(){this[d]&&this[p]&&this[p].length&&this[p].forEach((e=>this[d](e.key,e.value))),this[c]=new Map,this[p]=new i,this[s]=0}dump(){return this[p].map((e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[p]}set(e,t,r){if((r=r||this[u])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const i=r?Date.now():0,a=this[o](t,e);if(this[c].has(e)){if(a>this[n])return v(this,this[c].get(e)),!1;const o=this[c].get(e).value;return this[d]&&(this[l]||this[d](e,o.value)),o.now=i,o.maxAge=r,o.value=t,this[s]+=a-o.length,o.length=a,this.get(e),m(this),!0}const h=new _(e,t,a,i,r);return h.length>this[n]?(this[d]&&this[d](e,t),!1):(this[s]+=h.length,this[p].unshift(h),this[c].set(e,this[p].head),m(this),!0)}has(e){if(!this[c].has(e))return!1;const t=this[c].get(e).value;return!g(this,t)}get(e){return y(this,e,!0)}peek(e){return y(this,e,!1)}pop(){const e=this[p].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[c].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const i=e[r],n=i.e||0;if(0===n)this.set(i.k,i.v);else{const e=n-t;e>0&&this.set(i.k,i.v,e)}}}prune(){this[c].forEach(((e,t)=>y(this,t,!1)))}}},1378:e=>{var t=1e3,r=60*t,i=60*r,n=24*i;function s(e,t,r,i){var n=t>=1.5*r;return Math.round(e/r)+" "+i+(n?"s":"")}e.exports=function(e,o){o=o||{};var a,u,d=typeof e;if("string"===d&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(s){var o=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return 6048e5*o;case"days":case"day":case"d":return o*n;case"hours":case"hour":case"hrs":case"hr":case"h":return o*i;case"minutes":case"minute":case"mins":case"min":case"m":return o*r;case"seconds":case"second":case"secs":case"sec":case"s":return o*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}(e);if("number"===d&&isFinite(e))return o.long?(a=e,(u=Math.abs(a))>=n?s(a,u,n,"day"):u>=i?s(a,u,i,"hour"):u>=r?s(a,u,r,"minute"):u>=t?s(a,u,t,"second"):a+" ms"):function(e){var s=Math.abs(e);return s>=n?Math.round(e/n)+"d":s>=i?Math.round(e/i)+"h":s>=r?Math.round(e/r)+"m":s>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},4406:e=>{var t,r,i=e.exports={};function n(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===n||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:n}catch(e){t=n}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var a,u=[],d=!1,l=-1;function p(){d&&a&&(d=!1,a.length?u=a.concat(u):l=-1,u.length&&c())}function c(){if(!d){var e=o(p);d=!0;for(var t=u.length;t;){for(a=u,u=[];++l<t;)a&&a[l].run();l=-1,t=u.length}a=null,d=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function f(){}i.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];u.push(new h(e,t)),1!==u.length||d||o(c)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=f,i.addListener=f,i.once=f,i.off=f,i.removeListener=f,i.removeAllListeners=f,i.emit=f,i.prependListener=f,i.prependOnceListener=f,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},3448:(e,t,r)=>{"use strict";e.exports=r(9188)},3746:(e,t,r)=>{"use strict";var i=t,n=r(6901),s=r(8066);function o(e,t,r,i){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(d%s){",i);for(var s=t.resolvedType.values,o=Object.keys(s),a=0;a<o.length;++a)t.repeated&&s[o[a]]===t.typeDefault&&e("default:"),e("case%j:",o[a])("case %i:",s[o[a]])("m%s=%j",i,s[o[a]])("break");e("}")}else e('if(typeof d%s!=="object")',i)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",i,r,i);else{var u=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",i,i);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",i,i);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",i,i);break;case"uint64":u=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",i,i,u)('else if(typeof d%s==="string")',i)("m%s=parseInt(d%s,10)",i,i)('else if(typeof d%s==="number")',i)("m%s=d%s",i,i)('else if(typeof d%s==="object")',i)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",i,i,i,u?"true":"");break;case"bytes":e('if(typeof d%s==="string")',i)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",i,i,i)("else if(d%s.length)",i)("m%s=d%s",i,i);break;case"string":e("m%s=String(d%s)",i,i);break;case"bool":e("m%s=Boolean(d%s)",i,i)}}return e}function a(e,t,r,i){if(t.resolvedType)t.resolvedType instanceof n?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",i,r,i,i):e("d%s=types[%i].toObject(m%s,o)",i,r,i);else{var s=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",i,i,i,i);break;case"uint64":s=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',i)("d%s=o.longs===String?String(m%s):m%s",i,i,i)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",i,i,i,i,s?"true":"",i);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",i,i,i,i,i);break;default:e("d%s=m%s",i,i)}}return e}i.fromObject=function(e){var t=e.fieldsArray,r=s.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var i=0;i<t.length;++i){var a=t[i].resolve(),u=s.safeProp(a.name);a.map?(r("if(d%s){",u)('if(typeof d%s!=="object")',u)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",u)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",u),o(r,a,i,u+"[ks[i]]")("}")("}")):a.repeated?(r("if(d%s){",u)("if(!Array.isArray(d%s))",u)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",u)("for(var i=0;i<d%s.length;++i){",u),o(r,a,i,u+"[i]")("}")("}")):(a.resolvedType instanceof n||r("if(d%s!=null){",u),o(r,a,i,u),a.resolvedType instanceof n||r("}"))}return r("return m")},i.toObject=function(e){var t=e.fieldsArray.slice().sort(s.compareFieldsById);if(!t.length)return s.codegen()("return {}");for(var r=s.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),i=[],o=[],u=[],d=0;d<t.length;++d)t[d].partOf||(t[d].resolve().repeated?i:t[d].map?o:u).push(t[d]);if(i.length){for(r("if(o.arrays||o.defaults){"),d=0;d<i.length;++d)r("d%s=[]",s.safeProp(i[d].name));r("}")}if(o.length){for(r("if(o.objects||o.defaults){"),d=0;d<o.length;++d)r("d%s={}",s.safeProp(o[d].name));r("}")}if(u.length){for(r("if(o.defaults){"),d=0;d<u.length;++d){var l=u[d],p=s.safeProp(l.name);if(l.resolvedType instanceof n)r("d%s=o.enums===String?%j:%j",p,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",p)("}else")("d%s=o.longs===String?%j:%i",p,l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var c="["+Array.prototype.slice.call(l.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",p,String.fromCharCode.apply(String,l.typeDefault))("else{")("d%s=%s",p,c)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",p,p)("}")}else r("d%s=%j",p,l.typeDefault)}r("}")}var h=!1;for(d=0;d<t.length;++d){l=t[d];var f=e._fieldsArray.indexOf(l);p=s.safeProp(l.name),l.map?(h||(h=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",p,p)("d%s={}",p)("for(var j=0;j<ks2.length;++j){"),a(r,l,f,p+"[ks2[j]]")("}")):l.repeated?(r("if(m%s&&m%s.length){",p,p)("d%s=[]",p)("for(var j=0;j<m%s.length;++j){",p),a(r,l,f,p+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",p,l.name),a(r,l,f,p),l.partOf&&r("if(o.oneofs)")("d%s=%j",s.safeProp(l.partOf.name),l.name)),r("}")}return r("return d")}},9847:(e,t,r)=>{"use strict";e.exports=function(e){var t=s.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var a=e._fieldsArray[r].resolve(),u=a.resolvedType instanceof i?"int32":a.type,d="m"+s.safeProp(a.name);t("case %i:",a.id),a.map?(t("if(%s===util.emptyObject)",d)("%s={}",d)("var c2 = r.uint32()+r.pos"),void 0!==n.defaults[a.keyType]?t("k=%j",n.defaults[a.keyType]):t("k=null"),void 0!==n.defaults[u]?t("value=%j",n.defaults[u]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===n.basic[u]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",u),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==n.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',d):t("%s[k]=value",d)):a.repeated?(t("if(!(%s&&%s.length))",d,d)("%s=[]",d),void 0!==n.packed[u]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",d,u)("}else"),void 0===n.basic[u]?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",d,r):t("%s.push(r.%s())",d,u)):void 0===n.basic[u]?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",d,r):t("%s=r.%s()",d,u),t("break")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var l=e._fieldsArray[r];l.required&&t("if(!m.hasOwnProperty(%j))",l.name)("throw util.ProtocolError(%j,{instance:m})",o(l))}return t("return m")};var i=r(6901),n=r(3970),s=r(8066);function o(e){return"missing required '"+e.name+"'"}},5191:(e,t,r)=>{"use strict";e.exports=function(e){for(var t,r=s.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(s.compareFieldsById),u=0;u<a.length;++u){var d=a[u].resolve(),l=e._fieldsArray.indexOf(d),p=d.resolvedType instanceof i?"int32":d.type,c=n.basic[p];t="m"+s.safeProp(d.name),d.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,d.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(d.id<<3|2)>>>0,8|n.mapKey[d.keyType],d.keyType),void 0===c?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",l,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|c,p,t),r("}")("}")):d.repeated?(r("if(%s!=null&&%s.length){",t,t),d.packed&&void 0!==n.packed[p]?r("w.uint32(%i).fork()",(d.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",p,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===c?o(r,d,l,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(d.id<<3|c)>>>0,p,t)),r("}")):(d.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,d.name),void 0===c?o(r,d,l,t):r("w.uint32(%i).%s(%s)",(d.id<<3|c)>>>0,p,t))}return r("return w")};var i=r(6901),n=r(3970),s=r(8066);function o(e,t,r,i){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,i,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,i,(t.id<<3|2)>>>0)}},6901:(e,t,r)=>{"use strict";e.exports=o;var i=r(7641);((o.prototype=Object.create(i.prototype)).constructor=o).className="Enum";var n=r(9788),s=r(8066);function o(e,t,r,n,s){if(i.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=s||{},this.reserved=void 0,t)for(var o=Object.keys(t),a=0;a<o.length;++a)"number"==typeof t[o[a]]&&(this.valuesById[this.values[o[a]]=t[o[a]]]=o[a])}o.fromJSON=function(e,t){var r=new o(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},o.prototype.add=function(e,t,r){if(!s.isString(e))throw TypeError("name must be a string");if(!s.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=r||null,this},o.prototype.remove=function(e){if(!s.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},o.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},o.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)}},797:(e,t,r)=>{"use strict";e.exports=d;var i=r(7641);((d.prototype=Object.create(i.prototype)).constructor=d).className="Field";var n,s=r(6901),o=r(3970),a=r(8066),u=/^required|optional|repeated$/;function d(e,t,r,n,s,d,l){if(a.isObject(n)?(l=s,d=n,n=s=void 0):a.isObject(s)&&(l=d,d=s,s=void 0),i.call(this,e,d),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(r))throw TypeError("type must be a string");if(void 0!==n&&!u.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==s&&!a.isString(s))throw TypeError("extend must be a string");"proto3_optional"===n&&(n="optional"),this.rule=n&&"optional"!==n?n:void 0,this.type=r,this.id=t,this.extend=s||void 0,this.required="required"===n,this.optional=!this.required,this.repeated="repeated"===n,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==o.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=l}d.fromJSON=function(e,t){return new d(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(d.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),d.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),i.prototype.setOption.call(this,e,t,r)},d.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},d.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=o.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof n?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof s&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof s)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof n&&(this.parent.ctor.prototype[this.name]=this.defaultValue),i.prototype.resolve.call(this)},d.d=function(e,t,r,i){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(n,s){a.decorateType(n.constructor).add(new d(s,e,t,r,{default:i}))}},d._configure=function(e){n=e}},9188:(e,t,r)=>{"use strict";var i=e.exports=r(536);i.build="light",i.load=function(e,t,r){return"function"==typeof t?(r=t,t=new i.Root):t||(t=new i.Root),t.load(e,r)},i.loadSync=function(e,t){return t||(t=new i.Root),t.loadSync(e)},i.encoder=r(5191),i.decoder=r(9847),i.verifier=r(2332),i.converter=r(3746),i.ReflectionObject=r(7641),i.Namespace=r(9788),i.Root=r(742),i.Enum=r(6901),i.Type=r(3138),i.Field=r(797),i.OneOf=r(6898),i.MapField=r(1981),i.Service=r(9355),i.Method=r(8820),i.Message=r(3611),i.wrappers=r(6423),i.types=r(3970),i.util=r(8066),i.ReflectionObject._configure(i.Root),i.Namespace._configure(i.Type,i.Service,i.Enum),i.Root._configure(i.Type),i.Field._configure(i.Type)},536:(e,t,r)=>{"use strict";var i=t;function n(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}i.build="minimal",i.Writer=r(123),i.BufferWriter=r(6673),i.Reader=r(9799),i.BufferReader=r(7038),i.util=r(4165),i.rpc=r(4963),i.roots=r(9009),i.configure=n,n()},1981:(e,t,r)=>{"use strict";e.exports=o;var i=r(797);((o.prototype=Object.create(i.prototype)).constructor=o).className="MapField";var n=r(3970),s=r(8066);function o(e,t,r,n,o,a){if(i.call(this,e,t,n,void 0,void 0,o,a),!s.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}o.fromJSON=function(e,t){return new o(e,t.id,t.keyType,t.type,t.options,t.comment)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},o.prototype.resolve=function(){if(this.resolved)return this;if(void 0===n.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return i.prototype.resolve.call(this)},o.d=function(e,t,r){return"function"==typeof r?r=s.decorateType(r).name:r&&"object"==typeof r&&(r=s.decorateEnum(r).name),function(i,n){s.decorateType(i.constructor).add(new o(n,e,t,r))}}},3611:(e,t,r)=>{"use strict";e.exports=n;var i=r(4165);function n(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}n.create=function(e){return this.$type.create(e)},n.encode=function(e,t){return this.$type.encode(e,t)},n.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},n.decode=function(e){return this.$type.decode(e)},n.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},n.verify=function(e){return this.$type.verify(e)},n.fromObject=function(e){return this.$type.fromObject(e)},n.toObject=function(e,t){return this.$type.toObject(e,t)},n.prototype.toJSON=function(){return this.$type.toObject(this,i.toJSONOptions)}},8820:(e,t,r)=>{"use strict";e.exports=s;var i=r(7641);((s.prototype=Object.create(i.prototype)).constructor=s).className="Method";var n=r(8066);function s(e,t,r,s,o,a,u,d,l){if(n.isObject(o)?(u=o,o=a=void 0):n.isObject(a)&&(u=a,a=void 0),void 0!==t&&!n.isString(t))throw TypeError("type must be a string");if(!n.isString(r))throw TypeError("requestType must be a string");if(!n.isString(s))throw TypeError("responseType must be a string");i.call(this,e,u),this.type=t||"rpc",this.requestType=r,this.requestStream=!!o||void 0,this.responseType=s,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=d,this.parsedOptions=l}s.fromJSON=function(e,t){return new s(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return n.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},s.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),i.prototype.resolve.call(this))}},9788:(e,t,r)=>{"use strict";e.exports=p;var i=r(7641);((p.prototype=Object.create(i.prototype)).constructor=p).className="Namespace";var n,s,o,a=r(797),u=r(6898),d=r(8066);function l(e,t){if(e&&e.length){for(var r={},i=0;i<e.length;++i)r[e[i].name]=e[i].toJSON(t);return r}}function p(e,t){i.call(this,e,t),this.nested=void 0,this._nestedArray=null}function c(e){return e._nestedArray=null,e}p.fromJSON=function(e,t){return new p(e,t.options).addJSON(t.nested)},p.arrayToJSON=l,p.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},p.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(p.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=d.toArray(this.nested))}}),p.prototype.toJSON=function(e){return d.toObject(["options",this.options,"nested",l(this.nestedArray,e)])},p.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),i=0;i<r.length;++i)t=e[r[i]],this.add((void 0!==t.fields?n.fromJSON:void 0!==t.values?o.fromJSON:void 0!==t.methods?s.fromJSON:void 0!==t.id?a.fromJSON:p.fromJSON)(r[i],t));return this},p.prototype.get=function(e){return this.nested&&this.nested[e]||null},p.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof o)return this.nested[e].values;throw Error("no such enum: "+e)},p.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof n||e instanceof o||e instanceof s||e instanceof p||e instanceof u))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof p&&e instanceof p)||t instanceof n||t instanceof s)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,i=0;i<r.length;++i)e.add(r[i]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),c(this)},p.prototype.remove=function(e){if(!(e instanceof i))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),c(this)},p.prototype.define=function(e,t){if(d.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var i=e.shift();if(r.nested&&r.nested[i]){if(!((r=r.nested[i])instanceof p))throw Error("path conflicts with non-namespace objects")}else r.add(r=new p(i))}return t&&r.addJSON(t),r},p.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof p?e[t++].resolveAll():e[t++].resolve();return this.resolve()},p.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),d.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var i=this.get(e[0]);if(i){if(1===e.length){if(!t||t.indexOf(i.constructor)>-1)return i}else if(i instanceof p&&(i=i.lookup(e.slice(1),t,!0)))return i}else for(var n=0;n<this.nestedArray.length;++n)if(this._nestedArray[n]instanceof p&&(i=this._nestedArray[n].lookup(e,t,!0)))return i;return null===this.parent||r?null:this.parent.lookup(e,t)},p.prototype.lookupType=function(e){var t=this.lookup(e,[n]);if(!t)throw Error("no such type: "+e);return t},p.prototype.lookupEnum=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},p.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[n,o]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},p.prototype.lookupService=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},p._configure=function(e,t,r){n=e,s=t,o=r}},7641:(e,t,r)=>{"use strict";e.exports=s,s.className="ReflectionObject";var i,n=r(8066);function s(e,t){if(!n.isString(e))throw TypeError("name must be a string");if(t&&!n.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(s.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),s.prototype.toJSON=function(){throw Error()},s.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof i&&t._handleAdd(this)},s.prototype.onRemove=function(e){var t=e.root;t instanceof i&&t._handleRemove(this),this.parent=null,this.resolved=!1},s.prototype.resolve=function(){return this.resolved||this.root instanceof i&&(this.resolved=!0),this},s.prototype.getOption=function(e){if(this.options)return this.options[e]},s.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},s.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var i=this.parsedOptions;if(r){var s=i.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(s){var o=s[e];n.setProperty(o,r,t)}else(s={})[e]=n.setProperty({},r,t),i.push(s)}else{var a={};a[e]=t,i.push(a)}return this},s.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),i=0;i<r.length;++i)this.setOption(r[i],e[r[i]],t);return this},s.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},s._configure=function(e){i=e}},6898:(e,t,r)=>{"use strict";e.exports=o;var i=r(7641);((o.prototype=Object.create(i.prototype)).constructor=o).className="OneOf";var n=r(797),s=r(8066);function o(e,t,r,n){if(Array.isArray(t)||(r=t,t=void 0),i.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=n}function a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}o.fromJSON=function(e,t){return new o(e,t.oneof,t.options,t.comment)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},o.prototype.add=function(e){if(!(e instanceof n))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,a(this),this},o.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},o.prototype.onAdd=function(e){i.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}a(this)},o.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);i.prototype.onRemove.call(this,e)},o.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){s.decorateType(t.constructor).add(new o(r,e)),Object.defineProperty(t,r,{get:s.oneOfGetter(e),set:s.oneOfSetter(e)})}}},9799:(e,t,r)=>{"use strict";e.exports=u;var i,n=r(4165),s=n.LongBits,o=n.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var d,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},p=function(){return n.Buffer?function(e){return(u.create=function(e){return n.Buffer.isBuffer(e)?new i(e):l(e)})(e)}:l};function c(){var e=new s(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new s(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}u.create=p(),u.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,u.prototype.uint32=(d=4294967295,function(){if(d=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return d;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return d}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},u.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},u.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){i=e,u.create=p(),i._configure();var t=n.Long?"toLong":"toNumber";n.merge(u.prototype,{int64:function(){return c.call(this)[t](!1)},uint64:function(){return c.call(this)[t](!0)},sint64:function(){return c.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},7038:(e,t,r)=>{"use strict";e.exports=s;var i=r(9799);(s.prototype=Object.create(i.prototype)).constructor=s;var n=r(4165);function s(e){i.call(this,e)}s._configure=function(){n.Buffer&&(s.prototype._slice=n.Buffer.prototype.slice)},s.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},s._configure()},742:(e,t,r)=>{"use strict";e.exports=p;var i=r(9788);((p.prototype=Object.create(i.prototype)).constructor=p).className="Root";var n,s,o,a=r(797),u=r(6901),d=r(6898),l=r(8066);function p(e){i.call(this,"",e),this.deferred=[],this.files=[]}function c(){}p.fromJSON=function(e,t){return t||(t=new p),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},p.prototype.resolvePath=l.path.resolve,p.prototype.fetch=l.fetch,p.prototype.load=function e(t,r,i){"function"==typeof r&&(i=r,r=void 0);var n=this;if(!i)return l.asPromise(e,n,t,r);var a=i===c;function u(e,t){if(i){var r=i;if(i=null,a)throw e;r(e,t)}}function d(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in o)return r}return null}function p(e,t){try{if(l.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),l.isString(t)){s.filename=e;var i,o=s(t,n,r),p=0;if(o.imports)for(;p<o.imports.length;++p)(i=d(o.imports[p])||n.resolvePath(e,o.imports[p]))&&h(i);if(o.weakImports)for(p=0;p<o.weakImports.length;++p)(i=d(o.weakImports[p])||n.resolvePath(e,o.weakImports[p]))&&h(i,!0)}else n.setOptions(t.options).addJSON(t.nested)}catch(e){u(e)}a||f||u(null,n)}function h(e,t){if(!(n.files.indexOf(e)>-1))if(n.files.push(e),e in o)a?p(e,o[e]):(++f,setTimeout((function(){--f,p(e,o[e])})));else if(a){var r;try{r=l.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||u(e))}p(e,r)}else++f,n.fetch(e,(function(r,s){--f,i&&(r?t?f||u(null,n):u(r):p(e,s))}))}var f=0;l.isString(t)&&(t=[t]);for(var y,g=0;g<t.length;++g)(y=n.resolvePath("",t[g]))&&h(y);if(a)return n;f||u(null,n)},p.prototype.loadSync=function(e,t){if(!l.isNode)throw Error("not supported");return this.load(e,t,c)},p.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return i.prototype.resolveAll.call(this)};var h=/^[A-Z]/;function f(e,t){var r=t.parent.lookup(t.extend);if(r){var i=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return i.declaringField=t,t.extensionField=i,r.add(i),!0}return!1}p.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||f(0,e)||this.deferred.push(e);else if(e instanceof u)h.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof d)){if(e instanceof n)for(var t=0;t<this.deferred.length;)f(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);h.test(e.name)&&(e.parent[e.name]=e)}},p.prototype._handleRemove=function(e){if(e instanceof a){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof u)h.test(e.name)&&delete e.parent[e.name];else if(e instanceof i){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);h.test(e.name)&&delete e.parent[e.name]}},p._configure=function(e,t,r){n=e,s=t,o=r}},9009:e=>{"use strict";e.exports={}},4963:(e,t,r)=>{"use strict";t.Service=r(9548)},9548:(e,t,r)=>{"use strict";e.exports=n;var i=r(4165);function n(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(n.prototype=Object.create(i.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(t,r,n,s,o){if(!s)throw TypeError("request must be specified");var a=this;if(!o)return i.asPromise(e,a,t,r,n,s);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(e,r){if(e)return a.emit("error",e,t),o(e);if(null!==r){if(!(r instanceof n))try{r=n[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),o(e)}return a.emit("data",r,t),o(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){o(e)}),0)}else setTimeout((function(){o(Error("already ended"))}),0)},n.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},9355:(e,t,r)=>{"use strict";e.exports=a;var i=r(9788);((a.prototype=Object.create(i.prototype)).constructor=a).className="Service";var n=r(8820),s=r(8066),o=r(4963);function a(e,t){i.call(this,e,t),this.methods={},this._methodsArray=null}function u(e){return e._methodsArray=null,e}a.fromJSON=function(e,t){var r=new a(e,t.options);if(t.methods)for(var i=Object.keys(t.methods),s=0;s<i.length;++s)r.add(n.fromJSON(i[s],t.methods[i[s]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},a.prototype.toJSON=function(e){var t=i.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return s.toObject(["options",t&&t.options||void 0,"methods",i.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=s.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||i.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return i.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof n?(this.methods[e.name]=e,e.parent=this,u(this)):i.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof n){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,u(this)}return i.prototype.remove.call(this,e)},a.prototype.create=function(e,t,r){for(var i,n=new o.Service(e,t,r),a=0;a<this.methodsArray.length;++a){var u=s.lcFirst((i=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");n[u]=s.codegen(["r","c"],s.isReserved(u)?u+"_":u)("return this.rpcCall(m,q,s,r,c)")({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return n}},3138:(e,t,r)=>{"use strict";e.exports=v;var i=r(9788);((v.prototype=Object.create(i.prototype)).constructor=v).className="Type";var n=r(6901),s=r(6898),o=r(797),a=r(1981),u=r(9355),d=r(3611),l=r(9799),p=r(123),c=r(8066),h=r(5191),f=r(9847),y=r(2332),g=r(3746),m=r(6423);function v(e,t){i.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function _(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(v.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],i=r.id;if(this._fieldsById[i])throw Error("duplicate id "+i+" in "+this);this._fieldsById[i]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=c.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=c.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=v.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof d||((e.prototype=new d).constructor=e,c.merge(e.prototype,t)),e.$type=e.prototype.$type=this,c.merge(e,d,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var i={};for(r=0;r<this.oneofsArray.length;++r)i[this._oneofsArray[r].resolve().name]={get:c.oneOfGetter(this._oneofsArray[r].oneof),set:c.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,i)}}}),v.generateConstructor=function(e){for(var t,r=c.codegen(["p"],e.name),i=0;i<e.fieldsArray.length;++i)(t=e._fieldsArray[i]).map?r("this%s={}",c.safeProp(t.name)):t.repeated&&r("this%s=[]",c.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},v.fromJSON=function(e,t){var r=new v(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var d=Object.keys(t.fields),l=0;l<d.length;++l)r.add((void 0!==t.fields[d[l]].keyType?a.fromJSON:o.fromJSON)(d[l],t.fields[d[l]]));if(t.oneofs)for(d=Object.keys(t.oneofs),l=0;l<d.length;++l)r.add(s.fromJSON(d[l],t.oneofs[d[l]]));if(t.nested)for(d=Object.keys(t.nested),l=0;l<d.length;++l){var p=t.nested[d[l]];r.add((void 0!==p.id?o.fromJSON:void 0!==p.fields?v.fromJSON:void 0!==p.values?n.fromJSON:void 0!==p.methods?u.fromJSON:i.fromJSON)(d[l],p))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},v.prototype.toJSON=function(e){var t=i.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return c.toObject(["options",t&&t.options||void 0,"oneofs",i.arrayToJSON(this.oneofsArray,e),"fields",i.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},v.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return i.prototype.resolveAll.call(this)},v.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},v.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof o&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),_(this)}return e instanceof s?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),_(this)):i.prototype.add.call(this,e)},v.prototype.remove=function(e){if(e instanceof o&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),_(this)}if(e instanceof s){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),_(this)}return i.prototype.remove.call(this,e)},v.prototype.isReservedId=function(e){return i.isReservedId(this.reserved,e)},v.prototype.isReservedName=function(e){return i.isReservedName(this.reserved,e)},v.prototype.create=function(e){return new this.ctor(e)},v.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=h(this)({Writer:p,types:t,util:c}),this.decode=f(this)({Reader:l,types:t,util:c}),this.verify=y(this)({types:t,util:c}),this.fromObject=g.fromObject(this)({types:t,util:c}),this.toObject=g.toObject(this)({types:t,util:c});var i=m[e];if(i){var n=Object.create(this);n.fromObject=this.fromObject,this.fromObject=i.fromObject.bind(n),n.toObject=this.toObject,this.toObject=i.toObject.bind(n)}return this},v.prototype.encode=function(e,t){return this.setup().encode(e,t)},v.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},v.prototype.decode=function(e,t){return this.setup().decode(e,t)},v.prototype.decodeDelimited=function(e){return e instanceof l||(e=l.create(e)),this.decode(e,e.uint32())},v.prototype.verify=function(e){return this.setup().verify(e)},v.prototype.fromObject=function(e){return this.setup().fromObject(e)},v.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},v.d=function(e){return function(t){c.decorateType(t,e)}}},3970:(e,t,r)=>{"use strict";var i=t,n=r(8066),s=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function o(e,t){var r=0,i={};for(t|=0;r<e.length;)i[s[r+t]]=e[r++];return i}i.basic=o([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),i.defaults=o([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",n.emptyArray,null]),i.long=o([0,0,0,1,1],7),i.mapKey=o([0,0,0,5,5,0,0,0,1,1,0,2],2),i.packed=o([1,5,0,0,0,5,5,0,0,0,1,1,0])},8066:(e,t,r)=>{"use strict";var i,n,s=e.exports=r(4165),o=r(9009);s.codegen=r(1706),s.fetch=r(4641),s.path=r(2659),s.fs=s.inquire("fs"),s.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),i=0;i<t.length;)r[i]=e[t[i++]];return r}return[]},s.toObject=function(e){for(var t={},r=0;r<e.length;){var i=e[r++],n=e[r++];void 0!==n&&(t[i]=n)}return t};var a=/\\/g,u=/"/g;s.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},s.safeProp=function(e){return!/^[$\w_]+$/.test(e)||s.isReserved(e)?'["'+e.replace(a,"\\\\").replace(u,'\\"')+'"]':"."+e},s.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var d=/_([a-z])/g;s.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(d,(function(e,t){return t.toUpperCase()}))},s.compareFieldsById=function(e,t){return e.id-t.id},s.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(s.decorateRoot.remove(e.$type),e.$type.name=t,s.decorateRoot.add(e.$type)),e.$type;i||(i=r(3138));var n=new i(t||e.name);return s.decorateRoot.add(n),n.ctor=e,Object.defineProperty(e,"$type",{value:n,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:n,enumerable:!1}),n};var l=0;s.decorateEnum=function(e){if(e.$type)return e.$type;n||(n=r(6901));var t=new n("Enum"+l++,e);return s.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},s.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,i){var n=r.shift();if("__proto__"===n)return t;if(r.length>0)t[n]=e(t[n]||{},r,i);else{var s=t[n];s&&(i=[].concat(s).concat(i)),t[n]=i}return t}(e,t=t.split("."),r)},Object.defineProperty(s,"decorateRoot",{get:function(){return o.decorated||(o.decorated=new(r(742)))}})},1697:(e,t,r)=>{"use strict";e.exports=n;var i=r(4165);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=n.zero=new n(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var o=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var r=e>>>0,i=(e-r)/4294967296>>>0;return t&&(i=~i>>>0,r=~r>>>0,++r>4294967295&&(r=0,++i>4294967295&&(i=0))),new n(r,i)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if(i.isString(e)){if(!i.Long)return n.fromNumber(parseInt(e,10));e=i.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):s},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return i.Long?new i.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;n.fromHash=function(e){return e===o?s:new n((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},4165:function(e,t,r){"use strict";var i=t;function n(e,t,r){for(var i=Object.keys(t),n=0;n<i.length;++n)void 0!==e[i[n]]&&r||(e[i[n]]=t[i[n]]);return e}function s(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&n(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}i.asPromise=r(6781),i.base64=r(7026),i.EventEmitter=r(5570),i.float=r(5298),i.inquire=r(6116),i.utf8=r(7958),i.pool=r(804),i.LongBits=r(1697),i.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),i.global=i.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},i.isString=function(e){return"string"==typeof e||e instanceof String},i.isObject=function(e){return e&&"object"==typeof e},i.isset=i.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},i.Buffer=function(){try{var e=i.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(e){return"number"==typeof e?i.Buffer?i._Buffer_allocUnsafe(e):new i.Array(e):i.Buffer?i._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},i.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(e){return e?i.LongBits.from(e).toHash():i.LongBits.zeroHash},i.longFromHash=function(e,t){var r=i.LongBits.fromHash(e);return i.Long?i.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},i.merge=n,i.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},i.newError=s,i.ProtocolError=s("ProtocolError"),i.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},i.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var e=i.Buffer;e?(i._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},i._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):i._Buffer_from=i._Buffer_allocUnsafe=null}},2332:(e,t,r)=>{"use strict";e.exports=function(e){var t=n.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r={};e.oneofsArray.length&&t("var p={}");for(var i=0;i<e.fieldsArray.length;++i){var u=e._fieldsArray[i].resolve(),d="m"+n.safeProp(u.name);if(u.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",d,u.name),u.map)t("if(!util.isObject(%s))",d)("return%j",s(u,"object"))("var k=Object.keys(%s)",d)("for(var i=0;i<k.length;++i){"),a(t,u,"k[i]"),o(t,u,i,d+"[k[i]]")("}");else if(u.repeated)t("if(!Array.isArray(%s))",d)("return%j",s(u,"array"))("for(var i=0;i<%s.length;++i){",d),o(t,u,i,d+"[i]")("}");else{if(u.partOf){var l=n.safeProp(u.partOf.name);1===r[u.partOf.name]&&t("if(p%s===1)",l)("return%j",u.partOf.name+": multiple values"),r[u.partOf.name]=1,t("p%s=1",l)}o(t,u,i,d)}u.optional&&t("}")}return t("return null")};var i=r(6901),n=r(8066);function s(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function o(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(%s){",n)("default:")("return%j",s(t,"enum value"));for(var o=Object.keys(t.resolvedType.values),a=0;a<o.length;++a)e("case %i:",t.resolvedType.values[o[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,n)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",n)("return%j",s(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",n,n,n,n)("return%j",s(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',n)("return%j",s(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',n)("return%j",s(t,"boolean"));break;case"string":e("if(!util.isString(%s))",n)("return%j",s(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",s(t,"buffer"))}return e}function a(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",s(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",s(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",s(t,"boolean key"))}return e}},6423:(e,t,r)=>{"use strict";var i=t,n=r(3611);i[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var i="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return-1===i.indexOf("/")&&(i="/"+i),this.create({type_url:i,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",i="";if(t&&t.json&&e.type_url&&e.value){i=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var s=this.lookup(i);s&&(e=s.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof n){var o=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),i=r+("."===e.$type.fullName[0]?e.$type.fullName.substr(1):e.$type.fullName),o["@type"]=i,o}return this.toObject(e,t)}}},123:(e,t,r)=>{"use strict";e.exports=p;var i,n=r(4165),s=n.LongBits,o=n.base64,a=n.utf8;function u(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function d(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function p(){this.len=0,this.head=new u(d,0,0),this.tail=this.head,this.states=null}var c=function(){return n.Buffer?function(){return(p.create=function(){return new i})()}:function(){return new p}};function h(e,t,r){t[r]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function y(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function g(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}p.create=c(),p.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(p.alloc=n.pool(p.alloc,n.Array.prototype.subarray)),p.prototype._push=function(e,t,r){return this.tail=this.tail.next=new u(e,t,r),this.len+=t,this},f.prototype=Object.create(u.prototype),f.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},p.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},p.prototype.int32=function(e){return e<0?this._push(y,10,s.fromNumber(e)):this.uint32(e)},p.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},p.prototype.uint64=function(e){var t=s.from(e);return this._push(y,t.length(),t)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(y,t.length(),t)},p.prototype.bool=function(e){return this._push(h,1,e?1:0)},p.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(e){var t=s.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},p.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var m=n.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var i=0;i<e.length;++i)t[r+i]=e[i]};p.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(n.isString(e)){var r=p.alloc(t=o.length(e));o.decode(e,r,0),e=r}return this.uint32(t)._push(m,t,e)},p.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},p.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(d,0,0),this.len=0,this},p.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(d,0,0),this.len=0),this},p.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},p.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},p._configure=function(e){i=e,p.create=c(),i._configure()}},6673:(e,t,r)=>{"use strict";e.exports=s;var i=r(123);(s.prototype=Object.create(i.prototype)).constructor=s;var n=r(4165);function s(){i.call(this)}function o(e,t,r){e.length<40?n.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}s._configure=function(){s.alloc=n._Buffer_allocUnsafe,s.writeBytesBuffer=n.Buffer&&n.Buffer.prototype instanceof Uint8Array&&"set"===n.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var i=0;i<e.length;)t[r++]=e[i++]}},s.prototype.bytes=function(e){n.isString(e)&&(e=n._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=n.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},s._configure()},7847:(e,t,r)=>{const i=Symbol("SemVer ANY");class n{static get ANY(){return i}constructor(e,t){if(t=s(t),e instanceof n){if(e.loose===!!t.loose)return e;e=e.value}d("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===i?this.value="":this.value=this.operator+this.semver.version,d("comp",this)}parse(e){const t=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=i}toString(){return this.value}test(e){if(d("Comparator.test",e,this.options.loose),this.semver===i||e===i)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return u(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new p(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new p(this.value,t).test(e.semver);const r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),s=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=u(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),d=u(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||i||s&&o||a||d}}e.exports=n;const s=r(1388),{re:o,t:a}=r(4808),u=r(8117),d=r(952),l=r(2435),p=r(6843)},6843:(e,t,r)=>{class i{constructor(e,t){if(t=s(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!f(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,r=n.get(t);if(r)return r;const i=this.options.loose,s=i?d[l.HYPHENRANGELOOSE]:d[l.HYPHENRANGE];e=e.replace(s,O(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(d[l.COMPARATORTRIM],p),a("comparator trim",e);let u=(e=(e=(e=e.replace(d[l.TILDETRIM],c)).replace(d[l.CARETTRIM],h)).split(/\s+/).join(" ")).split(" ").map((e=>m(e,this.options))).join(" ").split(/\s+/).map((e=>R(e,this.options)));i&&(u=u.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(d[l.COMPARATORLOOSE]))))),a("range list",u);const y=new Map,g=u.map((e=>new o(e,this.options)));for(const e of g){if(f(e))return[e];y.set(e.value,e)}y.size>1&&y.has("")&&y.delete("");const v=[...y.values()];return n.set(t,v),v}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Range is required");return this.set.some((r=>g(r,t)&&e.set.some((e=>g(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(I(this.set[t],e,this.options))return!0;return!1}}e.exports=i;const n=new(r(7105))({max:1e3}),s=r(1388),o=r(7847),a=r(952),u=r(2435),{re:d,t:l,comparatorTrimReplace:p,tildeTrimReplace:c,caretTrimReplace:h}=r(4808),f=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,g=(e,t)=>{let r=!0;const i=e.slice();let n=i.pop();for(;r&&i.length;)r=i.every((e=>n.intersects(e,t))),n=i.pop();return r},m=(e,t)=>(a("comp",e,t),e=T(e,t),a("caret",e),e=_(e,t),a("tildes",e),e=w(e,t),a("xrange",e),e=A(e,t),a("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,_=(e,t)=>e.trim().split(/\s+/).map((e=>b(e,t))).join(" "),b=(e,t)=>{const r=t.loose?d[l.TILDELOOSE]:d[l.TILDE];return e.replace(r,((t,r,i,n,s)=>{let o;return a("tilde",e,t,r,i,n,s),v(r)?o="":v(i)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:v(n)?o=`>=${r}.${i}.0 <${r}.${+i+1}.0-0`:s?(a("replaceTilde pr",s),o=`>=${r}.${i}.${n}-${s} <${r}.${+i+1}.0-0`):o=`>=${r}.${i}.${n} <${r}.${+i+1}.0-0`,a("tilde return",o),o}))},T=(e,t)=>e.trim().split(/\s+/).map((e=>E(e,t))).join(" "),E=(e,t)=>{a("caret",e,t);const r=t.loose?d[l.CARETLOOSE]:d[l.CARET],i=t.includePrerelease?"-0":"";return e.replace(r,((t,r,n,s,o)=>{let u;return a("caret",e,t,r,n,s,o),v(r)?u="":v(n)?u=`>=${r}.0.0${i} <${+r+1}.0.0-0`:v(s)?u="0"===r?`>=${r}.${n}.0${i} <${r}.${+n+1}.0-0`:`>=${r}.${n}.0${i} <${+r+1}.0.0-0`:o?(a("replaceCaret pr",o),u="0"===r?"0"===n?`>=${r}.${n}.${s}-${o} <${r}.${n}.${+s+1}-0`:`>=${r}.${n}.${s}-${o} <${r}.${+n+1}.0-0`:`>=${r}.${n}.${s}-${o} <${+r+1}.0.0-0`):(a("no pr"),u="0"===r?"0"===n?`>=${r}.${n}.${s}${i} <${r}.${n}.${+s+1}-0`:`>=${r}.${n}.${s}${i} <${r}.${+n+1}.0-0`:`>=${r}.${n}.${s} <${+r+1}.0.0-0`),a("caret return",u),u}))},w=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>S(e,t))).join(" ")),S=(e,t)=>{e=e.trim();const r=t.loose?d[l.XRANGELOOSE]:d[l.XRANGE];return e.replace(r,((r,i,n,s,o,u)=>{a("xRange",e,r,i,n,s,o,u);const d=v(n),l=d||v(s),p=l||v(o),c=p;return"="===i&&c&&(i=""),u=t.includePrerelease?"-0":"",d?r=">"===i||"<"===i?"<0.0.0-0":"*":i&&c?(l&&(s=0),o=0,">"===i?(i=">=",l?(n=+n+1,s=0,o=0):(s=+s+1,o=0)):"<="===i&&(i="<",l?n=+n+1:s=+s+1),"<"===i&&(u="-0"),r=`${i+n}.${s}.${o}${u}`):l?r=`>=${n}.0.0${u} <${+n+1}.0.0-0`:p&&(r=`>=${n}.${s}.0${u} <${n}.${+s+1}.0-0`),a("xRange return",r),r}))},A=(e,t)=>(a("replaceStars",e,t),e.trim().replace(d[l.STAR],"")),R=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(d[t.includePrerelease?l.GTE0PRE:l.GTE0],"")),O=e=>(t,r,i,n,s,o,a,u,d,l,p,c,h)=>`${r=v(i)?"":v(n)?`>=${i}.0.0${e?"-0":""}`:v(s)?`>=${i}.${n}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${u=v(d)?"":v(l)?`<${+d+1}.0.0-0`:v(p)?`<${d}.${+l+1}.0-0`:c?`<=${d}.${l}.${p}-${c}`:e?`<${d}.${l}.${+p+1}-0`:`<=${u}`}`.trim(),I=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(a(e[r].semver),e[r].semver!==o.ANY&&e[r].semver.prerelease.length>0){const i=e[r].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}},2435:(e,t,r)=>{const i=r(952),{MAX_LENGTH:n,MAX_SAFE_INTEGER:s}=r(5558),{re:o,t:a}=r(4808),u=r(1388),{compareIdentifiers:d}=r(4935);class l{constructor(e,t){if(t=u(t),e instanceof l){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${e}`);if(e.length>n)throw new TypeError(`version is longer than ${n} characters`);i("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?o[a.LOOSE]:o[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(i("SemVer.compare",this.version,this.options,e),!(e instanceof l)){if("string"==typeof e&&e===this.version)return 0;e=new l(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof l||(e=new l(e,this.options)),d(this.major,e.major)||d(this.minor,e.minor)||d(this.patch,e.patch)}comparePre(e){if(e instanceof l||(e=new l(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],n=e.prerelease[t];if(i("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return d(r,n)}while(++t)}compareBuild(e){e instanceof l||(e=new l(e,this.options));let t=0;do{const r=this.build[t],n=e.build[t];if(i("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return d(r,n)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(0===d(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}}e.exports=l},6694:(e,t,r)=>{const i=r(9943);e.exports=(e,t)=>{const r=i(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},8117:(e,t,r)=>{const i=r(3276),n=r(7893),s=r(6379),o=r(8463),a=r(1897),u=r(506);e.exports=(e,t,r,d)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return i(e,r,d);case"!=":return n(e,r,d);case">":return s(e,r,d);case">=":return o(e,r,d);case"<":return a(e,r,d);case"<=":return u(e,r,d);default:throw new TypeError(`Invalid operator: ${t}`)}}},8686:(e,t,r)=>{const i=r(2435),n=r(9943),{re:s,t:o}=r(4808);e.exports=(e,t)=>{if(e instanceof i)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=s[o.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),s[o.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;s[o.COERCERTL].lastIndex=-1}else r=e.match(s[o.COERCE]);return null===r?null:n(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)}},5914:(e,t,r)=>{const i=r(2435);e.exports=(e,t,r)=>{const n=new i(e,r),s=new i(t,r);return n.compare(s)||n.compareBuild(s)}},5404:(e,t,r)=>{const i=r(2271);e.exports=(e,t)=>i(e,t,!0)},2271:(e,t,r)=>{const i=r(2435);e.exports=(e,t,r)=>new i(e,r).compare(new i(t,r))},6007:(e,t,r)=>{const i=r(9943),n=r(3276);e.exports=(e,t)=>{if(n(e,t))return null;{const r=i(e),n=i(t),s=r.prerelease.length||n.prerelease.length,o=s?"pre":"",a=s?"prerelease":"";for(const e in r)if(("major"===e||"minor"===e||"patch"===e)&&r[e]!==n[e])return o+e;return a}}},3276:(e,t,r)=>{const i=r(2271);e.exports=(e,t,r)=>0===i(e,t,r)},6379:(e,t,r)=>{const i=r(2271);e.exports=(e,t,r)=>i(e,t,r)>0},8463:(e,t,r)=>{const i=r(2271);e.exports=(e,t,r)=>i(e,t,r)>=0},6360:(e,t,r)=>{const i=r(2435);e.exports=(e,t,r,n)=>{"string"==typeof r&&(n=r,r=void 0);try{return new i(e instanceof i?e.version:e,r).inc(t,n).version}catch(e){return null}}},1897:(e,t,r)=>{const i=r(2271);e.exports=(e,t,r)=>i(e,t,r)<0},506:(e,t,r)=>{const i=r(2271);e.exports=(e,t,r)=>i(e,t,r)<=0},4551:(e,t,r)=>{const i=r(2435);e.exports=(e,t)=>new i(e,t).major},469:(e,t,r)=>{const i=r(2435);e.exports=(e,t)=>new i(e,t).minor},7893:(e,t,r)=>{const i=r(2271);e.exports=(e,t,r)=>0!==i(e,t,r)},9943:(e,t,r)=>{const{MAX_LENGTH:i}=r(5558),{re:n,t:s}=r(4808),o=r(2435),a=r(1388);e.exports=(e,t)=>{if(t=a(t),e instanceof o)return e;if("string"!=typeof e)return null;if(e.length>i)return null;if(!(t.loose?n[s.LOOSE]:n[s.FULL]).test(e))return null;try{return new o(e,t)}catch(e){return null}}},4250:(e,t,r)=>{const i=r(2435);e.exports=(e,t)=>new i(e,t).patch},8204:(e,t,r)=>{const i=r(9943);e.exports=(e,t)=>{const r=i(e,t);return r&&r.prerelease.length?r.prerelease:null}},733:(e,t,r)=>{const i=r(2271);e.exports=(e,t,r)=>i(t,e,r)},2961:(e,t,r)=>{const i=r(5914);e.exports=(e,t)=>e.sort(((e,r)=>i(r,e,t)))},9844:(e,t,r)=>{const i=r(6843);e.exports=(e,t,r)=>{try{t=new i(t,r)}catch(e){return!1}return t.test(e)}},1116:(e,t,r)=>{const i=r(5914);e.exports=(e,t)=>e.sort(((e,r)=>i(e,r,t)))},7230:(e,t,r)=>{const i=r(9943);e.exports=(e,t)=>{const r=i(e,t);return r?r.version:null}},7699:(e,t,r)=>{const i=r(4808);e.exports={re:i.re,src:i.src,tokens:i.t,SEMVER_SPEC_VERSION:r(5558).SEMVER_SPEC_VERSION,SemVer:r(2435),compareIdentifiers:r(4935).compareIdentifiers,rcompareIdentifiers:r(4935).rcompareIdentifiers,parse:r(9943),valid:r(7230),clean:r(6694),inc:r(6360),diff:r(6007),major:r(4551),minor:r(469),patch:r(4250),prerelease:r(8204),compare:r(2271),rcompare:r(733),compareLoose:r(5404),compareBuild:r(5914),sort:r(1116),rsort:r(2961),gt:r(6379),lt:r(1897),eq:r(3276),neq:r(7893),gte:r(8463),lte:r(506),cmp:r(8117),coerce:r(8686),Comparator:r(7847),Range:r(6843),satisfies:r(9844),toComparators:r(8865),maxSatisfying:r(3727),minSatisfying:r(4338),minVersion:r(1542),validRange:r(6240),outside:r(9106),gtr:r(995),ltr:r(7805),intersects:r(2013),simplifyRange:r(1338),subset:r(3122)}},5558:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:t,MAX_SAFE_COMPONENT_LENGTH:16}},952:(e,t,r)=>{var i=r(4406);const n="object"==typeof i&&i.env&&i.env.NODE_DEBUG&&/\bsemver\b/i.test(i.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=n},4935:e=>{const t=/^[0-9]+$/,r=(e,r)=>{const i=t.test(e),n=t.test(r);return i&&n&&(e=+e,r=+r),e===r?0:i&&!n?-1:n&&!i?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},1388:e=>{const t=["includePrerelease","loose","rtl"];e.exports=e=>e?"object"!=typeof e?{loose:!0}:t.filter((t=>e[t])).reduce(((e,t)=>(e[t]=!0,e)),{}):{}},4808:(e,t,r)=>{const{MAX_SAFE_COMPONENT_LENGTH:i}=r(5558),n=r(952),s=(t=e.exports={}).re=[],o=t.src=[],a=t.t={};let u=0;const d=(e,t,r)=>{const i=u++;n(e,i,t),a[e]=i,o[i]=t,s[i]=new RegExp(t,r?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","[0-9]+"),d("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),d("MAINVERSION",`(${o[a.NUMERICIDENTIFIER]})\\.(${o[a.NUMERICIDENTIFIER]})\\.(${o[a.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${o[a.NUMERICIDENTIFIERLOOSE]})\\.(${o[a.NUMERICIDENTIFIERLOOSE]})\\.(${o[a.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${o[a.NUMERICIDENTIFIER]}|${o[a.NONNUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${o[a.NUMERICIDENTIFIERLOOSE]}|${o[a.NONNUMERICIDENTIFIER]})`),d("PRERELEASE",`(?:-(${o[a.PRERELEASEIDENTIFIER]}(?:\\.${o[a.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${o[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[a.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER","[0-9A-Za-z-]+"),d("BUILD",`(?:\\+(${o[a.BUILDIDENTIFIER]}(?:\\.${o[a.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${o[a.MAINVERSION]}${o[a.PRERELEASE]}?${o[a.BUILD]}?`),d("FULL",`^${o[a.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${o[a.MAINVERSIONLOOSE]}${o[a.PRERELEASELOOSE]}?${o[a.BUILD]}?`),d("LOOSE",`^${o[a.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${o[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${o[a.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${o[a.XRANGEIDENTIFIER]})(?:\\.(${o[a.XRANGEIDENTIFIER]})(?:\\.(${o[a.XRANGEIDENTIFIER]})(?:${o[a.PRERELEASE]})?${o[a.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${o[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[a.XRANGEIDENTIFIERLOOSE]})(?:${o[a.PRERELEASELOOSE]})?${o[a.BUILD]}?)?)?`),d("XRANGE",`^${o[a.GTLT]}\\s*${o[a.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${o[a.GTLT]}\\s*${o[a.XRANGEPLAINLOOSE]}$`),d("COERCE",`(^|[^\\d])(\\d{1,${i}})(?:\\.(\\d{1,${i}}))?(?:\\.(\\d{1,${i}}))?(?:$|[^\\d])`),d("COERCERTL",o[a.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${o[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",d("TILDE",`^${o[a.LONETILDE]}${o[a.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${o[a.LONETILDE]}${o[a.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${o[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",d("CARET",`^${o[a.LONECARET]}${o[a.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${o[a.LONECARET]}${o[a.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${o[a.GTLT]}\\s*(${o[a.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${o[a.GTLT]}\\s*(${o[a.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${o[a.GTLT]}\\s*(${o[a.LOOSEPLAIN]}|${o[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${o[a.XRANGEPLAIN]})\\s+-\\s+(${o[a.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${o[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[a.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},995:(e,t,r)=>{const i=r(9106);e.exports=(e,t,r)=>i(e,t,">",r)},2013:(e,t,r)=>{const i=r(6843);e.exports=(e,t,r)=>(e=new i(e,r),t=new i(t,r),e.intersects(t))},7805:(e,t,r)=>{const i=r(9106);e.exports=(e,t,r)=>i(e,t,"<",r)},3727:(e,t,r)=>{const i=r(2435),n=r(6843);e.exports=(e,t,r)=>{let s=null,o=null,a=null;try{a=new n(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(s&&-1!==o.compare(e)||(s=e,o=new i(s,r)))})),s}},4338:(e,t,r)=>{const i=r(2435),n=r(6843);e.exports=(e,t,r)=>{let s=null,o=null,a=null;try{a=new n(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(s&&1!==o.compare(e)||(s=e,o=new i(s,r)))})),s}},1542:(e,t,r)=>{const i=r(2435),n=r(6843),s=r(6379);e.exports=(e,t)=>{e=new n(e,t);let r=new i("0.0.0");if(e.test(r))return r;if(r=new i("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const n=e.set[t];let o=null;n.forEach((e=>{const t=new i(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":o&&!s(t,o)||(o=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!o||r&&!s(r,o)||(r=o)}return r&&e.test(r)?r:null}},9106:(e,t,r)=>{const i=r(2435),n=r(7847),{ANY:s}=n,o=r(6843),a=r(9844),u=r(6379),d=r(1897),l=r(506),p=r(8463);e.exports=(e,t,r,c)=>{let h,f,y,g,m;switch(e=new i(e,c),t=new o(t,c),r){case">":h=u,f=l,y=d,g=">",m=">=";break;case"<":h=d,f=p,y=u,g="<",m="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,c))return!1;for(let r=0;r<t.set.length;++r){const i=t.set[r];let o=null,a=null;if(i.forEach((e=>{e.semver===s&&(e=new n(">=0.0.0")),o=o||e,a=a||e,h(e.semver,o.semver,c)?o=e:y(e.semver,a.semver,c)&&(a=e)})),o.operator===g||o.operator===m)return!1;if((!a.operator||a.operator===g)&&f(e,a.semver))return!1;if(a.operator===m&&y(e,a.semver))return!1}return!0}},1338:(e,t,r)=>{const i=r(9844),n=r(2271);e.exports=(e,t,r)=>{const s=[];let o=null,a=null;const u=e.sort(((e,t)=>n(e,t,r)));for(const e of u)i(e,t,r)?(a=e,o||(o=e)):(a&&s.push([o,a]),a=null,o=null);o&&s.push([o,null]);const d=[];for(const[e,t]of s)e===t?d.push(e):t||e!==u[0]?t?e===u[0]?d.push(`<=${t}`):d.push(`${e} - ${t}`):d.push(`>=${e}`):d.push("*");const l=d.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return l.length<p.length?l:t}},3122:(e,t,r)=>{const i=r(6843),n=r(7847),{ANY:s}=n,o=r(9844),a=r(2271),u=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=r.includePrerelease?[new n(">=0.0.0-0")]:[new n(">=0.0.0")]}if(1===t.length&&t[0].semver===s){if(r.includePrerelease)return!0;t=[new n(">=0.0.0")]}const i=new Set;let u,p,c,h,f,y,g;for(const t of e)">"===t.operator||">="===t.operator?u=d(u,t,r):"<"===t.operator||"<="===t.operator?p=l(p,t,r):i.add(t.semver);if(i.size>1)return null;if(u&&p){if(c=a(u.semver,p.semver,r),c>0)return null;if(0===c&&(">="!==u.operator||"<="!==p.operator))return null}for(const e of i){if(u&&!o(e,String(u),r))return null;if(p&&!o(e,String(p),r))return null;for(const i of t)if(!o(e,String(i),r))return!1;return!0}let m=!(!p||r.includePrerelease||!p.semver.prerelease.length)&&p.semver,v=!(!u||r.includePrerelease||!u.semver.prerelease.length)&&u.semver;m&&1===m.prerelease.length&&"<"===p.operator&&0===m.prerelease[0]&&(m=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,y=y||"<"===e.operator||"<="===e.operator,u)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),">"===e.operator||">="===e.operator){if(h=d(u,e,r),h===e&&h!==u)return!1}else if(">="===u.operator&&!o(u.semver,String(e),r))return!1;if(p)if(m&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===m.major&&e.semver.minor===m.minor&&e.semver.patch===m.patch&&(m=!1),"<"===e.operator||"<="===e.operator){if(f=l(p,e,r),f===e&&f!==p)return!1}else if("<="===p.operator&&!o(p.semver,String(e),r))return!1;if(!e.operator&&(p||u)&&0!==c)return!1}return!(u&&y&&!p&&0!==c||p&&g&&!u&&0!==c||v||m)},d=(e,t,r)=>{if(!e)return t;const i=a(e.semver,t.semver,r);return i>0?e:i<0||">"===t.operator&&">="===e.operator?t:e},l=(e,t,r)=>{if(!e)return t;const i=a(e.semver,t.semver,r);return i<0?e:i>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new i(e,r),t=new i(t,r);let n=!1;e:for(const i of e.set){for(const e of t.set){const t=u(i,e,r);if(n=n||null!==t,t)continue e}if(n)return!1}return!0}},8865:(e,t,r)=>{const i=r(6843);e.exports=(e,t)=>new i(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},6240:(e,t,r)=>{const i=r(6843);e.exports=(e,t)=>{try{return new i(e,t).range||"*"}catch(e){return null}}},8268:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},8006:(e,t,r)=>{"use strict";function i(e){var t=this;if(t instanceof i||(t=new i),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return t}function n(e,t,r){var i=t===e.head?new a(r,null,t,e):new a(r,t,t.next,e);return null===i.next&&(e.tail=i),null===i.prev&&(e.head=i),e.length++,i}function s(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function o(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,r,i){if(!(this instanceof a))return new a(e,t,r,i);this.list=i,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=i,i.Node=a,i.create=i,i.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},i.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},i.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},i.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},i.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},i.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},i.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},i.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,i=0;null!==r;i++)e.call(t,r.value,i,this),r=r.next},i.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,i=this.length-1;null!==r;i--)e.call(t,r.value,i,this),r=r.prev},i.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},i.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},i.prototype.map=function(e,t){t=t||this;for(var r=new i,n=this.head;null!==n;)r.push(e.call(t,n.value,this)),n=n.next;return r},i.prototype.mapReverse=function(e,t){t=t||this;for(var r=new i,n=this.tail;null!==n;)r.push(e.call(t,n.value,this)),n=n.prev;return r},i.prototype.reduce=function(e,t){var r,i=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,r=this.head.value}for(var n=0;null!==i;n++)r=e(r,i.value,n),i=i.next;return r},i.prototype.reduceReverse=function(e,t){var r,i=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,r=this.tail.value}for(var n=this.length-1;null!==i;n--)r=e(r,i.value,n),i=i.prev;return r},i.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},i.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},i.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new i;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=0,s=this.head;null!==s&&n<e;n++)s=s.next;for(;null!==s&&n<t;n++,s=s.next)r.push(s.value);return r},i.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new i;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=this.length,s=this.tail;null!==s&&n>t;n--)s=s.prev;for(;null!==s&&n>e;n--,s=s.prev)r.push(s.value);return r},i.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,s=this.head;null!==s&&i<e;i++)s=s.next;var o=[];for(i=0;s&&i<t;i++)o.push(s.value),s=this.removeNode(s);for(null===s&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev),i=0;i<r.length;i++)s=n(this,s,r[i]);return o},i.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var i=r.prev;r.prev=r.next,r.next=i}return this.head=t,this.tail=e,this};try{r(8268)(i)}catch(e){}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.amdO={},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};(()=>{"use strict";var e=__webpack_require__(3448),t=__webpack_require__(7808),r=__webpack_require__(9396),i=__webpack_require__.n(r),n=__webpack_require__(8834);const s=["bool","string","bytes","int32","int64","uint32","uint64","sint32","sint64","fixed32","fixed64","sfixed32","sfixed64","double","float"],o=e=>s.includes(e),a=(e,t)=>e.optional&&void 0===t?null:"bytes"===e.type?i().wrap(t).toString("hex"):e.long?Number.isSafeInteger(t.toNumber())?t.toNumber():t.toString():t;function u(e,t){const r=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]])}return r}(e,[]),i={};return Object.keys(t).forEach((e=>{const n=t[e],s=r[e];if(n.repeated)if(o(n.type))i[e]=s.map((e=>a(n,e)));else if("valuesById"in n.resolvedType)i[e]=s;else{if(!("fields"in n.resolvedType))throw new Error(`case not handled for repeated key: ${e}`);i[e]=s.map((e=>u(e,n.resolvedType.fields)))}else if(o(n.type))i[e]=a(n,s);else if("valuesById"in n.resolvedType)i[e]=n.resolvedType.valuesById[s];else{if(!n.resolvedType.fields)throw new Error(`case not handled: ${e}`);i[e]=u(s,n.resolvedType.fields)}})),i}const d=(e,t)=>{if("bytes"===e)return"string"!=typeof t||t?n.Buffer.from(t,"hex"):t;if("number"==typeof t&&!Number.isSafeInteger(t))throw new RangeError("field value is not within safe integer range");return t};function l(e,t){const r={};return e.fields?(Object.keys(e.fields).forEach((i=>{const n=e.fields[i],s=t[i];if(void 0!==s)if(o(n.type))n.repeated?r[i]=s.map((e=>d(n.type,e))):r[i]=d(n.type,s);else if(n.repeated){const t=e.lookupTypeOrEnum(n.type);r[i]=s.map((e=>l(t,e)))}else if("object"==typeof s&&null!==s){const t=e.lookupType(n.type);r[i]=l(t,s)}else if("number"==typeof s){const t=e.lookupEnum(n.type);r[i]=t.values[s]}else r[i]=s})),r):r}const p=(e,t)=>{const r=l(e,t),n=e.fromObject(r),s=e.encode(n).finish(),o=new(i())(s.byteLength);return o.append(s),o.reset(),o},c=(e,t)=>{const r=e.lookupType(t);let i=e.lookupEnum("MessageType").values[`MessageType_${t}`];return!i&&r.options&&(i=r.options["(wire_type)"]),{Message:r,messageType:i}},h=e=>{const{typeId:t}=(e=>({typeId:e.readUint16(),length:e.readUint32()}))(e);return{typeId:t,buffer:e}};var f=Object.freeze({__proto__:null,decode:h,decodeChunked:e=>{const t=i().wrap(e,void 0,void 0,!0),{sharp1:r,sharp2:n,typeId:s,length:o}=(e=>({sharp1:e.readByte(),sharp2:e.readByte(),typeId:e.readUint16(),length:e.readUint32()}))(t);if(35!==r||35!==n)throw new Error("Didn't receive expected header signature.");return{length:o,typeId:s,restBuffer:t}}});function y(e,t){const{addTrezorHeaders:r,chunked:n,messageType:s}=t,o=(r?8:6)+e.limit,a=new(i())(o);if(r&&(a.writeByte(35),a.writeByte(35)),a.writeUint16(s),a.writeUint32(e.limit),a.append(e.buffer),a.reset(),!1===n)return a;const u=[],d=Math.floor((a.limit-1)/63)+1||1;for(let e=0;e<d;e++){const t=63*e,r=Math.min(63*(e+1),a.limit),i=a.slice(t,r);i.compact(),u.push(i.buffer)}return u}const g=(e,t,r)=>{const{Message:i,messageType:n}=c(e,t);return y(p(i,r),{addTrezorHeaders:!0,chunked:!0,messageType:n})},m="Wrong result type.";function v(e){if(null==e)return null;if("string"!=typeof e)throw new Error(m);return e}var _,b,T,E,w,S,A,R,O,I,x,C,M,k,N,D,P,q,L,B,F,j,U,H,$,G,z,W,V,X,K,Y,J,Z,Q,ee,te,re,ie,ne,se=Object.freeze({__proto__:null,info:function(e){if("object"!=typeof e||null==e)throw new Error("Wrong result type.");const{version:t}=e;if("string"!=typeof t)throw new Error(m);return{version:t,configured:!!e.configured}},version:function(e){if("string"!=typeof e)throw new Error(m);return e.trim()},devices:function(e){if("object"!=typeof e)throw new Error(m);if(!(e instanceof Array))throw new Error(m);return e.map((e=>{if("object"!=typeof e||null==e)throw new Error(m);const{path:t}=e;if("string"!=typeof t)throw new Error(m);return{path:t.toString(),session:v(e.session),debugSession:v(e.debugSession),product:e.product,vendor:e.vendor,debug:!!e.debug}}))},acquire:function(e){if("object"!=typeof e||null==e)throw new Error(m);const{session:t}=e;if("string"!=typeof t&&"number"!=typeof t)throw new Error(m);return t.toString()},call:function(e){if("object"!=typeof e||null==e)throw new Error(m);const{type:t}=e;if("string"!=typeof t)throw new Error(m);const{message:r}=e;if("object"!=typeof r||null==r)throw new Error(m);return{type:t,message:r}}});!function(e){e[e.OT_UNKNOWN=0]="OT_UNKNOWN",e[e.MARKET=1]="MARKET",e[e.LIMIT=2]="LIMIT",e[e.OT_RESERVED=3]="OT_RESERVED"}(_||(_={})),function(e){e[e.SIDE_UNKNOWN=0]="SIDE_UNKNOWN",e[e.BUY=1]="BUY",e[e.SELL=2]="SELL"}(b||(b={})),function(e){e[e.TIF_UNKNOWN=0]="TIF_UNKNOWN",e[e.GTE=1]="GTE",e[e.TIF_RESERVED=2]="TIF_RESERVED",e[e.IOC=3]="IOC"}(T||(T={})),function(e){e[e.SPENDADDRESS=0]="SPENDADDRESS",e[e.SPENDMULTISIG=1]="SPENDMULTISIG",e[e.EXTERNAL=2]="EXTERNAL",e[e.SPENDWITNESS=3]="SPENDWITNESS",e[e.SPENDP2SHWITNESS=4]="SPENDP2SHWITNESS",e[e.SPENDTAPROOT=5]="SPENDTAPROOT"}(E||(E={})),function(e){e[e.PAYTOADDRESS=0]="PAYTOADDRESS",e[e.PAYTOSCRIPTHASH=1]="PAYTOSCRIPTHASH",e[e.PAYTOMULTISIG=2]="PAYTOMULTISIG",e[e.PAYTOOPRETURN=3]="PAYTOOPRETURN",e[e.PAYTOWITNESS=4]="PAYTOWITNESS",e[e.PAYTOP2SHWITNESS=5]="PAYTOP2SHWITNESS",e[e.PAYTOTAPROOT=6]="PAYTOTAPROOT"}(w||(w={})),function(e){e[e.SSGen=0]="SSGen",e[e.SSRTX=1]="SSRTX"}(S||(S={})),function(e){e[e.BITCOIN=0]="BITCOIN",e[e.MILLIBITCOIN=1]="MILLIBITCOIN",e[e.MICROBITCOIN=2]="MICROBITCOIN",e[e.SATOSHI=3]="SATOSHI"}(A||(A={})),function(e){e[e.TXINPUT=0]="TXINPUT",e[e.TXOUTPUT=1]="TXOUTPUT",e[e.TXMETA=2]="TXMETA",e[e.TXFINISHED=3]="TXFINISHED",e[e.TXEXTRADATA=4]="TXEXTRADATA",e[e.TXORIGINPUT=5]="TXORIGINPUT",e[e.TXORIGOUTPUT=6]="TXORIGOUTPUT"}(R||(R={})),function(e){e[e.LEDGER=0]="LEDGER",e[e.ICARUS=1]="ICARUS",e[e.ICARUS_TREZOR=2]="ICARUS_TREZOR"}(O||(O={})),function(e){e[e.BASE=0]="BASE",e[e.BASE_SCRIPT_KEY=1]="BASE_SCRIPT_KEY",e[e.BASE_KEY_SCRIPT=2]="BASE_KEY_SCRIPT",e[e.BASE_SCRIPT_SCRIPT=3]="BASE_SCRIPT_SCRIPT",e[e.POINTER=4]="POINTER",e[e.POINTER_SCRIPT=5]="POINTER_SCRIPT",e[e.ENTERPRISE=6]="ENTERPRISE",e[e.ENTERPRISE_SCRIPT=7]="ENTERPRISE_SCRIPT",e[e.BYRON=8]="BYRON",e[e.REWARD=14]="REWARD",e[e.REWARD_SCRIPT=15]="REWARD_SCRIPT"}(I||(I={})),function(e){e[e.PUB_KEY=0]="PUB_KEY",e[e.ALL=1]="ALL",e[e.ANY=2]="ANY",e[e.N_OF_K=3]="N_OF_K",e[e.INVALID_BEFORE=4]="INVALID_BEFORE",e[e.INVALID_HEREAFTER=5]="INVALID_HEREAFTER"}(x||(x={})),function(e){e[e.HIDE=0]="HIDE",e[e.BECH32=1]="BECH32",e[e.POLICY_ID=2]="POLICY_ID"}(C||(C={})),function(e){e[e.STAKE_REGISTRATION=0]="STAKE_REGISTRATION",e[e.STAKE_DEREGISTRATION=1]="STAKE_DEREGISTRATION",e[e.STAKE_DELEGATION=2]="STAKE_DELEGATION",e[e.STAKE_POOL_REGISTRATION=3]="STAKE_POOL_REGISTRATION"}(M||(M={})),function(e){e[e.SINGLE_HOST_IP=0]="SINGLE_HOST_IP",e[e.SINGLE_HOST_NAME=1]="SINGLE_HOST_NAME",e[e.MULTIPLE_HOST_NAME=2]="MULTIPLE_HOST_NAME"}(k||(k={})),function(e){e[e.NONE=0]="NONE",e[e.CATALYST_REGISTRATION_SIGNATURE=1]="CATALYST_REGISTRATION_SIGNATURE"}(N||(N={})),function(e){e[e.ORDINARY_TRANSACTION=0]="ORDINARY_TRANSACTION",e[e.POOL_REGISTRATION_AS_OWNER=1]="POOL_REGISTRATION_AS_OWNER",e[e.MULTISIG_TRANSACTION=2]="MULTISIG_TRANSACTION"}(D||(D={})),function(e){e[e.BYRON_WITNESS=0]="BYRON_WITNESS",e[e.SHELLEY_WITNESS=1]="SHELLEY_WITNESS"}(P||(P={})),function(e){e[e.Failure_UnexpectedMessage=1]="Failure_UnexpectedMessage",e[e.Failure_ButtonExpected=2]="Failure_ButtonExpected",e[e.Failure_DataError=3]="Failure_DataError",e[e.Failure_ActionCancelled=4]="Failure_ActionCancelled",e[e.Failure_PinExpected=5]="Failure_PinExpected",e[e.Failure_PinCancelled=6]="Failure_PinCancelled",e[e.Failure_PinInvalid=7]="Failure_PinInvalid",e[e.Failure_InvalidSignature=8]="Failure_InvalidSignature",e[e.Failure_ProcessError=9]="Failure_ProcessError",e[e.Failure_NotEnoughFunds=10]="Failure_NotEnoughFunds",e[e.Failure_NotInitialized=11]="Failure_NotInitialized",e[e.Failure_PinMismatch=12]="Failure_PinMismatch",e[e.Failure_WipeCodeMismatch=13]="Failure_WipeCodeMismatch",e[e.Failure_InvalidSession=14]="Failure_InvalidSession",e[e.Failure_FirmwareError=99]="Failure_FirmwareError"}(q||(q={})),function(e){e[e.ButtonRequest_Other=1]="ButtonRequest_Other",e[e.ButtonRequest_FeeOverThreshold=2]="ButtonRequest_FeeOverThreshold",e[e.ButtonRequest_ConfirmOutput=3]="ButtonRequest_ConfirmOutput",e[e.ButtonRequest_ResetDevice=4]="ButtonRequest_ResetDevice",e[e.ButtonRequest_ConfirmWord=5]="ButtonRequest_ConfirmWord",e[e.ButtonRequest_WipeDevice=6]="ButtonRequest_WipeDevice",e[e.ButtonRequest_ProtectCall=7]="ButtonRequest_ProtectCall",e[e.ButtonRequest_SignTx=8]="ButtonRequest_SignTx",e[e.ButtonRequest_FirmwareCheck=9]="ButtonRequest_FirmwareCheck",e[e.ButtonRequest_Address=10]="ButtonRequest_Address",e[e.ButtonRequest_PublicKey=11]="ButtonRequest_PublicKey",e[e.ButtonRequest_MnemonicWordCount=12]="ButtonRequest_MnemonicWordCount",e[e.ButtonRequest_MnemonicInput=13]="ButtonRequest_MnemonicInput",e[e._Deprecated_ButtonRequest_PassphraseType=14]="_Deprecated_ButtonRequest_PassphraseType",e[e.ButtonRequest_UnknownDerivationPath=15]="ButtonRequest_UnknownDerivationPath",e[e.ButtonRequest_RecoveryHomepage=16]="ButtonRequest_RecoveryHomepage",e[e.ButtonRequest_Success=17]="ButtonRequest_Success",e[e.ButtonRequest_Warning=18]="ButtonRequest_Warning",e[e.ButtonRequest_PassphraseEntry=19]="ButtonRequest_PassphraseEntry",e[e.ButtonRequest_PinEntry=20]="ButtonRequest_PinEntry"}(L||(L={})),function(e){e[e.PinMatrixRequestType_Current=1]="PinMatrixRequestType_Current",e[e.PinMatrixRequestType_NewFirst=2]="PinMatrixRequestType_NewFirst",e[e.PinMatrixRequestType_NewSecond=3]="PinMatrixRequestType_NewSecond",e[e.PinMatrixRequestType_WipeCodeFirst=4]="PinMatrixRequestType_WipeCodeFirst",e[e.PinMatrixRequestType_WipeCodeSecond=5]="PinMatrixRequestType_WipeCodeSecond",e[e.PinMatrixRequestType_BackupFirst=6]="PinMatrixRequestType_BackupFirst",e[e.PinMatrixRequestType_BackupSecond=7]="PinMatrixRequestType_BackupSecond"}(B||(B={})),function(e){e[e.UINT=1]="UINT",e[e.INT=2]="INT",e[e.BYTES=3]="BYTES",e[e.STRING=4]="STRING",e[e.BOOL=5]="BOOL",e[e.ADDRESS=6]="ADDRESS",e[e.ARRAY=7]="ARRAY",e[e.STRUCT=8]="STRUCT"}(F||(F={})),function(e){e[e.Bip39=0]="Bip39",e[e.Slip39_Basic=1]="Slip39_Basic",e[e.Slip39_Advanced=2]="Slip39_Advanced"}(j||(j={})),function(e){e[e.Strict=0]="Strict",e[e.PromptAlways=1]="PromptAlways",e[e.PromptTemporarily=2]="PromptTemporarily"}(U||(U={})),function(e){e[e.Capability_Bitcoin=1]="Capability_Bitcoin",e[e.Capability_Bitcoin_like=2]="Capability_Bitcoin_like",e[e.Capability_Binance=3]="Capability_Binance",e[e.Capability_Cardano=4]="Capability_Cardano",e[e.Capability_Crypto=5]="Capability_Crypto",e[e.Capability_EOS=6]="Capability_EOS",e[e.Capability_Ethereum=7]="Capability_Ethereum",e[e.Capability_Lisk=8]="Capability_Lisk",e[e.Capability_Monero=9]="Capability_Monero",e[e.Capability_NEM=10]="Capability_NEM",e[e.Capability_Ripple=11]="Capability_Ripple",e[e.Capability_Stellar=12]="Capability_Stellar",e[e.Capability_Tezos=13]="Capability_Tezos",e[e.Capability_U2F=14]="Capability_U2F",e[e.Capability_Shamir=15]="Capability_Shamir",e[e.Capability_ShamirGroups=16]="Capability_ShamirGroups",e[e.Capability_PassphraseEntry=17]="Capability_PassphraseEntry"}(H||(H={})),function(e){e[e.SeedEncExportType_NO=0]="SeedEncExportType_NO",e[e.SeedEncExportType_YES=1]="SeedEncExportType_YES",e[e.MnemonicPlainExportType_YES=2]="MnemonicPlainExportType_YES"}($||($={})),function(e){e[e.DISABLE=0]="DISABLE",e[e.ENABLE=1]="ENABLE",e[e.REFRESH=2]="REFRESH"}(G||(G={})),function(e){e[e.RecoveryDeviceType_ScrambledWords=0]="RecoveryDeviceType_ScrambledWords",e[e.RecoveryDeviceType_Matrix=1]="RecoveryDeviceType_Matrix"}(z||(z={})),function(e){e[e.WordRequestType_Plain=0]="WordRequestType_Plain",e[e.WordRequestType_Matrix9=1]="WordRequestType_Matrix9",e[e.WordRequestType_Matrix6=2]="WordRequestType_Matrix6"}(W||(W={})),function(e){e[e.SeedRequestType_Gen=0]="SeedRequestType_Gen",e[e.SeedRequestType_EncExport=1]="SeedRequestType_EncExport",e[e.SeedRequestType_EncImport=2]="SeedRequestType_EncImport"}(V||(V={})),function(e){e[e.WL_OperationType_Add=0]="WL_OperationType_Add",e[e.WL_OperationType_Delete=1]="WL_OperationType_Delete",e[e.WL_OperationType_Inquire=2]="WL_OperationType_Inquire"}(X||(X={})),function(e){e[e.MosaicLevy_Absolute=1]="MosaicLevy_Absolute",e[e.MosaicLevy_Percentile=2]="MosaicLevy_Percentile"}(K||(K={})),function(e){e[e.SupplyChange_Increase=1]="SupplyChange_Increase",e[e.SupplyChange_Decrease=2]="SupplyChange_Decrease"}(Y||(Y={})),function(e){e[e.CosignatoryModification_Add=1]="CosignatoryModification_Add",e[e.CosignatoryModification_Delete=2]="CosignatoryModification_Delete"}(J||(J={})),function(e){e[e.ImportanceTransfer_Activate=1]="ImportanceTransfer_Activate",e[e.ImportanceTransfer_Deactivate=2]="ImportanceTransfer_Deactivate"}(Z||(Z={})),function(e){e[e.NATIVE=0]="NATIVE",e[e.ALPHANUM4=1]="ALPHANUM4",e[e.ALPHANUM12=2]="ALPHANUM12"}(Q||(Q={})),function(e){e[e.NONE=0]="NONE",e[e.TEXT=1]="TEXT",e[e.ID=2]="ID",e[e.HASH=3]="HASH",e[e.RETURN=4]="RETURN"}(ee||(ee={})),function(e){e[e.ACCOUNT=0]="ACCOUNT",e[e.PRE_AUTH=1]="PRE_AUTH",e[e.HASH=2]="HASH"}(te||(te={})),function(e){e[e.Implicit=0]="Implicit",e[e.Originated=1]="Originated"}(re||(re={})),function(e){e[e.Yay=0]="Yay",e[e.Nay=1]="Nay",e[e.Pass=2]="Pass"}(ie||(ie={})),function(e){e[e.Default=0]="Default",e[e.Factory_Only=1]="Factory_Only"}(ne||(ne={})),e.util.Long=t,e.configure();var oe={check:se,buildOne:function(e,t,r){const{Message:i,messageType:n}=c(e,t);return y(p(i,r),{addTrezorHeaders:!1,chunked:!1,messageType:n})},buildBuffers:(e,t,r)=>{const n=g(e,t,r),s=[];for(const e of n){const t=new(i())(64);t.writeByte(63),t.append(e),t.reset(),s.push(t)}return s},buildEncodeBuffers:g,receiveOne:function(e,t){const r=i().wrap(t,"hex"),{typeId:n,buffer:s}=h(r),{Message:o,messageName:a}=((e,t)=>{const r=e.lookupEnum("MessageType").valuesById[t].replace("MessageType_","");return{Message:e.lookupType(r),messageName:r}})(e,n),d=((e,t)=>{const r=t.toBuffer(),i=new Uint8Array(r),n=e.decode(i);return u(n,n.$type.fields)})(o,s);return{message:d,type:a}},parseConfigure:function(t){return"string"==typeof t?e.Root.fromJSON(JSON.parse(t)):e.Root.fromJSON(t)},decodeProtocol:f},ae=__webpack_require__(6139).Promise;function ue(e,t){let r,i=e=>{},n=e=>{};const s=new ae(((t,s)=>{return o=this,a=void 0,d=function*(){if(i=t,n=s,"function"==typeof e)try{yield e()}catch(e){s(e)}"string"==typeof e&&(r=e)},new((u=void 0)||(u=ae))((function(e,t){function r(e){try{n(d.next(e))}catch(e){t(e)}}function i(e){try{n(d.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof u?n:new u((function(e){e(n)}))).then(r,i)}n((d=d.apply(o,a||[])).next())}));var o,a,u,d}));return{id:r,data:t,resolve:i,reject:n,promise:s}}class de extends Error{constructor(e){var t;super(),this.errorCode=le.UnknownError,this.message="",this.params={};const r=pe;if(this.message=r[le.UnknownError],"string"==typeof e)this.errorCode=le.UnknownError,this.message=e;else{const s=null!==(t=e.message||r[e.errorCode])&&void 0!==t?t:"";s&&(this.message=(n=e,"string"!=typeof(i=s)?i:i.replace(/\{([^}]+)\}/g,((e,t)=>n[t]||"?")))),this.params=e.params,this.errorCode=e.errorCode}var i,n;this.name="HardwareError"}}const le={UnknownError:0,DeviceFwException:101,DeviceUnexpectedMode:102,DeviceListNotInitialized:103,SelectDevice:104,DeviceNotFound:105,DeviceInitializeFailed:106,DeviceInterruptedFromOutside:107,DeviceUnexpectedBootloaderMode:108,DeviceInterruptedFromUser:109,DeviceCheckDeviceIdError:110,DeviceNotSupportPassphrase:111,DeviceCheckPassphraseStateError:112,DeviceNotOpenedPassphrase:113,DeviceOpenedPassphrase:114,NotInitialized:200,IFrameNotInitialized:300,IFrameAleradyInitialized:301,IFrameLoadFail:302,IframeTimeout:303,IframeBlocked:304,CallMethodError:400,CallMethodNotResponse:404,CallMethodInvalidParameter:405,FirmwareUpdateDownloadFailed:406,CallMethodNeedUpgradeFirmware:407,CallMethodDeprecated:408,NetworkError:500,TransportNotConfigured:600,TransportCallInProgress:601,TransportNotFound:602,TransportInvalidProtobuf:603,BleScanError:700,BlePermissionError:701,BleLocationError:702,BleRequiredUUID:703,BleConnectedError:704,BleDeviceNotBonded:705,BleServiceNotFound:706,BleCharacteristicNotFound:707,BleMonitorError:708,BleCharacteristicNotifyError:709,BleWriteCharacteristicError:710,BleAlreadyConnected:711,RuntimeError:800,PinInvalid:801,PinCancelled:802,ActionCancelled:803,FirmwareError:804,ResponseUnexpectTypeError:805,BridgeNetworkError:806,BridgeTimeoutError:807,BridgeNotInstalled:808,PollingTimeout:809,PollingStop:810,BlindSignDisabled:811},pe={[le.UnknownError]:"Unknown error occurred. Check message property.",[le.DeviceFwException]:"Firmware version mismatch",[le.DeviceUnexpectedMode]:"Device unexpected mode",[le.DeviceListNotInitialized]:"Device list is not initialized",[le.SelectDevice]:"Please select the connected device",[le.DeviceNotFound]:"Device not found",[le.DeviceInitializeFailed]:"Device initialization failed",[le.DeviceInterruptedFromOutside]:"Device interrupted",[le.DeviceInterruptedFromUser]:"Device interrupted",[le.DeviceUnexpectedBootloaderMode]:"Device should be in bootloader mode",[le.DeviceCheckDeviceIdError]:"Device Id in the features is not same.",[le.DeviceNotSupportPassphrase]:"Device not support passphrase",[le.DeviceCheckPassphraseStateError]:"Device passphrase state error",[le.DeviceNotOpenedPassphrase]:"Device not opened passphrase",[le.DeviceOpenedPassphrase]:"Device opened passphrase",[le.NotInitialized]:"Not initialized",[le.IFrameNotInitialized]:"IFrame not initialized",[le.IFrameAleradyInitialized]:"IFrame alerady initialized",[le.IFrameLoadFail]:"IFrame load fail",[le.IframeTimeout]:"init iframe time out",[le.IframeBlocked]:"IFrame blocked",[le.CallMethodError]:"Runtime errors during method execution",[le.CallMethodNotResponse]:"Method does not responding",[le.CallMethodInvalidParameter]:"Call method invalid parameter",[le.FirmwareUpdateDownloadFailed]:"Firmware update download failed",[le.CallMethodNeedUpgradeFirmware]:"Call method need upgrade firmware",[le.CallMethodDeprecated]:"Call method is deprecated",[le.NetworkError]:"Network request error",[le.TransportNotConfigured]:"Transport not configured",[le.TransportCallInProgress]:"Transport call in progress",[le.TransportNotFound]:"Transport not found",[le.TransportInvalidProtobuf]:"Transport invalid protobuf",[le.BleScanError]:"BLE scan error",[le.BlePermissionError]:"Bluetooth required to be turned on",[le.BleLocationError]:"Device is not authorized to use BluetoothLE",[le.BleRequiredUUID]:"uuid is required",[le.BleConnectedError]:"connected error is always runtime error",[le.BleDeviceNotBonded]:"device is not bonded",[le.BleServiceNotFound]:"BLEServiceNotFound: service not found",[le.BleCharacteristicNotFound]:"BLEServiceNotFound: service not found",[le.BleMonitorError]:"Monitor Error: characteristic not found",[le.BleCharacteristicNotifyError]:"Characteristic Notify Error",[le.BleWriteCharacteristicError]:"Write Characteristic Error",[le.BleAlreadyConnected]:"Already connected to device",[le.RuntimeError]:"Runtime error",[le.PinInvalid]:"Pin invalid",[le.PinCancelled]:"Pin cancelled",[le.ActionCancelled]:"Action cancelled by user",[le.FirmwareError]:"Firmware installation failed",[le.ResponseUnexpectTypeError]:"Response type is not expected",[le.BridgeNetworkError]:"Bridge network error",[le.BridgeTimeoutError]:"Bridge network timeout",[le.BridgeNotInstalled]:"Bridge not installed",[le.PollingTimeout]:"Polling timeout",[le.PollingStop]:"Polling stop",[le.BlindSignDisabled]:"Please confirm the BlindSign enabled"},ce=(e,t,r)=>new de("string"==typeof e?e:{errorCode:e,message:null!=t?t:"",params:r}),he=e=>e&&e.error instanceof de?{error:e.error.message,code:e.error.errorCode,params:e.error.params}:e&&e.error instanceof Error?{error:e.error.message,code:e.error.code}:e;var fe=Object.freeze({__proto__:null,HardwareError:de,HardwareErrorCode:le,HardwareErrorCodeMessage:pe,TypedError:ce,serializeError:he,CreateErrorByMessage:e=>{for(const t of Object.values(le))if(pe[t]===e)return ce(t);return new de(e)}}),ye=__webpack_require__(9644),ge=__webpack_require__.n(ye),me=__webpack_require__(6139).Promise;function ve(e,t,r,i){return new(r||(r=me))((function(n,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((i=i.apply(e,t||[])).next())}))}function _e(e){return"string"==typeof e?"text/plain":"application/json"}function be(e){try{return JSON.parse(e)}catch(t){return e}}function Te(e){var t;return ve(this,void 0,void 0,(function*(){const r={url:e.url,method:e.method,data:(i=e.body,"string"==typeof i?i:JSON.stringify(i)),withCredentials:!1,headers:{"Content-Type":_e(null==e.body?"":e.body)},timeout:null!==(t=e.timeout)&&void 0!==t?t:void 0};var i;const n=yield ge().request(r);if(200==+n.status)return be(n.data);const s=be(n.data);throw"object"==typeof s&&null!=s&&null!=s.error?new de({errorCode:le.NetworkError,message:s.error}):new de({errorCode:le.NetworkError,message:n.data})}))}const{check:Ee,buildOne:we,receiveOne:Se,parseConfigure:Ae}=oe;class Re{constructor(e){this.configured=!1,this.stopped=!1,this.url=null==e?"http://localhost:21320":e}_post(e){return this.stopped?me.reject(fe.TypedError("Transport stopped.")):Te(Object.assign(Object.assign({},e),{method:"POST",url:this.url+e.url}))}init(e){return ve(this,void 0,void 0,(function*(){return this.Log=e,yield this._silentInit()}))}_silentInit(){return ve(this,void 0,void 0,(function*(){const e=yield Te({url:this.url,method:"POST",timeout:3e3});return Ee.info(e).version}))}configure(e){const t=Ae(e);this.configured=!0,this._messages=t}listen(e){return ve(this,void 0,void 0,(function*(){if(null===e)throw fe.TypedError("Http-Transport does not support listen without previous.");const t=yield this._post({url:"/listen",body:e});return Ee.devices(t)}))}enumerate(){return ve(this,void 0,void 0,(function*(){const e=yield this._post({url:"/enumerate"});return Ee.devices(e)}))}_acquireMixed(e){const t=null==e.previous?"null":e.previous,r=`/acquire/${e.path}/${t}`;return this._post({url:r})}acquire(e){return ve(this,void 0,void 0,(function*(){const t=yield this._acquireMixed(e);return Ee.acquire(t)}))}release(e,t){return ve(this,void 0,void 0,(function*(){const r=this._post({url:`/release/${e}`});t||(yield r)}))}call(e,t,r){return ve(this,void 0,void 0,(function*(){if(null==this._messages)throw fe.TypedError(le.TransportNotConfigured);const i=this._messages;this.Log.debug("call-"," name: ",t," data: ",r);const n=we(i,t,r).toString("hex"),s=yield this._post({url:`/call/${e}`,body:n,timeout:"Initialize"===t?1e4:void 0});if("string"!=typeof s)throw fe.TypedError(le.NetworkError,"Returning data is not string.");const o=Se(i,s);return Ee.call(o)}))}post(e,t,r){return ve(this,void 0,void 0,(function*(){if(null==this._messages)throw fe.TypedError(le.TransportNotConfigured);const i=this._messages,n=we(i,t,r).toString("hex");yield this._post({url:`/post/${e}`,body:n})}))}read(e){return ve(this,void 0,void 0,(function*(){if(null==this._messages)throw fe.TypedError(le.TransportNotConfigured);const t=this._messages,r=yield this._post({url:`/read/${e}`});if("string"!=typeof r)throw fe.TypedError(le.NetworkError,"Returning data is not string.");const i=Se(t,r);return Ee.call(i)}))}requestDevice(){return me.reject()}stop(){this.stopped=!0}cancel(){this.Log.debug("canceled")}}var Oe=__webpack_require__(6139).Promise,Ie=__webpack_require__(8834).Buffer;function xe(e,t,r,i){return new(r||(r=Oe))((function(n,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((i=i.apply(e,t||[])).next())}))}const{parseConfigure:Ce,buildEncodeBuffers:Me,decodeProtocol:ke,receiveOne:Ne,check:De}=oe,Pe=[{vendorId:4617,productId:21440},{vendorId:4617,productId:21441}];class qe{constructor(){this.stopped=!1,this.configured=!1,this._lastDevices=[],this.configurationId=1,this.endpointId=1,this.interfaceId=0}init(e){this.Log=e;const{usb:t}=navigator;if(!t)throw fe.TypedError(le.RuntimeError,"WebUSB is not supported by current browsers");this.usb=t}configure(e){const t=Ce(e);this.configured=!0,this._messages=t}enumerate(){return xe(this,void 0,void 0,(function*(){return yield this._getDeviceList()}))}_getDeviceList(){return xe(this,void 0,void 0,(function*(){if(!this.usb)return[];const e=(yield this.usb.getDevices()).filter((e=>{const t=Pe.some((t=>e.vendorId===t.vendorId&&e.productId===t.productId)),r="string"==typeof e.serialNumber&&e.serialNumber.length>0;return t&&r}));return this._lastDevices=e.map((e=>({path:e.serialNumber,device:e}))),this._lastDevices}))}acquire(e){var t;return xe(this,void 0,void 0,(function*(){if(e.path)try{return yield this.connect(null!==(t=e.path)&&void 0!==t?t:"",!0),yield Oe.resolve(e.path)}catch(e){throw this.Log.debug("acquire error: ",e),e}}))}_findDevice(e){const t=this._lastDevices.find((t=>t.path===e));if(null==t)throw new Error("Action was interrupted.");return t.device}connect(e,t){return xe(this,void 0,void 0,(function*(){for(let r=0;r<5;r++){r>0&&(yield new Oe((e=>setTimeout((()=>e(void 0)),200*r))));try{return yield this._connectIn(e,t)}catch(e){if(4===r)throw e}}}))}_connectIn(e,t){return xe(this,void 0,void 0,(function*(){const r=yield this._findDevice(e);if(yield r.open(),t){yield r.selectConfiguration(this.configurationId);try{yield r.reset()}catch(e){}}yield r.claimInterface(this.interfaceId)}))}call(e,t,r){return xe(this,void 0,void 0,(function*(){if(null==this._messages)throw fe.TypedError(le.TransportNotConfigured);const i=yield this._findDevice(e);if(!i)throw fe.TypedError(le.DeviceNotFound);const n=this._messages;this.Log.debug("call-"," name: ",t," data: ",r);const s=Me(n,t,r);for(const t of s){const r=new Uint8Array(64);r[0]=63,r.set(new Uint8Array(t),1),i.opened||(yield this.connect(e,!1)),yield i.transferOut(this.endpointId,r)}const o=yield this._receive(e);if("string"!=typeof o)throw fe.TypedError(le.NetworkError,"Returning data is not string.");const a=Ne(n,o);return De.call(a)}))}_receive(e){var t;return xe(this,void 0,void 0,(function*(){const r=yield this._findDevice(e);r.opened||(yield this.connect(e,!1));const n=yield r.transferIn(this.endpointId,64),s=null===(t=n.data)||void 0===t?void 0:t.buffer.slice(1),{length:o,typeId:a,restBuffer:u}=ke.decodeChunked(s),d=Number(o+6),l=new(i())(d);for(l.writeUint16(a),l.writeUint32(o),o&&l.append(u);l.offset<d;){const e=yield r.transferIn(this.endpointId,64);if(!e.data)throw new Error("no data");0===e.data.byteLength&&console.warn("empty data");const t=e.data.buffer.slice(1);d-l.offset>=64?l.append(t):l.append(t.slice(0,d-l.offset))}l.reset();const p=l.toBuffer();return Ie.from(p).toString("hex")}))}release(e){return xe(this,void 0,void 0,(function*(){const t=yield this._findDevice(e);yield t.releaseInterface(this.interfaceId),yield t.close()}))}requestDevice(){return xe(this,void 0,void 0,(function*(){if(this.usb)try{return yield this.usb.requestDevice({filters:Pe})}catch(e){this.Log.debug("requestDevice error: ",e)}}))}}var Le=__webpack_require__(7699),Be=__webpack_require__.n(Le),Fe=__webpack_require__(6391),je=__webpack_require__.n(Fe),Ue=__webpack_require__(1965),He=__webpack_require__.n(Ue),$e=__webpack_require__(6139).Promise,Ge=__webpack_require__(4406),ze=__webpack_require__(8834).Buffer;function We(e,t,r,i){return new(r||(r=$e))((function(n,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((i=i.apply(e,t||[])).next())}))}function Ve(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=e[r]&&function(t){return new $e((function(i,n){!function(e,t,r,i){$e.resolve(i).then((function(t){e({value:t,done:r})}),t)}(i,n,(t=e[r](t)).done,t.value)}))}}}var Xe,Ke={exports:{}},Ye="object"==typeof Reflect?Reflect:null,Je=Ye&&"function"==typeof Ye.apply?Ye.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};Xe=Ye&&"function"==typeof Ye.ownKeys?Ye.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Ze=Number.isNaN||function(e){return e!=e};function Qe(){Qe.init.call(this)}Ke.exports=Qe,Ke.exports.once=function(e,t){return new $e((function(r,i){function n(r){e.removeListener(t,s),i(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",n),r([].slice.call(arguments))}dt(e,t,s,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&dt(e,"error",t,{once:!0})}(e,n)}))},Qe.EventEmitter=Qe,Qe.prototype._events=void 0,Qe.prototype._eventsCount=0,Qe.prototype._maxListeners=void 0;var et=10;function tt(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function rt(e){return void 0===e._maxListeners?Qe.defaultMaxListeners:e._maxListeners}function it(e,t,r,i){var n,s,o,a;if(tt(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]),void 0===o)o=s[t]=r,++e._eventsCount;else if("function"==typeof o?o=s[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=rt(e))>0&&o.length>n&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,a=u,console&&console.warn&&console.warn(a)}return e}function nt(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function st(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=nt.bind(i);return n.listener=r,i.wrapFn=n,n}function ot(e,t,r){var i=e._events;if(void 0===i)return[];var n=i[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(n):ut(n,n.length)}function at(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function ut(e,t){for(var r=new Array(t),i=0;i<t;++i)r[i]=e[i];return r}function dt(e,t,r,i){if("function"==typeof e.on)i.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function n(s){i.once&&e.removeEventListener(t,n),r(s)}))}}Object.defineProperty(Qe,"defaultMaxListeners",{enumerable:!0,get:function(){return et},set:function(e){if("number"!=typeof e||e<0||Ze(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");et=e}}),Qe.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Qe.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||Ze(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},Qe.prototype.getMaxListeners=function(){return rt(this)},Qe.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,n=this._events;if(void 0!==n)i=i&&void 0===n.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=n[e];if(void 0===a)return!1;if("function"==typeof a)Je(a,this,t);else{var u=a.length,d=ut(a,u);for(r=0;r<u;++r)Je(d[r],this,t)}return!0},Qe.prototype.addListener=function(e,t){return it(this,e,t,!1)},Qe.prototype.on=Qe.prototype.addListener,Qe.prototype.prependListener=function(e,t){return it(this,e,t,!0)},Qe.prototype.once=function(e,t){return tt(t),this.on(e,st(this,e,t)),this},Qe.prototype.prependOnceListener=function(e,t){return tt(t),this.prependListener(e,st(this,e,t)),this},Qe.prototype.removeListener=function(e,t){var r,i,n,s,o;if(tt(t),void 0===(i=this._events))return this;if(void 0===(r=i[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,n),1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},Qe.prototype.off=Qe.prototype.removeListener,Qe.prototype.removeAllListeners=function(e){var t,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var n,s=Object.keys(r);for(i=0;i<s.length;++i)"removeListener"!==(n=s[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},Qe.prototype.listeners=function(e){return ot(this,e,!0)},Qe.prototype.rawListeners=function(e){return ot(this,e,!1)},Qe.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):at.call(e,t)},Qe.prototype.listenerCount=at,Qe.prototype.eventNames=function(){return this._eventsCount>0?Xe(this._events):[]};const lt=2147483648,pt=e=>(e|lt)>>>0,ct=e=>(2147483647&e)>>>0,ht=fe.TypedError(le.CallMethodInvalidParameter,"Not a valid path"),ft=fe.TypedError(le.CallMethodInvalidParameter,"Path cannot contain negative values"),yt=e=>{if(!Array.isArray(e)||e.length<1)return"SPENDADDRESS";switch(ct(e[0])){case 48:return"SPENDMULTISIG";case 49:return"SPENDP2SHWITNESS";case 84:return"SPENDWITNESS";default:return"SPENDADDRESS"}},gt=e=>`m/${e.map((e=>e&lt?(2147483647&e)+"'":e)).join("/")}`,mt=(e,t=0,r=!1)=>{let i;if(i="string"==typeof e?(e=>{const t=e.toLowerCase().split("/");if("m"!==t[0])throw ht;return t.filter((e=>"m"!==e&&""!==e)).map((e=>{let t=!1;"'"===e.substr(e.length-1)&&(t=!0,e=e.substr(0,e.length-1));let r=parseInt(e);if(Number.isNaN(r))throw ht;if(r<0)throw ft;return t&&(r=pt(r)),r}))})(e):Array.isArray(e)?e.map((e=>{const t=parseInt(e);if(Number.isNaN(t))throw ht;if(t<0)throw ft;return t})):void 0,!i)throw ht;if(t>0&&i.length<t)throw ht;return r?i.splice(0,3):i},vt=e=>{if(!e||"object"!=typeof e||!e.serial_no)return"classic";const t=e.serial_no.slice(0,2);return"mi"===t.toLowerCase()?"mini":"tc"===t.toLowerCase()?"touch":"classic"},_t=e=>{var t,r;return"classic"===vt(e)?null!==(t=e.onekey_serial)&&void 0!==t?t:"":null!==(r=e.serial_no)&&void 0!==r?r:""},bt=e=>{const t=vt(e);return"string"==typeof e.label?e.label:`My OneKey ${t.charAt(0).toUpperCase()+t.slice(1)}`},Tt=e=>e?e.onekey_version?e.onekey_version.split("."):[e.major_version,e.minor_version,e.patch_version]:[0,0,0],Et=e=>e.ble_ver&&Be().valid(e.ble_ver)?e.ble_ver.split("."):null,wt=e=>{if(!e)return{support:!1};if("touch"===vt(e))return{support:!1};const t=Tt(e).join(".");return{support:Be().gte(t,"2.3.0"),require:"2.3.0"}},St=(e,t)=>We(void 0,void 0,void 0,(function*(){if(!e)return!1;const{message:r}=yield t.typedCall("GetAddress","Address",{address_n:[pt(44),pt(1),pt(0),0,0],coin_name:"Testnet",script_type:"SPENDADDRESS",show_display:!1});return r.address}));let At;class Rt{constructor(e,t){this.prefix=e,this.enabled=t,this.messages=[]}addMessage(e,t,...r){this.messages.push({level:e,prefix:t,message:r,timestamp:(new Date).getTime()}),this.messages.length>500&&this.messages.shift()}log(...e){this.addMessage("log",this.prefix,...e),xt(this.prefix,...e),this.enabled&&console.log(this.prefix,...e)}error(...e){this.addMessage("error",this.prefix,...e),xt(this.prefix,...e),this.enabled&&console.error(this.prefix,...e)}warn(...e){this.addMessage("warn",this.prefix,...e),xt(this.prefix,...e),this.enabled&&console.warn(this.prefix,...e)}debug(...e){this.addMessage("debug",this.prefix,...e),xt(this.prefix,...e),this.enabled&&console.log(this.prefix,...e)}}const Ot={},It=(e,t)=>{const r=new Rt(e,!!t);return Ot[e]=r,r},xt=(e,...t)=>{var r;null==At||At(("log-output",r=((...e)=>e.map((e=>"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e?e:"object"==typeof e?JSON.stringify(e,(()=>{const e=new WeakSet;return(t,r)=>{if("object"==typeof r&&null!==r){if(e.has(r))return;e.add(r)}return r}})()):e)))(e,...t),{event:"LOG_EVENT",type:"log-output",payload:r}))};var Ct;!function(e){e.Core="Core",e.Transport="Transport",e.Device="Device",e.DeviceCommands="DeviceCommands",e.DeviceConnector="DeviceConnector",e.DeviceList="DeviceList",e.DevicePool="DevicePool",e.HdCommonConnectSdk="@onekey/common-connect-sdk",e.HdBleSdk="@onekey/hd-ble-sdk",e.HdTransportHttp="@onekey/hd-transport-http",e.HdBleTransport="@onekey/hd-ble-transport",e.Connect="@onekey/connect",e.Iframe="IFrame",e.SendMessage="[SendMessage]",e.Method="[Method]"}(Ct||(Ct={}));const Mt={[Ct.Core]:It(Ct.Core),[Ct.Transport]:It(Ct.Transport),[Ct.Device]:It(Ct.Device),[Ct.DeviceCommands]:It(Ct.DeviceCommands),[Ct.DeviceConnector]:It(Ct.DeviceConnector),[Ct.DeviceList]:It(Ct.DeviceList),[Ct.DevicePool]:It(Ct.DevicePool),[Ct.HdBleSdk]:It(Ct.HdBleSdk),[Ct.HdTransportHttp]:It(Ct.HdTransportHttp),[Ct.HdBleTransport]:It(Ct.HdBleTransport),[Ct.Connect]:It(Ct.Connect),[Ct.Iframe]:It(Ct.Iframe),[Ct.SendMessage]:It(Ct.SendMessage),[Ct.Method]:It(Ct.Method),[Ct.HdCommonConnectSdk]:It(Ct.Method)},kt=e=>Mt[e],Nt=(e,t)=>{const r=e.filter((e=>Be().gt(e.version.join("."),t)));return 0===r.length?"valid":r.some((e=>e.required))?"required":"outdated"},Dt=(e,t)=>e.filter((e=>Be().gt(e.version.join("."),t))).map((e=>e.changelog));var Pt;class qt{static load(e){return We(this,void 0,void 0,(function*(){this.settings=e;try{const{data:e}=yield ge().get(`https://data.onekey.so/config.json?noCache=${(new Date).getTime()}`);this.deviceMap={classic:e.classic,mini:e.mini,touch:e.touch,pro:e.pro},this.assets={bridge:e.bridge}}catch(e){}}))}static getProtobufMessages(){return this.messages.default}static getSettings(e){return this.settings?"string"==typeof e?this.settings[e]:this.settings:null}}Pt=qt,qt.deviceMap={classic:{firmware:[],ble:[]},mini:{firmware:[],ble:[]},touch:{firmware:[],ble:[]},pro:{firmware:[],ble:[]}},qt.assets=null,qt.messages={default:{nested:{AptosGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},AptosAddress:{fields:{address:{type:"string",id:1}}},AptosSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2}}},AptosSignedTx:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},BinanceGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},BinanceAddress:{fields:{address:{rule:"required",type:"string",id:1}}},BinanceGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},BinancePublicKey:{fields:{public_key:{rule:"required",type:"bytes",id:1}}},BinanceSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},msg_count:{type:"uint32",id:2},account_number:{type:"sint64",id:3},chain_id:{type:"string",id:4},memo:{type:"string",id:5},sequence:{type:"sint64",id:6},source:{type:"sint64",id:7}}},BinanceTxRequest:{fields:{}},BinanceTransferMsg:{fields:{inputs:{rule:"repeated",type:"BinanceInputOutput",id:1},outputs:{rule:"repeated",type:"BinanceInputOutput",id:2}},nested:{BinanceInputOutput:{fields:{address:{type:"string",id:1},coins:{rule:"repeated",type:"BinanceCoin",id:2}}},BinanceCoin:{fields:{amount:{type:"sint64",id:1},denom:{type:"string",id:2}}}}},BinanceOrderMsg:{fields:{id:{type:"string",id:1},ordertype:{type:"BinanceOrderType",id:2},price:{type:"sint64",id:3},quantity:{type:"sint64",id:4},sender:{type:"string",id:5},side:{type:"BinanceOrderSide",id:6},symbol:{type:"string",id:7},timeinforce:{type:"BinanceTimeInForce",id:8}},nested:{BinanceOrderType:{values:{OT_UNKNOWN:0,MARKET:1,LIMIT:2,OT_RESERVED:3}},BinanceOrderSide:{values:{SIDE_UNKNOWN:0,BUY:1,SELL:2}},BinanceTimeInForce:{values:{TIF_UNKNOWN:0,GTE:1,TIF_RESERVED:2,IOC:3}}}},BinanceCancelMsg:{fields:{refid:{type:"string",id:1},sender:{type:"string",id:2},symbol:{type:"string",id:3}}},BinanceSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1},public_key:{rule:"required",type:"bytes",id:2}}},InputScriptType:{values:{SPENDADDRESS:0,SPENDMULTISIG:1,EXTERNAL:2,SPENDWITNESS:3,SPENDP2SHWITNESS:4,SPENDTAPROOT:5}},OutputScriptType:{values:{PAYTOADDRESS:0,PAYTOSCRIPTHASH:1,PAYTOMULTISIG:2,PAYTOOPRETURN:3,PAYTOWITNESS:4,PAYTOP2SHWITNESS:5,PAYTOTAPROOT:6}},DecredStakingSpendType:{values:{SSGen:0,SSRTX:1}},AmountUnit:{values:{BITCOIN:0,MILLIBITCOIN:1,MICROBITCOIN:2,SATOSHI:3}},MultisigRedeemScriptType:{fields:{pubkeys:{rule:"repeated",type:"HDNodePathType",id:1},signatures:{rule:"repeated",type:"bytes",id:2},m:{rule:"required",type:"uint32",id:3},nodes:{rule:"repeated",type:"HDNodeType",id:4},address_n:{rule:"repeated",type:"uint32",id:5,options:{packed:!1}}},nested:{HDNodePathType:{fields:{node:{rule:"required",type:"HDNodeType",id:1},address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}}}}}},GetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},ecdsa_curve_name:{type:"string",id:2},show_display:{type:"bool",id:3},coin_name:{type:"string",id:4,options:{default:"Bitcoin"}},script_type:{type:"InputScriptType",id:5,options:{default:"SPENDADDRESS"}},ignore_xpub_magic:{type:"bool",id:6}}},PublicKey:{fields:{node:{rule:"required",type:"HDNodeType",id:1},xpub:{rule:"required",type:"string",id:2},root_fingerprint:{type:"uint32",id:3}}},GetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},coin_name:{type:"string",id:2,options:{default:"Bitcoin"}},show_display:{type:"bool",id:3},multisig:{type:"MultisigRedeemScriptType",id:4},script_type:{type:"InputScriptType",id:5,options:{default:"SPENDADDRESS"}},ignore_xpub_magic:{type:"bool",id:6}}},Address:{fields:{address:{rule:"required",type:"string",id:1}}},GetOwnershipId:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},coin_name:{type:"string",id:2,options:{default:"Bitcoin"}},multisig:{type:"MultisigRedeemScriptType",id:3},script_type:{type:"InputScriptType",id:4,options:{default:"SPENDADDRESS"}}}},OwnershipId:{fields:{ownership_id:{rule:"required",type:"bytes",id:1}}},SignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2},coin_name:{type:"string",id:3,options:{default:"Bitcoin"}},script_type:{type:"InputScriptType",id:4,options:{default:"SPENDADDRESS"}},no_script_type:{type:"bool",id:5}}},MessageSignature:{fields:{address:{rule:"required",type:"string",id:1},signature:{rule:"required",type:"bytes",id:2}}},VerifyMessage:{fields:{address:{rule:"required",type:"string",id:1},signature:{rule:"required",type:"bytes",id:2},message:{rule:"required",type:"bytes",id:3},coin_name:{type:"string",id:4,options:{default:"Bitcoin"}}}},SignTx:{fields:{outputs_count:{rule:"required",type:"uint32",id:1},inputs_count:{rule:"required",type:"uint32",id:2},coin_name:{type:"string",id:3,options:{default:"Bitcoin"}},version:{type:"uint32",id:4,options:{default:1}},lock_time:{type:"uint32",id:5,options:{default:0}},expiry:{type:"uint32",id:6},overwintered:{type:"bool",id:7,options:{deprecated:!0}},version_group_id:{type:"uint32",id:8},timestamp:{type:"uint32",id:9},branch_id:{type:"uint32",id:10},amount_unit:{type:"AmountUnit",id:11,options:{default:"BITCOIN"}},decred_staking_ticket:{type:"bool",id:12,options:{default:!1}}}},TxRequest:{fields:{request_type:{type:"RequestType",id:1},details:{type:"TxRequestDetailsType",id:2},serialized:{type:"TxRequestSerializedType",id:3}},nested:{RequestType:{values:{TXINPUT:0,TXOUTPUT:1,TXMETA:2,TXFINISHED:3,TXEXTRADATA:4,TXORIGINPUT:5,TXORIGOUTPUT:6}},TxRequestDetailsType:{fields:{request_index:{type:"uint32",id:1},tx_hash:{type:"bytes",id:2},extra_data_len:{type:"uint32",id:3},extra_data_offset:{type:"uint32",id:4}}},TxRequestSerializedType:{fields:{signature_index:{type:"uint32",id:1},signature:{type:"bytes",id:2},serialized_tx:{type:"bytes",id:3}}}}},TxAck:{options:{deprecated:!0},fields:{tx:{type:"TransactionType",id:1}},nested:{TransactionType:{fields:{version:{type:"uint32",id:1},inputs:{rule:"repeated",type:"TxInputType",id:2},bin_outputs:{rule:"repeated",type:"TxOutputBinType",id:3},lock_time:{type:"uint32",id:4},outputs:{rule:"repeated",type:"TxOutputType",id:5},inputs_cnt:{type:"uint32",id:6},outputs_cnt:{type:"uint32",id:7},extra_data:{type:"bytes",id:8},extra_data_len:{type:"uint32",id:9},expiry:{type:"uint32",id:10},overwintered:{type:"bool",id:11,options:{deprecated:!0}},version_group_id:{type:"uint32",id:12},timestamp:{type:"uint32",id:13},branch_id:{type:"uint32",id:14}},nested:{TxInputType:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},prev_hash:{rule:"required",type:"bytes",id:2},prev_index:{rule:"required",type:"uint32",id:3},script_sig:{type:"bytes",id:4},sequence:{type:"uint32",id:5,options:{default:4294967295}},script_type:{type:"InputScriptType",id:6,options:{default:"SPENDADDRESS"}},multisig:{type:"MultisigRedeemScriptType",id:7},amount:{type:"uint64",id:8},decred_tree:{type:"uint32",id:9},witness:{type:"bytes",id:13},ownership_proof:{type:"bytes",id:14},commitment_data:{type:"bytes",id:15},orig_hash:{type:"bytes",id:16},orig_index:{type:"uint32",id:17},decred_staking_spend:{type:"DecredStakingSpendType",id:18},script_pubkey:{type:"bytes",id:19}}},TxOutputBinType:{fields:{amount:{rule:"required",type:"uint64",id:1},script_pubkey:{rule:"required",type:"bytes",id:2},decred_script_version:{type:"uint32",id:3}}},TxOutputType:{fields:{address:{type:"string",id:1},address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},amount:{rule:"required",type:"uint64",id:3},script_type:{type:"OutputScriptType",id:4,options:{default:"PAYTOADDRESS"}},multisig:{type:"MultisigRedeemScriptType",id:5},op_return_data:{type:"bytes",id:6},orig_hash:{type:"bytes",id:10},orig_index:{type:"uint32",id:11}}}}}}},TxInput:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},prev_hash:{rule:"required",type:"bytes",id:2},prev_index:{rule:"required",type:"uint32",id:3},script_sig:{type:"bytes",id:4},sequence:{type:"uint32",id:5,options:{default:4294967295}},script_type:{type:"InputScriptType",id:6,options:{default:"SPENDADDRESS"}},multisig:{type:"MultisigRedeemScriptType",id:7},amount:{rule:"required",type:"uint64",id:8},decred_tree:{type:"uint32",id:9},witness:{type:"bytes",id:13},ownership_proof:{type:"bytes",id:14},commitment_data:{type:"bytes",id:15},orig_hash:{type:"bytes",id:16},orig_index:{type:"uint32",id:17},decred_staking_spend:{type:"DecredStakingSpendType",id:18},script_pubkey:{type:"bytes",id:19}}},TxOutput:{fields:{address:{type:"string",id:1},address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},amount:{rule:"required",type:"uint64",id:3},script_type:{type:"OutputScriptType",id:4,options:{default:"PAYTOADDRESS"}},multisig:{type:"MultisigRedeemScriptType",id:5},op_return_data:{type:"bytes",id:6},orig_hash:{type:"bytes",id:10},orig_index:{type:"uint32",id:11}}},PrevTx:{fields:{version:{rule:"required",type:"uint32",id:1},lock_time:{rule:"required",type:"uint32",id:4},inputs_count:{rule:"required",type:"uint32",id:6},outputs_count:{rule:"required",type:"uint32",id:7},extra_data_len:{type:"uint32",id:9,options:{default:0}},expiry:{type:"uint32",id:10},version_group_id:{type:"uint32",id:12},timestamp:{type:"uint32",id:13},branch_id:{type:"uint32",id:14}}},PrevInput:{fields:{prev_hash:{rule:"required",type:"bytes",id:2},prev_index:{rule:"required",type:"uint32",id:3},script_sig:{rule:"required",type:"bytes",id:4},sequence:{rule:"required",type:"uint32",id:5},decred_tree:{type:"uint32",id:9}}},PrevOutput:{fields:{amount:{rule:"required",type:"uint64",id:1},script_pubkey:{rule:"required",type:"bytes",id:2},decred_script_version:{type:"uint32",id:3}}},TxAckInput:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"TxAckInputWrapper",id:1}},nested:{TxAckInputWrapper:{fields:{input:{rule:"required",type:"TxInput",id:2}}}}},TxAckOutput:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"TxAckOutputWrapper",id:1}},nested:{TxAckOutputWrapper:{fields:{output:{rule:"required",type:"TxOutput",id:5}}}}},TxAckPrevMeta:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"PrevTx",id:1}}},TxAckPrevInput:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"TxAckPrevInputWrapper",id:1}},nested:{TxAckPrevInputWrapper:{fields:{input:{rule:"required",type:"PrevInput",id:2}}}}},TxAckPrevOutput:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"TxAckPrevOutputWrapper",id:1}},nested:{TxAckPrevOutputWrapper:{fields:{output:{rule:"required",type:"PrevOutput",id:3}}}}},TxAckPrevExtraData:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"TxAckPrevExtraDataWrapper",id:1}},nested:{TxAckPrevExtraDataWrapper:{fields:{extra_data_chunk:{rule:"required",type:"bytes",id:8}}}}},GetOwnershipProof:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},coin_name:{type:"string",id:2,options:{default:"Bitcoin"}},script_type:{type:"InputScriptType",id:3,options:{default:"SPENDWITNESS"}},multisig:{type:"MultisigRedeemScriptType",id:4},user_confirmation:{type:"bool",id:5,options:{default:!1}},ownership_ids:{rule:"repeated",type:"bytes",id:6},commitment_data:{type:"bytes",id:7,options:{default:""}}}},OwnershipProof:{fields:{ownership_proof:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},AuthorizeCoinJoin:{options:{"(unstable)":!0},fields:{coordinator:{rule:"required",type:"string",id:1},max_total_fee:{rule:"required",type:"uint64",id:2},fee_per_anonymity:{type:"uint32",id:3,options:{default:0}},address_n:{rule:"repeated",type:"uint32",id:4,options:{packed:!1}},coin_name:{type:"string",id:5,options:{default:"Bitcoin"}},script_type:{type:"InputScriptType",id:6,options:{default:"SPENDADDRESS"}},amount_unit:{type:"AmountUnit",id:11,options:{default:"BITCOIN"}}}},GetPublicKeyMultiple:{fields:{addresses:{rule:"repeated",type:"BIP32Address",id:1},ecdsa_curve_name:{type:"string",id:2},show_display:{type:"bool",id:3},coin_name:{type:"string",id:4,options:{default:"Bitcoin"}},script_type:{type:"InputScriptType",id:5,options:{default:"SPENDADDRESS"}},ignore_xpub_magic:{type:"bool",id:6}},nested:{BIP32Address:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}}}}}},PublicKeyMultiple:{fields:{xpubs:{rule:"repeated",type:"string",id:1}}},FirmwareErase:{fields:{length:{type:"uint32",id:1}}},FirmwareRequest:{fields:{offset:{type:"uint32",id:1},length:{type:"uint32",id:2}}},FirmwareUpload:{fields:{payload:{rule:"required",type:"bytes",id:1},hash:{type:"bytes",id:2}}},SelfTest:{fields:{payload:{type:"bytes",id:1}}},FirmwareErase_ex:{fields:{length:{type:"uint32",id:1}}},CardanoDerivationType:{values:{LEDGER:0,ICARUS:1,ICARUS_TREZOR:2}},CardanoAddressType:{values:{BASE:0,BASE_SCRIPT_KEY:1,BASE_KEY_SCRIPT:2,BASE_SCRIPT_SCRIPT:3,POINTER:4,POINTER_SCRIPT:5,ENTERPRISE:6,ENTERPRISE_SCRIPT:7,BYRON:8,REWARD:14,REWARD_SCRIPT:15}},CardanoNativeScriptType:{values:{PUB_KEY:0,ALL:1,ANY:2,N_OF_K:3,INVALID_BEFORE:4,INVALID_HEREAFTER:5}},CardanoNativeScriptHashDisplayFormat:{values:{HIDE:0,BECH32:1,POLICY_ID:2}},CardanoCertificateType:{values:{STAKE_REGISTRATION:0,STAKE_DEREGISTRATION:1,STAKE_DELEGATION:2,STAKE_POOL_REGISTRATION:3}},CardanoPoolRelayType:{values:{SINGLE_HOST_IP:0,SINGLE_HOST_NAME:1,MULTIPLE_HOST_NAME:2}},CardanoTxAuxiliaryDataSupplementType:{values:{NONE:0,CATALYST_REGISTRATION_SIGNATURE:1}},CardanoTxSigningMode:{values:{ORDINARY_TRANSACTION:0,POOL_REGISTRATION_AS_OWNER:1,MULTISIG_TRANSACTION:2}},CardanoTxWitnessType:{values:{BYRON_WITNESS:0,SHELLEY_WITNESS:1}},CardanoBlockchainPointerType:{fields:{block_index:{rule:"required",type:"uint32",id:1},tx_index:{rule:"required",type:"uint32",id:2},certificate_index:{rule:"required",type:"uint32",id:3}}},CardanoNativeScript:{fields:{type:{rule:"required",type:"CardanoNativeScriptType",id:1},scripts:{rule:"repeated",type:"CardanoNativeScript",id:2},key_hash:{type:"bytes",id:3},key_path:{rule:"repeated",type:"uint32",id:4,options:{packed:!1}},required_signatures_count:{type:"uint32",id:5},invalid_before:{type:"uint64",id:6},invalid_hereafter:{type:"uint64",id:7}}},CardanoGetNativeScriptHash:{fields:{script:{rule:"required",type:"CardanoNativeScript",id:1},display_format:{rule:"required",type:"CardanoNativeScriptHashDisplayFormat",id:2},derivation_type:{rule:"required",type:"CardanoDerivationType",id:3}}},CardanoNativeScriptHash:{fields:{script_hash:{rule:"required",type:"bytes",id:1}}},CardanoAddressParametersType:{fields:{address_type:{rule:"required",type:"CardanoAddressType",id:1},address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},address_n_staking:{rule:"repeated",type:"uint32",id:3,options:{packed:!1}},staking_key_hash:{type:"bytes",id:4},certificate_pointer:{type:"CardanoBlockchainPointerType",id:5},script_payment_hash:{type:"bytes",id:6},script_staking_hash:{type:"bytes",id:7}}},CardanoGetAddress:{fields:{show_display:{type:"bool",id:2,options:{default:!1}},protocol_magic:{rule:"required",type:"uint32",id:3},network_id:{rule:"required",type:"uint32",id:4},address_parameters:{rule:"required",type:"CardanoAddressParametersType",id:5},derivation_type:{rule:"required",type:"CardanoDerivationType",id:6}}},CardanoAddress:{fields:{address:{rule:"required",type:"string",id:1}}},CardanoGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},derivation_type:{rule:"required",type:"CardanoDerivationType",id:3}}},CardanoPublicKey:{fields:{xpub:{rule:"required",type:"string",id:1},node:{rule:"required",type:"HDNodeType",id:2}}},CardanoSignTxInit:{fields:{signing_mode:{rule:"required",type:"CardanoTxSigningMode",id:1},protocol_magic:{rule:"required",type:"uint32",id:2},network_id:{rule:"required",type:"uint32",id:3},inputs_count:{rule:"required",type:"uint32",id:4},outputs_count:{rule:"required",type:"uint32",id:5},fee:{rule:"required",type:"uint64",id:6},ttl:{type:"uint64",id:7},certificates_count:{rule:"required",type:"uint32",id:8},withdrawals_count:{rule:"required",type:"uint32",id:9},has_auxiliary_data:{rule:"required",type:"bool",id:10},validity_interval_start:{type:"uint64",id:11},witness_requests_count:{rule:"required",type:"uint32",id:12},minting_asset_groups_count:{rule:"required",type:"uint32",id:13},derivation_type:{rule:"required",type:"CardanoDerivationType",id:14}}},CardanoTxInput:{fields:{prev_hash:{rule:"required",type:"bytes",id:1},prev_index:{rule:"required",type:"uint32",id:2}}},CardanoTxOutput:{fields:{address:{type:"string",id:1},address_parameters:{type:"CardanoAddressParametersType",id:2},amount:{rule:"required",type:"uint64",id:3},asset_groups_count:{rule:"required",type:"uint32",id:4}}},CardanoAssetGroup:{fields:{policy_id:{rule:"required",type:"bytes",id:1},tokens_count:{rule:"required",type:"uint32",id:2}}},CardanoToken:{fields:{asset_name_bytes:{rule:"required",type:"bytes",id:1},amount:{type:"uint64",id:2},mint_amount:{type:"sint64",id:3}}},CardanoPoolOwner:{fields:{staking_key_path:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},staking_key_hash:{type:"bytes",id:2}}},CardanoPoolRelayParameters:{fields:{type:{rule:"required",type:"CardanoPoolRelayType",id:1},ipv4_address:{type:"bytes",id:2},ipv6_address:{type:"bytes",id:3},host_name:{type:"string",id:4},port:{type:"uint32",id:5}}},CardanoPoolMetadataType:{fields:{url:{rule:"required",type:"string",id:1},hash:{rule:"required",type:"bytes",id:2}}},CardanoPoolParametersType:{fields:{pool_id:{rule:"required",type:"bytes",id:1},vrf_key_hash:{rule:"required",type:"bytes",id:2},pledge:{rule:"required",type:"uint64",id:3},cost:{rule:"required",type:"uint64",id:4},margin_numerator:{rule:"required",type:"uint64",id:5},margin_denominator:{rule:"required",type:"uint64",id:6},reward_account:{rule:"required",type:"string",id:7},owners:{rule:"repeated",type:"CardanoPoolOwner",id:8,options:{deprecated:!0}},relays:{rule:"repeated",type:"CardanoPoolRelayParameters",id:9,options:{deprecated:!0}},metadata:{type:"CardanoPoolMetadataType",id:10},owners_count:{rule:"required",type:"uint32",id:11},relays_count:{rule:"required",type:"uint32",id:12}}},CardanoTxCertificate:{fields:{type:{rule:"required",type:"CardanoCertificateType",id:1},path:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},pool:{type:"bytes",id:3},pool_parameters:{type:"CardanoPoolParametersType",id:4},script_hash:{type:"bytes",id:5}}},CardanoTxWithdrawal:{fields:{path:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},amount:{rule:"required",type:"uint64",id:2},script_hash:{type:"bytes",id:3}}},CardanoCatalystRegistrationParametersType:{fields:{voting_public_key:{rule:"required",type:"bytes",id:1},staking_path:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},reward_address_parameters:{rule:"required",type:"CardanoAddressParametersType",id:3},nonce:{rule:"required",type:"uint64",id:4}}},CardanoTxAuxiliaryData:{fields:{catalyst_registration_parameters:{type:"CardanoCatalystRegistrationParametersType",id:1},hash:{type:"bytes",id:2}}},CardanoTxMint:{fields:{asset_groups_count:{rule:"required",type:"uint32",id:1}}},CardanoTxItemAck:{fields:{}},CardanoTxAuxiliaryDataSupplement:{fields:{type:{rule:"required",type:"CardanoTxAuxiliaryDataSupplementType",id:1},auxiliary_data_hash:{type:"bytes",id:2},catalyst_signature:{type:"bytes",id:3}}},CardanoTxWitnessRequest:{fields:{path:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}}}},CardanoTxWitnessResponse:{fields:{type:{rule:"required",type:"CardanoTxWitnessType",id:1},pub_key:{rule:"required",type:"bytes",id:2},signature:{rule:"required",type:"bytes",id:3},chain_code:{type:"bytes",id:4}}},CardanoTxHostAck:{fields:{}},CardanoTxBodyHash:{fields:{tx_hash:{rule:"required",type:"bytes",id:1}}},CardanoSignTxFinished:{fields:{}},CardanoSignTx:{options:{deprecated:!0},fields:{inputs:{rule:"repeated",type:"CardanoTxInputType",id:1},outputs:{rule:"repeated",type:"CardanoTxOutputType",id:2},protocol_magic:{rule:"required",type:"uint32",id:5},fee:{rule:"required",type:"uint64",id:6},ttl:{type:"uint64",id:7},network_id:{rule:"required",type:"uint32",id:8},certificates:{rule:"repeated",type:"CardanoTxCertificateType",id:9},withdrawals:{rule:"repeated",type:"CardanoTxWithdrawalType",id:10},validity_interval_start:{type:"uint64",id:12},auxiliary_data:{type:"CardanoTxAuxiliaryDataType",id:13}},nested:{CardanoTxInputType:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},prev_hash:{rule:"required",type:"bytes",id:2},prev_index:{rule:"required",type:"uint32",id:3}}},CardanoTxOutputType:{fields:{address:{type:"string",id:1},amount:{rule:"required",type:"uint64",id:3},address_parameters:{type:"CardanoAddressParametersType",id:4},token_bundle:{rule:"repeated",type:"CardanoAssetGroupType",id:5}}},CardanoAssetGroupType:{fields:{policy_id:{rule:"required",type:"bytes",id:1},tokens:{rule:"repeated",type:"CardanoTokenType",id:2}}},CardanoTokenType:{fields:{asset_name_bytes:{rule:"required",type:"bytes",id:1},amount:{rule:"required",type:"uint64",id:2}}},CardanoPoolOwnerType:{fields:{staking_key_path:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},staking_key_hash:{type:"bytes",id:2}}},CardanoPoolRelayParametersType:{fields:{type:{rule:"required",type:"CardanoPoolRelayType",id:1},ipv4_address:{type:"bytes",id:2},ipv6_address:{type:"bytes",id:3},host_name:{type:"string",id:4},port:{type:"uint32",id:5}}},CardanoTxCertificateType:{fields:{type:{rule:"required",type:"CardanoCertificateType",id:1},path:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},pool:{type:"bytes",id:3},pool_parameters:{type:"CardanoPoolParametersType",id:4}}},CardanoTxWithdrawalType:{fields:{path:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},amount:{rule:"required",type:"uint64",id:2}}},CardanoTxAuxiliaryDataType:{fields:{blob:{type:"bytes",id:1},catalyst_registration_parameters:{type:"CardanoCatalystRegistrationParametersType",id:2}}}}},CardanoSignedTxChunk:{options:{deprecated:!0},fields:{signed_tx_chunk:{rule:"required",type:"bytes",id:1}}},CardanoSignedTxChunkAck:{options:{deprecated:!0},fields:{}},CardanoSignedTx:{options:{deprecated:!0},fields:{tx_hash:{rule:"required",type:"bytes",id:1},serialized_tx:{type:"bytes",id:2}}},Success:{fields:{message:{type:"string",id:1,options:{default:""}}}},Failure:{fields:{code:{type:"FailureType",id:1},message:{type:"string",id:2}},nested:{FailureType:{values:{Failure_UnexpectedMessage:1,Failure_ButtonExpected:2,Failure_DataError:3,Failure_ActionCancelled:4,Failure_PinExpected:5,Failure_PinCancelled:6,Failure_PinInvalid:7,Failure_InvalidSignature:8,Failure_ProcessError:9,Failure_NotEnoughFunds:10,Failure_NotInitialized:11,Failure_PinMismatch:12,Failure_WipeCodeMismatch:13,Failure_InvalidSession:14,Failure_FirmwareError:99}}}},ButtonRequest:{fields:{code:{type:"ButtonRequestType",id:1},pages:{type:"uint32",id:2}},nested:{ButtonRequestType:{values:{ButtonRequest_Other:1,ButtonRequest_FeeOverThreshold:2,ButtonRequest_ConfirmOutput:3,ButtonRequest_ResetDevice:4,ButtonRequest_ConfirmWord:5,ButtonRequest_WipeDevice:6,ButtonRequest_ProtectCall:7,ButtonRequest_SignTx:8,ButtonRequest_FirmwareCheck:9,ButtonRequest_Address:10,ButtonRequest_PublicKey:11,ButtonRequest_MnemonicWordCount:12,ButtonRequest_MnemonicInput:13,_Deprecated_ButtonRequest_PassphraseType:14,ButtonRequest_UnknownDerivationPath:15,ButtonRequest_RecoveryHomepage:16,ButtonRequest_Success:17,ButtonRequest_Warning:18,ButtonRequest_PassphraseEntry:19,ButtonRequest_PinEntry:20}}}},ButtonAck:{fields:{}},PinMatrixRequest:{fields:{type:{type:"PinMatrixRequestType",id:1}},nested:{PinMatrixRequestType:{values:{PinMatrixRequestType_Current:1,PinMatrixRequestType_NewFirst:2,PinMatrixRequestType_NewSecond:3,PinMatrixRequestType_WipeCodeFirst:4,PinMatrixRequestType_WipeCodeSecond:5,PinMatrixRequestType_BackupFirst:6,PinMatrixRequestType_BackupSecond:7}}}},PinMatrixAck:{fields:{pin:{rule:"required",type:"string",id:1},new_pin:{type:"string",id:2}}},PassphraseRequest:{fields:{_on_device:{type:"bool",id:1,options:{deprecated:!0}}}},PassphraseAck:{fields:{passphrase:{type:"string",id:1},_state:{type:"bytes",id:2,options:{deprecated:!0}},on_device:{type:"bool",id:3}}},Deprecated_PassphraseStateRequest:{options:{deprecated:!0},fields:{state:{type:"bytes",id:1}}},Deprecated_PassphraseStateAck:{options:{deprecated:!0},fields:{}},HDNodeType:{fields:{depth:{rule:"required",type:"uint32",id:1},fingerprint:{rule:"required",type:"uint32",id:2},child_num:{rule:"required",type:"uint32",id:3},chain_code:{rule:"required",type:"bytes",id:4},private_key:{type:"bytes",id:5},public_key:{rule:"required",type:"bytes",id:6}}},BixinPinInputOnDevice:{fields:{}},ConfluxGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},chain_id:{type:"uint32",id:3}}},ConfluxAddress:{fields:{address:{type:"string",id:1}}},ConfluxSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},nonce:{type:"bytes",id:2},gas_price:{type:"bytes",id:3},gas_limit:{type:"bytes",id:4},to:{type:"string",id:5},value:{type:"bytes",id:6},epoch_height:{type:"bytes",id:7},storage_limit:{type:"bytes",id:8},data_initial_chunk:{type:"bytes",id:9},data_length:{type:"uint32",id:10},chain_id:{type:"uint32",id:11}}},ConfluxTxRequest:{fields:{data_length:{type:"uint32",id:1},signature_v:{type:"uint32",id:2},signature_r:{type:"bytes",id:3},signature_s:{type:"bytes",id:4}}},ConfluxTxAck:{fields:{data_chunk:{type:"bytes",id:1}}},ConfluxSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{type:"bytes",id:2}}},ConfluxMessageSignature:{fields:{signature:{type:"bytes",id:2},address:{type:"string",id:3}}},ConfluxSignMessageCIP23:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},domain_hash:{type:"bytes",id:2},message_hash:{type:"bytes",id:3}}},CipherKeyValue:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},key:{rule:"required",type:"string",id:2},value:{rule:"required",type:"bytes",id:3},encrypt:{type:"bool",id:4},ask_on_encrypt:{type:"bool",id:5},ask_on_decrypt:{type:"bool",id:6},iv:{type:"bytes",id:7}}},CipheredKeyValue:{fields:{value:{rule:"required",type:"bytes",id:1}}},IdentityType:{fields:{proto:{type:"string",id:1},user:{type:"string",id:2},host:{type:"string",id:3},port:{type:"string",id:4},path:{type:"string",id:5},index:{type:"uint32",id:6,options:{default:0}}}},SignIdentity:{fields:{identity:{rule:"required",type:"IdentityType",id:1},challenge_hidden:{type:"bytes",id:2,options:{default:""}},challenge_visual:{type:"string",id:3,options:{default:""}},ecdsa_curve_name:{type:"string",id:4}}},SignedIdentity:{fields:{address:{type:"string",id:1},public_key:{rule:"required",type:"bytes",id:2},signature:{rule:"required",type:"bytes",id:3}}},GetECDHSessionKey:{fields:{identity:{rule:"required",type:"IdentityType",id:1},peer_public_key:{rule:"required",type:"bytes",id:2},ecdsa_curve_name:{type:"string",id:3}}},ECDHSessionKey:{fields:{session_key:{rule:"required",type:"bytes",id:1},public_key:{type:"bytes",id:2}}},CosiCommit:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},data:{type:"bytes",id:2}}},CosiCommitment:{fields:{commitment:{type:"bytes",id:1},pubkey:{type:"bytes",id:2}}},CosiSign:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},data:{type:"bytes",id:2},global_commitment:{type:"bytes",id:3},global_pubkey:{type:"bytes",id:4}}},CosiSignature:{fields:{signature:{rule:"required",type:"bytes",id:1}}},DebugLinkDecision:{fields:{yes_no:{type:"bool",id:1},swipe:{type:"DebugSwipeDirection",id:2},input:{type:"string",id:3},x:{type:"uint32",id:4},y:{type:"uint32",id:5},wait:{type:"bool",id:6},hold_ms:{type:"uint32",id:7}},nested:{DebugSwipeDirection:{values:{UP:0,DOWN:1,LEFT:2,RIGHT:3}}}},DebugLinkLayout:{fields:{lines:{rule:"repeated",type:"string",id:1}}},DebugLinkReseedRandom:{fields:{value:{type:"uint32",id:1}}},DebugLinkRecordScreen:{fields:{target_directory:{type:"string",id:1}}},DebugLinkGetState:{fields:{wait_word_list:{type:"bool",id:1},wait_word_pos:{type:"bool",id:2},wait_layout:{type:"bool",id:3}}},DebugLinkState:{fields:{layout:{type:"bytes",id:1},pin:{type:"string",id:2},matrix:{type:"string",id:3},mnemonic_secret:{type:"bytes",id:4},node:{type:"HDNodeType",id:5},passphrase_protection:{type:"bool",id:6},reset_word:{type:"string",id:7},reset_entropy:{type:"bytes",id:8},recovery_fake_word:{type:"string",id:9},recovery_word_pos:{type:"uint32",id:10},reset_word_pos:{type:"uint32",id:11},mnemonic_type:{type:"BackupType",id:12},layout_lines:{rule:"repeated",type:"string",id:13}}},DebugLinkStop:{fields:{}},DebugLinkLog:{fields:{level:{type:"uint32",id:1},bucket:{type:"string",id:2},text:{type:"string",id:3}}},DebugLinkMemoryRead:{fields:{address:{type:"uint32",id:1},length:{type:"uint32",id:2}}},DebugLinkMemory:{fields:{memory:{type:"bytes",id:1}}},DebugLinkMemoryWrite:{fields:{address:{type:"uint32",id:1},memory:{type:"bytes",id:2},flash:{type:"bool",id:3}}},DebugLinkFlashErase:{fields:{sector:{type:"uint32",id:1}}},DebugLinkEraseSdCard:{fields:{format:{type:"bool",id:1}}},DebugLinkWatchLayout:{fields:{watch:{type:"bool",id:1}}},EosGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},EosPublicKey:{fields:{wif_public_key:{rule:"required",type:"string",id:1},raw_public_key:{rule:"required",type:"bytes",id:2}}},EosSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},chain_id:{type:"bytes",id:2},header:{type:"EosTxHeader",id:3},num_actions:{type:"uint32",id:4}},nested:{EosTxHeader:{fields:{expiration:{rule:"required",type:"uint32",id:1},ref_block_num:{rule:"required",type:"uint32",id:2},ref_block_prefix:{rule:"required",type:"uint32",id:3},max_net_usage_words:{rule:"required",type:"uint32",id:4},max_cpu_usage_ms:{rule:"required",type:"uint32",id:5},delay_sec:{rule:"required",type:"uint32",id:6}}}}},EosTxActionRequest:{fields:{data_size:{type:"uint32",id:1}}},EosTxActionAck:{fields:{common:{type:"EosActionCommon",id:1},transfer:{type:"EosActionTransfer",id:2},delegate:{type:"EosActionDelegate",id:3},undelegate:{type:"EosActionUndelegate",id:4},refund:{type:"EosActionRefund",id:5},buy_ram:{type:"EosActionBuyRam",id:6},buy_ram_bytes:{type:"EosActionBuyRamBytes",id:7},sell_ram:{type:"EosActionSellRam",id:8},vote_producer:{type:"EosActionVoteProducer",id:9},update_auth:{type:"EosActionUpdateAuth",id:10},delete_auth:{type:"EosActionDeleteAuth",id:11},link_auth:{type:"EosActionLinkAuth",id:12},unlink_auth:{type:"EosActionUnlinkAuth",id:13},new_account:{type:"EosActionNewAccount",id:14},unknown:{type:"EosActionUnknown",id:15}},nested:{EosAsset:{fields:{amount:{type:"sint64",id:1},symbol:{type:"uint64",id:2}}},EosPermissionLevel:{fields:{actor:{type:"uint64",id:1},permission:{type:"uint64",id:2}}},EosAuthorizationKey:{fields:{type:{rule:"required",type:"uint32",id:1},key:{type:"bytes",id:2},address_n:{rule:"repeated",type:"uint32",id:3,options:{packed:!1}},weight:{rule:"required",type:"uint32",id:4}}},EosAuthorizationAccount:{fields:{account:{type:"EosPermissionLevel",id:1},weight:{type:"uint32",id:2}}},EosAuthorizationWait:{fields:{wait_sec:{type:"uint32",id:1},weight:{type:"uint32",id:2}}},EosAuthorization:{fields:{threshold:{type:"uint32",id:1},keys:{rule:"repeated",type:"EosAuthorizationKey",id:2},accounts:{rule:"repeated",type:"EosAuthorizationAccount",id:3},waits:{rule:"repeated",type:"EosAuthorizationWait",id:4}}},EosActionCommon:{fields:{account:{type:"uint64",id:1},name:{type:"uint64",id:2},authorization:{rule:"repeated",type:"EosPermissionLevel",id:3}}},EosActionTransfer:{fields:{sender:{type:"uint64",id:1},receiver:{type:"uint64",id:2},quantity:{type:"EosAsset",id:3},memo:{type:"string",id:4}}},EosActionDelegate:{fields:{sender:{type:"uint64",id:1},receiver:{type:"uint64",id:2},net_quantity:{type:"EosAsset",id:3},cpu_quantity:{type:"EosAsset",id:4},transfer:{type:"bool",id:5}}},EosActionUndelegate:{fields:{sender:{type:"uint64",id:1},receiver:{type:"uint64",id:2},net_quantity:{type:"EosAsset",id:3},cpu_quantity:{type:"EosAsset",id:4}}},EosActionRefund:{fields:{owner:{type:"uint64",id:1}}},EosActionBuyRam:{fields:{payer:{type:"uint64",id:1},receiver:{type:"uint64",id:2},quantity:{type:"EosAsset",id:3}}},EosActionBuyRamBytes:{fields:{payer:{type:"uint64",id:1},receiver:{type:"uint64",id:2},bytes:{type:"uint32",id:3}}},EosActionSellRam:{fields:{account:{type:"uint64",id:1},bytes:{type:"uint64",id:2}}},EosActionVoteProducer:{fields:{voter:{type:"uint64",id:1},proxy:{type:"uint64",id:2},producers:{rule:"repeated",type:"uint64",id:3,options:{packed:!1}}}},EosActionUpdateAuth:{fields:{account:{type:"uint64",id:1},permission:{type:"uint64",id:2},parent:{type:"uint64",id:3},auth:{type:"EosAuthorization",id:4}}},EosActionDeleteAuth:{fields:{account:{type:"uint64",id:1},permission:{type:"uint64",id:2}}},EosActionLinkAuth:{fields:{account:{type:"uint64",id:1},code:{type:"uint64",id:2},type:{type:"uint64",id:3},requirement:{type:"uint64",id:4}}},EosActionUnlinkAuth:{fields:{account:{type:"uint64",id:1},code:{type:"uint64",id:2},type:{type:"uint64",id:3}}},EosActionNewAccount:{fields:{creator:{type:"uint64",id:1},name:{type:"uint64",id:2},owner:{type:"EosAuthorization",id:3},active:{type:"EosAuthorization",id:4}}},EosActionUnknown:{fields:{data_size:{rule:"required",type:"uint32",id:1},data_chunk:{type:"bytes",id:2}}}}},EosSignedTx:{fields:{signature:{rule:"required",type:"string",id:1}}},EthereumSignTypedData:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},primary_type:{rule:"required",type:"string",id:2},metamask_v4_compat:{type:"bool",id:3,options:{default:!0}}}},EthereumTypedDataStructRequest:{fields:{name:{rule:"required",type:"string",id:1}}},EthereumTypedDataStructAck:{fields:{members:{rule:"repeated",type:"EthereumStructMember",id:1}},nested:{EthereumStructMember:{fields:{type:{rule:"required",type:"EthereumFieldType",id:1},name:{rule:"required",type:"string",id:2}}},EthereumFieldType:{fields:{data_type:{rule:"required",type:"EthereumDataType",id:1},size:{type:"uint32",id:2},entry_type:{type:"EthereumFieldType",id:3},struct_name:{type:"string",id:4}}},EthereumDataType:{values:{UINT:1,INT:2,BYTES:3,STRING:4,BOOL:5,ADDRESS:6,ARRAY:7,STRUCT:8}}}},EthereumTypedDataValueRequest:{fields:{member_path:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}}}},EthereumTypedDataValueAck:{fields:{value:{rule:"required",type:"bytes",id:1}}},EthereumGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},EthereumPublicKey:{fields:{node:{rule:"required",type:"HDNodeType",id:1},xpub:{rule:"required",type:"string",id:2}}},EthereumGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},EthereumAddress:{fields:{_old_address:{type:"bytes",id:1,options:{deprecated:!0}},address:{type:"string",id:2}}},EthereumSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},nonce:{type:"bytes",id:2,options:{default:""}},gas_price:{rule:"required",type:"bytes",id:3},gas_limit:{rule:"required",type:"bytes",id:4},to:{type:"string",id:11,options:{default:""}},value:{type:"bytes",id:6,options:{default:""}},data_initial_chunk:{type:"bytes",id:7,options:{default:""}},data_length:{type:"uint32",id:8,options:{default:0}},chain_id:{rule:"required",type:"uint64",id:9},tx_type:{type:"uint32",id:10}}},EthereumSignTxEIP1559:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},nonce:{rule:"required",type:"bytes",id:2},max_gas_fee:{rule:"required",type:"bytes",id:3},max_priority_fee:{rule:"required",type:"bytes",id:4},gas_limit:{rule:"required",type:"bytes",id:5},to:{type:"string",id:6,options:{default:""}},value:{rule:"required",type:"bytes",id:7},data_initial_chunk:{type:"bytes",id:8,options:{default:""}},data_length:{rule:"required",type:"uint32",id:9},chain_id:{rule:"required",type:"uint64",id:10},access_list:{rule:"repeated",type:"EthereumAccessList",id:11}},nested:{EthereumAccessList:{fields:{address:{rule:"required",type:"string",id:1},storage_keys:{rule:"repeated",type:"bytes",id:2}}}}},EthereumTxRequest:{fields:{data_length:{type:"uint32",id:1},signature_v:{type:"uint32",id:2},signature_r:{type:"bytes",id:3},signature_s:{type:"bytes",id:4}}},EthereumTxAck:{fields:{data_chunk:{rule:"required",type:"bytes",id:1}}},EthereumSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2}}},EthereumMessageSignature:{fields:{signature:{rule:"required",type:"bytes",id:2},address:{rule:"required",type:"string",id:3}}},EthereumVerifyMessage:{fields:{signature:{rule:"required",type:"bytes",id:2},message:{rule:"required",type:"bytes",id:3},address:{rule:"required",type:"string",id:4}}},EthereumSignMessageEIP712:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},domain_hash:{type:"bytes",id:2},message_hash:{type:"bytes",id:3}}},EthereumSignTypedHash:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},domain_separator_hash:{rule:"required",type:"bytes",id:2},message_hash:{type:"bytes",id:3}}},EthereumTypedDataSignature:{fields:{signature:{rule:"required",type:"bytes",id:1},address:{rule:"required",type:"string",id:2}}},BackupType:{values:{Bip39:0,Slip39_Basic:1,Slip39_Advanced:2}},SafetyCheckLevel:{values:{Strict:0,PromptAlways:1,PromptTemporarily:2}},Initialize:{fields:{session_id:{type:"bytes",id:1},_skip_passphrase:{type:"bool",id:2,options:{deprecated:!0}},derive_cardano:{type:"bool",id:3}}},GetFeatures:{fields:{}},Features:{fields:{vendor:{type:"string",id:1},major_version:{rule:"required",type:"uint32",id:2},minor_version:{rule:"required",type:"uint32",id:3},patch_version:{rule:"required",type:"uint32",id:4},bootloader_mode:{type:"bool",id:5},device_id:{type:"string",id:6},pin_protection:{type:"bool",id:7},passphrase_protection:{type:"bool",id:8},language:{type:"string",id:9},label:{type:"string",id:10},initialized:{type:"bool",id:12},revision:{type:"bytes",id:13},bootloader_hash:{type:"bytes",id:14},imported:{type:"bool",id:15},unlocked:{type:"bool",id:16},_passphrase_cached:{type:"bool",id:17,options:{deprecated:!0}},firmware_present:{type:"bool",id:18},needs_backup:{type:"bool",id:19},flags:{type:"uint32",id:20},model:{type:"string",id:21},fw_major:{type:"uint32",id:22},fw_minor:{type:"uint32",id:23},fw_patch:{type:"uint32",id:24},fw_vendor:{type:"string",id:25},fw_vendor_keys:{type:"bytes",id:26},unfinished_backup:{type:"bool",id:27},no_backup:{type:"bool",id:28},recovery_mode:{type:"bool",id:29},capabilities:{rule:"repeated",type:"Capability",id:30,options:{packed:!1}},backup_type:{type:"BackupType",id:31},sd_card_present:{type:"bool",id:32},sd_protection:{type:"bool",id:33},wipe_code_protection:{type:"bool",id:34},session_id:{type:"bytes",id:35},passphrase_always_on_device:{type:"bool",id:36},safety_checks:{type:"SafetyCheckLevel",id:37},auto_lock_delay_ms:{type:"uint32",id:38},display_rotation:{type:"uint32",id:39},experimental_features:{type:"bool",id:40},offset:{type:"uint32",id:500},ble_name:{type:"string",id:501},ble_ver:{type:"string",id:502},ble_enable:{type:"bool",id:503},se_enable:{type:"bool",id:504},se_ver:{type:"string",id:506},backup_only:{type:"bool",id:507},onekey_version:{type:"string",id:508},onekey_serial:{type:"string",id:509},bootloader_version:{type:"string",id:510},serial_no:{type:"string",id:511},spi_flash:{type:"string",id:512},initstates:{type:"uint32",id:513},NFT_voucher:{type:"bytes",id:514},cpu_info:{type:"string",id:515},pre_firmware:{type:"string",id:516},coin_switch:{type:"uint32",id:517},build_id:{type:"string",id:518}},nested:{Capability:{options:{"(has_bitcoin_only_values)":!0},values:{Capability_Bitcoin:1,Capability_Bitcoin_like:2,Capability_Binance:3,Capability_Cardano:4,Capability_Crypto:5,Capability_EOS:6,Capability_Ethereum:7,Capability_Lisk:8,Capability_Monero:9,Capability_NEM:10,Capability_Ripple:11,Capability_Stellar:12,Capability_Tezos:13,Capability_U2F:14,Capability_Shamir:15,Capability_ShamirGroups:16,Capability_PassphraseEntry:17}}}},LockDevice:{fields:{}},EndSession:{fields:{}},ApplySettings:{fields:{language:{type:"string",id:1},label:{type:"string",id:2},use_passphrase:{type:"bool",id:3},homescreen:{type:"bytes",id:4},_passphrase_source:{type:"uint32",id:5,options:{deprecated:!0}},auto_lock_delay_ms:{type:"uint32",id:6},display_rotation:{type:"uint32",id:7},passphrase_always_on_device:{type:"bool",id:8},safety_checks:{type:"SafetyCheckLevel",id:9},experimental_features:{type:"bool",id:10},use_ble:{type:"bool",id:100},use_se:{type:"bool",id:101},is_bixinapp:{type:"bool",id:102},fastpay_pin:{type:"bool",id:103},fastpay_confirm:{type:"bool",id:104},fastpay_money_limit:{type:"uint64",id:105},fastpay_times:{type:"uint32",id:106}},nested:{ExportType:{values:{SeedEncExportType_NO:0,SeedEncExportType_YES:1,MnemonicPlainExportType_YES:2}}}},ApplyFlags:{fields:{flags:{rule:"required",type:"uint32",id:1}}},ChangePin:{fields:{remove:{type:"bool",id:1}}},ChangeWipeCode:{fields:{remove:{type:"bool",id:1}}},SdProtect:{fields:{operation:{rule:"required",type:"SdProtectOperationType",id:1}},nested:{SdProtectOperationType:{values:{DISABLE:0,ENABLE:1,REFRESH:2}}}},Ping:{fields:{message:{type:"string",id:1,options:{default:""}},button_protection:{type:"bool",id:2}}},Cancel:{fields:{}},GetEntropy:{fields:{size:{rule:"required",type:"uint32",id:1}}},Entropy:{fields:{entropy:{rule:"required",type:"bytes",id:1}}},WipeDevice:{fields:{}},LoadDevice:{fields:{mnemonics:{rule:"repeated",type:"string",id:1},pin:{type:"string",id:3},passphrase_protection:{type:"bool",id:4},language:{type:"string",id:5,options:{default:"en-US"}},label:{type:"string",id:6},skip_checksum:{type:"bool",id:7},u2f_counter:{type:"uint32",id:8},needs_backup:{type:"bool",id:9},no_backup:{type:"bool",id:10}}},ResetDevice:{fields:{display_random:{type:"bool",id:1},strength:{type:"uint32",id:2,options:{default:256}},passphrase_protection:{type:"bool",id:3},pin_protection:{type:"bool",id:4},language:{type:"string",id:5,options:{default:"en-US"}},label:{type:"string",id:6},u2f_counter:{type:"uint32",id:7},skip_backup:{type:"bool",id:8},no_backup:{type:"bool",id:9},backup_type:{type:"BackupType",id:10,options:{default:"Bip39"}}}},BackupDevice:{fields:{}},EntropyRequest:{fields:{}},EntropyAck:{fields:{entropy:{rule:"required",type:"bytes",id:1}}},RecoveryDevice:{fields:{word_count:{type:"uint32",id:1},passphrase_protection:{type:"bool",id:2},pin_protection:{type:"bool",id:3},language:{type:"string",id:4},label:{type:"string",id:5},enforce_wordlist:{type:"bool",id:6},type:{type:"RecoveryDeviceType",id:8},u2f_counter:{type:"uint32",id:9},dry_run:{type:"bool",id:10}},nested:{RecoveryDeviceType:{values:{RecoveryDeviceType_ScrambledWords:0,RecoveryDeviceType_Matrix:1}}}},WordRequest:{fields:{type:{rule:"required",type:"WordRequestType",id:1}},nested:{WordRequestType:{values:{WordRequestType_Plain:0,WordRequestType_Matrix9:1,WordRequestType_Matrix6:2}}}},WordAck:{fields:{word:{rule:"required",type:"string",id:1}}},SetU2FCounter:{fields:{u2f_counter:{rule:"required",type:"uint32",id:1}}},GetNextU2FCounter:{fields:{}},NextU2FCounter:{fields:{u2f_counter:{rule:"required",type:"uint32",id:1}}},DoPreauthorized:{fields:{}},PreauthorizedRequest:{fields:{}},CancelAuthorization:{fields:{}},BixinSeedOperate:{fields:{type:{rule:"required",type:"SeedRequestType",id:1},seed_importData:{type:"bytes",id:2}},nested:{SeedRequestType:{values:{SeedRequestType_Gen:0,SeedRequestType_EncExport:1,SeedRequestType_EncImport:2}}}},BixinMessageSE:{fields:{inputmessage:{rule:"required",type:"bytes",id:1}}},BixinOutMessageSE:{fields:{outmessage:{type:"bytes",id:1}}},BixinReboot:{fields:{}},BixinBackupRequest:{fields:{}},BixinBackupAck:{fields:{data:{rule:"required",type:"bytes",id:1}}},BixinRestoreRequest:{fields:{data:{rule:"required",type:"bytes",id:1},language:{type:"string",id:2},label:{type:"string",id:3},passphrase_protection:{type:"bool",id:4}}},BixinRestoreAck:{fields:{data:{rule:"required",type:"bytes",id:1}}},BixinVerifyDeviceRequest:{fields:{data:{rule:"required",type:"bytes",id:1}}},BixinVerifyDeviceAck:{fields:{cert:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},BixinWhiteListRequest:{fields:{type:{rule:"required",type:"WL_OperationType",id:1},addr_in:{type:"string",id:2}},nested:{WL_OperationType:{values:{WL_OperationType_Add:0,WL_OperationType_Delete:1,WL_OperationType_Inquire:2}}}},BixinWhiteListAck:{fields:{address:{rule:"repeated",type:"string",id:1}}},BixinLoadDevice:{fields:{mnemonics:{rule:"required",type:"string",id:1},language:{type:"string",id:5,options:{default:"en-US"}},label:{type:"string",id:6},skip_checksum:{type:"bool",id:7}}},BixinBackupDevice:{fields:{}},BixinBackupDeviceAck:{fields:{mnemonics:{rule:"required",type:"string",id:1}}},DeviceInfoSettings:{fields:{serial_no:{type:"string",id:1},cpu_info:{type:"string",id:2},pre_firmware:{type:"string",id:3}}},GetDeviceInfo:{fields:{}},DeviceInfo:{fields:{serial_no:{type:"string",id:1},spiFlash_info:{type:"string",id:2},SE_info:{type:"string",id:3},NFT_voucher:{type:"bytes",id:4},cpu_info:{type:"string",id:5},pre_firmware:{type:"string",id:6}}},ReadSEPublicKey:{fields:{}},SEPublicKey:{fields:{public_key:{rule:"required",type:"bytes",id:1}}},WriteSEPublicCert:{fields:{public_cert:{rule:"required",type:"bytes",id:1}}},ReadSEPublicCert:{fields:{}},SEPublicCert:{fields:{public_cert:{rule:"required",type:"bytes",id:1}}},SpiFlashWrite:{fields:{address:{rule:"required",type:"uint32",id:1},data:{rule:"required",type:"bytes",id:2}}},SpiFlashRead:{fields:{address:{rule:"required",type:"uint32",id:1},len:{rule:"required",type:"uint32",id:2}}},SpiFlashData:{fields:{data:{rule:"required",type:"bytes",id:1}}},SESignMessage:{fields:{message:{rule:"required",type:"bytes",id:1}}},SEMessageSignature:{fields:{signature:{rule:"required",type:"bytes",id:1}}},NFTWriteInfo:{fields:{index:{rule:"required",type:"uint32",id:1},width:{rule:"required",type:"uint32",id:2},height:{rule:"required",type:"uint32",id:3},name_zh:{type:"string",id:4},name_en:{type:"string",id:5}}},NFTWriteData:{fields:{index:{rule:"required",type:"uint32",id:1},data:{rule:"required",type:"bytes",id:2},offset:{rule:"required",type:"uint32",id:3}}},RebootToBootloader:{fields:{}},MoneroTransactionSourceEntry:{fields:{outputs:{rule:"repeated",type:"MoneroOutputEntry",id:1},real_output:{type:"uint64",id:2},real_out_tx_key:{type:"bytes",id:3},real_out_additional_tx_keys:{rule:"repeated",type:"bytes",id:4},real_output_in_tx_index:{type:"uint64",id:5},amount:{type:"uint64",id:6},rct:{type:"bool",id:7},mask:{type:"bytes",id:8},multisig_kLRki:{type:"MoneroMultisigKLRki",id:9},subaddr_minor:{type:"uint32",id:10}},nested:{MoneroOutputEntry:{fields:{idx:{type:"uint64",id:1},key:{type:"MoneroRctKeyPublic",id:2}},nested:{MoneroRctKeyPublic:{fields:{dest:{type:"bytes",id:1},commitment:{type:"bytes",id:2}}}}},MoneroMultisigKLRki:{fields:{K:{type:"bytes",id:1},L:{type:"bytes",id:2},R:{type:"bytes",id:3},ki:{type:"bytes",id:4}}}}},MoneroTransactionDestinationEntry:{fields:{amount:{type:"uint64",id:1},addr:{type:"MoneroAccountPublicAddress",id:2},is_subaddress:{type:"bool",id:3},original:{type:"bytes",id:4},is_integrated:{type:"bool",id:5}},nested:{MoneroAccountPublicAddress:{fields:{spend_public_key:{type:"bytes",id:1},view_public_key:{type:"bytes",id:2}}}}},MoneroTransactionRsigData:{fields:{rsig_type:{type:"uint32",id:1},offload_type:{type:"uint32",id:2},grouping:{rule:"repeated",type:"uint64",id:3,options:{packed:!1}},mask:{type:"bytes",id:4},rsig:{type:"bytes",id:5},rsig_parts:{rule:"repeated",type:"bytes",id:6},bp_version:{type:"uint32",id:7}}},MoneroGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},network_type:{type:"uint32",id:3},account:{type:"uint32",id:4},minor:{type:"uint32",id:5},payment_id:{type:"bytes",id:6}}},MoneroAddress:{fields:{address:{type:"bytes",id:1}}},MoneroGetWatchKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network_type:{type:"uint32",id:2}}},MoneroWatchKey:{fields:{watch_key:{type:"bytes",id:1},address:{type:"bytes",id:2}}},MoneroTransactionInitRequest:{fields:{version:{type:"uint32",id:1},address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},network_type:{type:"uint32",id:3},tsx_data:{type:"MoneroTransactionData",id:4}},nested:{MoneroTransactionData:{fields:{version:{type:"uint32",id:1},payment_id:{type:"bytes",id:2},unlock_time:{type:"uint64",id:3},outputs:{rule:"repeated",type:"MoneroTransactionDestinationEntry",id:4},change_dts:{type:"MoneroTransactionDestinationEntry",id:5},num_inputs:{type:"uint32",id:6},mixin:{type:"uint32",id:7},fee:{type:"uint64",id:8},account:{type:"uint32",id:9},minor_indices:{rule:"repeated",type:"uint32",id:10,options:{packed:!1}},rsig_data:{type:"MoneroTransactionRsigData",id:11},integrated_indices:{rule:"repeated",type:"uint32",id:12,options:{packed:!1}},client_version:{type:"uint32",id:13},hard_fork:{type:"uint32",id:14},monero_version:{type:"bytes",id:15}}}}},MoneroTransactionInitAck:{fields:{hmacs:{rule:"repeated",type:"bytes",id:1},rsig_data:{type:"MoneroTransactionRsigData",id:2}}},MoneroTransactionSetInputRequest:{fields:{src_entr:{type:"MoneroTransactionSourceEntry",id:1}}},MoneroTransactionSetInputAck:{fields:{vini:{type:"bytes",id:1},vini_hmac:{type:"bytes",id:2},pseudo_out:{type:"bytes",id:3},pseudo_out_hmac:{type:"bytes",id:4},pseudo_out_alpha:{type:"bytes",id:5},spend_key:{type:"bytes",id:6}}},MoneroTransactionInputsPermutationRequest:{fields:{perm:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}}}},MoneroTransactionInputsPermutationAck:{fields:{}},MoneroTransactionInputViniRequest:{fields:{src_entr:{type:"MoneroTransactionSourceEntry",id:1},vini:{type:"bytes",id:2},vini_hmac:{type:"bytes",id:3},pseudo_out:{type:"bytes",id:4},pseudo_out_hmac:{type:"bytes",id:5},orig_idx:{type:"uint32",id:6}}},MoneroTransactionInputViniAck:{fields:{}},MoneroTransactionAllInputsSetRequest:{fields:{}},MoneroTransactionAllInputsSetAck:{fields:{rsig_data:{type:"MoneroTransactionRsigData",id:1}}},MoneroTransactionSetOutputRequest:{fields:{dst_entr:{type:"MoneroTransactionDestinationEntry",id:1},dst_entr_hmac:{type:"bytes",id:2},rsig_data:{type:"MoneroTransactionRsigData",id:3},is_offloaded_bp:{type:"bool",id:4}}},MoneroTransactionSetOutputAck:{fields:{tx_out:{type:"bytes",id:1},vouti_hmac:{type:"bytes",id:2},rsig_data:{type:"MoneroTransactionRsigData",id:3},out_pk:{type:"bytes",id:4},ecdh_info:{type:"bytes",id:5}}},MoneroTransactionAllOutSetRequest:{fields:{rsig_data:{type:"MoneroTransactionRsigData",id:1}}},MoneroTransactionAllOutSetAck:{fields:{extra:{type:"bytes",id:1},tx_prefix_hash:{type:"bytes",id:2},rv:{type:"MoneroRingCtSig",id:4},full_message_hash:{type:"bytes",id:5}},nested:{MoneroRingCtSig:{fields:{txn_fee:{type:"uint64",id:1},message:{type:"bytes",id:2},rv_type:{type:"uint32",id:3}}}}},MoneroTransactionSignInputRequest:{fields:{src_entr:{type:"MoneroTransactionSourceEntry",id:1},vini:{type:"bytes",id:2},vini_hmac:{type:"bytes",id:3},pseudo_out:{type:"bytes",id:4},pseudo_out_hmac:{type:"bytes",id:5},pseudo_out_alpha:{type:"bytes",id:6},spend_key:{type:"bytes",id:7},orig_idx:{type:"uint32",id:8}}},MoneroTransactionSignInputAck:{fields:{signature:{type:"bytes",id:1},pseudo_out:{type:"bytes",id:2}}},MoneroTransactionFinalRequest:{fields:{}},MoneroTransactionFinalAck:{fields:{cout_key:{type:"bytes",id:1},salt:{type:"bytes",id:2},rand_mult:{type:"bytes",id:3},tx_enc_keys:{type:"bytes",id:4},opening_key:{type:"bytes",id:5}}},MoneroKeyImageExportInitRequest:{fields:{num:{type:"uint64",id:1},hash:{type:"bytes",id:2},address_n:{rule:"repeated",type:"uint32",id:3,options:{packed:!1}},network_type:{type:"uint32",id:4},subs:{rule:"repeated",type:"MoneroSubAddressIndicesList",id:5}},nested:{MoneroSubAddressIndicesList:{fields:{account:{type:"uint32",id:1},minor_indices:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}}}}}},MoneroKeyImageExportInitAck:{fields:{}},MoneroKeyImageSyncStepRequest:{fields:{tdis:{rule:"repeated",type:"MoneroTransferDetails",id:1}},nested:{MoneroTransferDetails:{fields:{out_key:{type:"bytes",id:1},tx_pub_key:{type:"bytes",id:2},additional_tx_pub_keys:{rule:"repeated",type:"bytes",id:3},internal_output_index:{type:"uint64",id:4},sub_addr_major:{type:"uint32",id:5},sub_addr_minor:{type:"uint32",id:6}}}}},MoneroKeyImageSyncStepAck:{fields:{kis:{rule:"repeated",type:"MoneroExportedKeyImage",id:1}},nested:{MoneroExportedKeyImage:{fields:{iv:{type:"bytes",id:1},blob:{type:"bytes",id:3}}}}},MoneroKeyImageSyncFinalRequest:{fields:{}},MoneroKeyImageSyncFinalAck:{fields:{enc_key:{type:"bytes",id:1}}},MoneroGetTxKeyRequest:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network_type:{type:"uint32",id:2},salt1:{type:"bytes",id:3},salt2:{type:"bytes",id:4},tx_enc_keys:{type:"bytes",id:5},tx_prefix_hash:{type:"bytes",id:6},reason:{type:"uint32",id:7},view_public_key:{type:"bytes",id:8}}},MoneroGetTxKeyAck:{fields:{salt:{type:"bytes",id:1},tx_keys:{type:"bytes",id:2},tx_derivations:{type:"bytes",id:3}}},MoneroLiveRefreshStartRequest:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network_type:{type:"uint32",id:2}}},MoneroLiveRefreshStartAck:{fields:{}},MoneroLiveRefreshStepRequest:{fields:{out_key:{type:"bytes",id:1},recv_deriv:{type:"bytes",id:2},real_out_idx:{type:"uint64",id:3},sub_addr_major:{type:"uint32",id:4},sub_addr_minor:{type:"uint32",id:5}}},MoneroLiveRefreshStepAck:{fields:{salt:{type:"bytes",id:1},key_image:{type:"bytes",id:2}}},MoneroLiveRefreshFinalRequest:{fields:{}},MoneroLiveRefreshFinalAck:{fields:{}},DebugMoneroDiagRequest:{fields:{ins:{type:"uint64",id:1},p1:{type:"uint64",id:2},p2:{type:"uint64",id:3},pd:{rule:"repeated",type:"uint64",id:4,options:{packed:!1}},data1:{type:"bytes",id:5},data2:{type:"bytes",id:6}}},DebugMoneroDiagAck:{fields:{ins:{type:"uint64",id:1},p1:{type:"uint64",id:2},p2:{type:"uint64",id:3},pd:{rule:"repeated",type:"uint64",id:4,options:{packed:!1}},data1:{type:"bytes",id:5},data2:{type:"bytes",id:6}}},NearGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},NearAddress:{fields:{address:{type:"string",id:1}}},NearSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{type:"bytes",id:2}}},NearSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1}}},NEMGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network:{type:"uint32",id:2},show_display:{type:"bool",id:3}}},NEMAddress:{fields:{address:{rule:"required",type:"string",id:1}}},NEMSignTx:{fields:{transaction:{type:"NEMTransactionCommon",id:1},multisig:{type:"NEMTransactionCommon",id:2},transfer:{type:"NEMTransfer",id:3},cosigning:{type:"bool",id:4},provision_namespace:{type:"NEMProvisionNamespace",id:5},mosaic_creation:{type:"NEMMosaicCreation",id:6},supply_change:{type:"NEMMosaicSupplyChange",id:7},aggregate_modification:{type:"NEMAggregateModification",id:8},importance_transfer:{type:"NEMImportanceTransfer",id:9}},nested:{NEMTransactionCommon:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network:{type:"uint32",id:2},timestamp:{type:"uint32",id:3},fee:{type:"uint64",id:4},deadline:{type:"uint32",id:5},signer:{type:"bytes",id:6}}},NEMTransfer:{fields:{recipient:{type:"string",id:1},amount:{type:"uint64",id:2},payload:{type:"bytes",id:3},public_key:{type:"bytes",id:4},mosaics:{rule:"repeated",type:"NEMMosaic",id:5}},nested:{NEMMosaic:{fields:{namespace:{type:"string",id:1},mosaic:{type:"string",id:2},quantity:{type:"uint64",id:3}}}}},NEMProvisionNamespace:{fields:{namespace:{type:"string",id:1},parent:{type:"string",id:2},sink:{type:"string",id:3},fee:{type:"uint64",id:4}}},NEMMosaicCreation:{fields:{definition:{type:"NEMMosaicDefinition",id:1},sink:{type:"string",id:2},fee:{type:"uint64",id:3}},nested:{NEMMosaicDefinition:{fields:{name:{type:"string",id:1},ticker:{type:"string",id:2},namespace:{type:"string",id:3},mosaic:{type:"string",id:4},divisibility:{type:"uint32",id:5},levy:{type:"NEMMosaicLevy",id:6},fee:{type:"uint64",id:7},levy_address:{type:"string",id:8},levy_namespace:{type:"string",id:9},levy_mosaic:{type:"string",id:10},supply:{type:"uint64",id:11},mutable_supply:{type:"bool",id:12},transferable:{type:"bool",id:13},description:{type:"string",id:14},networks:{rule:"repeated",type:"uint32",id:15,options:{packed:!1}}},nested:{NEMMosaicLevy:{values:{MosaicLevy_Absolute:1,MosaicLevy_Percentile:2}}}}}},NEMMosaicSupplyChange:{fields:{namespace:{type:"string",id:1},mosaic:{type:"string",id:2},type:{type:"NEMSupplyChangeType",id:3},delta:{type:"uint64",id:4}},nested:{NEMSupplyChangeType:{values:{SupplyChange_Increase:1,SupplyChange_Decrease:2}}}},NEMAggregateModification:{fields:{modifications:{rule:"repeated",type:"NEMCosignatoryModification",id:1},relative_change:{type:"sint32",id:2}},nested:{NEMCosignatoryModification:{fields:{type:{type:"NEMModificationType",id:1},public_key:{type:"bytes",id:2}},nested:{NEMModificationType:{values:{CosignatoryModification_Add:1,CosignatoryModification_Delete:2}}}}}},NEMImportanceTransfer:{fields:{mode:{type:"NEMImportanceTransferMode",id:1},public_key:{type:"bytes",id:2}},nested:{NEMImportanceTransferMode:{values:{ImportanceTransfer_Activate:1,ImportanceTransfer_Deactivate:2}}}}}},NEMSignedTx:{fields:{data:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},NEMDecryptMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network:{type:"uint32",id:2},public_key:{type:"bytes",id:3},payload:{type:"bytes",id:4}}},NEMDecryptedMessage:{fields:{payload:{rule:"required",type:"bytes",id:1}}},RippleGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},RippleAddress:{fields:{address:{rule:"required",type:"string",id:1}}},RippleSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},fee:{type:"uint64",id:2},flags:{type:"uint32",id:3},sequence:{type:"uint32",id:4},last_ledger_sequence:{type:"uint32",id:5},payment:{type:"RipplePayment",id:6}},nested:{RipplePayment:{fields:{amount:{rule:"required",type:"uint64",id:1},destination:{rule:"required",type:"string",id:2},destination_tag:{type:"uint32",id:3}}}}},RippleSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1},serialized_tx:{rule:"required",type:"bytes",id:2}}},SolanaGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},SolanaAddress:{fields:{address:{type:"string",id:1}}},SolanaSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2}}},SolanaSignedTx:{fields:{signature:{type:"bytes",id:1}}},StarcoinGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},StarcoinAddress:{fields:{address:{type:"string",id:1}}},StarcoinGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},StarcoinPublicKey:{fields:{public_key:{rule:"required",type:"bytes",id:1}}},StarcoinSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{type:"bytes",id:2}}},StarcoinSignedTx:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},StarcoinSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{type:"bytes",id:2}}},StarcoinMessageSignature:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},StarcoinVerifyMessage:{fields:{public_key:{type:"bytes",id:1},signature:{type:"bytes",id:2},message:{type:"bytes",id:3}}},StellarAssetType:{values:{NATIVE:0,ALPHANUM4:1,ALPHANUM12:2}},StellarAsset:{fields:{type:{rule:"required",type:"StellarAssetType",id:1},code:{type:"string",id:2},issuer:{type:"string",id:3}}},StellarGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},StellarAddress:{fields:{address:{rule:"required",type:"string",id:1}}},StellarSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},network_passphrase:{rule:"required",type:"string",id:3},source_account:{rule:"required",type:"string",id:4},fee:{rule:"required",type:"uint32",id:5},sequence_number:{rule:"required",type:"uint64",id:6},timebounds_start:{rule:"required",type:"uint32",id:8},timebounds_end:{rule:"required",type:"uint32",id:9},memo_type:{rule:"required",type:"StellarMemoType",id:10},memo_text:{type:"string",id:11},memo_id:{type:"uint64",id:12},memo_hash:{type:"bytes",id:13},num_operations:{rule:"required",type:"uint32",id:14}},nested:{StellarMemoType:{values:{NONE:0,TEXT:1,ID:2,HASH:3,RETURN:4}}}},StellarTxOpRequest:{fields:{}},StellarPaymentOp:{fields:{source_account:{type:"string",id:1},destination_account:{rule:"required",type:"string",id:2},asset:{rule:"required",type:"StellarAsset",id:3},amount:{rule:"required",type:"sint64",id:4}}},StellarCreateAccountOp:{fields:{source_account:{type:"string",id:1},new_account:{rule:"required",type:"string",id:2},starting_balance:{rule:"required",type:"sint64",id:3}}},StellarPathPaymentStrictReceiveOp:{fields:{source_account:{type:"string",id:1},send_asset:{rule:"required",type:"StellarAsset",id:2},send_max:{rule:"required",type:"sint64",id:3},destination_account:{rule:"required",type:"string",id:4},destination_asset:{rule:"required",type:"StellarAsset",id:5},destination_amount:{rule:"required",type:"sint64",id:6},paths:{rule:"repeated",type:"StellarAsset",id:7}}},StellarPathPaymentStrictSendOp:{fields:{source_account:{type:"string",id:1},send_asset:{rule:"required",type:"StellarAsset",id:2},send_amount:{rule:"required",type:"sint64",id:3},destination_account:{rule:"required",type:"string",id:4},destination_asset:{rule:"required",type:"StellarAsset",id:5},destination_min:{rule:"required",type:"sint64",id:6},paths:{rule:"repeated",type:"StellarAsset",id:7}}},StellarManageSellOfferOp:{fields:{source_account:{type:"string",id:1},selling_asset:{rule:"required",type:"StellarAsset",id:2},buying_asset:{rule:"required",type:"StellarAsset",id:3},amount:{rule:"required",type:"sint64",id:4},price_n:{rule:"required",type:"uint32",id:5},price_d:{rule:"required",type:"uint32",id:6},offer_id:{rule:"required",type:"uint64",id:7}}},StellarManageBuyOfferOp:{fields:{source_account:{type:"string",id:1},selling_asset:{rule:"required",type:"StellarAsset",id:2},buying_asset:{rule:"required",type:"StellarAsset",id:3},amount:{rule:"required",type:"sint64",id:4},price_n:{rule:"required",type:"uint32",id:5},price_d:{rule:"required",type:"uint32",id:6},offer_id:{rule:"required",type:"uint64",id:7}}},StellarCreatePassiveSellOfferOp:{fields:{source_account:{type:"string",id:1},selling_asset:{rule:"required",type:"StellarAsset",id:2},buying_asset:{rule:"required",type:"StellarAsset",id:3},amount:{rule:"required",type:"sint64",id:4},price_n:{rule:"required",type:"uint32",id:5},price_d:{rule:"required",type:"uint32",id:6}}},StellarSetOptionsOp:{fields:{source_account:{type:"string",id:1},inflation_destination_account:{type:"string",id:2},clear_flags:{type:"uint32",id:3},set_flags:{type:"uint32",id:4},master_weight:{type:"uint32",id:5},low_threshold:{type:"uint32",id:6},medium_threshold:{type:"uint32",id:7},high_threshold:{type:"uint32",id:8},home_domain:{type:"string",id:9},signer_type:{type:"StellarSignerType",id:10},signer_key:{type:"bytes",id:11},signer_weight:{type:"uint32",id:12}},nested:{StellarSignerType:{values:{ACCOUNT:0,PRE_AUTH:1,HASH:2}}}},StellarChangeTrustOp:{fields:{source_account:{type:"string",id:1},asset:{rule:"required",type:"StellarAsset",id:2},limit:{rule:"required",type:"uint64",id:3}}},StellarAllowTrustOp:{fields:{source_account:{type:"string",id:1},trusted_account:{rule:"required",type:"string",id:2},asset_type:{rule:"required",type:"StellarAssetType",id:3},asset_code:{type:"string",id:4},is_authorized:{rule:"required",type:"bool",id:5}}},StellarAccountMergeOp:{fields:{source_account:{type:"string",id:1},destination_account:{rule:"required",type:"string",id:2}}},StellarManageDataOp:{fields:{source_account:{type:"string",id:1},key:{rule:"required",type:"string",id:2},value:{type:"bytes",id:3}}},StellarBumpSequenceOp:{fields:{source_account:{type:"string",id:1},bump_to:{rule:"required",type:"uint64",id:2}}},StellarSignedTx:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},TezosGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},TezosAddress:{fields:{address:{rule:"required",type:"string",id:1}}},TezosGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},TezosPublicKey:{fields:{public_key:{rule:"required",type:"string",id:1}}},TezosSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},branch:{rule:"required",type:"bytes",id:2},reveal:{type:"TezosRevealOp",id:3},transaction:{type:"TezosTransactionOp",id:4},origination:{type:"TezosOriginationOp",id:5},delegation:{type:"TezosDelegationOp",id:6},proposal:{type:"TezosProposalOp",id:7},ballot:{type:"TezosBallotOp",id:8}},nested:{TezosContractID:{fields:{tag:{rule:"required",type:"TezosContractType",id:1},hash:{rule:"required",type:"bytes",id:2}},nested:{TezosContractType:{values:{Implicit:0,Originated:1}}}},TezosRevealOp:{fields:{source:{rule:"required",type:"bytes",id:7},fee:{rule:"required",type:"uint64",id:2},counter:{rule:"required",type:"uint64",id:3},gas_limit:{rule:"required",type:"uint64",id:4},storage_limit:{rule:"required",type:"uint64",id:5},public_key:{rule:"required",type:"bytes",id:6}}},TezosTransactionOp:{fields:{source:{rule:"required",type:"bytes",id:9},fee:{rule:"required",type:"uint64",id:2},counter:{rule:"required",type:"uint64",id:3},gas_limit:{rule:"required",type:"uint64",id:4},storage_limit:{rule:"required",type:"uint64",id:5},amount:{rule:"required",type:"uint64",id:6},destination:{rule:"required",type:"TezosContractID",id:7},parameters:{type:"bytes",id:8},parameters_manager:{type:"TezosParametersManager",id:10}},nested:{TezosParametersManager:{fields:{set_delegate:{type:"bytes",id:1},cancel_delegate:{type:"bool",id:2},transfer:{type:"TezosManagerTransfer",id:3}},nested:{TezosManagerTransfer:{fields:{destination:{type:"TezosContractID",id:1},amount:{type:"uint64",id:2}}}}}}},TezosOriginationOp:{fields:{source:{rule:"required",type:"bytes",id:12},fee:{rule:"required",type:"uint64",id:2},counter:{rule:"required",type:"uint64",id:3},gas_limit:{rule:"required",type:"uint64",id:4},storage_limit:{rule:"required",type:"uint64",id:5},manager_pubkey:{type:"bytes",id:6},balance:{rule:"required",type:"uint64",id:7},spendable:{type:"bool",id:8},delegatable:{type:"bool",id:9},delegate:{type:"bytes",id:10},script:{rule:"required",type:"bytes",id:11}}},TezosDelegationOp:{fields:{source:{rule:"required",type:"bytes",id:7},fee:{rule:"required",type:"uint64",id:2},counter:{rule:"required",type:"uint64",id:3},gas_limit:{rule:"required",type:"uint64",id:4},storage_limit:{rule:"required",type:"uint64",id:5},delegate:{rule:"required",type:"bytes",id:6}}},TezosProposalOp:{fields:{source:{type:"bytes",id:1},period:{type:"uint64",id:2},proposals:{rule:"repeated",type:"bytes",id:4}}},TezosBallotOp:{fields:{source:{type:"bytes",id:1},period:{type:"uint64",id:2},proposal:{type:"bytes",id:3},ballot:{type:"TezosBallotType",id:4}},nested:{TezosBallotType:{values:{Yay:0,Nay:1,Pass:2}}}}}},TezosSignedTx:{fields:{signature:{rule:"required",type:"string",id:1},sig_op_contents:{rule:"required",type:"bytes",id:2},operation_hash:{rule:"required",type:"string",id:3}}},TronGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},TronAddress:{fields:{address:{type:"string",id:1}}},TronSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},ref_block_bytes:{rule:"required",type:"bytes",id:2},ref_block_hash:{rule:"required",type:"bytes",id:3},expiration:{rule:"required",type:"uint64",id:4},data:{type:"string",id:5},contract:{rule:"required",type:"TronContract",id:6},timestamp:{rule:"required",type:"uint64",id:7},fee_limit:{type:"uint64",id:8}},nested:{TronContract:{fields:{transfer_contract:{type:"TronTransferContract",id:2},trigger_smart_contract:{type:"TronTriggerSmartContract",id:31}},nested:{TronTransferContract:{fields:{to_address:{type:"string",id:2},amount:{type:"uint64",id:3}}},TronTriggerSmartContract:{fields:{contract_address:{type:"string",id:2},call_value:{type:"uint64",id:3},data:{type:"bytes",id:4},call_token_value:{type:"uint64",id:5},asset_id:{type:"uint64",id:6}}}}}}},TronSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1},serialized_tx:{type:"bytes",id:2}}},TronSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2}}},TronMessageSignature:{fields:{address:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},WebAuthnListResidentCredentials:{fields:{}},WebAuthnAddResidentCredential:{fields:{credential_id:{type:"bytes",id:1}}},WebAuthnRemoveResidentCredential:{fields:{index:{type:"uint32",id:1}}},WebAuthnCredentials:{fields:{credentials:{rule:"repeated",type:"WebAuthnCredential",id:1}},nested:{WebAuthnCredential:{fields:{index:{type:"uint32",id:1},id:{type:"bytes",id:2},rp_id:{type:"string",id:3},rp_name:{type:"string",id:4},user_id:{type:"bytes",id:5},user_name:{type:"string",id:6},user_display_name:{type:"string",id:7},creation_time:{type:"uint32",id:8},hmac_secret:{type:"bool",id:9},use_sign_count:{type:"bool",id:10},algorithm:{type:"sint32",id:11},curve:{type:"sint32",id:12}}}}},wire_in:{type:"bool",id:50002,extend:"google.protobuf.EnumValueOptions"},wire_out:{type:"bool",id:50003,extend:"google.protobuf.EnumValueOptions"},wire_debug_in:{type:"bool",id:50004,extend:"google.protobuf.EnumValueOptions"},wire_debug_out:{type:"bool",id:50005,extend:"google.protobuf.EnumValueOptions"},wire_tiny:{type:"bool",id:50006,extend:"google.protobuf.EnumValueOptions"},wire_bootloader:{type:"bool",id:50007,extend:"google.protobuf.EnumValueOptions"},wire_no_fsm:{type:"bool",id:50008,extend:"google.protobuf.EnumValueOptions"},facotry:{type:"bool",id:50501,extend:"google.protobuf.EnumValueOptions"},bitcoin_only:{type:"bool",id:6e4,extend:"google.protobuf.EnumValueOptions"},has_bitcoin_only_values:{type:"bool",id:51001,extend:"google.protobuf.EnumOptions"},unstable:{type:"bool",id:52001,extend:"google.protobuf.MessageOptions"},wire_type:{type:"uint32",id:52002,extend:"google.protobuf.MessageOptions"},experimental:{type:"bool",id:53001,extend:"google.protobuf.FieldOptions"},include_in_bitcoin_only:{type:"bool",id:6e4,extend:"google.protobuf.FileOptions"},CommandFlags:{values:{Default:0,Factory_Only:1}},MessageType:{options:{"(has_bitcoin_only_values)":!0},values:{MessageType_Initialize:0,MessageType_Ping:1,MessageType_Success:2,MessageType_Failure:3,MessageType_ChangePin:4,MessageType_WipeDevice:5,MessageType_GetEntropy:9,MessageType_Entropy:10,MessageType_LoadDevice:13,MessageType_ResetDevice:14,MessageType_Features:17,MessageType_PinMatrixRequest:18,MessageType_PinMatrixAck:19,MessageType_Cancel:20,MessageType_LockDevice:24,MessageType_ApplySettings:25,MessageType_ButtonRequest:26,MessageType_ButtonAck:27,MessageType_ApplyFlags:28,MessageType_BackupDevice:34,MessageType_EntropyRequest:35,MessageType_EntropyAck:36,MessageType_PassphraseRequest:41,MessageType_PassphraseAck:42,MessageType_RecoveryDevice:45,MessageType_WordRequest:46,MessageType_WordAck:47,MessageType_GetFeatures:55,MessageType_SdProtect:79,MessageType_ChangeWipeCode:82,MessageType_EndSession:83,MessageType_DoPreauthorized:84,MessageType_PreauthorizedRequest:85,MessageType_CancelAuthorization:86,MessageType_RebootToBootloader:87,MessageType_SetU2FCounter:63,MessageType_GetNextU2FCounter:80,MessageType_NextU2FCounter:81,MessageType_Deprecated_PassphraseStateRequest:77,MessageType_Deprecated_PassphraseStateAck:78,MessageType_FirmwareErase:6,MessageType_FirmwareErase_ex:16,MessageType_FirmwareUpload:7,MessageType_FirmwareRequest:8,MessageType_SelfTest:32,MessageType_GetPublicKey:11,MessageType_PublicKey:12,MessageType_SignTx:15,MessageType_TxRequest:21,MessageType_TxAck:22,MessageType_GetAddress:29,MessageType_Address:30,MessageType_SignMessage:38,MessageType_VerifyMessage:39,MessageType_MessageSignature:40,MessageType_GetOwnershipId:43,MessageType_OwnershipId:44,MessageType_GetOwnershipProof:49,MessageType_OwnershipProof:50,MessageType_AuthorizeCoinJoin:51,MessageType_CipherKeyValue:23,MessageType_CipheredKeyValue:48,MessageType_SignIdentity:53,MessageType_SignedIdentity:54,MessageType_GetECDHSessionKey:61,MessageType_ECDHSessionKey:62,MessageType_CosiCommit:71,MessageType_CosiCommitment:72,MessageType_CosiSign:73,MessageType_CosiSignature:74,MessageType_DebugLinkDecision:100,MessageType_DebugLinkGetState:101,MessageType_DebugLinkState:102,MessageType_DebugLinkStop:103,MessageType_DebugLinkLog:104,MessageType_DebugLinkMemoryRead:110,MessageType_DebugLinkMemory:111,MessageType_DebugLinkMemoryWrite:112,MessageType_DebugLinkFlashErase:113,MessageType_DebugLinkLayout:9001,MessageType_DebugLinkReseedRandom:9002,MessageType_DebugLinkRecordScreen:9003,MessageType_DebugLinkEraseSdCard:9005,MessageType_DebugLinkWatchLayout:9006,MessageType_EthereumGetPublicKey:450,MessageType_EthereumPublicKey:451,MessageType_EthereumGetAddress:56,MessageType_EthereumAddress:57,MessageType_EthereumSignTx:58,MessageType_EthereumSignTxEIP1559:452,MessageType_EthereumTxRequest:59,MessageType_EthereumTxAck:60,MessageType_EthereumSignMessage:64,MessageType_EthereumVerifyMessage:65,MessageType_EthereumMessageSignature:66,MessageType_EthereumSignTypedData:464,MessageType_EthereumTypedDataStructRequest:465,MessageType_EthereumTypedDataStructAck:466,MessageType_EthereumTypedDataValueRequest:467,MessageType_EthereumTypedDataValueAck:468,MessageType_EthereumTypedDataSignature:469,MessageType_EthereumSignTypedHash:470,MessageType_NEMGetAddress:67,MessageType_NEMAddress:68,MessageType_NEMSignTx:69,MessageType_NEMSignedTx:70,MessageType_NEMDecryptMessage:75,MessageType_NEMDecryptedMessage:76,MessageType_TezosGetAddress:150,MessageType_TezosAddress:151,MessageType_TezosSignTx:152,MessageType_TezosSignedTx:153,MessageType_TezosGetPublicKey:154,MessageType_TezosPublicKey:155,MessageType_StellarSignTx:202,MessageType_StellarTxOpRequest:203,MessageType_StellarGetAddress:207,MessageType_StellarAddress:208,MessageType_StellarCreateAccountOp:210,MessageType_StellarPaymentOp:211,MessageType_StellarPathPaymentStrictReceiveOp:212,MessageType_StellarManageSellOfferOp:213,MessageType_StellarCreatePassiveSellOfferOp:214,MessageType_StellarSetOptionsOp:215,MessageType_StellarChangeTrustOp:216,MessageType_StellarAllowTrustOp:217,MessageType_StellarAccountMergeOp:218,MessageType_StellarManageDataOp:220,MessageType_StellarBumpSequenceOp:221,MessageType_StellarManageBuyOfferOp:222,MessageType_StellarPathPaymentStrictSendOp:223,MessageType_StellarSignedTx:230,MessageType_CardanoSignTx:303,MessageType_CardanoGetPublicKey:305,MessageType_CardanoPublicKey:306,MessageType_CardanoGetAddress:307,MessageType_CardanoAddress:308,MessageType_CardanoSignedTx:310,MessageType_CardanoSignedTxChunk:311,MessageType_CardanoSignedTxChunkAck:312,MessageType_CardanoTxItemAck:313,MessageType_CardanoTxAuxiliaryDataSupplement:314,MessageType_CardanoTxWitnessRequest:315,MessageType_CardanoTxWitnessResponse:316,MessageType_CardanoTxHostAck:317,MessageType_CardanoTxBodyHash:318,MessageType_CardanoSignTxFinished:319,MessageType_CardanoSignTxInit:320,MessageType_CardanoTxInput:321,MessageType_CardanoTxOutput:322,MessageType_CardanoAssetGroup:323,MessageType_CardanoToken:324,MessageType_CardanoTxCertificate:325,MessageType_CardanoTxWithdrawal:326,MessageType_CardanoTxAuxiliaryData:327,MessageType_CardanoPoolOwner:328,MessageType_CardanoPoolRelayParameters:329,MessageType_CardanoGetNativeScriptHash:330,MessageType_CardanoNativeScriptHash:331,MessageType_CardanoTxMint:332,MessageType_RippleGetAddress:400,MessageType_RippleAddress:401,MessageType_RippleSignTx:402,MessageType_RippleSignedTx:403,MessageType_MoneroTransactionInitRequest:501,MessageType_MoneroTransactionInitAck:502,MessageType_MoneroTransactionSetInputRequest:503,MessageType_MoneroTransactionSetInputAck:504,MessageType_MoneroTransactionInputsPermutationRequest:505,MessageType_MoneroTransactionInputsPermutationAck:506,MessageType_MoneroTransactionInputViniRequest:507,MessageType_MoneroTransactionInputViniAck:508,MessageType_MoneroTransactionAllInputsSetRequest:509,MessageType_MoneroTransactionAllInputsSetAck:510,MessageType_MoneroTransactionSetOutputRequest:511,MessageType_MoneroTransactionSetOutputAck:512,MessageType_MoneroTransactionAllOutSetRequest:513,MessageType_MoneroTransactionAllOutSetAck:514,MessageType_MoneroTransactionSignInputRequest:515,MessageType_MoneroTransactionSignInputAck:516,MessageType_MoneroTransactionFinalRequest:517,MessageType_MoneroTransactionFinalAck:518,MessageType_MoneroKeyImageExportInitRequest:530,MessageType_MoneroKeyImageExportInitAck:531,MessageType_MoneroKeyImageSyncStepRequest:532,MessageType_MoneroKeyImageSyncStepAck:533,MessageType_MoneroKeyImageSyncFinalRequest:534,MessageType_MoneroKeyImageSyncFinalAck:535,MessageType_MoneroGetAddress:540,MessageType_MoneroAddress:541,MessageType_MoneroGetWatchKey:542,MessageType_MoneroWatchKey:543,MessageType_DebugMoneroDiagRequest:546,MessageType_DebugMoneroDiagAck:547,MessageType_MoneroGetTxKeyRequest:550,MessageType_MoneroGetTxKeyAck:551,MessageType_MoneroLiveRefreshStartRequest:552,MessageType_MoneroLiveRefreshStartAck:553,MessageType_MoneroLiveRefreshStepRequest:554,MessageType_MoneroLiveRefreshStepAck:555,MessageType_MoneroLiveRefreshFinalRequest:556,MessageType_MoneroLiveRefreshFinalAck:557,MessageType_EosGetPublicKey:600,MessageType_EosPublicKey:601,MessageType_EosSignTx:602,MessageType_EosTxActionRequest:603,MessageType_EosTxActionAck:604,MessageType_EosSignedTx:605,MessageType_BinanceGetAddress:700,MessageType_BinanceAddress:701,MessageType_BinanceGetPublicKey:702,MessageType_BinancePublicKey:703,MessageType_BinanceSignTx:704,MessageType_BinanceTxRequest:705,MessageType_BinanceTransferMsg:706,MessageType_BinanceOrderMsg:707,MessageType_BinanceCancelMsg:708,MessageType_BinanceSignedTx:709,MessageType_SolanaGetAddress:10100,MessageType_SolanaAddress:10101,MessageType_SolanaSignTx:10102,MessageType_SolanaSignedTx:10103,MessageType_StarcoinGetAddress:10300,MessageType_StarcoinAddress:10301,MessageType_StarcoinGetPublicKey:10302,MessageType_StarcoinPublicKey:10303,MessageType_StarcoinSignTx:10304,MessageType_StarcoinSignedTx:10305,MessageType_StarcoinSignMessage:10306,MessageType_StarcoinMessageSignature:10307,MessageType_StarcoinVerifyMessage:10308,MessageType_ConfluxGetAddress:10401,MessageType_ConfluxAddress:10402,MessageType_ConfluxSignTx:10403,MessageType_ConfluxTxRequest:10404,MessageType_ConfluxTxAck:10405,MessageType_ConfluxSignMessage:10406,MessageType_ConfluxSignMessageCIP23:10407,MessageType_ConfluxMessageSignature:10408,MessageType_ConfluxVerifyMessage:10409,MessageType_ConfluxVerifyMessageCIP23:10410,MessageType_AptosGetAddress:10600,MessageType_AptosAddress:10601,MessageType_AptosSignTx:10602,MessageType_AptosSignedTx:10603,MessageType_WebAuthnListResidentCredentials:800,MessageType_WebAuthnCredentials:801,MessageType_WebAuthnAddResidentCredential:802,MessageType_WebAuthnRemoveResidentCredential:803,MessageType_BixinSeedOperate:901,MessageType_BixinMessageSE:902,MessageType_BixinReboot:903,MessageType_BixinOutMessageSE:904,MessageType_BixinBackupRequest:905,MessageType_BixinBackupAck:906,MessageType_BixinRestoreRequest:907,MessageType_BixinRestoreAck:908,MessageType_BixinVerifyDeviceRequest:909,MessageType_BixinVerifyDeviceAck:910,MessageType_BixinWhiteListRequest:911,MessageType_BixinWhiteListAck:912,MessageType_BixinLoadDevice:913,MessageType_BixinBackupDevice:914,MessageType_BixinBackupDeviceAck:915,MessageType_BixinPinInputOnDevice:1e4,MessageType_EthereumSignMessageEIP712:10200,MessageType_GetPublicKeyMultiple:10210,MessageType_PublicKeyMultiple:10211,MessageType_TronGetAddress:10501,MessageType_TronAddress:10502,MessageType_TronSignTx:10503,MessageType_TronSignedTx:10504,MessageType_TronSignMessage:10505,MessageType_TronMessageSignature:10506,MessageType_NearGetAddress:10701,MessageType_NearAddress:10702,MessageType_NearSignTx:10703,MessageType_NearSignedTx:10704,MessageType_DeviceInfoSettings:10001,MessageType_GetDeviceInfo:10002,MessageType_DeviceInfo:10003,MessageType_ReadSEPublicKey:10004,MessageType_SEPublicKey:10005,MessageType_WriteSEPublicCert:10006,MessageType_ReadSEPublicCert:10007,MessageType_SEPublicCert:10008,MessageType_SpiFlashWrite:10009,MessageType_SpiFlashRead:10010,MessageType_SpiFlashData:10011,MessageType_SESignMessage:10012,MessageType_SEMessageSignature:10013,MessageType_NFTWriteInfo:10014,MessageType_NFTWriteData:10015}},google:{nested:{protobuf:{nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},public_dependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weak_dependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},message_type:{rule:"repeated",type:"DescriptorProto",id:4},enum_type:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},source_code_info:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nested_type:{rule:"repeated",type:"DescriptorProto",id:3},enum_type:{rule:"repeated",type:"EnumDescriptorProto",id:4},extension_range:{rule:"repeated",type:"ExtensionRange",id:5},oneof_decl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reserved_range:{rule:"repeated",type:"ReservedRange",id:9},reserved_name:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},type_name:{type:"string",id:6},extendee:{type:"string",id:2},default_value:{type:"string",id:7},oneof_index:{type:"int32",id:9},json_name:{type:"string",id:10},options:{type:"FieldOptions",id:8}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},input_type:{type:"string",id:2},output_type:{type:"string",id:3},options:{type:"MethodOptions",id:4},client_streaming:{type:"bool",id:5},server_streaming:{type:"bool",id:6}}},FileOptions:{fields:{java_package:{type:"string",id:1},java_outer_classname:{type:"string",id:8},java_multiple_files:{type:"bool",id:10},java_generate_equals_and_hash:{type:"bool",id:20,options:{deprecated:!0}},java_string_check_utf8:{type:"bool",id:27},optimize_for:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},go_package:{type:"string",id:11},cc_generic_services:{type:"bool",id:16},java_generic_services:{type:"bool",id:17},py_generic_services:{type:"bool",id:18},deprecated:{type:"bool",id:23},cc_enable_arenas:{type:"bool",id:31},objc_class_prefix:{type:"string",id:36},csharp_namespace:{type:"string",id:37},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{message_set_wire_format:{type:"bool",id:1},no_standard_descriptor_accessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},map_entry:{type:"bool",id:7},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allow_alias:{type:"bool",id:2},deprecated:{type:"bool",id:3},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifier_value:{type:"string",id:3},positive_int_value:{type:"uint64",id:4},negative_int_value:{type:"int64",id:5},double_value:{type:"double",id:6},string_value:{type:"bytes",id:7},aggregate_value:{type:"string",id:8}},nested:{NamePart:{fields:{name_part:{rule:"required",type:"string",id:1},is_extension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leading_comments:{type:"string",id:3},trailing_comments:{type:"string",id:4},leading_detached_comments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},source_file:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}}}}}}}}},qt.getFirmwareStatus=e=>{var t,r;const i=vt(e),n=Tt(e);if(!1===e.firmware_present)return"none";if("classic"===i&&e.bootloader_mode)return"unknown";const s=null!==(r=null===(t=Pt.deviceMap[i])||void 0===t?void 0:t.firmware)&&void 0!==r?r:[],o=n.join(".");return Nt(s,o)},qt.getFirmwareChangelog=e=>{var t,r;const i=vt(e),n=Tt(e);if(!1===e.firmware_present||"classic"===i&&e.bootloader_mode)return[];const s=null!==(r=null===(t=Pt.deviceMap[i])||void 0===t?void 0:t.firmware)&&void 0!==r?r:[],o=n.join(".");return Dt(s,o)},qt.getFirmwareLeatestRelease=e=>{var t,r;const i=vt(e),n=null!==(r=null===(t=Pt.deviceMap[i])||void 0===t?void 0:t.firmware)&&void 0!==r?r:[];return n[n.length-1]},qt.getBLEFirmwareStatus=e=>{var t,r;const i=vt(e),n=Et(e);if(!n)return"none";const s=null!==(r=null===(t=Pt.deviceMap[i])||void 0===t?void 0:t.ble)&&void 0!==r?r:[],o=n.join(".");return Nt(s,o)},qt.getBleFirmwareChangelog=e=>{var t,r;const i=vt(e),n=Et(e);if(!n)return[];const s=null!==(r=null===(t=Pt.deviceMap[i])||void 0===t?void 0:t.ble)&&void 0!==r?r:[],o=n.join(".");return Dt(s,o)},qt.getBleFirmwareLeatestRelease=e=>{var t,r;const i=vt(e),n=null!==(r=null===(t=Pt.deviceMap[i])||void 0===t?void 0:t.ble)&&void 0!==r?r:[];return n[n.length-1]},qt.getTransportStatus=e=>{var t,r;const i=null===(r=null===(t=Pt.assets)||void 0===t?void 0:t.bridge)||void 0===r?void 0:r.version;return i?Be().gte(e,i.join("."))?"valid":"outdated":"valid"};const Lt="CORE_EVENT",Bt=e=>{const{data:t}=e,r={event:t.event,type:t.type,payload:t.payload};return"number"==typeof e.id&&(r.id=e.id),"boolean"==typeof r.success&&(r.success=t.success),r},Ft="UI_EVENT",jt="ui-request_pin",Ut=(e,t)=>({event:Ft,type:e,payload:t}),Ht="iframe-call",$t="RESPONSE_EVENT",Gt=(e,t,r)=>({event:$t,type:$t,id:e,success:t,payload:t?r:he(r)}),zt="ui-receive_pin",Wt="device-connect",Vt="device-disconnect",Xt="button",Kt="pin",Yt="passphrase_on_device",Jt="features",Zt=(e,t)=>({event:"DEVICE_EVENT",type:e,payload:t}),Qt=(e,t)=>({event:"FIRMWARE_EVENT",type:e,payload:t}),er=kt(Ct.DevicePool);class tr extends Ke.exports{static setConnector(e){this.connector=e}static getDevices(e,t,r){var i,n,s,o;return We(this,void 0,void 0,(function*(){er.debug("get device list: connectId: ",t);const a={},u=[];if(t){const i=this.devicesCache[t];if(i){const n=e.find((e=>e.path===i.originalDescriptor.path));if(n)return er.debug("find existed Device: ",t),i.updateDescriptor(n,!0),a[t]=i,u.push(i),yield this._checkDevicePool(r),{devices:a,deviceList:u};er.debug("found device in cache, but path is different: ",t)}}try{for(i=Ve(e);!(n=yield i.next()).done;){const e=n.value,t=yield this._createDevice(e,r);if(t.features){const r=_t(t.features);this.devicesCache[r]&&this.devicesCache[r].updateDescriptor(e,!0),this.devicesCache[r]=t,a[r]=t}u.push(t)}}catch(e){s={error:e}}finally{try{n&&!n.done&&(o=i.return)&&(yield o.call(i))}finally{if(s)throw s.error}}return er.debug("get devices result : ",a,u),console.log("device poll -> connected: ",this.connectedPool),console.log("device poll -> disconnected: ",this.disconnectPool),yield this._checkDevicePool(r),{devices:a,deviceList:u}}))}static clearDeviceCache(e){er.debug("clear device pool cache: connectId",e),er.debug("clear device pool cache: ",this.devicesCache),e&&delete this.devicesCache[e]}static _createDevice(e,t){return We(this,void 0,void 0,(function*(){let r=this.getDeviceByPath(e.path);return r||(r=yr.fromDescriptor(e),r.deviceConnector=this.connector,yield r.connect(),yield r.initialize(t),yield r.release()),r}))}static _checkDevicePool(e){return We(this,void 0,void 0,(function*(){yield this._sendConnectMessage(e),this._sendDisconnectMessage()}))}static _sendConnectMessage(e){return We(this,void 0,void 0,(function*(){for(let t=this.connectedPool.length-1;t>=0;t--){const r=this.connectedPool[t],i=yield this._createDevice(r,e);er.debug("emit DEVICE.CONNECT: ",i),this.emitter.emit(Wt,i),this.connectedPool.splice(t,1)}}))}static _sendDisconnectMessage(){for(let e=this.disconnectPool.length-1;e>=0;e--){const t=this.connectedPool[e],r=(null==t?void 0:t.path)?this.getDeviceByPath(t.path):null;r&&this.emitter.emit(Vt,r),this.disconnectPool.splice(e,1)}}static reportDeviceChange(e){const t=((e,t)=>{const r=t.filter((t=>void 0===e.find((e=>e.path===t.path)))),i=e.filter((e=>void 0===t.find((t=>t.path===e.path)))),n=t.filter((t=>{const r=e.find((e=>e.path===t.path));return!!r&&r.session!==t.session})),s=n.filter((e=>"string"==typeof e.session)),o=n.filter((e=>"string"!=typeof e.session)),a=t.filter((t=>{const r=e.find((e=>e.path===t.path));return!!r&&r.debugSession!==t.debugSession})),u=n.filter((e=>"string"==typeof e.debugSession)),d=n.filter((e=>"string"!=typeof e.debugSession));return{connected:r,disconnected:i,changedSessions:n,acquired:s,released:o,changedDebugSessions:a,debugAcquired:u,debugReleased:d,didUpdate:r.length+i.length+n.length+a.length>0,descriptors:t}})(this.current||[],e);this.upcoming=e,this.current=this.upcoming,console.log("device pool -> current: ",this.current),console.log("device pool -> upcomming: ",this.upcoming),console.log("DeviceCache.reportDeviceChange diff: ",t),t.didUpdate&&(t.connected.forEach((e=>{const t=this.getDeviceByPath(e.path);t?(er.debug("emit DEVICE.CONNECT: ",t),this.emitter.emit(Wt,t)):this._addConnectedDeviceToPool(e)})),t.disconnected.forEach((e=>{this._removeDeviceFromConnectedPool(e.path);const t=this.getDeviceByPath(e.path);t?(er.debug("emit DEVICE.DISCONNECT: ",t),this.emitter.emit(Vt,t)):this._addDisconnectedDeviceToPool(e)})))}static getDeviceByPath(e){return Object.values(this.devicesCache).find((t=>t.originalDescriptor.path===e))}static _addConnectedDeviceToPool(e){const t=this.connectedPool.findIndex((t=>t.path===e.path));t>-1?this.connectedPool.splice(t,1,e):this.connectedPool.push(e)}static _removeDeviceFromConnectedPool(e){const t=this.connectedPool.findIndex((t=>t.path===e));t>-1&&this.connectedPool.splice(t,1)}static _addDisconnectedDeviceToPool(e){const t=this.disconnectPool.findIndex((t=>t.path===e.path));t>-1?this.disconnectPool.splice(t,1,e):this.disconnectPool.push(e)}}tr.current=null,tr.upcoming=[],tr.connectedPool=[],tr.disconnectPool=[],tr.devicesCache={},tr.emitter=new Ke.exports;const rr=kt(Ct.Transport),ir=kt(Ct.HdBleTransport),nr=kt(Ct.HdTransportHttp);class sr{static load(){rr.debug("transport manager load"),this.defaultMessages=qt.getProtobufMessages(),this.currentMessages=this.defaultMessages}static configure(){return We(this,void 0,void 0,(function*(){try{const e=qt.getSettings("env");rr.debug("Initializing transports"),"react-native"===e?this.reactNativeInit?rr.debug("React Native Do Not Initializing transports"):(yield this.transport.init(ir,tr.emitter),this.reactNativeInit=!0):yield this.transport.init(nr),rr.debug("Configuring transports"),yield this.transport.configure(JSON.stringify(this.defaultMessages)),rr.debug("Configuring transports done")}catch(e){if(rr.debug("Initializing transports error: ",e),"ECONNABORTED"===e.code)throw fe.TypedError(le.BridgeTimeoutError)}}))}static reconfigure(e){return We(this,void 0,void 0,(function*(){if(Array.isArray(e)&&(e=qt.getProtobufMessages()),this.currentMessages!==e&&e)try{yield this.transport.configure(JSON.stringify(e)),this.currentMessages=e}catch(e){throw fe.TypedError(le.TransportInvalidProtobuf,`Transport_InvalidProtobuf: ${e.message}`)}}))}static setTransport(e){const t=qt.getSettings("env");this.transport="react-native"===t?new e({scanTimeout:3e3}):new e,rr.debug("set transport: ",this.transport)}static getTransport(){return this.transport}static getDefaultMessages(){return this.defaultMessages}static getCurrentMessages(){return this.currentMessages}}sr.reactNativeInit=!1;const or=kt(Ct.DeviceCommands);class ar{constructor(e,t){this.device=e,this.mainId=t,this.transport=sr.getTransport(),this.disposed=!1}dispose(e){var t,r;return We(this,void 0,void 0,(function*(){this.disposed=!0,e&&this._cancelableRequest&&this._cancelableRequest(),this._cancelableRequest=void 0,yield null===(r=(t=this.transport).cancel)||void 0===r?void 0:r.call(t)}))}call(e,t={}){var r,i;return We(this,void 0,void 0,(function*(){or.debug("[DeviceCommands] [call] Sending",e);try{const r=this.transport.call(this.mainId,e,t);this.callPromise=r;const i=yield r;return or.debug("[DeviceCommands] [call] Received",i.type),i}catch(e){if(or.debug("[DeviceCommands] [call] Received error",e),"device disconnected during action"===(null===(i=null===(r=null==e?void 0:e.response)||void 0===r?void 0:r.data)||void 0===i?void 0:i.error))return{type:"BridgeNetworkError",message:{}};throw e}}))}typedCall(e,t,r){return We(this,void 0,void 0,(function*(){if(this.disposed)throw fe.TypedError(le.RuntimeError,"typedCall: DeviceCommands already disposed");const i=yield this._commonCall(e,r);try{((e,t)=>{if(!(Array.isArray(t)?t:t.split("|")).includes(e.type))throw fe.TypedError(le.ResponseUnexpectTypeError,`assertType: Response of unexpected type: ${e.type}. Should be ${t}`)})(i,t)}catch(e){if(or.debug("DeviceCommands typedcall error: ",e),!(e instanceof de))throw e;if(e.errorCode===le.ResponseUnexpectTypeError&&e.message.indexOf("BridgeNetworkError")>-1)throw fe.TypedError(le.BridgeNetworkError)}return i}))}_commonCall(e,t){return We(this,void 0,void 0,(function*(){const r=yield this.call(e,t);return this._filterCommonTypes(r)}))}_filterCommonTypes(e){if(or.debug("_filterCommonTypes: ",e),"Failure"===e.type){const{code:t}=e.message,{message:r}=e.message;let i=null;return t!==q.Failure_FirmwareError||r||(i=fe.TypedError(le.FirmwareError)),t===q.Failure_ActionCancelled&&(i=fe.TypedError(le.ActionCancelled)),t===q.Failure_PinInvalid&&(i=fe.TypedError(le.PinInvalid,r)),t===q.Failure_PinCancelled&&(i=fe.TypedError(le.PinCancelled)),t===q.Failure_DataError&&"Please confirm the BlindSign enabled"===r&&(i=fe.TypedError(le.BlindSignDisabled)),i?$e.reject(i):$e.reject(fe.TypedError(le.RuntimeError,`${t||"Failure_UnknownCode"},${r||"Failure_UnknownMessage"}`))}if("Features"===e.type)return $e.resolve(("Features"!==(t=e).type||t.message.major_version<1&&(t.message.major_version=1),t));var t;if("ButtonRequest"===e.type)return"ButtonRequest_PassphraseEntry"===e.message.code?this.device.emit(Yt,this.device):this.device.emit(Xt,this.device,e.message),this._commonCall("ButtonAck",{});e.type;const r="webusb"===qt.getSettings("env");return"PinMatrixRequest"===e.type?r?$e.reject(fe.TypedError(le.RuntimeError,"Please unlock your device")):this._promptPin(e.message.type).then((e=>"@@ONEKEY_INPUT_PIN_IN_DEVICE"===e?this._commonCall("BixinPinInputOnDevice"):this._commonCall("PinMatrixAck",{pin:e})),(()=>this._commonCall("Cancel",{}))):"PassphraseRequest"===e.type?$e.reject(fe.TypedError(le.DeviceNotSupportPassphrase,"Device not support passphrase",{require:"2.4.0"})):(e.type,e.type,$e.resolve(e))}_promptPin(e){return new $e(((t,r)=>{this.device.listenerCount(Kt)>0?(this._cancelableRequest=r,this.device.emit(Kt,this.device,e,((e,i)=>{this._cancelableRequest=void 0,e?r(e):t(i)}))):(console.warn("[DeviceCommands] [call] PIN callback not configured, cancelling request"),r(fe.TypedError(le.RuntimeError,"_promptPin: PIN callback not configured")))}))}}const ur="ui-device_bootloader_mode",dr="ui-device_not_initialized",lr="ui-device_seedless",pr=`https://jssdk.onekey.so/${Ge.env.VERSION}/`,cr={configSrc:"./data/config.json",version:"",debug:!1,priority:2,trustedHost:!1,connectSrc:pr,iframeSrc:`${pr}iframe.html`,parentOrigin:window&&window.location?window.location.origin:"",supportedBrowser:"undefined"==typeof navigator||!/Trident|MSIE|Edge/.test(navigator.userAgent),env:"web",lazyLoad:!1,timestamp:(new Date).getTime()},hr=kt(Ct.Device),fr={};class yr extends Ke.exports{constructor(e){super(),this.deviceConnector=null,this.features=void 0,this.featuresNeedsReload=!1,this.externalState=[],this.unavailableCapabilities={},this.instance=0,this.internalState=[],this.needReloadDevice=!1,this.keepSession=!1,this.passphraseState=void 0,this.originalDescriptor=e}static fromDescriptor(e){const t=Object.assign({},e);return new yr(t)}toMessageObject(){return this.isUnacquired()||!this.features?null:{connectId:"react-native"===qt.getSettings("env")?this.mainId||null:_t(this.features),uuid:_t(this.features),deviceType:this.features.bootloader_mode?(e=this.features,vt(e)):vt(this.features),deviceId:this.features.device_id||null,path:this.originalDescriptor.path,name:this.features.ble_name||this.features.label||`OneKey ${vt(this.features).toUpperCase()}`,label:bt(this.features),mode:this.getMode(),features:this.features,firmwareVersion:this.getFirmwareVersion(),bleFirmwareVersion:this.getBLEFirmwareVersion(),unavailableCapabilities:this.unavailableCapabilities};var e}connect(){const e=qt.getSettings("env");return new $e((t=>We(this,void 0,void 0,(function*(){if("react-native"!==e)if(!this.mainId||!this.isUsedHere()&&this.originalDescriptor)try{yield this.acquire(),t(!0)}catch(e){t(e)}else this.isUsedHere()?t(!0):t(!1);else try{yield this.acquire(),t(!0)}catch(e){t(e)}}))))}acquire(){var e,t,r,i;return We(this,void 0,void 0,(function*(){const n=qt.getSettings("env"),s="react-native"===n?"id":"session";try{if("react-native"===n){const r=yield null===(e=this.deviceConnector)||void 0===e?void 0:e.acquire(this.originalDescriptor.id);this.mainId=null!==(t=r.uuid)&&void 0!==t?t:"",hr.debug("Expected uuid:",this.mainId)}else this.mainId=yield null===(r=this.deviceConnector)||void 0===r?void 0:r.acquire(this.originalDescriptor.path,this.originalDescriptor.session),hr.debug("Expected session id:",this.mainId);this.updateDescriptor({[s]:this.mainId}),this.commands&&(yield this.commands.dispose(!1)),this.commands=new ar(this,null!==(i=this.mainId)&&void 0!==i?i:"")}catch(e){if(!this.runPromise)throw e;this.runPromise.reject(e),this.runPromise=null}}))}release(){var e;return We(this,void 0,void 0,(function*(){const t=qt.getSettings("env");if(this.isUsedHere()&&!this.keepSession&&this.mainId||this.mainId&&"react-native"===t){if(this.commands&&(this.commands.dispose(!1),this.commands.callPromise))try{yield this.commands.callPromise}catch(e){this.commands.callPromise=void 0}try{yield null===(e=this.deviceConnector)||void 0===e?void 0:e.release(this.mainId,!1),this.updateDescriptor({session:null})}catch(e){hr.error("[Device] release error: ",e)}finally{this.needReloadDevice=!0}}}))}getCommands(){return this.commands}getInternalState(e){var t,r;hr.debug("getInternalState session param: ",`device_id: ${e}`,`features.device_id: ${null===(t=this.features)||void 0===t?void 0:t.device_id}`,`passphraseState: ${this.passphraseState}`),hr.debug("getInternalState session cache: ",fr);const i=e||(null===(r=this.features)||void 0===r?void 0:r.device_id);if(!i)return;if(!this.passphraseState)return;const n=`${i}@${this.passphraseState}`;if(!fr[n]){const e=`${i}`;fr[e]&&(fr[n]=fr[e])}return fr[n]}setInternalState(e,t){var r;if(hr.debug("setInternalState session param: ",`state: ${e}`,`initSession: ${t}`,`device_id: ${null===(r=this.features)||void 0===r?void 0:r.device_id}`,`passphraseState: ${this.passphraseState}`),!this.features)return;if(!this.passphraseState&&!t)return;let i=`${this.features.device_id}`;this.passphraseState&&(i+=`@${this.passphraseState}`),e&&(fr[i]=e),hr.debug("setInternalState done session cache: ",fr)}clearInternalState(e){var t;hr.debug("clearInternalState param: ",e);const r=e||(null===(t=this.features)||void 0===t?void 0:t.device_id);if(r&&(delete fr[`${r}`],this.passphraseState)){const e=`${r}@${this.passphraseState}`;delete fr[e]}}initialize(e){return We(this,void 0,void 0,(function*(){hr.debug("initialize param:",e),this.passphraseState=null==e?void 0:e.passphraseState,(null==e?void 0:e.initSession)&&this.clearInternalState(null==e?void 0:e.deviceId);const t=this.getInternalState(null==e?void 0:e.deviceId),r={};t&&(r.session_id=t),hr.debug("initialize payload:",r);const{message:i}=yield this.commands.typedCall("Initialize","Features",r);this._updateFeatures(i,null==e?void 0:e.initSession)}))}getFeatures(){return We(this,void 0,void 0,(function*(){const{message:e}=yield this.commands.typedCall("GetFeatures","Features",{});this._updateFeatures(e)}))}_updateFeatures(e,t){this.features&&this.features.session_id&&!e.session_id&&(e.session_id=this.features.session_id),this.features&&this.features.device_id&&e.session_id&&this.setInternalState(e.session_id,t),e.unlocked=e.unlocked||!0,this.features=e,this.featuresNeedsReload=!1,this.emit(Jt,this,e)}updateDescriptor(e,t=!1){if("react-native"===qt.getSettings("env"))return;const r=this.originalDescriptor.session,i=e.session;r!==i&&(this.originalDescriptor.session=i),t&&(this.originalDescriptor=e)}updateFromCache(e){this.mainId=e.mainId,this.commands=e.commands,this.updateDescriptor(e.originalDescriptor,!0),e.features&&this._updateFeatures(e.features)}run(e,t){return We(this,void 0,void 0,(function*(){return this.runPromise&&(yield this.interruptionFromOutside(),hr.debug("[Device] run error:","Device is running, but will cancel previous operate")),t=(e=>(e||(e={}),e))(t),this.runPromise=ue(this._runInner.bind(this,e,t)),this.runPromise.promise}))}_runInner(e,t){return We(this,void 0,void 0,(function*(){if((!this.isUsedHere()||this.commands.disposed)&&"react-native"!==qt.getSettings("env")){yield this.acquire();try{e&&(yield this.initialize(t))}catch(e){return this.runPromise=null,e instanceof de?$e.reject(e):$e.reject(fe.TypedError(le.DeviceInitializeFailed,`Initialize failed: ${e.message}, code: ${e.code}`))}}if(t.keepSession&&(this.keepSession=!0),e)try{yield e()}catch(e){return this.runPromise&&this.runPromise.reject(e),void(this.runPromise=null)}(!this.keepSession&&"boolean"!=typeof t.keepSession||!1===t.keepSession)&&(this.keepSession=!1,yield this.release(),hr.debug("release device, mainId: ",this.mainId)),this.runPromise&&this.runPromise.resolve(),this.runPromise=null}))}interruptionFromOutside(){return We(this,void 0,void 0,(function*(){this.commands&&(yield this.commands.dispose(!1)),this.runPromise&&this.runPromise.reject(fe.TypedError(le.DeviceInterruptedFromOutside))}))}interruptionFromUser(){return We(this,void 0,void 0,(function*(){this.commands&&(yield this.commands.dispose(!0)),this.runPromise&&this.runPromise.reject(fe.TypedError(le.DeviceInterruptedFromUser))}))}getMode(){var e,t,r;return(null===(e=this.features)||void 0===e?void 0:e.bootloader_mode)?"bootloader":(null===(t=this.features)||void 0===t?void 0:t.initialized)?(null===(r=this.features)||void 0===r?void 0:r.no_backup)?"seedless":"normal":"initialize"}getFirmwareVersion(){return this.features?Tt(this.features):null}getBLEFirmwareVersion(){return this.features?Et(this.features):null}isUsed(){return"string"==typeof this.originalDescriptor.session}isUsedHere(){return"react-native"!==qt.getSettings("env")&&this.isUsed()&&this.originalDescriptor.session===this.mainId}isUsedElsewhere(){return this.isUsed()&&!this.isUsedHere()}isBootloader(){return this.features&&!!this.features.bootloader_mode}isInitialized(){return this.features&&!!this.features.initialized}isSeedless(){return this.features&&!!this.features.no_backup}isUnacquired(){return void 0===this.features}hasUnexpectedMode(e,t){if(this.features){if(this.isBootloader()&&!e.includes(ur))return ur;if(!this.isInitialized()&&!e.includes(dr))return dr;if(this.isSeedless()&&!e.includes(lr))return lr;if(!this.isBootloader()&&t.includes(ur))return"ui-device_not_in_bootloader_mode"}return null}hasUsePassphrase(){var e;const t=("touch"===vt(this.features)||"pro"===vt(this.features))&&!0===(null===(e=this.features)||void 0===e?void 0:e.unlocked);return this.features&&(!!this.features.passphrase_protection||t)}checkDeviceId(e){return!!this.features&&this.features.device_id===e}checkPassphraseState(){var e;return We(this,void 0,void 0,(function*(){if(!this.features)return!1;const t=!0===(null===(e=this.features)||void 0===e?void 0:e.unlocked),r="touch"===vt(this.features)||"pro"===vt(this.features),i=yield St(this.features,this.commands);return r&&t&&(yield this.getFeatures()),this.passphraseState&&this.passphraseState!==i?(this.clearInternalState(),i):void 0}))}}class gr extends Ke.exports{constructor(){super(...arguments),this.devices={}}getDeviceLists(e,t){var r,i;return We(this,void 0,void 0,(function*(){const n=yield null===(r=this.connector)||void 0===r?void 0:r.enumerate(),s=null!==(i=null==n?void 0:n.descriptors)&&void 0!==i?i:[];this.devices={};const{deviceList:o,devices:a}=yield tr.getDevices(s,e,t);return this.devices=a,o}))}allDevices(){return Object.keys(this.devices).map((e=>this.devices[e]))}getDevice(e){return this.devices[e]}}const mr=e=>({status:qt.getFirmwareStatus(e),changelog:qt.getFirmwareChangelog(e),release:qt.getFirmwareLeatestRelease(e)}),vr=e=>({status:qt.getBLEFirmwareStatus(e),changelog:qt.getBleFirmwareChangelog(e),release:qt.getBleFirmwareLeatestRelease(e)}),_r=kt(Ct.Method);class br{constructor(e){this.shouldEnsureConnected=!0,this.checkDeviceId=!1,this.useDevicePassphraseState=!0;const{payload:t}=e;this.name=t.method,this.payload=t,this.responseID=e.id||0,this.connectId=t.connectId||"",this.deviceId=t.deviceId||"",this.useDevice=!0,this.allowDeviceMode=[dr],this.requireDeviceMode=[]}getVersionRange(){return{}}setDevice(e){this.device=e,this.connectId=e.originalDescriptor.path}checkFirmwareRelease(){if(!this.device||!this.device.features)return;const e=mr(this.device.features);this.postMessage(Qt("firmware-release-info",Object.assign(Object.assign({},e),{features:this.device.features})));const t=vr(this.device.features);this.postMessage(Qt("ble-firmware-release-info",Object.assign(Object.assign({},t),{features:this.device.features})))}checkDeviceSupportFeature(){if(!this.device||!this.device.features)return;const e=wt(this.device.features);this.postMessage(Zt("support_features",{inputPinOnSoftware:e,device:this.device.toMessageObject()}))}checkSafetyLevelOnTestNet(){var e,t,r;return We(this,void 0,void 0,(function*(){if("touch"!==vt(this.device.features))return;let i=!1;"evmSignTransaction"===this.name&&[3,4,5,42].includes(Number(null===(t=null===(e=this.payload)||void 0===e?void 0:e.transaction)||void 0===t?void 0:t.chainId))&&(i=!0),i&&"Strict"===(null===(r=this.device.features)||void 0===r?void 0:r.safety_checks)&&(_r.debug("will change safety_checks level"),yield this.device.commands.typedCall("ApplySettings","Success",{safety_checks:"PromptTemporarily"}))}))}dispose(){}}const Tr=e=>"0x"===e.slice(0,2).toLowerCase(),Er=e=>Tr(e)?e.slice(2):e,wr=e=>{for(;/^00/.test(e);)e=e.slice(2);return e},Sr=e=>{if("string"==typeof e){let t=Er(e);return t.length%2!=0&&(t=`0${t}`),t}return Array.isArray(e)?e.map(Sr):"object"==typeof e?(t=e,r=e=>Sr(e),Object.fromEntries(Object.entries(t).map((([e,t])=>[e,r(t)])))):e;var t,r},Ar=e=>fe.TypedError(le.CallMethodInvalidParameter,e),Rr=(e,t)=>{t.forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t.name)&&t.required)throw Ar(`Missing required parameter: ${t.name}`);const r=e[t.name];if(r&&t.type)switch(t.type){case"array":if(!Array.isArray(r))throw Ar(`Parameter [${t.name}] is of type invalid and should be [${t.type}].`);if(!t.allowEmpty&&r.length<1)throw Ar(`Parameter "${t.name}" is empty.`);break;case"bigNumber":if("string"!=typeof r)throw Ar(`Parameter [${t.name}] is of type invalid and should be [string].`);try{if(new(je())(r).toFixed(0)!==r)throw new Error("")}catch(e){throw Ar(`Parameter [${t.name}] is of type invalid and should be [${t.type}].`)}break;case"buffer":if(void 0===r||"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r))throw Ar(`Parameter [${t.name}] is of type invalid and should be [buffer].`);break;case"hexString":if("string"!=typeof r||!((e,t)=>!("string"!=typeof e||!e.match(/^(0x|0X)?[0-9A-Fa-f]*$/)))((i=r,Tr(i)?i:`0x${i}`)))throw Ar(`Parameter [${t.name}] is of type invalid and should be [${t.type}].`);break;default:if(typeof r!==t.type)throw Ar(`Parameter [${t.name}] is of type invalid and should be [${t.type}].`)}var i}))},Or=e=>{var t;(null===(t=e.features)||void 0===t?void 0:t.firmware_present)&&e.emit(Xt,e,{code:"ButtonRequest_FirmwareUpdate"})},Ir=(e,t,r)=>{r(Ut("ui-firmware-progress",{device:e.toMessageObject(),progress:t}))},xr=kt(Ct.Method);var Cr=[{name:"Bitcoin",label:"BTC",slip44:0},{name:"Regtest",label:"REGTEST",slip44:1},{name:"Testnet",label:"TEST",slip44:1},{name:"Actinium",label:"ACM",slip44:228},{name:"Axe",label:"AXE",slip44:4242},{name:"Bitcore",label:"BTX",slip44:160},{name:"Dash",label:"DASH",slip44:5},{name:"Dash Testnet",label:"tDASH",slip44:1},{name:"Decred",label:"DCR",slip44:42},{name:"Decred Testnet",label:"TDCR",slip44:1},{name:"DigiByte",label:"DGB",slip44:20},{name:"Dogecoin",label:"DOGE",slip44:3},{name:"Feathercoin",label:"FTC",slip44:8},{name:"Firo",label:"FIRO",slip44:136},{name:"Firo Testnet",label:"tFIRO",slip44:1},{name:"Fujicoin",label:"FJC",slip44:75},{name:"GameCredits",label:"GAME",slip44:101},{name:"Komodo",label:"KMD",slip44:141},{name:"Koto",label:"KOTO",slip44:510},{name:"Litecoin",label:"LTC",slip44:2},{name:"Litecoin Testnet",label:"tLTC",slip44:1},{name:"Monacoin",label:"MONA",slip44:22},{name:"MonetaryUnit",label:"MUE",slip44:31},{name:"NIX",label:"NIX",slip44:400},{name:"Namecoin",label:"NMC",slip44:7},{name:"Peercoin",label:"PPC",slip44:6},{name:"Peercoin Testnet",label:"tPPC",slip44:1},{name:"Polis",label:"POLIS",slip44:1997},{name:"Primecoin",label:"XPM",slip44:24},{name:"Ravencoin",label:"RVN",slip44:175},{name:"Ritocoin",label:"RITO",slip44:19169},{name:"Stakenet",label:"XSN",slip44:199},{name:"Syscoin",label:"SYS",slip44:57},{name:"Unobtanium",label:"UNO",slip44:92},{name:"Verge",label:"XVG",slip44:77},{name:"Vertcoin",label:"VTC",slip44:28},{name:"Viacoin",label:"VIA",slip44:14},{name:"ZCore",label:"ZCR",slip44:428},{name:"Zcash",label:"ZEC",slip44:133},{name:"Zcash Testnet",label:"TAZ",slip44:1}];const Mr=(e,t)=>{let r;if(t){const e=t.toLowerCase();r=Cr.find((t=>t.name.toLowerCase()===e||t.label.toLowerCase()===e))}else if(e){const t=ct(e[1]);r=Cr.find((e=>e.slip44===t))}if(!r)throw t?fe.TypedError(le.CallMethodInvalidParameter,`Invalid coin name: ${t}`):e?fe.TypedError(le.CallMethodInvalidParameter,`Invalid path: ${e[0]}`):fe.TypedError(le.CallMethodInvalidParameter);return r},kr=e=>We(void 0,void 0,void 0,(function*(){const{typedCall:t,txRequest:r,refTxs:i,inputs:n,outputs:s,serializedTx:o,signatures:a}=e;if(((e,t,r)=>{if(!r)return;const{signature_index:i,signature:n,serialized_tx:s}=r;if(s&&e.push(s),"number"==typeof i){if(!n)throw fe.TypedError(le.RuntimeError,"saveTxSignatures: Unexpected null in trezor:TxRequestSerialized signature.");t[i]=n}})(o,a,r.serialized),"TXFINISHED"===r.request_type)return $e.resolve({signatures:a,serializedTx:o.join("")});const{message:u}=yield(e=>{const{tx_hash:t}=e.txRequest.details;return t?(({typedCall:e,txRequest:{request_type:t,details:r},refTxs:i})=>{const{tx_hash:n}=r;if(!n)throw fe.TypedError(le.RuntimeError,"requestPrevTxInfo: unknown details.tx_hash");const s=i[n.toLowerCase()];if(!s)throw fe.TypedError(le.RuntimeError,`requestPrevTxInfo: Requested unknown tx: ${n}`);if("TXINPUT"===t){if(!s.bin_outputs)throw fe.TypedError(le.RuntimeError,`requestPrevTxInfo: Requested unknown TXINPUT: ${n}`);return e("TxAckPrevInput","TxRequest",{tx:{input:s.inputs[r.request_index]}})}if("TXOUTPUT"===t){if(!s.bin_outputs)throw fe.TypedError(le.RuntimeError,`requestPrevTxInfo: Requested unknown TXOUTPUT: ${n}`);return e("TxAckPrevOutput","TxRequest",{tx:{output:s.bin_outputs[r.request_index]}})}if("TXORIGINPUT"===t){if(!s.outputs)throw fe.TypedError(le.RuntimeError,`requestPrevTxInfo: Requested unknown TXORIGINPUT: ${n}`);return e("TxAckInput","TxRequest",{tx:{input:s.inputs[r.request_index]}})}if("TXORIGOUTPUT"===t){if(!s.outputs)throw fe.TypedError(le.RuntimeError,`requestPrevTxInfo: Requested unknown TXORIGOUTPUT: ${n}`);return e("TxAckOutput","TxRequest",{tx:{output:s.outputs[r.request_index]}})}if("TXEXTRADATA"===t){if("number"!=typeof r.extra_data_len)throw fe.TypedError(le.RuntimeError,"requestPrevTxInfo: Missing extra_data_len");if("number"!=typeof r.extra_data_offset)throw fe.TypedError(le.RuntimeError,"requestPrevTxInfo: Missing extra_data_offset");if("string"!=typeof s.extra_data)throw fe.TypedError(le.RuntimeError,`requestPrevTxInfo: No extra data for transaction ${s.hash}`);const t=s.extra_data,i=r.extra_data_len,n=r.extra_data_offset;return e("TxAckPrevExtraData","TxRequest",{tx:{extra_data_chunk:t.substring(2*n,2*(n+i))}})}if("TXMETA"===t){const t=s.extra_data;return e("TxAckPrevMeta","TxRequest",{tx:{version:s.version,lock_time:s.lock_time,inputs_count:s.inputs.length,outputs_count:s.outputs?s.outputs.length:s.bin_outputs.length,timestamp:s.timestamp,version_group_id:s.version_group_id,expiry:s.expiry,branch_id:s.branch_id,extra_data_len:t?t.length/2:void 0}})}throw fe.TypedError(le.RuntimeError,`requestPrevTxInfo: Unknown request type: ${t}`)})(e):(({typedCall:e,txRequest:{request_type:t,details:r},inputs:i,outputs:n})=>{if("TXINPUT"===t)return e("TxAckInput","TxRequest",{tx:{input:i[r.request_index]}});if("TXOUTPUT"===t)return e("TxAckOutput","TxRequest",{tx:{output:n[r.request_index]}});if("TXMETA"===t)throw fe.TypedError(le.RuntimeError,"requestSignedTxInfo: Cannot read TXMETA from signed transaction");if("TXEXTRADATA"===t)throw fe.TypedError(le.RuntimeError,"requestSignedTxInfo: Cannot read TXEXTRADATA from signed transaction");throw fe.TypedError(le.RuntimeError,`requestSignedTxInfo: Unknown request type: ${t}`)})(e)})(e);return kr({typedCall:t,txRequest:u,refTxs:i,inputs:n,outputs:s,serializedTx:o,signatures:a})}));var Nr=(e,t,r,i,n,s)=>We(void 0,void 0,void 0,(function*(){const o={};i.forEach((e=>{o[e.hash.toLowerCase()]=e}));const{message:a}=yield e("SignTx","TxRequest",Object.assign(Object.assign({},n),{inputs_count:t.length,outputs_count:r.length,coin_name:s}));return kr({typedCall:e,txRequest:a,refTxs:o,inputs:t,outputs:r,serializedTx:[],signatures:[]})}));const Dr=e=>We(void 0,void 0,void 0,(function*(){const{typedCall:t,txRequest:r,refTxs:i,inputs:n,outputs:s,serializedTx:o,signatures:a}=e;if(((e,t,r)=>{if(!r)return;const{signature_index:i,signature:n,serialized_tx:s}=r;if(s&&e.push(s),"number"==typeof i){if(!n)throw fe.TypedError(le.RuntimeError,"saveTxSignatures: Unexpected null in trezor:TxRequestSerialized signature.");t[i]=n}})(o,a,r.serialized),"TXFINISHED"===r.request_type)return $e.resolve({signatures:a,serializedTx:o.join("")});const u=(e=>{const{tx_hash:t}=e.txRequest.details;return t?(({txRequest:{request_type:e,details:t},refTxs:r})=>{const{tx_hash:i}=t;if(!i)throw fe.TypedError(le.RuntimeError,"requestPrevTxInfo: unknown details.tx_hash");const n=r[i.toLowerCase()];if(!n)throw fe.TypedError(le.RuntimeError,`requestPrevTxInfo: Requested unknown tx: ${i}`);if(!n.bin_outputs)throw fe.TypedError(le.RuntimeError,`requestPrevTxInfo: bin_outputs not set tx: ${i}`);if("TXINPUT"===e)return{inputs:[n.inputs[t.request_index]]};if("TXOUTPUT"===e)return{bin_outputs:[n.bin_outputs[t.request_index]]};if("TXEXTRADATA"===e){if("number"!=typeof t.extra_data_len)throw fe.TypedError(le.RuntimeError,"requestPrevTxInfo: Missing extra_data_len");if("number"!=typeof t.extra_data_offset)throw fe.TypedError(le.RuntimeError,"requestPrevTxInfo: Missing extra_data_offset");if("string"!=typeof n.extra_data)throw fe.TypedError(le.RuntimeError,`requestPrevTxInfo: No extra data for transaction ${n.hash}`);const e=n.extra_data,r=t.extra_data_len,i=t.extra_data_offset;return{extra_data:e.substring(2*i,2*(i+r))}}if("TXMETA"===e){const e=n.extra_data,t={version:n.version,lock_time:n.lock_time,inputs_cnt:n.inputs.length,outputs_cnt:n.bin_outputs.length,timestamp:n.timestamp,version_group_id:n.version_group_id,expiry:n.expiry,branch_id:n.branch_id};return"string"==typeof e&&0!==e.length?Object.assign(Object.assign({},t),{extra_data_len:e.length/2}):t}throw fe.TypedError(le.RuntimeError,`requestPrevTxInfo: Unknown request type: ${e}`)})(e):(({txRequest:{request_type:e,details:t},inputs:r,outputs:i})=>{if("TXINPUT"===e)return{inputs:[r[t.request_index]]};if("TXOUTPUT"===e)return{outputs:[i[t.request_index]]};if("TXMETA"===e)throw fe.TypedError(le.RuntimeError,"requestSignedTxInfo: Cannot read TXMETA from signed transaction");if("TXEXTRADATA"===e)throw fe.TypedError(le.RuntimeError,"requestSignedTxInfo: Cannot read TXEXTRADATA from signed transaction");throw fe.TypedError(le.RuntimeError,`requestSignedTxInfo: Unknown request type: ${e}`)})(e)})(e),{message:d}=yield t("TxAck","TxRequest",{tx:u});return Dr({typedCall:t,txRequest:d,refTxs:i,inputs:n,outputs:s,serializedTx:o,signatures:a})}));var Pr=(e,t,r,i,n,s)=>We(void 0,void 0,void 0,(function*(){const o={};i.forEach((e=>{o[e.hash.toLowerCase()]=e}));const{message:a}=yield e("SignTx","TxRequest",Object.assign(Object.assign({},n),{inputs_count:t.length,outputs_count:r.length,coin_name:s}));return Dr({typedCall:e,txRequest:a,refTxs:o,inputs:t,outputs:r,serializedTx:[],signatures:[]})}));const qr=(e,t)=>e?[e.slice(0,t),e.slice(t)]:["",""],Lr=new RegExp(/^(.*)\[([0-9]*)\]$/),Br=new RegExp(/^bytes([0-9]*)$/),Fr=new RegExp(/^(u?int)([0-9]*)$/),jr=e=>{const t=Lr.exec(e);if(null===t)throw fe.TypedError(le.RuntimeError,`typename ${e} could not be parsed as an EIP-712 array`);const[r,i,n]=t;return{entryTypeName:i,arraySize:parseInt(n,10)||null}},Ur=(e,t)=>{if(Br.test(e)||"address"===e)return Sr(t);if("string"===e)return ze.from(t,"utf-8").toString("hex");const r=Fr.exec(e);if(r){const[e,i,n]=r;return((e,t,r)=>{let i=new(je())(e);if(r&&(i=((e,t)=>{if(t<1||t>32)throw fe.TypedError("Runtime","Int byte size must be between 1 and 32 (8 and 256 bits)");const r=new(je())(2).exponentiatedBy(8*t-1).negated(),i=r.negated().minus(1),n=new(je())(e);if(n.isGreaterThan(i)||n.isLessThan(r))throw fe.TypedError(le.RuntimeError,`Overflow when trying to convert number ${e.toString()} into ${t} bytes`);return n.isPositive()?n:n.minus(r).minus(r)})(i,t)),i.isNegative())throw fe.TypedError(le.RuntimeError,`Cannot convert negative number to unsigned interger: ${e.toString()}`);const n=i.toString(16),s=2*t;if(n.length>s)throw fe.TypedError(le.RuntimeError,`Overflow when trying to convert number ${e.toString()} into ${t} bytes`);return n.padStart(2*t,"0")})(t,Math.ceil(parseInt(n,10)/8),"int"===i)}if("bool"===e)return t?"01":"00";throw fe.TypedError(le.RuntimeError,`Unsupported data type for direct field encoding: ${e}`)},Hr={string:F.STRING,bool:F.BOOL,address:F.ADDRESS},$r=(e,t)=>{const r=Lr.exec(e);if(r){const[e,i,n]=r,s=$r(i,t);return{data_type:F.ARRAY,size:parseInt(n,10)||void 0,entry_type:s}}const i=Fr.exec(e);if(i){const[e,t,r]=i;return{data_type:"uint"===t?F.UINT:F.INT,size:Math.floor(parseInt(r,10)/8)}}const n=Br.exec(e);if(n){const[e,t]=n;return{data_type:F.BYTES,size:parseInt(t,10)||void 0}}const s=Hr[e];if(s)return{data_type:s};if(e in t)return{data_type:F.STRUCT,size:t[e].length,struct_name:e};throw fe.TypedError(le.RuntimeError,`No type definition specified: ${e}`)};var Gr=Object.freeze({__proto__:null,searchDevices:class extends br{init(){this.useDevice=!1,this.useDevicePassphraseState=!1}run(){var e,t;return We(this,void 0,void 0,(function*(){yield sr.configure();const r=yield null===(e=this.connector)||void 0===e?void 0:e.enumerate(),i=null!==(t=null==r?void 0:r.descriptors)&&void 0!==t?t:[];if("react-native"===qt.getSettings("env"))return i.map((e=>{var t,r;return Object.assign(Object.assign({},e),{connectId:e.id,deviceType:(r=null!==(t=e.name)&&void 0!==t?t:"",r?r.startsWith("MI")?"mini":r.startsWith("T")?"touch":"classic":"classic")})}));const{deviceList:n}=yield tr.getDevices(i);return n.map((e=>e.toMessageObject()))}))}},getFeatures:class extends br{init(){this.allowDeviceMode=[...this.allowDeviceMode,dr,ur],this.useDevicePassphraseState=!1}run(){return $e.resolve(this.device.features)}},getPassphraseState:class extends br{init(){this.allowDeviceMode=[...this.allowDeviceMode,dr],this.useDevicePassphraseState=!1}run(){var e,t;return We(this,void 0,void 0,(function*(){if(!this.device.features)return $e.reject(fe.TypedError(le.DeviceInitializeFailed));let{features:r}=this.device;const i=!0===(null===(t=null===(e=this.device)||void 0===e?void 0:e.features)||void 0===t?void 0:t.unlocked),n=yield St(this.device.features,this.device.commands);if(("touch"===vt(r)||"pro"===vt(r))&&i){const{message:e}=yield this.device.commands.typedCall("GetFeatures","Features",{});r=e}return r&&!0===r.passphrase_protection?$e.resolve(n):$e.resolve(void 0)}))}},getLogs:class extends br{init(){this.useDevice=!1,this.useDevicePassphraseState=!1}run(){return We(this,void 0,void 0,(function*(){const e=(()=>{let e=[];return Object.keys(Ot).forEach((t=>{e=e.concat(Ot[t].messages)})),e.sort(((e,t)=>e.timestamp-t.timestamp)),e})();return $e.resolve(e)}))}},checkFirmwareRelease:class extends br{init(){this.useDevicePassphraseState=!1}run(){if(this.device.features){const e=mr(this.device.features);return $e.resolve(e)}return $e.resolve(null)}},checkBLEFirmwareRelease:class extends br{init(){this.allowDeviceMode=[...this.allowDeviceMode,ur],this.checkDeviceId=!0,this.useDevicePassphraseState=!1}run(){if(this.device.features){const e=vr(this.device.features);return $e.resolve(e)}return $e.resolve(null)}},checkTransportRelease:class extends br{init(){this.useDevice=!1,this.useDevicePassphraseState=!1}run(){return We(this,void 0,void 0,(function*(){const e=sr.getTransport(),t=yield e.init(),r=qt.getTransportStatus(t);return $e.resolve(r)}))}},checkBridgeStatus:class extends br{init(){this.useDevice=!1,this.useDevicePassphraseState=!1}run(){return We(this,void 0,void 0,(function*(){return new $e(((e,t)=>{ge().request({url:"http://localhost:21320",method:"POST",withCredentials:!1,timeout:3e3}).then((()=>e(!0))).catch((r=>{"ECONNABORTED"===r.code?t(fe.TypedError(le.BridgeTimeoutError)):e(!1)}))}))}))}},deviceBackup:class extends br{init(){this.useDevicePassphraseState=!1}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("BackupDevice","Success");return $e.resolve(e.message)}))}},deviceChangePin:class extends br{init(){this.useDevicePassphraseState=!1,Rr(this.payload,[{name:"remove",type:"boolean"}]),this.params={remove:this.payload.remove}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("ChangePin","Success",Object.assign({},this.params));return $e.resolve(e.message)}))}},deviceFlags:class extends br{init(){this.useDevicePassphraseState=!1,Rr(this.payload,[{name:"flags",type:"number"}]),this.params={flags:this.payload.flags}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("ApplyFlags","Success",Object.assign({},this.params));return $e.resolve(e.message)}))}},deviceRebootToBootloader:class extends br{init(){this.useDevicePassphraseState=!1}getVersionRange(){return{classic:{min:"2.1.11"},mini:{min:"2.1.11"}}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("RebootToBootloader","Success");return $e.resolve(e.message)}))}},deviceRecovery:class extends br{init(){this.useDevicePassphraseState=!1,Rr(this.payload,[{name:"wordCount",type:"number"},{name:"passphraseProtection",type:"boolean"},{name:"pinProtection",type:"boolean"},{name:"language",type:"string"},{name:"label",type:"string"},{name:"enforceWordlist",type:"boolean"},{name:"type",type:"object"},{name:"u2fCounter",type:"number"},{name:"dryRun",type:"boolean"}]),this.params={word_count:this.payload.wordCount,passphrase_protection:this.payload.passphraseProtection,pin_protection:this.payload.pinProtection,language:this.payload.language,label:this.payload.label,enforce_wordlist:this.payload.enforceWordlist,type:this.payload.type,u2f_counter:this.payload.u2fCounter||Math.floor(Date.now()/1e3),dry_run:this.payload.dryRun}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("RecoveryDevice","Success",Object.assign({},this.params));return $e.resolve(e.message)}))}},deviceReset:class extends br{init(){this.useDevicePassphraseState=!1,Rr(this.payload,[{name:"displayRandom",type:"boolean"},{name:"strength",type:"number"},{name:"passphraseProtection",type:"boolean"},{name:"pinProtection",type:"boolean"},{name:"language",type:"string"},{name:"label",type:"string"},{name:"u2fCounter",type:"number"},{name:"skipBackup",type:"boolean"},{name:"noBackup",type:"boolean"},{name:"backupType"}]),this.params={display_random:this.payload.displayRandom,strength:this.payload.strength||256,passphrase_protection:this.payload.passphraseProtection,pin_protection:this.payload.pinProtection,language:this.payload.language,label:this.payload.label,u2f_counter:this.payload.u2fCounter||Math.floor(Date.now()/1e3),skip_backup:this.payload.skipBackup,no_backup:this.payload.noBackup,backup_type:this.payload.backupType}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("ResetDevice","Success",Object.assign({},this.params));return $e.resolve(e.message)}))}},deviceSettings:class extends br{init(){this.useDevicePassphraseState=!1,Rr(this.payload,[{name:"language",type:"string"},{name:"label",type:"string"},{name:"usePassphrase",type:"boolean"},{name:"homescreen",type:"string"},{name:"passphraseSource",type:"number"},{name:"autoLockDelayMs",type:"number"},{name:"displayRotation",type:"number"},{name:"passphraseAlwaysOnDevice",type:"boolean"},{name:"safetyChecks",type:"number"},{name:"experimentalFeatures",type:"boolean"}]),this.params={language:this.payload.language,label:this.payload.label,use_passphrase:this.payload.usePassphrase,homescreen:this.payload.homescreen,_passphrase_source:this.payload.passphraseSource,auto_lock_delay_ms:this.payload.autoLockDelayMs,display_rotation:this.payload.displayRotation,passphrase_always_on_device:this.payload.passphraseAlwaysOnDevice,safety_checks:this.payload.safetyChecks,experimental_features:this.payload.experimentalFeatures}}getVersionRange(){return this.payload.usePassphrase?{model_mini:{min:"2.4.0"}}:{}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("ApplySettings","Success",Object.assign({},this.params));return $e.resolve(e.message)}))}},deviceUpdateReboot:class extends br{init(){this.useDevicePassphraseState=!1}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("BixinReboot","Success");return $e.resolve(e.message)}))}},deviceSupportFeatures:class extends br{init(){this.useDevicePassphraseState=!1}run(){if(!this.device.features)return $e.reject(fe.TypedError(le.RuntimeError,"Device not initialized"));const e=wt(this.device.features);return $e.resolve({inputPinOnSoftware:e,device:this.device.toMessageObject()})}},deviceVerify:class extends br{init(){this.useDevicePassphraseState=!1,Rr(this.payload,[{name:"dataHex",type:"hexString"}]),this.params={data:Sr(this.payload.dataHex)}}run(){return We(this,void 0,void 0,(function*(){let e;if("classic"===vt(this.device.features))e=(yield this.device.commands.typedCall("BixinVerifyDeviceRequest","BixinVerifyDeviceAck",Object.assign(Object.assign({},this.params),{data:He().sha256(this.params.data)}))).message;else{const t=yield this.device.commands.typedCall("SESignMessage","SEMessageSignature",{message:this.params.data});e={cert:(yield this.device.commands.typedCall("ReadSEPublicCert","SEPublicCert")).message.public_cert,signature:t.message.signature}}return e?$e.resolve(e):$e.reject(fe.TypedError(le.RuntimeError,"Device not support verify"))}))}},deviceWipe:class extends br{init(){this.useDevicePassphraseState=!1}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("WipeDevice","Success");return $e.resolve(e.message)}))}},firmwareUpdate:class extends br{init(){this.allowDeviceMode=[ur,dr],this.requireDeviceMode=[ur],this.useDevicePassphraseState=!1;const{payload:e}=this;if(Rr(e,[{name:"version",type:"array"},{name:"binary",type:"buffer"}]),!e.updateType)throw fe.TypedError(le.CallMethodInvalidParameter,"updateType is required");this.params={updateType:e.updateType},"version"in e&&(this.params=Object.assign(Object.assign({},this.params),{version:e.version})),"binary"in e&&(this.params=Object.assign(Object.assign({},this.params),{binary:e.binary}))}run(){var e;return We(this,void 0,void 0,(function*(){const{device:t,params:r}=this;let i;try{if(r.binary)i=this.params.binary;else{if(!t.features)throw fe.TypedError(le.RuntimeError,"no features found for this device");const e=yield(({features:e,updateType:t,version:r})=>We(void 0,void 0,void 0,(function*(){const i=(({features:e,updateType:t})=>{var r,i,n;const s=vt(e),{deviceMap:o}=qt;return null!==(n=null===(i=null===(r=null==o?void 0:o[s])||void 0===r?void 0:r[t])||void 0===i?void 0:i[0])&&void 0!==n?n:null})({features:e,updateType:t});if(!i)throw fe.TypedError(le.RuntimeError,"no firmware found for this device");if(r&&!Be().eq(i.version,r))throw fe.TypedError(le.RuntimeError,"firmware version mismatch");const n="ble"===t?i.webUpdate:i.url;let s;try{s=yield((e,t)=>((e,t="text")=>We(void 0,void 0,void 0,(function*(){const r=yield ge().request({url:e,withCredentials:!1,responseType:"binary"===t?"arraybuffer":"json"});if(200==+r.status)return r.data;throw new Error(`httpRequest error: ${e} ${r.statusText}`)})))(e,t))(n,"binary")}catch(e){throw fe.TypedError(le.RuntimeError,"Method_FirmwareUpdate_DownloadFailed")}return Object.assign(Object.assign({},i),{binary:s})})))({features:t.features,version:r.version,updateType:r.updateType});i=e.binary}}catch(t){throw fe.TypedError(le.FirmwareUpdateDownloadFailed,null!==(e=t.message)&&void 0!==e?e:t)}return((e,t,r,i,{payload:n})=>We(void 0,void 0,void 0,(function*(){var s,o;if(1===(null===(s=i.features)||void 0===s?void 0:s.major_version)){Or(i);const s="firmware"===e?"FirmwareErase":"FirmwareErase_ex";yield t(s,"Success",{}),Ir(i,0,r);const{message:o}=yield t("FirmwareUpload","Success",{payload:n});return Ir(i,100,r),o}if(2===(null===(o=i.features)||void 0===o?void 0:o.major_version)){Or(i);const e=n.byteLength;let s=yield t("FirmwareErase",["FirmwareRequest","Success"],{length:e});for(;"Success"!==s.type;){const o=s.message.offset,a=s.message.offset+s.message.length,u=n.slice(o,a);o>0&&Ir(i,Math.round(o/e*100),r),s=yield t("FirmwareUpload",["FirmwareRequest","Success"],{payload:u})}return Ir(i,100,r),s.message}throw fe.TypedError(le.RuntimeError,"uploadFirmware: unknown major_version")})))(r.updateType,this.device.getCommands().typedCall.bind(this.device.getCommands()),this.postMessage,t,{payload:i})}))}},requestWebUsbDevice:class extends br{init(){this.useDevice=!1,this.useDevicePassphraseState=!1}run(){var e,t;return We(this,void 0,void 0,(function*(){if(yield sr.configure(),"webusb"!==qt.getSettings("env"))return $e.reject(fe.TypedError(le.RuntimeError,"Not webusb environment"));try{const r=yield null===(e=this.connector)||void 0===e?void 0:e.enumerate(),i=null!==(t=null==r?void 0:r.descriptors)&&void 0!==t?t:[],{deviceList:n}=yield tr.getDevices(i);return n.length>0?{device:n[0].toMessageObject()}:yield $e.reject(fe.TypedError(le.RuntimeError,"Please select the device to connect"))}catch(e){return xr.debug(e),$e.reject(fe.TypedError(le.RuntimeError,"Please select the device to connect"))}}))}},cipherKeyValue:class extends br{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};Rr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{const t=mt(e.path);Rr(e,[{name:"path",required:!0},{name:"key",type:"string"},{name:"value",type:"hexString"},{name:"encrypt",type:"boolean"},{name:"askOnEncrypt",type:"boolean"},{name:"askOnDecrypt",type:"boolean"},{name:"iv",type:"hexString"}]),this.params.push({address_n:t,key:e.key,value:Sr(e.value),encrypt:e.encrypt,ask_on_encrypt:e.askOnEncrypt,ask_on_decrypt:e.askOnDecrypt,iv:Sr(e.iv)})}))}run(){return We(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("CipherKeyValue","CipheredKeyValue",Object.assign({},r));e.push(Object.assign({path:gt(r.address_n)},i.message))}return $e.resolve(this.hasBundle?e:e[0])}))}},btcGetAddress:class extends br{constructor(){super(...arguments),this.hasBundle=!1}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],this.hasBundle=Object.prototype.hasOwnProperty.call(this.payload,"bundle");const e=this.hasBundle?this.payload:{bundle:[this.payload]};Rr(e,[{name:"bundle",type:"array"}]),this.params=[],e.bundle.forEach((e=>{var t;const r=mt(e.path,1);Rr(e,[{name:"path",required:!0},{name:"coin",type:"string"},{name:"showOnOneKey",type:"boolean"},{name:"multisig",type:"object"},{name:"scriptType",type:"string"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t,{multisig:n,coin:s}=e;let{scriptType:o}=e;o||(o=yt(r),"SPENDMULTISIG"!==o||n||(o="SPENDADDRESS"));const a=Mr(r,s).name;this.params.push({address_n:r,show_display:i,coin_name:a,multisig:n,script_type:o||"SPENDADDRESS"})}))}run(){return We(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("GetAddress","Address",Object.assign({},r));e.push(Object.assign({path:gt(r.address_n)},i.message))}return $e.resolve(this.hasBundle?e:e[0])}))}},btcGetPublicKey:class extends br{constructor(){super(...arguments),this.hasBundle=!1}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],this.hasBundle=Object.prototype.hasOwnProperty.call(this.payload,"bundle");const e=this.hasBundle?this.payload:{bundle:[this.payload]};Rr(e,[{name:"bundle",type:"array"}]),this.params=[],e.bundle.forEach((e=>{var t;const r=mt(e.path,1);Rr(e,[{name:"path",required:!0},{name:"coin",type:"string"},{name:"showOnOneKey",type:"boolean"},{name:"scriptType",type:"string"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t,{multisig:n,coin:s}=e;let{scriptType:o}=e;o||(o=yt(r),"SPENDMULTISIG"!==o||n||(o="SPENDADDRESS"));const a=Mr(r,s).name;this.params.push({address_n:r,show_display:i,coin_name:a,script_type:o||"SPENDADDRESS"})}))}run(){return We(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("GetPublicKey","PublicKey",Object.assign({},r));e.push(Object.assign({path:gt(r.address_n)},i.message))}return $e.resolve(this.hasBundle?e:e[0])}))}},btcSignMessage:class extends br{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0},{name:"coin",type:"string"}]);const{path:e,messageHex:t,coin:r}=this.payload,i=mt(e),{coinName:n,scriptType:s}=((e,t,r)=>{const i=Mr(e,t).name;let n=r;void 0===n&&(n=(e=>Array.isArray(e)&&e[0]===pt(48))(e));let s=yt(e);return"SPENDMULTISIG"!==s||n||(s="SPENDADDRESS"),{coinName:i,scriptType:null!=s?s:"SPENDADDRESS"}})(i,r,!1);this.params={address_n:i,message:Sr(t),coin_name:n,script_type:s}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("SignMessage","MessageSignature",Object.assign({},this.params));return $e.resolve(e.message)}))}},btcSignTransaction:class extends br{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"coin",type:"string",required:!0},{name:"inputs",type:"array",required:!0},{name:"outputs",type:"array",required:!0},{name:"refTxs",type:"array",required:!0,allowEmpty:!0},{name:"locktime",type:"number"},{name:"version",type:"number"},{name:"expiry",type:"number"},{name:"overwintered",type:"boolean"},{name:"versionGroupId",type:"number"},{name:"branchId",type:"number"},{name:"timestamp",type:"number"}]),this.payload.refTxs.forEach((e=>{Rr(e,[{name:"hash",type:"hexString",required:!0},{name:"inputs",type:"array",required:!0},{name:"bin_outputs",type:"array",required:!Array.isArray(e.outputs)},{name:"outputs",type:"array"},{name:"version",type:"number",required:!0},{name:"lock_time",type:"number",required:!0},{name:"extra_data",type:"string"},{name:"timestamp",type:"number"},{name:"version_group_id",type:"number"}])})),this.payload.inputs.forEach((e=>{mt(e.address_n);const t=(r=e.address_n,Array.isArray(r)&&r[0]===pt(49));var r;Rr(e,[{name:"prev_hash",type:"hexString",required:!0},{name:"prev_index",type:"number",required:!0},{name:"script_type",type:"string"},{name:"amount",type:"string",required:t},{name:"sequence",type:"number"},{name:"multisig",type:"object"}])})),this.payload.outputs.forEach((e=>{if(Rr(e,[{name:"address_n",type:"array"},{name:"address",type:"string"},{name:"amount",type:"string"},{name:"op_return_data",type:"string"},{name:"multisig",type:"object"}]),Object.prototype.hasOwnProperty.call(e,"address_n")&&Object.prototype.hasOwnProperty.call(e,"address"))throw fe.TypedError(le.CallMethodInvalidParameter,"Cannot use address and address_n in one output");if(e.address_n){const t=(e=>{if(!Array.isArray(e)||e.length<1)return"PAYTOADDRESS";if(49===e[0])return"PAYTOP2SHWITNESS";switch(ct(e[0])){case 48:return"PAYTOMULTISIG";case 49:return"PAYTOP2SHWITNESS";case 84:return"PAYTOWITNESS";default:return"PAYTOADDRESS"}})(e.address_n);if(e.script_type!==t)throw fe.TypedError(le.CallMethodInvalidParameter,`Output change script_type should be set to ${t}`)}}));const{inputs:e,outputs:t,refTxs:r,account:i,coin:n}=this.payload,s=Mr(void 0,n).name;this.params={inputs:e,outputs:t,refTxs:r,addresses:i?i.addresses:void 0,options:{lock_time:this.payload.locktime,timestamp:this.payload.timestamp,version:this.payload.version,expiry:this.payload.expiry,overwintered:this.payload.overwintered,version_group_id:this.payload.versionGroupId,branch_id:this.payload.branchId},coinName:s}}run(){return We(this,void 0,void 0,(function*(){const{device:e,params:t}=this,r=e.unavailableCapabilities.replaceTransaction,{refTxs:i}=t,n=r?Pr:Nr;return yield n(e.commands.typedCall.bind(e.commands),t.inputs,t.outputs,i,t.options,t.coinName)}))}},btcVerifyMessage:class extends br{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"address",type:"string",required:!0},{name:"messageHex",type:"hexString",required:!0},{name:"signature",type:"hexString",required:!0},{name:"coin",type:"string",required:!0}]);const{coin:e}=this.payload,{address:t,messageHex:r,signature:i}=Sr(this.payload),n=Mr(void 0,e).name;this.params={address:t,message:r,signature:i,coin_name:n}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("VerifyMessage","Success",Object.assign({},this.params));return $e.resolve(e.message)}))}},confluxGetAddress:class extends br{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.allowDeviceMode=[...this.allowDeviceMode,dr],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};Rr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=mt(e.path,3);Rr(e,[{name:"path",required:!0},{name:"chainId",type:"number"},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,chain_id:e.chainId,show_display:i})}))}getVersionRange(){return{model_mini:{min:"2.4.0"}}}run(){return We(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("ConfluxGetAddress","ConfluxAddress",Object.assign({},r));e.push(Object.assign({path:gt(r.address_n)},i.message))}return $e.resolve(this.hasBundle?e:e[0])}))}},confluxSignMessage:class extends br{init(){this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0}]);const{path:e,messageHex:t}=this.payload,r=mt(e,3);this.params={address_n:r,message:Sr(t)}}getVersionRange(){return{model_mini:{min:"2.4.0"}}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("ConfluxSignMessage","ConfluxMessageSignature",Object.assign({},this.params));return $e.resolve(e.message)}))}},confluxSignMessageCIP23:class extends br{init(){this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"domainHash",type:"hexString",required:!0},{name:"messageHash",type:"hexString",required:!0}]);const{path:e,domainHash:t,messageHash:r}=this.payload,i=mt(e,3);this.params={address_n:i,domain_hash:Sr(t),message_hash:Sr(r)}}getVersionRange(){return{model_mini:{min:"2.4.0"}}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("ConfluxSignMessageCIP23","ConfluxMessageSignature",Object.assign({},this.params));return $e.resolve(e.message)}))}},confluxSignTransaction:class extends br{constructor(){super(...arguments),this.addressN=[],this.processTxRequest=(e,t)=>We(this,void 0,void 0,(function*(){if(!e.data_length){const t=e.signature_v,r=e.signature_r,i=e.signature_s;if(null==t||null==r||null==i)throw fe.TypedError(le.CallMethodError,"sign transaction failed");return $e.resolve({v:`0x${t.toString(16)}`,r:`0x${r}`,s:`0x${i}`})}const[r,i]=qr(t,2*e.data_length),n=yield this.device.commands.typedCall("ConfluxTxAck","ConfluxTxRequest",{data_chunk:r});return this.processTxRequest(n.message,i)})),this.evmSignTx=(e,t)=>We(this,void 0,void 0,(function*(){const{to:r,value:i,gasPrice:n,gasLimit:s,nonce:o,data:a,chainId:u,epochHeight:d,storageLimit:l}=t,p=null==a?0:a.length/2,[c,h]=qr(a,2048);let f={address_n:e,nonce:wr(o),gas_price:wr(n),gas_limit:wr(s),to:r,value:wr(i),epoch_height:wr(d),storage_limit:wr(l),chain_id:u};0!==p&&(f=Object.assign(Object.assign({},f),{data_length:p,data_initial_chunk:c}));const y=yield this.device.commands.typedCall("ConfluxSignTx","ConfluxTxRequest",f);return this.processTxRequest(y.message,h)}))}init(){this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"transaction",type:"object",required:!0}]);const{path:e,transaction:t}=this.payload;this.addressN=mt(e,3);const r=t;Rr(r,[{name:"to",type:"hexString",required:!0},{name:"value",type:"hexString",required:!0},{name:"gasLimit",type:"hexString",required:!0},{name:"gasPrice",type:"hexString",required:!0},{name:"nonce",type:"hexString",required:!0},{name:"epochHeight",type:"hexString",required:!0},{name:"storageLimit",type:"hexString",required:!0},{name:"chainId",type:"number",required:!0},{name:"data",type:"hexString"}]),this.formattedTx=Sr(r)}getVersionRange(){return{model_mini:{min:"2.4.0"}}}run(){return We(this,void 0,void 0,(function*(){const{addressN:e,formattedTx:t}=this;if(null==t)throw fe.TypedError(le.CallMethodInvalidParameter,"ConfluxSignTransaction: format tx error");const r=yield this.evmSignTx(e,t);return $e.resolve(r)}))}},evmGetAddress:class extends br{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};Rr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=mt(e.path,3);Rr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}run(){return We(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("EthereumGetAddress","EthereumAddress",Object.assign({},r)),{address:n}=i.message;e.push({path:gt(r.address_n),address:n})}return $e.resolve(this.hasBundle?e:e[0])}))}},evmGetPublicKey:class extends br{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};Rr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=mt(e.path,3);Rr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}run(){return We(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("EthereumGetPublicKey","EthereumPublicKey",Object.assign({},r));e.push(Object.assign({path:gt(r.address_n)},i.message))}return $e.resolve(this.hasBundle?e:e[0])}))}},evmSignMessage:class extends br{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0}]);const{path:e,messageHex:t}=this.payload,r=mt(e,3);this.params={address_n:r,message:Sr(t)}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("EthereumSignMessage","EthereumMessageSignature",Object.assign({},this.params));return $e.resolve(e.message)}))}},evmSignMessageEIP712:class extends br{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"domainHash",type:"hexString",required:!0},{name:"messageHash",type:"hexString",required:!0}]);const{path:e,domainHash:t,messageHash:r}=this.payload,i=mt(e,3);this.params={address_n:i,domain_hash:Sr(t),message_hash:Sr(r)}}getVersionRange(){return{model_mini:{min:"2.1.9"}}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("EthereumSignMessageEIP712","EthereumMessageSignature",Object.assign({},this.params));return $e.resolve(e.message)}))}},evmSignTransaction:class extends br{constructor(){super(...arguments),this.addressN=[],this.isEIP1559=!1,this.processTxRequest=(e,t,r)=>We(this,void 0,void 0,(function*(){if(!e.data_length){let t=e.signature_v;const i=e.signature_r,n=e.signature_s;if(null==t||null==i||null==n)throw fe.TypedError(le.RuntimeError,"processTxRequest: Unexpected request");return r&&t<=1&&(t+=2*r+35),$e.resolve({v:`0x${t.toString(16)}`,r:`0x${i}`,s:`0x${n}`})}const[i,n]=qr(t,2*e.data_length),s=yield this.device.commands.typedCall("EthereumTxAck","EthereumTxRequest",{data_chunk:i});return this.processTxRequest(s.message,n,r)})),this.evmSignTx=(e,t)=>We(this,void 0,void 0,(function*(){const{to:r,value:i,gasPrice:n,gasLimit:s,nonce:o,data:a,chainId:u,txType:d}=t,l=null==a?0:a.length/2,[p,c]=qr(a,2048);let h={address_n:e,nonce:wr(o),gas_price:wr(n),gas_limit:wr(s),to:r,value:wr(i),chain_id:u};0!==l&&(h=Object.assign(Object.assign({},h),{data_length:l,data_initial_chunk:p})),null!==d&&(h=Object.assign(Object.assign({},h),{tx_type:d}));const f=yield this.device.commands.typedCall("EthereumSignTx","EthereumTxRequest",h);return this.processTxRequest(f.message,c,u)})),this.evmSignTxEip1559=(e,t)=>We(this,void 0,void 0,(function*(){const{to:r,value:i,gasLimit:n,nonce:s,data:o,chainId:a,maxFeePerGas:u,maxPriorityFeePerGas:d,accessList:l}=t,p=null==o?0:o.length/2,[c,h]=qr(o,2048),f={address_n:e,nonce:wr(s),max_gas_fee:wr(u),max_priority_fee:wr(d),gas_limit:wr(n),to:r,value:wr(i),data_length:p,data_initial_chunk:c,chain_id:a,access_list:(l||[]).map((e=>({address:e.address,storage_keys:e.storageKeys})))},y=yield this.device.commands.typedCall("EthereumSignTxEIP1559","EthereumTxRequest",f);return this.processTxRequest(y.message,h)}))}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"transaction",type:"object",required:!0}]);const{path:e,transaction:t}=this.payload;this.addressN=mt(e,3);const r=t;this.isEIP1559=!!r.maxFeePerGas&&!!r.maxPriorityFeePerGas;const i=[{name:"to",type:"hexString",required:!0},{name:"value",type:"hexString",required:!0},{name:"gasLimit",type:"hexString",required:!0},{name:"nonce",type:"hexString",required:!0},{name:"chainId",type:"number",required:!0},{name:"data",type:"hexString"}];this.isEIP1559?(i.push({name:"maxFeePerGas",type:"hexString",required:!0}),i.push({name:"maxPriorityFeePerGas",type:"hexString",required:!0})):(i.push({name:"gasPrice",type:"hexString",required:!0}),i.push({name:"txType",type:"number"})),Rr(r,i),this.formattedTx=Sr(r)}getVersionRange(){return this.isEIP1559?{model_mini:{min:"2.1.11"}}:{model_mini:{min:"1.0.0"}}}run(){return We(this,void 0,void 0,(function*(){const{addressN:e,isEIP1559:t,formattedTx:r}=this,i=yield t?this.evmSignTxEip1559(e,r):this.evmSignTx(e,r);return $e.resolve(i)}))}},evmSignTypedData:class extends br{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"metamaskV4Compat",type:"boolean"},{name:"data",type:"object"},{name:"domainHash",type:"hexString"},{name:"messageHash",type:"hexString"}]);const{path:e,data:t,metamaskV4Compat:r,domainHash:i,messageHash:n}=this.payload,s=mt(e,3);if(this.params={addressN:s,metamaskV4Compat:r,data:t},i)if(this.params.domainHash=Sr(i),n)this.params.messageHash=Sr(n);else if(t&&(!t.primaryType||"EIP712Domain"!==t.primaryType))throw fe.TypedError(le.CallMethodInvalidParameter,"message_hash should only be empty when data.primaryType=EIP712Domain")}signTypedData(){return We(this,void 0,void 0,(function*(){const{commands:e}=this.device,{addressN:t,data:r,metamaskV4Compat:i}=this.params,{types:n,primaryType:s,domain:o,message:a}=r;let u=yield e.typedCall("EthereumSignTypedData",["EthereumTypedDataStructRequest","EthereumTypedDataValueRequest","EthereumTypedDataSignature"],{address_n:t,primary_type:s,metamask_v4_compat:i});for(;"EthereumTypedDataStructRequest"===u.type;){const{name:t}=u.message,r=n[t];if(void 0===r)throw fe.TypedError("Runtime",`Type ${t} was not defined in types object`);const i={members:r.map((({name:e,type:t})=>({name:e,type:$r(t,n)})))};u=yield e.typedCall("EthereumTypedDataStructAck",["EthereumTypedDataStructRequest","EthereumTypedDataValueRequest","EthereumTypedDataSignature"],i)}for(;"EthereumTypedDataValueRequest"===u.type;){const{member_path:t}=u.message;let r,i;const[d,...l]=t;switch(d){case 0:r=o,i="EIP712Domain";break;case 1:r=a,i=s;break;default:throw fe.TypedError("Runtime","Root index can only be 0 or 1")}for(const e of l)if(Array.isArray(r))i=jr(i).entryTypeName,r=r[e];else if("object"==typeof r&&null!==r){const t=n[i][e];i=t.type,r=r[t.name]}let p;p=Array.isArray(r)?Ur("uint16",r.length):Ur(i,r),u=yield e.typedCall("EthereumTypedDataValueAck",["EthereumTypedDataValueRequest","EthereumTypedDataSignature"],{value:p})}if("EthereumTypedDataSignature"!==u.type)throw fe.TypedError("Runtime","Unexpected response type");const{address:d,signature:l}=u.message;return{address:d,signature:l}}))}getVersionRange(){return{model_mini:{min:"2.1.9"}}}supportSignTyped(){const e=vt(this.device.features);if("classic"===e||"mini"===e){const e=Tt(this.device.features).join("."),t="2.2.0";if(Be().lt(e,t))return!1}return!0}run(){return We(this,void 0,void 0,(function*(){if(!this.device.features)throw fe.TypedError("Device_InitializeFailed","Device initialization failed. Please try again.");const{addressN:e}=this.params,t=vt(this.device.features);if("classic"===t||"mini"===t){Rr(this.params,[{name:"domainHash",type:"hexString",required:!0},{name:"messageHash",type:"hexString",required:!0}]);const{domainHash:t,messageHash:r}=this.params;let i;return i=this.supportSignTyped()?yield this.device.commands.typedCall("EthereumSignTypedHash","EthereumTypedDataSignature",{address_n:e,domain_separator_hash:null!=t?t:"",message_hash:r}):yield this.device.commands.typedCall("EthereumSignMessageEIP712","EthereumMessageSignature",{address_n:e,domain_hash:null!=t?t:"",message_hash:null!=r?r:""}),$e.resolve(i.message)}return this.signTypedData()}))}},evmVerifyMessage:class extends br{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"address",type:"string",required:!0},{name:"messageHex",type:"hexString",required:!0},{name:"signature",type:"hexString",required:!0}]);const{address:e,messageHex:t,signature:r}=Sr(this.payload);this.params={address:e,message:t,signature:r}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("EthereumVerifyMessage","Success",Object.assign({},this.params));return $e.resolve(e.message)}))}},starcoinGetAddress:class extends br{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};Rr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=mt(e.path,3);Rr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}run(){return We(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("StarcoinGetAddress","StarcoinAddress",Object.assign({},r));e.push(Object.assign({path:gt(r.address_n)},i.message))}return $e.resolve(this.hasBundle?e:e[0])}))}},starcoinGetPublicKey:class extends br{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};Rr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=mt(e.path,3);Rr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}run(){return We(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("StarcoinGetPublicKey","StarcoinPublicKey",Object.assign({},r));e.push(Object.assign({path:gt(r.address_n)},i.message))}return $e.resolve(this.hasBundle?e:e[0])}))}},starcoinSignMessage:class extends br{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0}]);const{path:e,messageHex:t}=this.payload,r=mt(e,3);this.params={address_n:r,message:Sr(t)}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("StarcoinSignMessage","StarcoinMessageSignature",Object.assign({},this.params));return $e.resolve(e.message)}))}},starcoinSignTransaction:class extends br{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"rawTx",type:"hexString",required:!0}]);const{path:e,rawTx:t}=this.payload,r=mt(e,3);this.params={address_n:r,raw_tx:Sr(t)}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("StarcoinSignTx","StarcoinSignedTx",Object.assign({},this.params));return $e.resolve(e.message)}))}},starcoinVerifyMessage:class extends br{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"publicKey",type:"string",required:!0},{name:"messageHex",type:"hexString",required:!0},{name:"signature",type:"hexString",required:!0}]);const{publicKey:e,messageHex:t,signature:r}=Sr(this.payload);this.params={public_key:e,message:t,signature:r}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("StarcoinVerifyMessage","Success",Object.assign({},this.params));return $e.resolve(e.message)}))}},nemGetAddress:class extends br{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};Rr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=mt(e.path,3);Rr(e,[{name:"path",required:!0},{name:"network",type:"number"},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,network:e.network||104,show_display:i})}))}run(){return We(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("NEMGetAddress","NEMAddress",Object.assign({},r));e.push(Object.assign({path:gt(r.address_n)},i.message))}return $e.resolve(this.hasBundle?e:e[0])}))}},nemSignTransaction:class extends br{constructor(){super(...arguments),this.NEM_MOSAIC_LEVY_TYPES={1:"MosaicLevy_Absolute",2:"MosaicLevy_Percentile"},this.NEM_SUPPLY_CHANGE_TYPES={1:"SupplyChange_Increase",2:"SupplyChange_Decrease"},this.NEM_AGGREGATE_MODIFICATION_TYPES={1:"CosignatoryModification_Add",2:"CosignatoryModification_Delete"},this.NEM_IMPORTANCE_TRANSFER_MODES={1:"ImportanceTransfer_Activate",2:"ImportanceTransfer_Deactivate"},this.getCommon=(e,t)=>{var r;return{address_n:t,network:e.version>>24&255,timestamp:e.timeStamp,fee:e.fee,deadline:null!==(r=e.deadline)&&void 0!==r?r:0,signer:t?void 0:e.signer}},this.transferMessage=e=>{const t=e.mosaics?e.mosaics.map((e=>({namespace:e.mosaicId.namespaceId,mosaic:e.mosaicId.name,quantity:e.quantity}))):void 0;return{recipient:e.recipient,amount:e.amount,payload:e.message?e.message.payload:void 0,public_key:e.message&&2===e.message.type?e.message.publicKey:void 0,mosaics:t}},this.importanceTransferMessage=e=>({mode:this.NEM_IMPORTANCE_TRANSFER_MODES[e.importanceTransfer.mode],public_key:e.importanceTransfer.publicKey}),this.aggregateModificationMessage=e=>({modifications:e.modifications?e.modifications.map((e=>({type:this.NEM_AGGREGATE_MODIFICATION_TYPES[e.modificationType],public_key:e.cosignatoryAccount}))):void 0,relative_change:e.minCosignatories.relativeChange}),this.provisionNamespaceMessage=e=>{var t,r,i;return{namespace:null!==(t=e.newPart)&&void 0!==t?t:"",parent:e.parent||void 0,sink:null!==(r=e.rentalFeeSink)&&void 0!==r?r:"",fee:null!==(i=e.rentalFee)&&void 0!==i?i:0}},this.mosaicCreationMessage=e=>{var t,r;const{levy:i}=e.mosaicDefinition,n={namespace:e.mosaicDefinition.id.namespaceId,mosaic:e.mosaicDefinition.id.name,levy:i&&i.type?this.NEM_MOSAIC_LEVY_TYPES[i.type]:void 0,fee:i&&i.fee,levy_address:i&&i.recipient,levy_namespace:i&&i.mosaicId&&i.mosaicId.namespaceId,levy_mosaic:i&&i.mosaicId&&i.mosaicId.name,description:e.mosaicDefinition.description},{properties:s}=e.mosaicDefinition;return Array.isArray(s)&&s.forEach((e=>{const{name:t,value:r}=e;switch(t){case"divisibility":n.divisibility=parseInt(r);break;case"initialSupply":n.supply=parseInt(r);break;case"supplyMutable":n.mutable_supply="true"===r;break;case"transferable":n.transferable="true"===r}})),{definition:n,sink:null!==(t=e.creationFeeSink)&&void 0!==t?t:"",fee:null!==(r=e.creationFee)&&void 0!==r?r:0}},this.supplyChangeMessage=e=>{var t;return{namespace:e.mosaicId.namespaceId,mosaic:e.mosaicId.name,type:this.NEM_SUPPLY_CHANGE_TYPES[e.supplyType],delta:null!==(t=e.delta)&&void 0!==t?t:0}},this.parseTx=(e,t)=>{let r=e;const i={transaction:this.getCommon(e,t),transfer:void 0,importance_transfer:void 0,aggregate_modification:void 0,provision_namespace:void 0,mosaic_creation:void 0,supply_change:void 0};switch(258!==e.type&&4100!==e.type&&4098!==e.type||(i.cosigning=258===e.type||4098===e.type,r=e.otherTrans,i.multisig=this.getCommon(r)),r.type){case 257:i.transfer=this.transferMessage(r);break;case 2049:i.importance_transfer=this.importanceTransferMessage(r);break;case 4097:i.aggregate_modification=this.aggregateModificationMessage(r);break;case 8193:i.provision_namespace=this.provisionNamespaceMessage(r);break;case 16385:i.mosaic_creation=this.mosaicCreationMessage(r);break;case 16386:i.supply_change=this.supplyChangeMessage(r);break;default:throw fe.TypedError(le.CallMethodInvalidParameter,"Unknown transaction type")}return i}}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"transaction",type:"object",required:!0}]);const{path:e,transaction:t}=this.payload,r=mt(e,3);this.params=this.parseTx(t,r)}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("NEMSignTx","NEMSignedTx",Object.assign({},this.params));return $e.resolve(e)}))}},solGetAddress:class extends br{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};Rr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=mt(e.path,3);Rr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}run(){return We(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("SolanaGetAddress","SolanaAddress",Object.assign({},r)),{address:n}=i.message;e.push({path:gt(r.address_n),address:n})}return $e.resolve(this.hasBundle?e:e[0])}))}},solSignTransaction:class extends br{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};Rr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{const t=mt(e.path,3);Rr(e,[{name:"path",required:!0},{name:"rawTx",type:"hexString",required:!0}]),this.params.push({address_n:t,raw_tx:Sr(e.rawTx)})}))}getVersionRange(){return{classic:{min:"2.1.9"},mini:{min:"2.1.9"}}}run(){return We(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("SolanaSignTx","SolanaSignedTx",Object.assign({},r)),{signature:n}=i.message;e.push({path:gt(r.address_n),signature:n})}return $e.resolve(this.hasBundle?e:e[0])}))}},stellarGetAddress:class extends br{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};Rr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=mt(e.path,3);Rr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}run(){return We(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("StellarGetAddress","StellarAddress",Object.assign({},r)),{address:n}=i.message;e.push({path:gt(r.address_n),address:n})}return $e.resolve(this.hasBundle?e:e[0])}))}},stellarSignTransaction:class extends br{constructor(){super(...arguments),this.operations=[],this.parseOperation=e=>{switch(e.type){case"createAccount":return Rr(e,[{name:"destination",type:"string",required:!0},{name:"startingBalance",type:"bigNumber",required:!0}]),{type:"StellarCreateAccountOp",source_account:e.source,new_account:e.destination,starting_balance:e.startingBalance};case"payment":return Rr(e,[{name:"destination",type:"string",required:!0},{name:"amount",type:"bigNumber",required:!0},{name:"asset",required:!0}]),{type:"StellarPaymentOp",source_account:e.source,destination_account:e.destination,asset:e.asset,amount:e.amount};case"pathPayment":return Rr(e,[{name:"destAmount",type:"bigNumber",required:!0}]),{type:"StellarPathPaymentOp",source_account:e.source,send_asset:e.sendAsset,send_max:e.sendMax,destination_account:e.destination,destination_asset:e.destAsset,destination_amount:e.destAmount,paths:e.path};case"createPassiveOffer":return Rr(e,[{name:"amount",type:"bigNumber",required:!0}]),{type:"StellarCreatePassiveOfferOp",source_account:e.source,buying_asset:e.buying,selling_asset:e.selling,amount:e.amount,price_n:e.price.n,price_d:e.price.d};case"manageOffer":return Rr(e,[{name:"amount",type:"bigNumber",required:!0}]),{type:"StellarManageOfferOp",source_account:e.source,buying_asset:e.buying,selling_asset:e.selling,amount:e.amount,offer_id:e.offerId,price_n:e.price.n,price_d:e.price.d};case"setOptions":{const t=e.signer?{signer_type:e.signer.type,signer_key:e.signer.key,signer_weight:e.signer.weight}:void 0;return Object.assign({type:"StellarSetOptionsOp",source_account:e.source,clear_flags:e.clearFlags,set_flags:e.setFlags,master_weight:e.masterWeight,low_threshold:e.lowThreshold,medium_threshold:e.medThreshold,high_threshold:e.highThreshold,home_domain:e.homeDomain,inflation_destination_account:e.inflationDest},t)}case"changeTrust":return Rr(e,[{name:"limit",type:"bigNumber"}]),{type:"StellarChangeTrustOp",source_account:e.source,asset:e.line,limit:e.limit};case"allowTrust":return{type:"StellarAllowTrustOp",source_account:e.source,trusted_account:e.trustor,asset_type:e.assetType,asset_code:e.assetCode,is_authorized:e.authorize?1:0};case"accountMerge":return{type:"StellarAccountMergeOp",source_account:e.source,destination_account:e.destination};case"manageData":return{type:"StellarManageDataOp",source_account:e.source,key:e.name,value:e.value};case"bumpSequence":return{type:"StellarBumpSequenceOp",source_account:e.source,bump_to:e.bumpTo};default:return{}}},this.processTxRequest=(e,t)=>We(this,void 0,void 0,(function*(){const r=t+1>=e.length,i=e[t],{type:n}=i,s=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]])}return r}(i,["type"]);return r?(yield this.device.commands.typedCall(n,"StellarSignedTx",s)).message:(yield this.device.commands.typedCall(n,"StellarTxOpRequest",s),this.processTxRequest(e,t+1))}))}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"networkPassphrase",type:"string",required:!0},{name:"transaction",type:"object",required:!0}]);const{transaction:e,networkPassphrase:t}=this.payload;if(!e.timebounds)throw fe.TypedError(le.CallMethodInvalidParameter,"timebounds is required");const r=mt(this.payload.path,3);this.params={address_n:r,network_passphrase:t,source_account:e.source,fee:e.fee,sequence_number:e.sequence,num_operations:e.operations.length,memo_type:ee.NONE,timebounds_start:e.timebounds.minTime,timebounds_end:e.timebounds.maxTime},e.memo&&(this.params.memo_type=e.memo.type,this.params.memo_text=e.memo.text,this.params.memo_id=e.memo.id,this.params.memo_hash=e.memo.hash),e.operations.forEach((e=>{const t=this.parseOperation(e);t&&this.operations.push(t)})),console.log("StellarSignTransactionParams",this.params),console.log("StellarSignTransactionOperations",this.operations)}run(){return We(this,void 0,void 0,(function*(){return yield this.device.commands.typedCall("StellarSignTx","StellarTxOpRequest",Object.assign({},this.params)),this.processTxRequest(this.operations,0)}))}},tronGetAddress:class extends br{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};Rr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=mt(e.path,3);Rr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}getVersionRange(){return{model_mini:{min:"2.4.0"}}}run(){return We(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("TronGetAddress","TronAddress",Object.assign({},r)),{address:n}=i.message;e.push({path:gt(r.address_n),address:n})}return $e.resolve(this.hasBundle?e:e[0])}))}},tronSignMessage:class extends br{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0}]);const{path:e,messageHex:t}=this.payload,r=mt(e,3);this.params={address_n:r,message:Er(t)}}getVersionRange(){return{model_mini:{min:"2.4.0"}}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("TronSignMessage","TronMessageSignature",Object.assign({},this.params));return $e.resolve(e.message)}))}},tronSignTransaction:class extends br{parseTx(e,t){const r={address_n:t,data:e.data,timestamp:e.timestamp,fee_limit:e.feeLimit,ref_block_bytes:e.refBlockBytes,ref_block_hash:e.refBlockHash,expiration:e.expiration,contract:{}};return e.contract&&(e.contract.transferContract&&(r.contract={transfer_contract:{to_address:e.contract.transferContract.toAddress,amount:e.contract.transferContract.amount}}),e.contract.triggerSmartContract&&(r.contract={trigger_smart_contract:{contract_address:e.contract.triggerSmartContract.contractAddress,call_value:e.contract.triggerSmartContract.callValue,data:e.contract.triggerSmartContract.data,call_token_value:e.contract.triggerSmartContract.callTokenValue,asset_id:e.contract.triggerSmartContract.assetId}})),r}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"transaction",type:"object",required:!0}]);const{path:e,transaction:t}=this.payload,r=mt(e,3);Rr(t,[{name:"refBlockBytes",type:"hexString",required:!0},{name:"refBlockHash",type:"hexString",required:!0},{name:"expiration",type:"number",required:!0},{name:"timestamp",type:"number",required:!0},{name:"contract",type:"object",required:!0}]),this.params=this.parseTx(Sr(t),r)}getVersionRange(){return{model_mini:{min:"2.4.0"}}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("TronSignTx","TronSignedTx",Object.assign({},this.params));return $e.resolve(e.message)}))}},nearGetAddress:class extends br{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};Rr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=mt(e.path,3);Rr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}getVersionRange(){return{model_mini:{min:"2.4.0"}}}run(){return We(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("NearGetAddress","NearAddress",Object.assign({},r)),{address:n}=i.message;e.push({path:gt(r.address_n),address:n})}return $e.resolve(this.hasBundle?e:e[0])}))}},nearSignTransaction:class extends br{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"rawTx",type:"hexString",required:!0}]);const{path:e,rawTx:t}=this.payload,r=mt(e,3);this.params={address_n:r,raw_tx:Sr(t)}}getVersionRange(){return{model_mini:{min:"2.4.0"}}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("NearSignTx","NearSignedTx",Object.assign({},this.params));return $e.resolve(e.message)}))}},aptosGetAddress:class extends br{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};Rr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=mt(e.path,3);Rr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}run(){return We(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("AptosGetAddress","AptosAddress",Object.assign({},r)),{address:n}=i.message;e.push({path:gt(r.address_n),address:n})}return $e.resolve(this.hasBundle?e:e[0])}))}},aptosSignTransaction:class extends br{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,dr],Rr(this.payload,[{name:"path",required:!0},{name:"rawTx",type:"hexString",required:!0}]);const{path:e,rawTx:t}=this.payload,r=mt(e,3);this.params={address_n:r,raw_tx:Sr(t)}}getVersionRange(){return{model_mini:{min:"2.4.0"}}}run(){return We(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("AptosSignTx","AptosSignedTx",Object.assign({},this.params));return $e.resolve(e.message)}))}}});const zr=e=>{throw e instanceof de?e:"ERR_NETWORK"===e.code?fe.TypedError(le.BridgeNotInstalled):"ECONNABORTED"===e.code?fe.TypedError(le.BridgeTimeoutError):fe.TypedError(e)},Wr=kt(Ct.DeviceConnector);class Vr{constructor(){this.listenTimestamp=0,this.current=null,this.upcoming=[],this.listening=!1,sr.load(),this.transport=sr.getTransport(),tr.setConnector(this)}enumerate(){return We(this,void 0,void 0,(function*(){try{const e=yield this.transport.enumerate();return this.upcoming=e,this._reportDevicesChange(),{descriptors:e}}catch(e){zr(e)}}))}listen(){return We(this,void 0,void 0,(function*(){const e=null!==this.current,t=this.current||[];let r;this.listening=!0;try{if(Wr.debug("Start listening",t),this.listenTimestamp=(new Date).getTime(),r=e?yield this.transport.listen(t):yield this.transport.enumerate(),!this.listening)return;this.upcoming=r,Wr.debug("Listen result",r),this._reportDevicesChange(),this.listening&&this.listen()}catch(e){const t=(new Date).getTime()-this.listenTimestamp;Wr.debug("Listen error","timestamp",t,typeof e),t>1100?(yield(1e3,null,new $e((e=>{setTimeout(e,1e3,null)}))),this.listening&&this.listen()):Wr.warn("Transport error")}}))}stop(){this.listening=!1}acquire(e,t){return We(this,void 0,void 0,(function*(){Wr.debug("acquire",e,t);const r=qt.getSettings("env");try{let i;return i="react-native"===r?yield this.transport.acquire({uuid:e}):yield this.transport.acquire({path:e,previous:null!=t?t:null}),i}catch(e){Wr.debug("acquire error: ",e.message),zr(e)}}))}release(e,t){return We(this,void 0,void 0,(function*(){try{return yield this.transport.release(e,t)}catch(e){zr(e)}}))}_reportDevicesChange(){tr.reportDeviceChange(this.upcoming)}}const Xr=kt(Ct.Core),Kr=e=>({initSession:null==e?void 0:e.payload.initSession,passphraseState:null==e?void 0:e.payload.passphraseState,deviceId:null==e?void 0:e.payload.deviceId});let Yr,Jr,Zr,Qr,ei=[];const ti=[],ri=new Map;let ii=1;const ni={};let si={passphraseState:void 0};function oi(e){if(!Jr)throw fe.TypedError(le.DeviceListNotInitialized);let t;const r=Jr.allDevices();if(e.connectId)t=Jr.getDevice(e.connectId);else if(1===r.length)[t]=r;else if(r.length>1)throw fe.TypedError(le.SelectDevice);if(!t)throw fe.TypedError(le.DeviceNotFound);return t.deviceConnector=Zr,t}function ai(e){if(!e.connectId&&!Jr)throw fe.TypedError(le.DeviceListNotInitialized);if(!e.connectId)return oi(e);let t;return ri.has(e.connectId)?t=ri.get(e.connectId):(t=yr.fromDescriptor({id:e.connectId}),ri.set(e.connectId,t)),t.deviceConnector=Zr,t}const ui=(e,t)=>We(void 0,void 0,void 0,(function*(){let r=0;const i=e.payload&&e.payload.retryCount||5,n=e.payload&&e.payload.pollIntervalTime||1e3,s=e.payload&&e.payload.timeout||1e4;let o=null;Xr.debug(`EnsureConnected function start, MAX_RETRY_COUNT=${i}, POLL_INTERVAL_TIME=${n} `);const a=(i=n)=>We(void 0,void 0,void 0,(function*(){return new $e(((n,u)=>We(void 0,void 0,void 0,(function*(){if(!ni[t])return Xr.debug("EnsureConnected function stop, polling id: ",t),void u(fe.TypedError(le.PollingStop));o&&clearTimeout(o),o=setTimeout((()=>{u(fe.TypedError(le.PollingTimeout))}),s),r+=1,Xr.debug("EnsureConnected function try count: ",r," poll interval time: ",i);try{yield function(e){return We(this,void 0,void 0,(function*(){"react-native"===qt.getSettings("env")&&e.connectId?yield sr.configure():(Jr||(Jr=new gr,yield sr.configure(),Jr.connector=Zr),yield Jr.getDeviceLists(e.connectId,Kr(e)))}))}(e)}catch(e){if(Xr.debug("device list error: ",e),[le.BridgeNotInstalled,le.BridgeTimeoutError].includes(e.errorCode))return Jr=void 0,void u(e);e.errorCode===le.TransportNotConfigured&&(yield sr.configure())}const d=qt.getSettings("env");let l;try{if(l="react-native"===d?ai(e):oi(e),l)return o&&clearTimeout(o),"react-native"===d&&(yield l.acquire(),yield l.initialize(Kr(e))),void n(l)}catch(e){if(Xr.debug("device error: ",e),[le.BlePermissionError,le.BleLocationError,le.BleDeviceNotBonded,le.BleCharacteristicNotifyError,le.BleWriteCharacteristicError,le.BleAlreadyConnected].includes(e.errorCode))return void u(e)}return r>5?(o&&clearTimeout(o),Xr.debug("EnsureConnected get to max try count, will return: ",r),void u(fe.TypedError(le.DeviceNotFound))):setTimeout((()=>n(a(1.5*i))),i)}))))}));return ni[t]=!0,a()})),di=(e,t)=>{if(e.useDevicePassphraseState){if(!0===(null==t?void 0:t.passphrase_protection)&&!e.payload.passphraseState)throw tr.clearDeviceCache(e.payload.connectId),fe.TypedError(le.DeviceOpenedPassphrase);if(!1===(null==t?void 0:t.passphrase_protection)&&e.payload.passphraseState)throw tr.clearDeviceCache(e.payload.connectId),fe.TypedError(le.DeviceNotOpenedPassphrase)}},li=()=>{ei=[],Xr.debug("Cleanup...")},pi=e=>{e.removeListener(Kt,yi),e.removeListener(Xt,gi),e.removeListener(Yt,vi),e.removeListener(Jt,mi),tr.emitter.removeListener(Wt,hi)},ci=()=>{_i(Ut("ui-close_window"))},hi=e=>{const t="react-native"===qt.getSettings("env")?e:e.toMessageObject();_i(Zt(Wt,{device:t}))},fi=e=>{const t="react-native"===qt.getSettings("env")?e:e.toMessageObject();_i(Zt(Vt,{device:t}))},yi=(...[e,t,r])=>We(void 0,void 0,void 0,(function*(){Xr.debug("onDevicePinHandler");const i=bi(zt,e);_i(Ut(jt,{device:e.toMessageObject(),type:t}));const n=yield i.promise;r(null,n.payload)})),gi=(...[e,t])=>{_i(Zt(Xt,Object.assign(Object.assign({},t),{device:e.toMessageObject()}))),"ButtonRequest_PinEntry"===t.code?_i(Ut(jt,{device:e.toMessageObject(),type:"ButtonRequest_PinEntry"})):_i(Ut("ui-button",{device:e.toMessageObject()}))},mi=(...[e,t])=>{_i(Zt(Jt,Object.assign({},t)))},vi=(...[e])=>{_i(Ut("ui-request_passphrase_on_device",{device:e.toMessageObject(),passphraseState:e.passphraseState}))},_i=e=>{Yr.emit(Lt,e)},bi=(e,t)=>{const r=ue(e,t);return ei.push(r),r};class Ti extends Ke.exports{handleMessage(e){var t,r,i,n;return We(this,void 0,void 0,(function*(){switch(e.type){case zt:{const t=(o=e.type,ei.find((e=>e.id===o)));t&&(t.resolve(e),s=t,ei=ei.filter((e=>e!==s)));break}case"ui-bluetooth_permission":case"ui-location_permission":_i(e);break;case Ht:{const s=yield(e=>We(void 0,void 0,void 0,(function*(){var t;if(!e.id||!e.payload||e.type!==Ht)return $e.reject(fe.TypedError("on call: message.id or message.payload is missing"));let r,i;try{r=function(e){const{method:t}=e.payload;if("string"!=typeof t)throw fe.TypedError(le.CallMethodInvalidParameter,"Method is not set");const r=Gr[t];if(r)return new r(e);throw fe.TypedError(le.CallMethodInvalidParameter,`Method ${t} is not set`)}(e),r.connector=Zr,r.postMessage=_i,r.init()}catch(e){return $e.reject(e)}if(tr.emitter.on(Wt,hi),!r.useDevice)try{const e=yield r.run();return Gt(r.responseID,!0,e)}catch(e){return Gt(r.responseID,!1,{error:e})}ti.push(r),ti.length>1&&Xr.debug("should cancel the previous method execution: ",ti.map((e=>e.name)));const n=si.passphraseState!==r.payload.passphraseState;let s;si={passphraseState:r.payload.passphraseState},(n||r.payload.initSession)&&(Xr.debug("passphrase state change, clear device cache"),tr.clearDeviceCache(r.payload.connectId)),ni[ii]&&(ni[ii]=!1),ii+=1;try{s=yield ui(r,ii)}catch(e){return Gt(r.responseID,!1,{error:e})}Xr.debug("Call API - setDevice: ",s.mainId),null===(t=r.setDevice)||void 0===t||t.call(r,s),s.on(Kt,yi),s.on(Xt,gi),s.on(Yt,vi),s.on(Jt,mi);try{const e=()=>We(void 0,void 0,void 0,(function*(){const e=vt(s.features),t=(n=s.features)&&"object"==typeof n?"1"===n.model?"model_mini":"model_touch":"model_mini";var n;const o=r.getVersionRange()[e],a=r.getVersionRange()[t],u=null!=o?o:a;if(u&&s.features){const e=Tt(s.features).join(".");if(Be().valid(u.min)&&Be().lt(e,u.min))return $e.reject(fe.TypedError(le.CallMethodNeedUpgradeFirmware,`Device firmware version is too low, please update to ${u.min}`,{current:e,require:u.min}));if(u.max&&Be().valid(u.max)&&Be().gte(e,u.max))return $e.reject(fe.TypedError(le.CallMethodDeprecated,`Device firmware version is too high, this method has been deprecated in ${u.max}`,{current:e,deprecated:u.max}))}const d=s.hasUnexpectedMode(r.allowDeviceMode,r.requireDeviceMode);if(d)return"ui-device_not_in_bootloader_mode"===d?$e.reject(fe.TypedError(le.DeviceUnexpectedBootloaderMode)):$e.reject(fe.TypedError(le.DeviceUnexpectedMode,d));if(r.deviceId&&r.checkDeviceId&&!s.checkDeviceId(r.deviceId))return $e.reject(fe.TypedError(le.DeviceCheckDeviceIdError));if(r.checkFirmwareRelease(),r.checkDeviceSupportFeature(),Jr&&(yield sr.reconfigure(s.getFirmwareVersion())),di(r,s.features),s.hasUsePassphrase()&&r.useDevicePassphraseState){const e=(e=>{if(!e)return{support:!1};const t=vt(e);if("touch"===t||"pro"===t)return{support:!0};const r=Tt(e).join(".");return{support:Be().gte(r,"2.4.0"),require:"2.4.0"}})(s.features);if(!e.support)return $e.reject(fe.TypedError(le.DeviceNotSupportPassphrase,`Device not support passphrase, please update to ${e.require}`,{require:e.require}));const t=yield s.checkPassphraseState();if(di(r,s.features),t)return tr.clearDeviceCache(r.payload.connectId),$e.reject(fe.TypedError(le.DeviceCheckPassphraseStateError))}try{yield r.checkSafetyLevelOnTestNet()}catch(e){const t=e instanceof de?e:fe.TypedError(le.RuntimeError,"open safety check failed.");return i=Gt(r.responseID,!1,{error:t}),void(null==Qr||Qr.resolve(i))}try{const e=yield r.run();Xr.debug("Call API - Inner Method Run: "),i=Gt(r.responseID,!0,e),null==Qr||Qr.resolve(i)}catch(e){Xr.debug("Call API - Inner Method Run Error: ",e),i=Gt(r.responseID,!1,{error:e}),null==Qr||Qr.resolve(i)}}));Xr.debug("Call API - Device Run: ",s.mainId);const t=Object.assign({keepSession:r.payload.keepSession},Kr(r));Qr=ue((()=>s.run(e,t)));try{return yield Qr.promise}catch(e){return Xr.debug("Device Run Error: ",e),Gt(r.responseID,!1,{error:e})}}catch(e){i=Gt(r.responseID,!1,{error:e}),null==Qr||Qr.reject(fe.TypedError(le.CallMethodError,e.message)),Xr.debug("Call API - Run Error: ",e)}finally{i&&r&&r.dispose();const e=r.responseID?ti.findIndex((e=>e.responseID===r.responseID)):-1;e>-1&&(ti.splice(e,1),Xr.debug("Remove the finished method from the queue: ",ti.map((e=>e.name)))),ci(),li(),pi(s)}})))(e),{success:o,payload:a}=s;return o?s:Object.assign(Object.assign({},s),{payload:Object.assign(Object.assign({},a),{connectId:null!==(r=null===(t=e.payload)||void 0===t?void 0:t.connectId)&&void 0!==r?r:"",deviceId:null!==(n=null===(i=e.payload)||void 0===i?void 0:i.deviceId)&&void 0!==n?n:""})})}case"iframe-cancel":(e=>{const t=qt.getSettings("env");try{if(e){let r;r="react-native"===t?ai({connectId:e}):oi({connectId:e}),null==r||r.interruptionFromUser()}}catch(e){Xr.error("Cancel API Error: ",e)}li(),ci()})(e.payload.connectId)}var s,o;return $e.resolve(e)}))}dispose(){}}const Ei=e=>{if("string"!=typeof e)return"unknown";if(0===e.indexOf("file://"))return"file://";const t=e.match(/^.+\:\/\/[^\/]+/);return Array.isArray(t)&&t.length>0?t[0]:"unknown"};var wi=__webpack_require__(7408);function Si(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout((()=>{throw e}))}}class Ai extends wi{emit(e,...t){return super.emit(e,...t)}addListener(e,t){return super.addListener(e,t),this}on(e,t){return super.on(e,t),this}once(e,t){return super.once(e,t),this}removeListener(e,t){return super.removeListener(e,t),this}off(e,t){return super.off(e,t),this}removeAllListeners(e){return super.removeAllListeners(e),this}setMaxListeners(e){return super.setMaxListeners(e),this}getMaxListeners(){return super.getMaxListeners()}listeners(e){return super.listeners(e)}rawListeners(e){return super.rawListeners(e)}listenerCount(e){return super.listenerCount(e)}prependListener(e,t){return super.prependListener(e,t),this}prependOnceListener(e,t){return super.prependOnceListener(e,t),this}eventNames(){return super.eventNames()}}class Ri extends Ai{emit(e,...t){let r="error"===e;const i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;const r=new Error("Unhandled error."+(e?` (${e.message})`:""));throw r.context=e,r}const n=i[e];if(void 0===n)return!1;if("function"==typeof n)Si(n,this,t);else{const e=n.length,r=function(e){const t=e.length,r=new Array(t);for(let i=0;i<t;i+=1)r[i]=e[i];return r}(n);for(let i=0;i<e;i+=1)Si(r[i],this,t)}return!0}}var Oi=__webpack_require__(7030),Ii=__webpack_require__(5505),xi=__webpack_require__(1378),Ci=__webpack_require__(6139).Promise,Mi=function(e,t,r,i){return new(r||(r=Ci))((function(n,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((i=i.apply(e,t||[])).next())}))};const ki="$$ONEKEY_DEBUG_LOGGER";var Ni=__webpack_require__(6139).Promise,Di=__webpack_require__(4406),Pi=function(e,t,r,i){return new(r||(r=Ni))((function(n,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((i=i.apply(e,t||[])).next())}))};const qi=ki,Li={formatArgs:function(e){if(e[0]=`${(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")}+${Li.humanize(this.diff)}`,!this.useColors)return;const t=`color: ${this.color}`;e.splice(1,0,t,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r+=1,"%c"===e&&(i=r))})),e.splice(i,0,t)},save:function(e){return Pi(this,void 0,void 0,(function*(){try{e?yield Li.storage.setItem(qi,e):yield Li.storage.removeItem(qi)}catch(e){console.error("debug logger storage error",e)}}))},load:function(){return Pi(this,void 0,void 0,(function*(){let e;try{e=yield Li.storage.getItem(qi)}catch(e){console.error("debug logger storage error",e)}return!e&&void 0!==Di&&"env"in Di&&(e=Di.env.DEBUG),e}))},useColors:function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}};Li.storage=function(){try{return"undefined"!=typeof global&&global.$$onekeyAppStorage?global.$$onekeyAppStorage:"undefined"!=typeof window&&window.localStorage?window.localStorage:(console.warn("debugLogger init warning, neither `global.$$onekeyAppStorage` nor `window.localStorage` found."),{getItem(){return Pi(this,void 0,void 0,(function*(){return""}))},setItem(){return Pi(this,void 0,void 0,(function*(){}))},removeItem(){return Pi(this,void 0,void 0,(function*(){}))}})}catch(e){console.error("debug logger storage error",e)}}(),Li.humanize=xi,Li.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),Li.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],Li.log=(...e)=>{console.debug?console.debug(...e):console.log&&console.log(...e)};const Bi=Li;var Fi=__webpack_require__(6139).Promise;const ji=function(){return e=this,t=void 0,i=function*(){return function(e){return Mi(this,void 0,void 0,(function*(){function t(e){let i,n,s,o=null;function a(...e){if(!a.enabled)return;const r=a,n=Number(new Date),s=n-(i||n);r.diff=s,r.prev=i,r.curr=n,i=n,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((i,n)=>{if("%%"===i)return"%";o++;const s=t.formatters[n];if("function"==typeof s){const t=e[o];i=s.call(r,t),e.splice(o,1),o--}return i})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(n!==t.namespaces&&(n=t.namespaces,s=t.enabled(e)),s),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){const i=t(this.namespace+(void 0===r?":":r)+e);return i.log=this.log,i}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>`-${e}`))].join(",");return t.enable(""),e},t.enable=function(e){return Mi(this,void 0,void 0,(function*(){let r;yield t.save(e),t.namespaces=e,t.names=[],t.skips=[];const i=("string"==typeof e?e:"").split(/[\s,]+/),n=i.length;for(r=0;r<n;r++)i[r]&&("-"===(e=i[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp(`^${e.substr(1)}$`)):t.names.push(new RegExp(`^${e}$`)))}))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,i;for(r=0,i=t.skips.length;r<i;r++)if(t.skips[r].test(e))return!1;for(r=0,i=t.names.length;r<i;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=xi,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={j(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: ${e.message}`}}},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]};const n=yield t.load();return yield t.enable(n),t}))}(Bi)},new((r=void 0)||(r=Fi))((function(n,s){function o(e){try{u(i.next(e))}catch(e){s(e)}}function a(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((i=i.apply(e,t||[])).next())}));var e,t,r,i};function Ui(...e){"undefined"!=typeof localStorage&&localStorage.getItem(ki)&&console.error(...e)}const Hi={_isFakeLogger:!0,log:(...e)=>{},warn:(...e)=>{},error:(...e)=>{},debug:(...e)=>{},info:(...e)=>{},trace:(...e)=>{}};var $i;!function(e){e.jsBridge="jsBridge",e.providerBase="providerBase",e.extInjected="extInjected",e.extContentScripts="extContentScripts",e.webview="webview",e.desktopInjected="desktopInjected",e.ethereum="ethereum"}($i||($i={}));class Gi extends Ri{constructor(){super(),this.jsBridge=(...e)=>null,this.providerBase=(...e)=>null,this.extInjected=(...e)=>null,this.extContentScripts=(...e)=>null,this.webview=(...e)=>null,this.desktopInjected=(...e)=>null,this.ethereum=(...e)=>null,this._debug={enable(e){}},this._externalLogger=Hi,this._createExternalLog=e=>(...t)=>{var r,i;return this.once("debugReady",(()=>{var r;null===(r=this[e])||void 0===r||r.call(this,...t)})),null===(i=null===(r=this._externalLogger)||void 0===r?void 0:r.log)||void 0===i?void 0:i.call(r,`${e} >>> `,...t)},this.initExternalLogInstances()}initExternalLogInstances(){Object.keys($i).forEach((e=>{this[e]=this._createExternalLog(e)}))}isDebugReady(){return this._debug&&"function"==typeof this._debug}_attachExternalLogger(e){e&&(this._externalLogger=e)}_createDebugInstance(e){}}new Gi;const zi=new class extends Gi{constructor(){super(),this._debugInstanceCreatedMap={},ji().then((e=>{this._debug=e,this.initDebugInstances(),this.emit("debugReady")}))}initDebugInstances(){this.isDebugReady()&&Object.keys($i).forEach((e=>{this[e]=this._debug(e)}))}_createDebugInstance(e){if(!this._debugInstanceCreatedMap[e]&&(this._debugInstanceCreatedMap[e]=!0,e&&this._debug&&"function"==typeof this._debug)){const t=this._debug(e),r=this[e];this[e]=(...e)=>{t(...e),r&&"function"==typeof r&&r(...e)}}}};var Wi,Vi;!function(e){e.RESPONSE="RESPONSE",e.REQUEST="REQUEST"}(Wi||(Wi={})),function(e){e.ethereum="ethereum",e.conflux="conflux",e.solana="solana",e.starcoin="starcoin",e.sollet="sollet",e.near="near",e.$private="$private",e.$hardware_sdk="$hardware_sdk"}(Vi||(Vi={}));var Xi=__webpack_require__(6920);class Ki extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return Xi(this.serialize(),Ji,2)}}class Yi extends Ki{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function Ji(e,t){if("[Circular]"!==t)return t}const Zi=4500,Qi={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Web3 provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4500:{standard:"",message:"The request by this Web3 provider is timeout."}};function en(e,t="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(e)){const t=e.toString();if(r=Qi,i=t,Object.prototype.hasOwnProperty.call(r,i))return Qi[t].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return"Unspecified server error."}var r,i;return t}en(-32603);const tn=e=>rn(Zi,e);function rn(e,t){const[r,i]=function(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(t);return new Yi(e,r||en(e),i)}var nn=__webpack_require__(6139).Promise;const sn="undefined"!=typeof window?window:global,on="message",an="error";class un extends Ri{constructor(e={}){var t,r;super(),this._requestPayloadCache={},this.isExtUi=!1,this.isInjected=!1,this.sendAsString=!0,this.globalOnMessageEnabled=!0,this.providersHub={},this.globalOnMessage=e=>{return t=this,r=void 0,n=function*(){try{if(this.config.receiveHandler&&this.globalOnMessageEnabled){const t=yield this.config.receiveHandler(e,this);e.id&&this.response({id:e.id,scope:e.scope,remoteId:e.remoteId,data:t})}}catch(t){e.id&&e.type===Wi.REQUEST&&this.responseError({id:e.id,scope:e.scope,remoteId:e.remoteId,error:t}),this.emit(an,t)}},new((i=void 0)||(i=nn))((function(e,s){function o(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(o,a)}u((n=n.apply(t,r||[])).next())}));var t,r,i,n},this.version="0.0.17",this.remoteInfo={origin:"",remoteId:""},this.callbacksExpireTimeout=6e5,this.debugLogger=zi,this.callbacks=[],this.callbackId=1,this.config=e,this.callbacksExpireTimeout=null!==(t=e.timeout)&&void 0!==t?t:this.callbacksExpireTimeout,this.debugLogger=e.debugLogger||zi,this.sendAsString=null!==(r=e.sendAsString)&&void 0!==r?r:this.sendAsString,this.config.receiveHandler&&this.on(on,this.globalOnMessage),this.on(an,(e=>{var t;Ui("JsBridge ERROR: ",e,{code:null===(t=e)||void 0===t?void 0:t.code})})),this.rejectExpiredCallbacks()}attachProviderInstance(e){var t;const r=e.providerName;r&&(this.providersHub[r]=null!==(t=this.providersHub[r])&&void 0!==t?t:[],this.providersHub[r].push(e))}createCallbackId(){return this.callbackId+=1,this.callbackId}createPayload(e,{resolve:t,reject:r}){const{id:i,type:n}=e;if(t&&r&&i&&n===Wi.REQUEST){if(this.callbacks[i])throw new Error(`JsBridge ERROR: callback exists, id=${i}`);this.callbacks[i]={id:i,resolve:t,reject:r,created:Date.now()}}if(e.error){const t=e.error;e.error=function(e){return{name:e.name,message:e.message,stack:e.stack,code:e.code,data:e.data,key:e.key,info:e.info,className:e.className}}(t)}return null==e||delete e.resolve,null==e||delete e.reject,e}send({type:e,data:t,error:r,id:i,remoteId:n,sync:s=!1,scope:o}){const a=(a,u)=>{var d,l,p;let c=i;s||e!==Wi.REQUEST||(c=this.createCallbackId());try{const i=this.createPayload({id:c,data:t,error:r,type:e,origin:(null===(d=null==sn?void 0:sn.location)||void 0===d?void 0:d.origin)||"",remoteId:n,scope:o},{resolve:a,reject:u});let s=i;this.sendAsString&&(s=JSON.stringify(i)),(null===(l=this.debugLogger.jsBridge)||void 0===l?void 0:l.enabled)&&i&&i.id&&i.type===Wi.REQUEST&&(this._requestPayloadCache[i.id]=i,i.id%100==0&&(this._requestPayloadCache={})),this.debugLogger.jsBridge("send",i,"\r\n ------\x3e ",i.data,"\r\n ------\x3e ",null===(p=i.data)||void 0===p?void 0:p.result),this.sendPayload(s)}catch(e){c?this.rejectCallback(c,e):this.emit(an,e)}};if(!s)return new nn(a);a()}rejectCallback(e,t){this.processCallback({method:"reject",id:e,error:t})}resolveCallback(e,t){this.processCallback({method:"resolve",id:e,data:t})}processCallback({method:e,id:t,data:r,error:i}){const n=this.callbacks[t];n&&("reject"===e&&(n.reject&&n.reject(i),this.emit(an,i)),"resolve"===e&&n.resolve&&n.resolve(r),this.clearCallbackCache(t))}rejectExpiredCallbacks(){if(!this.callbacksExpireTimeout)return;const e=Date.now();for(const t in this.callbacks){const r=this.callbacks[t];if(r&&r.created&&e-r.created>this.callbacksExpireTimeout){const e=tn();this.rejectCallback(t,e)}}setTimeout((()=>{this.rejectExpiredCallbacks()}),this.callbacksExpireTimeout)}clearCallbackCache(e){delete this.callbacks[e]}receive(e="",t){var r,i,n,s,o;let a={data:null};if(Oi(e)&&(a=e),Ii(e))try{a=JSON.parse(e)}catch(c){throw this.emit(an,c),new Error("JsBridge ERROR: JSON.parse payloadReceived failed")}if(a.origin=null==t?void 0:t.origin,a.internal=Boolean(null==t?void 0:t.internal),(null==t?void 0:t.internal)&&this.isExtUi&&function(e){const t=e;return Boolean(t.name)&&["onekey-provider-eth","onekey-provider-cfx","publicConfig"].includes(t.name)}(a))return;if(!a.origin&&!this.isInjected)throw Ui(null===(r=null==this?void 0:this.constructor)||void 0===r?void 0:r.name,"[payload.origin] is missing.",this),new Error("JsBridge ERROR: receive message [payload.origin] is required.");if(!a.internal&&!a.scope)throw new Error("JsBridge ERROR: receive message [payload.scope] is required for non-internal method call.");const u=null!==(n=this._requestPayloadCache[null!==(i=null==a?void 0:a.id)&&void 0!==i?i:""])&&void 0!==n?n:null;this.debugLogger.jsBridge("receive",a,{sender:t},"\r\n -----\x3e ",null!==(o=null===(s=a.data)||void 0===s?void 0:s.result)&&void 0!==o?o:a.data,"\r\n <----- ",null==u?void 0:u.data);const{type:d,id:l,data:p,error:c,origin:h,remoteId:f}=a;if(this.remoteInfo={origin:h,remoteId:f},d===Wi.RESPONSE){if(null==l)throw new Error("JsBridge ERROR: parameter [id] is required in JsBridge.receive() when REQUEST type message");if(this.callbacks[l])try{c?this.rejectCallback(l,c):this.resolveCallback(l,p)}catch(e){this.emit(an,e)}}else{if(d!==Wi.REQUEST)throw new Error(`JsBridge ERROR: payload type not support yet (type=${d||"undefined"})`);{const e=Object.assign(Object.assign({},a),{created:Date.now()});this.emit(on,e)}}}requestSync({data:e,scope:t,remoteId:r}){this.send({id:void 0,type:Wi.REQUEST,scope:t,data:e,remoteId:r,sync:!0})}request(e){const{data:t,remoteId:r,scope:i}=e;return void 0===t&&console.warn("JsBridge ERROR: data required. Call like `bridge.request({ data: {...} });`"),this.send({type:Wi.REQUEST,data:t,remoteId:r,sync:!1,scope:i})}response({id:e,data:t,remoteId:r,scope:i}){this.send({type:Wi.RESPONSE,data:t,id:e,remoteId:r,scope:i,sync:!0})}responseError({id:e,error:t,scope:r,remoteId:i}){this.send({type:Wi.RESPONSE,error:t,id:e,remoteId:i,scope:r,sync:!0})}}__webpack_require__(1049),__webpack_require__(6139).Promise,__webpack_require__(6139).Promise;let dn=!1;class ln extends un{constructor(e){var t;super(e),this.sendAsString=!1,this.isInjected=!0,this.bridgeConfig=e,this.targetOrigin=null!==(t=e.targetOrigin)&&void 0!==t?t:window.location.origin,function(e={}){dn||(dn=!0,window.addEventListener("message",(t=>{var r,i,n;const s=t.data,o=null===(r=e.bridge)||void 0===r?void 0:r.bridgeConfig;if(o&&s.channel===o.channel&&s.frameName===o.remoteFrameName){const t=s.payload,r=null!==(i=e.bridge)&&void 0!==i?i:null===(n=null===window||void 0===window?void 0:window.$onekey)||void 0===n?void 0:n.jsBridge;r&&r.receive(t)}}),!1))}({debugLogger:this.debugLogger,bridge:this,origin:this.targetOrigin})}sendPayload(e){const t={channel:this.bridgeConfig.channel,frameName:this.bridgeConfig.selfFrameName,payload:e,direction:""};this.bridgeConfig.remoteFrame.postMessage(t,this.targetOrigin)}}const pn="onekey-iframe",cn="onekey-host",hn="onekey-js-sdk",fn="$hardware_sdk";let yn,gn;const mn=kt(Ct.SendMessage),vn=async(e,t=!0)=>{const r=t?gn:yn;try{"LOG_EVENT"!==e.event&&mn.debug("request: ",e);const t=await(r?.request({scope:fn,data:{...e}}));return"LOG_EVENT"!==e.event&&mn.debug("response: ",t),t}catch(e){throw mn.error(e),fe.CreateErrorByMessage(e.message)}};let _n;const bn=kt(Ct.Iframe);window.addEventListener("message",(e=>{if(e.source===window||!e.data)return;const t=Bt(e);"iframe-init"===t.type&&async function(e){if(qt.getSettings("origin"))return;const t=((e={})=>{const t=Object.assign({},cr);let r;Object.prototype.hasOwnProperty.call(e,"debug")&&(t.debug=e.debug),e.isFrame&&(t.parentOrigin=e.parentOrigin),"string"==typeof e.connectSrc&&(t.connectSrc=e.connectSrc),"undefined"!=typeof window?r=window.ONEKEY_CONNECT_SRC:void 0!==__webpack_require__.g&&(r=__webpack_require__.g.ONEKEY_CONNECT_SRC),"string"==typeof r&&(t.connectSrc=(e=>{if("string"==typeof e)return e.match(/^https:\/\/([A-Za-z0-9\-_]+\.)*onekey\.so\//)||e.match(/^https?:\/\/localhost:[58][0-9]{3}\//),e})(r),t.debug=!0);const i=t.connectSrc||pr;return t.iframeSrc=`${i}iframe.html`,e.transportReconnect&&(t.transportReconnect=e.transportReconnect),e.lazyLoad&&(t.lazyLoad=e.lazyLoad),"string"==typeof e.env?t.env=e.env:t.env=(()=>{if("undefined"!=typeof chrome&&chrome.runtime&&void 0!==chrome.runtime.onConnect)return"webextension";if("undefined"!=typeof navigator){if("string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase())return"react-native";if(navigator.userAgent.toLowerCase().indexOf(" electron/")>-1)return"electron"}return"web"})(),e.timestamp&&(t.timestamp=e.timestamp),t})({...e.settings??{},isFrame:!0});t.origin=origin&&"null"!==origin?origin:e.settings.origin,bn.enabled=!!t.debug;try{const e="webusb"===t.env?qe:Re;_n=await((e,t)=>We(void 0,void 0,void 0,(function*(){try{try{yield qt.load(e),(e=>{sr.setTransport(e)})(t)}catch(e){Xr.error("DataManager.load error")}return r=qt.getSettings("debug"),Object.keys(Ot).forEach((e=>{Ot[e].enabled=!!r})),"react-native"!==qt.getSettings("env")&&(At=_i),Yr=new Ti,Zr=new Vr,tr.emitter.on(Vt,fi),Yr}catch(e){Xr.error("core init",e)}var r})))(t,e),_n?.on(Lt,(e=>vn(e,!1)))}catch(e){return(e=>{let t={error:e.message,code:e.code};return e instanceof de&&(t={error:e.message,code:e.errorCode}),{success:!1,payload:t}})(e)}(e=>{const t=new ln(e);e.isHost?gn=t:yn=t})({isHost:!1,remoteFrame:window.parent,remoteFrameName:cn,selfFrameName:pn,channel:hn,targetOrigin:Ei(t.parentOrigin),receiveHandler:async e=>{const t=Bt(e);bn.debug("Frame Bridge Receive message: ",t);const r=await(_n?.handleMessage(t));return bn.debug("Frame Bridge response data: ",r),r}}),await vn({event:Ft,type:"iframe-init-bridge",payload:{}},!1)}(t.payload??{})}),!1)})()})();
3
+ //# sourceMappingURL=iframe.aa7e2f1305ebf0ba8c60.js.map