@onekeyfe/cross-inpage-provider-injected 2.2.69 → 2.2.71

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,2 @@
1
+ /*! For license information please see injectedWebEmbed.js.LICENSE.txt */
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,()=>(()=>{var e={1169(e){var t=1e3,n=60*t,r=60*n,o=24*r,i=7*o;function a(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,c){c=c||{};var u,s,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var a=/^(-?(?:\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(a){var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*c;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*o;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}(e);if("number"===l&&isFinite(e))return c.long?(u=e,(s=Math.abs(u))>=o?a(u,s,o,"day"):s>=r?a(u,s,r,"hour"):s>=n?a(u,s,n,"minute"):s>=t?a(u,s,t,"second"):u+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=r?Math.round(e/r)+"h":i>=n?Math.round(e/n)+"m":i>=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))}},7351(e){e.exports=a,a.default=a,a.stable=l,a.stableStringify=l;var t="[...]",n="[Circular]",r=[],o=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function a(e,t,n,a){var c;void 0===a&&(a=i()),u(e,"",0,[],void 0,0,a);try{c=0===o.length?JSON.stringify(e,t,n):JSON.stringify(e,d(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var s=r.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return c}function c(e,t,n,i){var a=Object.getOwnPropertyDescriptor(i,n);void 0!==a.get?a.configurable?(Object.defineProperty(i,n,{value:e}),r.push([i,n,t,a])):o.push([t,n,e]):(i[n]=e,r.push([i,n,t]))}function u(e,r,o,i,a,s,l){var f;if(s+=1,"object"==typeof e&&null!==e){for(f=0;f<i.length;f++)if(i[f]===e)return void c(n,e,r,a);if(void 0!==l.depthLimit&&s>l.depthLimit)return void c(t,e,r,a);if(void 0!==l.edgesLimit&&o+1>l.edgesLimit)return void c(t,e,r,a);if(i.push(e),Array.isArray(e))for(f=0;f<e.length;f++)u(e[f],f,f,i,e,s,l);else{var d=Object.keys(e);for(f=0;f<d.length;f++){var p=d[f];u(e[p],p,f,i,e,s,l)}}i.pop()}}function s(e,t){return e<t?-1:e>t?1:0}function l(e,t,n,a){void 0===a&&(a=i());var c,u=f(e,"",0,[],void 0,0,a)||e;try{c=0===o.length?JSON.stringify(u,t,n):JSON.stringify(u,d(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var s=r.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return c}function f(e,o,i,a,u,l,d){var p;if(l+=1,"object"==typeof e&&null!==e){for(p=0;p<a.length;p++)if(a[p]===e)return void c(n,e,o,u);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==d.depthLimit&&l>d.depthLimit)return void c(t,e,o,u);if(void 0!==d.edgesLimit&&i+1>d.edgesLimit)return void c(t,e,o,u);if(a.push(e),Array.isArray(e))for(p=0;p<e.length;p++)f(e[p],p,p,a,e,l,d);else{var y={},v=Object.keys(e).sort(s);for(p=0;p<v.length;p++){var h=v[p];f(e[h],h,p,a,e,l,d),y[h]=e[h]}if(void 0===u)return y;r.push([u,o,e]),u[o]=y}a.pop()}}function d(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(o.length>0)for(var r=0;r<o.length;r++){var i=o[r];if(i[1]===t&&i[0]===n){n=i[2],o.splice(r,1);break}}return e.call(this,t,n)}}},7668(e){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var n,r="object"===("undefined"==typeof Reflect?"undefined":t(Reflect))?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise(function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}h(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&h(e,"error",t,{once:!0})}(e,o)})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+t(e))}function s(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var o,i,a,c;if(u(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=s(e))>0&&a.length>o&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return e}function f(){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 d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=f.bind(r);return o.listener=n,r.wrapFn=o,o}function p(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):v(o,o.length)}function y(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function v(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function h(e,n,r,o){if("function"==typeof e.on)o.once?e.once(n,r):e.on(n,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+t(e));e.addEventListener(n,function t(i){o.once&&e.removeEventListener(n,t),r(i)})}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),a.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},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(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},a.prototype.getMaxListeners=function(){return s(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var s=u.length,l=v(u,s);for(n=0;n<s;++n)o(l[n],this,t)}return!0},a.prototype.addListener=function(e,t){return l(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return l(this,e,t,!0)},a.prototype.once=function(e,t){return u(t),this.on(e,d(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,d(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,o,i,a;if(u(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},a.prototype.listenerCount=y,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=function(e){return null==e},t="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;var r="object"==typeof self&&self&&self.Object===Object&&self;const o=(t||r||Function("return this")()).Symbol;var i=Object.prototype,a=i.hasOwnProperty,c=i.toString,u=o?o.toStringTag:void 0;var s=Object.prototype.toString;var l=o?o.toStringTag:void 0;const f=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":l&&l in Object(e)?function(e){var t=a.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var o=c.call(e);return r&&(t?e[u]=n:delete e[u]),o}(e):function(e){return s.call(e)}(e)},d=Array.isArray,p=function(e){return null!=e&&"object"==typeof e},y=(v=Object.getPrototypeOf,h=Object,function(e){return v(h(e))});var v,h,b=Function.prototype,g=Object.prototype,m=b.toString,w=g.hasOwnProperty,j=m.call(Object);var O=n(7668);function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,x(r.key),r)}}function S(e,t,n){return t&&C(e.prototype,t),n&&C(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function x(e){var t=function(e){if("object"!=k(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==k(t)?t:t+""}function _(e,t,n){return t=L(t),function(e,t){if(t&&("object"==k(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,P()?Reflect.construct(t,n||[],L(e).constructor):t.apply(e,n))}function P(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(P=function(){return!!e})()}function I(e,t,n,r){var o=T(L(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function T(){return T="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=L(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},T.apply(null,arguments)}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},L(e)}function R(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}function M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},M(e,t)}function N(e,t,n){var r;try{Reflect.apply(e,t,n)}catch(e){var o=setTimeout(function(){throw e});null===(r=null==o?void 0:o.unref)||void 0===r||r.call(o)}}var A=function(e){function t(){return E(this,t),_(this,t,arguments)}return R(t,e),S(t,[{key:"emit",value:function(e){var t="error"===e,n=this._events;if(void 0!==n)t=t&&void 0===n.error;else if(!t)return!1;for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];if(t){var a;if(o.length>0&&(a=o[0]),a instanceof Error)throw a;var c=new Error("Unhandled error.".concat(a?" (".concat(a.message,")"):""));throw c.context=a,c}var u=n[e];if(void 0===u)return!1;if("function"==typeof u)N(u,this,o);else for(var s=u.length,l=function(e){for(var t=e.length,n=new Array(t),r=0;r<t;r+=1)n[r]=e[r];return n}(u),f=0;f<s;f+=1)N(l[f],this,o);return!0}}])}(function(e){function t(){return E(this,t),_(this,t,arguments)}return R(t,e),S(t,[{key:"emit",value:function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return I(t,"emit",this,3)([e].concat(r))}},{key:"addListener",value:function(e,n){return I(t,"addListener",this,3)([e,n]),this}},{key:"on",value:function(e,n){return I(t,"on",this,3)([e,n]),this}},{key:"once",value:function(e,n){return I(t,"once",this,3)([e,n]),this}},{key:"removeListener",value:function(e,n){return I(t,"removeListener",this,3)([e,n]),this}},{key:"off",value:function(e,n){return I(t,"off",this,3)([e,n]),this}},{key:"removeAllListeners",value:function(e){return I(t,"removeAllListeners",this,3)([e]),this}},{key:"setMaxListeners",value:function(e){return I(t,"setMaxListeners",this,3)([e]),this}},{key:"getMaxListeners",value:function(){return I(t,"getMaxListeners",this,3)([])}},{key:"listeners",value:function(e){return I(t,"listeners",this,3)([e])}},{key:"rawListeners",value:function(e){return I(t,"rawListeners",this,3)([e])}},{key:"listenerCount",value:function(e){return I(t,"listenerCount",this,3)([e])}},{key:"prependListener",value:function(e,n){return I(t,"prependListener",this,3)([e,n]),this}},{key:"prependOnceListener",value:function(e,n){return I(t,"prependOnceListener",this,3)([e,n]),this}},{key:"eventNames",value:function(){return I(t,"eventNames",this,3)([])}}])}(n.n(O)())),F="$$ONEKEY_DEBUG_LOGGER",D="onekey_wallet_info_local_key_v5",G=n(1169),B=n.n(G);function z(e){return function(e){if(Array.isArray(e))return J(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return J(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function $(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return U(s,"_invoke",function(n,r,o){var i,c,u,s=0,l=o||[],f=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,c=0,u=e,d.n=n,a}};function p(n,r){for(c=n,u=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],p=d.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(c=0,d.v=r,d.n=i[1]):p<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(t=c<2?e:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(t){i=e,c=1,u=t}finally{s=1}}return{value:t,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(U(t={},r,function(){return this}),t),f=s.prototype=c.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,U(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=s,U(f,"constructor",s),U(s,"constructor",u),u.displayName="GeneratorFunction",U(s,o,"GeneratorFunction"),U(f),U(f,o,"Generator"),U(f,r,function(){return this}),U(f,"toString",function(){return"[object Generator]"}),($=function(){return{w:i,m:d}})()}function U(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}U=function(e,t,n,r){function i(t,n){U(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},U(e,t,n,r)}var q=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,c)}u((r=r.apply(e,t||[])).next())})};const W=function(e){return q(this,void 0,void 0,$().m(function t(){var n,r,o,i,a,c,u,s,l,f;return $().w(function(t){for(;;)switch(t.n){case 0:return l=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`.")},s=function(e){return e instanceof Error?e.stack||e.message:e},u=function(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")},c=function(e){if("*"===e[e.length-1])return!0;var t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},a=function(){var e=[].concat(z(r.names.map(u)),z(r.skips.map(u).map(function(e){return"-".concat(e)}))).join(",");return r.enable(""),e},i=function(e){return q(this,void 0,void 0,$().m(function t(){var n,o,i;return $().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,r.save(e);case 1:r.namespaces=e,r.names=[],r.skips=[],o=("string"==typeof e?e:"").split(/[\s,]+/),i=o.length,n=0;case 2:if(!(n<i)){t.n=5;break}if(o[n]){t.n=3;break}return t.a(3,4);case 3:"-"===(e=o[n].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^".concat(e.substr(1),"$"))):r.names.push(new RegExp("^".concat(e,"$")));case 4:n++,t.n=2;break;case 5:return t.a(2)}},t)}))},o=function(e,t){var n=r(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n},r=function(e){var t,n,i,a=null;function c(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];if(c.enabled){var i=c,a=Number(new Date),u=a-(t||a);i.diff=u,i.prev=t,i.curr=a,t=a,n[0]=r.coerce(n[0]),"string"!=typeof n[0]&&n.unshift("%O");var s=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,function(e,t){if("%%"===e)return"%";s++;var o=r.formatters[t];if("function"==typeof o){var a=n[s];e=o.call(i,a),n.splice(s,1),s--}return e}),r.formatArgs.call(i,n),(i.log||r.log).apply(i,n)}}return c.namespace=e,c.useColors=r.useColors(),c.color=r.selectColor(e),c.extend=o,c.destroy=r.destroy,Object.defineProperty(c,"enabled",{enumerable:!0,configurable:!1,get:function(){return null!==a?a:(n!==r.namespaces&&(n=r.namespaces,i=r.enabled(e)),i)},set:function(e){a=e}}),"function"==typeof r.init&&r.init(c),c},n=function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return r.colors[Math.abs(t)%r.colors.length]},r.debug=r,r.default=r,r.coerce=s,r.disable=a,r.enable=i,r.enabled=c,r.humanize=B(),r.destroy=l,Object.keys(e).forEach(function(t){r[t]=e[t]}),r.names=[],r.skips=[],r.formatters={j:function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: ".concat(e.message)}}},r.selectColor=n,t.n=1,r.load();case 1:return f=t.v,t.n=2,r.enable(f);case 2:return t.a(2,r)}},t)}))};function Q(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return H(s,"_invoke",function(n,r,o){var i,c,u,s=0,l=o||[],f=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,c=0,u=e,d.n=n,a}};function p(n,r){for(c=n,u=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],p=d.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(c=0,d.v=r,d.n=i[1]):p<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(t=c<2?e:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(t){i=e,c=1,u=t}finally{s=1}}return{value:t,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(H(t={},r,function(){return this}),t),f=s.prototype=c.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,H(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=s,H(f,"constructor",s),H(s,"constructor",u),u.displayName="GeneratorFunction",H(s,o,"GeneratorFunction"),H(f),H(f,o,"Generator"),H(f,r,function(){return this}),H(f,"toString",function(){return"[object Generator]"}),(Q=function(){return{w:i,m:d}})()}function H(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}H=function(e,t,n,r){function i(t,n){H(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},H(e,t,n,r)}var Z,Y=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,c)}u((r=r.apply(e,t||[])).next())})},K=F,V={formatArgs:function(e){if(e[0]="".concat((this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" "),"+").concat(V.humanize(this.diff)),this.useColors){var t="color: ".concat(this.color);e.splice(1,0,t,"color: inherit");var n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(n+=1,"%c"===e&&(r=n))}),e.splice(r,0,t)}},save:function(t){return Y(this,void 0,void 0,Q().m(function n(){var r;return Q().w(function(n){for(;;)switch(n.p=n.n){case 0:if(n.p=0,!t){n.n=2;break}return n.n=1,V.storage.setItem(K,t);case 1:n.n=5;break;case 2:if(!e(t)){n.n=4;break}return n.n=3,V.storage.removeItem(K);case 3:n.n=5;break;case 4:return n.n=5,V.storage.setItem(K,"");case 5:n.n=7;break;case 6:n.p=6,r=n.v,console.error("debug logger storage error",r);case 7:return n.a(2)}},n,null,[[0,6]])}))},load:function(){return Y(this,void 0,void 0,Q().m(function e(){var t,n;return Q().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,V.storage.getItem(K);case 1:t=e.v,e.n=3;break;case 2:e.p=2,n=e.v,console.error("debug logger storage error",n);case 3:return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),e.a(2,t)}},e,null,[[0,2]])}))},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+)/))}};V.storage=function(){try{return void 0!==n.g&&n.g.$$onekeyAppStorage?n.g.$$onekeyAppStorage:"undefined"!=typeof window&&window.localStorage?window.localStorage:(console.warn("debugLogger init warning, neither `global.$$onekeyAppStorage` nor `window.localStorage` found."),{getItem:function(){return Y(this,void 0,void 0,Q().m(function e(){return Q().w(function(e){for(;;)if(0===e.n)return e.a(2,"")},e)}))},setItem:function(){return Y(this,void 0,void 0,Q().m(function e(){return Q().w(function(e){for(;;)if(0===e.n)return e.a(2)},e)}))},removeItem:function(){return Y(this,void 0,void 0,Q().m(function e(){return Q().w(function(e){for(;;)if(0===e.n)return e.a(2)},e)}))}})}catch(e){console.error("debug logger storage error",e)}}(),V.humanize=B(),V.destroy=(Z=!1,function(){Z||(Z=!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`."))}),V.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"],V.log=function(){var e;if(console.debug)(e=console).debug.apply(e,arguments);else if(console.log){var t;(t=console).log.apply(t,arguments)}};const X=V;function ee(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return te(s,"_invoke",function(n,r,o){var i,c,u,s=0,l=o||[],f=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,c=0,u=e,d.n=n,a}};function p(n,r){for(c=n,u=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],p=d.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(c=0,d.v=r,d.n=i[1]):p<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(t=c<2?e:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(t){i=e,c=1,u=t}finally{s=1}}return{value:t,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(te(t={},r,function(){return this}),t),f=s.prototype=c.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,te(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=s,te(f,"constructor",s),te(s,"constructor",u),u.displayName="GeneratorFunction",te(s,o,"GeneratorFunction"),te(f),te(f,o,"Generator"),te(f,r,function(){return this}),te(f,"toString",function(){return"[object Generator]"}),(ee=function(){return{w:i,m:d}})()}function te(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}te=function(e,t,n,r){function i(t,n){te(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},te(e,t,n,r)}const ne=function(){return e=this,t=void 0,n=void 0,r=ee().m(function e(){return ee().w(function(e){for(;;)if(0===e.n)return e.a(2,W(X))},e)}),new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,c)}u((r=r.apply(e,t||[])).next())});var e,t,n,r};function re(e){return re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},re(e)}function oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ie(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ce(r.key),r)}}function ae(e,t,n){return t&&ie(e.prototype,t),n&&ie(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ce(e){var t=function(e){if("object"!=re(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=re(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==re(t)?t:t+""}function ue(e,t,n){return t=le(t),function(e,t){if(t&&("object"==re(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,se()?Reflect.construct(t,n||[],le(e).constructor):t.apply(e,n))}function se(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(se=function(){return!!e})()}function le(e){return le=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},le(e)}function fe(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&de(e,t)}function de(e,t){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},de(e,t)}function pe(){var e;"undefined"!=typeof localStorage&&localStorage.getItem(F)&&(e=console).error.apply(e,arguments)}var ye,ve={_isFakeLogger:!0,log:function(){},warn:function(){},error:function(){},debug:function(){},info:function(){},trace:function(){}};!function(e){e.jsBridge="jsBridge",e.providerBase="providerBase",e.extInjected="extInjected",e.extContentScripts="extContentScripts",e.webview="webview",e.desktopInjected="desktopInjected",e.ethereum="ethereum"}(ye||(ye={}));var he=function(e){function t(){var e;return oe(this,t),(e=ue(this,t)).jsBridge=function(){return null},e.providerBase=function(){return null},e.extInjected=function(){return null},e.extContentScripts=function(){return null},e.webview=function(){return null},e.desktopInjected=function(){return null},e.ethereum=function(){return null},e.isFaked=!0,e._debug={enable:function(e){}},e._externalLogger=ve,e._createExternalLog=function(t){return function(){for(var n,r,o,i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];return e.once("debugReady",function(){var n,r;e.isFaked||null===(n=e[t])||void 0===n||(r=n).call.apply(r,[e].concat(a))}),null===(o=null===(r=e._externalLogger)||void 0===r?void 0:r.log)||void 0===o?void 0:(n=o).call.apply(n,[r,"".concat(t," >>> ")].concat(a))}},e.initExternalLogInstances(),e.setMaxListeners(9999),e}return fe(t,e),ae(t,[{key:"initExternalLogInstances",value:function(){var e=this;Object.keys(ye).forEach(function(t){e[t]=e._createExternalLog(t)})}},{key:"isDebugReady",value:function(){return this._debug&&"function"==typeof this._debug}},{key:"_attachExternalLogger",value:function(e){e&&(this._externalLogger=e)}},{key:"_createDebugInstance",value:function(e){}}])}(A),be=function(e){function t(){var e;return oe(this,t),(e=ue(this,t)).isFaked=!1,e._debugInstanceCreatedMap={},ne().then(function(t){e._debug=t,e.isFaked=!1,e.initDebugInstances(),e.emit("debugReady")}),e}return fe(t,e),ae(t,[{key:"initDebugInstances",value:function(){var e=this;this.isDebugReady()&&Object.keys(ye).forEach(function(t){e[t]=e._debug(t)})}},{key:"_createDebugInstance",value:function(e){if(!this._debugInstanceCreatedMap[e]&&(this._debugInstanceCreatedMap[e]=!0,e&&this._debug&&"function"==typeof this._debug)){var t=this._debug(e),n=this[e];this[e]=function(){t.apply(void 0,arguments),n&&"function"==typeof n&&n.apply(void 0,arguments)}}}}])}(he),ge=new he,me=new be,we=n(7351),je=n.n(we);function Oe(e){return Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Oe(e)}function ke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Se(r.key),r)}}function Ce(e,t,n){return t&&Ee(e.prototype,t),n&&Ee(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Se(e){var t=function(e){if("object"!=Oe(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Oe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Oe(t)?t:t+""}function xe(e,t,n){return t=Le(t),function(e,t){if(t&&("object"==Oe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ie()?Reflect.construct(t,n||[],Le(e).constructor):t.apply(e,n))}function _e(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Te(e,t)}function Pe(e){var t="function"==typeof Map?new Map:void 0;return Pe=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(Ie())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&Te(o,n.prototype),o}(e,arguments,Le(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Te(n,e)},Pe(e)}function Ie(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ie=function(){return!!e})()}function Te(e,t){return Te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Te(e,t)}function Le(e){return Le=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Le(e)}var Re=function(e){function t(e,n,r){if(ke(this,t),!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');return xe(this,t,[e,n,r])}return _e(t,e),Ce(t)}(function(e){function t(e,n,r){var o;if(ke(this,t),!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!n||"string"!=typeof n)throw new Error('"message" must be a nonempty string.');return(o=xe(this,t,[n])).code=e,void 0!==r&&(o.data=r),o}return _e(t,e),Ce(t,[{key:"serialize",value:function(){var e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),e}},{key:"toString",value:function(){return je()(this.serialize(),Me,2)}}])}(Pe(Error)));function Me(e,t){if("[Circular]"!==t)return t}var Ne=4500,Ae={"-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."}},Fe=(De(-32603),"Unspecified server error.");function De(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Unspecified error message. This is a bug, please report it.";if(Number.isInteger(e)){var o=e.toString();if(t=Ae,n=o,Object.prototype.hasOwnProperty.call(t,n))return Ae[o].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return Fe}return r}function Ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Be(e){return Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Be(e)}var ze,Je,$e=function(e){return Ue(Ne,e)};function Ue(e,t){var n,r,o=(n=function(e){if(e){if("string"==typeof e)return[e];if("object"===Be(e)&&!Array.isArray(e)){var t=e.message,n=e.data;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,n]}}return[]}(t),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(n,r)||function(e,t){if(e){if("string"==typeof e)return Ge(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ge(e,t):void 0}}(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=o[0],a=o[1];return new Re(e,i||De(e),a)}!function(e){e.RESPONSE="RESPONSE",e.REQUEST="REQUEST"}(ze||(ze={})),function(e){e.btc="btc",e.ethereum="ethereum",e.conflux="conflux",e.tron="tron",e.solana="solana",e.sollet="sollet",e.near="near",e.aptos="aptos",e.martian="martian",e.algo="algo",e.sui="sui",e.cardano="cardano",e.alephium="alephium",e.cosmos="cosmos",e.polkadot="polkadot",e.scdo="scdo",e.ton="ton",e.webln="webln",e.nostr="nostr",e.bfc="bfc",e.neo="neo",e.stellar="stellar",e.$private="$private",e.$hardware_sdk="$hardware_sdk",e.$walletConnect="$walletConnect"}(Je||(Je={}));const qe="2.2.71";function We(e){return We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},We(e)}function Qe(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return He(s,"_invoke",function(n,r,o){var i,c,u,s=0,l=o||[],f=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,c=0,u=e,d.n=n,a}};function p(n,r){for(c=n,u=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],p=d.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(c=0,d.v=r,d.n=i[1]):p<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(t=c<2?e:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(t){i=e,c=1,u=t}finally{s=1}}return{value:t,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(He(t={},r,function(){return this}),t),f=s.prototype=c.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,He(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=s,He(f,"constructor",s),He(s,"constructor",u),u.displayName="GeneratorFunction",He(s,o,"GeneratorFunction"),He(f),He(f,o,"Generator"),He(f,r,function(){return this}),He(f,"toString",function(){return"[object Generator]"}),(Qe=function(){return{w:i,m:d}})()}function He(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}He=function(e,t,n,r){function i(t,n){He(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},He(e,t,n,r)}function Ze(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ye(r.key),r)}}function Ye(e){var t=function(e){if("object"!=We(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=We(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==We(t)?t:t+""}function Ke(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ke=function(){return!!e})()}function Ve(e){return Ve=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ve(e)}function Xe(e,t){return Xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xe(e,t)}console.log;var et="undefined"!=typeof window?window:n.g,tt="message",nt="error",rt=function(t){function n(){var e,t,r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=function(e,t,n){return t=Ve(t),function(e,t){if(t&&("object"==We(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ke()?Reflect.construct(t,n||[],Ve(e).constructor):t.apply(e,n))}(this,n)).callbacks=[],e.callbacksCount=0,e.callbackId=1,e._requestPayloadCache={},e.isExtUi=!1,e.isInjected=!1,e.sendAsString=!0,e.globalOnMessageEnabled=!0,e.providersHub={},e.callbacksExpireTimeout=6e5,e.debugLogger=me,e.globalOnMessage=function(t){return n=e,r=void 0,o=void 0,i=Qe().m(function e(){var n,r;return Qe().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!this.config.receiveHandler||!this.globalOnMessageEnabled){e.n=2;break}return e.n=1,this.config.receiveHandler(t,this);case 1:n=e.v,t.id&&this.response({id:t.id,scope:t.scope,remoteId:t.remoteId,data:n,peerOrigin:t.origin});case 2:e.n=4;break;case 3:e.p=3,r=e.v,t.id&&t.type===ze.REQUEST&&this.responseError({id:t.id,scope:t.scope,remoteId:t.remoteId,error:r,peerOrigin:t.origin}),this.emit(nt,r);case 4:return e.p=4,e.f(4);case 5:return e.a(2)}},e,this,[[0,3,4,5]])}),new(o||(o=Promise))(function(e,t){function a(e){try{u(i.next(e))}catch(e){t(e)}}function c(e){try{u(i.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o(function(e){e(n)})).then(a,c)}u((i=i.apply(n,r||[])).next())});var n,r,o,i},e.version=qe,e.remoteInfo={origin:"",remoteId:""},e.config=o,e.callbacksExpireTimeout=null!==(t=o.timeout)&&void 0!==t?t:e.callbacksExpireTimeout,e.debugLogger=o.debugLogger||me,e.sendAsString=null!==(r=o.sendAsString)&&void 0!==r?r:e.sendAsString,e.config.receiveHandler&&e.on(tt,e.globalOnMessage),e.on(nt,function(e){pe("JsBridge ERROR: ",e,{code:null==e?void 0:e.code})}),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xe(e,t)}(n,t),r=n,o=[{key:"attachProviderInstance",value:function(e){var t,n=e.providerName;n&&(this.providersHub[n]=null!==(t=this.providersHub[n])&&void 0!==t?t:[],this.providersHub[n].push(e))}},{key:"createCallbackId",value:function(){return this.callbackId+=1,this.callbackId}},{key:"createPayload",value:function(e,t){var n=t.resolve,r=t.reject,o=e.id,i=e.type;if(n&&r&&o&&i===ze.REQUEST){if(this.callbacks[o])throw new Error("JsBridge ERROR: callback exists, id=".concat(o));this.callbacks[o]={id:o,resolve:n,reject:r,created:Date.now()},this.callbacksCount+=1,this.startCallbackExpireTimerLoop()}if(e.error){var a=e.error;e.error=function(e){return{constructorName:e.constructorName,name:e.name,message:e.message,stack:e.stack,code:e.code,data:e.data,key:e.key,info:e.info,className:e.className,autoToast:e.autoToast,requestId:e.requestId,httpStatusCode:e.httpStatusCode,reconnect:e.reconnect,payload:e.payload}}(a)}return null==e||delete e.resolve,null==e||delete e.reject,e}},{key:"send",value:function(e){var t=this,n=e.type,r=e.data,o=e.error,i=e.id,a=e.remoteId,c=e.sync,u=void 0!==c&&c,s=e.scope,l=e.peerOrigin,f=function(e,c){var f,d,p,y=i;u||n!==ze.REQUEST||(y=t.createCallbackId());try{var v=t.createPayload({id:y,data:r,error:o,type:n,origin:(null===(f=null==et?void 0:et.location)||void 0===f?void 0:f.origin)||"",peerOrigin:l,remoteId:a,scope:s},{resolve:e,reject:c}),h=v;t.sendAsString&&(h=JSON.stringify(v)),(null===(d=t.debugLogger.jsBridge)||void 0===d?void 0:d.enabled)&&v&&v.id&&v.type===ze.REQUEST&&(t._requestPayloadCache[v.id]=v,v.id%100==0&&(t._requestPayloadCache={})),t.debugLogger.jsBridge("send",v,"\r\n ------\x3e ",v.data,"\r\n ------\x3e ",null===(p=v.data)||void 0===p?void 0:p.result),t.sendPayload(h)}catch(e){y?t.rejectCallback(y,e):t.emit(nt,e)}};if(!u)return new Promise(f);f()}},{key:"rejectCallback",value:function(e,t){this.processCallback({method:"reject",id:e,error:t})}},{key:"resolveCallback",value:function(e,t){this.processCallback({method:"resolve",id:e,data:t})}},{key:"processCallback",value:function(e){var t=e.method,n=e.id,r=e.data,o=e.error,i=this.callbacks[n];i&&("reject"===t&&(i.reject&&i.reject(o),this.emit(nt,o)),"resolve"===t&&i.resolve&&i.resolve(r),this.clearCallbackCache(n))}},{key:"rejectExpiredCallbacks",value:function(){if(this.callbacksExpireTimeout&&0!==this.callbacksCount)for(var e=Date.now(),t=this.callbacks.length,n=0;n<t;n++){var r=this.callbacks[n];if(r&&r.created&&e-r.created>this.callbacksExpireTimeout){var o=$e();this.rejectCallback(n,o)}}}},{key:"stopCallbackExpireTimerLoop",value:function(){this.callbacksExpireTimer&&(clearTimeout(this.callbacksExpireTimer),this.callbacksExpireTimer=void 0)}},{key:"startCallbackExpireTimerLoop",value:function(){var e,t,n=this;this.callbacksExpireTimeout&&0!==this.callbacksCount&&!this.callbacksExpireTimer&&(this.callbacksExpireTimer=setTimeout(function(){n.callbacksExpireTimer=void 0,n.rejectExpiredCallbacks(),n.startCallbackExpireTimerLoop()},this.callbacksExpireTimeout),null===(t=null===(e=this.callbacksExpireTimer)||void 0===e?void 0:e.unref)||void 0===t||t.call(e))}},{key:"clearCallbackCache",value:function(e){this.callbacks[e]&&(this.callbacksCount-=1),delete this.callbacks[e],this.callbacksCount<=0&&(this.callbacksCount=0,this.stopCallbackExpireTimerLoop())}},{key:"receive",value:function(){var t,n,r,o,i,a,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",u=arguments.length>1?arguments[1]:void 0,s={data:null};if(e(c)||""===c)throw new Error("JsBridge ERROR: receive() payload is empty");if(function(e){if(!p(e)||"[object Object]"!=f(e))return!1;var t=y(e);if(null===t)return!0;var n=w.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&m.call(n)==j}(c)&&(s=c),"string"==typeof(a=c)||!d(a)&&p(a)&&"[object String]"==f(a))try{s=JSON.parse(c)}catch(O){throw this.emit(nt,O),new Error("JsBridge ERROR: JSON.parse payloadReceived failed")}if(s.origin=null==u?void 0:u.origin,s.internal=Boolean(null==u?void 0:u.internal),!((null==u?void 0:u.internal)&&this.isExtUi&&function(e){var t=e;return Boolean(t.name)&&["onekey-provider-eth","onekey-provider-cfx","publicConfig"].includes(t.name)}(s))){if(!s.origin&&!this.isInjected)throw pe(null===(t=null==this?void 0:this.constructor)||void 0===t?void 0:t.name,"[payload.origin] is missing.",this),new Error("JsBridge ERROR: receive message [payload.origin] is required.");if(!s.internal&&!s.scope)throw new Error("JsBridge ERROR: receive message [payload.scope] is required for non-internal method call.");var l=null!==(r=this._requestPayloadCache[null!==(n=null==s?void 0:s.id)&&void 0!==n?n:""])&&void 0!==r?r:null;this.debugLogger.jsBridge("receive",s,{sender:u},"\r\n -----\x3e ",null!==(i=null===(o=s.data)||void 0===o?void 0:o.result)&&void 0!==i?i:s.data,"\r\n <----- ",null==l?void 0:l.data);var v=s,h=v.type,b=v.id,g=v.data,O=v.error,k=v.origin,E=v.remoteId;if(this.remoteInfo={origin:k,remoteId:E},h===ze.RESPONSE){if(null==b)throw new Error("JsBridge ERROR: parameter [id] is required in JsBridge.receive() when REQUEST type message");if(this.callbacks[b])try{if(O){var C=function(e){if(e instanceof Error)return e;for(var t=e,n=new Error(t.message),r=0,o=Object.keys(t);r<o.length;r++){var i=o[r];n[i]=t[i]}return n}(O);this.rejectCallback(b,C)}else this.resolveCallback(b,g)}catch(e){this.emit(nt,e)}}else{if(h!==ze.REQUEST)throw new Error("JsBridge ERROR: payload type not support yet (type=".concat(h||"undefined",")"));var S=Object.assign(Object.assign({},s),{created:Date.now()});this.emit(tt,S)}}}},{key:"requestSync",value:function(e){var t=e.data,n=e.scope,r=e.remoteId;this.send({id:void 0,type:ze.REQUEST,scope:n,data:t,remoteId:r,sync:!0})}},{key:"request",value:function(e){var t=e.data,n=e.remoteId,r=e.scope;return void 0===t&&console.warn("JsBridge ERROR: data required. Call like `bridge.request({ data: {...} });`"),this.send({type:ze.REQUEST,data:t,remoteId:n,sync:!1,scope:r})}},{key:"response",value:function(e){var t=e.id,n=e.data,r=e.remoteId,o=e.scope,i=e.peerOrigin;this.send({type:ze.RESPONSE,data:n,id:t,remoteId:r,scope:o,sync:!0,peerOrigin:i})}},{key:"responseError",value:function(e){var t=e.id,n=e.error,r=e.scope,o=e.remoteId,i=e.peerOrigin;this.send({type:ze.RESPONSE,error:n,id:t,remoteId:o,scope:r,sync:!0,peerOrigin:i})}}],o&&Ze(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,o}(A);const ot=function(e){if(!function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}(e))return!1;var t=f(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};function it(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return at(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?at(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function at(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ct(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return ut(s,"_invoke",function(n,r,o){var i,c,u,s=0,l=o||[],f=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,c=0,u=e,d.n=n,a}};function p(n,r){for(c=n,u=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],p=d.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(c=0,d.v=r,d.n=i[1]):p<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(t=c<2?e:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(t){i=e,c=1,u=t}finally{s=1}}return{value:t,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(ut(t={},r,function(){return this}),t),f=s.prototype=c.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,ut(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=s,ut(f,"constructor",s),ut(s,"constructor",u),u.displayName="GeneratorFunction",ut(s,o,"GeneratorFunction"),ut(f),ut(f,o,"Generator"),ut(f,r,function(){return this}),ut(f,"toString",function(){return"[object Generator]"}),(ct=function(){return{w:i,m:d}})()}function ut(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ut=function(e,t,n,r){function i(t,n){ut(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},ut(e,t,n,r)}var st=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,c)}u((r=r.apply(e,t||[])).next())})};function lt(e){return new Promise(function(t,n){try{var r=document.createElement("img");r.onload=function(){return t(!0)},r.onerror=function(){return t(!1)},r.src=e}catch(e){n(e)}})}function ft(e){var t=e.document,n=t.querySelector('head > meta[property="og:site_name"]');if(n)return n.content;var r=t.querySelector('head > meta[name="title"]');return r?r.content:t.title&&t.title.length>0?t.title:window.location.hostname}function dt(e){return st(this,void 0,void 0,ct().m(function t(){var n,r,o,i,a,c,u;return ct().w(function(t){for(;;)switch(t.p=t.n){case 0:n=e.document,r=n.querySelectorAll('head > link[rel~="icon"]'),o=it(r),t.p=1,o.s();case 2:if((i=o.n()).done){t.n=6;break}if(a=i.value,!(c=a)){t.n=4;break}return t.n=3,lt(a.href);case 3:c=t.v;case 4:if(!c){t.n=5;break}return t.a(2,a.href);case 5:t.n=2;break;case 6:t.n=8;break;case 7:t.p=7,u=t.v,o.e(u);case 8:return t.p=8,o.f(),t.f(8);case 9:return t.a(2,null)}},t,null,[[1,7,8,9]])}))}const pt={getSiteMetadata:function(){return st(this,void 0,void 0,ct().m(function e(){var t,n;return ct().w(function(e){for(;;)switch(e.n){case 0:return t=ft(window),e.n=1,dt(window);case 1:return n=e.v,e.a(2,{name:t,icon:n})}},e)}))},getSiteIcon:dt,getSiteName:ft,imgExists:lt};function yt(e){return yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yt(e)}function vt(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return ht(s,"_invoke",function(n,r,o){var i,c,u,s=0,l=o||[],f=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,c=0,u=e,d.n=n,a}};function p(n,r){for(c=n,u=r,t=0;!f&&s&&!o&&t<l.length;t++){var o,i=l[t],p=d.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(c=0,d.v=r,d.n=i[1]):p<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(t=c<2?e:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(t){i=e,c=1,u=t}finally{s=1}}return{value:t,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(ht(t={},r,function(){return this}),t),f=s.prototype=c.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,ht(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=s,ht(f,"constructor",s),ht(s,"constructor",u),u.displayName="GeneratorFunction",ht(s,o,"GeneratorFunction"),ht(f),ht(f,o,"Generator"),ht(f,r,function(){return this}),ht(f,"toString",function(){return"[object Generator]"}),(vt=function(){return{w:i,m:d}})()}function ht(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ht=function(e,t,n,r){function i(t,n){ht(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},ht(e,t,n,r)}function bt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,gt(r.key),r)}}function gt(e){var t=function(e){if("object"!=yt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=yt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==yt(t)?t:t+""}function mt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(mt=function(){return!!e})()}function wt(e){return wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wt(e)}function jt(e,t){return jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jt(e,t)}var Ot,kt=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,c)}u((r=r.apply(e,t||[])).next())})},Et=function(e){function t(e){var n,r,o,i,a;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=wt(t),function(e,t){if(t&&("object"==yt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,mt()?Reflect.construct(t,n||[],wt(e).constructor):t.apply(e,n))}(this,t)).version=qe,n.isOneKey=!0,n.debugLogger=ge,n.logger=ve,!e.bridge)throw new Error("ProviderBase init error: bridge required.");n.config=e,n.bridge=e.bridge,n.logger=e.logger||ve,n.debugLogger=(null===(r=n.bridge)||void 0===r?void 0:r.debugLogger)||ge,null===(i=null===(o=n.bridge)||void 0===o?void 0:o.debugLogger)||void 0===i||i._attachExternalLogger(n.logger);var c=setTimeout(function(){n.bridge.attachProviderInstance(n)},0);return null===(a=null==c?void 0:c.unref)||void 0===a||a.call(c),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jt(e,t)}(t,e),n=t,r=[{key:"configDebugLogger",value:function(e){try{if(!e||!this.bridge.debugLogger)return;var t=this.bridge.debugLogger;(e.enabledKeys||[]).forEach(function(e){t._createDebugInstance(e)}),e.config&&t._debug.enable(e.config),window.$onekey=window.$onekey||{},window.$onekey.$debugLogger=t}catch(e){pe("configDebugLogger ERROR:",e)}}},{key:"getConnectWalletInfo",value:function(){return kt(this,arguments,void 0,function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).timeout,n=void 0===t?3e3:t;return vt().m(function t(){return vt().w(function(t){for(;;)if(0===t.n)return t.a(2,new Promise(function(t,r){return kt(e,void 0,void 0,vt().m(function e(){var r,o,i;return vt().w(function(e){for(;;)switch(e.p=e.n){case 0:return o=setTimeout(function(){console.error("getConnectWalletInfo timeout: ".concat(n)),t(null)},n),null===(r=null==o?void 0:o.unref)||void 0===r||r.call(o),e.p=1,e.n=2,this.bridgeRequest({method:"wallet_getConnectWalletInfo",params:[{time:Date.now()}]});case 2:if((i=e.v)&&(i.providerState=i.providerState||{}),i&&i.debugLoggerConfig&&this.configDebugLogger(i.debugLoggerConfig),i&&i.walletInfo){window.$onekey=window.$onekey||{},window.$onekey.$walletInfo=i.walletInfo;try{localStorage.setItem(D,JSON.stringify(i.walletInfo))}catch(e){console.error(e)}}i?t(i):(console.error("getConnectWalletInfo error: result=null"),t(null)),e.n=4;break;case 3:e.p=3,pe("getConnectWalletInfo: ERROR",e.v),t(null);case 4:return e.p=4,clearTimeout(o),e.f(4);case 5:return e.a(2)}},e,this,[[1,3,4,5]])}))}))},t)})()})}},{key:"bridgeRequest",value:function(e,t){return kt(this,void 0,void 0,vt().m(function n(){var r,o,i,a,c,u,s,l,f;return vt().w(function(n){for(;;)switch(n.p=n.n){case 0:return c=!1,t&&ot(t)&&(c=!0),n.p=1,u={data:null!=e?e:{},scope:this.providerName},this.debugLogger.providerBase("bridgeRequest:",u,"\r\n -----\x3e ",u.data),n.n=2,this.bridge.request(u);case 2:return(s=n.v)&&(s.id=null!==(o=null!==(r=null==e?void 0:e.id)&&void 0!==r?r:s.id)&&void 0!==o?o:void 0,s.jsonrpc=null!==(a=null!==(i=null==e?void 0:e.jsonrpc)&&void 0!==i?i:s.jsonrpc)&&void 0!==a?a:"2.0"),l=s?s.result:void 0,t&&c&&t(null,s),this.debugLogger.providerBase("bridgeRequest RETURN:",{req:u,res:s},"\r\n -----\x3e ",u.data,"\r\n -----\x3e ",l),n.a(2,l);case 3:throw n.p=3,f=n.v,t&&c&&t(f),f;case 4:return n.a(2)}},n,this,[[1,3]])}))}},{key:"sendSiteMetadataDomReady",value:function(){var e=this;if("complete"===document.readyState)this.sendSiteMetadata();else{var t=function(){e.sendSiteMetadata(),window.removeEventListener("DOMContentLoaded",t)};window.addEventListener("DOMContentLoaded",t)}}},{key:"sendSiteMetadata",value:function(){return kt(this,void 0,void 0,vt().m(function e(){var t;return vt().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,pt.getSiteMetadata();case 1:return t=e.v,e.n=2,this.bridgeRequest({method:"wallet_sendSiteMetadata",params:t});case 2:return e.a(2,e.v)}},e,this)}))}},{key:"isConnectionStatusChanged",value:function(e){return void 0===this.connectionStatus||e!==this.connectionStatus}},{key:"isAccountsChanged",value:function(){throw new Error("isAccountsChanged not implemented")}},{key:"isNetworkChanged",value:function(){throw new Error("isNetworkChanged not implemented")}}],r&&bt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(A);function Ct(e){return Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ct(e)}function St(e){return function(e){if(Array.isArray(e))return xt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return xt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xt(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Pt(r.key),r)}}function Pt(e){var t=function(e){if("object"!=Ct(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ct(t)?t:t+""}!function(e){e[e.DEBUG=0]="DEBUG",e[e.LOG=1]="LOG",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR"}(Ot||(Ot={}));var It,Tt=new(function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.module=t;var n=function(){if("undefined"!=typeof localStorage){var e=localStorage.getItem(F);if(null!==e)try{var t=parseInt(e,10);if(t in Ot)return t}catch(e){return}}}();this.level=null!=n?n:Ot.DEBUG,this.level=null!=n?n:Ot.ERROR},t=[{key:"shouldLog",value:function(e){return e>=this.level}},{key:"formatMessage",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.module?["[".concat(this.module,"]:")].concat(t):t}},{key:"debug",value:function(){var e;this.shouldLog(Ot.DEBUG)&&(e=console).debug.apply(e,St(this.formatMessage.apply(this,arguments)))}},{key:"log",value:function(){var e;this.shouldLog(Ot.LOG)&&(e=console).log.apply(e,St(this.formatMessage.apply(this,arguments)))}},{key:"warn",value:function(){var e;this.shouldLog(Ot.WARN)&&(e=console).warn.apply(e,St(this.formatMessage.apply(this,arguments)))}},{key:"error",value:function(){var e;this.shouldLog(Ot.ERROR)&&(e=console).error.apply(e,St(this.formatMessage.apply(this,arguments)))}}],t&&_t(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());function Lt(e,t){var n=(null==t?void 0:t.providersHub)||window.$onekey,r=e.scope,o=e.data;if(r){var i=[];if((i=i.concat(n[r]).filter(Boolean))&&i.length){if(i.forEach(function(t){t&&t.emit&&(t.emit("message_low_level",o),t.emit("message_payload_raw",e))}),"$private"===r){var a=i[0];if(a&&a.webembedReceiveHandler)return a.webembedReceiveHandler(e,t)}}else pe("[".concat(r,"] provider is NOT injected to document or bridge."),o)}else pe("providerName (scope) is required in injectedProviderReceiveHandler.")}function Rt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}!function(e){e.btc="unisat",e.sui="suiWallet",e.polkadot="polkadot-js"}(It||(It={}));var Mt=["connectionStatus"],Nt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiByeD0iNi42NjY2NyIgZmlsbD0iIzQ0RDYyQyIvPgo8cGF0aCBkPSJNMTcuNDQ1NyA2Ljc4MzJMMTIuOTk0NSA2Ljc4MzJMMTIuMjEzNiA5LjE0NDQ2SDE0LjY4NTlMMTQuNjg1OSAxNC4xMTgySDE3LjQ0NTdWNi43ODMyWiIgZmlsbD0iYmxhY2siLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMS4wNzY0IDIwLjEzNzhDMjEuMDc2NCAyMi45NDEzIDE4LjgwMzcgMjUuMjE0MSAxNi4wMDAxIDI1LjIxNDFDMTMuMTk2NiAyNS4yMTQxIDEwLjkyMzggMjIuOTQxMyAxMC45MjM4IDIwLjEzNzhDMTAuOTIzOCAxNy4zMzQyIDEzLjE5NjYgMTUuMDYxNSAxNi4wMDAxIDE1LjA2MTVDMTguODAzNyAxNS4wNjE1IDIxLjA3NjQgMTcuMzM0MiAyMS4wNzY0IDIwLjEzNzhaTTE4Ljc3MTggMjAuMTM3OEMxOC43NzE4IDIxLjY2ODUgMTcuNTMwOSAyMi45MDk1IDE2LjAwMDEgMjIuOTA5NUMxNC40NjkzIDIyLjkwOTUgMTMuMjI4NCAyMS42Njg1IDEzLjIyODQgMjAuMTM3OEMxMy4yMjg0IDE4LjYwNyAxNC40NjkzIDE3LjM2NiAxNi4wMDAxIDE3LjM2NkMxNy41MzA5IDE3LjM2NiAxOC43NzE4IDE4LjYwNyAxOC43NzE4IDIwLjEzNzhaIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4K";function At(e){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},At(e)}function Ft(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Dt(r.key),r)}}function Dt(e){var t=function(e){if("object"!=At(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=At(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==At(t)?t:t+""}var Gt=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.settings=t,this.element=document.createElement("div"),this.element.className="onekey-alert-message ".concat(this.settings.customClass?this.settings.customClass:""),this.eventHandlers={},this.insert(),this.settings.duration&&this.initiateTimer(),this.bindEvents()},t=[{key:"insert",value:function(){var e;if(this.element){var t=document.createElement("div");if(t.className="onekey-alert-message-body",t.innerHTML=this.settings.content,null===(e=this.element)||void 0===e||e.appendChild(t),this.settings.dismissible){this.dismissButton=document.createElement("div"),this.dismissButton.className="onekey-alert-message-dismiss";var n=document.createElement("img");n.setAttribute("src","data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='25' viewBox='0 0 24 25' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.29289 4.79289C4.68342 4.40237 5.31658 4.40237 5.70711 4.79289L12 11.0858L18.2929 4.79289C18.6834 4.40237 19.3166 4.40237 19.7071 4.79289C20.0976 5.18342 20.0976 5.81658 19.7071 6.20711L13.4142 12.5L19.7071 18.7929C20.0976 19.1834 20.0976 19.8166 19.7071 20.2071C19.3166 20.5976 18.6834 20.5976 18.2929 20.2071L12 13.9142L5.70711 20.2071C5.31658 20.5976 4.68342 20.5976 4.29289 20.2071C3.90237 19.8166 3.90237 19.1834 4.29289 18.7929L10.5858 12.5L4.29289 6.20711C3.90237 5.81658 3.90237 5.18342 4.29289 4.79289Z' fill='black'/%3E%3C/svg%3E"),n.className="onekey-alert-close-icon",this.dismissButton.appendChild(n),this.element.appendChild(this.dismissButton)}this.settings.hostElement.appendChild(this.element)}}},{key:"bindEvents",value:function(){var e,t=this;this.eventHandlers.dismiss=function(){return t.dismiss()},null===(e=this.dismissButton)||void 0===e||e.addEventListener("click",this.eventHandlers.dismiss,!1)}},{key:"initiateTimer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.settings.duration;this.dismissalTimer=setTimeout(function(){e.dismiss()},t)}},{key:"cancelTimer",value:function(){this.dismissalTimer&&(clearTimeout(this.dismissalTimer),this.dismissalTimer=null)}},{key:"dismiss",value:function(){this.element&&(this.element.classList.add(".onekey-alert-message-hidden"),this.settings.hostElement.removeChild(this.element),this.element=null,this.settings.onDismiss&&this.settings.onDismiss(),this.cancelTimer())}}],t&&Ft(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),Bt=null,zt=null;const Jt=function(e){var t=e||{},n=t.content,r=void 0===n?"":n,o=t.duration,i=void 0===o?0:o,a=t.triggerElement,c=void 0===a?"×":a,u=t.customClass,s=void 0===u?"":u,l=t.dismissible,f=void 0!==l&&l;if(!Bt){var d=document.createElement("div");d.id="onekey-notification-center";var p=d.attachShadow({mode:"open"});(Bt=document.createElement("div")).classList.add("onekey-alert-container"),(zt=document.createElement("style")).innerHTML="\n .onekey-alert-container {\n position: fixed;\n z-index: 99999;\n top: 60px;\n right: 42px;\n }\n .onekey-alert-message {\n min-width: 230px;\n min-height: 44px;\n background: #FFFFFF;\n border: 1px solid rgba(0, 0, 0, 0.08);\n box-sizing: border-box;\n box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.10);\n border-radius: 8px;\n display: flex;\n align-items: center;\n\n font-family: 'Arial', sans-serif;\n font-style: normal;\n font-weight: 500;\n font-size: 13px;\n line-height: 19px;\n color: rgba(0, 0, 0, 0.88);\n\n padding: 16px;\n gap: 8px;\n\n opacity: 1;\n }\n .onekey-alert-message + .onekey-alert-message {\n margin-top: 30px;\n }\n .onekey-alert-message-body {\n display: flex;\n align-items: center;\n color: #13141A;\n }\n .onekey-alert-message-hidden {\n opacity: 0;\n transition: 0.3s;\n }\n\n .onekey-alert-message-dismiss {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 32px;\n height: 32px;\n cursor: pointer;\n }\n .onekey-alert-close-icon-close {\n flex-shrink: 0;\n width: 24px;\n height: 24px;\n }\n .onekey-strong {\n font-weight: bold;\n color: #13141A;\n }\n .onekey-alert-default-wallet {\n border-radius: 8px;\n height: 71px;\n\n font-size: 12px;\n line-height: 16px;\n color: #13141A;\n }\n\n .onekey-alert-network-changed {\n border-radius: 8px;\n height: 71px;\n\n font-size: 12px;\n line-height: 16px;\n color: #13141A;\n }\n ",p.appendChild(zt),p.appendChild(Bt),document.body.appendChild(d)}return new Gt({content:r,duration:i,triggerElement:c,hostElement:Bt,customClass:s,dismissible:f,onDismiss:function(){if(Bt&&!(null==Bt?void 0:Bt.hasChildNodes())){var e=Bt.getRootNode();e instanceof ShadowRoot?document.body.removeChild(e.host):document.body.removeChild(e),zt=null,Bt=null}}})};var $t,Ut,qt=function(){var e,t;if(window.self===window.top)return!1;try{return window.self.location.origin===(null===(t=null===(e=window.top)||void 0===e?void 0:e.location)||void 0===t?void 0:t.origin)}catch(e){return!1}};function Wt(e){return Wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wt(e)}function Qt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ht(r.key),r)}}function Ht(e){var t=function(e){if("object"!=Wt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Wt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Wt(t)?t:t+""}function Zt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Zt=function(){return!!e})()}function Yt(e){return Yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yt(e)}function Kt(e,t){return Kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kt(e,t)}var Vt=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Yt(t),function(e,t){if(t&&("object"==Wt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Zt()?Reflect.construct(t,n||[],Yt(e).constructor):t.apply(e,n))}(this,t,arguments)).sendAsString=!0,e.isInjected=!0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kt(e,t)}(t,e),n=t,(r=[{key:"sendPayload",value:function(e){window.ReactNativeWebView&&window.ReactNativeWebView.postMessage(e)}}])&&Qt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(rt);function Xt(e){return Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xt(e)}function en(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tn(r.key),r)}}function tn(e){var t=function(e){if("object"!=Xt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Xt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xt(t)?t:t+""}function nn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(nn=function(){return!!e})()}function rn(e){return rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rn(e)}function on(e,t){return on=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},on(e,t)}var an=D,cn="wallet_events_floating_icon_changed",un=function(e){function t(e){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=rn(t),function(e,t){if(t&&("object"==Xt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,nn()?Reflect.construct(t,n||[],rn(e).constructor):t.apply(e,n))}(this,t,[e]))._listeners=[],n.providerName=Je.$private;try{n.getConnectWalletInfo()}catch(e){console.error(e)}try{n.sendSiteMetadataDomReady()}catch(e){console.error(e)}return n._registerEvents(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&on(e,t)}(t,e),n=t,r=[{key:"_registerEvents",value:function(){var e=this;try{var t=localStorage.getItem(an),n=t?JSON.parse(t):null;this.on("message_low_level",function(t){var r=t.method,o=t.params;if("wallet_events_ext_switch_changed"===r){if(!n||n&&n.platformEnv.isExtension)try{localStorage.setItem(an,JSON.stringify(o)),e.notifyDefaultWalletChanged(o)}catch(e){console.error(e)}}else"wallet_events_dapp_network_changed"===r?e.notifyNetworkChanged(o):r===cn&&(console.log("wallet_events_floating_icon_changed ===>>>> : ",o),e._listeners.forEach(function(e){e.type===r&&e.callback(o)}))})}catch(e){console.error(e)}}},{key:"onNotifyFloatingIconChanged",value:function(e){this._listeners.push({type:cn,callback:e})}},{key:"request",value:function(e){return this.bridgeRequest(e)}},{key:"notifyDefaultWalletChanged",value:function(e){var t=!!e.isDefaultWallet;t&&(t=!e.excludedDappList.some(function(e){return e.startsWith(window.location.origin)})),function(e){if(!qt()){$t&&($t.dismiss(),$t=null);var t=e?"OneKey is your default wallet now.":"OneKey Default Canceled";$t=Jt({dismissible:!0,duration:0,customClass:"onekey-alert-default-wallet",content:'<div style="display: flex; align-items: center; gap: 8px;">\n <img style="width: 32px;" src="'.concat(Nt,'"/>\n <div>\n <div style="color: rgba(0, 0, 0, 0.88); font-size: 13px;"><span style="line-height: 19px; font-weight: ').concat(e?"500":"700",';">').concat(t,'</span></div>\n <div style="font-size: 13px; line-height: 18px; color: rgba(0, 0, 0, 0.61);">\n Please <a\n href="javascript:window.location.reload();"\n style="color: #0091FF; text-decoration: underline;">refresh the web page</a> \n and retry\n </div>\n </div>\n </div>\n ')})}}(t)}},{key:"notifyNetworkChanged",value:function(e){var t;e.networkChangedText&&(t=e.networkChangedText,qt()||(Ut&&(Ut.dismiss(),Ut=null),Ut=Jt({dismissible:!1,duration:1500,customClass:"onekey-alert-network-changed",content:'<div style="display: flex; align-items: center; gap: 8px;">\n <img style="width: 32px;" src="'.concat(Nt,'"/>\n <div>\n <div style="color: rgba(0, 0, 0, 0.88); font-size: 13px;"><span style="line-height: 19px; font-weight: 500;">').concat(t,"</span></div>\n </div>\n </div>\n ")})))}},{key:"getRookieGuideInfo",value:function(){return this.request({method:"wallet_getRookieGuideInfo"})}},{key:"resetRookieGuideProgress",value:function(){return this.request({method:"wallet_resetRookieGuideProgress"})}}],r&&en(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Et);const sn=(ln=()=>new Vt({receiveHandler:Lt}),(null===(fn=null===window||void 0===window?void 0:window.$onekey)||void 0===fn?void 0:fn.jsBridge)||(window.$onekey=window.$onekey||{},window.$onekey.jsBridge=ln(),Tt.debug("JsBridge injected success!",performance.now())),window.$onekey.jsBridge);var ln,fn;const dn=new un({bridge:sn});!function(e,t,n){if(!(null==n?void 0:n.alwaysInject)){if(!function(e){var t,n,r,o,i=localStorage.getItem(D),a=i?JSON.parse(i):null;if(!a)return!0;if(e){var c,u=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Rt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}(e);try{for(u.s();!(c=u.n()).done;){var s=c.value;if("web"===s&&(null===(t=null==a?void 0:a.platformEnv)||void 0===t?void 0:t.isWeb))return!1;if("desktop"===s&&(null===(n=null==a?void 0:a.platformEnv)||void 0===n?void 0:n.isDesktop))return!1;if("extension"===s&&(null===(r=null==a?void 0:a.platformEnv)||void 0===r?void 0:r.isExtension))return!1;if("native"===s&&(null===(o=null==a?void 0:a.platformEnv)||void 0===o?void 0:o.isNative))return!1}}catch(e){u.e(e)}finally{u.f()}}return!0}(null==n?void 0:n.disablePlatform))return;if(!function(){try{var e=localStorage.getItem(D),t=e?JSON.parse(e):null;if(!t)return!0;if(!(null==t?void 0:t.isDefaultWallet))return!1;if(Array.isArray(null==t?void 0:t.excludedDappList)){var n=window.location.origin;if(t.excludedDappList.includes(n))return!1}return!0}catch(e){Tt.warn(e)}return!0}())return}new Proxy(t,{defineProperty:function(e,t,n){try{if(Mt.includes(t))return Reflect.defineProperty(e,t,n)}catch(e){}return!0}});try{window[e]=t}catch(n){Tt.error(n);try{window[e]=t}catch(e){Tt.warn(e)}}}("$onekey",Object.assign(Object.assign({},window.$onekey),{jsBridge:sn,$private:dn}),{enumerable:!0,alwaysInject:!0})})(),{}})());
@@ -0,0 +1 @@
1
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
3
+ import { defineWindowProperty, injectedProviderReceiveHandler, injectJsBridge, } from '@onekeyfe/cross-inpage-provider-core';
4
+ import { JsBridgeNativeInjected } from '@onekeyfe/native-bridge-injected';
5
+ import { ProviderPrivate } from '@onekeyfe/onekey-private-provider';
6
+ const bridge = () => new JsBridgeNativeInjected({
7
+ receiveHandler: injectedProviderReceiveHandler,
8
+ });
9
+ const jsBridge = injectJsBridge(bridge);
10
+ const $private = new ProviderPrivate({
11
+ bridge: jsBridge,
12
+ });
13
+ defineWindowProperty('$onekey', Object.assign(Object.assign({}, window.$onekey), { jsBridge,
14
+ $private }), { enumerable: true, alwaysInject: true });
15
+ // eslint-disable-next-line no-void
16
+ void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/cross-inpage-provider-injected",
3
- "version": "2.2.69",
3
+ "version": "2.2.71",
4
4
  "keywords": [
5
5
  "cross-inpage-provider"
6
6
  ],
@@ -48,12 +48,13 @@
48
48
  "dependencies": {
49
49
  "@noble/curves": "1.8.0",
50
50
  "@noble/hashes": "1.7.2",
51
- "@onekeyfe/cross-inpage-provider-core": "2.2.69",
52
- "@onekeyfe/cross-inpage-provider-types": "2.2.69",
53
- "@onekeyfe/desktop-bridge-injected": "2.2.69",
54
- "@onekeyfe/extension-bridge-injected": "2.2.69",
55
- "@onekeyfe/inpage-providers-hub": "2.2.69",
56
- "@onekeyfe/native-bridge-injected": "2.2.69",
51
+ "@onekeyfe/cross-inpage-provider-core": "2.2.71",
52
+ "@onekeyfe/cross-inpage-provider-types": "2.2.71",
53
+ "@onekeyfe/desktop-bridge-injected": "2.2.71",
54
+ "@onekeyfe/extension-bridge-injected": "2.2.71",
55
+ "@onekeyfe/inpage-providers-hub": "2.2.71",
56
+ "@onekeyfe/native-bridge-injected": "2.2.71",
57
+ "@onekeyfe/onekey-private-provider": "2.2.71",
57
58
  "bignumber.js": "^9.1.2",
58
59
  "buffer": "^6.0.3",
59
60
  "cipher-base": "^1.0.6",
@@ -62,5 +63,5 @@
62
63
  "pbkdf2": "^3.1.3",
63
64
  "sha.js": "^2.4.12"
64
65
  },
65
- "gitHead": "7485565ca9007ea5f82518980d86e89178e4429c"
66
+ "gitHead": "341eeb07dce7aaab26db78523b7071d945e17626"
66
67
  }