1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3858],{94005:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONNECT_METHOD_BATCH_FETCHMSG=t.CONNECT_METHOD_FETCHMSG=t.CONNECT_METHOD_RECEIVE=t.CONNECT_METHOD_UNSUB=t.CONNECT_METHOD_SUB=t.CONNECT_METHOD_PUBLISH=t.CONNECT_METHOD_LOGIN=t.CONNECT_METHOD_PUSH=void 0,t.CONNECT_METHOD_PUSH="push",t.CONNECT_METHOD_LOGIN="login",t.CONNECT_METHOD_PUBLISH="publish",t.CONNECT_METHOD_SUB="subscribe",t.CONNECT_METHOD_UNSUB="unsubscribe",t.CONNECT_METHOD_RECEIVE="receive",t.CONNECT_METHOD_FETCHMSG="fetchMessages",t.CONNECT_METHOD_BATCH_FETCHMSG="batchFetchMessages"},86438:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||(r=function(e){return(r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),a=0;a<n.length;a++)"default"!==n[a]&&o(t,e,n[a]);return i(t,e),t}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.OKXWalletConnector=void 0;let c=n(98573),l=n(24214),u=n(41588),d=n(34959),h=n(77573),f=n(26729),g=a(n(72465)),p=n(11352),v=n(34206),m=(0,h.resolveWebSocketImplementation)();class y{constructor(e){if(this.events=new f.EventEmitter,this.state=c.ConnectorState.InitState,this.selectedUrlIndex=0,this.retryCount=0,this.timeOutLimit=8e3,!(0,h.checkWSUrl)(e))throw Error(`CONNECTOR: invalid url ${e}`);this.url=e,this.heartbeatTimer=null,this.connectionTimeoutTimer=null,this.connectURLStorage=new u.Storage(l.OKXCONNECTOR_CACHE_KEY+l.OKXCONNECTOR_CACHE_KEY)}get connecting(){return this.state==c.ConnectorState.Connecting}onPayload(e){if(void 0!==e.data){if(g.logDebug("get received data"),g.logDebug(e),"string"==typeof e.data&&"pong"===e.data){g.logDebug(`CONNECT: receive pong ${Date.now().toString()}`);return}this.events.emit("payload",e.data)}}onClose(e){var t;g.logDebug("socket get closed: ",null===(t=this.socket)||void 0===t?void 0:t.url,e.code),this.socket=void 0,this.events.emit("close",e)}onError(e,t){let n={id:e,msg:t.toString()};this.events.emit("payload",n)}onopen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.state=c.ConnectorState.Connected,this.events.emit("open")}emitError(e){this.events.emit("fail",e)}heartbeat(){return s(this,void 0,void 0,function*(){if(this.heartbeatTimer&&clearTimeout(this.heartbeatTimer),this.state!=c.ConnectorState.Connected&&this.state!=c.ConnectorState.OnError){g.logDebug("heart beat close");return}if(!this.socket){if(g.logDebug("socket not exist"),this.state==c.ConnectorState.Connected||this.state==c.ConnectorState.OnError){g.logDebug("socket reconnect by heartbeat");try{yield this.tryRegistOpen()}catch(e){g.logError("regist open failed"),this.heartbeatTimer=setTimeout(this.heartbeat.bind(this),5e3)}}return}if(this.socket.readyState!==WebSocket.OPEN){if(g.logDebug("socket not ready"),this.state==c.ConnectorState.Connected||this.state==c.ConnectorState.OnError){g.logDebug("socket reconnect by heartbeat with state",this.state,this.socket.readyState);try{yield this.tryRegistOpen()}catch(e){g.logError("regist open failed"),this.heartbeatTimer=setTimeout(this.heartbeat.bind(this),5e3)}}return}g.logDebug(`send ping heart beat: ${Date.now().toString()}, ${this.socket}`),this.socket.send("ping"),this.heartbeatTimer=setTimeout(this.heartbeat.bind(this),5e3)})}registOpen(e=this.url,t=!1){if(!(0,h.checkWSUrl)(e))throw Error(`CONNECTOR: invali
1d url ${e}`);return this.url=e,t||g.logDebug("Connection connect:",this.url,new Date().toUTCString()),this.state=c.ConnectorState.Connecting,new URLSearchParams(e).get("origin"),new Promise((t,n)=>{let r=new m(e,[]);g.logDebug("Connection connect Begin:",this.url,new Date().toUTCString()),this.startTimeOutTimer(r),(0,h.hasBuiltInWebSocket)()?(g.logDebug("Add socket error handler"),r.onerror=()=>{n(Error("socket error")),r.close()}):(g.logDebug("Add socket error handler"),r.on("error",()=>{n(Error("socket error")),r.close()})),r.onopen=()=>{g.logDebug("socket opened"),this.resetTimeOutTimer(c.OKXCONNECTOR_WS_URL_PENDING_CLOSE_CODE.FINISHED),this.onopen(r),this.heartbeat(),t(r)}})}checkMaxRetry(){return g.logDebug("current retry count:",this.retryCount,"of",c.OKXCONNECTOR_WS_URL_LIST.length),this.retryCount>3*c.OKXCONNECTOR_WS_URL_LIST.length}connectionTryNext(){return s(this,void 0,void 0,function*(){if(this.checkMaxRetry())g.logDebug("Max Connection retry ",this.retryCount,new Date().toUTCString());else{this.retryCount+=1;let e=this.getNextSelectUrl();return g.logDebug("Connection retry:",e,new Date().toUTCString()),this.registOpen(e,!0)}})}startTimeOutTimer(e){this.connectionTimeoutTimer&&this.resetTimeOutTimer(c.OKXCONNECTOR_WS_URL_PENDING_CLOSE_CODE.CANCELED),this.pendingSocket=e,this.connectionTimeoutTimer=setTimeout(()=>{this.pendingSocket&&this.resetTimeOutTimer(c.OKXCONNECTOR_WS_URL_PENDING_CLOSE_CODE.TIME_OUT)},this.timeOutLimit)}resetTimeOutTimer(e){var t;if(e==c.OKXCONNECTOR_WS_URL_PENDING_CLOSE_CODE.TIME_OUT)throw clearTimeout(this.connectionTimeoutTimer),null===(t=this.pendingSocket)||void 0===t||t.close(),this.pendingSocket=void 0,g.reportEvent(v.OKXReportType.LOG,"timeout",this.retryCount.toString()),Error("socket timeout");this.pendingSocket=void 0,clearTimeout(this.connectionTimeoutTimer)}cacheSuccessUrlSelect(){this.connectURLStorage.saveContent(this.selectedUrlIndex.toString(),l.OKXCONNECTOR_CACHE_KEY)}getNextSelectUrl(){return this.selectedUrlIndex+=1,this.selectedUrlIndex=this.selectedUrlIndex%c.OKXCONNECTOR_WS_URL_LIST.length,c.OKXCONNECTOR_WS_URL_LIST[this.selectedUrlIndex]}onVisibleChanged(){return s(this,void 0,void 0,function*(){if("visible"===document.visibilityState&&(g.logDebug(`get changed ${this.state}, ${this.socket}`),this.state==c.ConnectorState.Connected&&void 0===this.socket)){g.logDebug("CONNECTION need reopen");try{yield this.tryRegistOpen()}catch(e){g.logError("regist open failed")}return}})}tryRegistOpen(){return s(this,arguments,void 0,function*(e=this.url){if(this.connecting)return g.logDebug("tryRegistOpen => connecting state"),new Promise((e,t)=>{this.events.once("fail",e=>(g.logDebug("tryRegistOpen => connecting fail listener",e),t(e))),this.events.once("open",()=>void 0===this.socket?t(Error("Connect lost")):e(this.socket))});g.logDebug("tryRegistOpen => try registOpen until retry limit is hit");let t=!1;for(;!this.checkMaxRetry()&&!this.socket;)try{g.logDebug("tryRegistOpen => call registOpen, try count:",this.retryCount,t),yield this.registOpen(e,t)}catch(n){g.logDebug("tryRegistOpen => registOpen failed",n),this.retryCount+=1,e=this.getNextSelectUrl(),t=!0}if(g.logDebug("tryRegistOpen => exit while loop",this.retryCount,this.socket),!this.socket&&this.checkMaxRetry())throw g.logDebug("tryRegistOpen => failed to open a socket",this.retryCount,this.socket),this.retryCount=0,this.state=c.ConnectorState.OnError,this.emitError(Error("tryRegistOpen failed")),new p.OKXConnectError(p.OKX_CONNECT_ERROR_CODES.CONNECTION_ERROR,"Failed to connect")})}connect(){return s(this,void 0,void 0,function*(){try{yield this.tryRegistOpen(),document.removeEventListener("visibilitychange",this.onVisibleChanged.bind(this)),document.addEventListener("visibilitychange",this.onVisibleChanged.bind(this))}catch(e){throw g.logDebug("connect => failed to connect",e),e}})}disconnect(){return s(this,void 0,void 0,function*(){return this.state=c.ConnectorState.Disconnected,new Promise((e,t)=>{if(void 0===this.socket){e();return}this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close(),this.heartbeatTimer&&clearTimeout(this.heartbeatTimer)})})}currentStatus(){return{state:this.state,url:this.url}}addListener(e,t,n,r,o){this.listenPayloadHandler&&this.events.removeListener("payload",this.listenPayloadHandler),this.listenPayloadHandler=i=>s(this,void 0,void 0,function*(){var a;g.logDebug(`<<< get payload ${i}`);let s=(0,d.safeJsonParse)(i);if(s.params&&s.params.data){let i=null===(a=s.params.data)||void 0===a?void 0:a.message,c=!1;if(i&&o){let e=yield o(s.params.data);c=e.isSplitPackage&&!e.finalMessage,e.isSplitPackage&&(e.finalMessage&&e.finalMessage.length>0?(g.logDebug("CONNECT: update raw msg content"),i=e.finalMessage):(g.logDebug("CONNECT: skip raw msg content"),c=!0))}if(!c)try{let o=t(i);void 0===o?(g.logDebug("CONNECT: decrypt undefined"),r(e,"Decrypt undefined")):n(e,o)}catch(t){g.logDebug(`CONNECT: decrypt failed: ${t}`),r(e,t.message)}}}),this.events.on("payload",this.listenPayloadHandler),this.failHandler&&this.events.removeListener("fail",this.failHandler),this.failHandler=t=>{t?(g.logDebug(`CONNECT failed: ${t}`),r(e,t.message)):r(e,"Unkonow error")},this.events.on("fail",this.failHandler)}addPackageParse(e){this.payloadHandler&&this.events.removeListener("payload",this.payloadHandler),this.payloadHandler=t=>s(this,void 0,void 0,function*(){g.logDebug(`CONNECTION @[${new Date().toUTCString()}] <<<< received e:${t}`);let n=(0,d.safeJsonParse)(t);yield e(n)}),this.events.on("payload",this.payloadHandler)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}send(e,t){return s(this,void 0,void 0,function*(){try{void 0===this.socket&&(g.logDebug(`>>> send payload undefined ${t}`),yield e()),g.logDebug(`CONNECTION @[${new Date().toUTCString()}]>>> send payload ${(0,d.safeJsonStringify)(t)}`),this.socket&&this.socket.send((0,d.safeJsonStringify)(t))}catch(e){this.onError(t.id,e)}})}getMsgPayloadFromHistory(e){return s(this,void 0,void 0,function*(){if(void 0===e)return;let t=(0,d.safeJsonStringify)(e);g.logDebug("get received data from history"),g.logDebug(t),t=(0,d.safeJsonStringify)({params:{data:e}}),this.events.emit("payload",t)})}onOpen(e){this.openHandler&&this.events.removeListener("open",this.openHandler),this.openHandler=()=>s(this,void 0,void 0,function*(){g.logDebug(`CONNECTION @[${new Date().toUTCString()}] >>> ws opened: `),yield e()}),this.events.on("open",this.openHandler),this.cacheSuccessUrlSelect()}}t.OKXWalletConnector=y},1936:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);
1(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||(r=function(e){return(r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),a=0;a<n.length;a++)"default"!==n[a]&&o(t,e,n[a]);return i(t,e),t}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionManager=void 0;let c=n(86438),l=n(94005),u=n(24214),d=n(82779),h=n(98573),f=n(26729),g=n(41588),p=n(77573),v=n(23390),m=n(28655),y=n(2145),C=a(n(72465)),O=n(72465),b=n(34206),w=n(11349),_=n(93057);class E{constructor(e){this.events=new f.EventEmitter,this.splitManager=new _.ConnectionSplitPackages("dapp"),this.connectStorage=new g.Storage(u.OKXCONNECTOR_CACHE_KEY_DAPP+e,u.OKXCONNECTOR_CACHE_KEY_DAPP),this.crypto=new v.SessionCrypto;let t=(0,w.isInTMA)();if((0,O.logDebug)("do init:",t),C.reportLog("connection manager do init"),t)try{let e=this.getCachedCryptoKeyPair();(0,O.logDebug)("use same pk:",e),this.crypto=new v.SessionCrypto(e)}catch(e){this.connectStorage.clearCache(),C.reportEvent(b.OKXReportType.LOG,"cache_fail","cache failed")}this.jwtKeyPair=this.getCachedJWTKeyPair(),this.saveJWTKeyPair(this.jwtKeyPair),this.connector=new c.OKXWalletConnector(h.OKXCONNECTOR_WS_URL_1),this.packageId=Date.now(),this.connectedWalletPK="",this.currentTopic="",C.logDebug(`this.connectedWalletPK constructor ${this.connectedWalletPK}`)}refreshPackageId(){let e=Date.now();e==this.packageId&&(this.packageId=e+1),this.packageId=e}saveCryptoKeyPair(e){let t=(0,y.safeJsonStringify)(e);this.connectStorage.encryptStoreMsg(t,u.OKXCONNECTOR_CRYPTO_KEY)}getCachedCryptoKeyPair(){let e=this.connectStorage.getAndDecrypt(u.OKXCONNECTOR_CRYPTO_KEY);return"string"==typeof e?(C.logDebug("get cached crypto key:"),C.logDebug(e),(0,y.safeJsonParse)(e)):(this.connectStorage.clearCache(),null)}saveJWTKeyPair(e){var t={publicKey:(0,p.toHexString)(e.publicKey),secretKey:(0,p.toHexString)(e.secretKey)};C.logDebug("save jwt kp");let n=(0,y.safeJsonStringify)(t);C.logDebug(n),this.connectStorage.encryptStoreMsg(n,u.OKXCONNECTOR_JWT_KEY)}getCachedJWTKeyPair(){try{let e=this.connectStorage.getAndDecrypt(u.OKXCONNECTOR_JWT_KEY);if("string"!=typeof e)return(0,m.generateKeyPair)();{C.logDebug("get cached jwt kp:"),C.logDebug(e);let t=(0,y.safeJsonParse)(e);return C.logDebug("save jwt kp"),C.logDebug(t),{publicKey:(0,p.hexToByteArray)(t.publicKey),secretKey:(0,p.hexToByteArray)(t.secretKey)}}}catch(e){return C.reportEvent(b.OKXReportType.LOG,"cache_fail","cache failed"),(0,m.generateKeyPair)()}}isWalletPKReady(){return C.logDebug(`isWalletPKReady ===> ${this.connectedWalletPK}`),this.connectedWalletPK.length>0}makeJWT(e){return s(this,void 0,void 0,function*(){return yield(0,m.signJWT)(e,d.OKXCONNECTOR_JWT_SIDE,d.OKXCONNECTOR_JWT_TTL,this.jwtKeyPair)})}parsePackage(e){return s(this,arguments,void 0,function*(e,t=!1){var n,r,o,i,a,c,l,d,h,f,g,p,v;if(this.events.emit(e.id,e),!t){yield this.sendACK(e.id,!0);let t=null===(n=this.connectStorage.getItem(u.OKXCONNECTOR_TOKEN_CACHE))||void 0===n?void 0:n.content;if(t&&(null===(o=null===(r=e.params)||void 0===r?void 0:r.data)||void 0===o?void 0:o.messageId)){let n=this.splitManager.tryParseMessageSplitPayload(null===(a=null===(i=e.params)||void 0===i?void 0:i.data)||void 0===a?void 0:a.message);if(n){let r={topicId:null===(l=null===(c=e.params)||void 0===c?void 0:c.data)||void 0===l?void 0:l.topic,messageId:null===(h=null===(d=e.params)||void 0===d?void 0:d.data)||void 0===h?void 0:h.messageId,messageObject:n,publishedAt:null===(g=null===(f=e.params)||void 0===f?void 0:f.data)||void 0===g?void 0:g.publishedAt}
1,o=yield this.splitManager.onReceivedPackageCheck(r);o.completeMessageIdList&&o.completeMessageIdList.forEach(e=>s(this,void 0,void 0,function*(){this.refreshPackageId(),yield this.sendReceive(this.packageId.toString(),e,t)}))}else this.refreshPackageId(),yield this.sendReceive(this.packageId.toString(),null===(v=null===(p=e.params)||void 0===p?void 0:p.data)||void 0===v?void 0:v.messageId,t)}}})}restoreConnect(e){return s(this,void 0,void 0,function*(){if(C.reportLog("connection manager restore connection"),C.logDebug(`connectionManager restoreConenct ${e}`),"string"!=typeof e||0===e.length)throw Error("CONNECTION: invalid topic");C.logDebug("connectionManager restoreConenct disconnect"),yield this.disconnect(!0),this.connectStorage.saveContent(e,u.OKXCONNECTOR_TOKEN_CACHE),C.logDebug("connectionManager restoreConenct conect"),yield this.connect(!0)})}getConnectInfo(){var e=(0,p.generateTopic)();return C.logDebug(`generate topic token: ${e}`),C.reportLog("connection manager generate connection info"),this.currentTopic=e,{channelId:e,clientId:this.crypto.stringifyKeypair().publicKey}}connect(){return s(this,arguments,void 0,function*(e=!1){this.timeLog=new Date().getTime(),(0,O.logDebug)("ConnectTime---enter->",this.timeLog),C.reportLog("connection manager begin connect");let t=this.connectStorage.getItem(u.OKXCONNECTOR_TOKEN_CACHE);var n=this.currentTopic;if(C.logDebug(`generate topic token: ${n}`),e){null!=t&&(C.logDebug(`read last connect id: ${t}`),n=t.content);var r=this.connectStorage.getItem(u.OKXCONNECTOR_CRYPTO_SENDER_PK_CACHE);r&&(this.connectedWalletPK=r.content,(0,O.logDebug)(`connectionManager connect() this.connectedWalletPK : ${this.connectedWalletPK}`)),C.reportLog("connection manager do restore connection")}if(e)try{let e=this.getCachedCryptoKeyPair();e&&(this.crypto=new v.SessionCrypto(e))}catch(e){throw C.logError("get crypto key pair from cache failed"),C.reportEvent(b.OKXReportType.LOG,"cache_fail","cache failed"),this.connectStorage.clearCache(),Error("crypto cache failed")}C.logDebug(`use crypto client id: ${this.crypto.stringifyKeypair().publicKey}`),this.connectStorage.saveContent(n,u.OKXCONNECTOR_TOKEN_CACHE);var o=yield this.makeJWT(n);return C.logDebug(`generate jwt token: ${o}`),this.connectStorage.saveContent(o,"jwt"),new Promise((e,t)=>{this.connector.onOpen(()=>s(this,void 0,void 0,function*(){C.logDebug("1. connector on open"),C.reportLog("1. connect ws open");let r=new Date().getTime();(0,O.logDebug)("ConnectTime---open->",r-this.timeLog),this.events.once(this.packageId.toString(),r=>s(this,void 0,void 0,function*(){if(r&&r.error){C.logError("failed when login"),C.reportLog("2. connect login failed"),yield this.connector.disconnect();var o=Error();o.message=r.error.message,o.name=r.error.code.toString(),t(o)}this.refreshPackageId(),this.events.once(this.packageId.toString(),r=>s(this,void 0,void 0,function*(){if(r&&r.error){C.logError("failed when subscribe"),C.reportLog("3. connect subscribe failed"),yield this.connector.disconnect();var o=Error();o.message=r.error.message,o.name=r.error.code.toString(),t(o)}this.refreshPackageId(),C.logDebug(`4. subscribe callback then send fetch: ${this.packageId}`),C.reportLog("4. subscribe callback then send fetch");let i=new Date().getTime();(0,O.logDebug)("ConnectTime--subscribe callback->",i-this.timeLog),yield this.sendFetchAndConsumeMessages(this.packageId.toString(),n),C.logDebug(`5. splitmanager init: ${this.packageId}`),C.reportLog("5. splitmanager init"),yield this.splitManager.init(this.sendRaw.bind(this)),e()})),C.logDebug(`3. login callback then send subscribe: ${this.packageId}`),C.reportLog("3. connect subscribe failed");let i=new Date().getTime();(0,O.logDebug)("ConnectTime---login callback->",i-this.timeLog),yield this.connector.send(()=>s(this,void 0,void 0,function*(){C.logDebug("CONNECT: reconnect before send"),yield this.connector.connect().catch(e=>{(0,O.logDebug)("ConnectionManager connect error",e),t(e)})}),{id:this.packageId.toString(),jsonrpc:h.CONNECT_JSONRPC_VER,method:l.CONNECT_METHOD_SUB,params:{topic:n}})})),C.logDebug("2. login called"),C.reportLog("2. connection manager connect call login"),yield this.connector.send(()=>s(this,void 0,void 0,function*(){C.logDebug("CONNECT: reconnect before send"),yield this.connector.connect().catch(e=>{(0,O.logDebug)("ConnectionManager connect error",e),t(e)})}),{id:this.packageId.toString(),jsonrpc:h.CONNECT_JSONRPC_VER,method:l.CONNECT_METHOD_LOGIN,params:{token:o}}),this.connector.addPackageParse(e=>{var t;if(C.logDebug("connect: parse package"),C.logDebug(e),!("params"in e)||!("data"in e.params)){this.parsePackage(e,!0);return}let n=null===(t=e.params.data)||void 0===t?void 0:t.message;if(void 0!==n){n=n.replace(/'/g,'"');let e=(0,y.safeJsonParse)(n);"string"!=typeof e&&"clientId"in e&&e.clientId&&e.clientId.length>0&&(this.connectedWalletPK=e.clientId,C.logDebug(`this.connectedWalletPK addPackageParse ${this.connectedWalletPK}`),this.connectStorage.saveContent(this.connectedWalletPK,u.OKXCONNECTOR_CRYPTO_SENDER_PK_CACHE),this.saveCryptoKeyPair(this.crypto.stringifyKeypair()))}this.parsePackage(e,e.method===l.CONNECT_METHOD_RECEIVE)})})),this.connector.connect().catch(e=>{(0,O.logDebug)("ConnectionManager connect error",e),t(e)})})})}disconnect(){return s(this,arguments,void 0,function*(e=!1){yield this.connector.disconnect(),C.reportLog("connect disconnect"),this.connectStorage.clearCache(u.OKXCONNECTOR_TOKEN_CACHE),e||(this.connectStorage.clearCache(u.OKXCONNECTOR_CRYPTO_SENDER_PK_CACHE),this.connectedWalletPK="",(0,O.logDebug)(`connectionManager disconnect() this.connectedWalletPK : ${this.connectedWalletPK}`))})}updateProtocolVersion(e,t){this.splitManager.updateTopicSenderVersion(e,t)}addListener(e,t,n){this.connector.addListener((0,y.safeJsonStringify)(e),e=>{if(e=e.replace(/'/g,'"'),C.logDebug(`addListener ===> ${e}`),void 0!==e){let r;var t=(0,y.safeJsonParse)(e),n=t.message;return n.trimStart().startsWith("{")?r=n:(t.clientId&&t.clientId.length>0&&(this.connectedWalletPK=t.clientId,this.connectStorage.saveContent(this.connectedWalletPK,u.OKXCONNECTOR_CRYPTO_SENDER_PK_CACHE),C.logDebug(`this.connectedWalletPK addListener ${this.connectedWalletPK}`),C.logDebug(`this.cryptoKey addListener ${(0,p.toHexString)(this.crypto.keyPair.publicKey)}`),this.saveCryptoKeyPair(this.crypto.stringifyKeypair())),r=this.crypto.decrypt(n,this.connectedWalletPK)),C.logDebug(`addListener ===> ${r}`),r}},t,n,e=>new Promise((t,n)=>s(this,void 0,void 0,function*(){let n=this.splitManager.tryParseMessageSplitPayload(e.message);if(n){let r={topicId:e.topic,messageId:null==e?void 0:e.messageId,messageObject:n,publishedAt:null==e?void 0:e.publishedAt};
1t((yield this.splitManager.onReceivedPackageCheck(r)))}else t({isSplitPackage:!1})})))}sendRaw(e){return s(this,void 0,void 0,function*(){C.logDebug(`message send =====> ${e}`),C.reportLog("connect send raw msg"),C.logDebug(`message send =====encrypt message.length>>>> ${e.length}`);let t=this.connectStorage.getItem(u.OKXCONNECTOR_TOKEN_CACHE);C.logDebug(`message send =====topic>>>> ${null==t?void 0:t.content}`),this.refreshPackageId();let n={id:this.packageId.toString(),method:l.CONNECT_METHOD_PUBLISH,jsonrpc:h.CONNECT_JSONRPC_VER,params:{message:{topic:null==t?void 0:t.content,message:e,ttl:h.OKXCONNECTOR_MESSAGE_TTL}}};return this.events.once(this.packageId.toString(),e=>s(this,void 0,void 0,function*(){e&&e.error?C.logError(`@${new Date().toUTCString()} >>> failed when send msg`):e&&!e.error&&C.logDebug(`CONNECTION @[${new Date().toUTCString()}] >>> send msg with id ${this.packageId} successed`)})),yield this.connector.send(()=>s(this,void 0,void 0,function*(){return C.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()}),n),this.packageId})}sendEncryptedMsg(e,t){return s(this,arguments,void 0,function*(e,t,n=h.OKXCONNECTOR_MESSAGE_TTL){this.refreshPackageId();let r={id:this.packageId.toString(),method:l.CONNECT_METHOD_PUBLISH,jsonrpc:h.CONNECT_JSONRPC_VER,params:{message:{topic:e,message:t,ttl:n}}};this.events.once(this.packageId.toString(),e=>s(this,void 0,void 0,function*(){e&&e.error?C.logError(`@${new Date().toUTCString()} >>> failed when send msg`):e&&!e.error&&C.logDebug(`CONNECTION @[${new Date().toUTCString()}] >>> send msg with id ${this.packageId} successed`)})),yield this.connector.send(()=>s(this,void 0,void 0,function*(){return C.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()}),r)})}send(e){return s(this,arguments,void 0,function*(e,t=h.OKXCONNECTOR_MESSAGE_TTL){if(C.logDebug(`message send =====> ${e}`),C.reportLog("connect send msg"),!this.isWalletPKReady())throw Error("connection not finish");let n=this.crypto.encrypt(e,this.connectedWalletPK);C.logDebug(`message send =====encrypt message.length>>>> ${n.length}`),C.reportEvent(b.OKXReportType.LOG,"msg_size",n.length.toString());let r=this.connectStorage.getItem(u.OKXCONNECTOR_TOKEN_CACHE);return C.logDebug(`message send =====topic>>>> ${null==r?void 0:r.content}`),yield this.splitManager.sendSplitPackages(null==r?void 0:r.content,n,this.sendEncryptedMsg.bind(this),this.sendRaw.bind(this)),this.packageId})}sendACK(e,t){return s(this,arguments,void 0,function*(e,t,n){if(!0===t){let t={id:e,jsonrpc:h.CONNECT_JSONRPC_VER,result:!0};yield this.connector.send(()=>s(this,void 0,void 0,function*(){return C.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()}),t)}else if(n){let t={id:e,jsonrpc:h.CONNECT_JSONRPC_VER,error:{code:n.code,message:n.message}};yield this.connector.send(()=>s(this,void 0,void 0,function*(){return C.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()}),t)}})}sendReceive(e,t,n){return s(this,void 0,void 0,function*(){let r={id:e,jsonrpc:h.CONNECT_JSONRPC_VER,method:l.CONNECT_METHOD_RECEIVE,params:{data:{messageId:t,topic:n}}};yield this.connector.send(()=>s(this,void 0,void 0,function*(){return C.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()}),r)})}sendFetchAndConsumeMessages(e,t){return s(this,void 0,void 0,function*(){this.events.once(e,e=>s(this,void 0,void 0,function*(){var n,r;if(e.result){var o=e.result.hasMore,i=e.result.data;if(i)for(let e=0;e<i.length;e++){let n=i[e];if(n&&n.topic==t){let e=n.messageId;C.reportLog("5. get fetch result"),this.splitManager.tryParseMessageSplitPayload(n.message)?(yield this.connector.getMsgPayloadFromHistory(n),C.logDebug("skip receive")):(yield this.connector.getMsgPayloadFromHistory(n),this.refreshPackageId(),yield this.sendReceive(this.packageId.toString(),e,t))}}o&&(this.refreshPackageId(),yield this.sendFetchAndConsumeMessages(this.packageId.toString(),t))}else C.logDebug(`CONNECT: get error rsp ${null===(n=e.error)||void 0===n?void 0:n.code} : ${null===(r=e.error)||void 0===r?void 0:r.message}`)})),C.logDebug("5. send fetch more"),C.reportLog("5. send fetch more");let n=new Date().getTime();(0,O.logDebug)("ConnectTime---5->",n-this.timeLog);let r={id:e,jsonrpc:h.CONNECT_JSONRPC_VER,method:l.CONNECT_METHOD_FETCHMSG,params:{data:{topic:t}}};yield this.connector.send(()=>s(this,void 0,void 0,function*(){return C.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()}),r)})}cleanCache(){C.reportLog("connection cache clean called"),this.connectStorage.clearCache()}saveSessionContent(e,t){t||this.connectStorage.clearCache(u.OKXCONNECTOR_SESSION_PREFIX_KEY+e);let n=(0,y.safeJsonStringify)(t);this.connectStorage.encryptStoreMsg(n,u.OKXCONNECTOR_SESSION_PREFIX_KEY+e)}getSessionContent(e){try{let t=this.connectStorage.getAndDecrypt(u.OKXCONNECTOR_SESSION_PREFIX_KEY+e);if(t)return(0,y.safeJsonParse)(t)}catch(t){this.connectStorage.clearCache(u.OKXCONNECTOR_SESSION_PREFIX_KEY+e)}}getCurrentConnectionReady(){let e=!1;
1try{this.getCachedCryptoKeyPair()&&(e=!0)}catch(e){C.logError("check connection ready failed")}return this.isWalletPKReady()&&e}getCryptoKeyEnable(){let e=!1;try{this.getCachedCryptoKeyPair()&&(e=!0)}catch(e){C.logError("check connection ready failed")}return e}}t.ConnectionManager=E},93057:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||(r=function(e){return(r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),a=0;a<n.length;a++)"default"!==n[a]&&o(t,e,n[a]);return i(t,e),t}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionSplitPackages=void 0;let l=n(24214),u=c(n(69483)),d=n(77573),h=n(2145),f=a(n(72465)),g=n(72465),p="ConnectionReceiveKey",v="ConnectionSendKey",m="ConnectionSenderVersionKey";class y{constructor(e){this.splitMessageSendArray=new Map,this.splitMessageReceivedArray=new Map,this.splitMessageSenderVersionMap=new Map,this.splitPackageCache=u.default.createInstance({name:l.OKXCONNECTOR_STORAGE_PROTOCOL_CACHE+e})}init(e){return s(this,void 0,void 0,function*(){if(yield this.recoverFromCache(),this.splitMessageSendArray.size>0){for(let[t,n]of this.splitMessageSendArray.entries())for(let r=0;r<n.length;){let o=n[r];try{yield e((0,h.safeJsonStringify)(o),t),f.logDebug(`Successfully sent payload: ${(0,h.safeJsonStringify)(o)} to topic: ${t}`),n.splice(r,1)}catch(e){f.logError(`Failed to send payload: ${(0,h.safeJsonStringify)(o)} to topic: ${t}`,e),o.retryCount=(o.retryCount||0)+1,o.retryCount>3?(f.logError(`Payload failed after 3 retries: ${(0,h.safeJsonStringify)(o)}`),n.splice(r,1)):r++}}yield this.syncCache()}})}tryParseMessageSplitPayload(e){var t;let n;try{if(e.trimStart().startsWith("{")){let r=(0,h.safeJsonParse)(e);r&&r.protocol_version&&r.protocol_version>=2&&r.package_group_id&&(null===(t=r.package_group_id)||void 0===t?void 0:t.length)>0&&(n=r)}else(0,g.logDebug)("not split packages")}catch(e){(0,g.logDebug)("not split packages")}return n}updateTopicSenderVersion(e,t){return s(this,void 0,void 0,function*(){this.splitMessageSenderVersionMap.set(e,t),yield this.syncCache(),(0,g.logDebug)("get update topic sender version: ",e,t)})}sendSplitPackages(e,t,n,r){return s(this,void 0,void 0,function*(){if(!e){f.logError("sendSplitPackages invalid topic");return}let o=this.splitMessageSenderVersionMap.get(e),i=t.length;try{if(i<63e3)throw Error(`no need to split (size:${i})`);if(!o||o&&o<2)throw Error(`version not support split (version: ${o})`);let n=[];for(let e=0;e<t.length;e+=63e3)e+63e3<t.length?n.push(t.slice(e,e+63e3)):n.push(t.slice(e));let a=(0,d.generateGroupId)(),s=n.map((t,r)=>({topicId:e,protocol_version:2,total_count:n.length,package_index:r,package_group_id:a,content:t}));this.mergePackageArray(!0,s);for(let t=0;t<s.length;){let n=s[t],o=(0,h.safeJsonStringify)(n);try{yield r(o,e),f.logDebug(`Successfully sent payload: ${o} to topic: ${e}`),s.splice(t,1)}catch(r){f.logError(`Failed to send payload: ${o} to topic: ${e}`,r),n.retryCount=(n.retryCount||0)+1,n.retryCount>3?(f.logError(`Payload failed after 3 retries: ${o}`),s.splice(t,1)):t++}}this.splitMessageSendArray.set(e,[]),yield this.syncCache()}catch(r){(0,g.logDebug)("send split packages no split"),(0,g.logDebug)(r),yield n(e,t)}})}
1onReceivedPackageCheck(e){return s(this,void 0,void 0,function*(){this.mergePackageArray(!1,[e]);let t=new Map,n=e.topicId;this.splitMessageReceivedArray.forEach((n,r)=>{r==e.topicId&&n.forEach(e=>{if(e.messageObject.package_group_id){let n=t.get(e.messageObject.package_group_id);n||(n=[]),n.push(e),t.set(e.messageObject.package_group_id,n)}})}),(0,g.logDebug)("on received message, check message cache");let r={isSplitPackage:!1};if(e.messageObject.package_group_id){r.isSplitPackage=!0;let o=t.get(e.messageObject.package_group_id);if(null==o?void 0:o.length){let t=new Set;if(o.forEach(e=>{void 0!==e.messageObject.package_index&&t.add(e.messageObject.package_index)}),t.size==e.messageObject.total_count){o.sort((e,t)=>(e.messageObject.package_index||0===e.messageObject.package_index)&&(t.messageObject.package_index||0===t.messageObject.package_index)?e.messageObject.package_index-t.messageObject.package_index:0);let e=o.reduce((e,t)=>(e.push(t.messageObject.content),e),[]),t=o.reduce((e,t)=>(e.push(t.messageId),e),[]);r.isSplitPackage=!0,r.finalMessage=e.join(""),r.completeMessageIdList=t;let i=this.splitMessageReceivedArray.get(n);i&&(i=i.filter(e=>!t.includes(e.messageId)),this.splitMessageReceivedArray.set(n,i)),yield this.syncCache()}}}return r})}mergePackageArray(e,t){return s(this,void 0,void 0,function*(){if((0,g.logDebug)("append sending array"),e){let e=t.filter(e=>{let t=e.topicId,n=!0,r=this.splitMessageSendArray.get(t);return null==r||r.forEach(t=>{t.package_group_id==e.package_group_id&&t.total_count==e.total_count&&t.package_index==e.package_index&&(n=!1)}),n});if(e.length>0){let t=e[0].topicId,n=this.splitMessageSendArray.get(t);n||(n=[]),n=n.concat(e),this.splitMessageSendArray.set(t,n),(0,g.logDebug)("append sending array (after filted): ",n)}}else{let e=t.filter(e=>{let t=e.topicId,n=!0,r=this.splitMessageReceivedArray.get(t);return null==r||r.forEach(t=>{t.messageId==e.messageId&&(n=!1)}),n});if(e.length>0){let t=e[0].topicId,n=this.splitMessageReceivedArray.get(t);n||(n=[]),n=n.concat(e),this.splitMessageReceivedArray.set(t,n),(0,g.logDebug)("append received array (after filted): ",n)}}})}syncCache(){return s(this,void 0,void 0,function*(){(0,g.logDebug)("sync split message cache"),yield this.splitPackageCache.setItem(p,this.splitMessageReceivedArray),yield this.splitPackageCache.setItem(v,this.splitMessageSendArray),yield this.splitPackageCache.setItem(m,this.splitMessageSenderVersionMap)})}recoverFromCache(){return s(this,void 0,void 0,function*(){let e=yield this.splitPackageCache.getItem(p);e?this.splitMessageReceivedArray=e:this.splitMessageReceivedArray=new Map;let t=yield this.splitPackageCache.getItem(v);t?this.splitMessageSendArray=t:this.splitMessageSendArray=new Map;let n=yield this.splitPackageCache.getItem(m);n?this.splitMessageSenderVersionMap=n:this.splitMessageSenderVersionMap=new Map})}}t.ConnectionSplitPackages=y},98573:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectorState=t.CONNECT_PROTOCOL_VER=t.CONNECT_JSONRPC_VER=t.OKXCONNECTOR_MESSAGE_TTL=t.OKXCONNECTOR_WS_URL_PENDING_CLOSE_CODE=t.OKXCONNECTOR_WS_URL_LIST=t.OKXCONNECTOR_WS_URL_IDX_KEY=t.OKXCONNECTOR_WS_URL_3=t.OKXCONNECTOR_WS_URL_2=t.OKXCONNECTOR_WS_URL_1=t.EVENT_EMITTER_MAX_LISTENERS=t.OKXCONNECTOR_PROTOCOL_VERSION=void 0,t.OKXCONNECTOR_PROTOCOL_VERSION=2,t.EVENT_EMITTER_MAX_LISTENERS=10,t.OKXCONNECTOR_WS_URL_1="wss://wsdexpri.okx.com/ws/v1/wallet-connect-relay",t.OKXCONNECTOR_WS_URL_2="wss://wsdexpri.okx.ac/ws/v1/wallet-connect-relay",t.OKXCONNECTOR_WS_URL_3="wss://wsdexpri.coinall.ltd/ws/v1/wallet-connect-relay",t.OKXCONNECTOR_WS_URL_IDX_KEY="wuik",t.OKXCONNECTOR_WS_URL_LIST=[t.OKXCONNECTOR_WS_URL_1,t.OKXCONNECTOR_WS_URL_2,t.OKXCONNECTOR_WS_URL_3],t.OKXCONNECTOR_WS_URL_PENDING_CLOSE_CODE={TIME_OUT:3990,CANCELED:3991,FINISHED:3992},t.OKXCONNECTOR_MESSAGE_TTL=3e5,t.CONNECT_JSONRPC_VER="2.0",t.CONNECT_PROTOCOL_VER=2,t.ConnectorState={InitState:0,Connecting:1,Connected:2,Disconnected:3,OnError:4}},50849:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
1ise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Engine=void 0;let o=n(11352),i=n(98573),a=n(34959),s=n(42869),c=n(1936),l=n(70802),u=n(16411);class d{constructor(e){this.connectors=[],this.useConnector=void 0,this.connectionManager=new c.ConnectionManager(e),this.addConnectionListener()}getConnector(){if(this.useConnector)return this.useConnector}setAccountChangeListener(e){for(let t of(this.accountChangeListener=e,(0,a.logDebug)("setAccountChangeListener: engine",e),this.connectors))t.setAccountChangeListener(e)}registerConnector(e){for(let t of(this.connectors=e,e))t.setConnectionManager(this.connectionManager)}hasWsConnector(){for(let e of this.connectors)if(this.isWsConnector(e))return!0;return!1}isWsConnector(e){return!!e&&(e.getTag()===s.OKX_TG_WALLET||e.getTag()===s.OKX_APP_WALLET)}isInjectedConnector(e){return!!e&&e.getTag()===s.OKX_INJECT_WALLET}universalConnect(e,t,n){return r(this,void 0,void 0,function*(){return this.addConnectionListener(),new Promise((i,c)=>r(this,void 0,void 0,function*(){var r,d,h,f;try{(0,a.logDebug)("engine universalConnect request :",JSON.stringify(e)),(0,a.logDebug)("engine universalConnect sessionConfig :",JSON.stringify(t));let p=[];e.forEach(e=>{let t=e.name;(t.startsWith("requestAccounts")||t.startsWith("ton"))&&p.push(e)}),(0,a.logDebug)("engine universalConnect universalRequest :",JSON.stringify(p));let v=this.connectionManager.getConnectInfo(),m=Date.now().toString(),y=null!==(r=t.openUniversalUrl)&&void 0!==r&&r,C={protocolVer:Number(o.tonConnectSdkVersion),topic:v.channelId,clientId:v.clientId,requestId:m,dAppInfo:t.dappInfo,requests:p,redirect:null!==(d=null==t?void 0:t.redirect)&&void 0!==d?d:"none"},O=(0,a.encodeConnectParams)(C);C.redirect=null!==(h=null==t?void 0:t.redirect)&&void 0!==h?h:"none",(0,a.logDebug)("engine universalConnect ==>>universalConnectRequest:",JSON.stringify(C));var g="";y&&(g=(0,a.getOKXLink)(C,t.useMini,t.tmaReturnUrl),(0,a.logDebug)("engine universalConnect ==>>openOKXLink:",g));let b=()=>1==this.connectors.length&&this.connectors[0].getTag()===s.OKX_INJECT_WALLET?this.connectors[0].openWallet({connectRequest:C}):t.useMini?(0,a.openOKXTMAWalletlinkWithFallback)(g):(0,a.useShortLink)()?(0,a.openOKXUniversalLink)(g):(0,a.openOKXDeeplinkWithFallback)(g);(0,a.logDebug)("engine universalConnect ==>>openOKXLink:",g);let w=(0,a.isIos)();if(w&&y&&((0,a.logDebug)(`engine universalConnect ==>>isIOS: ${w} openUniversalLink: ${y}`),b()),this.addOnConnectResultListener(e=>{var n,r,d,h;try{if(this.addOnConnectResultListener(void 0),"connect"==e.method){(0,a.logDebug)("engin universalConnect success connectResponse:>>>",JSON.stringify(e));let c=(0,l.buildNameSpacesByConnectResponse)(e);if(c){let l;switch((null===(r=null===(n=e.payload)||void 0===n?void 0:n.responses)||void 0===r?void 0:r[0])&&"walletName"in e.payload.responses[0]&&(l=e.payload.responses[0].walletName),null===(d=e.payload)||void 0===d?void 0:d.wallet.appName){case u.OKXWalletName:f=s.OKX_APP_WALLET;break;case u.OKXMiniWalletName:f=s.OKX_TG_WALLET;break;case u.OKXInjectWalletName:f=s.OKX_INJECT_WALLET}var f,g=this.connectors.find(e=>e.getTag()===f);if(!g)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR);let h=Object.assign({topic:v.channelId,sessionConfig:t,namespaces:c},e.payload&&{wallet:Object.assign(Object.assign({},e.payload.wallet),{walletName:l})}),p=e.payload.responses.find(e=>"requestAccounts"===e.name);p&&p.connectRequestMethods&&(h.signResponse=p.connectRequestMethods),(0,a.logDebug)("engin universalConnect success session:>>>",JSON.stringify(h)),this.isWsConnector(g)&&((0,a.logDebug)("engine update protocol version"),this.connectionManager.updateProtocolVersion(v.channelId,e.payload.wallet.maxProtocolVersion)),i(h),this.setUseConnector(g)}else throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR)}else if("connect_error"==e.method&&(null===(h=e.payload)||void 0===h?void 0:h.code)!=void 0)throw new o.OKXConnectError(e.payload.code)}catch(e){c(e)}}),this.hasWsConnector()){yield null===(f=this.connectionManager)||void 0===f?void 0:f.disconnect(!1);try{yield this.connectionManager.connect()}catch(e){throw(0,a.logDebug)("Engine universalConnect error",e),e}(0,a.logDebug)("engin universalConnect ==>> connectInfoAndUrl:",n),this.sendSession(O)}if(!w&&y&&b(),(0,a.logDebug)("engin universalConnect ==>> connectInfoAndUrl:",n),n){let e={connectRequest:C,redirect:t.redirect,tmaReturnUrl:t.tmaReturnUrl};(0,a.logDebug)("universalConnect connectInfoAndUrl info :",JSON.stringify(e)),n(e)}}catch(e){(0,a.logDebug)("Engine universalConnect catch error",e),c(e)}}))})}addOnConnectResultListener(e){for(let t of this.connectors)this.isInjectedConnector(t)&&t.setOnConnectResultListener(e);this.connectResultListener=e}openWallet(e,t){var n;t?t.openWallet(e):null===(n=this.getConnector())||void 0===n||n.openWallet(e)}send(e,t,n){return r(this,void 0,void 0,function*(){var r;return null===(r=this.getConnector())||void 0===r?void 0:r.send(e,t,n)})}clearData(){var e;null===(e=this.getConnector())||void 0===e||e.clearData()}addDisconnectListener(e){var t;null===(t=this.getConnector())||void 0===t||t.addDisconnectListener(e)}saveSessionContent(e,t){this.connectionManager.saveSessionContent(e,t)}getSessionContent(e){var t,n=this.connectionManager.getSessionContent(e);
1if(n){var r="";if("object"==typeof n&&(r=this.getTagByappName(null===(t=n.wallet)||void 0===t?void 0:t.appName)),this.connectors.find(e=>e.getTag()===r))return n}}getTagByappName(e){var t="";if(e)switch(e){case u.OKXWalletName:t=s.OKX_APP_WALLET;break;case u.OKXMiniWalletName:t=s.OKX_TG_WALLET;break;case u.OKXInjectWalletName:t=s.OKX_INJECT_WALLET}return t}setConnectConnector(e){var t=this.getTagByappName(null==e?void 0:e.appName);t&&this.setUseConnector(this.connectors.find(e=>e.getTag()===t))}setUseConnector(e){this.useConnector=e,this.isWsConnector(e)&&e.addConnectionListener()}setSessionConnectingListener(e){this.sessionConnectingListener=e}restoreconnect(e,t){return r(this,void 0,void 0,function*(){var n;yield null===(n=this.getConnector())||void 0===n?void 0:n.restoreconnect(e,t)})}restoreconnectFromTopic(e){return r(this,void 0,void 0,function*(){this.isWsConnector(this.getConnector())&&(yield this.getConnector().restoreconnectFromTopic(e))})}getCurrentConnectionReady(e){var t;return!!(null===(t=this.getConnector())||void 0===t?void 0:t.getCurrentConnectionReady(e))}connectManagerDisconnect(){return r(this,arguments,void 0,function*(e=!1){var t;yield null===(t=this.getConnector())||void 0===t?void 0:t.connectManagerDisconnect(e)})}sendSession(e){return r(this,void 0,void 0,function*(){(0,a.logDebug)("[Connect] sendSession called:",e);let t=Date.now().toString(),n={method:"session_info",params:{protocolVersion:i.CONNECT_PROTOCOL_VER,sessionInfo:e}};yield this.connectionManager.sendRaw(JSON.stringify(Object.assign(Object.assign({},n),{requestId:t})))})}addConnectionListener(){var e;null===(e=this.connectionManager)||void 0===e||e.addListener("sdk_response",(e,t)=>{var n=(0,a.safeJsonParse)(t);(0,a.logDebug)(`Engine ==>> addListener ==> success ==> ${n}`),"connect"===n.method||"connect_error"===n.method?this.connectResultListener&&this.connectResultListener(n):"session_connecting"===n.method&&((0,a.logDebug)("Engine ==>> handleResponse_4 ===> sessionConnectingListener"),this.sessionConnectingListener&&((0,a.logDebug)("Engine ==>> handleResponse_4 ===> sessionConnectingListener not null"),this.sessionConnectingListener(),this.sessionConnectingListener=void 0))},function(){})}}t.Engine=d},3301:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=t.Engine=t.WalletConnectionManager=t.ConnectionManager=t.OKXWalletConnector=void 0;var r=n(86438);Object.defineProperty(t,"OKXWalletConnector",{enumerable:!0,get:function(){return r.OKXWalletConnector}});var o=n(1936);Object.defineProperty(t,"ConnectionManager",{enumerable:!0,get:function(){return o.ConnectionManager}});var i=n(93497);Object.defineProperty(t,"WalletConnectionManager",{enumerable:!0,get:function(){return i.WalletConnectionManager}});var a=n(50849);Object.defineProperty(t,"Engine",{enumerable:!0,get:function(){return a.Engine}});var s=n(41588);Object.defineProperty(t,"Storage",{enumerable:!0,get:function(){return s.Storage}})},28655:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||(r=function(e){return(r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),a=0;a<n.length;a++)"default"!==n[a]&&o(t,e,n[a]);return i(t,e),t}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})}
1,c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MULTICODEC_ED25519_LENGTH=t.MULTICODEC_ED25519_HEADER=t.MULTICODEC_ED25519_BASE=t.MULTICODEC_ED25519_ENCODING=t.DID_METHOD=t.DID_PREFIX=t.DID_DELIMITER=t.KEY_PAIR_SEED_LENGTH=t.DATA_ENCODING=t.JSON_ENCODING=t.JWT_ENCODING=t.JWT_DELIMITER=t.JWT_IRIDIUM_TYP=t.JWT_IRIDIUM_ALG=t.JWTHeaderType=void 0,t.generateKeyPair=function(){return h.default.sign.keyPair()},t.decodeJSON=p,t.encodeJSON=v,t.encodeIss=m,t.decodeIss=y,t.encodeSig=C,t.decodeSig=O,t.encodeData=b,t.decodeData=function(e){var n,r;let o=(0,g.okxtoString)(e,t.DATA_ENCODING).split(t.JWT_DELIMITER);return{header:p(null!==(n=o[0])&&void 0!==n?n:"{}"),payload:p(null!==(r=o[1])&&void 0!==r?r:"{}")}},t.encodeJWT=w,t.decodeJWT=_,t.signJWT=function(e,n,r,o){return s(this,arguments,void 0,function*(e,n,r,o,i=Math.floor(Date.now())){let a={alg:t.JWT_IRIDIUM_ALG,typ:t.JWT_IRIDIUM_TYP},s={iss:m(o.publicKey),sub:e,aud:n,act:"authenticate user",iat:i,exp:i+r},c=b({header:a,payload:s});return f.logDebug(`get sec kp: ${o.secretKey} {${o.secretKey.length}}`),w({header:a,payload:s,signature:h.default.sign.detached(c,o.secretKey)})})},t.verifyJWT=function(e){return s(this,void 0,void 0,function*(){let{header:n,payload:r,data:o,signature:i}=_(e);if(n.alg!==t.JWT_IRIDIUM_ALG||n.typ!==t.JWT_IRIDIUM_TYP)throw Error("JWT must use EdDSA algorithm");let a=y(r.iss);return l.verify(a,o,i)})};let l=a(n(31050)),u=n(2145),d=n(77573),h=c(n(50780)),f=a(n(72465)),g=n(73813);function p(e){return(0,u.safeJsonParse)((0,g.okxtoString)((0,g.okxfromString)(e,t.JWT_ENCODING),t.JSON_ENCODING))}function v(e){return(0,g.okxtoString)((0,g.okxfromString)((0,u.safeJsonStringify)(e),t.JSON_ENCODING),t.JWT_ENCODING)}function m(e){f.logDebug(`publicKey: ${(0,d.toHexString)(e)}`);var n=(0,g.okxtoString)(e,t.MULTICODEC_ED25519_ENCODING);return[t.DID_PREFIX,t.DID_METHOD,n].join(t.DID_DELIMITER)}function y(e){let[n,r,o]=e.split(t.DID_DELIMITER);if(n!==t.DID_PREFIX||r!==t.DID_METHOD)throw Error('Issuer must be a DID with method "key"');if(void 0===o)throw Error("multicodec is undefined");let i=(0,g.okxfromString)(o,t.MULTICODEC_ED25519_ENCODING);if(void 0===i||i.length!==t.MULTICODEC_ED25519_LENGTH)throw Error("Issuer must be a public key with length 32 bytes");return i}function C(e){return(0,g.okxtoString)(e,t.JWT_ENCODING)}function O(e){return(0,g.okxfromString)(e,t.JWT_ENCODING)}function b(e){return(0,g.okxfromString)([v(e.header),v(e.payload)].join(t.JWT_DELIMITER),t.DATA_ENCODING)}function w(e){return[v(e.header),v(e.payload),C(e.signature)].join(t.JWT_DELIMITER)}function _(e){var n,r,o;let i=e.split(t.JWT_DELIMITER),a=p(null!==(n=i[0])&&void 0!==n?n:"{}");return{header:a,payload:p(null!==(r=i[1])&&void 0!==r?r:"{}"),signature:O(null!==(o=i[2])&&void 0!==o?o:"{}"),data:(0,g.okxfromString)(i.slice(0,2).join(t.JWT_DELIMITER),t.DATA_ENCODING)}}t.JWTHeaderType="dapp",t.JWT_IRIDIUM_ALG="EdDSA",t.JWT_IRIDIUM_TYP="JWT",t.JWT_DELIMITER=".",t.JWT_ENCODING="base64url",t.JSON_ENCODING="utf8",t.DATA_ENCODING="utf8",t.KEY_PAIR_SEED_LENGTH=32,t.DID_DELIMITER=":",t.DID_PREFIX="did",t.DID_METHOD="key",t.MULTICODEC_ED25519_ENCODING="base58btc",t.MULTICODEC_ED25519_BASE="z",t.MULTICODEC_ED25519_HEADER="K36",t.MULTICODEC_ED25519_LENGTH=32},82779:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}
1),t.OKXCONNECTOR_JWT_TTL=t.OKXCONNECTOR_JWT_WALLET_SIDE=t.OKXCONNECTOR_JWT_SIDE=void 0,t.OKXCONNECTOR_JWT_SIDE="wallet",t.OKXCONNECTOR_JWT_WALLET_SIDE="dapp",t.OKXCONNECTOR_JWT_TTL=864e5},70802:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildNameSpacesByConnectResponse=function(e){return o(e)},t.buildRequestAccountNameSpacesByConnectResponse=o,t.buildAccountNameSpaces=i;let r=n(72465);function o(e){let t={};(0,r.logDebug)("buildRequestAccountNameSpacesByConnectResponse start connectResponse111>>",JSON.stringify(e));let n=e.payload.responses.find(e=>"requestAccounts"===e.name);if(n&&n.accounts){let e=[];for(let t of n.accounts)"ton"===t.namespace?t.data&&t.data.ton_addr&&t.data.ton_addr.address&&t.data.ton_addr.address.length>0&&((0,r.logDebug)("buildRequestAccountNameSpacesByConnectResponse start TON>>",JSON.stringify(t)),e.push(t)):((0,r.logDebug)("buildRequestAccountNameSpacesByConnectResponse start other>>",JSON.stringify(t)),e.push(t));n.accounts=e}let o=e.payload.responses.find(e=>"ton_addr"===e.name),a=e.payload.responses.find(e=>"ton_proof"===e.name);if(o&&!n){(0,r.logDebug)("buildRequestAccountNameSpacesByConnectResponse adapt ton data >>");let e=o.address;e="ton:"+o.network+":"+e;let t={ton_addr:o};a&&(t.ton_proof=a),n={name:"requestAccounts",accounts:[{namespace:"ton",addresses:[e],methods:["ton_sendTransaction"],extra:{},data:t}]}}return(0,r.logDebug)("buildRequestAccountNameSpacesByConnectResponse end universalResponse>>>",JSON.stringify(n)),i(n.accounts,t),t}function i(e,t){e.forEach(e=>{var n=[],o=[];e.addresses.forEach(e=>{var t=e.split(":");if((0,r.logDebug)("buildRequestAccountNameSpacesByConnectResponse addressArr>>",t.length),t.length>=3){let i=t.slice(0,2).join(":");n.push(i),o.push(e),(0,r.logDebug)("buildRequestAccountNameSpacesByConnectResponse chain:>>",i,"addressItem:",e)}}),e.data&&e.data.ton_addr&&(e.data.ton_addr.name="ton_addr"),e.data&&e.data.ton_proof&&(e.data.ton_proof.name="ton_proof"),t[e.namespace]={chains:n,accounts:o,methods:e.methods,extra:e.extra,payload:e.data},(0,r.logDebug)("buildRequestAccountNameSpacesByConnectResponse result>>",JSON.stringify(t))})}},41588:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||(r=function(e){return(r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),a=0;a<n.length;a++)"default"!==n[a]&&o(t,e,n[a]);return i(t,e),t}),s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=void 0;let c=n(24214),l=s(n(50780)),u=n(77573),d=n(34959),h=a(n(72465)),f=n(34959),g=n(81354);class p{constructor(e,t){let n=(0,u.resolveLocalStorage)();this.storeKey="",this.cipherIV="",this.subKey=e,h.logDebug("--------get current local storage --------"),h.logDebug(n);let r=n.getItem(p.cacheKey+e);if(null==r){h.logDebug("with no cache"),this.cache={};return}if(h.logDebug(r),(null==r?void 0:r.length)>0){var o=(0,d.safeJsonParse)(r);this.cache=o}h.logDebug(`get cache obj: ${this.cache}`),(void 0===this.cache||null==this.cache)&&(this.cache={})}
1checkAndUpgradeCache(e,t){if(e&&e.length>0&&t&&t.length>0){h.logDebug("--------get current local storage --------"),h.logDebug(localStorage);let n=localStorage.getItem(p.cacheKey+e);if(null==n){h.logDebug("no pre cache content");return}h.logDebug(n),(null==n?void 0:n.length)>0&&(h.logDebug("write in cache content: ",e,"->",t),localStorage.setItem(p.cacheKey+t,n),h.logDebug("clean in cache content: ",e),localStorage.removeItem(p.cacheKey+e))}else h.logDebug("no pre cache key:",e)}saveContent(e,t,n="-"){let r={id:n,timestamp:Date.now().toString(),content:e};this.saveItem(r,t)}saveItem(e,t){let n=p.cacheKey+this.subKey,r=(0,u.resolveLocalStorage)();h.logDebug(this.cache),h.logDebug(`get cache obj: ${this.cache}, ${t}, ${e}`),this.cache[t]=e;let o=(0,d.safeJsonStringify)(this.cache);h.logDebug(`STORAGE: ${t} @ ${this.cache}`),r.setItem(n,o)}getItem(e){return h.logDebug(`STORAGE >> getItem: ${e} @ ${this.cache}`),this.cache[e]}getCachedPBKDF2InfoKey(){var e,t,n,r;if(this.storeKey.length>0&&(null===(e=this.cipherIV)||void 0===e?void 0:e.length)>0)return{pw:this.storeKey,iv:this.cipherIV};let o=null===(t=this.getItem(c.OKXCONNECTOR_STORAGER_CRYPTO_SALT))||void 0===t?void 0:t.content;o||(o=(0,u.toHexString)(l.default.randomBytes(24)),this.saveContent(o,c.OKXCONNECTOR_STORAGER_CRYPTO_SALT));let i=null===(n=this.getItem(c.OKXCONNECTOR_STORAGE_CRYPTO_PASSWORD))||void 0===n?void 0:n.content;i||(i=(0,u.toHexString)(l.default.randomBytes(32)),this.saveContent(i,c.OKXCONNECTOR_STORAGE_CRYPTO_PASSWORD));let a=null===(r=this.getItem(c.OKXCONNECTOR_STORAGE_CRYPTO_CIPHERIV))||void 0===r?void 0:r.content;if(!a){let e=l.default.randomBytes(16);a=(0,u.toHexString)(e),this.saveContent(a,c.OKXCONNECTOR_STORAGE_CRYPTO_CIPHERIV)}return this.cipherIV=a,this.storeKey=(0,g.PBKDF2)(i,o,{iterations:10}).toString(),{pw:this.storeKey,iv:this.cipherIV}}encryptStoreMsg(e,t){(0,f.logDebug)(`encryptStoreMsg encryptStoreMsg start ${Date.now()}`);let n=this.getCachedPBKDF2InfoKey();(0,f.logDebug)(`encryptStoreMsg encryptStoreMsg mid ${Date.now()}`);var r=g.AES.encrypt(e,n.pw).toString();this.saveContent(r,t),(0,f.logDebug)(`encryptStoreMsg encryptStoreMsg end ${Date.now()}`)}getAndDecrypt(e){(0,f.logDebug)(`encryptStoreMsg getAndDecrypt start ${Date.now()}`);let t=this.getItem(e);if(t&&t.content){let e=this.getCachedPBKDF2InfoKey();(0,f.logDebug)(`encryptStoreMsg getAndDecrypt mid ${Date.now()}`);let n=g.AES.decrypt(t.content,e.pw).toString(g.enc.Utf8);return(0,f.logDebug)(`encryptStoreMsg getAndDecrypt end ${Date.now()}`),n}return null}clearCache(e){if(void 0===e){let e=(0,u.resolveLocalStorage)();this.cache={};let t=p.cacheKey+this.subKey;e.setItem(t,"")}else{let t=p.cacheKey+this.subKey,n=(0,u.resolveLocalStorage)();h.logDebug(this.cache),this.cache[e]=null;let r=(0,d.safeJsonStringify)(this.cache);h.logDebug(`STORAGE: clean key ${e} @ ${this.cache}`),n.setItem(t,r)}}}t.Storage=p,p.cacheKey="OKXStorageKey"},24214:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OKXCONNECTOR_STORAGE_PROTOCOL_CACHE=t.OKXCONNECTOR_STORAGE_CIPHER_METHOD=t.OKXCONNECTOR_STORAGE_CRYPTO_CIPHERIV=t.OKXCONNECTOR_STORAGER_CRYPTO_SALT=t.OKXCONNECTOR_STORAGE_CRYPTO_PASSWORD=t.OKXCONNECTOR_TON_KEY=t.OKXCONNECTOR_CRYPTO_SENDER_PK_CACHE=t.OKXCONNECTOR_TOKEN_CACHE=t.OKXCONNECTOR_JWT_KEY=t.OKXCONNECTOR_SESSION_PREFIX_KEY=t.OKXCONNECTOR_CRYPTO_KEY=t.OKXCONNECTOR_CACHE_KEY_DAPP=t.OKXCONNECTOR_CACHE_KEY=void 0,t.OKXCONNECTOR_CACHE_KEY="ck",t.OKXCONNECTOR_CACHE_KEY_DAPP="ck_dapp",t.OKXCONNECTOR_CRYPTO_KEY="cck_k",t.OKXCONNECTOR_SESSION_PREFIX_KEY="cspk_",t.OKXCONNECTOR_JWT_KEY="cjk_k",t.OKXCONNECTOR_TOKEN_CACHE="ct",t.OKXCONNECTOR_CRYPTO_SENDER_PK_CACHE="csp",t.OKXCONNECTOR_TON_KEY="OKXStorage_ctc",t.OKXCONNECTOR_STORAGE_CRYPTO_PASSWORD="scp",t.OKXCONNECTOR_STORAGER_CRYPTO_SALT="scs",t.OKXCONNECTOR_STORAGE_CRYPTO_CIPHERIV="scpc",t.OKXCONNECTOR_STORAGE_CIPHER_METHOD="aes-256-cbc",t.OKXCONNECTOR_STORAGE_PROTOCOL_CACHE="okx_connect_split_cache_key"},79043:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletConnectionManagerEvent=t.WalletConnectionManagerTopicInfoCacheKey=void 0,t.WalletConnectionManagerTopicInfoCacheKey="wcmtic",t.WalletConnectionManagerEvent={RECEIVE_REQUEST:"payload"}},93497:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);
1(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||(r=function(e){return(r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),a=0;a<n.length;a++)"default"!==n[a]&&o(t,e,n[a]);return i(t,e),t}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletConnectionManager=void 0;let c=n(86438),l=n(94005),u=n(24214),d=n(82779),h=n(98573),f=n(79043),g=n(93057),p=n(26729),v=n(41588),m=n(77573),y=n(23390),C=n(28655),O=n(2145),b=a(n(72465)),w=n(72465),_=n(34959);class E{constructor(){this.events=new p.EventEmitter,this.communicateEvents=new p.EventEmitter,this.splitManager=new g.ConnectionSplitPackages("wallet"),b.logDebug("connect manager construct"),this.connectStorage=new v.Storage(u.OKXCONNECTOR_CACHE_KEY),this.jwtKeyPair=this.getCachedJWTKeyPair(),this.saveJWTKeyPair(this.jwtKeyPair),this.connector=new c.OKXWalletConnector(h.OKXCONNECTOR_WS_URL_1),this.packageId=Date.now(),this.sessionCryptoInfoMap=new Map,this.inLogin=!1,this.isLogined=!1}refreshPackageId(e=0){let t=Date.now()+e;t==this.packageId&&(this.packageId=t+1),this.packageId=t}saveCryptoKeyPair(e,t){let n=(0,O.safeJsonStringify)(t);this.connectStorage.encryptStoreMsg(n,u.OKXCONNECTOR_CRYPTO_KEY+e)}getCachedCryptoKeyPair(e){let t=this.connectStorage.getAndDecrypt(u.OKXCONNECTOR_CRYPTO_KEY+e);return"string"==typeof t?(b.logDebug("get cached crypto key:"),b.logDebug(t),(0,O.safeJsonParse)(t)):(this.connectStorage.clearCache(),null)}saveJWTKeyPair(e){var t={publicKey:(0,m.toHexString)(e.publicKey),secretKey:(0,m.toHexString)(e.secretKey)};b.logDebug("save jwt kp");let n=(0,O.safeJsonStringify)(t);b.logDebug(n),this.connectStorage.encryptStoreMsg(n,u.OKXCONNECTOR_JWT_KEY),b.logDebug("after save jwt kp")}getCachedJWTKeyPair(){let e=this.connectStorage.getAndDecrypt(u.OKXCONNECTOR_JWT_KEY);if("string"!=typeof e)return(0,C.generateKeyPair)();{b.logDebug("get cached jwt kp:"),b.logDebug(e);let t=(0,O.safeJsonParse)(e);return b.logDebug("save jwt kp"),b.logDebug(t),{publicKey:(0,m.hexToByteArray)(t.publicKey),secretKey:(0,m.hexToByteArray)(t.secretKey)}}}isTopicPublicKeyExist(e){return b.logDebug(`isTopicPublicKeyExist ===> ${e}`),this.sessionCryptoInfoMap.get(e)}makeJWT(e){return s(this,void 0,void 0,function*(){return yield(0,C.signJWT)(e,d.OKXCONNECTOR_JWT_WALLET_SIDE,d.OKXCONNECTOR_JWT_TTL,this.jwtKeyPair)})}parseInternalMsg(e){try{let t=(0,O.safeJsonParse)(e)["ivur-igbfft-ptjip"];if(t&&t.length>0)return(0,_.base64decode)(t,!0).toString()}catch(e){b.logError("parse internal msg",e)}}updateClientId(e,t){let n=this.sessionCryptoInfoMap.get(e);if((0,w.logDebug)("updateClientId",n,e,t),n&&t&&t.length>0){if(n.cid){let r=(0,m.getLastSixMd5Hash)(t);n.cid==r?n.dappPublicKey=t:b.logError("cid check failed",n,e,t)}else n.dappPublicKey=t;this.syncCacheSessionInfo()}return!1}parsePackage(e,t){return s(this,arguments,void 0,function*(e,t,n=!1){var r,o,i,a,c,l,u,d,h,f,g,p,v,m,y,C,E;this.events.emit(t.id,t);let R=this.sessionCryptoInfoMap.get(e);b.logDebug("get sessionInfo for decrypt topic:",e),b.logDebug("get sessionInfo for decrypt:",t.id,e,R,this.sessionCryptoInfoMap);let N=!1;if(R&&t.params.data&&(null===(r=t.params.data)||void 0===r?void 0:r.message)){if(null===(o=t.params.data)||void 0===o?void 0:o.isInternalData){let e=null===(i=t.params.data)||void 0===i?void 0:i.message,n=null===(a=t.params.data)||void 0===a?void 0:a.topic,r=this.parseInternalMsg(e);(0,w.logDebug)("parse internal origin: ",r),r&&r.length>0&&this.communicateEvents.emit("origin",r,n)}else try{let n=null===(c=t.params.data)||void 0===c?void 0:c.message;if(n.trimStart().startsWith("{")){let r=this.splitManager.tryParseMessageSplitPayload(n);if(r){(0,w.logDebug)("parse split msg object: ",r),N=!0;let n={topicId:null===(u=null===(l=t.params)||void 0===l?void 0:l.data)||void 0===u?void 0:u.topic,messageId:null===(h=null===(d=t.params)||void 0===d?void 0:d.data)||void 0===h?void 0:h.messageId,messageObject:r,publishedAt:null===(g=null===(f=t.params)||void 0===f?void 0:f.data)||void 0===g?void 0:g.publishedAt}
1,o=yield this.splitManager.onReceivedPackageCheck(n);if(o.completeMessageIdList&&o.completeMessageIdList.forEach(t=>s(this,void 0,void 0,function*(){this.refreshPackageId(),yield this.sendReceive(this.packageId.toString(),t,e)})),o.finalMessage){let t=R.crypto.decryptWallet(o.finalMessage,R.dappPublicKey);(0,w.logDebug)("<<< receive msg from split:",e,t),this.communicateEvents.emit(e,t)}}else{let t=(0,O.safeJsonParse)(n);if(t.method){if("session_info"==t.method){let n=t.params.sessionInfo,r=(0,_.base64decode)(n,!1);(0,w.logDebug)("wallet connection manager requset base64Content:",r),(0,w.logDebug)("base64Content:"+r);let o=r.toObject();this.updateClientId(e,o.clientId)}(0,w.logDebug)("<<< parse raw msg:",e,t),this.communicateEvents.emit(e,n)}}}else{let n=R.crypto.decryptWallet(null===(p=t.params.data)||void 0===p?void 0:p.message,R.dappPublicKey);(0,w.logDebug)("<<< receive msg:",e,n),this.communicateEvents.emit(e,n)}}catch(r){let n=R.crypto.decryptWallet(null===(v=t.params.data)||void 0===v?void 0:v.message,R.dappPublicKey);(0,w.logDebug)("<<< receive msg:",e,n),this.communicateEvents.emit(e,n)}}!n&&(yield this.sendACK(t.id,!0),e&&!N&&(null===(y=null===(m=t.params)||void 0===m?void 0:m.data)||void 0===y?void 0:y.messageId)&&(this.refreshPackageId(),yield this.sendReceive(this.packageId.toString(),null===(E=null===(C=t.params)||void 0===C?void 0:C.data)||void 0===E?void 0:E.messageId,e)))})}recovrySessionInfoFromCache(){let e=this.connectStorage.getAndDecrypt(f.WalletConnectionManagerTopicInfoCacheKey);if(b.logDebug("get cached sessionInfos:",e),e){let t=(0,O.safeJsonParse)(e);for(let e in t){let n=t[e];b.logDebug("make topicItem:",n);let r={topic:e,crypto:new y.SessionCrypto({publicKey:n.cryptoKeyPair.publicKey,secretKey:n.cryptoKeyPair.secretKey}),dappPublicKey:n.dappPublicKey,cid:n.cid};this.sessionCryptoInfoMap.set(e,r)}}b.logDebug("get cached sessionInfos map:",this.sessionCryptoInfoMap)}syncCacheSessionInfo(){let e={};for(let[t,n]of this.sessionCryptoInfoMap)b.logDebug("for each Keys",t),n&&(e[t]={cryptoKeyPair:n.crypto.stringifyKeypair(),dappPublicKey:n.dappPublicKey,cid:n.cid});let t=(0,O.safeJsonStringify)(e);b.logDebug("sync cache sessionInfos:",t),this.connectStorage.encryptStoreMsg(t,f.WalletConnectionManagerTopicInfoCacheKey)}cacheSessionInfo(e,t,n=!0){let r=t.dappPublicKey,o=[];for(let[e,t]of this.sessionCryptoInfoMap)b.logDebug("for each Keys",e),t.dappPublicKey==r&&(b.logDebug("duplicated dapp public key:",e,r),o.push(e));for(let[e,t]of this.sessionCryptoInfoMap)o.includes(e)&&this.sessionCryptoInfoMap.delete(e);return b.logDebug("cleaned connect session cache:",this.sessionCryptoInfoMap),this.sessionCryptoInfoMap.set(e,t),b.logDebug("cache sessionInfo:",e,t,this.sessionCryptoInfoMap),n&&this.syncCacheSessionInfo(),o}updateProtocolVersion(e,t){this.splitManager.updateTopicSenderVersion(e,t)}appendTopic(e,t,n){return s(this,void 0,void 0,function*(){return(0,w.logDebug)("4.1. get append Topic:",e),new Promise((r,o)=>s(this,void 0,void 0,function*(){if(!this.isLogined){var i=Error();i.message="connection is not logined",i.name="append error",o(i);return}let a={topic:e,crypto:new y.SessionCrypto,dappPublicKey:t||"",cid:n},s=this.cacheSessionInfo(e,a,!1);yield this.subscribeTopics(Array.from([e])),this.refreshPackageId(),b.logDebug(`5. subscribe callback then fetch append message: ${this.packageId}, ${e}`),b.reportLog("5. subscribe callback then fetch append message");let c=new Date().getTime();(0,w.logDebug)("Append --subscribe callback->",c-this.timeLog),r(s)}))})}confirmAppendingTopics(){this.syncCacheSessionInfo()}connect(){return s(this,void 0,void 0,function*(){this.timeLog=new Date().getTime(),(0,w.logDebug)("[Wallet] ConnectTime---enter->",this.timeLog),b.reportLog("wallet connect connect called");let e=Date.now().toString();var t=yield this.makeJWT(e);return b.logDebug(`generate jwt token: ${t}`),this.connectStorage.saveContent(t,"jwt"),this.recovrySessionInfoFromCache(),new Promise((e,n)=>{this.inLogin=!0,this.connector.onOpen(()=>s(this,void 0,void 0,function*(){b.logDebug("1. connector on open"),b.reportLog("1. wallet connect connect on open");let r=new Date().getTime();(0,w.logDebug)("ConnectTime---open->",r-this.timeLog),this.events.once(this.packageId.toString(),t=>s(this,void 0,void 0,function*(){if(t&&t.error){b.logError("failed when login"),yield this.connector.disconnect();var r=Error();r.message=t.error.message,r.name=t.error.code.toString(),n(r)}else this.isLogined=!0,e(),b.logDebug("3. subscribe cached topics",this.sessionCryptoInfoMap),b.reportLog("3. wallet connect connect subscribe cached topics"),this.sessionCryptoInfoMap.size>0&&(yield this.subscribeTopics(Array.from(this.sessionCryptoInfoMap.keys())))})),b.logDebug("2. login called"),b.reportLog("2. wallet connect login called"),yield this.connector.send(()=>s(this,void 0,void 0,function*(){return b.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()}),{id:this.packageId.toString(),jsonrpc:h.CONNECT_JSONRPC_VER,method:l.CONNECT_METHOD_LOGIN,params:{token:t}})})),this.connector.connect().catch(e=>{(0,w.logDebug)("WalletConnectionManager connect error",e),n(e)}),this.connector.addPackageParse(e=>{var t,n;if(b.logDebug("connect: parse package"),b.logDebug(e),!("params"in e)||!("data"in e.params)){this.parsePackage("",e,!0);return}(null===(t=e.params.data)||void 0===t?void 0:t.topic)&&this.parsePackage(null===(n=e.params.data)||void 0===n?void 0:n.topic,e,e.method===l.CONNECT_METHOD_RECEIVE)})})})}getSessionPublicKey(e){if(this.isTopicPublicKeyExist(e)){let t=this.sessionCryptoInfoMap.get(e);if(t)return(0,m.toHexString)(t.crypto.keyPair.publicKey)}}getCurrentCachedTopicIdList(){return Array.from(this.sessionCryptoInfoMap.keys())}disconnect(){return s(this,arguments,void 0,function*(e=!1){yield this.connector.disconnect(),this.connectStorage.clearCache(u.OKXCONNECTOR_TOKEN_CACHE),e||this.connectStorage.clearCache(u.OKXCONNECTOR_CRYPTO_SENDER_PK_CACHE)})}sendRaw(e,t){return s(this,void 0,void 0,function*(){t&&(yield this.sendMsg(t,e,h.OKXCONNECTOR_MESSAGE_TTL))})}sendMsg(e,t,n){return s(this,void 0,void 0,function*(){if(t){this.refreshPackageId();let r={id:this.packageId.toString(),method:l.CONNECT_METHOD_PUBLISH,jsonrpc:h.CONNECT_JSONRPC_VER,params:{message:{topic:e,message:t,ttl:n}}};this.events.once(this.packageId.toString(),e=>s(this,void 0,void 0,function*(){e&&e.error?b.logError(`@${new Date().toUTCString()} >>> failed when send msg`):e&&!e.error&&b.logDebug(`CONNECTION @[${new Date().toUTCString()}] >>> send msg with id ${this.packageId} successed`)})),yield this.connector.send(()=>s(this,void 0,void 0,function*(){return b.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()}),r)}})}send(e,t){return s(this,arguments,void 0,function*(e,t,n=!1,r=h.OKXCONNECTOR_MESSAGE_TTL,o=!1){var i,a;let s;if(b.logDebug(`message send =====> ${t}`),!this.isTopicPublicKeyExist(e))throw Error("connection not finish");let c=null===(i=this.sessionCryptoInfoMap.get(e))||void 0===i?void 0:i.dappPublicKey,l=null===(a=this.sessionCryptoInfoMap.get(e))||void 0===a?void 0:a.crypto;o&&(s={message:t});let u=!1;if(l&&c&&!o&&(u=!0,s={message:l.encryptWallet(t,c)}),s){n&&l&&(s.clientId=(0,m.toHexString)(l.keyPair.publicKey));let t=(0,O.safeJsonStringify)(s);!o&&u?yield this.splitManager.sendSplitPackages(e,t,this.sendMsg.bind(this),this.sendRaw.bind(this)):yield this.sendMsg(e,t,r)}})}
1sendACK(e,t){return s(this,arguments,void 0,function*(e,t,n){if(!0===t){let t={id:e,jsonrpc:h.CONNECT_JSONRPC_VER,result:!0};yield this.connector.send(()=>s(this,void 0,void 0,function*(){return b.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()}),t)}else if(n){let t={id:e,jsonrpc:h.CONNECT_JSONRPC_VER,error:{code:n.code,message:n.message}};yield this.connector.send(()=>s(this,void 0,void 0,function*(){return b.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()}),t)}})}sendReceive(e,t,n){return s(this,void 0,void 0,function*(){let r={id:e,jsonrpc:h.CONNECT_JSONRPC_VER,method:l.CONNECT_METHOD_RECEIVE,params:{data:{messageId:t,topic:n}}};yield this.connector.send(()=>s(this,void 0,void 0,function*(){return b.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()}),r)})}sendUnsubscribe(e){return s(this,void 0,void 0,function*(){yield this.connector.send(()=>s(this,void 0,void 0,function*(){return b.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()}),{id:this.packageId.toString(),jsonrpc:h.CONNECT_JSONRPC_VER,method:l.CONNECT_METHOD_UNSUB,params:{topic:e}}),this.sessionCryptoInfoMap.delete(e),this.syncCacheSessionInfo()})}sendFetchAndConsumeMessages(e,t){return s(this,void 0,void 0,function*(){this.events.once(e,e=>s(this,void 0,void 0,function*(){var n,r;if(e.result){var o=e.result.hasMore,i=e.result.data;if(i)for(let e=0;e<i.length;e++){let n=i[e];if(n&&n.topic==t){let e=n.messageId;yield this.connector.getMsgPayloadFromHistory(n),this.refreshPackageId(),yield this.sendReceive(this.packageId.toString(),e,t)}}o&&(this.refreshPackageId(),yield this.sendFetchAndConsumeMessages(this.packageId.toString(),t))}else b.logDebug(`CONNECT: get error rsp ${null===(n=e.error)||void 0===n?void 0:n.code} : ${null===(r=e.error)||void 0===r?void 0:r.message}`)})),b.logDebug("5. send fetch more");let n=new Date().getTime();(0,w.logDebug)("ConnectTime---5->",n-this.timeLog);let r={id:e,jsonrpc:h.CONNECT_JSONRPC_VER,method:l.CONNECT_METHOD_FETCHMSG,params:{data:{topic:t}}};yield this.connector.send(()=>s(this,void 0,void 0,function*(){return b.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()}),r)})}sendBatchFetchAndConsumeMessages(e,t){return s(this,void 0,void 0,function*(){this.events.once(e,e=>s(this,void 0,void 0,function*(){var n,r;if(e.result){var o=e.result.hasMore,i=e.result.data;if(i)for(let e=0;e<i.length;e++){let t=i[e];if(t&&t.topic){if(this.splitManager.tryParseMessageSplitPayload(t.message))yield this.connector.getMsgPayloadFromHistory(t);else{let n=t.messageId;yield this.connector.getMsgPayloadFromHistory(t),this.refreshPackageId(e),yield this.sendReceive(this.packageId.toString(),n,t.topic)}}}o&&(this.refreshPackageId(),yield this.sendBatchFetchAndConsumeMessages(this.packageId.toString(),t))}else b.logDebug(`CONNECT: get error rsp ${null===(n=e.error)||void 0===n?void 0:n.code} : ${null===(r=e.error)||void 0===r?void 0:r.message}`)})),b.logDebug("5. send fetch more"),b.reportLog("5. send fetch more");let n=new Date().getTime();(0,w.logDebug)("ConnectTime---5->",n-this.timeLog);let r={id:e,jsonrpc:h.CONNECT_JSONRPC_VER,method:l.CONNECT_METHOD_BATCH_FETCHMSG,params:{topics:t,withInternalData:!0}
1};yield this.connector.send(()=>s(this,void 0,void 0,function*(){b.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()}),r)})}cleanCache(){return s(this,void 0,void 0,function*(){this.connectStorage.clearCache()})}saveSessionContent(e,t){t||this.connectStorage.clearCache(u.OKXCONNECTOR_SESSION_PREFIX_KEY+e);let n=(0,O.safeJsonStringify)(t);this.connectStorage.encryptStoreMsg(n,u.OKXCONNECTOR_SESSION_PREFIX_KEY+e)}getSessionContent(e){let t=this.connectStorage.getAndDecrypt(u.OKXCONNECTOR_SESSION_PREFIX_KEY+e);if(t)return(0,O.safeJsonParse)(t)}subscribeTopics(e){return s(this,void 0,void 0,function*(){(0,w.logDebug)("4. topicid list",e),b.reportLog("4. topicid list"),this.refreshPackageId();let t=new Date().getTime();return(0,w.logDebug)("ConnectTime--subscribe callback->",t-this.timeLog),new Promise((t,n)=>s(this,void 0,void 0,function*(){let n=0;for(let r=0;r<e.length;++r){let o=e[r];this.refreshPackageId(r),this.events.once(this.packageId.toString(),i=>s(this,void 0,void 0,function*(){if(i&&i.error){b.logError("failed when subscribe"),yield this.connector.disconnect();var a=Error();a.message=i.error.message,a.name=i.error.code.toString(),(n+=1)==e.length&&t()}this.refreshPackageId(r);let s=new Date().getTime();(0,w.logDebug)("ConnectTime--subscribe callback->",s-this.timeLog),(n+=1)==e.length&&(b.logDebug(`5. send fetch msg: ${this.packageId}, ${o}`),yield this.sendBatchFetchAndConsumeMessages(this.packageId.toString(),e),yield this.splitManager.init(this.sendRaw.bind(this)),t())})),b.logDebug(`3. login callback then send subscribe: ${this.packageId}, ${o}`),b.reportLog("3. login callback then send subscribe");let i=new Date().getTime();(0,w.logDebug)("ConnectTime---login callback->",i-this.timeLog),yield this.connector.send(()=>s(this,void 0,void 0,function*(){return b.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()}),{id:this.packageId.toString(),jsonrpc:h.CONNECT_JSONRPC_VER,method:l.CONNECT_METHOD_SUB,params:{topic:o}})}}))})}}t.WalletConnectionManager=E},66375:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AppwalletConnector=void 0;let r=n(38799),o=n(42869),i=n(34959),a=n(82250);class s extends r.WsConnector{static getConnector(){return new s}constructor(){super(),this.walletName="OKX App",this.walletNameKey="walletModal.mobileConnectionModal.connectApp"}getTag(){return o.OKX_APP_WALLET}openWallet(e){var t;if(e&&e.connectRequest){let n=e.connectRequest;if((0,i.logDebug)(`appwallet-connector openwallet before useSHortLink engineConnectInfo.connectRequest JSON ${JSON.stringify(e)}`),(0,i.useShortLink)()){let e=(0,i.getOKXLink)(n);(0,i.openOKXUniversalLink)(e)}else{(0,i.logDebug)(`appwallet-connector openwallet else connectRequest ${n}`);let r=(0,i.encodeConnectParams)(Object.assign(Object.assign({},n),{redirect:null!==(t=e.redirect)&&void 0!==t?t:"none"})),o=(0,i.getAppWalletDeepLink)(r);(0,i.openOKXDeeplinkWithFallback)(o)}}else(0,i.isOS)("android")?(0,i.openDeeplinkWithFallback)(a.stackDeepLink,()=>{}):(0,i.openLinkBlank)(a.standardUniversalLink)}}t.AppwalletConnector=s},42869:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OKX_TG_WALLET=t.OKX_APP_WALLET=t.OKX_INJECT_WALLET=void 0,t.OKX_INJECT_WALLET="okx_inject_wallet",t.OKX_APP_WALLET="okx_app_wallet",t.OKX_TG_WALLET="okx_tg_wallet"},29473:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OkxwalletInjectConnector=t.WsConnector=t.TgwalletConnector=t.InjectConnector=t.OKX_INJECT_WALLET=t.OKX_APP_WALLET=t.OKX_TG_WALLET=t.AppwalletConnector=void 0;var r=n(66375);Object.defineProperty(t,"AppwalletConnector",{enumerable:!0,get:function(){return r.AppwalletConnector}});var o=n(42869);Object.defineProperty(t,"OKX_TG_WALLET",{enumerable:!0,get:function(){return o.OKX_TG_WALLET}}),Object.defineProperty(t,"OKX_APP_WALLET",{enumerable:!0,get:function(){return o.OKX_APP_WALLET}}),Object.defineProperty(t,"OKX_INJECT_WALLET",{enumerable:!0,get:function(){return o.OKX_INJECT_WALLET}});var i=n(75384);Object.defineProperty(t,"InjectConnector",{enumerable:!0,get:function(){return i.InjectConnector}});var a=n(33507);Object.defineProperty(t,"TgwalletConnector",{enumerable:!0,get:function(){return a.TgwalletConnector}});var s=n(38799);Object.defineProperty(t,"WsConnector",{enumerable:!0,get:function(){return s.WsConnector}});var c=n(25545);Object.defineProperty(t,"OkxwalletInjectConnector",{enumerable:!0,get:function(){return c.OkxwalletInjectConnector}})},75384:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
1ise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.InjectConnector=void 0;let o=n(11352),i=n(34959),a=n(42869),s=n(27085),c=n(16411),l=n(34093),u=n(68051),d=n(11998),h=n(84524),f=n(31580),g=n(77573),p=n(70802);class v{constructor(){this.disconnectListener=[],this.providerMap=new Map,this.accountChangedEVMHandler=null,this.accountChangedSolanaPublicKeyHandler=null,this.accountChangedTONHandler=null,this.disconnectHandler=null,this.walletName="",this.walletNameKey="",this.enable=!0,this.providerMap.set(o.NameSpaceKeyEip155,new h.Eip155Provider),this.providerMap.set(o.NameSpaceKeySOL,new s.SolProvider),this.providerMap.set(o.NameSpaceKeyAptos,new l.AptosProvider),this.providerMap.set(o.NameSpaceKeyTON,new d.TONProvider),this.providerMap.set(o.NameSpaceKeySui,new f.SuiProvider)}setAccountChangeListener(e){(0,i.logDebug)("setAccountChangeListener: inject",e),this.accountChangeListener=e}setConnectionManager(e){this.connectionManager=e}getInjectProvider(e){for(let[t,n]of this.providerMap.entries())if(e.includes(t))return n}openWallet(e){return r(this,void 0,void 0,function*(){if((0,i.logDebug)("InjectEngine connect begin:",JSON.stringify(e)),!e)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR);this.dappInfo=e.connectRequest.dAppInfo;var t,n,r,a=e.connectRequest;try{if(window&&window.okxwallet){if(a.requests){let e=a.requests.find(e=>"requestAccounts"===e.name),i=yield window.okxwallet.getVersion(),l={method:"connect",requestId:a.requestId,payload:{wallet:{platform:null!==(t=navigator.platform)&&void 0!==t?t:"/",appName:c.OKXInjectWalletName,appVersion:null!=i?i:"1.0.0",maxProtocolVersion:1},responses:[]}},d={name:"requestAccounts",accounts:[]};l.payload.responses.push(d),yield this.disconnect();let h=null!==(n=e.requiredNamespaces)&&void 0!==n?n:[],f=null!==(r=e.optionalNamespaces)&&void 0!==r?r:[],g=!0,p=!1;if(h.length+f.length===1&&!(0,u.isDevice)("mobile")){let e=1===h.length?h[0]:f[0],t=this.getInjectProvider(e.namespace);yield null==t?void 0:t.connect(e,this.dappInfo),p=!0,g=!1}var s=yield this.getAccountByRequestWallets(g,!1,p,h,f);if(s){if(d.accounts.push(...s),0===d.accounts.length)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"connect connectAccounts is null")}else throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"connect requestWallets is null");this.connectResultListener&&(this.disconnectHandler&&window.okxwallet.removeListener("disconnect",this.disconnectHandler),this.disconnectHandler=()=>{console.log("window.okxwallet disconnect:"),this.disconnectListener.forEach(e=>e()),this.disconnectListener=[]},window.okxwallet.on("disconnect",this.disconnectHandler),this.connectResultListener(l))}}else throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR)}catch(e){var l=o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR;e instanceof o.OKXConnectError&&(l=e.code,e.message),this.connectResultListener&&this.connectResultListener({requestId:"-1",method:"connect_error",payload:{code:l}})}})}disconnect(){return r(this,void 0,void 0,function*(){(0,i.logDebug)("InjectEngine ==>> disconnect okxwallet.disconnect()"),window.okxwallet&&(yield window.okxwallet.disconnect(),(0,i.logDebug)("InjectEngine ==>> disconnect end okxwallet.disconnect()"))})}getRequestId(){let e=Date.now().toString();return(0,i.logDebug)("InjectEngine ==>> getRequestId ==>",e),e}send(e,t){return r(this,void 0,void 0,function*(){var n;try{if((0,i.logDebug)("InjectEngine send > request:",(0,i.safeJsonStringify)(e)),"disconnect"===e.method){yield this.disconnect(),this.disconnectListener.forEach(e=>e()),this.disconnectListener=[],null===(n=t.onAck)||void 0===n||n.call(t);return}yield this.checkWalletMatch();let r=this.getInjectProvider(e.chainId);if(r){r.send(e).then(e=>{var n;(0,i.logDebug)("InjectEngine ==>> send > result:",e),null===(n=t.resolve)||void 0===n||n.call(t,e)}).catch(n=>{var r;let a=n.code;4001===a&&(a=o.OKX_CONNECT_ERROR_CODES.USER_REJECTS_ERROR);let s={requestId:this.getRequestId(),method:e.method,error:{code:a,message:n.message}};(0,i.logDebug)("InjectEngine ==>> send > errorResponse:",JSON.stringify(s)),null===(r=t.resolve)||void 0===r||r.call(t,s)});return}throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED)}catch(e){return(0,i.logDebug)("InjectEngine ==>> send ===> error:",e),Promise.reject(e)}})}checkWalletMatch(){return r(this,void 0,void 0,function*(){return new Promise((e,t)=>
1{var n;let r=null===(n=this.connectionManager)||void 0===n?void 0:n.getSessionContent("connectSession");r||t(new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED)),this.restoreconnect(r,n=>{n?e():t(new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED))})})})}checkAccountChanged(){return r(this,void 0,void 0,function*(){var e;try{let t=null===(e=this.connectionManager)||void 0===e?void 0:e.getSessionContent("connectSession");if(!t)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED);(0,i.logDebug)("inject-connector checkAccountChanged --sessionInfo:",JSON.stringify(t));let n=this.getRequireNameSpaceFromSession(t);(0,i.logDebug)("inject-connector checkAccountChanged --requiredNamespaces:",JSON.stringify(n));let r=yield this.getAccountByRequestWallets(!1,!0,!1,n,[]);if((0,i.logDebug)("inject-connector checkAccountChanged --accounts:",JSON.stringify(r)),r){let e={};(0,p.buildAccountNameSpaces)(r,e),this.compareAndModifyNamespaces(t.namespaces,e)||((0,i.logDebug)("inject-connector checkAccountChanged --result sessionLocal:",JSON.stringify(t)),this.accountChangeListener?((0,i.logDebug)("inject-connector checkAccountChanged -accountChangeListener:",this.accountChangeListener),this.accountChangeListener(t)):((0,i.logDebug)("inject-connector checkAccountChanged disconnect:"),yield this.disconnect()))}else throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"connect requestWallets is null")}catch(e){throw(0,i.logDebug)("inject-connector restoreconnect catch error",JSON.stringify(e)),e}})}compareAndModifyNamespaces(e,t){let n=!0;for(let r in e)if(t[r]){let o=e[r],a=t[r];(0,i.logDebug)("inject-connector checkAccountChanged ns1:",JSON.stringify(o)),(0,i.logDebug)("inject-connector checkAccountChanged ns2:",JSON.stringify(a)),JSON.stringify([...o.accounts].sort())!==JSON.stringify([...a.accounts].sort())&&(n=!1,o.accounts=[...a.accounts],o.extra=Object.assign({},a.extra),o.payload=Object.assign({},a.payload)),(0,i.logDebug)("inject-connector checkAccountChanged new ns1:",JSON.stringify(o))}return(0,i.logDebug)(`inject-connector checkAccountChanged compareAndModifyNamespaces ===> ${n}`),n}clearData(){this.connectResultListener=void 0}addDisconnectListener(e){this.disconnectListener.push(e)}setOnConnectResultListener(e){this.connectResultListener=e}connectManagerDisconnect(){return r(this,arguments,void 0,function*(e=!1){})}getCurrentConnectionReady(e){return!!e&&e.every(e=>{var t;return null===(t=this.getInjectProvider(e))||void 0===t?void 0:t.connectReady()})}getTag(){return a.OKX_INJECT_WALLET}toJSON(){return"inject-connector"}getRequireNameSpaceFromSession(e){var t,n,r=[];for(let i in e.namespaces){let a=e.namespaces[i],s={namespace:i,chains:a.chains};if(i===o.NameSpaceKeyAptos){let e=[];a.chains.forEach(t=>{let n=(0,g.replaceChainNameToChainId)(t);e.push(n)}),s={namespace:i,chains:e}}else if(i===o.NameSpaceKeyTON){let e,r;(null===(t=a.payload)||void 0===t?void 0:t.ton_proof)&&(e=null===(n=a.payload)||void 0===n?void 0:n.ton_proof).proof.payload&&(r={name:"ton_proof",payload:e.proof.payload}),s={namespace:i,chains:a.chains,params:{ton_addr:{name:"ton_addr"},ton_proof:r}}}r.push(s)}return r}restoreconnect(e,t){if(!window.okxwallet){t(null);return}this.dappInfo=null===(n=e.sessionConfig)||void 0===n?void 0:n.dappInfo,(0,i.logDebug)("inject-connector restoreconnect --sessionInfo:",JSON.stringify(e));var n,r=this.getRequireNameSpaceFromSession(e);(0,i.logDebug)("inject-connector restoreconnect --requiredNamespaces:",JSON.stringify(r)),this.getAccountByRequestWallets(!1,!1,!1,r,[]).then(n=>{(0,i.logDebug)("inject-connector restoreconnect --accounts:",JSON.stringify(n));let r=!0;for(let t in e.namespaces){var a=n.find(e=>e.namespace===t),s=e.namespaces[t].accounts;if(!a)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR,"resotreconnect error: accountItem error");a.addresses.length===s.length&&a.addresses.slice().sort().every((e,n)=>{if(t!==o.NameSpaceKeyAptos)return e===s.slice().sort()[n];{let t=s.slice().sort()[n];return(0,i.logDebug)("check aptos address -value and aptosAdd--",e,t),(t=(0,g.replaceChainNameToChainId)(t))===e}})||(r=!1)}if(r)t(e);else throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR,"resotreconnect error: address not as same as session")}
1).catch(e=>{(0,i.logDebug)("inject-connector restoreconnect catch error",JSON.stringify(e)),t(null)})}getAccountByRequestWallets(e,t,n,a,s){return r(this,void 0,void 0,function*(){try{let h;var r=[],c=[];if((0,u.isDevice)("mobile")){var l=yield window.okxwallet.connectWallet(e,{requiredNamespaces:a,optionalNamespaces:s});r.push(l)}else r=yield window.okxwallet.requestWallets(e);var d=[...null!=a?a:[],...null!=s?s:[]];let f=r[0];(0,i.logDebug)(" InjectEngine connect connectAccounts:",JSON.stringify(f));let g=!1;if(d&&f&&f.address)for(let[r,i]of this.providerMap.entries()){let a=yield i.parseConnectResponse(e,t,n,d,f,this.dappInfo);a&&(h=r,c.push(a),r===o.NameSpaceKeyTON&&(g=!0))}let p=a.every(e=>{let t=c.find(t=>t.namespace===e.namespace);return!!t&&e.chains.every(e=>!!t.addresses.find(t=>t.startsWith(e+":")))});if((0,i.logDebug)("InjectEngine connect requiredNamespaces:",JSON.stringify(a)),(0,i.logDebug)("InjectEngine connect accountResult:",JSON.stringify(c)),!p)throw yield this.disconnect(),new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED);return(0,u.isDevice)("mobile")||(this.configEventWithKey(h,g),yield window.okxwallet.requestWallets(e)),c}catch(e){if(e&&"object"==typeof e&&"code"in e&&4001===e.code)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.USER_REJECTS_ERROR);throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR)}})}configEventWithKey(e,t){if(window.okxwallet&&e){if(this.accountChangedEVMHandler&&window.okxwallet.removeListener("accountsChanged",this.accountChangedEVMHandler),this.accountChangedSolanaPublicKeyHandler&&(window.okxwallet.solana.removeListener("accountChanged",this.accountChangedSolanaPublicKeyHandler),window.okxwallet.sui.removeListener("accountChanged",this.accountChangedSolanaPublicKeyHandler)),this.accountChangedTONHandler&&window.okxTonWallet.tonconnect.off("accountChanged",this.accountChangedTONHandler),t)console.log("window.okxwallet configEventWithKey:",e),this.accountChangedTONHandler=()=>{console.log("window.okxwallet configEventWithKey_TON:",Date.now(),e),this.checkAccountChanged().catch(e=>{console.log("window.okxwallet configEventWithKey error: ",e)})},window.okxTonWallet.tonconnect.on("accountChanged",this.accountChangedTONHandler);else switch(e){case o.NameSpaceKeyEip155:console.log("window.okxwallet configEventWithKey:",e),this.accountChangedEVMHandler=t=>{console.log("window.okxwallet configEventWithKey_evm:",Date.now(),e,t),t&&t.length>0&&this.checkAccountChanged().catch(e=>{console.log("window.okxwallet configEventWithKey error: ",e)})},window.okxwallet.on("accountsChanged",this.accountChangedEVMHandler);break;case o.NameSpaceKeySOL:console.log("window.okxwallet configEventWithKey:",e),this.accountChangedSolanaPublicKeyHandler=t=>{console.log("window.okxwallet configEventWithKey_solana:",Date.now(),e,t),t&&this.checkAccountChanged().catch(e=>{console.log("window.okxwallet configEventWithKey error: ",e)})},window.okxwallet.solana.on("accountChanged",this.accountChangedSolanaPublicKeyHandler);break;case o.NameSpaceKeySui:console.log("window.okxwallet configEventWithKey:",e),this.accountChangedSolanaPublicKeyHandler=t=>{console.log("window.okxwallet configEventWithKey_sui:",Date.now(),e,t),t&&this.checkAccountChanged().catch(e=>{console.log("window.okxwallet configEventWithKey error: ",e)})},window.okxwallet.sui.on("accountChanged",this.accountChangedSolanaPublicKeyHandler);break;case o.NameSpaceKeyTON:console.log("window.okxwallet configEventWithKey:",e)}}}}t.InjectConnector=v},25545:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OkxwalletInjectConnector=void 0;let r=n(75384);class o extends r.InjectConnector{static getConnector(){return new o}constructor(){super(),this.walletName="OKX Wallet extension",this.walletNameKey="walletModal.mobileConnectionModal.connectInjected"}}t.OkxwalletInjectConnector=o},33507:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TgwalletConnector=void 0;let r=n(38799),o=n(42869),i=n(34959);class a extends r.WsConnector{static getConnector(){return new a}constructor(){super(),this.walletName="OKX Mini Wallet",this.walletNameKey="walletModal.mobileConnectionModal.connectMini"}getTag(){return o.OKX_TG_WALLET}
1openWallet(e){e&&e.connectRequest&&(n=(0,i.encodeTWAConnectURLParams)(Object.assign(Object.assign({},e.connectRequest),{redirect:"none"})));var t,n,r=(0,i.getTelegramWalletTWAUrl)(n,null!==(t=null==e?void 0:e.tmaReturnUrl)&&void 0!==t?t:"back");(0,i.openOKXTMAWalletlinkWithFallback)(r)}}t.TgwalletConnector=a},38799:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.WsConnector=void 0;let o=n(2145),i=n(72465);class a{constructor(){this.disconnectListener=[],this.walletName="",this.walletNameKey="",this.enable=!0,this.pendingRequests=new Map,(0,i.getDefaultReporter)().beginReport()}setAccountChangeListener(e){this.accountChangeListener=e}setConnectionManager(e){this.connectionManager=e}addConnectionListener(){var e;null===(e=this.connectionManager)||void 0===e||e.addListener("sdk_response",(e,t)=>{var n=(0,o.safeJsonParse)(t);(0,i.logDebug)(`Engine ==>> addListener ==> success ==> ${n}`),this.handleResponse(e,n)},function(){})}addDisconnectListener(e){this.disconnectListener.push(e)}connectManagerDisconnect(){return r(this,arguments,void 0,function*(e=!1){var t;yield null===(t=this.connectionManager)||void 0===t?void 0:t.disconnect(e)})}openWallet(e){}bindRequestForPromise(e,t){this.pendingRequests.set(e,t)}send(e,t,n){return r(this,void 0,void 0,function*(){var r,a;(0,i.logDebug)("Engine ==>> send request==>",JSON.stringify(e));let s=this.getRequestId();try{let c=yield null===(r=this.connectionManager)||void 0===r?void 0:r.send(JSON.stringify(Object.assign(Object.assign({},e),{requestId:s})),n);c&&(null===(a=this.connectionManager)||void 0===a||a.events.once(c.toString(),e=>{var n;(0,i.logDebug)(`Engine ==> send => onAck => ${(0,o.safeJsonStringify)(e)}`),e&&e.result&&(null===(n=t.onAck)||void 0===n||n.call(t))})),t.resolve&&this.bindRequestForPromise(s,t.resolve)}catch(e){return Promise.reject(e)}})}restoreconnect(e,t){return r(this,void 0,void 0,function*(){var n;yield null===(n=this.connectionManager)||void 0===n?void 0:n.restoreConnect(e.topic),t(e)})}restoreconnectFromTopic(e){return r(this,void 0,void 0,function*(){var t;yield null===(t=this.connectionManager)||void 0===t?void 0:t.restoreConnect(e)})}getRequestId(){let e=Date.now().toString();return(0,i.logDebug)("Engine ==>> getRequestId ==>",e),e}handleResponse(e,t){if((0,i.logDebug)(`Engine ==>> handleResponse_1 ======>response: ${(0,o.safeJsonStringify)(t)}`,e),"requestId"in t){(0,i.logDebug)("Engine ==>> handleResponse_2 ===> in response");let e=t.requestId,n=this.pendingRequests.get(e);n?((0,i.logDebug)("Engine ==>> handleResponse_3 ===> find resolve:",n),n(t),this.pendingRequests.delete(e)):((0,i.logDebug)("Engine ==>> handleResponse_3 ===> not find resolve:"),"disconnect"===t.method&&(this.disconnectListener.forEach(e=>e()),this.disconnectListener=[],this.clearData()))}}getCurrentConnectionReady(){var e;return!!(null===(e=this.connectionManager)||void 0===e?void 0:e.getCurrentConnectionReady())}saveSessionContent(e,t){var n;null===(n=this.connectionManager)||void 0===n||n.saveSessionContent(e,t)}getSessionContent(e){var t;return null===(t=this.connectionManager)||void 0===t?void 0:t.getSessionContent(e)}setOnConnectResultListener(e){this.connectResultListener=e}getTag(){return""}toJSON(){return"ws-connector"}clearData(){this.pendingRequests.clear()}}t.WsConnector=a},23390:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SessionCrypto=void 0;let o=r(n(50780)),i=n(77573);class a{constructor(e){this.nonceLength=24,this.sessionKeyPair=e?this.createKeypairFromString(e):this.createKeypair()}createKeypair(){return o.default.box.keyPair()}createKeypairFromString(e){return{publicKey:(0,i.hexToByteArray)(e.publicKey),secretKey:(0,i.hexToByteArray)(e.secretKey)}}createNonce(){return o.default.randomBytes(this.nonceLength)}get keyPair(){return this.sessionKeyPair}encrypt(e,t){let n=new TextEncoder().encode(e),r=this.createNonce(),a=o.default.box(n,r,(0,i.hexToByteArray)(t),this.keyPair.secretKey),s=(0,i.concatUint8Arrays)(r,a);var c=(0,i.toHexString)(s),l=new TextEncoder().encode(c);return(0,i.base64encode)(l,!1)}encryptWallet(e,t){let n=new TextEncoder().encode(e),r=this.createNonce(),a=o.default.box(n,r,(0,i.hexToByteArray)(t),this.keyPair.secretKey),s=(0,i.concatUint8Arrays)(r,a);return(0,i.base64encode)(s,!1)}decrypt(e,t){let n=(0,i.base64decode)(e,!0).toUint8Array(),[r,a]=(0,i.splitToUint8Arrays)(n,this.nonceLength),s=o.default.box.open(a,r,(0,i.hexToByteArray)(t),this.keyPair.secretKey);if(!s)throw Error(`Decryption error: 2 message: ${e.toString()} 3 sender pubkey: ${t.toString()} 4 keypair pubkey: ${(0,i.toHexString)(this.keyPair.publicKey)} 5 keypair secretkey: ${(0,i.toHexString)(this.keyPair.secretKey)}`);return new TextDecoder().decode(s)}decryptWallet(e,t){let n=(0,i.base64decode)(e,!0),r=(0,i.hexToByteArray)(n.toString()),[a,s]=(0,i.splitToUint8Arrays)(r,this.nonceLength),c=o.default.box.open(s,a,(0,i.hexToByteArray)(t),this.keyPair.secretKey);if(!c)throw Error(`Decryption error: 6 message: ${e.toString()} 7 sender pubkey: ${t.toString()} 8 keypair pubkey: ${(0,i.toHexString)(this.keyPair.publicKey)} 9 keypair secretkey: ${(0,i.toHexString)(this.keyPair.secretKey)}`);return new TextDecoder().decode(c)}stringifyKeypair(){return{publicKey:(0,i.toHexString)(this.keyPair.publicKey),secretKey:(0,i.toHexString)(this.keyPair.secretKey)}}}t.SessionCrypto=a},98134:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);
9(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(3301),t),o(n(11352),t),o(n(34959),t),o(n(84524),t),o(n(29473),t)},7039:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SuiMethods=t.TONMethods=t.AptosMethods=t.SOLANAMethods=t.Eip55Methods=void 0,t.hasOKXInjectedProvider=function(){return void 0!==function(e){let t=(e,n)=>{let[r,...o]=n.split("."),i=e[r];if(i)return 0===o.length?i:t(i,o.join("."))};if("undefined"!=typeof window)return t(window,e)}("okxwallet")},t.Eip55Methods=["personal_sign","eth_signTypedData_v4","eth_sendTransaction","wallet_addEthereumChain","wallet_watchAsset","wallet_switchEthereumChain","eth_requestAccounts","eth_accounts","eth_chainId"],t.SOLANAMethods=["solana_signTransaction","solana_signMessage","solana_signAllTransactions","solana_signAndSendTransaction"],t.AptosMethods=["aptos_signMessage","aptos_signTransaction","aptos_signAndSubmitTransaction"],t.TONMethods=["ton_sendTransaction"],t.SuiMethods=["sui_signMessage","sui_signPersonalMessage","sui_signTransactionBlock","sui_signAndExecuteTransactionBlock"]},84524:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(7039),t),o(n(81653),t)},34093:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.AptosProvider=void 0;let o=n(11352),i=n(34959),a=n(7039),s=n(68051);class c{send(e){return r(this,void 0,void 0,function*(){try{let t;(0,i.logDebug)("AptosProvider send request:",(0,i.safeJsonStringify)(e)),yield this.restoreConnect();let n=e.method;switch(n){case"aptos_signMessage":if(e.injectParams){let n=yield window.okxwallet.aptos.signMessage(e.injectParams);return t={method:e.method,result:n.signature},(0,i.logDebug)("AptosProvider send result:",(0,i.safeJsonStringify)(t)),t}throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`param is error method: '${n}'`);case"aptos_signTransaction":{(0,i.logDebug)("AptosProvider Method>>>> :",n);let r=yield window.okxwallet.aptos.signTransaction(e.params);return t={method:e.method,result:r},(0,i.logDebug)("AptosProvider send result:",(0,i.safeJsonStringify)(t)),t}case"aptos_signAndSubmitTransaction":{(0,i.logDebug)("AptosProvider Method>>>> :",n);let r=yield window.okxwallet.aptos.signAndSubmitTransaction(e.params);return t={method:e.method,result:r.hash},(0,i.logDebug)("AptosProvider send result:",(0,i.safeJsonStringify)(t)),t}default:throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,` method: '${n}'`)}}catch(e){throw(0,i.logDebug)("AptosProvider send error:",e),e}})}connectReady(){return!0}disconnect(){}restoreConnect(){return(0,s.isDevice)("mobile")?window.okxwallet.aptos.connect():Promise.resolve()}parseConnectResponse(e,t,n,s,c,l){return r(this,void 0,void 0,function*(){let e=[];s.forEach(t=>{t.namespace===o.NameSpaceKeyAptos&&e.push(...t.chains)});let t=[],n={};if((0,i.logDebug)("AptosProvider parseConnectResponse connectChain",JSON.stringify(e)),e.forEach(e=>{let r=c.address.find(t=>"637"===t.chainId&&637===t.coinType||t.namespaceChainId===e);r&&(t.push(e+":"+r.address),n[e]={publicKey:r.publicKey})}),(0,i.logDebug)("AptosProvider parseConnectResponse addresses",JSON.stringify(t)),t&&t.length>0)return{namespace:o.NameSpaceKeyAptos,addresses:t,methods:[...a.AptosMethods],extra:n}})}connect(e,t){return r(this,void 0,void 0,function*(){return window.okxwallet.aptos.connect()})}}t.AptosProvider=c},27085:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
9ise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SolProvider=void 0;let i=n(11352),a=n(34959),s=o(n(77191)),c=n(68051),l=n(7039);class u{send(e){return r(this,void 0,void 0,function*(){var t;try{let o;yield this.restoreConnect(),(0,a.logDebug)("SolProvider send request:",JSON.stringify(e));let c=e.method;if(e.injectParams)switch(c){case"solana_signMessage":if(e.injectParams&&"object"==typeof e.injectParams&&"message"in e.injectParams){var n=null===(t=e.injectParams)||void 0===t?void 0:t.message;let r=new TextEncoder().encode(n),i=yield window.okxwallet.solana.signMessage(r,"utf8");return o={method:e.method,result:s.default.encode(i.signature)},(0,a.logDebug)("SolProvider send result:",JSON.stringify(i)),o}throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`param is error method: '${c}'`);case"solana_signTransaction":{let t=yield window.okxwallet.solana.signTransaction(e.injectParams);return(0,a.logDebug)("SolProvider send bufferResult:",JSON.stringify(t)),o={method:e.method,injectResult:t},(0,a.logDebug)("SolProvider send result:",(0,a.safeJsonStringify)(o)),o}case"solana_signAllTransactions":{let t=yield window.okxwallet.solana.signAllTransactions(e.injectParams);return(0,a.logDebug)("SolProvider send result:",(0,a.safeJsonStringify)(t)),o={method:e.method,injectResult:t}}case"solana_signAndSendTransaction":var r=yield window.okxwallet.solana.signAndSendTransaction(e.injectParams);return(0,a.logDebug)("SolProvider send result:",(0,a.safeJsonStringify)(r)),o={method:e.method,injectResult:r};default:throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,`method: '${c}'`)}else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`param is error method: '${c}'`)}catch(e){throw(0,a.logDebug)("SolProvider send error:",e),e}})}connectReady(){return!0}disconnect(){}restoreConnect(){return(0,c.isDevice)("mobile")?this.connect(void 0):Promise.resolve()}parseConnectResponse(e,t,n,o,s,c){return r(this,void 0,void 0,function*(){let e=[];o.forEach(t=>{t.namespace===i.NameSpaceKeySOL&&e.push(...t.chains)});let t=[],n={},r={};if(e.forEach(e=>{let o=s.address.find(t=>"501"===t.chainId&&501===t.coinType||t.namespaceChainId===e);o&&(t.push(e+":"+o.address),r&&"publicKey"in r?n[e]=r:n[e]={publicKey:o.publicKey})}),t&&t.length>0){let e={namespace:i.NameSpaceKeySOL,addresses:t,methods:[...l.SOLANAMethods],extra:n};return(0,a.logDebug)("parseConnectResponse nameSpaceResponse :",JSON.stringify(e)),e}})}connect(e,t){return r(this,void 0,void 0,function*(){return window.okxwallet.solana.connect()})}}t.SolProvider=u},11998:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.TONProvider=void 0;let o=n(11352),i=n(34959),a=n(68051),s=n(7039);class c{constructor(){this.signalChainConnectResult=void 0}send(e){return r(this,void 0,void 0,function*(){try{(0,i.logDebug)("TONProvider send request:",(0,i.safeJsonStringify)(e));let t=null;if("ton_sendTransaction"===e.method)e.params&&(t={method:"sendTransaction",params:[JSON.stringify(e.params)],id:Date.now().toString()},(0,i.logDebug)("TONProvider tonParams first:",JSON.stringify(t)));else throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED);if(t){let n=yield window.okxTonWallet.tonconnect.send(t);if((0,i.logDebug)("TONProvider send request result:",(0,i.safeJsonStringify)(n)),n.error)throw new o.OKXConnectError(n.error.code,n.error.message);return{result:n.result,method:e.method}}throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)}catch(e){throw(0,i.logDebug)("TONProvider encountered an error:",e),e}})}connectReady(){return!0}restoreConnect(){return Promise.resolve()}parseConnectResponse(e,t,n,c,l,u){return r(this,void 0,void 0,function*(){try{let r=[];
9c.forEach(e=>{e.namespace===o.NameSpaceKeyTON&&r.push(...e.chains)});let d=[],h={};if(r.forEach(e=>{(0,i.getChainId)(e);let t=l.address.find(t=>"607"===t.chainId&&607===t.coinType||t.namespaceChainId===e);t&&(d.push(e+":"+t.address),h[e]={publicKey:t.publicKey})}),(0,i.logDebug)("tonprovider parseConnectResponse needPop and addresses: ",e,JSON.stringify(d)),d&&d.length>0){let r,l=c.find(e=>e.namespace===o.NameSpaceKeyTON);if((0,i.logDebug)("tonprovider parseConnectResponse ton: ",JSON.stringify(l)),l&&l.params&&u&&u.manifestUrl){this.dappInfo=u;let n=[l.params.ton_addr],o={manifestUrl:u.manifestUrl,items:n};(e||t)&&l.params.ton_proof&&n.push(l.params.ton_proof),(0,i.logDebug)("parseConnectResponse ton connect params: ",JSON.stringify(o)),r=(0,a.isDevice)("mobile")?yield window.okxTonWallet.tonconnect.connect(2,o):e||t?yield window.okxTonWallet.tonconnect.connect(2,o):yield window.okxTonWallet.tonconnect.restoreConnection()}else throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"manifestUrl is nil");if(n&&this.signalChainConnectResult&&(r=this.signalChainConnectResult,this.signalChainConnectResult=void 0),(0,i.logDebug)("parseConnectResponse ton connect result: ",JSON.stringify(r)),r&&l){if("connect_error"===r.event)throw new o.OKXConnectError(r.payload.code,r.payload.message);{let e=r.payload.items.find(e=>"ton_addr"===e.name),t=r.payload.items.find(e=>"ton_proof"===e.name);return(0,i.logDebug)("tonprovider connect isSignalChain: ",n),{namespace:o.NameSpaceKeyTON,addresses:d,methods:[...s.TONMethods],extra:h,data:{ton_addr:e,ton_proof:t,manifestUrl:u.manifestUrl}}}}}return}catch(e){throw(0,i.logDebug)("tonprovider parseConnectResponse error: ",JSON.stringify(e)),e}})}connect(e,t){return r(this,void 0,void 0,function*(){if(e&&t&&t.manifestUrl&&e.params){this.dappInfo=t;let n=[e.params.ton_addr],r={manifestUrl:t.manifestUrl,items:n};e.params.ton_proof&&n.push(e.params.ton_proof),(0,i.logDebug)("tonprovider connect params: ",JSON.stringify(r));try{let e=yield window.okxTonWallet.tonconnect.connect(2,r);return(0,i.logDebug)("tonprovider connect tonResult: ",JSON.stringify(e)),this.signalChainConnectResult=e,e}catch(e){throw(0,i.logDebug)("tonprovider connect error: ",JSON.stringify(e)),new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"tonconnect error")}}else throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"manifestUrl or params is nil")})}}t.TONProvider=c},16592:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Eip155Provider=void 0;let o=n(11352),i=n(34959),a=n(68051),s=n(7039);class c{send(e){return r(this,void 0,void 0,function*(){var t;try{(0,i.logDebug)("Eip155Provider send request:",(0,i.safeJsonStringify)(e)),yield this.restoreConnect();let n=null;switch(e.method){case"personal_sign":e.params&&"message"in e.params&&(n={method:e.method,params:[e.params.message,e.address]});break;case"eth_sendTransaction":case"wallet_addEthereumChain":case"wallet_switchEthereumChain":e.params&&(n={method:e.method,params:[e.params]});break;case"eth_signTypedData_v4":e.params&&"typedDataJson"in e.params&&(null===(t=e.params)||void 0===t?void 0:t.typedDataJson)&&"string"==typeof e.params.typedDataJson&&(n={method:e.method,params:[e.address,e.params.typedDataJson]});break;case"wallet_watchAsset":e.params&&(n={method:e.method,params:e.params});break;default:throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)}if(n){if(("wallet_switchEthereumChain"===e.method||"wallet_addEthereumChain"===e.method)&&e.params&&"chainId"in e.params){(0,i.logDebug)("Eip155Provider send request switch requestParams:",(0,i.safeJsonStringify)(n));let t=parseInt(e.params.chainId,16).toString();yield window.okxwallet.request(n);let r=`eip155:${t}:${e.address}`;
9return(0,i.logDebug)("Eip155Provider send request switch result:",r),{result:r,method:e.method}}{let t=(0,i.getChainId)(e.chainId),r=`0x${Number(t).toString(16)}`;if((0,i.logDebug)("Eip155Provider current chainId:",t,r),r){yield window.okxwallet.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]}),(0,i.logDebug)("Eip155Provider send request requestParams:",r,(0,i.safeJsonStringify)(n));let t=yield window.okxwallet.request(n);return(0,i.logDebug)("Eip155Provider send request result:",(0,i.safeJsonStringify)(t)),{result:t,method:e.method}}}}else throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)}catch(e){throw(0,i.logDebug)("Eip155Provider encountered an error:",e),e}})}connectReady(){return!0}restoreConnect(){return(0,a.isDevice)("mobile")?window.okxwallet.request({method:"eth_requestAccounts"}):Promise.resolve()}parseConnectResponse(e,t,n,a,c,l){return r(this,void 0,void 0,function*(){try{let e=[];a.forEach(t=>{t.namespace===o.NameSpaceKeyEip155&&e.push(...t.chains)});let t=[],n={};if(e.forEach(e=>{let r=(0,i.getChainId)(e),o=c.address.find(t=>t.chainId===r&&60===t.coinType||t.namespaceChainId===e);o&&(t.push(e+":"+o.address),n[e]={publicKey:o.publicKey})}),t&&t.length>0)return{namespace:o.NameSpaceKeyEip155,addresses:t,methods:[...s.Eip55Methods],extra:n};return}catch(e){throw e}})}connect(e,t){return r(this,void 0,void 0,function*(){return window.okxwallet.request({method:"eth_requestAccounts"})})}}t.Eip155Provider=c},81653:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(16592),t)},31580:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SuiProvider=void 0;let o=n(11352),i=n(34959),a=n(68051),s=n(7039);class c{constructor(){}connectReady(){return!0}getSuiPublicKey(){return r(this,void 0,void 0,function*(){return(yield this.connect(void 0)).accounts[0].publicKey})}parseConnectResponse(e,t,n,a,c,l){return r(this,void 0,void 0,function*(){try{let e=[];a.forEach(t=>{t.namespace===o.NameSpaceKeySui&&e.push(...t.chains)});let t=[],n={};if(0==e.length)return;let r=yield this.getSuiPublicKey();if(e.forEach(e=>{var o;(0,i.getChainId)(e);let a=c.address.find(t=>784===t.coinType||t.namespaceChainId===e);a&&(t.push(e+":"+a.address),n[e]={publicKey:null!==(o=a.publicKey)&&void 0!==o?o:r})}),t&&t.length>0)return{namespace:o.NameSpaceKeySui,addresses:t,methods:[...s.SuiMethods],extra:n};return}catch(e){throw e}})}restoreConnect(){return(0,a.isDevice)("mobile")?this.connect(void 0):Promise.resolve()}getSuiWallet(){return window.okxwallet.sui}send(e){return r(this,void 0,void 0,function*(){try{let t;yield this.restoreConnect(),(0,i.logDebug)("suiProvider send request:",JSON.stringify(e));let n=e.method;if(e.injectParams&&this.getSuiWallet()){let r=e.injectParams;switch(n){case"sui_signTransactionBlock":let o=yield this.getSuiWallet().features["sui:signTransactionBlock"].signTransactionBlock(r);t={method:"sui_signTransactionBlock",result:o.signature};break;case"sui_signAndExecuteTransactionBlock":let i=yield this.getSuiWallet().features["sui:signAndExecuteTransactionBlock"].signAndExecuteTransactionBlock(r);t={method:"sui_signAndExecuteTransactionBlock",result:i.digest};break;case"sui_signMessage":let a=yield this.getSuiWallet().features["sui:signMessage"].signMessage(r);
9t={method:"sui_signMessage",result:a.signature};break;case"sui_signPersonalMessage":let s=yield this.getSuiWallet().features["sui:signPersonalMessage"].signPersonalMessage(r);t={method:"sui_signPersonalMessage",result:s.signature}}}return t}catch(e){throw(0,i.logDebug)("suiProvider send error:",e),e}})}connect(e,t){return r(this,void 0,void 0,function*(){var e;return null===(e=this.getSuiWallet())||void 0===e?void 0:e.features["standard:connect"].connect()})}}t.SuiProvider=c},69226:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TON_CHAINS=t.COSMOS_CHAINS=t.APTOS_CHAINS=t.SUI_CHAINS=t.SOLANA_CHAINS=t.BTC_CHAINS=void 0,t.BTC_CHAINS={MAINNET:"btc:mainnet",FRACTAL:"fractal:mainnet"},t.SOLANA_CHAINS={MAINNET:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",TESTNET:"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",SONIC_TESTNET:"sonic:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z"},t.SUI_CHAINS={MAINNET:"sui:mainnet"},t.APTOS_CHAINS={MAINNET:"aptos:mainnet"},t.COSMOS_CHAINS={COSMOS_MAINNET:"cosmos:cosmoshub-4"},t.TON_CHAINS={MAINNET:"ton:-239"}},31700:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.IEngine=t.ISignClient=t.ISignClientEvents=t.IEngineEvents=void 0;let o=r(n(26729));class i extends o.default{constructor(){super()}}t.IEngineEvents=i;class a extends o.default{constructor(){super()}}t.ISignClientEvents=a;class s{constructor(e){this.data=e}}t.ISignClient=s;class c{constructor(e){this.client=e}}t.IEngine=c},6751:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.OKXWalletName=t.creatOKXInjectWalletInfo=t.creatOKXMiniAppWalletInfo=t.creatOKXWalletInfo=t.ISignClientEvents=t.IEngine=t.IEngineEvents=t.ISignClient=t.getBigIntRpcId=t.formatJsonRpcRequest=t.isJsonRpcError=t.isJsonRpcResponse=t.parseConnectionError=t.isHttpUrl=t.formatJsonRpcError=void 0;var i=n(86872);Object.defineProperty(t,"formatJsonRpcError",{enumerable:!0,get:function(){return i.formatJsonRpcError}}),Object.defineProperty(t,"isHttpUrl",{enumerable:!0,get:function(){return i.isHttpUrl}}),Object.defineProperty(t,"parseConnectionError",{enumerable:!0,get:function(){return i.parseConnectionError}}),Object.defineProperty(t,"isJsonRpcResponse",{enumerable:!0,get:function(){return i.isJsonRpcResponse}}),Object.defineProperty(t,"isJsonRpcError",{enumerable:!0,get:function(){return i.isJsonRpcError}}),Object.defineProperty(t,"formatJsonRpcRequest",{enumerable:!0,get:function(){return i.formatJsonRpcRequest}}),Object.defineProperty(t,"getBigIntRpcId",{enumerable:!0,get:function(){return i.getBigIntRpcId}});var a=n(31700);Object.defineProperty(t,"ISignClient",{enumerable:!0,get:function(){return a.ISignClient}}),Object.defineProperty(t,"IEngineEvents",{enumerable:!0,get:function(){return a.IEngineEvents}}),Object.defineProperty(t,"IEngine",{enumerable:!0,get:function(){return a.IEngine}}),Object.defineProperty(t,"ISignClientEvents",{enumerable:!0,get:function(){return a.ISignClientEvents}}),o(n(94234),t);var s=n(16411);Object.defineProperty(t,"creatOKXWalletInfo",{enumerable:!0,get:function(){return s.creatOKXWalletInfo}}),Object.defineProperty(t,"creatOKXMiniAppWalletInfo",{enumerable:!0,get:function(){return s.creatOKXMiniAppWalletInfo}}),Object.defineProperty(t,"creatOKXInjectWalletInfo",{enumerable:!0,get:function(){return s.creatOKXInjectWalletInfo}}),Object.defineProperty(t,"OKXWalletName",{enumerable:!0,get:function(){return s.OKXWalletName}})},86872:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};function o(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function i(e){return"result"in e}function a(e){return"error"in e}
9Object.defineProperty(t,"__esModule",{value:!0}),t.isJsonRpcPayload=o,t.isJsonRpcRequest=function(e){return o(e)&&"method"in e},t.isJsonRpcResponse=function(e){return o(e)&&(i(e)||a(e))},t.isJsonRpcResult=i,t.isJsonRpcError=a,t.payloadId=h,t.getBigIntRpcId=function(){return BigInt(Date.now())*BigInt(1e6)+BigInt(d.getNextValue())},t.formatJsonRpcRequest=function(e,t,n){return{id:n||h(),jsonrpc:"2.0",method:e,params:t}},t.formatJsonRpcResult=function(e,t){return{id:e,jsonrpc:"2.0",result:t}},t.formatJsonRpcError=function(e,t,n){return{id:e,jsonrpc:"2.0",error:v(t,n)}},t.isReservedErrorCode=f,t.getError=g,t.getErrorByCode=p,t.formatErrorMessage=v,t.isHttpUrl=function(e){return m(e,"^https?:")},t.isWsUrl=function(e){return m(e,"^wss?:")},t.parseConnectionError=function(e,t,n){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?Error(`Unavailable ${n} RPC url at ${t}`):e};let s=n(48217),c=r(n(50780));class l{constructor(e){this.i=1,8===e?new Uint8Array(1):16===e?new Uint16Array(1):new Uint32Array(1),e?this.initialValue=c.default.randomBytes(e/8)[0]:this.initialValue=0}getNextValue(){return this.initialValue+this.i++}}let u=new l(8),d=new l(16);function h(){return 1e3*Date.now()+u.getNextValue()}function f(e){return s.RESERVED_ERROR_CODES.includes(e)}function g(e){return Object.keys(s.STANDARD_ERROR_MAP).includes(e)?s.STANDARD_ERROR_MAP[e]:s.STANDARD_ERROR_MAP[s.DEFAULT_ERROR]}function p(e){return Object.values(s.STANDARD_ERROR_MAP).find(t=>t.code===e)||s.STANDARD_ERROR_MAP[s.DEFAULT_ERROR]}function v(e,t){return void 0===e?g(s.INTERNAL_ERROR):("string"==typeof e&&(e=Object.assign(Object.assign({},g(s.SERVER_ERROR)),{message:e})),void 0!==t&&(e.data=t),f(e.code)&&(e=p(e.code)),e)}function m(e,t){let n=function(e){let t=e.match(RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==n&&new RegExp(t).test(n)}},67411:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}
9),t.CONNECT_ITEM_ERROR_CODES=void 0,(r=n||(t.CONNECT_ITEM_ERROR_CODES=n={}))[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"},52032:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TONCHAIN=void 0,(n||(t.TONCHAIN=n={})).MAINNET="-239"},94234:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONNECT_ITEM_ERROR_CODES=t.TONCHAIN=void 0;var r=n(52032);Object.defineProperty(t,"TONCHAIN",{enumerable:!0,get:function(){return r.TONCHAIN}});var o=n(67411);Object.defineProperty(t,"CONNECT_ITEM_ERROR_CODES",{enumerable:!0,get:function(){return o.CONNECT_ITEM_ERROR_CODES}})},16411:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OKXInjectWalletName=t.OKXMiniWalletName=t.OKXWalletName=void 0,t.creatOKXWalletInfo=function(){return{appName:"okxAppWallet",name:t.OKXWalletName,imageUrl:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png"}},t.creatOKXMiniAppWalletInfo=function(){return{appName:"okxMiniApp",name:t.OKXMiniWalletName,imageUrl:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png"}},t.creatOKXInjectWalletInfo=function(){return{appName:"okxInjectWallet",name:t.OKXInjectWalletName,imageUrl:""}},t.OKXWalletName="OKX Wallet",t.OKXMiniWalletName="OKX Mini Wallet",t.OKXInjectWalletName="OKX Inject Wallet"},82250:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OKX_MINI_WALLET_NAME=t.OKX_APP_WALLET_NAME=t.stackDeepLink=t.tgwalletAppName=t.tgwalletName=t.tonConnectSdkVersion=t.shortUniversalLink=t.standardDeeplink=t.downloadUrl=t.standardUniversalLink=t.okxDeeplink=void 0,t.getTestTwaUrl=function(){return window.okxTesttwaUrl},t.getTestTgTwaUrl=function(){return window.okxTestTgtwaUrl},t.getBotNameAndAppName=function(e){let t=new URL(e).pathname.split("/").filter(Boolean);if(t.length>=2)return{botName:t[0],appName:t[1]}},t.okxDeeplink="okx://web3",t.standardUniversalLink="undefined"!=typeof window&&window.location.hostname.includes("okx.com")?"https://link.okx.com/download":"https://www.okx.com/download",t.downloadUrl="https://www.okx.com/download",t.standardDeeplink=`${t.okxDeeplink}/wallet/connect`,t.shortUniversalLink="https://www.okx.com/ul/connect",t.tonConnectSdkVersion="1",t.tgwalletName="OKX_WALLET_BOT",t.tgwalletAppName="start",t.stackDeepLink="okx://web3?stack=true",t.OKX_APP_WALLET_NAME="OKX Wallet",t.OKX_MINI_WALLET_NAME="OKX Mini Wallet"},30242:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OKX_CONNECT_ERROR_CODES=t.OKXConnectError=void 0;var r=n(48217);Object.defineProperty(t,"OKXConnectError",{enumerable:!0,get:function(){return r.OKXConnectError}}),Object.defineProperty(t,"OKX_CONNECT_ERROR_CODES",{enumerable:!0,get:function(){return r.OKX_CONNECT_ERROR_CODES}})},48217:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_ERROR=t.STANDARD_ERROR_MAP=t.SERVER_ERROR_CODE_RANGE=t.RESERVED_ERROR_CODES=t.SERVER_ERROR=t.INTERNAL_ERROR=t.INVALID_PARAMS=t.METHOD_NOT_FOUND=t.INVALID_REQUEST=t.PARSE_ERROR=t.OKX_CONNECT_ERROR_CODES=t.OKXConnectError=void 0;class o extends Error{constructor(e,t){void 0==t&&(t=function(e){if(e==n.UNKNOWN_ERROR);else if(e==n.BAD_REQUEST_ERROR)return"bad request error";else if(e==n.ALREADY_CONNECTED_ERROR)return"already connected error";else if(e==n.NOT_CONNECTED_ERROR)return"not connected error";else if(e==n.UNKNOWN_APP_ERROR)return"unknown app error";else if(e==n.USER_REJECTS_ERROR)return"user rejects error";else if(e==n.USER_REJECTS_ERROR_CAUSE_REGISTER)return"wallet address are registering";else if(e==n.METHOD_NOT_SUPPORTED)return"method not supported";else if(e==n.CONNECTION_ERROR)return"connect error";else if(e==n.CHAIN_NOT_SUPPORTED)return"chain not supported";return"unknown error"}(e)),super(t),this.code=e,this.message=`${o.prefix} ${t?"\n"+t:""}`,Object.setPrototypeOf(this,o.prototype)}toJSON(){return{message:this.message,code:this.code}}}t.OKXConnectError=o,o.prefix="[OKX_CONNECT_SDK_ERROR]",(r=n||(t.OKX_CONNECT_ERROR_CODES=n={}))[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",r[r.ALREADY_CONNECTED_ERROR=11]="ALREADY_CONNECTED_ERROR",r[r.NOT_CONNECTED_ERROR=12]="NOT_CONNECTED_ERROR",r[r.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",r[r.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",r[r.USER_REJECTS_ERROR_CAUSE_REGIST
9ER=301]="USER_REJECTS_ERROR_CAUSE_REGISTER",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",r[r.CHAIN_NOT_SUPPORTED=500]="CHAIN_NOT_SUPPORTED",r[r.WALLET_NOT_SUPPORTED=600]="WALLET_NOT_SUPPORTED",r[r.CONNECTION_ERROR=700]="CONNECTION_ERROR",t.PARSE_ERROR="PARSE_ERROR",t.INVALID_REQUEST="INVALID_REQUEST",t.METHOD_NOT_FOUND="METHOD_NOT_FOUND",t.INVALID_PARAMS="INVALID_PARAMS",t.INTERNAL_ERROR="INTERNAL_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.RESERVED_ERROR_CODES=[-32700,-32600,-32601,-32602,-32603],t.SERVER_ERROR_CODE_RANGE=[-32e3,-32099],t.STANDARD_ERROR_MAP={[t.PARSE_ERROR]:{code:-32700,message:"Parse error"},[t.INVALID_REQUEST]:{code:-32600,message:"Invalid Request"},[t.METHOD_NOT_FOUND]:{code:-32601,message:"Method not found"},[t.INVALID_PARAMS]:{code:-32602,message:"Invalid params"},[t.INTERNAL_ERROR]:{code:-32603,message:"Internal error"},[t.SERVER_ERROR]:{code:-32e3,message:"Server error"}},t.DEFAULT_ERROR=t.SERVER_ERROR},11352:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.TON_CHAINS=t.COSMOS_CHAINS=t.APTOS_CHAINS=t.SUI_CHAINS=t.SOLANA_CHAINS=t.BTC_CHAINS=t.downloadUrl=t.okxDeeplink=t.tonConnectSdkVersion=t.standardDeeplink=t.standardUniversalLink=t.NameSpaceKeyStarknet=t.NameSpaceKeyTron=t.NameSpaceKeyCosmos=t.NameSpaceKeyAptos=t.NameSpaceKeyBtc=t.NameSpaceKeySui=t.NameSpaceKeyTON=t.NameSpaceKeySOL=t.NameSpaceKeyEip155=void 0,o(n(30242),t);var i=n(29803);Object.defineProperty(t,"NameSpaceKeyEip155",{enumerable:!0,get:function(){return i.NameSpaceKeyEip155}}),Object.defineProperty(t,"NameSpaceKeySOL",{enumerable:!0,get:function(){return i.NameSpaceKeySOL}}),Object.defineProperty(t,"NameSpaceKeyTON",{enumerable:!0,get:function(){return i.NameSpaceKeyTON}}),Object.defineProperty(t,"NameSpaceKeySui",{enumerable:!0,get:function(){return i.NameSpaceKeySui}}),Object.defineProperty(t,"NameSpaceKeyBtc",{enumerable:!0,get:function(){return i.NameSpaceKeyBtc}}),Object.defineProperty(t,"NameSpaceKeyAptos",{enumerable:!0,get:function(){return i.NameSpaceKeyAptos}}),Object.defineProperty(t,"NameSpaceKeyCosmos",{enumerable:!0,get:function(){return i.NameSpaceKeyCosmos}}),Object.defineProperty(t,"NameSpaceKeyTron",{enumerable:!0,get:function(){return i.NameSpaceKeyTron}}),Object.defineProperty(t,"NameSpaceKeyStarknet",{enumerable:!0,get:function(){return i.NameSpaceKeyStarknet}});var a=n(82250);Object.defineProperty(t,"standardUniversalLink",{enumerable:!0,get:function(){return a.standardUniversalLink}}),Object.defineProperty(t,"standardDeeplink",{enumerable:!0,get:function(){return a.standardDeeplink}}),Object.defineProperty(t,"tonConnectSdkVersion",{enumerable:!0,get:function(){return a.tonConnectSdkVersion}}),Object.defineProperty(t,"okxDeeplink",{enumerable:!0,get:function(){return a.okxDeeplink}}),Object.defineProperty(t,"downloadUrl",{enumerable:!0,get:function(){return a.downloadUrl}}),o(n(6751),t);var s=n(69226);Object.defineProperty(t,"BTC_CHAINS",{enumerable:!0,get:function(){return s.BTC_CHAINS}}),Object.defineProperty(t,"SOLANA_CHAINS",{enumerable:!0,get:function(){return s.SOLANA_CHAINS}}),Object.defineProperty(t,"SUI_CHAINS",{enumerable:!0,get:function(){return s.SUI_CHAINS}}),Object.defineProperty(t,"APTOS_CHAINS",{enumerable:!0,get:function(){return s.APTOS_CHAINS}}),Object.defineProperty(t,"COSMOS_CHAINS",{enumerable:!0,get:function(){return s.COSMOS_CHAINS}}),Object.defineProperty(t,"TON_CHAINS",{enumerable:!0,get:function(){return s.TON_CHAINS}})},29803:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NameSpaceKeyStarknet=t.NameSpaceKeyTron=t.NameSpaceKeyCosmos=t.NameSpaceKeyAptos=t.NameSpaceKeyBtc=t.NameSpaceKeySui=t.NameSpaceKeyTON=t.NameSpaceKeySOL=t.NameSpaceKeyEip155=void 0,t.NameSpaceKeyEip155="eip155",t.NameSpaceKeySOL="solana",t.NameSpaceKeyTON="ton",t.NameSpaceKeySui="sui",t.NameSpaceKeyBtc="btc",t.NameSpaceKeyAptos="aptos",t.NameSpaceKeyCosmos="cosmos",t.NameSpaceKeyTron="tron",t.NameSpaceKeyStarknet="starknet"},66301:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
9ise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};function r(e,t){return n(this,void 0,void 0,function*(){return new Promise((n,r)=>{var o,i;if(null===(o=null==t?void 0:t.signal)||void 0===o?void 0:o.aborted){r(Error("Delay aborted"));return}let a=setTimeout(()=>n(),e);null===(i=null==t?void 0:t.signal)||void 0===i||i.addEventListener("abort",()=>{clearTimeout(a),r(Error("Delay aborted"))})})})}Object.defineProperty(t,"__esModule",{value:!0}),t.callForSuccess=function(e,t){return n(this,void 0,void 0,function*(){var n,o;let i;let a=null!==(n=null==t?void 0:t.attempts)&&void 0!==n?n:3,s=null!==(o=null==t?void 0:t.delayMs)&&void 0!==o?o:800;if("function"!=typeof e)throw Error(`Expected a function, got ${typeof e}`);let c=0;for(;c<a;)try{return yield e()}catch(e){i=e,++c<a&&(yield r(s))}throw i})},t.delay=r},34959:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.chainName2IdMap=t.replaceChainIdToChainName=t.replaceChainNameToChainId=t.checkMetaData=t.versionCompare=t.isBrowser=t.isOS=t.isMobileUserAgent=t.openDeeplinkWithFallback=t.openLinkBlank=t.openLink=t.getChainId=t.useShortLink=t.toSafeBase64FromBase64=t.isValidObject=t.isIos=t.base64decode=t.base64encode=t.splitToUint8Arrays=t.concatUint8Arrays=t.toHexString=t.hexToByteArray=t.getOKXLink=t.openOKXUniversalLink=t.getAppWalletShortDeepLink=t.encodeTWAC
9onnectURLParams=t.encodeConnectParams=t.openOKXTMAWalletlinkWithFallback=t.getTelegramWalletTWAUrl=t.getAppWalletDeepLink=t.encodeTelegramUrlParameters=t.isTelegramUrl=t.openOKXDeeplinkWithFallback=t.openOKXDeeplink=t.getUniversalLink=t.safeJsonStringify=t.safeJsonParse=t.getDefaultReporter=t.reportEvent=t.reportLog=t.logWarning=t.logError=t.logDebug=t.callForSuccess=void 0;var i=n(66301);Object.defineProperty(t,"callForSuccess",{enumerable:!0,get:function(){return i.callForSuccess}});var a=n(72465);Object.defineProperty(t,"logDebug",{enumerable:!0,get:function(){return a.logDebug}}),Object.defineProperty(t,"logError",{enumerable:!0,get:function(){return a.logError}}),Object.defineProperty(t,"logWarning",{enumerable:!0,get:function(){return a.logWarning}}),Object.defineProperty(t,"reportLog",{enumerable:!0,get:function(){return a.reportLog}}),Object.defineProperty(t,"reportEvent",{enumerable:!0,get:function(){return a.reportEvent}}),Object.defineProperty(t,"getDefaultReporter",{enumerable:!0,get:function(){return a.getDefaultReporter}}),o(n(47460),t),o(n(34206),t);var s=n(2145);Object.defineProperty(t,"safeJsonParse",{enumerable:!0,get:function(){return s.safeJsonParse}}),Object.defineProperty(t,"safeJsonStringify",{enumerable:!0,get:function(){return s.safeJsonStringify}});var c=n(11349);Object.defineProperty(t,"getUniversalLink",{enumerable:!0,get:function(){return c.getUniversalLink}}),Object.defineProperty(t,"openOKXDeeplink",{enumerable:!0,get:function(){return c.openOKXDeeplink}}),Object.defineProperty(t,"openOKXDeeplinkWithFallback",{enumerable:!0,get:function(){return c.openOKXDeeplinkWithFallback}}),Object.defineProperty(t,"isTelegramUrl",{enumerable:!0,get:function(){return c.isTelegramUrl}}),Object.defineProperty(t,"encodeTelegramUrlParameters",{enumerable:!0,get:function(){return c.encodeTelegramUrlParameters}}),Object.defineProperty(t,"getAppWalletDeepLink",{enumerable:!0,get:function(){return c.getAppWalletDeepLink}}),Object.defineProperty(t,"getTelegramWalletTWAUrl",{enumerable:!0,get:function(){return c.getTelegramWalletTWAUrl}}),Object.defineProperty(t,"openOKXTMAWalletlinkWithFallback",{enumerable:!0,get:function(){return c.openOKXTMAWalletlinkWithFallback}}),Object.defineProperty(t,"encodeConnectParams",{enumerable:!0,get:function(){return c.encodeConnectParams}}
9),Object.defineProperty(t,"encodeTWAConnectURLParams",{enumerable:!0,get:function(){return c.encodeTWAConnectURLParams}}),Object.defineProperty(t,"getAppWalletShortDeepLink",{enumerable:!0,get:function(){return c.getAppWalletShortDeepLink}}),Object.defineProperty(t,"openOKXUniversalLink",{enumerable:!0,get:function(){return c.openOKXUniversalLink}}),Object.defineProperty(t,"getOKXLink",{enumerable:!0,get:function(){return c.getOKXLink}});var l=n(77573);Object.defineProperty(t,"hexToByteArray",{enumerable:!0,get:function(){return l.hexToByteArray}}),Object.defineProperty(t,"toHexString",{enumerable:!0,get:function(){return l.toHexString}}),Object.defineProperty(t,"concatUint8Arrays",{enumerable:!0,get:function(){return l.concatUint8Arrays}}),Object.defineProperty(t,"splitToUint8Arrays",{enumerable:!0,get:function(){return l.splitToUint8Arrays}}),Object.defineProperty(t,"base64encode",{enumerable:!0,get:function(){return l.base64encode}}),Object.defineProperty(t,"base64decode",{enumerable:!0,get:function(){return l.base64decode}}),Object.defineProperty(t,"isIos",{enumerable:!0,get:function(){return l.isIos}}),Object.defineProperty(t,"isValidObject",{enumerable:!0,get:function(){return l.isValidObject}}),Object.defineProperty(t,"toSafeBase64FromBase64",{enumerable:!0,get:function(){return l.toSafeBase64FromBase64}}),Object.defineProperty(t,"useShortLink",{enumerable:!0,get:function(){return l.useShortLink}}),Object.defineProperty(t,"getChainId",{enumerable:!0,get:function(){return l.getChainId}});var u=n(33849);Object.defineProperty(t,"openLink",{enumerable:!0,get:function(){return u.openLink}}),Object.defineProperty(t,"openLinkBlank",{enumerable:!0,get:function(){return u.openLinkBlank}}),Object.defineProperty(t,"openDeeplinkWithFallback",{enumerable:!0,get:function(){return u.openDeeplinkWithFallback}}),Object.defineProperty(t,"isMobileUserAgent",{enumerable:!0,get:function(){return u.isMobileUserAgent}}),Object.defineProperty(t,"isOS",{enumerable:!0,get:function(){return u.isOS}}),Object.defineProperty(t,"isBrowser",{enumerable:!0,get:function(){return u.isBrowser}});var d=n(30133);Object.defineProperty(t,"versionCompare",{enumerable:!0,get:function(){return d.versionCompare}});var h=n(31418);Object.defineProperty(t,"checkMetaData",{enumerable:!0,get:function(){return h.checkMetaData}});var f=n(77573);Object.defineProperty(t,"replaceChainNameToChainId",{enumerable:!0,get:function(){return f.replaceChainNameToChainId}}),Object.defineProperty(t,"replaceChainIdToChainName",{enumerable:!0,get:function(){return f.replaceChainIdToChainName}}),Object.defineProperty(t,"chainName2IdMap",{enumerable:!0,get:function(){return f.chainName2IdMap}})},72465:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultReporter=function(){return i},t.logDebug=function(...e){if("undefined"!=typeof console)try{(null==window?void 0:window.okxLogDebug)&&console.log(`[OKX_CONNECT_SDK] ${a} `,...e)}catch(e){}},t.logError=function(...e){if("undefined"!=typeof console)try{(null==window?void 0:window.okxLogDebug)&&console.error(`[OKX_CONNECT_SDK] ${a} `,...e);{let t="";t+=[...e].reduce((e,t)=>{"string"==typeof t?e+=","+t:"object"==typeof t&&(e+=JSON.stringify(t))}),i.sendRecordContent(t,o.OKXReportType.LOG,"")}}catch(e){}},t.logWarning=function(...e){if("undefined"!=typeof console)try{(null==window?void 0:window.okxLogDebug)&&console.warn(`[OKX_CONNECT_SDK] ${a} `,...e)}catch(e){}},t.reportEvent=function(e,t,n){return r(this,void 0,void 0,function*(){yield i.sendRecordContent(n,e,t)})},t.reportLog=function(e){return r(this,arguments,void 0,function*(e,t="default"){})};let o=n(34206),i=new o.OKXReporter,a=n(71860).version},68051:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mediaNotTouch=t.mediaTouch=t.maxWidth=void 0,t.isDevice=function(e){var n;let s=(0,i.getWindow)();if(!s)return"desktop"===e;if((0,o.isTmaPlatform)("weba"))return!0;let c=s.innerWidth;
9switch(e){case"desktop":return c>t.maxWidth.tablet;case"tablet":return c>t.maxWidth.mobile;default:let l=c<=t.maxWidth.mobile||(0,r.isOS)("ios","android","ipad");if(l){let e=!!(null===(n=(0,i.getWindow)())||void 0===n?void 0:n.TelegramWebviewProxy),t=navigator.maxTouchPoints||0;e&&0===t&&(l=!1),(0,a.logDebug)("isDevice mobile isTelegram and maxTouchPoints:",l,e,t)}return l}},t.media=function(e){switch(e){case"mobile":return`@media (max-width: ${t.maxWidth.mobile}px)`;case"tablet":return`@media (max-width: ${t.maxWidth.tablet}px) (min-width: ${t.maxWidth.mobile}px)`;default:return`@media (min-width: ${t.maxWidth.tablet}px)`}},t.mediaMin=function(e){return`@media (min-width: ${e}px)`},t.mediaMax=function(e){return`@media (max-width: ${e}px)`},t.mediaMinMax=function(e,t){return`@media (min-width: ${e}px) and (max-width: ${t}px)`};let r=n(33849),o=n(30133),i=n(11349),a=n(72465);t.maxWidth={mobile:440,tablet:1020},t.mediaTouch="@media (hover: none)",t.mediaNotTouch="@media not all and (hover: none)"},34206:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.OKXReporter=t.OKXReportSide=t.OKXReportType=t.versionStr=void 0;let i=o(n(54098)),a=n(72465),s=n(11349),c=n(34959),l=o(n(69483)),u=o(n(50780));t.versionStr="1.7.0";let d=["https://www.okx.com/dappstat/wallet-connect","https://www.okx.ac/dappstat/wallet-connect"],h="OKX_RP_UUID_CK",f={headers:{Accept:"*/*","Content-Type":"text/plain"},method:"POST"};t.OKXReportType={PAGE_IN:"page_in",PAGE_OUT:"page_out",CLICK:"click",LOG:"log"},t.OKXReportSide={DAPP:"dapp",WALLET:"wallet"};let g=(e,...t)=>r(void 0,[e,...t],void 0,function*(e,t={},n=5e3){for(let r of e)try{let e=new AbortController,o=e.signal,a=(0,i.default)(r,Object.assign(Object.assign({},t),{signal:o})),s=new Promise((t,r)=>setTimeout(()=>{e.abort(),r(Error("Request timed out"))},n)),c=yield Promise.race([a,s]);if(c.ok)return c;if(502==c.status)return console.error("Fetch error status 502",r),c}catch(e){console.error(`Fetch error for ${r}:`,e)}throw console.error("'All fetch attempts failed.'"),Error("All fetch attempts failed.")});class p{constructor(){this.currentSide=t.OKXReportSide.DAPP,this.currentVersion=t.versionStr,this.storage=l.default.createInstance({name:"OKXReporter"}),this.recordList=[],this.currentUUID=(0,c.toHexString)(u.default.randomBytes(16))}configVersionAndSide(e,t,n){this.currentVersion=e,this.currentSide=t,this.appName=n}get recordCacheKey(){return"OKX_RP_CK@"+this.appName}get reportPlatform(){return(0,c.isMobileUserAgent)()?(0,c.isIos)()?"iOS":"android":"pc"}beginReport(){return r(this,void 0,void 0,function*(){this.startErrorCatching();let e=yield this.storage.getItem(this.recordCacheKey),t=yield this.storage.getItem(h);t?this.currentUUID=t:this.storage.setItem(h,this.currentUUID),e&&(this.recordList=e,(0,a.logDebug)("resume records from cache length: ",this.recordList.length),yield this.sendCachedRecords())})}startErrorCatching(){(0,s.getWindow)()&&(0,a.logDebug)("begin capture console error")}cachedErrors(){return this.recordList}sendRecord(e){return r(this,void 0,void 0,function*(){return new Promise((t,n)=>r(this,void 0,void 0,function*(){try{let r=JSON.stringify(e);(0,a.logDebug)("[REPORT] record: ",r);let o=yield g(d,Object.assign(Object.assign({},f),{body:r}));(0,a.logDebug)("[REPORT] get rsp:",o),o&&o.status&&200==o.status?(this.recordList=this.recordList.filter(t=>t.timestamp!=e.timestamp||t.content!=e.content),yield this.storage.setItem(this.recordCacheKey,this.recordList),t(!0)):n(!1)}catch(e){(0,a.logDebug)("send record error:",e),t(!0)}}))})}sendRecordContent(e,t,n){return r(this,void 0,void 0,function*(){var r,o,i,a;let c=null===(r=(0,s.getWindow)())||void 0===r?void 0:r.location.pathname,l=null===(o=(0,s.getWindow)())||void 0===o?void 0:o.location.origin;c&&l&&(l+=c);let u=null===(i=(0,s.getWindow)())||void 0===i?void 0:i.navigator.language,d=null===(a=(0,s.getWindow)())||void 0===a?void 0:a.navigator.userAgent,h=this.reportPlatform,f={uuid:this.currentUUID,version:this.currentVersion,content:e,action:n,side:this.currentSide,timestamp:new Date().getTime(),url:l,lang:u,type:t,platform:h,"user-agent":d};yield this.markRecordItem(f),yield this.sendRecord(f)})}sendCachedRecords(){return r(this,void 0,void 0,function*(){return new Promise((e,t)=>
9r(this,void 0,void 0,function*(){let n=this.recordList.map(e=>this.sendRecord(e));(0,a.logDebug)("[REPORT] submit & clean recorded caches begin @",new Date().toUTCString()),Promise.allSettled(n).then(n=>{(0,a.logDebug)("[REPORT] submit & clean recorded caches ends @",new Date().toUTCString());let r=[];n.forEach((e,t)=>{"rejected"==e.status&&r.push(t)}),this.recordList=this.recordList.filter((e,t)=>!r.includes(t)),this.storage.setItem(this.recordCacheKey,this.recordList).then(function(t){e()}).catch(function(e){t(e)})})}))})}markRecordItem(e){return r(this,void 0,void 0,function*(){if(this.recordList.push(e),this.recordList.length>100){let e=this.recordList.length-100;this.recordList.splice(0,e)}return new Promise((t,n)=>{this.storage.setItem(this.recordCacheKey,this.recordList).then(function(n){t(e)}).catch(function(e){n(e)})})})}markRecord(e,t,n,o){return r(this,void 0,void 0,function*(){var r,i,a,c;let l=null===(r=(0,s.getWindow)())||void 0===r?void 0:r.location.pathname,u=null===(i=(0,s.getWindow)())||void 0===i?void 0:i.location.origin;l&&u&&(u+=l);let d=null===(a=(0,s.getWindow)())||void 0===a?void 0:a.navigator.language,h=this.reportPlatform,f=null===(c=(0,s.getWindow)())||void 0===c?void 0:c.navigator.userAgent,g={uuid:this.currentUUID,version:this.currentVersion,content:e,action:n,side:o,timestamp:new Date().getTime(),url:u,lang:d,type:t,platform:h,"user-agent":f};return yield this.markRecordItem(g)})}}t.OKXReporter=p},47460:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Report_WalletType_Key=t.Report_Proceed_QRCode_Click=t.Report_ChooseType_Download_Click=t.Report_ChooseType_ConnectWallet_Click=t.Report_Proceed_Retry_Click=t.Report_ChooseType_ConnectWallet_View=t.Report_Loading_ConnectWallet_View=t.Report_Proceed_QRCode_View=t.Report_Proceed_Proceed_View=void 0,t.Report_Proceed_Proceed_View="OKXConnectSDK_Proceed_Proceed_View",t.Report_Proceed_QRCode_View="OKXConnectSDK_Proceed_QRCode_View",t.Report_Loading_ConnectWallet_View="OKXConnectSDK_Loading_ConnectWallet_View",t.Report_ChooseType_ConnectWallet_View="OKXConnectSDK_ChooseType_ConnectWallet_View",t.Report_Proceed_Retry_Click="OKXConnectSDK_Proceed_Retry_Click",t.Report_ChooseType_ConnectWallet_Click="OKXConnectSDK_ChooseType_ConnectWallet_Click",t.Report_ChooseType_Download_Click="OKXConnectSDK_ChooseType_Download_Click",t.Report_Proceed_QRCode_Click="OKXConnectSDK_Proceed_QRCode_Click",t.Report_WalletType_Key="wallet_type"},31418:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkMetaData=function(e){if(!e)throw new r.OKXConnectError(r.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR,"You have to specify a `dappMetaData`in the options.");if(!e.name)throw new r.OKXConnectError(r.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR,"dappName is required");if(!e.icon)throw new r.OKXConnectError(r.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR,"icon is required");return!0};let r=n(11352)},2145:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeJsonParse=function(e){if("string"!=typeof e)throw(0,r.logDebug)(e),Error(`Cannot safe json parse value of type ${typeof e}`);try{return i(e)}catch(t){return console.error("safeJsonParse error:",t),e}},t.safeJsonStringify=function(e){return"string"==typeof e?e:o(e)||""};let r=n(72465),o=e=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString()+"n":t),i=e=>{let t=e.replace(/:(\b\d{17,}|\b(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))(?=[,\}\]]|$)/g,(e,t)=>`:"${t}n"`);try{return JSON.parse(t,(e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t)}catch(t){return JSON.parse(e)}}},73813:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.okxfromString=function(e,t="utf8"){let n=l[t];if((0,o.logDebug)("okxfromstring ====> "),!n)throw Error(`Unsupported encoding "${t}"`);return n.decoder.decode(`${n.prefix}${e}`)},t.okxtoString=function(e,t="utf8"){let n=l[t];if((0,o.logDebug)("okxtoString ====> "),!n)throw Error(`Unsupported encoding "${t}"`);return n.encoder.encode(e).substring(1)},t.alloc=function(e=0){return new Uint8Array(e)},t.allocUnsafe=i;let r=n(61432),o=n(72465);function i(e=0){return new Uint8Array(e)}function a(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}let s=a("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),c=a("ascii","a",e=>{let t="a";for(let n=0;n<e.length;n++){let r=e[n];r&&String.fromCharCode(r)&&(t+=String.fromCharCode(r))}return t},e=>{let t=i((e=e.substring(1)).length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}),l=Object.assign({utf8:s,"utf-8":s,hex:r.bases.base16,latin1:c,ascii:c,binary:c},r.bases)},30133:function(e,t,n){"use strict";var r,o,i,a,s,c,l;
9Object.defineProperty(t,"__esModule",{value:!0}),t.isTmaPlatform=function(...e){return e.includes(p)},t.isInTMA=m,t.inTg=function(){return y()||m()},t.isInTelegramBrowser=y,t.sendExpand=function(){O("web_app_expand",{})},t.sendOpenTelegramLink=function(e,t){let n=new URL(e);if("http:"!==n.protocol&&"https:"!==n.protocol){if(t)return t();throw new h.OKXConnectError(h.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Url protocol is not supported: ${n}`)}if("t.me"!==n.hostname){if(t)return t();throw new h.OKXConnectError(h.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Url host is not supported: ${n}`)}let r=n.pathname+n.search;C()||w(v,"6.1")>=0?O("web_app_open_tg_link",{path_full:r}):(0,f.openLinkBlank)("https://t.me"+r)},t.versionCompare=w;let u=n(11349),d=n(72465),h=n(11352),f=n(33849),g={};try{let e=location.hash.toString();g=function(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(0>e.indexOf("=")&&0>e.indexOf("?"))return t._path=b(e),t;let n=e.indexOf("?");if(n>=0){let r=e.substr(0,n);t._path=b(r),e=e.substr(n+1)}let r=function(e){let t,n,r,o,i={};if(!e.length)return i;let a=e.split("&");for(t=0;t<a.length;t++)r=b((n=a[t].split("="))[0]),o=null==n[1]?null:b(n[1]),i[r]=o;return i}(e);for(let e in r)t[e]=r[e];return t}(e)}catch(e){}let p="unknown";if((null==g?void 0:g.tgWebAppPlatform)&&(p=null!==(r=g.tgWebAppPlatform)&&void 0!==r?r:"unknown"),"unknown"===p){let e=(0,u.getWindow)();p=null!==(a=null===(i=null===(o=null==e?void 0:e.Telegram)||void 0===o?void 0:o.WebApp)||void 0===i?void 0:i.platform)&&void 0!==a?a:"unknown"}let v="6.0";if((null==g?void 0:g.tgWebAppVersion)&&(v=g.tgWebAppVersion),!v){let e=(0,u.getWindow)();v=null!==(l=null===(c=null===(s=null==e?void 0:e.Telegram)||void 0===s?void 0:s.WebApp)||void 0===c?void 0:c.version)&&void 0!==l?l:"6.0"}function m(){var e;return"unknown"!==p||!!(null===(e=(0,u.getWindow)())||void 0===e?void 0:e.TelegramWebviewProxy)}function y(){var e;let t=!!(null===(e=(0,u.getWindow)())||void 0===e?void 0:e.TelegramWebview);return(m()||t)&&"unknown"===p}function C(){try{let e=(0,u.getWindow)();if(!e)return!1;return null!=e.parent&&e!==e.parent}catch(e){return!1}}function O(e,t){try{let n=(0,u.getWindow)();if(!n)throw new h.OKXConnectError(h.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Can't post event to parent window: window is not defined");if(void 0!==n.TelegramWebviewProxy)(0,d.logDebug)("postEvent",e,t),n.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(n.external&&"notify"in n.external)(0,d.logDebug)("postEvent",e,t),n.external.notify(JSON.stringify({eventType:e,eventData:t}));else if(C()){let r=JSON.stringify({eventType:e,eventData:t});(0,d.logDebug)("postEvent",e,t),n.parent.postMessage(r,"*")}else throw new h.OKXConnectError(h.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Can't post event to TMA")}catch(e){(0,d.logError)(`Can't post event to parent window: ${e}`)}}function b(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch(t){return e}}function w(e,t){let n,r,o,i;"string"!=typeof e&&(e=""),"string"!=typeof t&&(t="");let a=e.replace(/^\s+|\s+$/g,"").split("."),s=t.replace(/^\s+|\s+$/g,"").split(".");for(r=0,n=Math.max(a.length,s.length);r<n;r++)if((o=parseInt(a[r])||0)!==(i=parseInt(s[r])||0)){if(o>i)return 1;return -1}return 0}},11349:function(e,t,n){"use strict";var r,o,i,a;Object.defineProperty(t,"__esModule",{value:!0}),t.removeUrlLastSlash=f,t.addPathToUrl=function(e,t){return f(e)+"/"+t},t.getUniversalLink=g,t.openOKXDeeplink=function(e){var t;let n=g(e),r=!!(null===(t=v())||void 0===t?void 0:t.TelegramWebviewProxy);console.log("openOKXDeeplink fullUrl:",n),!(0,u.isIos)()||(0,u.isInIOSLine)()?r?window.open(e,"_blank"):window.location.href=e:p(n)},t.openOKXUniversalLink=p,t.openOKXDeeplinkWithFallback=function(e){var t;let n=g(e),r=!!(null===(t=v())||void 0===t?void 0:t.TelegramWebviewProxy);console.log("openOKXDeeplinkWithFallback fullUrl:",n);let o=!1;s.standardUniversalLink,console.log("openOKXDeeplinkWithFallback standardUniversalLink:",s.standardUniversalLink);let i=null,a=()=>{console.log("fallbackToDownloadPage :empty")};if((0,u.isIos)()?(0,u.isInIOSLine)()&&(a=()=>{o||window.open(n,"_self")}):a=()=>{o||(i?i.open(n,"_self"):window.open(n,"_blank"))},!(0,u.isIos)()||(0,u.isInIOSLine)()||(0,u.isInIOSLark)()||(0,u.isInIOSWeChat)()){r?i=window.open(e,"_blank"):window.location.href=e,setTimeout(a,3e3);let t=0,n=setInterval(()=>{console.log("windowOpen --> interval:",++t,document.hidden,document.visibilityState),(t>=10||document.hidden)&&(o=!0,clearInterval(n),console.log("windowOpen :cleat: ${count}"))},200);window.addEventListener("blur",()=>{o=!0},{once:!0}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(o=!0)})}else r?window.open(n,"_blank"):(console.log("windowOpen[before]: ",Date.now()),(null==window?void 0:window.okxLogDebug)?window.open(n,"_blank"):window.open(n,"_self"),console.log("windowOpen[after]: ",Date.now()))},t.getWindow=v,t.isTelegramUrl=function(e){if(!e)return!1;let t=new URL(e);return"tg:"===t.protocol||"t.me"===t.hostname},t.encodeTelegramUrlParameters=function(e){let t=e;return(t=(t=(t=(t=(t=t.replace(/\./g,"%2E")).replace(/-/g,"%2D")).replace(/_/g,"%5F")).replace(/&/g,"-")).replace(/=/g,"__")).replace(/%/g,"--")}
9,t.encodeConnectParams=m,t.encodeTWAConnectURLParams=y,t.getAppWalletDeepLink=function(e){return`${s.standardDeeplink}?param=${e}`},t.getAppWalletShortDeepLink=C,t.getTelegramWalletTWAUrl=O,t.openOKXTMAWalletlinkWithFallback=function(e){var t,n,r,o,i;(0,c.logDebug)("[TWA] open link:",e,"isInTMA ==> ",E()),E()?(null===(n=null===(t=v())||void 0===t?void 0:t.Telegram)||void 0===n?void 0:n.WebApp)?null===(i=null===(o=null===(r=v())||void 0===r?void 0:r.Telegram)||void 0===o?void 0:o.WebApp)||void 0===i||i.openTelegramLink(e):(0,d.sendOpenTelegramLink)(e):(0,l.getTestTwaUrl)()?window.open(e,"_blank"):window.open(e,"_self")},t.isInTMA=E,t.isInTelegramBrowser=function(){var e;let t=!!(null===(e=v())||void 0===e?void 0:e.TelegramWebview);return(E()||t)&&"unknown"===_},t.getOKXLink=function(e,t=!1,n){if((0,c.logDebug)(`url getOKXLink() called connectRequest==> ${JSON.stringify(e)} useMini=> ${t} tmaReturnUrl==> ${n}`),t)return e?O(y(e),null!=n?n:"back"):O(void 0,null!=n?n:"back");if((0,u.useShortLink)())return e?C(e.topic,e.clientId):l.shortUniversalLink;if(!e)return s.standardDeeplink;{let t=m(e);return`${s.standardDeeplink}?param=${t}`}};let s=n(11352),c=n(72465),l=n(82250),u=n(77573),d=n(30133),h=n(98573);function f(e){return"/"===e.slice(-1)?e.slice(0,-1):e}function g(e,t=!1){console.log("getUniversalLink deeplinkUrl:",e,", useStandardUniversalLink:",t);let n=encodeURIComponent(e);return console.log("getUniversalLink standardUniversalLink:",s.standardUniversalLink),console.log("getUniversalLink standardUniversalLink:",`${s.standardUniversalLink}?deeplink=${n}`),`${s.standardUniversalLink}?deeplink=${n}`}function p(e){(0,u.isIos)()?E()?window.open(e,"_blank"):(console.log("windowOpen[before]: ",Date.now()),(null==window?void 0:window.okxLogDebug)?window.open(e,"_blank"):window.open(e,"_self"),console.log("windowOpen[after]: ",Date.now())):window.open(e,"_blank")}function v(){if("undefined"!=typeof window)return window}function m(e){let t=JSON.stringify(Object.assign(Object.assign({},e),{protocolVersion:h.CONNECT_PROTOCOL_VER}));(0,c.logDebug)("url encodeConnectParams connectRequestStr ",t);let n=btoa(String.fromCharCode(...new TextEncoder().encode(t)));return(0,c.logDebug)("url encodeConnectParams base64Encoded ",n),n}function y(e){let t=JSON.stringify({topic:e.topic,clientId:e.clientId});return(0,c.logDebug)("url encodeConnectParams connectRequestStr",t),btoa(String.fromCharCode(...new TextEncoder().encode(t)))}function C(e,t){return`${l.shortUniversalLink}?topic=${e}${(0,u.getLastSixMd5Hash)(t)}`}function O(e,t){let n={okxconnect:"",redirect:"",extraparams:"",fromtg:!1};e&&(n.okxconnect=e),t&&(n.redirect=t),E()?n.fromtg=!0:n.fromtg=!1,(0,c.logDebug)("getTelegramWalletTWAUrl redirect:",n.redirect);let r=JSON.stringify(n),o=btoa(String.fromCharCode(...new TextEncoder().encode(r))),i=(0,u.toSafeBase64FromBase64)(o);if((0,c.logDebug)("[TWA] open link:",n,o),e||t){if(E())return(0,l.getTestTgTwaUrl)()?`${(0,l.getTestTgTwaUrl)()}?startapp=${i}`:`https://t.me/${l.tgwalletName}/start?startapp=${i}`;if((0,l.getTestTwaUrl)())return`${(0,l.getTestTwaUrl)()}?tgWebAppStartParam=${i}`;if(!(0,l.getTestTgTwaUrl)())return`tg://resolve?domain=${l.tgwalletName}&appname=${l.tgwalletAppName}&startapp=${i}`;{let e=(0,l.getBotNameAndAppName)((0,l.getTestTgTwaUrl)());if(e){let{botName:t,appName:n}=e;return`tg://resolve?domain=${t}&appname=${n}&startapp=${i}`}return`tg://resolve?domain=${l.tgwalletName}&appname=${l.tgwalletAppName}&startapp=${i}`}}if(E())return(0,l.getTestTgTwaUrl)()?`${(0,l.getTestTgTwaUrl)()}`:`https://t.me/${l.tgwalletName}/start`;if((0,l.getTestTwaUrl)())return`${(0,l.getTestTwaUrl)()}`;if(!(0,l.getTestTgTwaUrl)())return`tg://resolve?domain=${l.tgwalletName}&appname=${l.tgwalletAppName}`;{let e=(0,l.getBotNameAndAppName)((0,l.getTestTgTwaUrl)());if(e){let{botName:t,appName:n}=e;return`tg://resolve?domain=${t}&appname=${n}`}return`tg://resolve?domain=${l.tgwalletName}&appname=${l.tgwalletAppName}`}}function b(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch(t){return e}}let w={};try{let e=location.hash.toString();w=function(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(0>e.indexOf("=")&&0>e.indexOf("?"))return t._path=b(e),t;let n=e.indexOf("?");if(n>=0){let r=e.substr(0,n);t._path=b(r),e=e.substr(n+1)}let r=function(e){let t,n,r,o,i={};if(!e.length)return i;let a=e.split("&");for(t=0;t<a.length;t++)r=b((n=a[t].split("="))[0]),o=null==n[1]?null:b(n[1]),i[r]=o;return i}(e);for(let e in r)t[e]=r[e];return t}(e)}catch(e){}let _="unknown";if((null==w?void 0:w.tgWebAppPlatform)&&(_=null!==(r=w.tgWebAppPlatform)&&void 0!==r?r:"unknown"),"unknown"===_){let e=v();_=null!==(a=null===(i=null===(o=null==e?void 0:e.Telegram)||void 0===o?void 0:o.WebApp)||void 0===i?void 0:i.platform)&&void 0!==a?a:"unknown"}function E(){var e;return"unknown"!==_||!!(null===(e=v())||void 0===e?void 0:e.TelegramWebviewProxy)}},77573:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esMo
9dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.chainName2IdMap=t.isValidObject=t.RANDOM_LENGTH=t.isBrowser=t.resolveLocalStorage=t.hasLocalStorage=t.hasBuiltInWebSocket=t.resolveWebSocketImplementation=void 0,t.hexToByteArray=function(e){if(e.length%2!=0)throw Error(`Cannot convert ${e} to bytesArray`);let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n/2]=parseInt(e.slice(n,n+2),16);return t},t.getChainId=function(e){return e.includes(":")?e.split(":")[1]:e},t.toHexString=function(e){let t="";return e.forEach(e=>{t+=("0"+(255&e).toString(16)).slice(-2)}),t},t.concatUint8Arrays=function(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n},t.splitToUint8Arrays=function(e,t){if(t>=e.length)throw Error("Index is out of buffer");return[e.slice(0,t),e.slice(t)]},t.base64encode=function(e,t){let n;return e instanceof Uint8Array?n=e:("string"!=typeof e&&(e=(0,c.safeJsonStringify)(e)),n=i.default.decodeUTF8(e)),function(e,t){let n=i.default.encodeBase64(e);return t?encodeURIComponent(n):n}(n,t)},t.base64decode=function(e,t){var n;let r=(n=e,t&&(n=decodeURIComponent(n)),i.default.decodeBase64(n));return{toString:()=>i.default.encodeUTF8(r),toObject(){try{return(0,c.safeJsonParse)(i.default.encodeUTF8(r))}catch(e){return null}},toUint8Array:()=>r}},t.checkWSUrl=function(e){let t=e.match(RegExp(/^\w+:/,"gi"));if(!t||!t.length)return!1;let n=t[0];return void 0!==n&&RegExp("^wss?:").test(n)},t.hashKey=f,t.generateRandomBytes32=g,t.generateTopic=function(){let e=g();return(0,l.logDebug)(`generate topic called ${e}`),f((0,a.toString)(e,h))},t.generateGroupId=function(){let e=o.default.randomBytes(16);return(0,l.logDebug)(`generate groupid called ${e}`),f((0,a.toString)(e,h))},t.isInIOSLine=function(){return navigator.userAgent.includes("Safari Line/")&&p()},t.isInIOSLark=function(){return navigator.userAgent.includes("Lark/")&&p()},t.isInIOSWeChat=function(){return navigator.userAgent.includes("MicroMessenger/")&&p()},t.isIos=p,t.getLastSixMd5Hash=function(e){return d.default.MD5(e).toString().slice(-6)},t.toSafeBase64FromBase64=function(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},t.useShortLink=function(){return!1},t.replaceChainNameToChainId=function(e){return t.chainName2IdMap.forEach((t,n)=>{e.includes(n)&&(e=e.replace(n,t))}),e},t.replaceChainIdToChainName=function(e){return t.chainName2IdMap.forEach((t,n)=>{e.includes(t)&&(e=e.replace(t,n))}),e};let o=r(n(50780)),i=r(n(16885)),a=n(92263),s=n(73294),c=n(2145),l=n(72465),u=n(73813),d=r(n(81354)),h="base16";function f(e,t=h){(0,l.logDebug)(`hash key called ${e}`);let n=(0,s.hash)((0,u.okxfromString)(e,t));return(0,a.toString)(n,t)}function g(){return o.default.randomBytes(t.RANDOM_LENGTH)}function p(){let e=navigator.userAgent,t=navigator.maxTouchPoints||0,n=/iPad|iPhone|iPod/.test(e)&&!window.MSStream,r=e.includes("Mac")&&t>1;return(0,l.logDebug)(`utils isIos >>>isIOSDevice: ${n} >> isIPadOS: ${r}`),n||r}t.resolveWebSocketImplementation=()=>{if("undefined"!=typeof WebSocket);else if(void 0!==n.g&&void 0!==n.g.WebSocket)return n.g.WebSocket;else if("undefined"!=typeof window&&void 0!==window.WebSocket)return window.WebSocket;else if("undefined"!=typeof self&&void 0!==self.WebSocket)return self.WebSocket;return WebSocket},t.hasBuiltInWebSocket=()=>"undefined"!=typeof WebSocket||void 0!==n.g&&void 0!==n.g.WebSocket||"undefined"!=typeof window&&void 0!==window.WebSocket||"undefined"!=typeof self&&void 0!==self.WebSocket,t.hasLocalStorage=()=>void 0!==n.g&&void 0!==n.g.localStorage||"undefined"!=typeof window&&void 0!==window.localStorage,t.resolveLocalStorage=()=>void 0!==n.g&&void 0!==n.g.localStorage?n.g.localStorage:"undefined"!=typeof window&&void 0!==window.localStorage?window.localStorage:localStorage,t.isBrowser=()=>"undefined"!=typeof window,t.RANDOM_LENGTH=32,t.isValidObject=e=>Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length,t.chainName2IdMap=new Map,t.chainName2IdMap.set("aptos:mainnet","aptos:637"),t.chainName2IdMap.set("movement:testnet","aptos:70000060"),t.chainName2IdMap.set("movement:mainnet","aptos:70000066"),t.chainName2IdMap.set("soon:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","svm:70000069"),t.chainName2IdMap.set("soon:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","svm:70000067"),t.chainName2IdMap.set("eclipse:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","svm:70000068")},33849:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esMo
9dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.openLink=s,t.openLinkBlank=function(e){s(e,"_blank")},t.openDeeplinkWithFallback=function(e,t){let n=()=>{u("safari")||l("android")&&u("firefox")||t()},r=setTimeout(()=>n(),500);window.addEventListener("blur",()=>clearTimeout(r),{once:!0}),l("android")&&(0,a.inTg)()?s(e,"_blank"):s(e,"_self")},t.isMobileUserAgent=function(){var e;let t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.slice(0,4)))&&(t=!0),t},t.getUserAgent=c,t.isOS=l,t.isBrowser=u;let o=r(n(42238)),i=n(72465),a=n(30133);function s(e,t="_self"){(0,i.logDebug)("openLink",e,t),window.open(e,t,"noopener noreferrer")}function c(){var e,t,n;let r,i;let a=new o.default().getResult(),s=null===(e=a.os.name)||void 0===e?void 0:e.toLowerCase(),c=null===(t=a.device.model)||void 0===t?void 0:t.toLowerCase();switch(!0){case"ipad"===c:r="ipad";break;case"ios"===s:r="ios";break;case"android"===s:r="android";break;case"mac os"===s:r="macos";break;case"linux"===s:r="linux";break;case null==s?void 0:s.includes("windows"):r="windows"}let l=null===(n=a.browser.name)||void 0===n?void 0:n.toLowerCase();switch(!0){case"chrome"===l:i="chrome";break;case"firefox"===l:i="firefox";break;case null==l?void 0:l.includes("safari"):i="safari";break;case null==l?void 0:l.includes("opera"):i="opera"}return{os:r,browser:i}}function l(...e){return e.includes(c().os)}function u(...e){return e.includes(c().browser)}},11589:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.toUserFriendlyAddress=t.removeUrlLastSlash=t.addPathToUrl=t.createVersionInfo=t.BrowserEventDispatcher=t.createTransactionSigningFailedEvent=t.createTransactionSignedEvent=t.createTransactionSentForSignatureEvent=t.createDisconnectionEvent=t.createConnectionStartedEvent=t.createConnectionRestoringStartedEvent=t.createConnectionRestoringErrorEvent=t.createConnectionRestoringCompletedEvent=t.createConnectionErrorEvent=t.createConnectionCompletedEvent=t.createResponseVersionEvent=t.createRequestVersionEvent=t.OKX_TON_CONNECTION_AND_TRANSACTION_EVENT=t.OKXTonConnect=void 0;var i=n(40723);Object.defineProperty(t,"OKXTonConnect",{enumerable:!0,get:function(){return i.OKXTonConnect}}),o(n(98134),t);var a=n(38095);Object.defineProperty(t,"OKX_TON_CONNECTION_AND_TRANSACTION_EVENT",{enumerable:!0,get:function(){return a.OKX_TON_CONNECTION_AND_TRANSACTION_EVENT}}),Object.defineProperty(t,"createRequestVersionEvent",{enumerable:!0,get:function(){return a.createRequestVersionEvent}}),Object.defineProperty(t,"createResponseVersionEvent",{enumerable:!0,get:function(){return a.createResponseVersionEvent}}),Object.defineProperty(t,"createConnectionCompletedEvent",{enumerable:!0,get:function(){return a.createConnectionCompletedEvent}}),Object.defineProperty(t,"createConnectionErrorEvent",{enumerable:!0,get:function(){return a.createConnectionErrorEvent}}),Object.defineProperty(t,"createConnectionRestoringCompletedEvent",{enumerable:!0,get:function(){return a.createConnectionRestoringCompletedEvent}}),Object.defineProperty(t,"createConnectionRestoringErrorEvent",{enumerable:!0,get:function(){return a.createConnectionRestoringErrorEvent}}),Object.defineProperty(t,"createConnectionRestoringStartedEvent",{enumerable:!0,get:function(){return a.createConnectionRestoringStartedEvent}}),Object.defineProperty(t,"createConnectionStartedEvent",{enumerable:!0,get:function(){return a.createConnectionStartedEvent}}),Object.defineProperty(t,"createDisconnectionEvent",{enumerable:!0,get:function(){return a.createDisconnectionEvent}}),Object.defineProperty(t,"createTransactionSentForSignatureEvent",{enumerable:!0,get:function(){return a.createTransactionSentForSignatureEvent}}),Object.defineProperty(t,"createTransactionSignedEvent",{enumerable:!0,get:function(){return a.createTransactionSignedEvent}}),Object.defineProperty(t,"createTransactionSigningFailedEvent",{enumerable:!0,get:function(){return a.createTransactionSigningFailedEvent}}),Object.defineProperty(t,"BrowserEventDispatcher",{enumerable:!0,get:function(){return a.BrowserEventDispatcher}}),Object.defineProperty(t,"createVersionInfo",{enumerable:!0,get:function(){return a.createVersionInfo}});var s=n(33995);Object.defineProperty(t,"addPathToUrl",{enumerable:!0,get:function(){return s.addPathToUrl}}),Object.defineProperty(t,"removeUrlLastSlash",{enumerable:!0,get:function(){return s.removeUrlLastSlash}}),Object.defineProperty(t,"toUserFriendlyAddress",{enumerable:!0,get:function(){return s.toUserFriendlyAddress}})},59726:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
9ise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};Object.defineProperty(t,"__esModule",{value:!0}),t.OKXTonConnectInner=void 0;let i=n(71169),a=n(98134),s=n(76138),c=n(93591),l=n(54955),u=n(92617),d=n(48681);class h{constructor(e){if(this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.openUniversalLink=!!this.provider&&this.provider.openUniversalLink,this.connectors=[a.AppwalletConnector.getConnector()],(0,a.checkMetaData)(e.metaData),!e.metaData)throw(0,a.logDebug)("OKXTonConnect constructor error: options.metaData is nil"),new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"dapp metaData can not be null");(0,a.logDebug)("OKXTonConnect constructor options:",JSON.stringify(e)),this.dappSettings={metaData:Object.assign(Object.assign({},e.metaData),{url:window.location.hostname,origin:window.location.origin})},this.tracker=new c.TonConnectTracker({OKXtonConnectSdkVersion:d.OKXtonConnectSdkVersion}),this.storage=new a.Storage(d.OKXCONNECTOR_TON_KEY+this.dappSettings.metaData.name,d.OKXCONNECTOR_TON_KEY),this.bridgeConnectionStorage=new u.BridgeConnectionStorage(this.storage)}registerConnector(e){this.connectors=e}get connected(){return null!==this._wallet}get account(){var e;return(null===(e=this._wallet)||void 0===e?void 0:e.account)||null}get wallet(){return this._wallet}set wallet(e){this._wallet=e,this.statusChangeSubscriptions.forEach(e=>e(this._wallet))}connect(e){return r(this,void 0,void 0,function*(){var t;return(0,a.logDebug)("ton-Connect ==>> connect_1 >> request:",e),this.connected&&(0,a.logError)("It's already connected to OKX Wallet, please call disconnect() first"),yield null===(t=this.provider)||void 0===t?void 0:t.closeConnection(!1,!0),this.provider||(this.provider=new i.BridgeProvider(this.storage,this.dappSettings.metaData.name,this.connectors)),this.provider.listen(this.walletEventsListener.bind(this)),this.tracker.trackConnectionStarted(),yield this.provider.connect(this.createConnectRequest(e),null==e?void 0:e.redirect,null==e?void 0:e.openUniversalLink,null==e?void 0:e.tmaReturnUrl)})}walletEventsListener(e){switch((0,a.logDebug)("ton-Connect ==>> walletEventsListener_1 >> e:",e),e.event){case"connect":this.onWalletConnected(e.payload);break;case"connect_error":this.onWalletConnectError(e.payload);break;case"disconnect":this.onWalletDisconnected("wallet")}}onWalletConnected(e){(0,a.logDebug)("ton-Connect ==>> onWalletConnected_1 >> connectEvent:",e);let t=e.items.find(e=>"ton_addr"===e.name),n=e.items.find(e=>"ton_proof"===e.name);if(!t)throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"ton_addr connection item was not found");let r={device:e.device,provider:this.provider.type,account:{address:t.address,chain:t.network,walletStateInit:t.walletStateInit,publicKey:t.publicKey}};n&&(r.connectItems={tonProof:n}),this.wallet=r,(0,a.logDebug)("ton-Connect ==>> onWalletConnected_2 >> wallet:",r),this.tracker.trackConnectionCompleted(r)}onWalletConnectError(e){var t;(0,a.logDebug)("ton-Connect ==>> onWalletConnectError_1 >> connectEventError:",e);let n=new a.OKXConnectError(e.code,e.message);(0,a.logDebug)("ton-Connect ==>> onWalletConnectError_1 >> error:",n),this.statusChangeErrorSubscriptions.forEach(e=>e(n)),this.tracker.trackConnectionError(null!==(t=e.message)&&void 0!==t?t:"",e.code)}onWalletDisconnected(e){this.tracker.trackDisconnection(this.wallet,e),this.wallet=null}disconnect(){return r(this,void 0,void 0,function*(){var e;if((0,a.logDebug)("ton-Connect ==>> disconnect_1"),!this.connected)throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,"wallet is not connected");(0,a.logDebug)("ton-Connect ==>> disconnect_222"),this.onWalletDisconnected("dapp"),yield null===(e=this.provider)||void 0===e?void 0:e.disconnect()})}onStatusChange(e,t){return this.statusChangeSubscriptions.push(e),t&&this.statusChangeErrorSubscriptions.push(t),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(t=>t!==e),t&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(e=>e!==t))}}restoreConnection(){return r(this,void 0,void 0,function*(){var e;(0,a.logDebug)("ton-Connect ==>> restoreConnection_1"),this.tracker.trackConnectionRestoringStarted();let t=null;try{if(!(null==(t=yield i.BridgeProvider.fromStorage(this.storage,this.dappSettings.metaData.name,this.connectors))?void 0:t.isCryptoEnable())){this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),null==t||t.closeConnection(),t=null;return}}catch(e){this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),null==t||t.closeConnection(),t=null;return}if(!t){(0,a.logError)("Provider is not restored"),this.tracker.trackConnectionRestoringError("Provider is not restored");return}(0,a.logDebug)("ton-Connect ==>> restoreConnection_2 ==>> Provider is restored "),null===(e=this.provider)||void 0===e||e.closeConnection(!0,!1),this.provider=t,t.listen(this.walletEventsListener.bind(this)),yield this.provider.restoreConnection(),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")})}sendTransaction(e,t){return r(this,void 0,void 0,function*(){var n;(0,a.logDebug)("ton-Connect ==>> sendTransaction_1",e),this.checkConnection(),(0,s.checkSendTransactionSupport)(this.wallet.device.features,{requiredMessagesNumber:e.messages.length}),this.tracker.trackTransactionSentForSignature(this.wallet,e),(0,a.logDebug)("ton-Connect ==>> sendTransaction_2 ==>> check params");let{validUntil:r}=e,i=o(e,["validUntil"]),c=e.from||this.account.address,u=this.account.chain;(0,a.logDebug)("ton-Connect ==>> sendTransaction_2 ==>> await sendRequest",u),!(0,a.isIos)()||(null==t?void 0:t.doNotOpenWallet)||null===(n=this.provider)||void 0===n||n.openOKXWallet();let d=yield this.provider.sendRequest(l.sendTransactionParser.convertToRpcRequest(Object.assign(Object.assign({},i),{valid_until:r,from:c,network:u})),{onRequestSent:()=>{var e,n;(0,a.isIos)()||(null==t?void 0:t.doNotOpenWallet)||null===(e=this.provider)||void 0===e||e.openOKXWallet(),null===(n=null==t?void 0:t.onRequestSent)||void 0===n||n.call(t)}});if((0,a.logDebug)("ton-Connect ==>> sendTransaction_3 ==>>sendRequest response:",d),l.sendTransactionParser.isError(d))throw this.tracker.trackTransactionSigningFailed(this.wallet,e,d.error.message,d.error.code),new a.OKXConnectError(d.error.code,d.error.message);let h=l.sendTransactionParser.convertFromRpcResponse(d);return this.tracker.trackTransactionSigned(this.wallet,e,h),h})}checkConnection(){if((0,a.logDebug)("ton-Connect ==>> checkConnection"),!this.connected)throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,"Wallet not connected")}createConnectRequest(e){(0,a.logDebug)("ton-Connect ==>> createConnectRequest");let t={ton_addr:{name:"ton_addr"}};return(null==e?void 0:e.tonProof)&&(t.ton_proof={name:"ton_proof",payload:e.tonProof}),{dappInfo:this.dappSettings.metaData,params:t}}static getWallets(){return this.walletsList}}t.OKXTonConnectInner=h,h.walletsList=[(0,a.creatOKXWalletInfo)()]},40723:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
9ise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.OKXTonConnect=void 0;let o=n(98134),i=n(59726);class a{constructor(e){try{(0,o.logDebug)("OKXTonConnect constructor called"),window&&window.okxConnectTonsdkinwindow&&window.okxConnectTonsdkinwindow instanceof i.OKXTonConnectInner?(this.tonInner=window.okxConnectTonsdkinwindow,(0,o.logDebug)("OKXTonConnect constructor old called")):(this.tonInner=new i.OKXTonConnectInner(e),(0,o.logDebug)("OKXTonConnect constructor new called"),this.registerConnector([o.AppwalletConnector.getConnector()]),window&&(window.okxConnectTonsdkinwindow=this.tonInner))}catch(e){throw e}}get connected(){return this.tonInner.connected}get openUniversalLink(){return this.tonInner.openUniversalLink}get provider(){return this.tonInner.provider}get account(){return this.tonInner.account}get wallet(){return this.tonInner.wallet}set wallet(e){this.tonInner.wallet=e}connect(e){return r(this,void 0,void 0,function*(){return this.tonInner.connect(e)})}disconnect(){return r(this,void 0,void 0,function*(){return this.tonInner.disconnect()})}onStatusChange(e,t){return this.tonInner.onStatusChange(e,t)}restoreConnection(){return r(this,void 0,void 0,function*(){return this.tonInner.restoreConnection()})}sendTransaction(e,t){return r(this,void 0,void 0,function*(){return this.tonInner.sendTransaction(e,t)})}static getWallets(){return i.OKXTonConnectInner.getWallets()}registerConnector(e){this.tonInner.registerConnector(e)}}t.OKXTonConnect=a},41970:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RpcParser=void 0;class n{isError(e){return"error"in e}}t.RpcParser=n},54955:function(e,t,n){"use strict";var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};Object.defineProperty(t,"__esModule",{value:!0}),t.sendTransactionParser=void 0;let o=n(41970);class i extends o.RpcParser{convertToRpcRequest(e){let{redirect:t}=e;return{method:"ton_sendTransaction",redirect:t,params:r(e,["redirect"])}}convertFromRpcResponse(e){return{boc:e.result.toString()}}}t.sendTransactionParser=new i},92617:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.BridgeConnectionStorage=void 0;let o=n(98134);class i{constructor(e){this.storage=e,this.storeKey="ton_connect_info_adapter_universal"}storeConnection(e){return r(this,void 0,void 0,function*(){return(0,o.logDebug)("BridgeConnectionStorage ==>> storeConnection ==>> connection:",e),this.storage.saveContent(JSON.stringify(e),this.storeKey)})}removeConnection(){return r(this,void 0,void 0,function*(){return(0,o.logDebug)("BridgeConnectionStorage ==>> removeConnection"),this.storage.clearCache(this.storeKey)})}getConnection(){return r(this,void 0,void 0,function*(){let e=this.storage.getItem(this.storeKey);if((0,o.logDebug)("BridgeConnectionStorage ==>> getConnection ==>>this.storage: ",this.storage),!e||!(null==e?void 0:e.content))return null;try{let t=null==e?void 0:e.content;if(!t)return null;{let e;return e=JSON.parse(t),(0,o.logDebug)("BridgeConnectionStorage ==>> getConnection ==>>connection: ",e),e}}catch(e){return null}})}getHttpConnection(){return r(this,void 0,void 0,function*(){let e=yield this.getConnection();if(!e)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Trying to read HTTP connection source while nothing is stored");return e})}storeLastWalletEventId(e){return r(this,void 0,void 0,function*(){let t=yield this.getConnection();if(t&&"connectEvent"in t)return t.lastWalletEventId=e,this.storeConnection(t)})}getLastWalletEventId(){return r(this,void 0,void 0,function*(){let e=yield this.getConnection();if(e&&"lastWalletEventId"in e)return e.lastWalletEventId})}}t.BridgeConnectionStorage=i},71169:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
9ise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.BridgeProvider=void 0;let o=n(6341),i=n(98134),a=n(92617),s=n(48681),c=n(93591);class l{constructor(e,t,n){this.storage=e,this.type="http",this.listeners=[],this.walletConnectionSource={universalLink:i.standardUniversalLink},this.openUniversalLink=!1,this.engine=new i.Engine(t+"_okxton"),this.engine.registerConnector(n),this.connectionStorage=new a.BridgeConnectionStorage(e),this.tracker=new c.TonConnectTracker({OKXtonConnectSdkVersion:s.OKXtonConnectSdkVersion}),(0,i.getDefaultReporter)().configVersionAndSide("tonsdk-1.5.2","dapp",t)}static fromStorage(e){return r(this,arguments,void 0,function*(e,t,n){(0,i.logDebug)("bridge-provider ==>> fromStorage ==>>storage:",e),(0,i.reportLog)("bridge-provider ==>> fromStorage");let r=new a.BridgeConnectionStorage(e),s=yield r.getHttpConnection();if((0,o.isPendingConnectionHttp)(s))return null;let c=new l(e,t,n);return c.openUniversalLink=s.openUniversalLink,c})}isCryptoEnable(){return this.engine.connectionManager.getCryptoKeyEnable()}connect(e,t,n,o){return r(this,void 0,void 0,function*(){return(0,i.logDebug)("bridge-provider ==>> connect_1 ==>>message:",e),(0,i.logDebug)("bridge-provider ==>> connect_1 ==>>redirect:",t),(0,i.logDebug)("bridge-provider ==>> connect_1 ==>>openUniversalLink:",n),(0,i.logDebug)("bridge-provider ==>> connect_1 ==>>tmaReturnUrl:",o),(0,i.reportLog)("bridge-provider ==>> connect"),new Promise((r,a)=>{try{this.openUniversalLink=n,void 0===this.openUniversalLink&&(this.openUniversalLink=(0,i.isMobileUserAgent)());let s={namespace:"ton",chains:["ton:-239"],params:e.params},c=[];e.params.ton_addr&&c.push(e.params.ton_addr),e.params.ton_proof&&c.push(e.params.ton_proof),c.push({name:"requestAccounts",requiredNamespaces:[s]});let l={dappInfo:e.dappInfo,openUniversalUrl:this.openUniversalLink,redirect:t,tmaReturnUrl:o};this.engine.universalConnect(c,l,e=>{(0,i.logDebug)(`bridge-provider: connect: info>>>> ${JSON.stringify(e)}`);try{let t=(0,i.encodeConnectParams)(e.connectRequest),n=(0,i.getAppWalletDeepLink)(t),o=(0,i.getUniversalLink)(n);this.tracker.trackConnectionInfoBeforeJump(e),r(o)}catch(e){a(e)}}).then(e=>{(0,i.logDebug)(`bridge-provider: connect: success>>>> ${JSON.stringify(e)}`),this.connectSuccessHandle(e)}).catch(e=>{(0,i.logDebug)(`bridge-provider: connect: catch>>>> ${JSON.stringify(e)}`);let t={event:"connect_error",requestId:Number(Date.now()),payload:{code:e.code,message:e.message}};(0,i.logDebug)("bridge-provider ==>> connectListener_4 ==>>connect_error:",t),this.listeners.forEach(e=>e(t)),a(e)})}catch(e){console.error("bridge-provider connect try catch error:>>>",JSON.stringify(e)),a(e)}})})}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter(t=>t!==e)}disconnectListener(){return r(this,void 0,void 0,function*(){(0,i.logDebug)("bridge-provider ==>> disconnectListener"),(0,i.reportLog)("bridge-provider ==>> disconnectListener");let e={event:"disconnect",requestId:Number(1),payload:{}};this.listeners.forEach(t=>t(e)),yield this.closeConnection()})}connectSuccessHandle(e){return r(this,void 0,void 0,function*(){var t,n;try{let r=null===(t=e.namespaces)||void 0===t?void 0:t.ton,o=r.payload,a=e.wallet;if(!r||!o||!a||!o.ton_addr)throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR);o.ton_addr;let s=e.sessionConfig,c=[];o.ton_addr&&c.push(o.ton_addr),o.ton_proof&&c.push(o.ton_proof);let l={platform:a.platform,appName:a.appName,appVersion:a.appVersion,maxProtocolVersion:a.maxProtocolVersion,features:["ton_sendTransaction"]},u={type:"http",lastWalletEventId:Number(Date.now()),connectEvent:{event:"connect",payload:{items:c,device:l}},connectionSource:this.walletConnectionSource,channelId:e.topic,openUniversalLink:null==s?void 0:s.openUniversalUrl};(0,i.logDebug)("bridge-provider ==>> connectSuccessHandle_2 ==>>storeConnection:",u),yield this.connectionStorage.storeConnection(u),null===(n=this.engine)||void 0===n||n.addDisconnectListener(this.disconnectListener.bind(this));let d={event:"connect",requestId:u.lastWalletEventId,payload:u.connectEvent.payload};(0,i.logDebug)("bridge-provider ==>> connectSuccessHandle_3 ==>>
9listeners.forEach:",d),this.listeners.forEach(e=>e(d))}catch(t){(0,i.logDebug)("bridge-provider ==>> connectSuccessHandle_4 ==>>error:",t);let e={event:"connect_error",requestId:Number(Date.now()),payload:{code:i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,message:"Connect success connectSuccessHandle response error"}};(0,i.logDebug)("bridge-provider ==>> connectSuccessHandle_4 ==>>connect_error:",e),this.listeners.forEach(t=>t(e))}})}closeConnection(){return r(this,arguments,void 0,function*(e=!1,t=!1){var n,r;(0,i.logDebug)("bridge-provider ==>> closeConnection ==>>fromRestore:",e," needOpenUrl:",t),(0,i.reportLog)("bridge-provider ==>> closeConnection"),this.listeners=[],t||(yield null===(n=this.engine)||void 0===n?void 0:n.connectManagerDisconnect(e)),e||(null===(r=this.engine)||void 0===r||r.clearData(),yield this.connectionStorage.removeConnection())})}restoreConnection(){return r(this,void 0,void 0,function*(){var e;(0,i.logDebug)("bridge-provider ==>> restoreConnection_1"),(0,i.reportLog)("bridge-provider ==>> restoreConnection");let t=yield this.connectionStorage.getHttpConnection(),n=this.engine.connectionManager.getCryptoKeyEnable();if(!(!t||!n||(0,o.isPendingConnectionHttp)(t))){if((0,i.logDebug)("bridge-provider ==>> restoreConnection_2 ==>>storedConnection.channelId:",t.channelId),t.channelId)try{let n={event:"connect",requestId:Number(0),payload:t.connectEvent.payload};this.listeners.forEach(e=>e(n)),this.engine.setConnectConnector(t.connectEvent.payload.device);let r=t.channelId;(0,i.logDebug)("bridge-provider ==>> restoreConnection_3 ==>>this.engine.restoreConnect:",r),null===(e=this.engine)||void 0===e||e.addDisconnectListener(this.disconnectListener.bind(this)),yield this.engine.restoreconnectFromTopic(r)}catch(e){(0,i.logDebug)("bridge-provider ==>> restoreConnection_4 ==>>closeConnection_1"),yield this.closeConnection()}else(0,i.logDebug)("bridge-provider ==>> restoreConnection_4 ==>>closeConnection_2"),yield this.closeConnection()}})}openOKXWallet(){(0,i.logDebug)("bridge-provider ==>> openOKXWallet",this.openUniversalLink),(0,i.reportLog)("bridge-provider ==>> openOKXWallet"),this.openUniversalLink&&(0,i.openOKXDeeplink)(i.standardDeeplink)}disconnect(){return r(this,void 0,void 0,function*(){return(0,i.logDebug)("bridge-provider ==>> disconnect_1"),(0,i.reportLog)("bridge-provider ==>> disconnect"),new Promise(e=>r(this,void 0,void 0,function*(){let t=!1,n=()=>{t||(t=!0,this.closeConnection().then(e))};try{yield this.sendRequest({method:"disconnect"},{onRequestSent:n,attempts:1})}catch(n){t||this.closeConnection().then(e)}finally{n()}}))})}sendRequest(e,t,n){return(0,i.logDebug)("bridge-provider ==>> sendRequest"),(0,i.reportLog)("bridge-provider ==>> sendRequest"),new Promise((o,i)=>r(this,void 0,void 0,function*(){var r;try{yield null===(r=this.engine)||void 0===r?void 0:r.send(e,{resolve:function(e){o(e)},onAck:function(){var e;null===(e=null==t?void 0:t.onRequestSent)||void 0===e||e.call(t)}},n)}catch(e){i(e)}}))}connectorOpenWallet(){this.engine.openWallet()}}t.BridgeProvider=l},6341:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPendingConnectionHttp=function(e){return!("connectEvent"in e)}},86773:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserEventDispatcher=void 0;class r{constructor(){this.window=window}dispatchEvent(e,t){return n(this,void 0,void 0,function*(){var n;let r=new CustomEvent(e,{detail:t});null===(n=this.window)||void 0===n||n.dispatchEvent(r)})}addEventListener(e,t,r){return n(this,void 0,void 0,function*(){var n;return null===(n=this.window)||void 0===n||n.addEventListener(e,t,r),()=>{var n;return null===(n=this.window)||void 0===n?void 0:n.removeEventListener(e,t)}})}}t.BrowserEventDispatcher=r},38095:function(e,t,n){"use strict";
9Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserEventDispatcher=t.createVersionInfo=t.createTransactionSigningFailedEvent=t.createTransactionSignedEvent=t.createTransactionSentForSignatureEvent=t.createDisconnectionEvent=t.createConnectionStartedEvent=t.createConnectionRestoringStartedEvent=t.createConnectionRestoringErrorEvent=t.createConnectionRestoringCompletedEvent=t.createConnectionErrorEvent=t.createConnectionCompletedEvent=t.createResponseVersionEvent=t.createRequestVersionEvent=t.OKX_TON_CONNECTION_AND_TRANSACTION_EVENT=void 0;var r=n(92430);Object.defineProperty(t,"OKX_TON_CONNECTION_AND_TRANSACTION_EVENT",{enumerable:!0,get:function(){return r.OKX_TON_CONNECTION_AND_TRANSACTION_EVENT}});var o=n(34715);Object.defineProperty(t,"createRequestVersionEvent",{enumerable:!0,get:function(){return o.createRequestVersionEvent}}),Object.defineProperty(t,"createResponseVersionEvent",{enumerable:!0,get:function(){return o.createResponseVersionEvent}}),Object.defineProperty(t,"createConnectionCompletedEvent",{enumerable:!0,get:function(){return o.createConnectionCompletedEvent}}),Object.defineProperty(t,"createConnectionErrorEvent",{enumerable:!0,get:function(){return o.createConnectionErrorEvent}}),Object.defineProperty(t,"createConnectionRestoringCompletedEvent",{enumerable:!0,get:function(){return o.createConnectionRestoringCompletedEvent}}),Object.defineProperty(t,"createConnectionRestoringErrorEvent",{enumerable:!0,get:function(){return o.createConnectionRestoringErrorEvent}}),Object.defineProperty(t,"createConnectionRestoringStartedEvent",{enumerable:!0,get:function(){return o.createConnectionRestoringStartedEvent}}),Object.defineProperty(t,"createConnectionStartedEvent",{enumerable:!0,get:function(){return o.createConnectionStartedEvent}}),Object.defineProperty(t,"createDisconnectionEvent",{enumerable:!0,get:function(){return o.createDisconnectionEvent}}),Object.defineProperty(t,"createTransactionSentForSignatureEvent",{enumerable:!0,get:function(){return o.createTransactionSentForSignatureEvent}}),Object.defineProperty(t,"createTransactionSignedEvent",{enumerable:!0,get:function(){return o.createTransactionSignedEvent}}),Object.defineProperty(t,"createTransactionSigningFailedEvent",{enumerable:!0,get:function(){return o.createTransactionSigningFailedEvent}}),Object.defineProperty(t,"createVersionInfo",{enumerable:!0,get:function(){return o.createVersionInfo}});var i=n(86773);Object.defineProperty(t,"BrowserEventDispatcher",{enumerable:!0,get:function(){return i.BrowserEventDispatcher}})},93591:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.TonConnectTracker=void 0;let o=n(34715),i=n(86773);class a{get version(){return(0,o.createVersionInfo)({okx_ton_connect_sdk_lib:this.OKXtonConnectSdkVersion,okx_connect_ui_lib:this.OKXConnectUiVersion})}constructor(e){this.eventPrefix="okx-ton-connect-",this.OKXConnectUiVersion=null,this.eventDispatcher=new i.BrowserEventDispatcher,this.OKXtonConnectSdkVersion=e.OKXtonConnectSdkVersion,this.init().catch()}init(){return r(this,void 0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.OKXConnectUiVersion=yield this.requestTonConnectUiVersion()}catch(e){}})}setRequestVersionHandler(){return r(this,void 0,void 0,function*(){yield this.eventDispatcher.addEventListener("okx-ton-connect-request-version",()=>r(this,void 0,void 0,function*(){yield this.eventDispatcher.dispatchEvent("okx-ton-connect-response-version",(0,o.createResponseVersionEvent)(this.OKXtonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return r(this,void 0,void 0,function*(){return new Promise((e,t)=>r(this,void 0,void 0,function*(){try{yield this.eventDispatcher.addEventListener("okx-connect-ui-response-version",t=>{e(t.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("okx-connect-ui-request-version",(0,o.createRequestVersionEvent)())}catch(e){t(e)}}))})}dispatchUserActionEvent(e){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${e.type}`,e).catch()}catch(e){}}trackConnectionStarted(...e){try{let t=(0,o.createConnectionStartedEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionDeepLink(...e){try{let t=(0,o.createConnectionDeepLinkEvent)(...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionCompleted(...e){try{let t=(0,o.createConnectionCompletedEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionInfoBeforeJump(e){try{let t=(0,o.createConnectionInfoBeforeJumpEvent)(e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionError(...e){try{let t=(0,o.createConnectionErrorEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionRestoringStarted(...e){try{let t=(0,o.createConnectionRestoringStartedEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionRestoringCompleted(...e){try{let t=(0,o.createConnectionRestoringCompletedEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionRestoringError(...e){try{let t=(0,o.createConnectionRestoringErrorEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackDisconnection(...e){try{let t=(0,o.createDisconnectionEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackTransactionSentForSignature(...e){try{let t=(0,o.createTransactionSentForSignatureEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackTransactionSigned(...e){try{let t=(0,o.createTransactionSignedEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackTransactionSigningFailed(...e){try{let t=(0,o.createTransactionSigningFailedEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}}t.TonConnectTracker=a},92430:function(e,t){"use strict";var n,r;
9Object.defineProperty(t,"__esModule",{value:!0}),t.OKX_TON_CONNECTION_AND_TRANSACTION_EVENT=void 0,(r=n||(t.OKX_TON_CONNECTION_AND_TRANSACTION_EVENT=n={})).OKX_TON_CONNECTION_STARTED="okx-ton-connect-connection-started",r.OKX_TON_CONNECTION_COMPLETED="okx-ton-connect-connection-completed",r.OKX_TON_CONNECTION_ERROR="okx-ton-connect-connection-error",r.OKX_TON_CONNECTION_RESTORING_STARTED="okx-ton-connect-connection-restoring-started",r.OKX_TON_CONNECTION_RESTORING_COMPLETED="okx-ton-connect-connection-restoring-completed",r.OKX_TON_CONNECTION_RESTORING_ERROR="okx-ton-connect-connection-restoring-error",r.OKX_TON_DISCONNECTION="okx-ton-connect-disconnection",r.OKX_TON_TRANSACTION_SENT_FOR_SIGNATURE="okx-ton-connect-transaction-sent-for-signature",r.OKX_TON_TRANSACTION_SIGNED="okx-ton-connect-transaction-signed",r.OKX_TON_TRANSACTION_SIGNING_FAILED="okx-ton-connect-transaction-signing-failed"},34715:function(e,t){"use strict";function n(e){return{okx_ton_connect_sdk_lib:e.okx_ton_connect_sdk_lib,okx_connect_ui_lib:e.okx_connect_ui_lib}}function r(e,t){var r,o,i,a,s,c,l,u;let d=(null===(r=null==t?void 0:t.connectItems)||void 0===r?void 0:r.tonProof)&&"proof"in t.connectItems.tonProof;return{wallet_address:null!==(i=null===(o=null==t?void 0:t.account)||void 0===o?void 0:o.address)&&void 0!==i?i:null,wallet_type:null!==(a=null==t?void 0:t.device.appName)&&void 0!==a?a:null,wallet_version:null!==(s=null==t?void 0:t.device.appVersion)&&void 0!==s?s:null,auth_type:d?"ton_proof":"ton_addr",custom_data:Object.assign({chain_id:null!==(l=null===(c=null==t?void 0:t.account)||void 0===c?void 0:c.chain)&&void 0!==l?l:null,provider:null!==(u=null==t?void 0:t.provider)&&void 0!==u?u:null},n(e))}}function o(e,t){var n,r,o,i;return{valid_until:null!==(n=String(t.validUntil))&&void 0!==n?n:null,from:null!==(i=null!==(r=t.from)&&void 0!==r?r:null===(o=null==e?void 0:e.account)||void 0===o?void 0:o.address)&&void 0!==i?i:null,messages:t.messages.map(e=>{var t,n;return{address:null!==(t=e.address)&&void 0!==t?t:null,amount:null!==(n=e.amount)&&void 0!==n?n:null}})}}Object.defineProperty(t,"__esModule",{value:!0}),t.createRequestVersionEvent=function(){return{type:"request-version"}},t.createResponseVersionEvent=function(e){return{type:"response-version",version:e}},t.createVersionInfo=n,t.createConnectionStartedEvent=function(e){return{type:"connection-started",custom_data:n(e)}},t.createConnectionDeepLinkEvent=function(e){return{type:"connection-get-deeplink",deeplinkUrl:e}},t.createConnectionInfoBeforeJumpEvent=function(e){return{type:"connection-info-before-jump",connectInfo:e}},t.createConnectionCompletedEvent=function(e,t){return Object.assign({type:"connection-completed",is_success:!0},r(e,t))},t.createConnectionErrorEvent=function(e,t,r){return{type:"connection-error",is_success:!1,error_message:t,error_code:null!=r?r:null,custom_data:n(e)}},t.createConnectionRestoringStartedEvent=function(e){return{type:"connection-restoring-started",custom_data:n(e)}},t.createConnectionRestoringCompletedEvent=function(e,t){return Object.assign({type:"connection-restoring-completed",is_success:!0},r(e,t))},t.createConnectionRestoringErrorEvent=function(e,t){return{type:"connection-restoring-error",is_success:!1,error_message:t,custom_data:n(e)}},t.createTransactionSentForSignatureEvent=function(e,t,n){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},r(e,t)),o(t,n))},t.createTransactionSignedEvent=function(e,t,n,i){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:i.boc},r(e,t)),o(t,n))},t.createTransactionSigningFailedEvent=function(e,t,n,i,a){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:i,error_code:null!=a?a:null},r(e,t)),o(t,n))},t.createDisconnectionEvent=function(e,t,n){return Object.assign({type:"disconnection",scope:n},r(e,t))}},2600:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUserFriendlyAddress=function(e,t=!1){let{wc:n,hex:i}=function(e){if(!e.includes(":"))throw Error(`Wrong address ${e}. Address must include ":".`);let t=e.split(":");if(2!==t.length)throw Error(`Wrong address ${e}. Address must include ":" only once.`);let n=parseInt(t[0]);if(0!==n&&-1!==n)throw Error(`Wrong address ${e}. WC must be eq 0 or -1, but ${n} received.`);let r=t[1];if((null==r?void 0:r.length)!==64)throw Error(`Wrong address ${e}. Hex part must be 64bytes length, but ${null==r?void 0:r.length} received.`);return{wc:n,hex:function(e){let t=(e=e.toLowerCase()).length;if(t%2!=0)throw Error("Hex string must have length a multiple of 2: "+e);let n=t/2,r=new Uint8Array(n);for(let t=0;t<n;t++){let n=2*t,i=e.substring(n,n+2);if(!o.hasOwnProperty(i))throw Error("Invalid hex character: "+i);r[t]=o[i]}return r}(r)}}(e),a=81;t&&(a|=128);let s=new Int8Array(34);s[0]=a,s[1]=n,s.set(i,2);let c=new Uint8Array(36);return c.set(s),c.set(function(e){let t=0,n=new Uint8Array(e.length+2);for(let r of(n.set(e),n)){let e=128;for(;e>0;)t<<=1,r&e&&(t+=1),e>>=1,t>65535&&(t&=65535,t^=4129)}return new Uint8Array([Math.floor(t/256),t%256])}(s),34),(0,r.base64encode)(c,!1).replace(/\+/g,"-").replace(/\//g,"_")};let r=n(98134),o={};for(let e=0;e<=255;e++){let t=e.toString(16);t.length<2&&(t="0"+t),o[t]=e}},48681:function(e,t){"use strict";
9Object.defineProperty(t,"__esModule",{value:!0}),t.OKXCONNECTOR_TON_KEY=t.OKXtonConnectSdkVersion=void 0,t.OKXtonConnectSdkVersion="1",t.OKXCONNECTOR_TON_KEY="OKXStorage_ctc"},76138:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkSendTransactionSupport=function(e,t){if(!e.includes("ton_sendTransaction"))throw new r.OKXConnectError(r.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,"Wallet doesn't support SendTransaction feature.");if(4<t.requiredMessagesNumber)throw new r.OKXConnectError(r.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,`Wallet is not able to handle such SendTransaction request. Max support messages number is 4, but ${t.requiredMessagesNumber} is required.`)};let r=n(98134)},33995:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUserFriendlyAddress=t.removeUrlLastSlash=t.addPathToUrl=void 0;var r=n(62025);Object.defineProperty(t,"addPathToUrl",{enumerable:!0,get:function(){return r.addPathToUrl}}),Object.defineProperty(t,"removeUrlLastSlash",{enumerable:!0,get:function(){return r.removeUrlLastSlash}});var o=n(2600);Object.defineProperty(t,"toUserFriendlyAddress",{enumerable:!0,get:function(){return o.toUserFriendlyAddress}})},62025:function(e,t){"use strict";function n(e){return"/"===e.slice(-1)?e.slice(0,-1):e}Object.defineProperty(t,"__esModule",{value:!0}),t.removeUrlLastSlash=n,t.addPathToUrl=function(e,t){return n(e)+"/"+t}},29987:function(e,t){var n="undefined"!=typeof self?self:this,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();(function(e){var t={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};if(t.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};function i(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw TypeError("Invalid character in header field name");return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(n[Symbol.iterator]=function(){return n}),n}function c(e){this.map={},e instanceof c?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function l(e){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}function u(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function d(e){var t=new FileReader,n=u(t);return t.readAsArrayBuffer(e),n}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e){if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var n;t.arrayBuffer&&t.blob&&(n=e)&&DataView.prototype.isPrototypeOf(n)?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||o(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e)}}else this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,n,r=l(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=u(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},t.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(e,t){e=i(e),t=a(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},c.prototype.delete=function(e){delete this.map[i(e)]},c.prototype.get=function(e){return e=i(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(i(e))},c.prototype.set=function(e,t){this.map[i(e)]=a(t)},c.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},c.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),s(e)},c.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),s(e)},c.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),s(e)},t.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function p(e,t){var n,r,o=(t=t||{}).body;if(e instanceof p){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new c(t.headers)),this.method=(r=(n=t.method||this.method||"GET").toUpperCase(),g.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function v(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function m(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}p.prototype.clone=function(){return new p(this,{body:this._bodyInit})},f.call(p.prototype),f.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var y=[301,302,303,307,308];m.redirect=function(e,t){if(-1===y.indexOf(t))throw RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},e.DOMException=r.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function C(n,r){return new Promise(function(o,i){var a=new p(n,r);if(a.signal&&a.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEac
9h(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL"),o(new m("response"in s?s.response:s.responseText,n))},s.onerror=function(){i(TypeError("Network request failed"))},s.ontimeout=function(){i(TypeError("Network request failed"))},s.onabort=function(){i(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&t.blob&&(s.responseType="blob"),a.headers.forEach(function(e,t){s.setRequestHeader(t,e)}),a.signal&&(a.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",l)}),s.send(void 0===a._bodyInit?null:a._bodyInit)})}C.polyfill=!0,r.fetch||(r.fetch=C,r.Headers=c,r.Request=p,r.Response=m),e.Headers=c,e.Request=p,e.Response=m,e.fetch=C,Object.defineProperty(e,"__esModule",{value:!0})})({}),r.fetch.ponyfill=!0,delete r.fetch.polyfill,(t=r.fetch).default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t},37528:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.OKXBtcProvider=void 0;let o=n(88196),i=n(98134);class a{constructor(e){this.caip=["btc:mainnet","fractal:mainnet"],this.provider=e}getAddressForChainId(e){var t,n;if(void 0==this.checkChainId(e))throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId");let r=null===(n=null===(t=this.provider.session)||void 0===t?void 0:t.namespaces.btc)||void 0===n?void 0:n.accounts.filter(function(t){return t.startsWith(e)});if(void 0==r||r.length<0)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"no connected account");return r[0].split(":")[2]}getAccount(e){var t,n,r;if(void 0==this.checkChainId(e))throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId");let i=null===(r=null===(n=null===(t=this.provider.session)||void 0===t?void 0:t.namespaces.btc)||void 0===n?void 0:n.extra)||void 0===r?void 0:r[e],a="";return void 0!=i&&(a=i.compressedPublicKey),{address:this.getAddressForChainId(e),publicKey:a}}signMessage(e,t,n){return r(this,void 0,void 0,function*(){if(void 0==this.checkChainId(e))throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId");if("undefined"===t)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"the method signMessage parmas error");let r={signStr:t,from:this.getAddressForChainId(e)};n&&(r.type=n);try{let t=yield this.provider.request({method:"btc_signMessage",params:r},e);if("result"in t)return t.result;return t.error}catch(e){if(e instanceof o.OKXConnectError)throw e;throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"the method signTransaction request error")}})}sendBitcoin(e,t,n,i){return r(this,void 0,void 0,function*(){if(void 0==this.checkChainId(e))throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId");let r={from:this.getAddressForChainId(e),to:t,value:(n/1e8).toString()};(null==i?void 0:i.feeRate)&&(r.satBytes=i.feeRate.toString());let a=yield this.send(e,r);return void 0!==a&&"txhash"in a?a.txhash:a})}send(e,t){return r(this,void 0,void 0,function*(){if(void 0==this.checkChainId(e))throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId");if(!this.checkParameters(t,"to","value"))throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"the method send parmas error");t.from=this.getAddressForChainId(e);try{let n=yield this.provider.request({method:"btc_send",params:t},e);if("result"in n)return{txhash:n.result};return n.error}catch(e){if(e instanceof o.OKXConnectError)throw e;throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`the method send request error: ${e}`)}})}signPsbt(e,t,n){return r(this,void 0,void 0,function*(){return new Promise((r,o)=>{this.signPsbts(e,[t],[n]).then(e=>{r(JSON.parse(e)[0])}).catch(e=>{o(e)})})})}signPsbts(e,t,n){return r(this,void 0,void 0,function*(){if(void 0==this.checkChainId(e))throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId");if(void 0===t)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"the method signPsbts params error");let r={psbtHexs:t,options:n};r.from=this.getAddressForChainId(e);try{let t=yield this.provider.request({method:"btc_signPsbts",params:r},e);if("result"in t)return t.result}catch(e){if(e instanceof o.OKXConnectError)throw e;throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`the method send request error: ${e}`)}})}signAndPushPsbt(e,t,n){return r(this,void 0,void 0,function*(){if(void 0==this.checkChainId(e))throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId");if(void 0===t)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"the method signPsbts params error");let r={psbtHex:t,options:n};r.from=this.getAddressForChainId(e);try{let t=yield this.provider.request({method:"btc_signAndPushPsbt",params:r},e);if("result"in t)return JSON.parse(t.result);return t.error}catch(e){if(e instanceof o.OKXConnectError)throw e;throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`the method send request error: ${e}`)}})}sendInscription(e,t,n,i){return r(this,void 0,void 0,function*(){let r={address:t,inscriptionId:n,options:i};if(void 0==this.checkChainId(e))throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId");if("undefined"===t)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"the method sendInscription params error");var a=0;i&&"feeRate"in i&&(a=i.feeRate);let s=this.getAddressForChainId(e);var c=7;if("undefined"!==n){let e="-Atomicals",t="-Ordinals";(null==n?void 0:n.toLowerCase().endsWith(e.toLowerCase()))?(c=8,n=this.removeSuffix(n,e)):(null==n?void 0:n.toLowerCase().endsWith(t.toLowerCase()))&&
9(n=this.removeSuffix(n,t))}let l={scenario:5,feeRate:a,txType:"20",to:t,batchBean:[{coinAmount:"1",nftId:n,protocolId:c,coinId:"",inscriptionId:"",from:s}],extension:r};try{let t=yield this.provider.request({method:"btc_sendInscription",params:l},e);if("result"in t)return t.result;return t.error}catch(e){if(e instanceof o.OKXConnectError)throw e;throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"the method signTransaction request error")}})}sendRunes(e,t,n,a,s){return r(this,void 0,void 0,function*(){try{let r;if(!e||!t||!n||!a)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"The parameter is empty. Please check");let c=this.checkChainId(e);if(void 0!=c&&(c.startsWith("btc")?r=13:c.startsWith("fractal")&&(r=16)),void 0==c||void 0==r)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId");let l={fromAddress:this.getAddressForChainId(e),protocolId:r,address:t,runeid:n,amount:a,options:s};return(0,i.logDebug)("OKXBtcProvider sendRunes -->",JSON.str
9ingify(l)),(yield this.provider.request({method:"btc_sendRunes",params:l},e)).result}catch(e){throw e}})}inscribeTransfer(e,t,n){return r(this,void 0,void 0,function*(){try{let r;if(!e||!t||!n)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"The parameter is empty. Please check");let a=this.checkChainId(e);if(void 0!=a&&(a.startsWith("btc")?r=1:a.startsWith("fractal")&&(r=14)),void 0==a||void 0==r)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId");let s={fromAddress:this.getAddressForChainId(e),protocolId:r,ticker:t,amount:n};(0,i.logDebug)("OKXBtcProvider inscribeTransfer -->",JSON.stringify(s)),yield this.provider.request({method:"btc_inscribeTransfer",params:s},e)}catch(e){throw e}})}removeSuffix(e,t){return e.endsWith(t)?e.slice(0,e.length-t.length):e}checkParameters(e,...t){var n=[];return t.forEach(t=>{`${t}` in e||n.push(t)}),!(n.length>0)||(console.log("not find key: ",n.join(",")),!1)}checkChainId(e){if(this.caip.includes(e)){let[t,n]=e.split(":");return t}}}t.OKXBtcProvider=a,t.default=a},11925:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.OKXCosmosProvider=void 0;let o=n(98134);class i{constructor(e){this.provider=e}getAccount(e){var t,n,r,i,a,s;(0,o.logDebug)("OKXCosmosProvider getAccount chainId:",e),(0,o.logDebug)("OKXCosmosProvider getAccount namespaces:",JSON.stringify(null===(t=this.provider.session)||void 0===t?void 0:t.namespaces));let c=null===(r=null===(n=this.provider.session)||void 0===n?void 0:n.namespaces[o.NameSpaceKeyCosmos])||void 0===r?void 0:r.accounts.filter(function(t){return t.startsWith(e)})[0];if((0,o.logDebug)("OKXCosmosProvider getAccount account:",JSON.stringify(c)),!c)return;let l=c.split(":"),u=c.split(":")[2];(0,o.logDebug)("OKXCosmosProvider getAccount address:",u);let d=null===(s=null===(a=null===(i=this.provider.session)||void 0===i?void 0:i.namespaces[o.NameSpaceKeyCosmos])||void 0===a?void 0:a.extra)||void 0===s?void 0:s[`${l[0]}:${l[1]}`],h="";if(void 0!=d&&console.log("aptos_publicKey",h=d.publicKey),u)return{algo:"secp256k1",address:u,bech32Address:u,pubKey:this.hexToUint8Array(h)}}signArbitrary(e,t,n){return r(this,void 0,void 0,function*(){let r=window.btoa(n),o={chainId:e,method:"cosmos_signArbitrary",params:{signer:t,chain_id:e.split(":")[1],data:{chain_id:"",account_number:"0",sequence:"0",fee:{gas:"0",amount:[]},msgs:[{type:"sign/MsgSignData",value:{signer:t,data:r}}],memo:""}}};try{let t=yield this.provider.request(o,e);if(!("result"in t))return t.error;if("string"==typeof t.result)return JSON.parse(t.result);return t.result}catch(e){return e}})}signAmino(e,t,n,o){return r(this,void 0,void 0,function*(){if("sign/MsgSignData"==n.msgs[0].type){let r={chainId:e,method:"cosmos_signArbitrary",params:{signer:t,chain_id:e.split(":")[1],data:n}};try{let t=yield this.provider.request(r,e);if("result"in t)return t.result;return t.error}catch(e){return e}}else{let r={chainId:e,method:"cosmos_signAmino",params:{signer:t,chainId:e.split(":")[1],sign_doc:n,signOptions:o}};try{let t=yield this.provider.request(r,e);if(!("result"in t))return t.error;{let e=JSON.parse(t.result);return console.log("signdoc",n,e.signDoc),n.fee=e.signDoc.fee,{signed:n,signature:e.signature}}}catch(e){return e}}})}signDirect(e,t,n,o){return r(this,void 0,void 0,function*(){let r={bodyBytes:this.bufferToHex(n.bodyBytes),authInfoBytes:this.bufferToHex(n.authInfoBytes),chainId:n.chainId,accountNumber:n.accountNumber?n.accountNumber.toString():null,signOptions:o||null},i={chainId:e,method:"cosmos_signDirect",params:{signer:t,chainId:e.split(":")[1],sign_doc:r}};try{let t=yield this.provider.request(i,e);if("result"in t){let e=JSON.parse(t.result);return console.log("signdirect result",e),n.authInfoBytes=this.messageToBuffer(e.signDoc.authInfoBytes),{signed:n,signature:e.signature}}}catch(e){return e}})}messageToBuffer(e){var t=Uint8Array.from([]);try{t="string"==typeof e?this.hexToUint8Array(e.replace("0x","")):Uint8Array.from(e)}catch(e){console.log(`messageToBuffer error: ${e}`)}return t}bufferToHex(e){return"0x"+[...new Uint8Array(e)].map(e=>e.toString(16).padStart(2,"0")).join("")}hexToUint8Array(e){if(e.length%2!=0)throw"Invalid hexString";for(var t=new Uint8Array(e.length/2),n=0;n<e.length;n+=2){var r=parseInt(e.substr(n,2),16);if(isNaN(r))throw"Invalid hexString";t[n/2]=r}return t}}t.OKXCosmosProvider=i},41444:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
9ise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.OKXStarknetProvider=void 0;let o=n(98134);class i{constructor(e){this.STARKNET_CHAIN_ID="starknet:mainnet",this.provider=e}getChain(e){if(null==e&&(e=this.STARKNET_CHAIN_ID),e!=this.STARKNET_CHAIN_ID)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED,"The chainId:"+e+"is wrong for OKXStarknetProvider");return e}getAccount(e){var t,n,r,i,a;let s=null===(n=null===(t=this.provider.session)||void 0===t?void 0:t.namespaces[o.NameSpaceKeyStarknet])||void 0===n?void 0:n.accounts.filter(function(t){return t.startsWith(e)})[0];if(!s)return;let c=s.split(":"),l=s.split(":")[2],u=null===(a=null===(i=null===(r=this.provider.session)||void 0===r?void 0:r.namespaces[o.NameSpaceKeyStarknet])||void 0===i?void 0:i.extra)||void 0===a?void 0:a[`${c[0]}:${c[1]}`],d="";if(void 0!=u&&(d=u.publicKey),l)return{address:l,pubKey:d}}signMessage(e,t,n){return r(this,void 0,void 0,function*(){n=this.getChain(n),0==e.length&&(e=this.getAccount(n).address);let r={chainId:n,method:"starknet_signMessage",params:{accountAddress:e,typedData:t}};try{let e=yield this.provider.request(r,n);if(!("result"in e))return e.error;{let t=e.result;return"string"==typeof t&&(t=JSON.parse(t)),[t.signedDataR,t.signedDataS]}}catch(e){return e}})}sendTransaction(e,t,n){return r(this,void 0,void 0,function*(){n=this.getChain(n);let r={method:"starknet_sendTransaction",params:{data:JSON.stringify({accountAddress:e,executionRequest:t}),from:e}};try{let e=yield this.provider.request(r,n);if("result"in e)return{transaction_hash:e.result};return e.error}catch(e){return e}})}signMessageDeclareContractPayload(e,t){return r(this,void 0,void 0,function*(){t=this.getChain(t);try{let n=yield this.provider.request({method:"starknet_signMessage",params:e},t);if("result"in n)return{transaction_hash:n.result.txHash,class_hash:n.result.classHash};return n.error}catch(e){return e}})}sendMessageExecuteTransactionDetail(e,t,n,o,i){return r(this,void 0,void 0,function*(){i=this.getChain(i);let r={calls:Array.isArray(t)?t:[t],abis:n,transactionsDetail:{nonce:null==o?void 0:o.nonce,maxFee:null==o?void 0:o.nonce,version:null==o?void 0:o.version}};return this.sendTransaction(e,r,i)})}}t.OKXStarknetProvider=i},12253:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.OKXTonProvider=void 0;let o=n(88196),i=n(98134);class a{constructor(e){this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.provider=e,this.provider.on("connect",()=>{let e=this.wallet();(0,i.logDebug)("OKXTONProvider event connect:",JSON.stringify(e)),this.statusChangeSubscriptions.forEach(t=>t(e))}),this.provider.on("reconnect",()=>{let e=this.wallet();(0,i.logDebug)("OKXTONProvider event reconnect:",JSON.stringify(e)),this.statusChangeSubscriptions.forEach(t=>t(e))}),this.provider.on("disconnect",()=>{(0,i.logDebug)("OKXTONProvider event disconnect:"),this.statusChangeSubscriptions.forEach(e=>e(null))}),this.provider.on("connect_error",e=>{(0,i.logDebug)("OKXTONProvider event connect_error:",JSON.stringify(e)),this.statusChangeErrorSubscriptions.forEach(t=>t(e))})}connected(){return!!this.provider.connected()&&!!this.provider.session.namespaces.ton}account(){try{if(!this.provider.session)return null;let e=this.provider.session.namespaces.ton;if(!e||!e.payload||!e.payload.ton_addr)return null;let t=e.payload.ton_addr;return{address:t.address,chain:t.network,walletStateInit:t.walletStateInit,publicKey:t.publicKey}}catch(e){return(0,i.logDebug)("OKXTONProvider account error:",JSON.stringify(e)),null}}wallet(){if(this.connected())try{let e=this.provider.session.wallet,t={device:{platform:e.platform,appName:e.appName,a
9ppVersion:e.appVersion,maxProtocolVersion:e.maxProtocolVersion,features:["ton_sendTransaction"]},provider:"http",account:this.account()},n=this.provider.session.namespaces.ton;return n&&n.payload&&n.payload.ton_proof&&(t.connectItems={tonProof:n.payload.ton_proof}),(0,i.logDebug)("OKXTONProvider wallet :",JSON.stringify(t)),t}catch(e){(0,i.logDebug)("OKXTONProvider wallet error:",JSON.stringify(e))}return null}onStatusChange(e,t){return this.statusChangeSubscriptions.push(e),t&&this.statusChangeErrorSubscriptions.push(t),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(t=>t!==e),t&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(e=>e!==t))}}sendTransaction(e){return r(this,void 0,void 0,function*(){if(e.network&&e.network!==i.TONCHAIN.MAINNET)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"OKXTONProvider sendTransaction network error");if(e.network||(e.network=i.TONCHAIN.MAINNET),this.provider.session&&!e.from){let t=this.provider.requestAccountsWithNamespace("ton");e.from=t[0]}let t={method:"ton_sendTransaction",params:e},n="ton:"+i.TONCHAIN.MAINNET;return(0,i.logDebug)("OKXTONProvider sendTransaction transaction----:",n,JSON.stringify(t)),this.provider.request(t,n)})}}t.OKXTonProvider=a,t.default=a},69647:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.OKXTronProvider=void 0;let o=n(98134);class i{constructor(e){this.TRON_CHAIN_ID="tron:mainnet",this.provider=e}getChain(e){if(null==e&&(e=this.TRON_CHAIN_ID),e!=this.TRON_CHAIN_ID)throw new o.OKXConnectError(o.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED,"The chainId:"+e+"is wrong for OKXTronProvider");return e}getAccount(e){var t,n,r,i,a;e=this.getChain(e);let s=null===(n=null===(t=this.provider.session)||void 0===t?void 0:t.namespaces[o.NameSpaceKeyTron])||void 0===n?void 0:n.accounts.filter(function(t){return t.startsWith(e)})[0];if(!s)return;let c=s.split(":"),l=s.split(":")[2],u=null===(a=null===(i=null===(r=this.provider.session)||void 0===r?void 0:r.namespaces[o.NameSpaceKeyTron])||void 0===i?void 0:i.extra)||void 0===a?void 0:a[`${c[0]}:${c[1]}`];if(void 0!=u&&u.publicKey,l)return{address:l}}stringToHex(e){let t="";for(let n=0;n<e.length;n++)t+=e.charCodeAt(n).toString(16).padStart(2,"0");return t}signMessage(e,t){return r(this,void 0,void 0,function*(){let n={chainId:t=this.getChain(t),method:"tron_signMessage",params:{message:this.stringToHex(e)}};try{let e=yield this.provider.request(n,t);if("result"in e)return e.result;return e.error}catch(e){return e}})}signMessageV2(e,t){return r(this,void 0,void 0,function*(){let n={chainId:t=this.getChain(t),method:"tron_signMessageV2",params:{message:e}};try{let e=yield this.provider.request(n,t);if("result"in e)return e.result;return e.error}catch(e){return e}})}signTransaction(e,t){return r(this,void 0,void 0,function*(){t=this.getChain(t);try{let n=yield this.provider.request({method:"tron_signTransaction",params:e},t);if("result"in n){let e;e="string"==typeof n.result?JSON.parse(n.result):n.result;let t={};t.visible=e.visible,t.txID=e.txID;let r={};return r.contract=e.raw_data.contract,r.expiration=e.raw_data.expiration,r.ref_block_bytes=e.raw_data.ref_block_bytes,r.fee_limit=e.raw_data.fee_limit,r.ref_block_hash=e.raw_data.ref_block_hash,r.timestamp=e.raw_data.timestamp,t.raw_data=r,t.raw_data_hex=e.raw_data_hex,t.signature=e.signature,t}}catch(e){return e}})}signAndSendTransaction(e,t){return r(this,void 0,void 0,function*(){t=this.getChain(t);try{let n=yield this.provider.request({method:"tron_signAndSendTransaction",params:e},t);if("result"in n)return n.result}catch(e){return e}})}}t.OKXTronProvider=i},222:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
9ise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.OKXUniversalProvider=void 0;let i=n(33876),a=n(6702),s=n(52419),c=o(n(26729)),l=n(64537),u=n(98134),d=n(98134),h=n(23525),f=o(n(97911)),g=o(n(74263)),p=o(n(43995)),v=o(n(96945)),m=o(n(74454)),y=o(n(76988)),C=n(2042),O=n(12125),b=n(11788),w=o(n(61318));class _{static init(e){return r(this,void 0,void 0,function*(){let t;return(0,d.logDebug)("OKXUniversalProvider init() called"),(0,d.checkMetaData)(e.dappMetaData),(0,C.setGlobal)("disableProviderPing",!0),window&&window.okxConnectUniversalinwindow&&window.okxConnectUniversalinwindow instanceof _?((0,d.logDebug)("OKXUniversalConnect init() old called"),t=window.okxConnectUniversalinwindow):((0,d.logDebug)("OKXUniversalConnect init() new called"),t=new _(e),window&&(window.okxConnectUniversalinwindow=t),yield t.initialize()),(0,d.getDefaultReporter)().configVersionAndSide("universalprovider-1.5.2","dapp",t.providerOpts.dappMetaData.name),t})}constructor(e){this.rpcProviders={},this.events=new c.default,e.connector&&0!=e.connector.length||(e.connector=[d.AppwalletConnector.getConnector(),d.TgwalletConnector.getConnector()]),this.providerOpts=e}request(e,t){return r(this,void 0,void 0,function*(){if((0,d.logDebug)("OKXUniversalProvider request() called"),(0,d.reportLog)("OKXUniversalProvider request() called"),!this.connected())throw new d.OKXConnectError(d.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR);(0,d.logDebug)("OKXUniversalProvider request() connected ");let{namespace:n,requestParam:r}=this.buildRequestParamFromRequest(e,t);return yield this.getProvider(n).request(r)})}buildRequestParamFromRequest(e,t){var n;(0,d.logDebug)("UniversalProvider request args >>>>>>>: ",t,(0,d.safeJsonStringify)(e));let[r,o]=this.validateChain(t);if(!this.session)throw new d.OKXConnectError(d.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Please call connect() before request()");let i=Object.keys(this.session.namespaces);if(!t&&i&&i.length>1)throw new d.OKXConnectError(d.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,"Multiple chains have been linked, the request method requires chain");let a=(0,u.replaceChainNameToChainId)(`${r}:${o}`);null!=a&&(r=a.split(":")[0],o=a.split(":")[1]);let s=Object.assign(Object.assign({},e),{chainId:`${r}:${o}`,redirect:null!==(n=e.redirect)&&void 0!==n?n:this.sessionConfig.redirect});return{namespace:r,requestParam:s}}enable(){return r(this,void 0,void 0,function*(){if(!this.client)throw new d.OKXConnectError(d.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Sign Client not initialized");if(!this.session){if(this.connectOpts)yield this.connect(this.connectOpts);else throw new d.OKXConnectError(d.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Sign Client not initialized")}return yield this.requestAccounts()})}disconnect(){return r(this,void 0,void 0,function*(){if((0,d.logDebug)("OKXUniversalProvider disconnect() called"),(0,d.reportLog)("provider disconnect called"),!this.session)throw new d.OKXConnectError(d.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR);return new Promise(e=>r(this,void 0,void 0,function*(){let t=!1,n=()=>r(this,void 0,void 0,function*(){t||(t=!0,yield this.disconnectAndEmit(),yield this.cleanup(),e(),(0,d.logDebug)("UniversalProvider disconnect Disconnected"),(0,d.reportLog)("provider disconnect disconnected"))});try{yield this.client.disconnect(),yield n()}catch(e){yield n()}}))})}disconnectAndEmit(){var e,t;this.client.engine.connectManagerDisconnect(),this.events.emit("disconnect",{topic:null===(e=this.session)||void 0===e?void 0:e.topic}),this.events.emit("session_delete",{topic:null===(t=this.session)||void 0===t?void 0:t.topic})}replaceNamespace(e,t){var n,r;let o=null===(n=e.namespaces)||void 0===n?void 0:n[t];if(void 0!=o){let n=this.replaceNamespaceInner(o);void 0!=e.namespaces&&t in e.namespaces&&void 0!=n&&(e.namespaces[t]=n)}let i=null===(r=e.optionalNamespaces)||void 0===r?void 0:r[t];if(void 0!=i){let n=this.replaceNamespaceInner(i);void 0!=e.optionalNamespaces&&t in e.optionalNamespaces&&void 0!=n&&(e.optionalNamespaces[t]=n)}return e}replaceNamespaceInner(e){var t;return void 0!=e&&(e.chains=null===(t=e.chains)||void 0===t?void 0:t.map(e=>(0,u.replaceChainNameToChainId)(e)),void 0!=e.defaultChain&&(e.defaultChain=(0,u.replaceChainNameToChainId)(e.defaultChain))),e}replaceSessionAptos(e,t){var n;let r=null===(n=null==e?void 0:e.namespaces)||void 0===n?void 0:n[t];if(void 0!=r&&void 0!=r.chains){r.chains=r.chains.map(e=>(0,u.replaceChainIdToChainName)(e)),r.accounts=r.accounts.map(e=>(0,u.replaceChainIdToChainName)(e));let n={};Object.keys(r.extra||{}
9).forEach((r,o)=>{(0,u.replaceChainIdToChainName)(r),n[(0,u.replaceChainIdToChainName)(r)]=Object.values((null==e?void 0:e.namespaces[t].extra)||{})[o]}),r.extra=n}(0,d.logDebug)("replaceSessionAptos",e)}connected(){(0,d.logDebug)("OKXUniversalProvider connected() called"),(0,d.reportLog)("provider connected called");let e=()=>{try{this.cleanup(),this.client.engine.connectManagerDisconnect()}catch(e){(0,d.logDebug)("Error during disconnect:",e)}};try{if(!this.session)return!1;if(!this.client.engine.getCurrentConnectionReady(Object.keys(this.session.namespaces)))return e(),!1;return!0}catch(t){return e(),!1}}connectAndSign(e,t){return r(this,void 0,void 0,function*(){(0,d.logDebug)("OKXUniversalProvider connectAndSign() called");let n=Object.assign(Object.assign({},e),{signRequest:t});return(0,d.logDebug)("OKXUniversalProvider connectAndSign() opts:",JSON.stringify(e)),(0,d.logDebug)("OKXUniversalProvider connectAndSign() signRequest:",JSON.stringify(t)),yield this.connect(n)})}connect(e){return r(this,void 0,void 0,function*(){if((0,d.logDebug)("OKXUniversalProvider connect() called"),(0,d.reportLog)("provider connect called"),!this.client)throw new d.OKXConnectError(d.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Sign Client not initialized");if(this.connected())return this.session;e=this.replaceNamespace(e,"aptos"),e=this.replaceNamespace(e,"solana"),(0,d.logDebug)("OKXUniversalProvider connect >>>>",JSON.stringify(e)),void 0===e.sessionConfig&&(e.sessionConfig={}),void 0===e.sessionConfig.openUniversalUrl&&(e.sessionConfig.openUniversalUrl=(0,d.isMobileUserAgent)()),this.setNamespaces(e);try{(0,d.logDebug)(`UniversalProvider connect opts.stringify ====> ${JSON.stringify(e)}`);let t=yield this.client.connect(e);if((0,d.logDebug)(`UniversalProvider connect success ====> ${JSON.stringify(t)}`),t){if(this.replaceSessionAptos(t,"aptos"),this.replaceSessionAptos(t,"solana"),this.session=t,this.client.session=t,this.setConnectConnector(),(0,d.logDebug)("OKXUniversalProvider connect success opts>>>>",JSON.stringify(e)),this.onConnect(),e.signRequest&&e.signRequest.length>0){let t=e.signRequest[0],n=[];"undefined"!=typeof window&&window&&window.okxConnectUniversalUIinwindow?((0,d.logDebug)("OKXUniversalProvider connect success, us UI SDK>>>>"),this.session.signResponse&&this.session.signResponse.length>0&&(n=this.session.signResponse)):((0,d.logDebug)("OKXUniversalProvider connect success, us Universal SDK>>>>"),this.session.signResponse&&this.session.signResponse.length>0?n=this.session.signResponse:n.push((0,O.creatNotSupportMethodItemReplay)(t))),(0,d.logDebug)(`UniversalProvider connect success connectRequestReply ====> ${JSON.stringify(n)}`),setTimeout(()=>{this.events.emit("connect_signResponse",n)},100)}return t}return}catch(e){throw(0,d.logDebug)("UniversalProvider connect error ====> ",JSON.stringify(e)),e}})}syncAllAddresses(){return r(this,void 0,void 0,function*(){if((0,b.syncAddressAvailable)(this.session.wallet))return this.client.syncAllAddress();throw new d.OKXConnectError(d.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)})}setConnectConnector(){var e;this.client.setConnectConnector(null===(e=this.session)||void 0===e?void 0:e.wallet)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}setDefaultChain(e,t){(0,d.logDebug)("OKXUniversalProvider setDefaultChain() called");try{if(!this.connected())return;let[n,r]=this.validateChain(e);this.getProvider(n).setDefaultChain(r,t)}catch(e){if(!/Please call connect/.test(e.message))throw e}}checkStorage(){return r(this,void 0,void 0,function*(){let e=yield this.getFromStore("connectSession");if((0,d.logDebug)(e),e){(0,d.logDebug)("checkStorage error start");try{this.session=e,this.client.session=this.session,this.setConnectConnector(),yield this.client.restoreconnect(e),this.sessionConfig=e.sessionConfig,this.client.sessionConfig=this.sessionConfig,(0,d.logDebug)("[evm u-provider] do reconnection",this.session),this.createProviders(),this.registerEventListeners(),setTimeout(()=>{this.events.emit("reconnect",{session:this.session})},100)}catch(e){yield this.cleanup(),(0,d.logDebug)(`checkStorage error ${JSON.stringify(e)}`)}}})}initialize(){return r(this,void 0,void 0,function*(){(0,d.logDebug)("OKXUniversalProvider initialize() called"),(0,d.reportLog)("provider initialize called");let e=Object.assign({url:window.location.hostname,origin:window.location.origin},this.providerOpts.dappMetaData);this.client=new l.SignClient(e,this.events),this.registerConnector(this.providerOpts.connector),yield this.checkStorage()})}createProviders(){if(!this.client)throw new d.OKXConnectError(d.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Sign Client not initialized");if(!this.connected())throw new d.OKXConnectError(d.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Session not initialized. Please call connect() before enable()");let e=[...new Set(Object.keys(this.session.namespaces).filter(e=>{var t,n;return(null===(n=null===(t=this.session.namespaces[e])||void 0===t?void 0:t.accounts)||void 0===n?void 0:n.length)>0}).map(e=>(0,h.parseNamespaceKey)(e)))];this.rpcProviders={}
9,e.forEach(e=>{if(!this.session)return;let t=this.session.namespaces[e];switch((0,d.logDebug)("init eip155 >> ",t),e){case"eip155":this.rpcProviders[e]=new i.Eip155Provider({namespace:t},this.client,this.events);break;case"solana":let n={namespace:t},r=new f.default(n,"solana",this.client,this.events);this.rpcProviders[e]=r;let o=new f.default(n,"sonic",this.client,this.events);this.rpcProviders.sonic=o;let s=new f.default(n,"svm",this.client,this.events);this.rpcProviders.svm=s;let c=new f.default(n,"soon",this.client,this.events);this.rpcProviders.soon=c;let l=new f.default(n,"eclipse",this.client,this.events);this.rpcProviders.eclipse=l;break;case"ton":let u=new v.default({namespace:t},this.client,this.events);this.rpcProviders[e]=u;break;case"sui":let h=new a.SuiProvider({namespace:t},this.client,this.events);h.name="sui",this.rpcProviders[e]=h;break;case"btc":let C={namespace:t},O=new g.default(C,"btc",this.client,this.events);this.rpcProviders.btc=O;let b=new g.default(C,"fractal",this.client,this.events);this.rpcProviders.fractal=b;break;case"aptos":let _=new p.default({namespace:t},"aptos",this.client,this.events);this.rpcProviders[e]=_;let E=new p.default({namespace:t},"movement",this.client,this.events);this.rpcProviders.movement=E;break;case"cosmos":let R=new m.default({namespace:t},this.client,this.events);this.rpcProviders[e]=R;break;case"tron":let N=new y.default({namespace:t},this.client,this.events);this.rpcProviders[e]=N;break;case"starknet":let S=new w.default({namespace:t},"starknet",this.client,this.events);this.rpcProviders[e]=S}})}registerEventListeners(){if(void 0===this.client)throw new d.OKXConnectError(d.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Sign Client is not initialized");this.client.engine.addDisconnectListener(()=>{this.disconnectAndEmit(),this.cleanup()}),this.on(s.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e)}),this.on(s.PROVIDER_EVENTS.UPDATE_NAMESPACES,e=>{if(e){let t=Object.keys(e)[0];this.session&&(this.session.namespaces[t]=e[t],this.session&&(this.persist("connectSession",this.session),this.events.emit("session_update",this.session)),(0,d.logDebug)("PROVIDER_EVENTS.UPDATE_NAMESPACES this.session... ->>>",JSON.stringify(this.session)))}})}getProvider(e){return(0,d.logDebug)("current get providers",this.rpcProviders),(0,d.logDebug)("query namespace: ",e),this.rpcProviders[e]}setNamespaces(e){this.connectOpts=e;let{namespaces:t,sessionConfig:n}=e,r={origin:window.location.origin,url:window.location.hostname,name:this.providerOpts.dappMetaData.name,icon:this.providerOpts.dappMetaData.icon,manifestUrl:this.providerOpts.dappMetaData.manifestUrl};this.sessionConfig=Object.assign({dappInfo:r},n),(0,d.logDebug)("setNamespaces sessionConfig>>>",this.sessionConfig),this.client.sessionConfig=this.sessionConfig,this.persist("sessionConfig",n)}validateChain(e){var t;let[n,r]=(null==e?void 0:e.split(":"))||["",""];if(!this.session||!this.session.namespaces||!Object.keys(this.session.namespaces).length)return(0,d.logDebug)("get name & chain",n,r),[n,r];if(n){if(!this.isChainNamespaceInSession(n))throw new d.OKXConnectError(d.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Namespace '${n}' is not configured. Please call connect() first with namespace config.`);if(r&&e){(0,d.logDebug)("this.session.namespaces -->> ",n,JSON.stringify(this.session.namespaces));let r=null===(t=this.session.namespaces[n])||void 0===t?void 0:t.chains;if((0,d.logDebug)("get chainsArr & chain",JSON.stringify(r),e),r&&!r.includes(e))throw new d.OKXConnectError(d.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Namespace not include the chain '${e}'`)}}if(n&&r)return(0,d.logDebug)("get name & chain",n,r),[n,r];let o=(0,h.parseNamespaceKey)(Object.keys(this.session.namespaces)[0]),i=this.rpcProviders[o].getDefaultChain();return(0,d.logDebug)("get default chain:",i),[o,i]}isChainNamespaceInSession(e){var t,n;if(Object.keys((null===(t=this.session)||void 0===t?void 0:t.namespaces)||{}).map(e=>(0,h.parseNamespaceKey)(e)).includes(e))return!0;let r=!1;return Object.values((null===(n=this.session)||void 0===n?void 0:n.namespaces)||{}
9).forEach(t=>{t.chains.forEach(t=>{t.split(":")[0]==e&&(r=!0)})}),r}requestAccountsWithNamespace(e){return this.getProvider(e).requestAccounts()}requestDefaultChainWithNamespace(e){return this.getProvider(e).getDefaultChain()}requestAccounts(){return r(this,void 0,void 0,function*(){let[e]=this.validateChain();return yield this.getProvider(e).requestAccounts()})}onChainChanged(e){var t;if(!(null===(t=this.session)||void 0===t?void 0:t.namespaces))return;let[n,r]=this.validateChain(e);r&&(this.session.namespaces[n]&&(this.session.namespaces[n].defaultChain=r,this.persist("connectSession",this.session)),this.events.emit("chainChanged",r))}onConnect(){this.createProviders(),this.session&&(this.persist("connectSession",this.session),console.log("window.okxwallet save session:",Date.now())),this.events.emit("connect",{session:this.session}),this.registerEventListeners()}cleanup(){return r(this,void 0,void 0,function*(){this.session=void 0,this.client.session=void 0,this.setConnectConnector(),this.sessionProperties=void 0,this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),this.persist("connectSession",void 0)})}persist(e,t){return(0,d.logDebug)("[evm u-provider] persisit data",e,t),this.client.engine.saveSessionContent(e,t)}getFromStore(e){return r(this,void 0,void 0,function*(){return this.client.engine.getSessionContent(e)})}showRequestModal(e,t){try{let{namespace:n,requestParam:r}=this.buildRequestParamFromRequest(e,t);return this.getProvider(n).showRequestModal(r)}catch(e){return!1}}openWallet(e,t){this.client.openWallet(e,t)}registerConnector(e){this.client.registerConnector(e),this.client.setAccountChangeListener(e=>{(0,d.logDebug)("accountChangeListener sessionï¼",this.events.listenerCount("accountChanged"),JSON.stringify(e));try{e&&this.events.listenerCount("accountChanged")&&(this.replaceSessionAptos(e,"aptos"),this.replaceSessionAptos(e,"solana"),this.session=e,this.client.session=e,this.session&&(this.persist("connectSession",this.session),console.log("window.okxwallet save session:",Date.now())),this.setConnectConnector(),this.createProviders(),this.events.emit("accountChanged",this.session))}catch(e){(0,d.logDebug)("setAccountChangeListener error:",JSON.stringify(e))}})}}t.OKXUniversalProvider=_,t.default=_},88196:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.OKXStarknetProvider=t.OKXTronProvider=t.OKXTonProvider=t.OKXCosmosProvider=t.OKXBtcProvider=t.OKXUniversalProvider=void 0,o(n(5893),t),o(n(12125),t);var i=n(222);Object.defineProperty(t,"OKXUniversalProvider",{enumerable:!0,get:function(){return i.OKXUniversalProvider}});var a=n(37528);Object.defineProperty(t,"OKXBtcProvider",{enumerable:!0,get:function(){return a.OKXBtcProvider}});var s=n(11925);Object.defineProperty(t,"OKXCosmosProvider",{enumerable:!0,get:function(){return s.OKXCosmosProvider}});var c=n(12253);Object.defineProperty(t,"OKXTonProvider",{enumerable:!0,get:function(){return c.OKXTonProvider}});var l=n(69647);Object.defineProperty(t,"OKXTronProvider",{enumerable:!0,get:function(){return l.OKXTronProvider}});var u=n(41444);Object.defineProperty(t,"OKXStarknetProvider",{enumerable:!0,get:function(){return u.OKXStarknetProvider}}),o(n(98134),t)},12125:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};
9Object.defineProperty(t,"__esModule",{value:!0}),o(n(43195),t)},64537:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SignClient=void 0;let o=n(98134),i=n(23525),a=n(20421),s=n(52419);class c extends o.ISignClient{constructor(e,t){super(e),this.connect=e=>r(this,void 0,void 0,function*(){return new Promise((t,n)=>r(this,void 0,void 0,function*(){try{var c=[];(0,o.logDebug)("client connect params >>>",JSON.stringify(e));var l={name:"requestAccounts",requiredNamespaces:(0,i.nameSpaceToConnectWalletNameSpace)(e.namespaces),optionalNamespaces:(0,i.nameSpaceToConnectWalletNameSpace)(e.optionalNamespaces)};this.engine.setSessionConnectingListener(()=>{(0,o.logDebug)("sessionConnectingListener >>>"),this.events.emit(s.PROVIDER_EVENTS.SESSION_CONNECTING)}),e.signRequest&&(l.connectRequestMethods=yield(0,a.connectMethodsToConnectWalletMethods)(e.signRequest,l.requiredNamespaces)),c.push(l),(0,o.logDebug)("client connect connectRequest >>>",JSON.stringify(c)),this.engine.universalConnect(c,Object.assign({dappInfo:this.metadata},e.sessionConfig),e=>{e&&e.connectRequest&&((0,o.logDebug)("universalConect info.connectRequest :",e.connectRequest),(0,o.logDebug)("universalConect url:",(0,o.getOKXLink)(e.connectRequest,this.sessionConfig.useMini)),this.events.emit("display_uri",(0,o.getOKXLink)(e.connectRequest,this.sessionConfig.useMini)),this.events.emit("short_display_uri",(0,o.getAppWalletShortDeepLink)(e.connectRequest.topic,e.connectRequest.clientId)),(0,o.logDebug)(`universalConect EngineConnectInfo ${JSON.stringify(e)}`),this.events.emit("okx_engine_connect_params",e))}).then(n=>r(this,void 0,void 0,function*(){(0,i.fillParamsToSession)(n,e.namespaces,e.optionalNamespaces,this.sessionConfig),(0,o.logDebug)(`signClient: connect: session ${JSON.stringify(n)}`),e.signRequest&&(yield(0,a.connectMethodsResponseUpdate)(n,e.signRequest)),t(n)})).catch(e=>{(0,o.logDebug)(`signClient: connect: catch ${JSON.stringify(e)}`),this.events.emit("connect_error",e),n(e)})}catch(e){(0,o.logDebug)(`signClient: connect: ${JSON.stringify(e)}`),n(e)}}))}),this.restoreconnect=e=>r(this,void 0,void 0,function*(){return new Promise((t,n)=>{this.engine.restoreconnect(e,e=>{e?t(e):n()})})}),this.reject=e=>r(this,void 0,void 0,function*(){}),this.request=e=>r(this,void 0,void 0,function*(){return new Promise((t,n)=>r(this,void 0,void 0,function*(){var r,i;(0,o.logDebug)("clint request --params>>>> >",null===(r=this.sessionConfig)||void 0===r?void 0:r.openUniversalUrl,(0,o.safeJsonStringify)(e));try{(null===(i=this.sessionConfig)||void 0===i?void 0:i.openUniversalUrl)&&(0,o.isIos)()&&this.openOKXWallet(),yield this.engine.send(e,{resolve:e=>{if(delete e.requestId,(0,o.logDebug)("clint request --response >",(0,o.safeJsonStringify)(e)),"error"in e&&e.error){let t=e.error;n(new o.OKXConnectError(e.error.code,e.method+":"+t.message))}else t(e)},onAck:()=>{var e;!(0,o.isIos)()&&(null===(e=this.sessionConfig)||void 0===e?void 0:e.openUniversalUrl)&&this.openOKXWallet()}})}catch(e){(0,o.logDebug)("clint request --error:",e),n(e)}}))}),this.disconnect=()=>r(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.engine.send({method:"disconnect"},{onAck:()=>{e()}},864e5).catch(e=>{console.log(`disconnect : ${JSON.stringify(e)}`),t(e)})})}),this.engine=new o.Engine(e.name),this.events=t,this.metadata=e}setAccountChangeListener(e){this.engine.setAccountChangeListener(e)}openOKXWallet(){(0,o.logDebug)("bridge-provider ==>> connect_5"),this.engine.openWallet({tmaReturnUrl:this.sessionConfig.tmaReturnUrl})}syncAllAddress(){return r(this,void 0,void 0,function*(){return new Promise((e,t)=>{this.engine.send({method:"sync_all_addresses"},{resolve:n=>{if(delete n.requestId,(0,o.logDebug)("clint syncAllAddress --response >",JSON.stringify(n)),"error"in n&&n.error){let e=n.error;t(new o.OKXConnectError(n.error.code,n.method+":"+e.message))}else{let t=n.result;e((0,a.syncResoonseToRequire)(t))}}}).catch(e=>{console.log(`disconnect : ${JSON.stringify(e)}`),t(e)})})})}registerConnector(e){this.engine.registerConnector(e)}openWallet(e,t){this.engine.openWallet(e,t)}setConnectConnector(e){this.engine.setConnectConnector(e)}}t.SignClient=c},20421:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
9ise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.connectSupportMethods=void 0,t.creatNotSupportMethodItemReplay=function(e){let t=new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED);return{method:e.method,chainId:e.chainId,error:{code:t.code,message:t.message}}},t.connectMethodsAdaptOldVersion=function(e,t){return r(this,void 0,void 0,function*(){var n,r,o,c,l;try{(0,i.logDebug)("connectMethodsAdaptOldVersion start params :",JSON.stringify(e));let d={};if("solana_signMessage"===e.method){let o=null===(n=t.namespaces[i.NameSpaceKeySOL])||void 0===n?void 0:n.accounts.filter(function(t){return t.startsWith(e.chainId)})[0],c=(0,s.fromAccountToAddress)(o);if(e.params&&c&&"message"in e.params){let n=e.params.message;if((null===(r=t.wallet)||void 0===r?void 0:r.appName)=="OKX Wallet"){let e=new TextEncoder().encode(n);n=a.default.encode(e)}return e.params={message:n,pubkey:c},e.injectParams=e.params,d={publicKey:c},(0,i.logDebug)("solana_signMessage account and address:",JSON.stringify(o),c),(0,i.logDebug)("solana_signMessage callBackParams:",JSON.stringify(d)),d}throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)}if("sui_signMessage"===e.method||"sui_signPersonalMessage"===e.method){if("message"in e.params&&e.params.message){let t=JSON.parse(JSON.stringify(e.params.message)),n=Object.values(t),r=new Uint8Array(n),o=new TextDecoder("utf8"),a=btoa(o.decode(r));return e.params={message:atob(a)},e.injectParams={message:r},console.log("sui_signMessag suiMessagee suiMessageb64:>>>>",JSON.stringify(e.params),a),"sui_signMessage"===e.method?d={messageBytes:a,signature:""}:"sui_signPersonalMessage"===e.method&&(d={bytes:a,signature:""}),(0,i.logDebug)("sui_signMessage/sui_signPersonalMessage callBackParams:",JSON.stringify(d)),d}throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)}if("btc_signMessage"===e.method){let n=(null===(o=t.namespaces[i.NameSpaceKeyBtc])||void 0===o?void 0:o.accounts.filter(function(t){return t.startsWith(e.chainId)}))[0],r=(0,s.fromAccountToAddress)(n);if((0,i.logDebug)("btc_signMessage account and address:",JSON.stringify(n),r),r){if("message"in e.params&&e.params.message&&"string"==typeof e.params.message)e.params={from:r,signStr:e.params.message};else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED);return e.params.from=r,(0,i.logDebug)("btc_signMessage callBackParams:",JSON.stringify(d)),d}throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)}if("aptos_signMessage"===e.method){let n=e.params,r=null===(c=t.namespaces[i.NameSpaceKeyAptos])||void 0===c?void 0:c.accounts.filter(function(t){return t.startsWith(e.chainId)})[0],o=(0,s.fromAccountToAddress)(r);if(n&&o){let t="APTOS",r="",a="";var u=t;let s=window.location.protocol+"//"+window.location.hostname;"address"in n&&n.address&&(u+="\naddress: "+o),"application"in n&&n.application&&(u+="\napplication: "+s);let c=1;"chainId"in n&&n.chainId&&("aptos:mainnet"==n.chainId?c=1:"movement:testnet"==n.chainId&&(c=2),u+="\nchainId: "+c),"message"in n&&(u+="\nmessage: "+n.message,r=n.message),"nonce"in n&&(u+="\nnonce: "+n.nonce,a=n.nonce);let l=new TextEncoder().encode(u),h=Array.from(l).map(e=>e.toString(16).padStart(2,"0")).join("");return e.params={message:h},(0,i.logDebug)("aptos_signMessage requestParams:",JSON.stringify(e)),d={address:o,application:s,chainId:c,fullMessage:u,message:r,nonce:a,prefix:t,signature:""},(0,i.logDebug)("aptos_signMessage callBackParams:",JSON.stringify(d)),d}throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)}else if("cosmos_signArbitrary"===e.method){let n=null===(l=null==t?void 0:t.namespaces[i.NameSpaceKeyCosmos])||void 0===l?void 0:l.accounts.filter(function(t){return t.startsWith(e.chainId)})[0],r=(0,s.fromAccountToAddress)(n),o=e.params.message,a=btoa(o);
9if((0,i.logDebug)("cosmos_signArbitrary account and address:",JSON.stringify(n),r),(0,i.logDebug)("cosmos_signArbitrary cosmosBase64Encoded:",a),o&&r)return e.params={signer:r,chain_id:e.chainId.split(":")[1],data:{chain_id:"",account_number:"0",sequence:"0",fee:{gas:"0",amount:[]},msgs:[{type:"sign/MsgSignData",value:{signer:r,data:a}}],memo:""}},(0,i.logDebug)("cosmos_signArbitrary callBackParams:",JSON.stringify(d)),d;throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)}(0,i.logDebug)("sol_handleSignatureData end params:",JSON.stringify(e))}catch(e){throw e}})},t.connectMethodsResponseUpdate=function(e,t){return r(this,void 0,void 0,function*(){var n;try{if(e.signResponse){for(let r of((0,i.logDebug)("connectMethodsResponseUpdate signResponse:",JSON.stringify(e.signResponse)),(0,i.logDebug)("connectMethodsResponseUpdate session.namespaces:",JSON.stringify(e.namespaces)),e.signResponse))if((0,i.logDebug)("connectMethodsResponseUpdate methodItem:",JSON.stringify(r)),"result"in r){if("solana_signMessage"===r.method){let t=r.result;(0,i.logDebug)("solana_signMessage methodItem.chainId:",r.chainId);let o=null===(n=e.namespaces[i.NameSpaceKeySOL])||void 0===n?void 0:n.accounts.filter(function(e){return(0,i.logDebug)("solana_signMessage account:",e),e.startsWith(r.chainId)})[0];(0,i.logDebug)("solana_signMessage result account:",t,o),t&&o&&(r.result={signature:a.default.decode(t),publicKey:(0,s.fromAccountToAddress)(o)})}else if("sui_signMessage"===r.method||"sui_signPersonalMessage"===r.method){let e=t.filter(function(e){return e.method===r.method})[0];if(e&&e.params&&"message"in e.params){let t=e.params.message,n=btoa(t);console.log("sui_signMessag suiMessagee suiMessageb64:>>>>",t,n),"sui_signMessage"===r.method?r.result={messageBytes:n,signature:r.result}:"sui_signPersonalMessage"===r.method&&(r.result={bytes:n,signature:r.result})}}else if("aptos_signMessage"===r.method){if(r.chainId=(0,i.replaceChainIdToChainName)(r.chainId),r.result=JSON.parse(r.result),console.log("aptos_signMessage result methodItem.result before:>>>>",JSON.stringify(r.result)),r.result&&"signature"in r.result){let e=r.result.signature;e&&e.startsWith("0x")&&(e=e.slice(2,e.length),r.result.signature=e)}console.log("aptos_signMessage result methodItem.result after:>>>>",JSON.stringify(r.result))}else if("cosmos_signArbitrary"===r.method)r.result=JSON.parse(r.result);else if("starknet_signMessage"==r.method){let e=r.result;"string"==typeof e&&(e=JSON.parse(e)),r.result=[e.signedDataR,e.signedDataS]}else"sync_all_addresses"==r.method&&(r.result=l(r.result))}}}catch(e){throw(0,i.logDebug)("connectMethodsResponseUpdate signResponse Error:",JSON.stringify(e)),e}})},t.connectMethodsToConnectWalletMethods=function(e,n){return r(this,void 0,void 0,function*(){try{(0,i.logDebug)("connectMethodsToConnectWalletMethods requestMethods:",JSON.stringify(e));let u=[];if(e&&e.length>1)throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"connectAndSign/openModalAndSign signRequest only support one data");if(!n&&e&&e.length>0)throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Connect request params error , RequestMethods cannot be added when the NameSpace is empty");for(let t of e)if("aptos_signMessage"===t.method&&(t.chainId=(0,i.replaceChainNameToChainId)(t.chainId)),"wallet_addEthereumChain"===t.method){if(!(null==n?void 0:n.some(e=>e.namespace.includes("eip155"))))throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Connect request params error, When using '${t.method}', the EVM chain needs to be included in the NameSpace`)}else if("sync_all_addresses"===t.method){if((0,s.syncAddressHostAvailable)())t.chainId="";else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)}else if(!(null==n?void 0:n.some(e=>e.chains.some(e=>e.includes(`${t.chainId}`)))))throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Connect request params error, When using '${t.method}', NameSpace must contain '${t.chainId}'`);for(let n of e){if(!t.connectSupportMethods.includes(n.method))throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect requestMethods not support method, method: '${n.method}'`);if("wallet_addEthereumChain"===n.method){if(Array.isArray(n.params)){let e=n.params;if(e&&1===e.length){let t=e[0];c(t)&&(n.params=t)}else if(e&&e.length>1)throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params only support one data, method: '${n.method}'`);else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is nil, method: '${n.method}'`)}}else if("personal_sign"===n.method){var r;if(r=n.params,"object"==typeof r&&null!==r&&Array.isArray(r)){if(n.params&&1!==n.params.length)throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params error, method: '${n.method}' `);let e=n.params[0];if(e&&"string"==typeof e)n.params={message:e};else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${n.method}' `)}}
9else if("sui_signMessage"===n.method||"sui_signPersonalMessage"===n.method){if(c(n.params)&&"message"in n.params){if(n.params.message){(0,i.logDebug)("sui_signMessage item.params.message :",n.params.message);let e=JSON.parse(JSON.stringify(n.params.message)),t=Object.values(e),r=new Uint8Array(t),o=new TextDecoder("utf8"),a=btoa(o.decode(r));n.params.message=atob(a)}else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${n.method}' `)}else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${n.method}' `)}else if("solana_signMessage"===n.method){if(c(n.params)&&"message"in n.params){if(n.params.message&&"string"==typeof n.params.message){let e=new TextEncoder().encode(n.params.message);n.params.bs58Message=a.default.encode(e)}else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${n.method}' `)}else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${n.method}' `)}else if("aptos_signMessage"===n.method){if(c(n.params)){if(n.chainId){var o=n.params,l=window.location.protocol+"//"+window.location.hostname;let e=1;"aptos:637"===n.chainId||"aptos:70000060"===n.chainId&&(e=2),n.params={data:o,applicationUrl:l,prefix:"APTOS",aptosChainId:e}}else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params chainId is error, method: '${n.method}' `)}else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${n.method}' `)}else if("cosmos_signArbitrary"===n.method){if(c(n.params)){if(n.params.message&&"string"==typeof n.params.message){let e=btoa(n.params.message),t=n.chainId.split(":")[1];if(t)n.params={chain_id:t,data:{chain_id:"",account_number:"0",sequence:"0",fee:{gas:"0",amount:[]},msgs:[{type:"sign/MsgSignData",value:{signer:"",data:e}}],memo:""}};else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params chainId is error, method: '${n.method}' `)}else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params message is error, method: '${n.method}' `)}else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${n.method}' `)}else if("tron_signMessage"==n.method){if(c(n.params)){if("message"in n.params&&n.params.message&&"string"==typeof n.params.message)n.params.message=function(e){let t="";for(let n=0;n<e.length;n++)t+=e.charCodeAt(n).toString(16).padStart(2,"0");return t}(n.params.message);else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${n.method}' `)}else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${n.method}' `)}else if("btc_signMessage"==n.method){if(c(n.params)){if("message"in n.params&&n.params.message&&"string"==typeof n.params.message)n.params={signStr:n.params.message};else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${n.method}' `)}else throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${n.method}' `)}(0,i.logDebug)("connectMethodsToConnectWalletMethods item:",JSON.stringify(n)),u.push(n)}return u}catch(e){throw e}})},t.syncResoonseToRequire=l;let i=n(98134),a=o(n(77191)),s=n(11788);function c(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function l(e){let t=JSON.parse(e);return{type:t.type,isEvm:t.isEvm,walletName:t.walletName,deriveName:t.deriveName,addresses:t.addresses.map(e=>({coinId:e.ci,address:e.a&&"null"!==e.a?e.a:t.evmAddress}))}}t.connectSupportMethods=Object.freeze(["personal_sign","sui_signMessage","sui_signPersonalMessage","btc_signMessage","aptos_signMessage","cosmos_signArbitrary","tron_signMessage","tron_signMessageV2","starknet_signMessage","sync_all_addresses"])},43195:function(e,t,n){"use strict";
9Object.defineProperty(t,"__esModule",{value:!0}),t.creatNotSupportMethodItemReplay=t.connectMethodsAdaptOldVersion=void 0;var r=n(20421);Object.defineProperty(t,"connectMethodsAdaptOldVersion",{enumerable:!0,get:function(){return r.connectMethodsAdaptOldVersion}}),Object.defineProperty(t,"creatNotSupportMethodItemReplay",{enumerable:!0,get:function(){return r.creatNotSupportMethodItemReplay}})},23525:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAccountsChains=function(e){let t=[];return e.forEach(e=>{let[n,r]=e.split(":");t.push(`${n}:${r}`)}),t},t.nameSpaceToConnectWalletNameSpace=function(e){var t=[];return e&&Object.keys(e).forEach(n=>{(n===r.NameSpaceKeyEip155||n===r.NameSpaceKeySOL||n===r.NameSpaceKeySui||n===r.NameSpaceKeyAptos||n==r.NameSpaceKeyBtc||n===r.NameSpaceKeyTON||n===r.NameSpaceKeyCosmos||n===r.NameSpaceKeyTron||n===r.NameSpaceKeyStarknet)&&e[n].chains&&t.push({namespace:n,chains:e[n].chains,params:e[n].params})}),t},t.fillParamsToSession=function(e,t,n,o){let i=(e,t)=>{Object.assign(e,t)},a=(e,t)=>{for(let n in t)t.hasOwnProperty(n)&&t[n].rpcMap&&(t[n].rpcMap&&(e[n].rpcMap||(e[n].rpcMap={}),i(e[n].rpcMap,t[n].rpcMap)),t[n].defaultChain&&void 0===e[n].defaultChain&&e[n].chains.some(e=>e.split(":")[1]===t[n].defaultChain)&&(e[n].defaultChain=t[n].defaultChain))};for(let r in t&&a(e.namespaces,t),n&&a(e.namespaces,n),e.namespaces){let t=e.namespaces[r];(null==t?void 0:t.accounts)&&0!==t.accounts.length||delete e.namespaces[r]}e.namespaces[r.NameSpaceKeyBtc]&&e.wallet.appName===r.OKXWalletName&&function(e){try{if(e&&e.extra){var t=e.extra;Object.keys(t).forEach(e=>{let n=t[e];6===Number(n.addressType)?n.publicKey=n.compressedPublicKey.slice(2):n.publicKey=n.compressedPublicKey})}}catch(e){(0,r.logDebug)("namespaces fixMobileBtcSession error")}}(e.namespaces[r.NameSpaceKeyBtc]),e.sessionConfig=o},t.isCaipNamespace=o,t.parseNamespaceKey=function(e){return o(e)?e.split(":")[0]:e};let r=n(98134);function o(e){return e.includes(":")}},59997:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PROVIDER_EVENTS=void 0,t.PROVIDER_EVENTS={DEFAULT_CHAIN_CHANGED:"default_chain_changed",UPDATE_NAMESPACES:"update_name_spaces",SESSION_CONNECTING:"session_connecting"}},52419:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(98443),t),o(n(59997),t)},98443:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GENERIC_SUBPROVIDER_NAME=t.RPC_URL=t.STORAGE=t.CONTEXT=t.WC_VERSION=t.PROTOCOL=t.RELAY_URL=t.LOGGER=void 0,t.LOGGER="error",t.RELAY_URL="wss://relay.walletconnect.com",t.PROTOCOL="wc",t.WC_VERSION=2,t.CONTEXT="universal_provider",t.STORAGE=`${t.PROTOCOL}@${t.WC_VERSION}:${t.CONTEXT}:`,t.RPC_URL="https://rpc.walletconnect.com/v1/",t.GENERIC_SUBPROVIDER_NAME="generic"},11788:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(5893),t),o(n(2042),t)},43995:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};
9Object.defineProperty(t,"__esModule",{value:!0});let o=n(52419),i=n(98134),a=n(2042),s=n(29663),c=n(22782);class l{constructor(e,t,n,r){this.name="aptos",this.namespace=e.namespace,this.events=r,this.client=n,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders(),this.name=t}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return r(this,void 0,void 0,function*(){if((0,i.logDebug)("aptos request --args--string>",(0,i.safeJsonStringify)(e)),(0,i.logDebug)("aptos provider namespace: ",this.namespace),this.namespace.methods.includes(e.method))return this.client.request(e);throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,"Please upgrade OKX APP")})}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(o.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{let n=(0,a.getChainId)(t),r=(0,a.getRpcUrl)(t,this.namespace),o=this.createHttpProvider(n,r);o&&(e[n]=o)}),e}getHttpProvider(){let e=`${this.chainId}`,t=this.httpProviders[e];if(void 0===t)throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){if(t)return new c.JsonRpcProvider(new s.JsonRpcConnection(t,(0,a.getGlobal)("disableProviderPing")))}showRequestModal(e){return!0}}t.default=l},74263:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});let o=n(52419),i=n(98134),a=n(2042),s=n(29663),c=n(22782);class l{constructor(e,t,n,r){this.name=i.NameSpaceKeyBtc,this.namespace=e.namespace,this.events=r,this.client=n,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders(),this.name=t}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return r(this,void 0,void 0,function*(){return((0,i.logDebug)("btc request --args--string>",JSON.stringify(e)),(0,i.logDebug)("btc provider namespace: ",JSON.stringify(this.namespace)),this.namespace.methods.includes(e.method))?this.client.request(e):this.getHttpProvider().request(e)})}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(o.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{let n=(0,a.getChainId)(t),r=(0,a.getRpcUrl)(t,this.namespace),o=this.createHttpProvider(n,r);o&&(e[n]=o)}),e}getHttpProvider(){let e=`${this.chainId}`,t=this.httpProviders[e];if(void 0===t)throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){if(t)return new c.JsonRpcProvider(new s.JsonRpcConnection(t,(0,a.getGlobal)("disableProviderPing")));(0,i.logError)(`No RPC url provided for chainId: ${e}`)}showRequestModal(e){return!0}}t.default=l},74454:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
9ise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});let o=n(52419),i=n(98134),a=n(2042),s=n(29663),c=n(22782);class l{constructor(e,t,n){this.name=i.NameSpaceKeyCosmos,this.namespace=e.namespace,this.events=n,this.client=t,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return r(this,void 0,void 0,function*(){if((0,i.logDebug)("cosmos request --args--string>",JSON.stringify(e)),(0,i.logDebug)("cosmos provider namespace: ",JSON.stringify(this.namespace)),this.namespace.methods.includes(e.method))return this.client.request(e);throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,"Please upgrade OKX APP")})}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(o.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{let n=(0,a.getChainId)(t),r=(0,a.getRpcUrl)(t,this.namespace),o=this.createHttpProvider(n,r);o&&(e[n]=o)}),e}getHttpProvider(){let e=`${this.chainId}`,t=this.httpProviders[e];if(void 0===t)throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){if(t)return new c.JsonRpcProvider(new s.JsonRpcConnection(t,(0,a.getGlobal)("disableProviderPing")))}showRequestModal(e){return!0}}t.default=l},33876:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Eip155Provider=void 0;let o=n(2042),i=n(52419),a=n(98134),s=n(22782),c=n(29663);class l{constructor(e,t,n){this.name="eip155",this.namespace=e.namespace,this.events=n,this.client=t,this.chainId=parseInt(this.getDefaultChain()),this.httpProviders=this.createHttpProviders(),(0,a.logDebug)("eip155 constructor --opts.namespace-->",e.namespace)}isRecord(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}isArray(e){return"object"==typeof e&&null!==e&&Array.isArray(e)}
9updateRequestParams(e){let t=e.params&&"object"==typeof e.params&&!Array.isArray(e.params);if("wallet_switchEthereumChain"===e.method){let n=e.chainId.split(":")[1],r=parseInt(n,10);if(isNaN(r))throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Invalid decimal number, chainId: '${n}' `);if(e.params){if(t){let t=e.params;"chainId"in t||(t.chainId="0x"+r.toString(16),e.params=t)}else throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Request params error , method: '${e.method}' `)}else e.params={chainId:"0x"+r.toString(16)}}else if("personal_sign"===e.method||"eth_signTypedData_v4"===e.method||"eth_sendTransaction"===e.method||"wallet_watchAsset"===e.method){if(!e.params)throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Request params is nil, method: '${e.method}'`);if(this.isRecord(e.params)){let t=e.params;if((0,a.logDebug)("eip155 updateRequestParams params>",JSON.stringify(t)),"chainId"in t){let n;let r=parseInt(e.chainId.split(":")[1],10),o=String(t.chainId);if(o.startsWith(this.name)&&e.chainId===o)n=r;else if(o.startsWith("0x"))n=parseInt(o,16);else if(isNaN(Number(o)))throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Invalid params.chainId format, method: '${e.method}'`);else n=parseInt(o,10);if(r!==n)throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Request params.chainId not equal chain, method: '${e.method}' `)}}else throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Invalid request params type, method: '${e.method}'`)}}adaptArray(e){if("wallet_switchEthereumChain"===e.method||"wallet_addEthereumChain"===e.method||"wallet_watchAsset"===e.method||"eth_sendTransaction"===e.method){if(this.isArray(e.params)){let t=e.params;if(t){if(1===t.length){let t=e.params[0];this.isRecord(t)&&(e.params=t)}else if(t.length>1)throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params only Support one data, method: '${e.method}' `);else throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params is nil, method: '${e.method}' `)}}}else if("eth_signTypedData_v4"===e.method){if(this.isArray(e.params)){let t=e.params;if(t&&t.length>2)throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params only Support one data, method: '${e.method}' `);if(t&&0===t.length)throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params is nil, method: '${e.method}' `);let n={};if(t&&2===t.length){let t=e.params[0];if(t&&"string"==typeof t){let r=!1;if(this.namespace.accounts.forEach(e=>{(0,o.fromAccountToAddress)(e).toLowerCase()===t.toLowerCase()&&(r=!0)}),(0,a.logDebug)("eip155 adaptArray eth_signTypedData_v4 >>>isEqual: ",r),!r)throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params address error, not equal, method: '${e.method}' `);if(this.isRecord(e.params[1]))n=e.params[1];else throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params message data error, method: '${e.method}' `)}else throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params address error , not string, method: '${e.method}' `)}else if(t&&1===t.length){if(this.isRecord(e.params[0]))n=e.params[0];else throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params message data error, method: '${e.method}' `)}try{let t=JSON.stringify(n);e.params={typedDataJson:t}}catch(t){throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params call JSON.stringify() failed, method: '${e.method}' `)}}}else if("personal_sign"===e.method&&this.isArray(e.params)){if(e.params&&e.params.length>2)throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params error, method: '${e.method}' `);if(e.params&&0===e.params.length)throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params is nil, method: '${e.method}' `);let t=e.params[0],n=e.params[1];if(n&&"string"==typeof n){let t=!1;
9if(this.namespace.accounts.forEach(e=>{(0,o.fromAccountToAddress)(e).toLowerCase()===n.toLowerCase()&&(t=!0)}),(0,a.logDebug)("eip155 adaptArray personal_sign >>>isEqual: ",t),!t)throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params address error, method: '${e.method}' `)}if(t&&"string"==typeof t)e.params={message:t};else throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params is error, method: '${e.method}' `)}}showRequestModal(e){switch(e.method){case"eth_requestAccounts":case"eth_accounts":case"eth_chainId":break;case"eth_sendTransaction":case"eth_signTransaction":case"eth_sign":case"personal_sign":case"eth_signTypedData":case"wallet_addEthereumChain":case"wallet_watchAsset":case"eth_signTypedData_v4":return!0;case"wallet_switchEthereumChain":{this.adaptArray(e),this.updateRequestParams(e);let{parsedChainId:t,hexChainId:n}=this.getHexChainIdFromRequest(e);return!this.isChainApproved(t)}}return!1}configAddressAdaptInjectWallet(e){this.namespace.accounts.forEach(t=>{t.includes(e.chainId)&&(e.address=(0,o.fromAccountToAddress)(t))})}request(e){return r(this,void 0,void 0,function*(){switch(this.adaptArray(e),(0,a.logDebug)("eip155 request --args--string>
9",JSON.stringify(e)),this.updateRequestParams(e),(0,a.logDebug)("eip155 request --params--string>",JSON.stringify(e)),this.configAddressAdaptInjectWallet(e),e.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_switchEthereumChain":return yield this.handleSwitchChain(e);case"wallet_addEthereumChain":return this.addEthereumChain(e)}if(!this.namespace.methods.includes(e.method))return(0,a.logDebug)("[RPC] request begin"),yield this.getHttpProvider().request(e);try{let t=yield this.client.request(e);if((0,a.logDebug)("eip155 request --response----string>",JSON.stringify(t)),this.isRecord(t)&&"result"in t){let e=t.result;if(e&&"string"==typeof e&&("true"===e||"false"===e))return(0,a.logDebug)("eip155 request --wallet_watchAsset>>>>","true"===e),"true"===e;return t.result}return t}catch(e){throw(0,a.logDebug)(`eip155 request --response --error--string> e instanceof OKXConnectError ${e instanceof a.OKXConnectError}`,JSON.stringify(e)),e}})}addEthereumChain(e){return r(this,void 0,void 0,function*(){let t=yield this.client.request(e);try{if("result"in t){let n=t.result;if(n){let t=n.split(":")[0],r=n.split(":")[1];if(this.namespace,this.namespace.accounts.push(n),this.namespace.chains.push(t+":"+r),this.isRecord(e.params)&&"rpcUrls"in e.params){let t=e.params.rpcUrls,n=t?t[0]:void 0;n&&(this.namespace.rpcMap?this.namespace.rpcMap[r]=n:this.namespace.rpcMap={[r]:n},this.setHttpProvider(r,n))}this.events.emit(i.PROVIDER_EVENTS.UPDATE_NAMESPACES,{eip155:this.namespace})}}else new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`the method ${e.method} request error`)}catch(t){throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`the method ${e.method} request error`)}return null})}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){if(this.chainId=parseInt(e),!this.httpProviders[e]){let n=t||(0,o.getRpcUrl)(`${this.name}:${e}`,this.namespace);n?this.setHttpProvider(e,n):(0,a.logError)(`No RPC url provided for chainId: ${e}`)}this.events.emit(i.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return((0,a.logDebug)("eip155 getAccounts ",e,this.chainId),e)?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>(0,o.fromAccountToAddress)(e)))]:[]}getHexChainIdFromRequest(e){let t=e.params,n="0x0";t&&"chainId"in t&&(n=t.chainId),n=n.startsWith("0x")?n:`0x${n}`,(0,a.logDebug)("handleSwitchChain -->args ",e),(0,a.logDebug)("handleSwitchChain -->hexChainId ",n);let r=parseInt(n,16);return(0,a.logDebug)("handleSwitchChain -->parsedChainId ",r),{parsedChainId:r,hexChainId:n}}handleSwitchChain(e){return r(this,void 0,void 0,function*(){let{parsedChainId:t,hexChainId:n}=this.getHexChainIdFromRequest(e);if(this.isChainApproved(t))this.setDefaultChain(`${t}`);else throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED,`the method ${e.method} request error`)})}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}createHttpProvider(e,t){if(t)return new s.JsonRpcProvider(new c.JsonRpcConnection(t,(0,o.getGlobal)("disableProviderPing")));(0,a.logError)(`No RPC url provided for chainId: ${e}`)}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{let n=(0,o.getChainId)(t),r=(0,o.getRpcUrl)(t,this.namespace);(0,a.logDebug)("get parsed chain and rpc:",n,r);let i=this.createHttpProvider(n,r);i&&(e[n]=i)}),(0,a.logDebug)("get http providermap:",e),e}setHttpProvider(e,t){let n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}getHttpProvider(){let e=`${this.chainId}`,t=this.httpProviders[e];if((0,a.logDebug)("[RPC] get http provider:",e,t),void 0===t)throw Error(`JSON-RPC provider for ${e} not found`);return t}}
9t.Eip155Provider=l,t.default=l},29663:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcConnection=void 0;let i=n(26729),a=o(n(29987)),s=n(98134),c=n(98134),l={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class u{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new i.EventEmitter,this.isAvailable=!1,this.registering=!1,!(0,c.isHttpUrl)(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}open(){return r(this,arguments,void 0,function*(e=this.url){yield this.register(e)})}close(){return r(this,void 0,void 0,function*(){if(!this.isAvailable)throw Error("Connection already closed");this.onClose()})}send(e){return r(this,void 0,void 0,function*(){this.isAvailable||(yield this.register());try{let t=(0,s.safeJsonStringify)(e),n=yield(0,a.default)(this.url,Object.assign(Object.assign({},l),{body:t})),r=yield n.json();this.onPayload({data:r})}catch(t){this.onError(e.id,t)}})}register(){return r(this,arguments,void 0,function*(e=this.url){if(!(0,c.isHttpUrl)(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering)return new Promise((e,t)=>{this.events.once("register_error",e=>{t(e)}),this.events.once("open",()=>{if(void 0===this.isAvailable)return t(Error("HTTP connection is missing or invalid"));e()})});this.url=e,this.registering=!0;try{if(!this.disableProviderPing){let t=(0,s.safeJsonStringify)({id:1,jsonrpc:"2.0",method:"test",params:[]});yield(0,a.default)(e,Object.assign(Object.assign({},l),{body:t}))}this.onOpen()}catch(t){let e=this.parseError(t);throw this.events.emit("register_error",e),this.onClose(),e}})}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(void 0===e.data)return;let t="string"==typeof e.data?(0,s.safeJsonParse)(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let n=this.parseError(t),r=n.message||n.toString(),o=(0,c.formatJsonRpcError)(e,r);this.events.emit("payload",o)}parseError(e,t=this.url){return(0,c.parseConnectionError)(e,t,"HTTP")}}t.JsonRpcConnection=u},22782:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcProvider=void 0;let o=n(26729),i=n(5893),a=n(98134),s=n(98134);class c extends i.IJSONRpcProvider{constructor(e){super(e),this.events=new o.EventEmitter,this.connected=!1,this.connecting=!1,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}connect(){return r(this,arguments,void 0,function*(e=this.connection){yield this.open(e)})}disconnect(){return r(this,void 0,void 0,function*(){yield this.close()})}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}request(e,t){return r(this,void 0,void 0,function*(){return this.requestStrict((0,a.formatJsonRpcRequest)(e.method,e.params||[],(0,a.getBigIntRpcId)().toString()),t)})}requestStrict(e,t){return r(this,void 0,void 0,function*(){return new Promise((n,o)=>r(this,void 0,void 0,function*(){if(!this.connection.connected)try{yield this.open()}catch(e){o(e)}this.events.on(`${e.id}`,e=>{(0,a.isJsonRpcError)(e)?o(e.error):n(e.result)});try{(0,s.logDebug)("[RPC] >>> send request",e,t),yield this.connection.send(e,t)}catch(e){o(e)}}))})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),(0,a.isJsonRpcResponse)(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}open(){return r(this,arguments,void 0,function*(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(yield this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),yield this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))})}close(){return r(this,void 0,void 0,function*(){yield this.connection.close()})}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}t.JsonRpcProvider=c},97911:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
9ise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SolanaProvider=void 0;let o=n(52419),i=n(98134),a=n(2042),s=n(29663),c=n(22782);class l{constructor(e,t,n,r){this.name="solana",this.namespace=e.namespace,this.events=r,this.client=n,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders(),this.name=t}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return r(this,void 0,void 0,function*(){if((0,i.logDebug)("solana request --args--string>",JSON.stringify(e)),(0,i.logDebug)("solana provider namespace: ",this.namespace),this.namespace.methods.includes(e.method))return this.client.request(e);throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,"Please upgrade OKX APP")})}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(o.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{let n=(0,a.getChainId)(t),r=(0,a.getRpcUrl)(t,this.namespace),o=this.createHttpProvider(n,r);o&&(e[n]=o)}),e}getHttpProvider(){let e=`${this.chainId}`,t=this.httpProviders[e];if(void 0===t)throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){if(t)return new c.JsonRpcProvider(new s.JsonRpcConnection(t,(0,a.getGlobal)("disableProviderPing")))}getPubkey(e){return this.getWalletAddress(e)}getWalletAddress(e){return e||(null==(e=this.namespace.defaultChain)?void 0:e.startsWith("solana"))||(e=`solana:${e}`),this.namespace.accounts.filter(function(t){return t.split(":").length>2&&t.startsWith(e)}).map(function(e){return e.split(":")[2]})[0]}showRequestModal(e){return!0}}t.SolanaProvider=l,t.default=l},61318:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});let o=n(52419),i=n(98134),a=n(2042),s=n(29663),c=n(22782);class l{constructor(e,t,n,r){this.name="starknet",this.namespace=e.namespace,this.events=r,this.client=n,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders(),this.name=t}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return r(this,void 0,void 0,function*(){if((0,i.logDebug)("starknet request --args--string>",JSON.stringify(e)),(0,i.logDebug)("starknet provider namespace: ",this.namespace),this.namespace.methods.includes(e.method))return this.client.request(e);throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,"Wallet doesn't support"+e.method)})}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(o.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{let n=(0,a.getChainId)(t),r=(0,a.getRpcUrl)(t,this.namespace),o=this.createHttpProvider(n,r);o&&(e[n]=o)}),e}getHttpProvider(){let e=`${this.chainId}`,t=this.httpProviders[e];if(void 0===t)throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){if(t)return new c.JsonRpcProvider(new s.JsonRpcConnection(t,(0,a.getGlobal)("disableProviderPing")))}showRequestModal(e){return!0}}t.default=l},6702:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
9ise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SuiProvider=void 0;let o=n(52419),i=n(98134),a=n(2042),s=n(29663),c=n(22782);class l{constructor(e,t,n){this.name=i.NameSpaceKeySui,this.namespace=e.namespace,this.events=n,this.client=t,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}request(e){return r(this,void 0,void 0,function*(){return((0,i.logDebug)("sui request --args--string>",JSON.stringify(e)),(0,i.logDebug)("sui provider namespace: ",this.namespace),this.namespace.methods.includes(e.method))?this.client.request(e):this.getHttpProvider().request(e)})}requestAccounts(){return this.getAccounts()}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(o.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{let n=(0,a.getChainId)(t),r=(0,a.getRpcUrl)(t,this.namespace),o=this.createHttpProvider(n,r);o&&(e[n]=o)}),e}getHttpProvider(){let e=`${this.chainId}`,t=this.httpProviders[e];if((0,i.logDebug)("[RPC] get http provider:",e,t),void 0===t)throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let n=this.createHttpProvider(e,t);n&&((0,i.logDebug)("setHttpProvider",e,t),this.httpProviders[e]=n)}createHttpProvider(e,t){if(t)return new c.JsonRpcProvider(new s.JsonRpcConnection(t,(0,a.getGlobal)("disableProviderPing")));(0,i.logError)(`No RPC url provided for chainId: ${e}`)}getPubkey(e){return this.getWalletAddress(e)}getWalletAddress(e){return e||(null==(e=this.namespace.defaultChain)?void 0:e.startsWith("sui"))||(e=`sui:${e}`),this.namespace.accounts.filter(function(t){return t.split(":").length>2&&t.startsWith(e)}).map(function(e){return e.split(":")[2]})[0]}showRequestModal(e){switch(e.method){case"sui_signMessage":case"sui_signPersonalMessage":case"sui_signTransactionBlock":case"sui_signAndExecuteTransactionBlock":return!0}return!1}}t.SuiProvider=l,t.default=l},96945:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};Object.defineProperty(t,"__esModule",{value:!0});let i=n(52419),a=n(98134),s=n(2042),c=n(29663),l=n(22782);class u{constructor(e,t,n){this.name=a.NameSpaceKeyTON,this.namespace=e.namespace,this.events=n,this.client=t,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}isRecord(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}request(e){return r(this,void 0,void 0,function*(){var t,n,r,i;if((0,a.logDebug)("TONProvider request --args--string>",JSON.stringify(e)),(0,a.logDebug)("TONProvider request provider namespace: ",this.namespace),this.namespace.methods.includes(e.method)){if(!e.params)throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"ton request params is nil");if(this.isRecord(e.params)){let s=e.params,{validUntil:c}=s,l=o(s,["validUntil"]),u=null===(n=null===(t=this.namespace.payload)||void 0===t?void 0:t.ton_addr)||void 0===n?void 0:n.address;"from"in l&&(u=l.from||(null===(i=null===(r=this.namespace.payload)||void 0===r?void 0:r.ton_addr)||void 0===i?void 0:i.address)),e.params.from=u,e.params.network=this.getDefaultChain(),e.params.valid_until=c;let d=yield this.client.request(e);
9if(this.isRecord(d)&&"result"in d){let e={boc:d.result.toString()};return(0,a.logDebug)("TONProvider request provider response: ",JSON.stringify(d)),(0,a.logDebug)("TONProvider request provider result: ",JSON.stringify(e)),e}throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"ton_send request response is nil")}throw new a.OKXConnectError(a.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"ton request params type add nil")}return this.getHttpProvider().request(e)})}requestAccounts(){return this.getAccounts()}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(i.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){var e,t;let n=this.namespace.accounts;if((0,a.logDebug)("ton getAccounts accounts :",n),(0,a.logDebug)("ton getAccounts .namespace :",JSON.stringify(this.namespace)),!n)return[];let r=null===(t=null===(e=this.namespace.payload)||void 0===e?void 0:e.ton_addr)||void 0===t?void 0:t.address;return((0,a.logDebug)("ton getAccounts address :",r),r)?[r]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{let n=(0,s.getChainId)(t),r=(0,s.getRpcUrl)(t,this.namespace),o=this.createHttpProvider(n,r);o&&(e[n]=o)}),e}getHttpProvider(){let e=`${this.chainId}`,t=this.httpProviders[e];if((0,a.logDebug)("[RPC] get http provider:",e,t),void 0===t)throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let n=this.createHttpProvider(e,t);n&&((0,a.logDebug)("setHttpProvider",e,t),this.httpProviders[e]=n)}createHttpProvider(e,t){if(t)return new l.JsonRpcProvider(new c.JsonRpcConnection(t,(0,s.getGlobal)("disableProviderPing")));(0,a.logError)(`No RPC url provided for chainId: ${e}`)}showRequestModal(e){return"ton_sendTransaction"===e.method}}t.default=u},76988:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});let o=n(52419),i=n(98134),a=n(2042),s=n(29663),c=n(22782);class l{constructor(e,t,n){this.name=i.NameSpaceKeyTron,this.namespace=e.namespace,this.events=n,this.client=t,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return r(this,void 0,void 0,function*(){if((0,i.logDebug)("tron request --args--string>",JSON.stringify(e)),(0,i.logDebug)("tron provider namespace: ",JSON.stringify(this.namespace)),this.namespace.methods.includes(e.method))return this.client.request(e);throw new i.OKXConnectError(i.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,"Please upgrade OKX APP")})}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(o.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{let n=(0,a.getChainId)(t),r=(0,a.getRpcUrl)(t,this.namespace),o=this.createHttpProvider(n,r);o&&(e[n]=o)}),e}getHttpProvider(){let e=`${this.chainId}`,t=this.httpProviders[e];if(void 0===t)throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){if(t)return new c.JsonRpcProvider(new s.JsonRpcConnection(t,(0,a.getGlobal)("disableProviderPing")))}showRequestModal(e){return!0}}t.default=l},5893:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);
9(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(55166),t),o(n(39558),t)},39558:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},55166:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IJSONRpcProvider=t.IJSONRpcConnection=void 0;class n{}t.IJSONRpcConnection=n;class r{constructor(e){}}t.IJSONRpcProvider=r},17236:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setGlobal=t.getGlobal=void 0;let n={};t.getGlobal=e=>n[e],t.setGlobal=(e,t)=>{n[e]=t}},2042:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(85451),t),o(n(17236),t)},85451:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRpcUrl=function(e,t,n){var r;let i=o(e);return(null===(r=t.rpcMap)||void 0===r?void 0:r[i.reference])||""},t.getChainId=function(e){return e.includes(":")?e.split(":")[1]:e},t.fromAccountToAddress=function(e){if(!e)return"";try{let t=e.split(":").slice(2),n=t.length>0?t.join(":"):"";return(0,r.logDebug)("fromAccountToAddress address and account:",n,e),n}catch(t){return(0,r.logError)("fromAccountToAddress error:",e),""}},t.convertChainIdToNumber=function(e){return"number"==typeof e?e:e.includes("0x")?parseInt(e,16):isNaN(Number(e=e.includes(":")?e.split(":")[1]:e))?e:Number(e)},t.parseChainId=o,t.mergeArrays=function(e=[],t=[]){return[...new Set([...e,...t])]},t.syncAddressAvailable=function(e){return!(!e||"OKX Wallet"!==e.appName||(0,r.versionCompare)("6.97.0",e.appVersion)>0)&&i()},t.syncAddressHostAvailable=i;let r=n(98134);function o(e){let[t,n]=e.split(":");return{namespace:t,reference:n}}function i(){try{return!!window.okxGlobal}catch(e){return!1}}},98099:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(97117);function o(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>8,t[n+1]=e>>>0,t}function i(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t}function a(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function s(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function c(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function l(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function u(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>24,t[n+1]=e>>>16,t[n+2]=e>>>8,t[n+3]=e>>>0,t}function d(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24,t}function h(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),u(e/4294967296>>>0,t,n),u(e>>>0,t,n+4),t}function f(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),d(e>>>0,t,n),d(e/4294967296>>>0,t,n+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=o,t.writeInt16BE=o,t.writeUint16LE=i,t.writeInt16LE=i,t.readInt32BE=a,t.readUint32BE=s,t.readInt32LE=c,t.readUint32LE=l,t.writeUint32BE=u,t.writeInt32BE=u,t.writeUint32LE=d,t.writeInt32LE=d,t.readInt64BE=function(e,t){void 0===t&&(t=0);var n=a(e,t),r=a(e,t+4);return 4294967296*n+r-(r>>31)*4294967296},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*s(e,t)+s(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var n=c(e,t);return 4294967296*c(e,t+4)+n-(n>>31)*4294967296},t.readUint64LE=function(e,t){void 0===t&&(t=0);var n=l(e,t);return 4294967296*l(e,t+4)+n},t.writeUint64BE=h,t.writeInt64BE=h,t.writeUint64LE=f,t.writeInt64LE=f,t.readUintBE=function(e,t,n){if(void 0===n&&(n=0),e%8!=0)throw Error("readUintBE supp
9orts only bitLengths divisible by 8");if(e/8>t.length-n)throw Error("readUintBE: array is too short for the given bitLength");for(var r=0,o=1,i=e/8+n-1;i>=n;i--)r+=t[i]*o,o*=256;return r},t.readUintLE=function(e,t,n){if(void 0===n&&(n=0),e%8!=0)throw Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-n)throw Error("readUintLE: array is too short for the given bitLength");for(var r=0,o=1,i=n;i<n+e/8;i++)r+=t[i]*o,o*=256;return r},t.writeUintBE=function(e,t,n,o){if(void 0===n&&(n=new Uint8Array(e/8)),void 0===o&&(o=0),e%8!=0)throw Error("writeUintBE supports only bitLengths divisible by 8");if(!r.isSafeInteger(t))throw Error("writeUintBE value must be an integer");for(var i=1,a=e/8+o-1;a>=o;a--)n[a]=t/i&255,i*=256;return n},t.writeUintLE=function(e,t,n,o){if(void 0===n&&(n=new Uint8Array(e/8)),void 0===o&&(o=0),e%8!=0)throw Error("writeUintLE supports only bitLengths divisible by 8");if(!r.isSafeInteger(t))throw Error("writeUintLE value must be an integer");for(var i=1,a=o;a<o+e/8;a++)n[a]=t/i&255,i*=256;return n},t.readFloat32BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t)},t.readFloat32LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t,!0)},t.readFloat64BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t)},t.readFloat64LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t,!0)},t.writeFloat32BE=function(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(n,e),t},t.writeFloat32LE=function(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(n,e,!0),t},t.writeFloat64BE=function(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(n,e),t},t.writeFloat64LE=function(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(n,e,!0),t}},31050:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;let r=n(31416),o=n(93350),i=n(17309);function a(e){let t=new Float64Array(16);if(e)for(let n=0;n<e.length;n++)t[n]=e[n];return t}t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32,new Uint8Array(32)[0]=9;let s=a(),c=a([1]),l=a([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=a([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=a([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),h=a([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),f=a([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function g(e,t){for(let n=0;n<16;n++)e[n]=0|t[n]}function p(e){let t=1;for(let n=0;n<16;n++){let r=e[n]+t+65535;t=Math.floor(r/65536),e[n]=r-65536*t}e[0]+=t-1+37*(t-1)}function v(e,t,n){let r=~(n-1);for(let n=0;n<16;n++){let o=r&(e[n]^t[n]);e[n]^=o,t[n]^=o}}function m(e,t){let n=a(),r=a();for(let e=0;e<16;e++)r[e]=t[e];p(r),p(r),p(r);for(let e=0;e<2;e++){n[0]=r[0]-65517;for(let e=1;e<15;e++)n[e]=r[e]-65535-(n[e-1]>>16&1),n[e-1]&=65535;n[15]=r[15]-32767-(n[14]>>16&1);let e=n[15]>>16&1;n[14]&=65535,v(r,n,1-e)}for(let t=0;t<16;t++)e[2*t]=255&r[t],e[2*t+1]=r[t]>>8}function y(e,t){let n=0;for(let r=0;r<32;r++)n|=e[r]^t[r];return(1&n-1>>>8)-1}function C(e,t){let n=new Uint8Array(32),r=new Uint8Array(32);return m(n,e),m(r,t),y(n,r)}function O(e){let t=new Uint8Array(32);return m(t,e),1&t[0]}function b(e,t,n){for(let r=0;r<16;r++)e[r]=t[r]+n[r]}function w(e,t,n){for(let r=0;r<16;r++)e[r]=t[r]-n[r]}function _(e,t,n){let r,o,i=0,a=0,s=0,c=0,l=0,u=0,d=0,h=0,f=0,g=0,p=0,v=0,m=0,y=0,C=0,O=0,b=0,w=0,_=0,E=0,R=0,N=0,S=0,T=0,A=0,D=0,P=0,I=0,K=0,k=0,x=0,M=n[0],L=n[1],U=n[2],W=n[3],X=n[4],j=n[5],B=n[6],H=n[7],J=n[8],q=n[9],F=n[10],$=n[11],V=n[12],G=n[13],z=n[14],Q=n[15];i+=(r=t[0])*M,a+=r*L,s+=r*U,c+=r*W,l+=r*X,u+=r*j,d+=r*B,h+=r*H,f+=r*J,g+=r*q,p+=r*F,v+=r*$,m+=r*V,y+=r*G,C+=r*z,O+=r*Q,a+=(r=t[1])*M,s+=r*L,c+=r*U,l+=r*W,u+=r*X,d+=r*j,h+=r*B,f+=r*H,g+=r*J,p+=r*q,v+=r*F,m+=r*$,y+=r*V,C+=r*G,O+=r*z,b+=r*Q,s+=(r=t[2])*M,c+=r*L,l+=r*U,u+=r*W,d+=r*X,h+=r*j,f+=r*B,g+=r*H,p+=r*J,v+=r*q,m+=r*F,y+=r*$,C+=r*V,O+=r*G,b+=r*z,w+=r*Q,c+=(r=t[3])*M,l+=r*L,u+=r*U,d+=r*W,h+=r*X,f+=r*j,g+=r*B,p+=r*H,v+=r*J,m+=r*q,y+=r*F,C+=r*$,O+=r*V,b+=r*G,w+=r*z,_+=r*Q,l+=(r=t[4])*M,u+=r*L,d+=r*U,h+=r*W,f+=r*X,g+=r*j,p+=r*B,v+=r*H,m+=r*J,y+=r*q,C+=r*F,O+=r*$,b+=r*V,w+=r*G,_+=r*z,E+=r*Q,u+=(r=t[5])*M,d+=r*L,h+=r*U,f+=r*W,g+=r*X,p+=r*j,v+=r*B,m+=r*H,y+=r*J,C+=r*q,O+=r*F,b+=r*$,w+=r*V,_+=r*G,E+=r*z,R+=r*Q,d+=(r=t[6])*M,h+=r*L,f+=r*U,g+=r*W,p+=r*X,v+=r*j,m+=r*B,y+=r*H,C+=r*J,O+=r*q,b+=r*F,w+=r*$,_+=r*V,E+=r*G,R+=r*z,N+=r*Q,h+=(r=t[7])*M,f+=r*L,g+=r*U,p+=r*W,v+=r*X,m+=r*j,y+=r*B,C+=r*H,O+=r*J,b+=r*q,w+=r*F,_+=r*$,E+=r*V,R+=r*G,N+=r*z,S+=r*Q,f+=(r=t[8])*M,g+=r*L,p+=r*U,v+=r*W,m+=r*X,y+=r*j,C+=r*B,O+=r*H,b+=r*J,w+=r*q,_+=r*F,E+=r*$,R+=r*V,N+=r*G,S+=r*z,T+=r*Q,g+=(r=t[9])*M,p+=r*L,v+=r*U,m+=r*W,y+=r*X,C+=r*j,O+=r*B,b+=r*H,w+=r*J,_+=r*q,E+=r*F,R+=r*$,N+=r*V,S+=r*G,T+=r*z,A+=r*Q,p+=(r=t[10])*M,v+=r*L,m
9+=r*U,y+=r*W,C+=r*X,O+=r*j,b+=r*B,w+=r*H,_+=r*J,E+=r*q,R+=r*F,N+=r*$,S+=r*V,T+=r*G,A+=r*z,D+=r*Q,v+=(r=t[11])*M,m+=r*L,y+=r*U,C+=r*W,O+=r*X,b+=r*j,w+=r*B,_+=r*H,E+=r*J,R+=r*q,N+=r*F,S+=r*$,T+=r*V,A+=r*G,D+=r*z,P+=r*Q,m+=(r=t[12])*M,y+=r*L,C+=r*U,O+=r*W,b+=r*X,w+=r*j,_+=r*B,E+=r*H,R+=r*J,N+=r*q,S+=r*F,T+=r*$,A+=r*V,D+=r*G,P+=r*z,I+=r*Q,y+=(r=t[13])*M,C+=r*L,O+=r*U,b+=r*W,w+=r*X,_+=r*j,E+=r*B,R+=r*H,N+=r*J,S+=r*q,T+=r*F,A+=r*$,D+=r*V,P+=r*G,I+=r*z,K+=r*Q,C+=(r=t[14])*M,O+=r*L,b+=r*U,w+=r*W,_+=r*X,E+=r*j,R+=r*B,N+=r*H,S+=r*J,T+=r*q,A+=r*F,D+=r*$,P+=r*V,I+=r*G,K+=r*z,k+=r*Q,O+=(r=t[15])*M,b+=r*L,w+=r*U,_+=r*W,E+=r*X,R+=r*j,N+=r*B,S+=r*H,T+=r*J,A+=r*q,D+=r*F,P+=r*$,I+=r*V,K+=r*G,k+=r*z,x+=r*Q,i+=38*b,a+=38*w,s+=38*_,c+=38*E,l+=38*R,u+=38*N,d+=38*S,h+=38*T,f+=38*A,g+=38*D,p+=38*P,v+=38*I,m+=38*K,y+=38*k,C+=38*x,o=Math.floor((r=i+(o=1)+65535)/65536),i=r-65536*o,o=Math.floor((r=a+o+65535)/65536),a=r-65536*o,o=Math.floor((r=s+o+65535)/65536),s=r-65536*o,o=Math.floor((r=c+o+65535)/65536),c=r-65536*o,o=Math.floor((r=l+o+65535)/65536),l=r-65536*o,o=Math.floor((r=u+o+65535)/65536),u=r-65536*o,o=Math.floor((r=d+o+65535)/65536),d=r-65536*o,o=Math.floor((r=h+o+65535)/65536),h=r-65536*o,o=Math.floor((r=f+o+65535)/65536),f=r-65536*o,o=Math.floor((r=g+o+65535)/65536),g=r-65536*o,o=Math.floor((r=p+o+65535)/65536),p=r-65536*o,o=Math.floor((r=v+o+65535)/65536),v=r-65536*o,o=Math.floor((r=m+o+65535)/65536),m=r-65536*o,o=Math.floor((r=y+o+65535)/65536),y=r-65536*o,o=Math.floor((r=C+o+65535)/65536),C=r-65536*o,o=Math.floor((r=O+o+65535)/65536),O=r-65536*o,i+=o-1+37*(o-1),o=Math.floor((r=i+(o=1)+65535)/65536),i=r-65536*o,o=Math.floor((r=a+o+65535)/65536),a=r-65536*o,o=Math.floor((r=s+o+65535)/65536),s=r-65536*o,o=Math.floor((r=c+o+65535)/65536),c=r-65536*o,o=Math.floor((r=l+o+65535)/65536),l=r-65536*o,o=Math.floor((r=u+o+65535)/65536),u=r-65536*o,o=Math.floor((r=d+o+65535)/65536),d=r-65536*o,o=Math.floor((r=h+o+65535)/65536),h=r-65536*o,o=Math.floor((r=f+o+65535)/65536),f=r-65536*o,o=Math.floor((r=g+o+65535)/65536),g=r-65536*o,o=Math.floor((r=p+o+65535)/65536),p=r-65536*o,o=Math.floor((r=v+o+65535)/65536),v=r-65536*o,o=Math.floor((r=m+o+65535)/65536),m=r-65536*o,o=Math.floor((r=y+o+65535)/65536),y=r-65536*o,o=Math.floor((r=C+o+65535)/65536),C=r-65536*o,o=Math.floor((r=O+o+65535)/65536),O=r-65536*o,i+=o-1+37*(o-1),e[0]=i,e[1]=a,e[2]=s,e[3]=c,e[4]=l,e[5]=u,e[6]=d,e[7]=h,e[8]=f,e[9]=g,e[10]=p,e[11]=v,e[12]=m,e[13]=y,e[14]=C,e[15]=O}function E(e,t){let n;let r=a();for(n=0;n<16;n++)r[n]=t[n];for(n=253;n>=0;n--)_(r,r,r),2!==n&&4!==n&&_(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}function R(e,t){let n=a(),r=a(),o=a(),i=a(),s=a(),c=a(),l=a(),d=a(),h=a();w(n,e[1],e[0]),w(h,t[1],t[0]),_(n,n,h),b(r,e[0],e[1]),b(h,t[0],t[1]),_(r,r,h),_(o,e[3],t[3]),_(o,o,u),_(i,e[2],t[2]),b(i,i,i),w(s,r,n),w(c,i,o),b(l,i,o),b(d,r,n),_(e[0],s,c),_(e[1],d,l),_(e[2],l,c),_(e[3],s,d)}function N(e,t,n){for(let r=0;r<4;r++)v(e[r],t[r],n)}function S(e,t){let n=a(),r=a(),o=a();E(o,t[2]),_(n,t[0],o),_(r,t[1],o),m(e,r),e[31]^=O(n)<<7}function T(e,t,n){g(e[0],s),g(e[1],c),g(e[2],c),g(e[3],s);for(let r=255;r>=0;--r){let o=n[r/8|0]>>(7&r)&1;N(e,t,o),R(t,e),R(e,e),N(e,t,o)}}function A(e,t){let n=[a(),a(),a(),a()];g(n[0],d),g(n[1],h),g(n[2],c),_(n[3],d,h),T(e,n,t)}function D(e){if(e.length!==t.SEED_LENGTH)throw Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);let n=(0,o.hash)(e);n[0]&=248,n[31]&=127,n[31]|=64;let r=new Uint8Array(32),i=[a(),a(),a(),a()];A(i,n),S(r,i);let s=new Uint8Array(64);return s.set(e),s.set(r,32),{publicKey:r,secretKey:s}}t.generateKeyPairFromSeed=D,t.generateKeyPair=function(e){let t=(0,r.randomBytes)(32,e),n=D(t);return(0,i.wipe)(t),n},t.extractPublicKeyFromSecretKey=function(e){if(e.length!==t.SECRET_KEY_LENGTH)throw Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(e.subarray(32))};let P=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function I(e,t){let n,r,o,i;for(r=63;r>=32;--r){for(n=0,o=r-32,i=r-12;o<i;++o)t[o]+=n-16*t[r]*P[o-(r-32)],n=Math.floor((t[o]+128)/256),t[o]-=256*n;t[o]+=n,t[r]=0}for(o=0,n=0;o<32;o++)t[o]+=n-(t[31]>>4)*P[o],n=t[o]>>8,t[o]&=255;for(o=0;o<32;o++)t[o]-=n*P[o];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=255&t[r]}function K(e){let t=new Float64Array(64);for(let n=0;n<64;n++)t[n]=e[n];for(let t=0;t<64;t++)e[t]=0;I(e,t)}function k(e,t){var n,r,o;let i=a(),u=a(),d=a(),h=a(),p=a(),v=a(),m=a();return(g(e[2],c),!function(e,t){for(let n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}(e[1],t),_(d,n=e[1],n),_(h,d,l),w(d,d,e[2]),b(h,e[2],h),_(p,h,h),_(v,p,p),_(m,v,p),_(i,m,d),_(i,i,h),!function(e,t){let n;let r=a();for(n=0;n<16;n++)r[n]=t[n];for(n=250;n>=0;n--)_(r,r,r),1!==n&&_(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}(i,i),_(i,i,d),_(i,i,h),_(i,i,h),_(e[0],i,h),_(u,r=e[0],r),_(u,u,h),C(u,d)&&_(e[0],e[0],f),_(u,o=e[0],o),_(u,u,h),C(u,d))?-1:(O(e[0])===t[3
91]>>7&&w(e[0],s,e[0]),_(e[3],e[0],e[1]),0)}t.sign=function(e,t){let n=new Float64Array(64),r=[a(),a(),a(),a()],i=(0,o.hash)(e.subarray(0,32));i[0]&=248,i[31]&=127,i[31]|=64;let s=new Uint8Array(64);s.set(i.subarray(32),32);let c=new o.SHA512;c.update(s.subarray(32)),c.update(t);let l=c.digest();c.clean(),K(l),A(r,l),S(s,r),c.reset(),c.update(s.subarray(0,32)),c.update(e.subarray(32)),c.update(t);let u=c.digest();K(u);for(let e=0;e<32;e++)n[e]=l[e];for(let e=0;e<32;e++)for(let t=0;t<32;t++)n[e+t]+=u[e]*i[t];return I(s.subarray(32),n),s},t.verify=function(e,n,r){let i=new Uint8Array(32),s=[a(),a(),a(),a()],c=[a(),a(),a(),a()];if(r.length!==t.SIGNATURE_LENGTH)throw Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(k(c,e))return!1;let l=new o.SHA512;l.update(r.subarray(0,32)),l.update(e),l.update(n);let u=l.digest();return K(u),T(s,c,u),A(c,r.subarray(32)),R(s,c),S(i,s),!y(r,i)},t.convertPublicKeyToX25519=function(e){let t=[a(),a(),a(),a()];if(k(t,e))throw Error("Ed25519: invalid public key");let n=a(),r=a(),o=t[1];b(n,c,o),w(r,c,o),E(r,r),_(n,n,r);let i=new Uint8Array(32);return m(i,n),i},t.convertSecretKeyToX25519=function(e){let t=(0,o.hash)(e.subarray(0,32));t[0]&=248,t[31]&=127,t[31]|=64;let n=new Uint8Array(t.subarray(0,32));return(0,i.wipe)(t),n}},97117:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mul=Math.imul||function(e,t){var n=65535&e,r=65535&t;return n*r+((e>>>16&65535)*r+n*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<<t|e>>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},31416:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;let r=n(46008),o=n(98099),i=n(17309);function a(e,n=t.defaultRandomSource){return n.randomBytes(e)}t.defaultRandomSource=new r.SystemRandomSource,t.randomBytes=a,t.randomUint32=function(e=t.defaultRandomSource){let n=a(4,e),r=(0,o.readUint32LE)(n);return(0,i.wipe)(n),r};let s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function c(e,n=s,r=t.defaultRandomSource){if(n.length<2)throw Error("randomString charset is too short");if(n.length>256)throw Error("randomString charset is too long");let o="",c=n.length,l=256-256%c;for(;e>0;){let t=a(Math.ceil(256*e/l),r);for(let r=0;r<t.length&&e>0;r++){let i=t[r];i<l&&(o+=n.charAt(i%c),e--)}(0,i.wipe)(t)}return o}t.randomString=c,t.randomStringForEntropy=function(e,n=s,r=t.defaultRandomSource){return c(Math.ceil(e/(Math.log(n.length)/Math.LN2)),n,r)}},75455:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserRandomSource=void 0;class n{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&void 0!==e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw Error("Browser random byte generator is not available.");let t=new Uint8Array(e);for(let e=0;e<t.length;e+=65536)this._crypto.getRandomValues(t.subarray(e,e+Math.min(t.length-e,65536)));return t}}t.BrowserRandomSource=n},58871:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRandomSource=void 0;let r=n(17309);class o{constructor(){this.isAvailable=!1,this.isInstantiated=!1;{let e=n(35883);e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw Error("NodeRandomSource: got fewer bytes than requested");let n=new Uint8Array(e);for(let e=0;e<n.length;e++)n[e]=t[e];return(0,r.wipe)(t),n}}t.NodeRandomSource=o},46008:function(e,t,n){"use strict";
9Object.defineProperty(t,"__esModule",{value:!0}),t.SystemRandomSource=void 0;let r=n(75455),o=n(58871);class i{constructor(){if(this.isAvailable=!1,this.name="",this._source=new r.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new o.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw Error("System random byte generator is not available.");return this._source.randomBytes(e)}}t.SystemRandomSource=i},73294:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(98099),o=n(17309);t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var i=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){o.wipe(this._buffer),o.wipe(this._temp),this.reset()},e.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this._finished)throw Error("SHA256: can't update because hash was finished.");var n=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&t>0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=s(this._temp,this._state,e,n,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[n++],t--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,n=this._bufferLength,o=t%64<56?64:128;this._buffer[n]=128;for(var i=n+1;i<o-8;i++)this._buffer[i]=0;r.writeUint32BE(t/536870912|0,this._buffer,o-8),r.writeUint32BE(t<<3,this._buffer,o-4),s(this._temp,this._state,this._buffer,0,o),this._finished=!0}for(var i=0;i<this.digestLength/4;i++)r.writeUint32BE(this._state[i],e,4*i);return this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(this._finished)throw Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){o.wipe(e.state),e.buffer&&o.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA256=i;var a=new Int32Array([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]);function s(e,t,n,o,i){for(;i>=64;){for(var s=t[0],c=t[1],l=t[2],u=t[3],d=t[4],h=t[5],f=t[6],g=t[7],p=0;p<16;p++){var v=o+4*p;e[p]=r.readUint32BE(n,v)}for(var p=16;p<64;p++){var m=e[p-2],y=(m>>>17|m<<15)^(m>>>19|m<<13)^m>>>10,C=((m=e[p-15])>>>7|m<<25)^(m>>>18|m<<14)^m>>>3;e[p]=(y+e[p-7]|0)+(C+e[p-16]|0)}for(var p=0;p<64;p++){var y=(((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&h^~d&f)|0)+(g+(a[p]+e[p]|0)|0)|0,C=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&c^s&l^c&l)|0;g=f,f=h,h=d,d=u+y|0,u=l,l=c,c=s,s=y+C|0}t[0]+=s,t[1]+=c,t[2]+=l,t[3]+=u,t[4]+=d,t[5]+=h,t[6]+=f,t[7]+=g,o+=64,i-=64}return o}t.hash=function(e){var t=new i;t.update(e);var n=t.digest();return t.clean(),n}},93350:function(e,t,n){"use strict";
9Object.defineProperty(t,"__esModule",{value:!0});var r=n(98099),o=n(17309);t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var i=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){o.wipe(this._buffer),o.wipe(this._tempHi),o.wipe(this._tempLo),this.reset()},e.prototype.update=function(e,n){if(void 0===n&&(n=e.length),this._finished)throw Error("SHA512: can't update because hash was finished.");var r=0;if(this._bytesHashed+=n,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&n>0;)this._buffer[this._bufferLength++]=e[r++],n--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(n>=this.blockSize&&(r=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,r,n),n%=this.blockSize);n>0;)this._buffer[this._bufferLength++]=e[r++],n--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,n=this._bufferLength,o=t%128<112?128:256;this._buffer[n]=128;for(var i=n+1;i<o-8;i++)this._buffer[i]=0;r.writeUint32BE(t/536870912|0,this._buffer,o-8),r.writeUint32BE(t<<3,this._buffer,o-4),s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,o),this._finished=!0}for(var i=0;i<this.digestLength/8;i++)r.writeUint32BE(this._stateHi[i],e,8*i),r.writeUint32BE(this._stateLo[i],e,8*i+4);return this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(this._finished)throw Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){o.wipe(e.stateHi),o.wipe(e.stateLo),e.buffer&&o.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA512=i;var a=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,
91322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function s(e,t,n,o,i,s,c){for(var l,u,d,h,f,g,p,v,m=n[0],y=n[1],C=n[2],O=n[3],b=n[4],w=n[5],_=n[6],E=n[7],R=o[0],N=o[1],S=o[2],T=o[3],A=o[4],D=o[5],P=o[6],I=o[7];c>=128;){for(var K=0;K<16;K++){var k=8*K+s;e[K]=r.readUint32BE(i,k),t[K]=r.readUint32BE(i,k+4)}for(var K=0;K<80;K++){var x=m,M=y,L=C,U=O,W=b,X=w,j=_,B=E,H=R,J=N,q=S,F=T,$=A,V=D,G=P,z=I;if(l=E,f=65535&(u=I),g=u>>>16,p=65535&l,v=l>>>16,l=(b>>>14|A<<18)^(b>>>18|A<<14)^(A>>>9|b<<23),f+=65535&(u=(A>>>14|b<<18)^(A>>>18|b<<14)^(b>>>9|A<<23)),g+=u>>>16,p+=65535&l,v+=l>>>16,l=b&w^~b&_,f+=65535&(u=A&D^~A&P),g+=u>>>16,p+=65535&l,v+=l>>>16,l=a[2*K],f+=65535&(u=a[2*K+1]),g+=u>>>16,p+=65535&l,v+=l>>>16,l=e[K%16],f+=65535&(u=t[K%16]),g+=u>>>16,p+=65535&l,v+=l>>>16,g+=f>>>16,p+=g>>>16,v+=p>>>16,d=65535&p|v<<16,h=65535&f|g<<16,l=d,f=65535&(u=h),g=u>>>16,p=65535&l,v=l>>>16,l=(m>>>28|R<<4)^(R>>>2|m<<30)^(R>>>7|m<<25),f+=65535&(u=(R>>>28|m<<4)^(m>>>2|R<<30)^(m>>>7|R<<25)),g+=u>>>16,p+=65535&l,v+=l>>>16,l=m&y^m&C^y&C,f+=65535&(u=R&N^R&S^N&S),g+=u>>>16,p+=65535&l,v+=l>>>16,g+=f>>>16,p+=g>>>16,v+=p>>>16,B=65535&p|v<<16,z=65535&f|g<<16,l=U,f=65535&(u=F),g=u>>>16,p=65535&l,v=l>>>16,l=d,f+=65535&(u=h),g+=u>>>16,p+=65535&l,v+=l>>>16,g+=f>>>16,p+=g>>>16,v+=p>>>16,U=65535&p|v<<16,F=65535&f|g<<16,y=x,C=M,O=L,b=U,w=W,_=X,E=j,m=B,N=H,S=J,T=q,A=F,D=$,P=V,I=G,R=z,K%16==15)for(var k=0;k<16;k++)l=e[k],f=65535&(u=t[k]),g=u>>>16,p=65535&l,v=l>>>16,l=e[(k+9)%16],f+=65535&(u=t[(k+9)%16]),g+=u>>>16,p+=65535&l,v+=l>>>16,l=((d=e[(k+1)%16])>>>1|(h=t[(k+1)%16])<<31)^(d>>>8|h<<24)^d>>>7,f+=65535&(u=(h>>>1|d<<31)^(h>>>8|d<<24)^(h>>>7|d<<25)),g+=u>>>16,p+=65535&l,v+=l>>>16,l=((d=e[(k+14)%16])>>>19|(h=t[(k+14)%16])<<13)^(h>>>29|d<<3)^d>>>6,f+=65535&(u=(h>>>19|d<<13)^(d>>>29|h<<3)^(h>>>6|d<<26)),g+=u>>>16,p+=65535&l,v+=l>>>16,g+=f>>>16,p+=g>>>16,v+=p>>>16,e[k]=65535&p|v<<16,t[k]=65535&f|g<<16}l=m,f=65535&(u=R),g=u>>>16,p=65535&l,v=l>>>16,l=n[0],f+=65535&(u=o[0]),g+=u>>>16,p+=65535&l,v+=l>>>16,g+=f>>>16,p+=g>>>16,v+=p>>>16,n[0]=m=65535&p|v<<16,o[0]=R=65535&f|g<<16,l=y,f=65535&(u=N),g=u>>>16,p=65535&l,v=l>>>16,l=n[1],f+=65535&(u=o[1]),g+=u>>>16,p+=65535&l,v+=l>>>16,g+=f>>>16,p+=g>>>16,v+=p>>>16,n[1]=y=65535&p|v<<16,o[1]=N=65535&f|g<<16,l=C,f=65535&(u=S),g=u>>>16,p=65535&l,v=l>>>16,l=n[2],f+=65535&(u=o[2]),g+=u>>>16,p+=65535&l,v+=l>>>16,g+=f>>>16,p+=g>>>16,v+=p>>>16,n[2]=C=65535&p|v<<16,o[2]=S=65535&f|g<<16,l=O,f=65535&(u=T),g=u>>>16,p=65535&l,v=l>>>16,l=n[3],f+=65535&(u=o[3]),g+=u>>>16,p+=65535&l,v+=l>>>16,g+=f>>>16,p+=g>>>16,v+=p>>>16,n[3]=O=65535&p|v<<16,o[3]=T=65535&f|g<<16,l=b,f=65535&(u=A),g=u>>>16,p=65535&l,v=l>>>16,l=n[4],f+=65535&(u=o[4]),g+=u>>>16,p+=65535&l,v+=l>>>16,g+=f>>>16,p+=g>>>16,v+=p>>>16,n[4]=b=65535&p|v<<16,o[4]=A=65535&f|g<<16,l=w,f=65535&(u=D),g=u>>>16,p=65535&l,v=l>>>16,l=n[5],f+=65535&(u=o[5]),g+=u>>>16,p+=65535&l,v+=l>>>16,g+=f>>>16,p+=g>>>16,v+=p>>>16,n[5]=w=65535&p|v<<16,o[5]=D=65535&f|g<<16,l=_,f=65535&(u=P),g=u>>>16,p=65535&l,v=l>>>16,l=n[6],f+=65535&(u=o[6]),g+=u>>>16,p+=65535&l,v+=l>>>16,g+=f>>>16,p+=g>>>16,v+=p>>>16,n[6]=_=65535&p|v<<16,o[6]=P=65535&f|g<<16,l=E,f=65535&(u=I),g=u>>>16,p=65535&l,v=l>>>16,l=n[7],f+=65535&(u=o[7]),g+=u>>>16,p+=65535&l,v+=l>>>16,g+=f>>>16,p+=g>>>16,v+=p>>>16,n[7]=E=65535&p|v<<16,o[7]=I=65535&f|g<<16,s+=128,c-=128}return s}t.hash=function(e){var t=new i;t.update(e);var n=t.digest();return t.clean(),n}},17309:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t<e.length;t++)e[t]=0;return e}},58162:function(e){"use strict";e.exports=function(e){if(e.length>=255)throw TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var r=0;r<e.length;
9r++){var o=e.charAt(r),i=o.charCodeAt(0);if(255!==t[i])throw TypeError(o+" is ambiguous");t[i]=r}var a=e.length,s=e.charAt(0),c=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function u(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;for(var n=0,r=0,o=0;e[n]===s;)r++,n++;for(var i=(e.length-n)*c+1>>>0,l=new Uint8Array(i);e[n];){var u=t[e.charCodeAt(n)];if(255===u)return;for(var d=0,h=i-1;(0!==u||d<o)&&-1!==h;h--,d++)u+=a*l[h]>>>0,l[h]=u%256>>>0,u=u/256>>>0;if(0!==u)throw Error("Non-zero carry");o=d,n++}for(var f=i-o;f!==i&&0===l[f];)f++;for(var g=new Uint8Array(r+(i-f)),p=r;f!==i;)g[p++]=l[f++];return g}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,o=0,i=t.length;o!==i&&0===t[o];)o++,n++;for(var c=(i-o)*l+1>>>0,u=new Uint8Array(c);o!==i;){for(var d=t[o],h=0,f=c-1;(0!==d||h<r)&&-1!==f;f--,h++)d+=256*u[f]>>>0,u[f]=d%a>>>0,d=d/a>>>0;if(0!==d)throw Error("Non-zero carry");r=h,o++}for(var g=c-r;g!==c&&0===u[g];)g++;for(var p=s.repeat(n);g<c;++g)p+=e.charAt(u[g]);return p},decodeUnsafe:u,decode:function(e){var t=u(e);if(t)return t;throw Error("Non-base"+a+" character")}}}},77191:function(e,t,n){let r=n(58162);e.exports=r("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},54098:function(e,t,n){var r="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==n.g&&n.g,o=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();(function(e){var t=void 0!==o&&o||"undefined"!=typeof self&&self||void 0!==n.g&&n.g||{},r={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(r.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function c(e){return"string"!=typeof e&&(e=String(e)),e}function l(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function d(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function h(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function f(e){var t=new FileReader,n=h(t);return t.readAsArrayBuffer(e),n}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(e){if(this.bodyUsed=this.bodyUsed,this._bodyInit=e,e){if("string"==typeof e)this._bodyText=e;else if(r.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(r.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var t;r.arrayBuffer&&r.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e)}}else this._noBody=!0,this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return d(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(r.blob)return this.blob().then(f);throw Error("could not read as ArrayBuffer")},this.text=function(){var e,t,n,r,o,i=d(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,n=h(t=new FileReader),o=(r=/charset=([A-Za-z0-9_-]+)/.exec(e.type))?r[1]:"utf-8",t.readAsText(e,o),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},r.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=s(e),t=c(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},u.prototype.delete=function(e){delete this.map[s(e)]},u.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},u.prototype.set=function(e,t){this.map[s(e)]=c(t)},u.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),l(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),l(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),l(e)},r.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var v=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function m(e,n){if(!(this instanceof m))throw TypeError('Please use the "new" operator, this DOM object c
9onstructor cannot be called as a function.');var r,o,i=(n=n||{}).body;if(e instanceof m){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,n.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=n.credentials||this.credentials||"same-origin",(n.headers||!this.headers)&&(this.headers=new u(n.headers)),this.method=(o=(r=n.method||this.method||"GET").toUpperCase(),v.indexOf(o)>-1?o:r),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal||function(){if("AbortController"in t)return new AbortController().signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),("GET"===this.method||"HEAD"===this.method)&&("no-store"===n.cache||"no-cache"===n.cache)){var a=/([?&])_=[^&]*/;a.test(this.url)?this.url=this.url.replace(a,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function y(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function C(e,t){if(!(this instanceof C))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},p.call(m.prototype),p.call(C.prototype),C.prototype.clone=function(){return new C(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},C.error=function(){var e=new C(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var O=[301,302,303,307,308];C.redirect=function(e,t){if(-1===O.indexOf(t))throw RangeError("Invalid status code");return new C(null,{status:t,headers:{location:e}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function b(n,o){return new Promise(function(i,a){var l=new m(n,o);if(l.signal&&l.signal.aborted)return a(new e.DOMException("Aborted","AbortError"));var d=new XMLHttpRequest;function h(){d.abort()}if(d.onload=function(){var e,t,n={statusText:d.statusText,headers:(e=d.getAllResponseHeaders()||"",t=new u,e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();try{t.append(r,o)}catch(e){console.warn("Response "+e.message)}}}),t)};0===l.url.indexOf("file://")&&(d.status<200||d.status>599)?n.status=200:n.status=d.status,n.url="responseURL"in d?d.responseURL:n.headers.get("X-Request-URL");var r="response"in d?d.response:d.responseText;setTimeout(function(){i(new C(r,n))},0)},d.onerror=function(){setTimeout(function(){a(TypeError("Network request failed"))},0)},d.ontimeout=function(){setTimeout(function(){a(TypeError("Network request timed out"))},0)},d.onabort=function(){setTimeout(function(){a(new e.DOMException("Aborted","AbortError"))},0)},d.open(l.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(t){return e}}(l.url),!0),"include"===l.credentials?d.withCredentials=!0:"omit"===l.credentials&&(d.withCredentials=!1),"responseType"in d&&(r.blob?d.responseType="blob":r.arrayBuffer&&(d.responseType="arraybuffer")),o&&"object"==typeof o.headers&&!(o.headers instanceof u||t.Headers&&o.headers instanceof t.Headers)){var f=[];
9Object.getOwnPropertyNames(o.headers).forEach(function(e){f.push(s(e)),d.setRequestHeader(e,c(o.headers[e]))}),l.headers.forEach(function(e,t){-1===f.indexOf(t)&&d.setRequestHeader(t,e)})}else l.headers.forEach(function(e,t){d.setRequestHeader(t,e)});l.signal&&(l.signal.addEventListener("abort",h),d.onreadystatechange=function(){4===d.readyState&&l.signal.removeEventListener("abort",h)}),d.send(void 0===l._bodyInit?null:l._bodyInit)})}b.polyfill=!0,t.fetch||(t.fetch=b,t.Headers=u,t.Request=m,t.Response=C),e.Headers=u,e.Request=m,e.Response=C,e.fetch=b})({}),o.fetch.ponyfill=!0,delete o.fetch.polyfill;var i=r.fetch?r:o;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},69483:function(e,t,n){var r;r=function(){return(function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){if(i)return i(a,!0);var c=Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){return o(t[a][1][e]||e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i=void 0,a=0;a<r.length;a++)o(r[a]);return o})({1:[function(e,t,r){(function(e){"use strict";var n,r,o=e.MutationObserver||e.WebKitMutationObserver;if(o){var i=0,a=new o(u),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),n=function(){s.data=i=++i%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var c=new e.MessageChannel;c.port1.onmessage=u,n=function(){c.port2.postMessage(0)}}var l=[];function u(){r=!0;for(var e,t,n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}r=!1}t.exports=function(e){1!==l.push(e)||r||n()}}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){"use strict";var r=e(1);function o(){}var i={},a=["REJECTED"],s=["FULFILLED"],c=["PENDING"];function l(e){if("function"!=typeof e)throw TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,e!==o&&f(this,e)}function u(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function d(e,t,n){r(function(){var r;try{r=t(n)}catch(t){return i.reject(e,t)}r===e?i.reject(e,TypeError("Cannot resolve promise with itself")):i.resolve(e,r)})}function h(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function f(e,t){var n=!1;function r(t){n||(n=!0,i.reject(e,t))}function o(t){n||(n=!0,i.resolve(e,t))}var a=g(function(){t(o,r)});"error"===a.status&&r(a.value)}function g(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}t.exports=l,l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var n=new this.constructor(o);return this.state!==c?d(n,this.state===s?e:t,this.outcome):this.queue.push(new u(n,e,t)),n},u.prototype.callFulfilled=function(e){i.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){i.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},i.resolve=function(e,t){var n=g(h,t);if("error"===n.status)return i.reject(e,n.value);var r=n.value;if(r)f(e,r);else{e.state=s,e.outcome=t;for(var o=-1,a=e.queue.length;++o<a;)e.queue[o].callFulfilled(t)}return e},i.reject=function(e,t){e.state=a,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},l.resolve=function(e){return e instanceof this?e:i.resolve(new this(o),e)},l.reject=function(e){var t=new this(o);return i.reject(t,e)},l.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var a=Array(n),s=0,c=-1,l=new this(o);++c<n;)(function(e,o){t.resolve(e).then(function(e){a[o]=e,++s!==n||r||(r=!0,i.resolve(l,a))},function(e){r||(r=!0,i.reject(l,e))})})(e[c],c);return l},l.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var a=-1,s=new this(o);++a<n;)(function(e){t.resolve(e).then(function(e){r||(r=!0,i.resolve(s,e))},function(e){r||(r=!0,i.reject(s,e))})})(e[a]);return s}},{1:1}],3:[function(e,t,r){(function(t){"use strict";"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,n){"use strict";var r="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},o=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function i(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(o){if("TypeError"!==o.name)throw o;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var a=Promise;function s(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}
9function c(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function l(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function u(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var d="local-forage-detect-blob-support",h=void 0,f={},g=Object.prototype.toString,p="readonly",v="readwrite";function m(e){var t=f[e.name],n={};n.promise=new a(function(e,t){n.resolve=e,n.reject=t}),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then(function(){return n.promise}):t.dbReady=n.promise}function y(e){var t=f[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function C(e,t){var n=f[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function O(e,t){return new a(function(n,r){if(f[e.name]=f[e.name]||N(),e.db){if(!t)return n(e.db);m(e),e.db.close()}var i=[e.name];t&&i.push(e.version);var a=o.open.apply(o,i);t&&(a.onupgradeneeded=function(t){var n=a.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(d)}catch(n){if("ConstraintError"===n.name)console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw n}}),a.onerror=function(e){e.preventDefault(),r(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},n(t),y(e)}})}function b(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),r=e.version<e.db.version,o=e.version>e.db.version;if(r&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||n){if(n){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function w(e){return i([function(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),o=0;o<t;o++)r[o]=e.charCodeAt(o);return n}(atob(e.data))],{type:e.type})}function _(e){return e&&e.__local_forage_encoded_blob}function E(e){var t=this,n=t._initReady().then(function(){var e=f[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return c(n,e,e),n}function R(e,t,n,r){void 0===r&&(r=1);try{var o=e.db.transaction(e.storeName,t);n(null,o)}catch(o){if(r>0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return a.resolve().then(function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),O(e,!0)}).then(function(){return(function(e){m(e);for(var t=f[e.name],n=t.forages,r=0;r<n.length;r++){var o=n[r];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return e.db=null,O(e,!1).then(function(t){return(e.db=t,b(e))?O(e,!0):t}).then(function(r){e.db=t.db=r;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=r}).catch(function(t){throw C(e,t),t})})(e).then(function(){R(e,t,n,r-1)})}).catch(n);n(o)}}function N(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}var S={_driver:"asyncStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=e[r];var o=f[n.name];o||(o=N(),f[n.name]=o),o.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=E);var i=[];function s(){return a.resolve()}for(var c=0;c<o.forages.length;c++){var l=o.forages[c];l!==t&&i.push(l._initReady().catch(s))}var u=o.forages.slice(0);return a.all(i).then(function(){return n.db=o.db,O(n,!1)}).then(function(e){return(n.db=e,b(n,t._defaultConfig.version))?O(n,!0):e}).then(function(e){n.db=o.db=e,t._dbInfo=n;for(var r=0;r<u.length;r++){var i=u[r];i!==t&&(i._dbInfo.db=n.db,i._dbInfo.version=n.version)}})},_support:function(){try{if(!o||!o.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,t){var n=this,r=new a(function(t,r){n.ready().then(function(){R(n._dbInfo,p,function(o,i){if(o)return r(o);try{var a=i.objectStore(n._dbInfo.storeName).openCursor(),s=1;a.onsuccess=function(){var n=a.result;if(n){var r=n.value;_(r)&&(r=w(r));var o=e(r,n.key,s++);void 0!==o?t(o):n.continue()}else t()},a.onerror=function(){r(a.error)}}catch(e){r(e)}})}).catch(r)});return s(r,t),r},getItem:function(e,t){var n=this;e=l(e);var r=new a(function(t,r){n.ready().then(function(){R(n._dbInfo,p,function(o,i){if(o)return r(o);try{var a=i.objectStore(n._dbInfo.storeName).get(e);a.onsuccess=function(){var e=a.result;void 0===e&&(e=null),_(e)&&(e=w(e)),t(e)},a.onerror=function(){r(a.error)}}catch(e){r(e)}})}).catch(r)});return s(r,t),r},setItem:function(e,t,n){var r=this;e=l(e);var o=new a(function(n,o){var s;r.ready().then(function(){var e;return(s=r._dbInfo,"[object Blob]"===g.call(t))?(e=s.db,"boolean"==typeof h?a.resolve(h):new a(function(t){var n=e.transaction(d,v),r=i([""]);n.objectStore(d).put(r,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/);t(navigator.userAgent.match(/Edge\//)||!e||parseInt(e[1],10)>=43)}}).catch(function(){return!1}).then(function(e){return h=e})).then(function(e){return e?t:new a(function(e,n){var r=new FileReader;r.onerror=n,r.onloadend=function(n){e({__local_forage_encoded_blob:!0,data:btoa(n.target.result||""),type:t.type})},r.readAsBinaryString(t)})}):t}).then(function(t){R(r._dbInfo,v,function(i,a){if(i)return o(i);try{var s=a.objectStore(r._dbInfo.storeName);null===t&&(t=void 0);var c=s.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),n(t)},a.onabort=a.onerror=function(){var e=c.error?c.error:c.transaction.error;o(e)}}catch(e){o(e)}})}).catch(o)});return s(o,n),o},removeItem:function(e,t){var n=this;e=l(e);var r=new a(function(t,r){n.ready().then(function(){R(n._dbInfo,v,function(o,i){if(o)return r(o);try{var a=i.objectStore(n._dbInfo.storeName).delete(e);i.oncomplete=function(){t()},i.onerror=function(){r(a.error)},i.onabort=function(){var e=a.error?a.error:a.transaction.error;r(e)}}catch(e){r(e)}})}).catch(r)});return s(r,t),r},clear:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){R(t._dbInfo,v,function(r,o){if(r)return n(r);try{var i=o.objectStore(t._dbInfo.storeName).clear();o.oncomplete=function(){e()},o.onabort=o.onerror=function(){var e=i.error?i.error:i.transaction.error;n(e)}}catch(e){n(e)}})}).catch(n)});return s(n,e),n},length:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){R(t._dbInfo,p,function(r,o){if(r)return n(r);try{var i=o.objectStore(t._dbInfo.storeName).count();i.onsuccess=function(){e(i.result)},i.onerror=function(){n(i.error)}}catch(e){n(e)}})}).catch(n)});return s(n,e),n},key:function(e,t){var n=this,r=new a(function(t,r){if(e<0){t(null);return}n.ready().then(function(){R(n._dbInfo,p,function(o,i){if(o)return r(o);try{var a=i.objectStore(n._dbInfo.storeName),s=!1,c=a.openKeyCursor();c.onsuccess=function(){var n=c.result;if(!n){t(null);return}0===e?t(n.key):s?t(n.key):(s=!0,n.advance(e))},c.onerror=function(){r(c.error)}}catch(e){r(e)}})}).catch(r)});return s(r,t),r},keys:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){R(t._dbInfo,p,function(r,o){if(r)return n(r);try{var i=o.objectStore(t._dbInfo.storeName).openKeyCursor(),a=[];i.onsuccess=function(){var t=i.result;if(!t){e(a);return}a.push(t.key),t.continue()},i.onerror=function(){n(i.error)}}catch(e){n(e)}})}).catch(n)});return s(n,e),n},dropInstance:function(e,t){t=u.apply(this,arguments);var n,r=this.config();if((e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName),e.name){var i=e.name===r.name&&this._dbInfo.db?a.resolve(this._dbInfo.db):O(e,!1).then(function(t){var n=f[e.name],r=n.forages;n.db=t;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=t;return t});n=e.storeName?i.then(function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.ver
9sion+1;m(e);var r=f[e.name],i=r.forages;t.close();for(var s=0;s<i.length;s++){var c=i[s];c._dbInfo.db=null,c._dbInfo.version=n}return new a(function(t,r){var i=o.open(e.name,n);i.onerror=function(e){i.result.close(),r(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),t(e)}}).then(function(e){r.db=e;for(var t=0;t<i.length;t++){var n=i[t];n._dbInfo.db=e,y(n._dbInfo)}}).catch(function(t){throw(C(e,t)||a.resolve()).catch(function(){}),t})}}):i.then(function(t){m(e);var n=f[e.name],r=n.forages;t.close();for(var i=0;i<r.length;i++)r[i]._dbInfo.db=null;return new a(function(t,n){var r=o.deleteDatabase(e.name);r.onerror=function(){var e=r.result;e&&e.close(),n(r.error)},r.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},r.onsuccess=function(){var e=r.result;e&&e.close(),t(e)}}).then(function(e){n.db=e;for(var t=0;t<r.length;t++)y(r[t]._dbInfo)}).catch(function(t){throw(C(e,t)||a.resolve()).catch(function(){}),t})})}else n=a.reject("Invalid arguments");return s(n,t),n}},T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=/^~~local_forage_type~([^~]+)~/,D="__lfsc__:",P=D.length,I="arbf",K="blob",k="si08",x="ui08",M="uic8",L="si16",U="si32",W="ur16",X="ui32",j="fl32",B="fl64",H=P+I.length,J=Object.prototype.toString;function q(e){var t,n,r,o,i,a=.75*e.length,s=e.length,c=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var l=new ArrayBuffer(a),u=new Uint8Array(l);for(t=0;t<s;t+=4)n=T.indexOf(e[t]),r=T.indexOf(e[t+1]),o=T.indexOf(e[t+2]),i=T.indexOf(e[t+3]),u[c++]=n<<2|r>>4,u[c++]=(15&r)<<4|o>>2,u[c++]=(3&o)<<6|63&i;return l}function F(e){var t,n=new Uint8Array(e),r="";for(t=0;t<n.length;t+=3)r+=T[n[t]>>2]+T[(3&n[t])<<4|n[t+1]>>4]+T[(15&n[t+1])<<2|n[t+2]>>6]+T[63&n[t+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var $={serialize:function(e,t){var n="";if(e&&(n=J.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===J.call(e.buffer))){var r,o=D;e instanceof ArrayBuffer?(r=e,o+=I):(r=e.buffer,"[object Int8Array]"===n?o+=k:"[object Uint8Array]"===n?o+=x:"[object Uint8ClampedArray]"===n?o+=M:"[object Int16Array]"===n?o+=L:"[object Uint16Array]"===n?o+=W:"[object Int32Array]"===n?o+=U:"[object Uint32Array]"===n?o+=X:"[object Float32Array]"===n?o+=j:"[object Float64Array]"===n?o+=B:t(Error("Failed to get type for BinaryArray"))),t(o+F(r))}else if("[object Blob]"===n){var i=new FileReader;i.onload=function(){t(D+K+("~~local_forage_type~"+e.type)+"~"+F(this.result))},i.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if(e.substring(0,P)!==D)return JSON.parse(e);var t,n=e.substring(H),r=e.substring(P,H);if(r===K&&A.test(n)){var o=n.match(A);t=o[1],n=n.substring(o[0].length)}var a=q(n);switch(r){case I:return a;case K:return i([a],{type:t});case k:return new Int8Array(a);case x:return new Uint8Array(a);case M:return new Uint8ClampedArray(a);case L:return new Int16Array(a);case W:return new Uint16Array(a);case U:return new Int32Array(a);case X:return new Uint32Array(a);case j:return new Float32Array(a);case B:return new Float64Array(a);default:throw Error("Unkown type: "+r)}},stringToBuffer:q,bufferToString:F};function V(e,t,n,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function G(e,t,n,r,o,i){e.executeSql(n,r,o,function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],function(e,s){s.rows.length?i(e,a):V(e,t,function(){e.executeSql(n,r,o,i)},i)},i):i(e,a)},i)}function z(e,t,n,r){var o=this;e=l(e);var i=new a(function(i,a){o.ready().then(function(){void 0===t&&(t=null);var s=t,c=o._dbInfo;c.serializer.serialize(t,function(t,l){l?a(l):c.db.transaction(function(n){G(n,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[e,t],function(){i(s)},function(e,t){a(t)})},function(t){if(t.code===t.QUOTA_ERR){if(r>0){i(z.apply(o,[e,s,n,r-1]));return}a(t)}})})}).catch(a)});return s(i,n),i}var Q={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]="string"!=typeof e[r]?e[r].toString():e[r];var o=new a(function(e,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return r(e)}n.db.transaction(function(o){V(o,n,function(){t._dbInfo=n,e()},function(e,t){r(t)})},r)});
9return n.serializer=$,o},_support:"function"==typeof openDatabase,iterate:function(e,t){var n=this,r=new a(function(t,r){n.ready().then(function(){var o=n._dbInfo;o.db.transaction(function(n){G(n,o,"SELECT * FROM "+o.storeName,[],function(n,r){for(var i=r.rows,a=i.length,s=0;s<a;s++){var c=i.item(s),l=c.value;if(l&&(l=o.serializer.deserialize(l)),void 0!==(l=e(l,c.key,s+1))){t(l);return}}t()},function(e,t){r(t)})})}).catch(r)});return s(r,t),r},getItem:function(e,t){var n=this;e=l(e);var r=new a(function(t,r){n.ready().then(function(){var o=n._dbInfo;o.db.transaction(function(n){G(n,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],function(e,n){var r=n.rows.length?n.rows.item(0).value:null;r&&(r=o.serializer.deserialize(r)),t(r)},function(e,t){r(t)})})}).catch(r)});return s(r,t),r},setItem:function(e,t,n){return z.apply(this,[e,t,n,1])},removeItem:function(e,t){var n=this;e=l(e);var r=new a(function(t,r){n.ready().then(function(){var o=n._dbInfo;o.db.transaction(function(n){G(n,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],function(){t()},function(e,t){r(t)})})}).catch(r)});return s(r,t),r},clear:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){G(t,r,"DELETE FROM "+r.storeName,[],function(){e()},function(e,t){n(t)})})}).catch(n)});return s(n,e),n},length:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){G(t,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],function(t,n){e(n.rows.item(0).c)},function(e,t){n(t)})})}).catch(n)});return s(n,e),n},key:function(e,t){var n=this,r=new a(function(t,r){n.ready().then(function(){var o=n._dbInfo;o.db.transaction(function(n){G(n,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],function(e,n){t(n.rows.length?n.rows.item(0).key:null)},function(e,t){r(t)})})}).catch(r)});return s(r,t),r},keys:function(e){var t=this,n=new a(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){G(t,r,"SELECT key FROM "+r.storeName,[],function(t,n){for(var r=[],o=0;o<n.rows.length;o++)r.push(n.rows.item(o).key);e(r)},function(e,t){n(t)})})}).catch(n)});return s(n,e),n},dropInstance:function(e,t){t=u.apply(this,arguments);var n,r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var o=this;return s(n=e.name?new a(function(t){var n;(n=e.name===r.name?o._dbInfo.db:openDatabase(e.name,"","",0),e.storeName)?t({db:n,storeNames:[e.storeName]}):t(new a(function(e,t){n.transaction(function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(t,r){for(var o=[],i=0;i<r.rows.length;i++)o.push(r.rows.item(i).name);e({db:n,storeNames:o})},function(e,n){t(n)})},function(e){t(e)})}))}).then(function(e){return new a(function(t,n){e.db.transaction(function(r){for(var o=[],i=0,s=e.storeNames.length;i<s;i++)o.push(function(e){return new a(function(t,n){r.executeSql("DROP TABLE IF EXISTS "+e,[],function(){t()},function(e,t){n(t)})})}(e.storeNames[i]));a.all(o).then(function(){t()}).catch(function(e){n(e)})},function(e){n(e)})})}):a.reject("Invalid arguments"),t),n}};function Y(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}var Z={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var n in e)t[n]=e[n];return(t.keyPrefix=Y(e,this._defaultConfig),!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}()||localStorage.length>0)?(this._dbInfo=t,t.serializer=$,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var n=this,r=n.ready().then(function(){for(var t=n._dbInfo,r=t.keyPrefix,o=r.length,i=localStorage.length,a=1,s=0;s<i;s++){var c=localStorage.key(s);if(0===c.indexOf(r)){var l=localStorage.getItem(c);if(l&&(l=t.serializer.deserialize(l)),void 0!==(l=e(l,c.substring(o),a++)))return l}}});return s(r,t),r},getItem:function(e,t){var n=this;e=l(e);var r=n.ready().then(function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&(r=t.serializer.deserialize(r)),r});return s(r,t),r},setItem:function(e,t,n){var r=this;e=l(e);var o=r.ready().then(function(){void 0===t&&(t=null);var n=t;return new a(function(o,i){var a=r._dbInfo;a.serializer.serialize(t,function(t,r){if(r)i(r);else try{localStorage.setItem(a.keyPrefix+e,t),o(n)}catch(e){("QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&i(e),i(e)}})})});return s(o,n),o},removeItem:function(e,t){var n=this;e=l(e);var r=n.ready().then(function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)});return s(r,t),r},clear:function(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);0===r.indexOf(e)&&localStorage.removeItem(r)}});return s(n,e),n},length:function(e){var t=this.keys().then(function(e){return e.length});return s(t,e),t},key:function(e,t){var n=this,r=n.ready().then(function(){var t,r=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(r.keyPrefix.length)),t});return s(r,t),r},keys:function(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo,n=localStorage.length,r=[],o=0;o<n;o++){var i=localStorage.key(o);0===i.indexOf(e.keyPrefix)&&r.push(i.substring(e.keyPrefix.length))}return r});return s(n,e),n},dropInstance:function(e,t){if(t=u.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n,r=this.config();e.name=e.name||r.name,e.storeName=e.storeName||r.storeName}var o=this;return s(n=e.name?new a(function(t){t(e.storeName?Y(e,o._defaultConfig):e.name+"/")}).then(function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}}):a.reject("Invalid arguments"),t),n}},ee=function(e,t){for(var n,r=e.length,o=0;o<r;){if((n=e[o])===t||"number"==typeof n&&"number"==typeof t&&isNaN(n)&&isNaN(t))return!0;o++}return!1},et=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},en={},er={},eo={INDEXEDDB:S,WEBSQL:Q,LOCALSTORAGE:Z},ei=[eo.INDEXEDDB._driver,eo.WEBSQL._driver,eo.LOCALSTORAGE._driver],ea=["dropInstance"],es=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ea),ec={description:"",driver:ei.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function el(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(et(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var eu=new(function(){function e(t){for(var n in function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,e),eo)if(eo.hasOwnProperty(n)){var r=eo[n],o=r._driver;this[n]=o,en[o]||this.defineDriver(r)}this._defaultConfig=el({},ec),this._config=el({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(e){if((void 0===e?"undefined":r(e))==="object"){if(this._ready)return Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var r=new a(function(t,n){try{var r=e._driver,o=Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver){n(o);return}for(var i=es.concat("_initStorage"),c=0,l=i.length;c<l;c++){var u=i[c];if((!ee(ea,u)||e[u])&&"function"!=typeof e[u]){n(o);return}}!function(){for(var t=function(e){return function(){var t=Error("Method "+e+" is not implemented by the current driver"),n=a.reject(t);return s(n,arguments[arguments.length-1]),n}},n=0,r=ea.length;n<r;n++){var o=ea[n];e[o]||(e[o]=t(o))}}();var d=function(n){en[r]&&console.info("Redefining LocalForage driver: "+r),en[r]=e,er[r]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(d,n):d(!!e._support):d(!0)}catch(e){n(e)}});return c(r,t,n),r},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var r=en[e]?a.resolve(en[e]):a.reject(Error("Driver not found."));return c(r,t,n),r}
9,e.prototype.getSerializer=function(e){var t=a.resolve($);return c(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then(function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready});return c(n,e,e),n},e.prototype.setDriver=function(e,t,n){var r=this;et(e)||(e=[e]);var o=this._getSupportedDrivers(e);function i(){r._config.driver=r.driver()}function s(e){return r._extend(e),i(),r._ready=r._initStorage(r._config),r._ready}var l=null!==this._driverSet?this._driverSet.catch(function(){return a.resolve()}):a.resolve();return this._driverSet=l.then(function(){var e=o[0];return r._dbInfo=null,r._ready=null,r.getDriver(e).then(function(e){r._driver=e._driver,i(),r._wrapLibraryMethodsWithReady(),r._initDriver=function(){var e=0;return function t(){for(;e<o.length;){var n=o[e];return e++,r._dbInfo=null,r._ready=null,r.getDriver(n).then(s).catch(t)}i();var c=Error("No available storage method found.");return r._driverSet=a.reject(c),r._driverSet}()}})}).catch(function(){i();var e=Error("No available storage method found.");return r._driverSet=a.reject(e),r._driverSet}),c(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!er[e]},e.prototype._extend=function(e){el(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e[n];this.supports(o)&&t.push(o)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=es.length;e<t;e++)!function(e,t){e[t]=function(){var n=arguments;return e.ready().then(function(){return e[t].apply(e,n)})}}(this,es[e])},e.prototype.createInstance=function(t){return new e(t)},e}());t.exports=eu},{3:3}]},{},[4])(4)},e.exports=r()},43579:function(e,t,n){"use strict";n.r(t),n.d(t,{Circle:function(){return R},Line:function(){return h},default:function(){return N}});var r=n(87462),o=n(1413),i=n(91),a=n(67294),s=n(93967),c=n.n(s),l={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},u=function(){var e=(0,a.useRef)([]),t=(0,a.useRef)(null);return(0,a.useEffect)(function(){var n=Date.now(),r=!1;e.current.forEach(function(e){if(e){r=!0;var o=e.style;o.transitionDuration=".3s, .3s, .3s, .06s",t.current&&n-t.current<100&&(o.transitionDuration="0s, 0s")}}),r&&(t.current=Date.now())}),e.current},d=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],h=function(e){var t=(0,o.Z)((0,o.Z)({},l),e),n=t.className,s=t.percent,h=t.prefixCls,f=t.strokeColor,g=t.strokeLinecap,p=t.strokeWidth,v=t.style,m=t.trailColor,y=t.trailWidth,C=t.transition,O=(0,i.Z)(t,d);delete O.gapPosition;var b=Array.isArray(s)?s:[s],w=Array.isArray(f)?f:[f],_=u(),E=p/2,R=100-p/2,N="M ".concat("round"===g?E:0,",").concat(E,"\n L ").concat("round"===g?R:100,",").concat(E),S="0 0 100 ".concat(p),T=0;return a.createElement("svg",(0,r.Z)({className:c()("".concat(h,"-line"),n),viewBox:S,preserveAspectRatio:"none",style:v},O),a.createElement("path",{className:"".concat(h,"-line-trail"),d:N,strokeLinecap:g,stroke:m,strokeWidth:y||p,fillOpacity:"0"}),b.map(function(e,t){var n=1;switch(g){case"round":n=1-p/100;break;case"square":n=1-p/2/100;break;default:n=1}var r={strokeDasharray:"".concat(e*n,"px, 100px"),strokeDashoffset:"-".concat(T,"px"),transition:C||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},o=w[t]||w[w.length-1];return T+=e,a.createElement("path",{key:t,className:"".concat(h,"-line-path"),d:N,strokeLinecap:g,stroke:o,strokeWidth:p,fillOpacity:"0",ref:function(e){_[t]=e},style:r})}))},f=n(71002),g=n(97685),p=n(98924),v=0,m=(0,p.Z)(),y=function(e){var t=a.useState(),n=(0,g.Z)(t,2),r=n[0],o=n[1];return a.useEffect(function(){var e;o("rc_progress_".concat((m?(e=v,v+=1):e="TEST_OR_SSR",e)))},[]),e||r},C=function(e){var t=e.bg,n=e.children;return a.createElement("div",{style:{width:"100%",height:"100%",background:t}},n)};function O(e,t){return Object.keys(e).map(function(n){var r=parseFloat(n);return"".concat(e[n]," ").concat("".concat(Math.floor(r*t),"%"))})}var b=a.forwardRef(function(e,t){var n=e.prefixCls,r=e.color,o=e.gradientId,i=e.radius,s=e.style,c=e.ptg,l=e.strokeLinecap,u=e.strokeWidth,d=e.size,h=e.gapDegree,g=r&&"object"===(0,f.Z)(r),p=d/2,v=a.createElement("circle",{className:"".concat(n,"-circle-path"),r:i,cx:p,cy:p,stroke:g?"#FFF":void 0,strokeLinecap:l,strokeWidth:u,opacity:0===c?0:1,style:s,ref:t});if(!g)return v;var m="".concat(o,"-conic"),y=O(r,(360-h)/360),b=O(r,1),w="conic-gradient(from ".concat(h?"".concat(180+h
9/2,"deg"):"0deg",", ").concat(y.join(", "),")"),_="linear-gradient(to ".concat(h?"bottom":"top",", ").concat(b.join(", "),")");return a.createElement(a.Fragment,null,a.createElement("mask",{id:m},v),a.createElement("foreignObject",{x:0,y:0,width:d,height:d,mask:"url(#".concat(m,")")},a.createElement(C,{bg:_},a.createElement(C,{bg:w}))))}),w=function(e,t,n,r,o,i,a,s,c,l){var u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,d=(100-r)/100*t;return"round"===c&&100!==r&&(d+=l/2)>=t&&(d=t-.01),{stroke:"string"==typeof s?s:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:d+u,transform:"rotate(".concat(o+n/100*360*((360-i)/360)+(0===i?0:({bottom:0,top:180,left:90,right:-90})[a]),"deg)"),transformOrigin:"".concat(50,"px ").concat(50,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},_=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function E(e){var t=null!=e?e:[];return Array.isArray(t)?t:[t]}var R=function(e){var t,n,s,d,h=(0,o.Z)((0,o.Z)({},l),e),g=h.id,p=h.prefixCls,v=h.steps,m=h.strokeWidth,C=h.trailWidth,O=h.gapDegree,R=void 0===O?0:O,N=h.gapPosition,S=h.trailColor,T=h.strokeLinecap,A=h.style,D=h.className,P=h.strokeColor,I=h.percent,K=(0,i.Z)(h,_),k=y(g),x="".concat(k,"-gradient"),M=50-m/2,L=2*Math.PI*M,U=R>0?90+R/2:-90,W=(360-R)/360*L,X="object"===(0,f.Z)(v)?v:{count:v,gap:2},j=X.count,B=X.gap,H=E(I),J=E(P),q=J.find(function(e){return e&&"object"===(0,f.Z)(e)}),F=q&&"object"===(0,f.Z)(q)?"butt":T,$=w(L,W,0,100,U,R,N,S,F,m),V=u();return a.createElement("svg",(0,r.Z)({className:c()("".concat(p,"-circle"),D),viewBox:"0 0 ".concat(100," ").concat(100),style:A,id:g,role:"presentation"},K),!j&&a.createElement("circle",{className:"".concat(p,"-circle-trail"),r:M,cx:50,cy:50,stroke:S,strokeLinecap:F,strokeWidth:C||m,style:$}),j?(t=Math.round(H[0]/100*j),n=100/j,s=0,Array(j).fill(null).map(function(e,r){var o=r<=t-1?J[0]:S,i=o&&"object"===(0,f.Z)(o)?"url(#".concat(x,")"):void 0,c=w(L,W,s,n,U,R,N,o,"butt",m,B);return s+=(W-c.strokeDashoffset+B)*100/W,a.createElement("circle",{key:r,className:"".concat(p,"-circle-path"),r:M,cx:50,cy:50,stroke:i,strokeWidth:m,opacity:1,style:c,ref:function(e){V[r]=e}})})):(d=0,H.map(function(e,t){var n=J[t]||J[J.length-1],r=w(L,W,d,e,U,R,N,n,F,m);return d+=e,a.createElement(b,{key:t,color:n,ptg:e,radius:M,prefixCls:p,gradientId:x,style:r,strokeLinecap:F,strokeWidth:m,gapDegree:R,ref:function(e){V[t]=e},size:100})}).reverse()))},N={Line:h,Circle:R}},61432:function(e,t,n){"use strict";n.r(t),n.d(t,{CID:function(){return eP},bases:function(){return eH},bytes:function(){return r},codecs:function(){return eq},digest:function(){return g},hasher:function(){return p},hashes:function(){return eJ},varint:function(){return f}});var r={};n.r(r),n.d(r,{coerce:function(){return R},empty:function(){return b},equals:function(){return E},fromHex:function(){return _},fromString:function(){return S},isBinary:function(){return N},toHex:function(){return w},toString:function(){return T}});var o={};n.r(o),n.d(o,{identity:function(){return U}});var i={};n.r(i),n.d(i,{base2:function(){return W}});var a={};n.r(a),n.d(a,{base8:function(){return X}});var s={};n.r(s),n.d(s,{base10:function(){return j}});var c={};n.r(c),n.d(c,{base16:function(){return B},base16upper:function(){return H}});var l={};n.r(l),n.d(l,{base32:function(){return J},base32hex:function(){return V},base32hexpad:function(){return z},base32hexpadupper:function(){return Q},base32hexupper:function(){return G},base32pad:function(){return F},base32padupper:function(){return $},base32upper:function(){return q},base32z:function(){return Y}});var u={};n.r(u),n.d(u,{base36:function(){return Z},base36upper:function(){return ee}});var d={};n.r(d),n.d(d,{base58btc:function(){return et},base58flickr:function(){return en}});var h={};n.r(h),n.d(h,{base64:function(){return er},base64pad:function(){return eo},base64url:function(){return ei},base64urlpad:function(){return ea}});var f={};n.r(f),n.d(f,{decode:function(){return el},encodeTo:function(){return eu},encodingLength:function(){return ed}});var g={};n.r(g),n.d(g,{Digest:function(){return ep},create:function(){return eh},decode:function(){return ef},equals:function(){return eg}});var p={};n.r(p),n.d(p,{Hasher:function(){return em},from:function(){return ev}});var v={};n.r(v),n.d(v,{sha256:function(){return eC},sha512:function(){return eO}});var m={};n.r(m),n.d(m,{identity:function(){return eb}});var y={};n.r(y),n.d(y,{code:function(){return eE},decode:function(){return eN},encode:function(){return eR},name:function(){return e_}});var C={};n.r(C),n.d(C,{code:function(){return eT},decode:function(){return eD},encode:function(){return eA},name:function(){return eS}});var O=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var o=0;o<e.length;o++){var i=e.charAt(o),a=i.charCodeAt(0);if(255!==n[a])throw TypeError(i+" is ambiguous");n[a]=o}
9var s=e.length,c=e.charAt(0),l=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function d(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var r=0,o=0;e[t]===c;)r++,t++;for(var i=(e.length-t)*l+1>>>0,a=new Uint8Array(i);e[t];){var u=n[e.charCodeAt(t)];if(255===u)return;for(var d=0,h=i-1;(0!==u||d<o)&&-1!==h;h--,d++)u+=s*a[h]>>>0,a[h]=u%256>>>0,u=u/256>>>0;if(0!==u)throw Error("Non-zero carry");o=d,t++}if(" "!==e[t]){for(var f=i-o;f!==i&&0===a[f];)f++;for(var g=new Uint8Array(r+(i-f)),p=r;f!==i;)g[p++]=a[f++];return g}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,o=0,i=t.length;o!==i&&0===t[o];)o++,n++;for(var a=(i-o)*u+1>>>0,l=new Uint8Array(a);o!==i;){for(var d=t[o],h=0,f=a-1;(0!==d||h<r)&&-1!==f;f--,h++)d+=256*l[f]>>>0,l[f]=d%s>>>0,d=d/s>>>0;if(0!==d)throw Error("Non-zero carry");r=h,o++}for(var g=a-r;g!==a&&0===l[g];)g++;for(var p=c.repeat(n);g<a;++g)p+=e.charAt(l[g]);return p},decodeUnsafe:d,decode:function(e){var n=d(e);if(n)return n;throw Error(`Non-${t} character`)}}};let b=new Uint8Array(0),w=e=>e.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),_=e=>{let t=e.match(/../g);return t?new Uint8Array(t.map(e=>parseInt(e,16))):b},E=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0},R=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},N=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),S=e=>new TextEncoder().encode(e),T=e=>new TextDecoder().decode(e);class A{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class D{constructor(e,t,n){this.name=e,this.prefix=t,this.baseDecode=n}decode(e){if("string"==typeof e){if(e[0]===this.prefix)return this.baseDecode(e.slice(1));throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)}throw Error("Can only multibase decode strings")}or(e){return new P({[this.prefix]:this,...e.decoders||{[e.prefix]:e}})}}class P{constructor(e){this.decoders=e}or(e){let t=e.decoders||{[e.prefix]:e};return new P({...this.decoders,...t})}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}class I{constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new A(e,t,n),this.decoder=new D(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let K=({name:e,prefix:t,encode:n,decode:r})=>new I(e,t,n,r),k=({prefix:e,name:t,alphabet:n})=>{let{encode:r,decode:o}=O(n,t);return K({prefix:e,name:t,encode:r,decode:e=>R(o(e))})},x=(e,t,n,r)=>{let o={};for(let e=0;e<t.length;++e)o[t[e]]=e;let i=e.length;for(;"="===e[i-1];)--i;let a=new Uint8Array(i*n/8|0),s=0,c=0,l=0;for(let t=0;t<i;++t){let i=o[e[t]];if(void 0===i)throw SyntaxError(`Non-${r} character`);c=c<<n|i,(s+=n)>=8&&(s-=8,a[l++]=255&c>>s)}if(s>=n||255&c<<8-s)throw SyntaxError("Unexpected end of data");return a},M=(e,t,n)=>{let r="="===t[t.length-1],o=(1<<n)-1,i="",a=0,s=0;for(let r=0;r<e.length;++r)for(s=s<<8|e[r],a+=8;a>n;)a-=n,i+=t[o&s>>a];if(a&&(i+=t[o&s<<n-a]),r)for(;i.length*n&7;)i+="=";return i},L=({name:e,prefix:t,bitsPerChar:n,alphabet:r})=>K({prefix:t,name:e,encode:e=>M(e,r,n),decode:t=>x(t,r,n,e)}),U=K({prefix:"\0",name:"identity",encode:e=>T(e),decode:e=>S(e)}),W=L({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),X=L({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),j=k({prefix:"9",name:"base10",alphabet:"0123456789"}),B=L({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),H=L({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),J=L({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),q=L({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),F=L({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),$=L({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),V=L({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),G=L({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),z=L({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Q=L({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Y=L({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Z=k({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),ee=k({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),et=k({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),en=k({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),er=L({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
9+/",bitsPerChar:6}),eo=L({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ei=L({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ea=L({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var es=function e(t,n,r){n=n||[];for(var o=r=r||0;t>=2147483648;)n[r++]=255&t|128,t/=128;for(;-128&t;)n[r++]=255&t|128,t>>>=7;return n[r]=0|t,e.bytes=r-o+1,n},ec=function e(t,n){var r,o=0,n=n||0,i=0,a=n,s=t.length;do{if(a>=s)throw e.bytes=0,RangeError("Could not decode varint");r=t[a++],o+=i<28?(127&r)<<i:(127&r)*Math.pow(2,i),i+=7}while(r>=128);return e.bytes=a-n,o};let el=e=>[ec(e),ec.bytes],eu=(e,t,n=0)=>(es(e,t,n),t),ed=e=>e<128?1:e<16384?2:e<2097152?3:e<268435456?4:e<34359738368?5:e<4398046511104?6:e<562949953421312?7:e<72057594037927940?8:e<0x7fffffffffffffff?9:10,eh=(e,t)=>{let n=t.byteLength,r=ed(e),o=r+ed(n),i=new Uint8Array(o+n);return eu(e,i,0),eu(n,i,r),i.set(t,o),new ep(e,n,t,i)},ef=e=>{let t=R(e),[n,r]=el(t),[o,i]=el(t.subarray(r)),a=t.subarray(r+i);if(a.byteLength!==o)throw Error("Incorrect length");return new ep(n,o,a,t)},eg=(e,t)=>e===t||e.code===t.code&&e.size===t.size&&E(e.bytes,t.bytes);class ep{constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}}let ev=({name:e,code:t,encode:n})=>new em(e,t,n);class em{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}async digest(e){if(e instanceof Uint8Array){let t=await this.encode(e);return eh(this.code,t)}throw Error("Unknown type, must be binary type")}}let ey=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),eC=ev({name:"sha2-256",code:18,encode:ey("SHA-256")}),eO=ev({name:"sha2-512",code:19,encode:ey("SHA-512")}),eb=ev({name:"identity",code:0,encode:e=>R(e)}),ew=e=>R(e),{name:e_,code:eE,encode:eR,decode:eN}={name:"raw",code:85,decode:ew,encode:ew},{name:eS,code:eT,encode:eA,decode:eD}={name:"json",code:512,encode:e=>new TextEncoder().encode(JSON.stringify(e)),decode:e=>JSON.parse(new TextDecoder().decode(e))};class eP{constructor(e,t,n,r){this.code=t,this.version=e,this.multihash=n,this.bytes=r,this.byteOffset=r.byteOffset,this.byteLength=r.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:eX,byteLength:eX,code:eW,version:eW,multihash:eW,bytes:eW,_baseCache:eX,asCID:eX})}toV0(){if(0===this.version)return this;{let{code:e,multihash:t}=this;if(e!==ex)throw Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==eM)throw Error("Cannot convert non sha2-256 multihash CID to CIDv0");return eP.createV0(t)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=eh(e,t);return eP.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&eg(this.multihash,e.multihash)}toString(e){let{bytes:t,version:n,_baseCache:r}=this;return 0===n?eK(t,r,e||et.encoder):ek(t,r,e||J.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return ej(/^0\.0/,eB),!!(e&&(e[eU]||e.asCID===e))}get toBaseEncodedString(){throw Error("Deprecated, use .toString()")}get codec(){throw Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw Error('"multibaseName" property is deprecated')}get prefix(){throw Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof eP)return e;if(null!=e&&e.asCID===e){let{version:t,code:n,multihash:r,bytes:o}=e;return new eP(t,n,r,o||eL(t,n,r.bytes))}if(null==e||!0!==e[eU])return null;{let{version:t,multihash:n,code:r}=e,o=ef(n);return eP.create(t,r,o)}}static create(e,t,n){if("number"!=typeof t)throw Error("String codecs are no longer supported");switch(e){case 0:if(t===ex)return new eP(e,t,n,n.bytes);throw Error(`Version 0 CID must use dag-pb (code: ${ex}) block encoding`);case 1:{let r=eL(e,t,n.bytes);return new eP(e,t,n,r)}default:throw Error("Invalid version")}}static createV0(e){return eP.create(0,ex,e)}static createV1(e,t){return eP.create(1,e,t)}static decode(e){let[t,n]=eP.decodeFirst(e);
9if(n.length)throw Error("Incorrect length");return t}static decodeFirst(e){let t=eP.inspectBytes(e),n=t.size-t.multihashSize,r=R(e.subarray(n,n+t.multihashSize));if(r.byteLength!==t.multihashSize)throw Error("Incorrect length");let o=r.subarray(t.multihashSize-t.digestSize),i=new ep(t.multihashCode,t.digestSize,o,r);return[0===t.version?eP.createV0(i):eP.createV1(t.codec,i),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[n,r]=el(e.subarray(t));return t+=r,n},r=n(),o=ex;if(18===r?(r=0,t=0):1===r&&(o=n()),0!==r&&1!==r)throw RangeError(`Invalid CID version ${r}`);let i=t,a=n(),s=n(),c=t+s;return{version:r,codec:o,multihashCode:a,digestSize:s,multihashSize:c-i,size:c}}static parse(e,t){let[n,r]=eI(e,t),o=eP.decode(r);return o._baseCache.set(n,e),o}}let eI=(e,t)=>{switch(e[0]){case"Q":return[et.prefix,(t||et).decode(`${et.prefix}${e}`)];case et.prefix:return[et.prefix,(t||et).decode(e)];case J.prefix:return[J.prefix,(t||J).decode(e)];default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},eK=(e,t,n)=>{let{prefix:r}=n;if(r!==et.prefix)throw Error(`Cannot string encode V0 in ${n.name} encoding`);let o=t.get(r);if(null!=o)return o;{let o=n.encode(e).slice(1);return t.set(r,o),o}},ek=(e,t,n)=>{let{prefix:r}=n,o=t.get(r);if(null!=o)return o;{let o=n.encode(e);return t.set(r,o),o}},ex=112,eM=18,eL=(e,t,n)=>{let r=ed(e),o=r+ed(t),i=new Uint8Array(o+n.byteLength);return eu(e,i,0),eu(t,i,r),i.set(n,o),i},eU=Symbol.for("@ipld/js-cid/CID"),eW={writable:!1,configurable:!1,enumerable:!0},eX={writable:!1,enumerable:!1,configurable:!1},ej=(e,t)=>{if(e.test("0.0.0-dev"))console.warn(t);else throw Error(t)},eB=`CID.isCID(v) is deprecated and will be removed in the next major release. 10Following code pattern: 11 12if (CID.isCID(value)) { 13 doSomethingWithCID(value) 14} 15 16Is replaced with: 17 18const cid = CID.asCID(value) 19if (cid) { 20 // Make sure to use cid instead of value 21 doSomethingWithCID(cid) 22} 23`,eH={...o,...i,...a,...s,...c,...l,...u,...d,...h},eJ={...v,...m},eq={raw:y,json:C}},46749:function(e,t,n){"use strict";n.d(t,{OKXTonConnectUI:function(){return ah},OKX_UI_CONNECTION_AND_TRANSACTION_EVENT:function(){return aa}});var r,o,i,a,s,c,l,u,d,h,f,g=n(98134),p=n(11589),v=n(42238),m=n(93967),y=n(9996),C=n(88196),O=n(34155),b=Object.defineProperty,w=Object.defineProperties,_=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,S=(e,t,n)=>t in e?b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>
23{for(var n in t||(t={}))R.call(t,n)&&S(e,n,t[n]);if(E)for(var n of E(t))N.call(t,n)&&S(e,n,t[n]);return e},A=(e,t)=>w(e,_(t)),D=(e,t,n)=>(S(e,"symbol"!=typeof t?t+"":t,n),n),P=(e,t,n)=>new Promise((r,o)=>{var i=e=>{try{s(n.next(e))}catch(e){o(e)}},a=e=>{try{s(n.throw(e))}catch(e){o(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,a);s((n=n.apply(e,t)).next())}),I=((r=I||{}).DARK="DARK",r.LIGHT="LIGHT",r);class K extends g.OKXConnectError{constructor(e){super(1,e)}}let k={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return x(this.context.count)},getNextContextId(){return x(this.context.count++)}};function x(e){let t=String(e),n=t.length-1;return k.context.id+(n?String.fromCharCode(96+n):"")+t}let M=Symbol("solid-proxy"),L="function"==typeof Proxy,U=Symbol("solid-track"),W={equals:(e,t)=>e===t},X=eu,j={owned:null,cleanups:null,context:null,owner:null};var B=null;let H=null,J=null,q=null,F=0;function $(e,t){let n=H,r=B,o=0===e.length,i=void 0===t?r:t,a=o?j:{owned:null,cleanups:null,context:i?i.context:null,owner:i};B=a,H=null;try{return el(o?e:()=>e(()=>Y(()=>ef(a))),!0)}finally{H=n,B=r}}function V(e,t){let n={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},W,t):W).equals||void 0};return[eo.bind(n),e=>("function"==typeof e&&(e=e(n.value)),ei(n,e))]}function G(e,t,n){ea(es(e,t,!1,1))}function z(e,t,n){X=ed;let r=es(e,t,!1,1);n&&n.render||(r.user=!0),q?q.push(r):ea(r)}function Q(e,t,n){n=n?Object.assign({},W,n):W;let r=es(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ea(r),eo.bind(r)}function Y(e){if(null===H)return e();let t=H;H=null;try{return e()}finally{H=t}}function Z(e){z(()=>Y(e))}function ee(e){return null===B||(null===B.cleanups?B.cleanups=[e]:B.cleanups.push(e)),e}function et(e,t){let n=Symbol("context");return{id:n,Provider:function(e){let t;return G(()=>t=Y(()=>(B.context=A(T({},B.context),{[n]:e.value}),er(()=>e.children))),void 0),t},defaultValue:e}}function en(e){let t;return B&&B.context&&void 0!==(t=B.context[e.id])?t:e.defaultValue}function er(e){let t=Q(e),n=Q(()=>(function e(t){if("function"==typeof t&&!t.length)return e(t());if(Array.isArray(t)){let n=[];for(let r=0;r<t.length;r++){let o=e(t[r]);Array.isArray(o)?n.push.apply(n,o):n.push(o)}return n}return t})(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:null!=e?[e]:[]},n}function eo(){if(this.sources&&this.state){if(1===this.state)ea(this);else{let e=J;J=null,el(()=>eh(this),!1),J=e}}if(H){let e=this.observers?this.observers.length:0;H.sources?(H.sources.push(this),H.sourceSlots.push(e)):(H.sources=[this],H.sourceSlots=[e]),this.observers?(this.observers.push(H),this.observerSlots.push(H.sources.length-1)):(this.observers=[H],this.observerSlots=[H.sources.length-1])}return this.value}function ei(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&el(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t];n.state||(n.pure?J.push(n):q.push(n),n.observers&&function e(t){for(let n=0;n<t.observers.length;n+=1){let r=t.observers[n];!r.state&&(r.state=2,r.pure?J.push(r):q.push(r),r.observers&&e(r))}}(n)),n.state=1}if(J.length>1e6)throw J=[],Error()},!1)),t}function ea(e){if(!e.fn)return;ef(e);let t=F;!function(e,t,n){let r;let o=B,i=H;H=B=e;try{r=e.fn(t)}catch(t){return e.pure&&(e.state=1,e.owned&&e.owned.forEach(ef),e.owned=null),e.updatedAt=n+1,eg(t)}finally{H=i,B=o}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?ei(e,r):e.value=r,e.updatedAt=n)}(e,e.value,t)}function es(e,t,n,r=1,o){let i={fn:e,state:r,updatedAt:null,owned:null,sources:null,
23sourceSlots:null,cleanups:null,value:t,owner:B,context:B?B.context:null,pure:n};return null===B||B!==j&&(B.owned?B.owned.push(i):B.owned=[i]),i}function ec(e){if(0===e.state)return;if(2===e.state)return eh(e);if(e.suspense&&Y(e.suspense.inFallback))return e.suspense.effects.push(e);let t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<F);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(1===(e=t[n]).state)ea(e);else if(2===e.state){let n=J;J=null,el(()=>eh(e,t[0]),!1),J=n}}function el(e,t){if(J)return e();let n=!1;t||(J=[]),q?n=!0:q=[],F++;try{let t=e();return function(e){if(J&&(eu(J),J=null),e)return;let t=q;q=null,t.length&&el(()=>X(t),!1)}(n),t}catch(e){n||(q=null),J=null,eg(e)}}function eu(e){for(let t=0;t<e.length;t++)ec(e[t])}function ed(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:ec(r)}for(t=0;t<n;t++)ec(e[t])}function eh(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){let r=e.sources[n];if(r.sources){let e=r.state;1===e?r!==t&&(!r.updatedAt||r.updatedAt<F)&&ec(r):2===e&&eh(r,t)}}}function ef(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),o=t.observerSlots.pop();n<r.length&&(e.sourceSlots[o]=n,r[n]=e,t.observerSlots[n]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)ef(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)ef(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function eg(e,t=B){throw e instanceof Error?e:Error("string"==typeof e?e:"Unknown error",{cause:e})}let ep=Symbol("fallback");function ev(e){for(let t=0;t<e.length;t++)e[t]()}function em(e,t){return Y(()=>e(t||{}))}function ey(){return!0}let eC={get:(e,t,n)=>t===M?n:e.get(t),has:(e,t)=>t===M||e.has(t),set:ey,deleteProperty:ey,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:ey,deleteProperty:ey}),ownKeys:e=>e.keys()};function eO(e){return(e="function"==typeof e?e():e)?e:{}}function eb(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(void 0!==t)return t}}function ew(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t=t||!!r&&M in r,e[n]="function"==typeof r?(t=!0,Q(r)):r}if(L&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=eO(e[n])[t];if(void 0!==r)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in eO(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(eO(e[n])));return[...new Set(t)]}},eC);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let o=e[t];if(!o)continue;let i=Object.getOwnPropertyNames(o);for(let e=i.length-1;e>=0;e--){let t=i[e];if("__proto__"===t||"constructor"===t)continue;let a=Object.getOwnPropertyDescriptor(o,t);if(r[t]){let e=n[t];e&&(a.get?e.push(a.get.bind(o)):void 0!==a.value&&e.push(()=>a.value))}else r[t]=a.get?{enumerable:!0,configurable:!0,get:eb.bind(n[t]=[a.get.bind(o)])}:void 0!==a.value?a:void 0}}let o={},i=Object.keys(r);for(let e=i.length-1;e>=0;e--){let t=i[e],n=r[t];n&&n.get?Object.defineProperty(o,t,n):o[t]=n?n.value:void 0}return o}function e_(e,...t){if(L&&M in e){let n=new Set(t.length>1?t.flat():t[0]),r=t.map(t=>new Proxy({get:n=>t.includes(n)?e[n]:void 0,has:n=>t.includes(n)&&n in e,keys:()=>t.filter(t=>t in e)},eC));return r.push(new Proxy({get:t=>n.has(t)?void 0:e[t],has:t=>!n.has(t)&&t in e,keys:()=>Object.keys(e).filter(e=>!n.has(e))},eC)),r}let n={},r=t.map(()=>({}));for(let o of Object.getOwnPropertyNames(e)){let i=Object.getOwnPropertyDescriptor(e,o),a=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable,s=!1,c=0;for(let e of t)e.includes(o)&&(s=!0,a?r[c][o]=i.value:Object.defineProperty(r[c],o,i)),++c;s||(a?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}let eE=e=>`Stale read from <${e}>.`;function eR(e){return Q(function(e,t,n={}){let r=[],o=[],i=[],a=0,s=t.length>1?[]:null;return ee(()=>ev(i)),()=>{let c=e()||[],l=c.length,u,d;return c[U],Y(()=>{let e,t,f,g,p,v,m,y,C;if(0===l)0!==a&&(ev(i),i=[],r=[],o=[],a=0,s&&(s=[])),n.fallback&&(r=[ep],o[0]=$(e=>(i[0]=e,n.fallback())),a=1);else if(0===a){for(d=0,o=Array(l);d<l;d++)r[d]=c[d],o[d]=$(h);a=l}else{for(f=Array(l),g=Array(l),s&&(p=Array(l)),v=0,m=Math.min(a,l);v<m&&r[v]===c[v];v++);for(m=a-1,y=l-1;m>=v&&y>=v&&r[m]===c[y];m--,y--)f[y]=o[m],g[y]=i[m],s&&(p[y]=s[m]);for(e=new Map,t=Array(y+1),d=y;d>=v;d--)C=c[d],u=e.get(C),t[d]=void 0===u?-1:u,e.set(C,d);for(u=v;u<=m;u++)C=r[u],void 0!==(d=e.get(C))&&-1!==d?(f[d]=o[u],g[d]=i[u],s&&(p[d]=s[u]),d=t[d],e.set(C,d)):i[u]();for(d=v;d<l;d++)d in f?(o[d]=f[d],i[d]=g[d],s&&(s[d]=p[d],s[d](d))):o[d]=$(h);o=o.slice(0,a=l),r=c.slice(0)}return o}
23);function h(e){if(i[d]=e,s){let[e,n]=V(d);return s[d]=n,t(c[d],e)}return t(c[d])}}}(()=>e.each,e.children,"fallback"in e&&{fallback:()=>e.fallback}||void 0))}function eN(e){let t=e.keyed,n=Q(()=>e.when,void 0,{equals:(e,n)=>t?e===n:!e==!n});return Q(()=>{let r=n();if(r){let o=e.children;return"function"==typeof o&&o.length>0?Y(()=>o(t?r:()=>{if(!Y(n))throw eE("Show");return e.when})):o}return e.fallback},void 0,void 0)}function eS(e){let t=!1,n=er(()=>e.children),r=Q(()=>{let e=n();Array.isArray(e)||(e=[e]);for(let n=0;n<e.length;n++){let r=e[n].when;if(r)return t=!!e[n].keyed,[n,r,e[n]]}return[-1]},void 0,{equals:(e,n)=>(t?e[1]===n[1]:!e[1]==!n[1])&&e[2]===n[2]});return Q(()=>{let[n,o,i]=r();if(n<0)return e.fallback;let a=i.children;return"function"==typeof a&&a.length>0?Y(()=>a(t?o:()=>{if(Y(r)[0]!==n)throw eE("Match");return i.when})):a},void 0,void 0)}function eT(e){return e}let eA=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline","allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"]),eD=new Set(["innerHTML","textContent","innerText","children"]),eP=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),eI=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}}),eK=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ek=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),ex={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},eM="_$DX_DELEGATE";function eL(e,t,n,r={}){let o;return $(r=>{o=r,t===document?e():eH(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function eU(e,t,n){let r;let o=()=>{let t=document.createElement("template");return t.innerHTML=e,n?t.content.firstChild.firstChild:t.content.firstChild},i=t?()=>Y(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function eW(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function eX(e,t){null==t?e.removeAttribute("class"):e.className=t}function ej(e,t={},n,r){let o={};return r||G(()=>o.children=e$(e,t.children,o.children)),G(()=>"function"==typeof t.ref&&eB(t.ref,e)),G(()=>(function(e,t,n,r,o={},i=!1){for(let r in t||(t={}),o)if(!(r in t)){if("children"===r)continue;o[r]=eq(e,r,null,o[r],n,i,t)}for(let a in t){if("children"===a){r||e$(e,t.children);continue}let s=t[a];o[a]=eq(e,a,s,o[a],n,i,t)}})(e,t,n,!0,o,!0)),o}function eB(e,t,n){return Y(()=>e(t,n))}function eH(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return e$(e,t,r,n);G(r=>e$(e,t(),r,n),r)}function eJ(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,o=r.length;t<o;t++)e.classList.toggle(r[t],n)}function eq(e,t,n,r,o,i,a){var s,c;let l,u,d,h,f;if("style"===t)return function(e,t,n){let r,o;if(!t)return n?eW(e,"style"):t;let i=e.style;if("string"==typeof t)return i.cssText=t;for(o in"string"==typeof n&&(i.cssText=n=void 0),n||(n={}),t||(t={}),n)null==t[o]&&i.removeProperty(o),delete n[o];for(o in t)(r=t[o])!==n[o]&&(i.setProperty(o,r),n[o]=r);return n}(e,n,r);if("classList"===t)return function(e,t,n={}){let r,o;let i=Object.keys(t||{}),a=Object.keys(n);for(r=0,o=a.length;r<o;r++){let o=a[r];o&&"undefined"!==o&&!t[o]&&(eJ(e,o,!1),delete n[o])}for(r=0,o=i.length;r<o;r++){let o=i[r],a=!!t[o];o&&"undefined"!==o&&n[o]!==a&&a&&(eJ(e,o,!0),n[o]=a)}return n}(e,n,r);if(n===r)return r;if("ref"===t)i||n(e);else if("on:"===t.slice(0,3)){let o=t.slice(3);r&&e.removeEventListener(o,r,"function"!=typeof r&&r),n&&e.addEventListener(o,n,"function"!=typeof n&&n)}else if("oncapture:"===t.slice(0,10)){let o=t.slice(10);r&&e.removeEventListener(o,r,!0),n&&e.addEventListener(o,n,!0)}else if("on"===t.slice(0,2)){let o=t.slice(2).toLowerCase(),i=eK.has(o);if(!i&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(o,t)}(i||n)&&(!function(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,"function"!=typeof n&&n)}(e,o,n,i),i&&function(e,t=window.document){let n=t[eM]||(t[eM]=new Set);for(let r=0,o=e.length;r<o;r++){let o=e[r];
23n.has(o)||(n.add(o),t.addEventListener(o,eF))}}([o]))}else if("attr:"===t.slice(0,5))eW(e,t.slice(5),n);else if("bool:"===t.slice(0,5))s=t.slice(5),n?e.setAttribute(s,""):e.removeAttribute(s);else if((f="prop:"===t.slice(0,5))||(d=eD.has(t))||!o&&((h=function(e,t){let n=eI[e];return"object"==typeof n?n[t]?n.$:void 0:n}(t,e.tagName))||(u=eA.has(t)))||(l=e.nodeName.includes("-")||"is"in a))(f&&(t=t.slice(5),u=!0),"class"===t||"className"===t)?eX(e,n):!l||u||d?e[h||t]=n:e[t.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]=n;else{let r=o&&t.indexOf(":")>-1&&ex[t.split(":")[0]];r?(c=t,null==n?e.removeAttributeNS(r,c):e.setAttributeNS(r,c,n)):eW(e,eP[t]||t,n)}return n}function eF(e){let t=e.target,n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),a=()=>{let r=t[n];if(r&&!t.disabled){let o=t[`${n}Data`];if(void 0!==o?r.call(t,o,e):r.call(t,e),e.cancelBubble)return}return t.host&&"string"!=typeof t.host&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},s=()=>{for(;a()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>t||document}),e.composedPath){let n=e.composedPath();i(n[0]);for(let e=0;e<n.length-2&&(t=n[e],a());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===o)break}}else s();i(r)}function e$(e,t,n,r,o){for(;"function"==typeof n;)n=n();if(t===n)return n;let i=typeof t,a=void 0!==r;if(e=a&&n[0]&&n[0].parentNode||e,"string"===i||"number"===i){if("number"===i&&(t=t.toString())===n)return n;if(a){let o=n[0];o&&3===o.nodeType?o.data!==t&&(o.data=t):o=document.createTextNode(t),n=eG(e,n,r,o)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===i)n=eG(e,n,r);else if("function"===i)return G(()=>{let o=t();for(;"function"==typeof o;)o=o();n=e$(e,o,n,r)}),()=>n;else if(Array.isArray(t)){let i=[],s=n&&Array.isArray(n);if(function e(t,n,r,o){let i=!1;for(let a=0,s=n.length;a<s;a++){let s=n[a],c=r&&r[t.length],l;if(null==s||!0===s||!1===s);else if("object"==(l=typeof s)&&s.nodeType)t.push(s);else if(Array.isArray(s))i=e(t,s,c)||i;else if("function"===l){if(o){for(;"function"==typeof s;)s=s();i=e(t,Array.isArray(s)?s:[s],Array.isArray(c)?c:[c])||i}else t.push(s),i=!0}else{let e=String(s);c&&3===c.nodeType&&c.data===e?t.push(c):t.push(document.createTextNode(e))}}return i}(i,t,n,o))return G(()=>n=e$(e,i,n,r,!0)),()=>n;if(0===i.length){if(n=eG(e,n,r),a)return n}else s?0===n.length?eV(e,i,r):function(e,t,n){let r=n.length,o=t.length,i=r,a=0,s=0,c=t[o-1].nextSibling,l=null;for(;a<o||s<i;){if(t[a]===n[s]){a++,s++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===a){let t=i<r?s?n[s-1].nextSibling:n[i-s]:c;for(;s<i;)e.insertBefore(n[s++],t)}else if(i===s)for(;a<o;)l&&l.has(t[a])||t[a].remove(),a++;else if(t[a]===n[i-1]&&n[s]===t[o-1]){let r=t[--o].nextSibling;e.insertBefore(n[s++],t[a++].nextSibling),e.insertBefore(n[--i],r),t[o]=n[i]}else{if(!l){l=new Map;let e=s;for(;e<i;)l.set(n[e],e++)}let r=l.get(t[a]);if(null!=r){if(s<r&&r<i){let c=a,u=1,d;for(;++c<o&&c<i&&null!=(d=l.get(t[c]))&&d===r+u;)u++;if(u>r-s){let o=t[a];for(;s<r;)e.insertBefore(n[s++],o)}else e.replaceChild(n[s++],t[a++])}else a++}else t[a++].remove()}}}(e,n,i):(n&&eG(e),eV(e,i));n=i}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=eG(e,n,r,t);eG(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}return n}function eV(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function eG(e,t,n,r){if(void 0===n)return e.textContent="";let o=r||document.createTextNode("");if(t.length){let r=!1;for(let i=t.length-1;i>=0;i--){let a=t[i];if(o!==a){let t=a.parentNode===e;r||i?t&&a.remove():t?e.replaceChild(o,a):e.insertBefore(o,n)}else r=!0}}else e.insertBefore(o,n);return[o]}function ez(e,t=!1){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}function eQ(e){let t;let{useShadow:n}=e,r=document.createTextNode(""),o=()=>e.mount||document.body,i=B;return z(()=>{t||(t=function(e,t){let n=B,r=H;B=e,H=null;try{return el(t,!0)}catch(e){eg(e)}finally{B=n,H=r}}(i,()=>Q(()=>e.children)));let a=o();if(a instanceof HTMLHeadElement){let[e,n]=V(!1);$(n=>eH(a,()=>e()?n():t(),null)),ee(()=>n(!0))}else{let o=ez(e.isSVG?"g":"div",e.isSVG),i=n&&o.attachShadow?o.attachShadow({mode:"open"}):o;Object.defineProperty(o,"_$host",{get:()=>r.parentNode,configurable:!0}),eH(i,t),a.appendChild(o),e.ref&&e.ref(o),ee(()=>a.removeChild(o))}},void 0,{render:!k.context}),r}function eY(e){let[t,n]=e_(e,["component"]),r=Q(()=>t.component);return Q(()=>{let e=r();switch(typeof e){case"function":return Y(()=>e(n));case"string":let t=ek.has(e),o=ez(e,t);return ej(o,n,t),o}})}let eZ={data:""},e0=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||eZ,e1=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,e2=/\/\*[^]*?\*\/| +/g,e5=/\n+/g,e3=(e,t)=>
23{let n="",r="",o="";for(let i in e){let a=e[i];"@"==i[0]?"i"==i[1]?n=i+" "+a+";":r+="f"==i[1]?e3(a,i):i+"{"+e3(a,"k"==i[1]?"":t)+"}":"object"==typeof a?r+=e3(a,t?t.replace(/([^,])+/g,e=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):i):null!=a&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=e3.p?e3.p(i,a):i+":"+a+";")}return n+(t&&o?t+"{"+o+"}":o)+r},e6={},e4=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+e4(e[n]);return t}return e},e8=(e,t,n,r,o)=>{var i;let a=e4(e),s=e6[a]||(e6[a]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(a));if(!e6[s]){let t=a!==e?e:(e=>{let t,n,r=[{}];for(;t=e1.exec(e.replace(e2,""));)t[4]?r.shift():t[3]?(n=t[3].replace(e5," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(e5," ").trim();return r[0]})(e);e6[s]=e3(o?{["@keyframes "+s]:t}:t,n?"":"."+s)}let c=n&&e6.g?e6.g:null;return n&&(e6.g=e6[s]),i=e6[s],c?t.data=t.data.replace(c,i):-1===t.data.indexOf(i)&&(t.data=r?i+t.data:t.data+i),s},e9=(e,t,n)=>e.reduce((e,r,o)=>{let i=t[o];if(i&&i.call){let e=i(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;i=t?"."+t:e&&"object"==typeof e?e.props?"":e3(e,""):!1===e?"":e}return e+r+(null==i?"":i)},"");function e7(e){let t=this||{},n=e.call?e(t.p):e;return e8(n.unshift?n.raw?e9(n,[].slice.call(arguments,1),t.p):n.reduce((e,n)=>Object.assign(e,n&&n.call?n(t.p):n),{}):n,e0(t.target),t.g,t.o,t.k)}e7.bind({g:1});let te=e7.bind({k:1}),tt=et();function tn(e){return em(tt.Provider,{value:e.theme,get children(){return e.children}})}function tr(){return en(tt)}function to(e){let t=this||{};return(...n)=>{let r=r=>{let o;let i=ew(r,{theme:en(tt)}),[a,s]=e_(ew(i,{get class(){let e=i.class,r="class"in i&&/^go[0-9]+/.test(e);return[e,e7.apply({target:t.target,o:r,p:i,g:t.g},n)].filter(Boolean).join(" ")}}),["as","theme"]),c=a.as||e;return"function"==typeof c?o=c(s):1==t.g?ej(o=document.createElement(c),s):o=eY(ew({component:c},s)),o};return r.class=e=>Y(()=>e7.apply({target:t.target,p:e,g:t.g},n)),r}}let ti=new Proxy(to,{get:(e,t)=>e(t)});function ta(){let e=to.call({g:1},"div").apply(null,arguments);return function(t){return e(t),null}}let ts="okxc-root",tc="okxc-disable-scroll",tl="okxc-using-mouse",tu=()=>(document.body.addEventListener("mousedown",()=>document.body.classList.add(tl)),document.body.addEventListener("keydown",e=>{"Tab"===e.key&&document.body.classList.remove(tl)}),em(ta` 24 ${ts} * { 25 margin: 0; 26 padding: 0; 27 box-sizing: border-box; 28 29 font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, Tahoma, Verdana, sans-serif; 30 -webkit-font-smoothing: antialiased; 31 -moz-osx-font-smoothing: grayscale; 32 -webkit-tap-highlight-color: transparent; 33 } 34 35 ${ts} img { 36 -webkit-user-select: none; 37 -webkit-touch-callout: none; 38 } 39 40 ${ts} *:focus { 41 outline: #08f auto 2px; 42 } 43 44 ${ts} li { 45 list-style: none; 46 } 47 48 ${ts} button { 49 outline: none; 50 } 51 52 body.${tc} { 53 position: fixed; 54 overflow-y: scroll; 55 right: 0; 56 left: 0; 57 } 58 59 body.${tl} ${ts} *:focus { 60 outline: none; 61 } 62`,{}));function td(e,t){return"#"===e[0]&&(e=function(e){"#"===e[0]&&(e=e.slice(1));let t=parseInt(e,16);return[t>>16&255,t>>8&255,255&t].join(",")}(e)),`rgba(${e}, ${t})`}function th(e){return e.toString()+"px"}let tf=class{constructor(){D(this,"storage",{})}static getInstance(){return tf.instance||(tf.instance=new tf),tf.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return null!=(t=this.storage[e])?t:null}key(e){var t;let n=Object.keys(this.storage);return e<0||e>=n.length?null:null!=(t=n[e])?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}};function tg(...e){(0,g.logDebug)(e)}D(tf,"instance");let tp={};try{let e=location.hash.toString();tp=function(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(0>e.indexOf("=")&&0>e.indexOf("?"))return t._path=tO(e),t;let n=e.indexOf("?");if(n>=0){let r=e.substr(0,n);t._path=tO(r),e=e.substr(n+1)}let r=function(e){let t,n,r,o,i={};if(!e.length)return i;let a=e.split("&");for(t=0;t<a.length;t++)r=tO((n=a[t].split("="))[0]),o=null==n[1]?null:tO(n[1]),i[r]=o;return i}(e);for(let e in r)t[e]=r[e];return t}(e)}catch(e){}let tv="unknown";if((null==tp?void 0:tp.tgWebAppPlatform)&&(tv=null!=(s=tp.tgWebAppPlatform)?s:"unknown"),"unknown"===tv){let e=ni();tv=null!=(u=null==(l=null==(c=null==e?void 0:e.Telegram)?void 0:c.WebApp)?void 0:l.platform)?u:"unknown"}let tm="6.0";if((null==tp?void 0:tp.tgWebAppVersion)&&(tm=tp.tgWebAppVersion),!tm){let e=ni();tm=null!=(f=null==(h=null==(d=null==e?void 0:e.Telegram)?void 0:d.WebApp)?void 0:h.version)?f:"6.0"}function ty(){var e;return"unknown"!==tv||!!(null==(e=ni())?void 0:e.TelegramWebviewProxy)}function tC(){!function(e,t){try{let n=ni();if(!n)throw new K("Can't post event to parent window: window is not defined");if(void 0!==n.TelegramWebviewProxy)tg("postEvent",e,t),n.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(n.external&&"notify"in n.external)tg("postEvent",e,t),n.external.notify(JSON.stringify({eventType:e,eventData:t}));else if(function(){try{let e=ni();if(!e)return!1;return null!=e.parent&&e!==e.parent}catch(e){return!1}}()){let r=JSON.stringify({eventType:e,eventData:t});tg("postEvent",e,t),n.parent.postMessage(r,"*")}else throw new K("Can't post event to TMA")}catch(e){!function(...e){(0,g.logError)(e)}(`Can't post event to parent window: ${e}`)}}("web_app_expand",{})}function tO(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch(t){return e}}let tb={mobile:440,tablet:1020};function tw(e){var t;let n=ni();if(!n)return"desktop"===e;if(function(...e){return e.includes(tv)}("weba"))return!0;let r=n.innerWidth;
62switch(e){case"desktop":return r>tb.tablet;case"tablet":return r>tb.mobile;default:let o=r<=tb.mobile||function(...e){return e.includes(ns().os)}("ios","android","ipad");if(o){let e=!!(null==(t=ni())?void 0:t.TelegramWebviewProxy),n=navigator.maxTouchPoints||0;e&&0===n&&(o=!1),(0,g.logDebug)("isDevice mobile isTelegram and maxTouchPoints:",o,e,n)}return o}}function t_(e){switch(e){case"mobile":return`@media (max-width: ${tb.mobile}px)`;case"tablet":return`@media (max-width: ${tb.tablet}px) (min-width: ${tb.mobile}px)`;default:return`@media (min-width: ${tb.tablet}px)`}}let tE="@media (hover: none)",tR="@media not all and (hover: none)",[tN,tS]=V(tw("mobile")),tT=()=>tS(tw("mobile"));ni()&&(window.addEventListener("resize",()=>tT()),window.addEventListener("load",()=>tT(),{once:!0}));let tA=Symbol("store-raw"),tD=Symbol("store-node"),tP=Symbol("store-has"),tI=Symbol("store-self");function tK(e){let t=e[M];if(!t&&(Object.defineProperty(e,M,{value:t=new Proxy(e,tW)}),!Array.isArray(e))){let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){let i=n[o];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(t)})}}return t}function tk(e){let t;return null!=e&&"object"==typeof e&&(e[M]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function tx(e,t=new Set){let n,r,o,i;if(n=null!=e&&e[tA])return n;if(!tk(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,i=e.length;n<i;n++)(r=tx(o=e[n],t))!==o&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let n=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let s=0,c=n.length;s<c;s++)a[i=n[s]].get||(r=tx(o=e[i],t))===o||(e[i]=r)}return e}function tM(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function tL(e,t,n){if(e[t])return e[t];let[r,o]=V(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function tU(e){H&&tL(tM(e,tD),tI)()}let tW={get(e,t,n){if(t===tA)return e;if(t===M)return n;if(t===U)return tU(e),n;let r=tM(e,tD),o=r[t],i=o?o():e[t];if(t===tD||t===tP||"__proto__"===t)return i;if(!o){let n=Object.getOwnPropertyDescriptor(e,t);H&&("function"!=typeof i||e.hasOwnProperty(t))&&!(n&&n.get)&&(i=tL(r,t,i)())}return tk(i)?tK(i):i},has:(e,t)=>t===tA||t===M||t===U||t===tD||t===tP||"__proto__"===t||(H&&tL(tM(e,tP),t)(),t in e),set:()=>!0,deleteProperty:()=>!0,ownKeys:function(e){return tU(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return n&&!n.get&&n.configurable&&t!==M&&t!==tD&&(delete n.value,delete n.writable,n.get=()=>e[M][t]),n}};function tX(e,t,n,r=!1){if(!r&&e[t]===n)return;let o=e[t],i=e.length;void 0===n?(delete e[t],e[tP]&&e[tP][t]&&void 0!==o&&e[tP][t].$()):(e[t]=n,e[tP]&&e[tP][t]&&void 0===o&&e[tP][t].$());let a=tM(e,tD),s;if((s=tL(a,t,o))&&s.$(()=>n),Array.isArray(e)&&e.length!==i){for(let t=e.length;t<i;t++)(s=a[t])&&s.$();(s=tL(a,"length",i))&&s.$(e.length)}(s=a[tI])&&s.$()}function tj(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let o=n[r];tX(e,o,t[o])}}function tB(...[e,t]){let n=tx(e||{}),r=Array.isArray(n);return[tK(n),function(...e){el(()=>{r&&1===e.length?function(e,t){if("function"==typeof t&&(t=t(e)),Array.isArray(t=tx(t))){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let r=t[n];e[n]!==r&&tX(e,n,r)}tX(e,"length",r)}else tj(e,t)}(n,e[0]):function e(t,n,r=[]){let o,i=t;if(n.length>1){let a=typeof(o=n.shift()),s=Array.isArray(t);if(Array.isArray(o)){for(let i=0;i<o.length;i++)e(t,[o[i]].concat(n),r);return}if(s&&"function"===a){for(let i=0;i<t.length;i++)o(t[i],i)&&e(t,[i].concat(n),r);return}if(s&&"object"===a){let{from:i=0,to:a=t.length-1,by:s=1}=o;for(let o=i;o<=a;o+=s)e(t,[o].concat(n),r);return}if(n.length>1){e(t[o],n,[o].concat(r));return}i=t[o],r=[o].concat(r)}let a=n[0];("function"!=typeof a||(a=a(i,r))!==i)&&(void 0!==o||void 0!=a)&&(a=tx(a),void 0===o||tk(i)&&tk(a)&&!Array.isArray(a)?tj(i,a):tX(t,o,a))}(n,e)},!1)}]}let[tH,tJ]=tB({language:"en_US"}),[tq,tF]=tB({buttonRootId:null,language:"en_US"});function t$(e,t){return!!t&&(e.name.toLowerCase()===t.toLowerCase()||e.appName.toLowerCase()===t.toLowerCase())}function tV(){return function(){var e;let t=!!(null==(e=ni())?void 0:e.TelegramWebview);return(ty()||t)&&"unknown"===tv}()||ty()}
62let tG=[g.NameSpaceKeySui,g.NameSpaceKeySOL,g.NameSpaceKeyEip155,g.NameSpaceKeyTON,g.NameSpaceKeyBtc,g.NameSpaceKeyAptos,g.NameSpaceKeyTron,g.NameSpaceKeyStarknet,g.NameSpaceKeyCosmos],tz=[g.NameSpaceKeyEip155,g.NameSpaceKeySOL,g.NameSpaceKeyTON,g.NameSpaceKeySui],tQ=[g.NameSpaceKeySOL],tY=[g.SOLANA_CHAINS.MAINNET];function tZ(e,t){return!!tV()&&t2(e)&&t2(t)}function t0(e,t){if(!e)return!0;for(let[n,r]of Object.entries(e)){if(tQ.includes(n)){if(r.chains.some(e=>!tY.includes(e)))return!1}else if(!tz.includes(n))return!1;if(!function(e,t){switch(e){case g.NameSpaceKeySui:if(tN())return t9("6.103.0");break;case g.NameSpaceKeyTON:if(!t||!t.manifestUrl)return!1;if(tN())return t9("6.103.0")}return!0}(n,t))return!1}return!0}function t1(e=!0){var t,n,r,o;let i=e?tH.walletConnector:tq.walletConnector;if(!i){(0,g.logWarning)("not find connector yet");return}for(let c of i)switch(c.getTag()){case g.OKX_TG_WALLET:if(e){var a=null==(t=tH.connectRequestParameters)?void 0:t.namespaces,s=null==(n=tH.connectRequestParameters)?void 0:n.optionalNamespaces;c.enable=tZ(a,s)}else c.enable=!0;break;case g.OKX_APP_WALLET:c.enable=!0;break;case g.OKX_INJECT_WALLET:if(e){var a=null==(r=tH.connectRequestParameters)?void 0:r.namespaces,s=null==(o=tH.connectRequestParameters)?void 0:o.optionalNamespaces;c.enable=t0(a,tH.dappMetaData)&&t0(s,tH.dappMetaData)}else c.enable=!0}}function t2(e){try{if(!e)return!0;return Object.keys(e).every(e=>tG.includes(e))}catch(e){return!1}}function t5(e){return!!e&&e.name===(0,g.creatOKXWalletInfo)().name}function t3(e,t){(0,g.logDebug)("wallets openWallet"),e&&(t5(e)?((0,g.logDebug)("wallets openWallet openOKXDeeplinkWithFallback"),(0,g.openOKXDeeplink)(g.standardDeeplink)):((0,g.logDebug)("wallets openWallet openOKXTMAWalletlinkWithFallback"),(0,g.openOKXTMAWalletlinkWithFallback)((0,g.getTelegramWalletTWAUrl)(void 0,t))))}function t6(e,t){return!("qrcode"===t||t4(e))}function t4(e){return!!e&&e.name===(0,g.creatOKXInjectWalletInfo)().name}function t8(){try{if(tN())return t9("6.102.0");return!!window.okxwallet}catch(e){return!1}}function t9(e){let t=window.okxwallet;if(!t)return!1;{let n=t.appVersion;return(0,g.versionCompare)(n,e)>=0}}function t7(){return tN()&&!!window.okxwallet}function ne(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?I.LIGHT:I.DARK}function nt(e){let t=t=>e(t.matches?I.DARK:I.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}function nn(){document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart","")}function nr(){document.body.getElementsByTagName(ts)||customElements.define(ts,class extends HTMLElement{})}function no(e){return P(this,null,function*(){yield new Promise(e=>requestAnimationFrame(e)),e()})}function ni(){if("undefined"!=typeof window)return window}function na(){if(function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}())return localStorage;if(void 0!==O&&null!=O.versions&&null!=O.versions.node)throw new K("`localStorage` is unavailable, but it is required for TonConnect");return tf.getInstance()}function ns(){var e,t,n;let r,o;let i=new v().getResult(),a=null==(e=i.os.name)?void 0:e.toLowerCase(),s=null==(t=i.device.model)?void 0:t.toLowerCase();switch(!0){case"ipad"===s:r="ipad";break;case"ios"===a:r="ios";break;case"android"===a:r="android";break;case"mac os"===a:r="macos";break;case"linux"===a:r="linux";break;case null==a?void 0:a.includes("windows"):r="windows"}let c=null==(n=i.browser.name)?void 0:n.toLowerCase();switch(!0){case"chrome"===c:o="chrome";break;case"firefox"===c:o="firefox";break;case null==c?void 0:c.includes("safari"):o="safari";break;case null==c?void 0:c.includes("opera"):o="opera"}return{os:r,browser:o}}class nc{constructor(e){D(this,"localStorage"),D(this,"storageKey","okx-wallet-connect-ui_wallet-info"),this.localStorage=na(),this.storageKey=e}setWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getWalletInfo(){let e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeWalletInfo(){this.localStorage.removeItem(this.storageKey)}}class nl{constructor(){D(this,"localStorage"),D(this,"storageKey","okx_wallet_connect_ui_last-selected-wallet-info"),this.localStorage=na()}setLastSelectedWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getLastSelectedWalletInfo(){let e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeLastSelectedWalletInfo(){this.localStorage.removeItem(this.storageKey)}}let[nu,nd]=V({status:"closed",closeReason:null});Q(()=>"opened"===nu().status);let[nh,nf]=V({status:"closed",closeReason:null}),ng=Q(()=>"opened"===nh().status),np=Q(()=>{let e=nh();return"opened"===e.status?e.walletInfo:null}),nv="undefined"!=typeof window?new nl:void 0,[nm,ny]=V((null==nv?void 0:nv.getLastSelectedWalletInfo())||null),nC=e=>{nv||(nv=new nl),e?(tg(`modals-state.ts: setLastSelectedWalletInfo ${JSON.stringify(e)}`),nv.setLastSelectedWalletInfo(e)):(tg("modals-state.ts: setLastSelectedWalletInfo removeLastSelectedWalletInfo"),nv.removeLastSelectedWalletInfo()),ny(e)},[nO,nb]=V(null),nw=ti.div` 63 background-color: ${e=>e.theme.colors.background.secondary}; 64`,n_=e=>{let t;let[n,r]=V(null);return z(()=>{let t=new window.Image;return(t.src=e.src,t.alt=e.alt||"",t.setAttribute("draggable","false"),e.class&&t.classList.add(e.class),t.complete)?r(t):(t.addEventListener("load",()=>r(t)),()=>t.removeEventListener("load",()=>r(t)))}),[em(eN,{get when(){return n()},get children(){return n()}}),em(eN,{get when(){return!n()},get children(){return em(nw,{get class(){return e.class},ref(e){var n=t;"function"==typeof n?n(e):t=e}})}})]},nE={m:"100vh",s:"8px",none:"0"},nR={s:.02,m:.04},nN=ti.button` 65 display: ${e=>
65e.leftIcon||e.rightIcon?"flex":"inline-block"}; 66 gap: ${e=>e.leftIcon||e.rightIcon?"4px":"unset"}; 67 align-items: ${e=>e.leftIcon||e.rightIcon?"center":"unset"}; 68 justify-content: ${e=>e.leftIcon||e.rightIcon?"space-between":"unset"}; 69 background-color: ${e=>"flat"===e.appearance?"transparent":"secondary"===e.appearance?e.theme.colors.background.tint:td(e.theme.colors.accent,.12)}; 70 color: ${e=>"secondary"===e.appearance?e.theme.colors.text.primary:e.theme.colors.accent}; 71 72 padding: ${e=>"flat"===e.appearance?"0":"9px 16px"}; 73 padding-left: ${e=>e.leftIcon&&"flat"!==e.appearance?"12px":"16px"}; 74 padding-right: ${e=>e.rightIcon&&"flat"!==e.appearance?"12px":"16px"}; 75 border: none; 76 border-radius: ${e=>nE[e.theme.borderRadius]}; 77 cursor: ${e=>e.disabled?"not-allowed":"pointer"}; 78 79 font-size: 14px; 80 font-weight: 510; 81 line-height: 18px; 82 83 transition: transform 0.125s ease-in-out; 84 85 ${tR} { 86 &:hover { 87 transform: ${e=>e.disabled?"unset":`scale(${1+nR[e.scale]})`}; 88 } 89 } 90 91 &:active { 92 transform: ${e=>e.disabled?"unset":`scale(${1-nR[e.scale]})`}; 93 } 94 95 ${tE} { 96 &:active { 97 transform: ${e=>e.disabled?"unset":`scale(${1-2*nR[e.scale]})`}; 98 } 99 } 100`;function nS(e){let t=Y(()=>Object.keys(e).filter(e=>e.startsWith("data-"))),[n]=e_(e,t);return n}let nT=e=>{let t=nS(e);return em(nN,ew({get appearance(){return e.appearance||"primary"},get class(){return e.class},onClick:t=>{var n;return null==(n=e.onClick)?void 0:n.call(e,t)},onMouseEnter:t=>{var n;return null==(n=e.onMouseEnter)?void 0:n.call(e,t)},onMouseLeave:t=>{var n;return null==(n=e.onMouseLeave)?void 0:n.call(e,t)},ref(t){var n=e.ref;"function"==typeof n?n(t):e.ref=t},get disabled(){return e.disabled},get scale(){return e.scale||"m"},get leftIcon(){return!!e.leftIcon},get rightIcon(){return!!e.rightIcon},"data-tc-button":"true"},t,{get children(){return[Q(()=>e.leftIcon),Q(()=>e.children),Q(()=>e.rightIcon)]}}))};function nA(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let nD=e=>{let t;let n=!0,[r,o]=V(),[i,a]=V(),s=er(()=>e.children),{onBeforeEnter:c,onEnter:l,onAfterEnter:u,onBeforeExit:d,onExit:h,onAfterExit:f}=e,g=Q(()=>{let t=e.name||"s";
100return{enterActiveClass:e.enterActiveClass||t+"-enter-active",enterClass:e.enterClass||t+"-enter",enterToClass:e.enterToClass||t+"-enter-to",exitActiveClass:e.exitActiveClass||t+"-exit-active",exitClass:e.exitClass||t+"-exit",exitToClass:e.exitToClass||t+"-exit-to"}});function p(t,s){if(!n||e.appear){let n=function(c){t&&(!c||c.target===t)&&(t.removeEventListener("transitionend",n),t.removeEventListener("animationend",n),t.classList.remove(...h),t.classList.remove(...f),el(()=>{r()!==t&&o(t),i()===t&&a(void 0)},!1),u&&u(t),"inout"===e.mode&&v(t,s))},d=g().enterClass.split(" "),h=g().enterActiveClass.split(" "),f=g().enterToClass.split(" ");c&&c(t),t.classList.add(...d),t.classList.add(...h),nA(()=>{t.classList.remove(...d),t.classList.add(...f),l&&l(t,()=>n()),(!l||l.length<2)&&(t.addEventListener("transitionend",n),t.addEventListener("animationend",n))})}s&&!e.mode?a(t):o(t)}function v(t,n){let i=g().exitClass.split(" "),a=g().exitActiveClass.split(" "),s=g().exitToClass.split(" ");if(!n.parentNode)return c();
100function c(i){i&&i.target!==n||(n.removeEventListener("transitionend",c),n.removeEventListener("animationend",c),n.classList.remove(...a),n.classList.remove(...s),r()===n&&o(void 0),f&&f(n),"outin"===e.mode&&p(t,n))}d&&d(n),n.classList.add(...i),n.classList.add(...a),nA(()=>{n.classList.remove(...i),n.classList.add(...s)}),h&&h(n,()=>c()),(!h||h.length<2)&&(n.addEventListener("transitionend",c),n.addEventListener("animationend",c))}return ea(es(r=>{for(t=s();"function"==typeof t;)t=t();return Y(()=>(t&&t!==r&&("outin"!==e.mode?p(t,r):n&&o(t)),r&&r!==t&&"inout"!==e.mode&&v(t,r),n=!1,t))},void 0,!0,1)),[r,i]},nP="androidBackHandler",nI={[nP]:!0};var nK=eU('<svg><path fill-rule=evenodd clip-rule=evenodd d="M10.2122 14.3407C10.5384 14.0854 10.5959 13.614 10.3406 13.2878L6.20237 8.00003L10.3406 2.71227C10.5959 2.38607 10.5384 1.91469 10.2122 1.6594C9.88604 1.40412 9.41465 1.46161 9.15937 1.7878L4.65937 7.5378C4.44688 7.80932 4.44688 8.19074 4.65937 8.46226L9.15937 14.2123C9.41465 14.5385 9.88604 14.5959 10.2122 14.3407Z"></svg>',!1,!0);let nk={left:0,top:90,right:180,bottom:270},nx=e=>{let t=tr(),n=()=>e.fill||t.colors.icon.secondary,r=()=>e.direction||"left";return em(ti("svg")` 101 transform: rotate(${e=>nk[e.svgDirection]}deg); 102 transition: transform 0.1s ease-in-out; 103 `,{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",get svgDirection(){return r()},get children(){var o=nK();return G(()=>eW(o,"fill",n())),o}})};var nM=eU('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M18.5303 6.53033C18.8232 6.23744 18.8232 5.76256 18.5303 5.46967C18.2374 5.17678 17.7626 5.17678 17.4697 5.46967L12 10.9393L6.53033 5.46967C6.23744 5.17678 5.76256 5.17678 5.46967 5.46967C5.17678 5.76256 5.17678 6.23744 5.46967 6.53033L10.9393 12L5.46967 17.4697C5.17678 17.7626 5.17678 18.2374 5.46967 18.5303C5.76256 18.8232 6.23744 18.8232 6.53033 18.5303L12 13.0607L17.4697 18.5303C17.7626 18.8232 18.2374 18.8232 18.5303 18.5303C18.8232 18.2374 18.8232 17.7626 18.5303 17.4697L13.0607 12L18.5303 6.53033Z">');let nL=e=>{var t,n;let r=tr();tg(`CloseIcon ${r}`);let o=()=>e.fill||r.colors.icon.secondary;return n=(t=nM()).firstChild,G(()=>eW(n,"fill",o())),t};var nU=eU('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path fill-rule=evenodd clip-rule=evenodd d="M14.1839 17.7069C13.6405 18.6507 13.3688 19.1226 13.0591 19.348C12.4278 19.8074 11.5723 19.8074 10.941 19.348C10.6312 19.1226 10.3595 18.6507 9.81613 17.7069L5.52066 10.2464C4.76864 8.94024 4.39263 8.28717 4.33762 7.75894C4.2255 6.68236 4.81894 5.65591 5.80788 5.21589C6.29309 5 7.04667 5 8.55383 5H15.4462C16.9534 5 17.7069 5 18.1922 5.21589C19.1811 5.65591 19.7745 6.68236 19.6624 7.75894C19.6074 8.28717 19.2314 8.94024 18.4794 10.2464L14.1839 17.7069ZM11.1 16.3412L6.56139 8.48002C6.31995 8.06185 6.19924 7.85276 6.18146 7.68365C6.14523 7.33896 6.33507 7.01015 6.65169 6.86919C6.80703 6.80002 7.04847 6.80002 7.53133 6.80002H7.53134L11.1 6.80002V16.3412ZM12.9 16.3412L17.4387 8.48002C17.6801 8.06185 17.8008 7.85276 17.8186 7.68365C17.8548 7.33896 17.665 7.01015 17.3484 6.86919C17.193 6.80002 16.9516 6.80002 16.4687 6.80002L12.9 6.80002V16.3412Z">');let nW=e=>{var t,n;let r=tr(),o=()=>e.fill||r.colors.icon.primary;return n=(t=nU()).firstChild,G(()=>eW(n,"fill",o())),t};var nX=eU('<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 viewBox="0 0 16 16"fill=none><g clip-path=url(#clip0_3783_2045)><circle cx=8 cy=8.00098 r=8></circle><path d="M4.75 8.50098L7 10.751L11.75 6.00098"stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path></g><defs><clipPath id=clip0_3783_2045><rect width=16 height=16 fill=white transform="translate(0 0.000976562)">'),nj=eU('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><circle cx=12 cy=12 r=11></circle><path d="M17.1364 9.6364C17.4879 9.28493 17.4879 8.71508 17.1364 8.36361C16.7849 8.01214 16.2151 8.01214 15.8636 8.36361L10 14.2272L8.1364 12.3636C7.78493 12.0121 7.21508 12.0121 6.86361 12.3636C6.51214 12.7151 6.51214 13.2849 6.86361 13.6364L9.36361 16.
1031364C9.71508 16.4879 10.2849 16.4879 10.6364 16.1364L17.1364 9.6364Z">'),nB=eU('<svg width=72 height=72 viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><circle cx=36 cy=36 r=33></circle><path d="M50.9142 28.4142C51.6953 27.6332 51.6953 26.3668 50.9142 25.5858C50.1332 24.8047 48.8668 24.8047 48.0858 25.5858L30 43.6716L23.9142 37.5858C23.1332 36.8047 21.8668 36.8047 21.0858 37.5858C20.3047 38.3668 20.3047 39.6332 21.0858 40.4142L28.5858 47.9142C29.3668 48.6953 30.6332 48.6953 31.4142 47.9142L50.9142 28.4142Z">');let nH=e=>{let t=tr(),n=()=>e.size||"s",r=()=>e.fill||t.colors.icon.success;return Q(()=>{var o,i,a,s,c,l,u,d,h;return Q(()=>"xs"===n())()?(a=(i=(o=nX()).firstChild.firstChild).nextSibling,G(n=>{var s=e.class,c=r(),l=t.colors.constant.white;return s!==n.e&&eW(o,"class",n.e=s),c!==n.t&&eW(i,"fill",n.t=c),l!==n.a&&eW(a,"stroke",n.a=l),n},{e:void 0,t:void 0,a:void 0}),o):Q(()=>"s"===n())()?(l=(c=(s=nj()).firstChild).nextSibling,G(n=>{var o=e.class,i=r(),a=t.colors.constant.white;return o!==n.e&&eW(s,"class",n.e=o),i!==n.t&&eW(c,"fill",n.t=i),a!==n.a&&eW(l,"fill",n.a=a),n},{e:void 0,t:void 0,a:void 0}),s):(h=(d=(u=nB()).firstChild).nextSibling,G(n=>{var o=e.class,i=r(),a=t.colors.constant.white;return o!==n.e&&eW(u,"class",n.e=o),i!==n.t&&eW(d,"fill",n.t=i),a!==n.a&&eW(h,"fill",n.a=a),n},{e:void 0,t:void 0,a:void 0}),u)})};var nJ=eU('<svg xmlns=http://www.w3.org/2000/svg width=103 height=102 viewBox="0 0 103 102"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M51.5 14.8747C31.5487 14.8747 15.375 31.0485 15.375 50.9997C15.375 70.951 31.5487 87.1247 51.5 87.1247C71.4513 87.1247 87.625 70.951 87.625 50.9997C87.625 31.0485 71.4513 14.8747 51.5 14.8747ZM9 50.9997C9 27.5276 28.0279 8.49974 51.5 8.49974C74.9721 8.49974 94 27.5276 94 50.9997C94 74.4718 74.9721 93.4997 51.5 93.4997C28.0279 93.4997 9 74.4718 9 50.9997ZM65.0234 37.4765C66.2682 38.7213 66.2682 40.7395 65.0234 41.9843L56.0078 50.9999L65.0234 60.0155C66.2682 61.2603 66.2682 63.2785 65.0234 64.5233C63.7786 65.7681 61.7604 65.7681 60.5156 64.5233L51.5 55.5077L42.4844 64.5233C41.2396 65.7681 39.2214 65.7681 37.9766 64.5233C36.7318 63.2785 36.7318 61.2603 37.9766 60.0155L46.9922 50.9999L37.9766 41.9843C36.7318 40.7395 36.7318 38.7213 37.9766 37.4765C39.2214 36.2317 41.2396 36.2317 42.4844 37.4765L51.5 46.4921L60.5156 37.4765C61.7604 36.2317 63.7787 36.2317 65.0234 37.4765Z"fill=#909090>'),nq=eU('<svg xmlns=http://www.w3.org/2000/svg width=72 height=72 viewBox="0 0 103 102"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M51.5 14.8747C31.5487 14.8747 15.375 31.0485 15.375 50.9997C15.375 70.951 31.5487 87.1247 51.5 87.1247C71.4513 87.1247 87.625 70.951 87.625 50.9997C87.625 31.0485 71.4513 14.8747 51.5 14.8747ZM9 50.9997C9 27.5276 28.0279 8.49974 51.5 8.49974C74.9721 8.49974 94 27.5276 94 50.9997C94 74.4718 74.9721 93.4997 51.5 93.4997C28.0279 93.4997 9 74.4718 9 50.9997ZM65.0234 37.4765C66.2682 38.7213 66.2682 40.7395 65.0234 41.9843L56.0078 50.9999L65.0234 60.0155C66.2682 61.2603 66.2682 63.2785 65.0234 64.5233C63.7786 65.7681 61.7604 65.7681 60.5156 64.5233L51.5 55.5077L42.4844 64.5233C41.2396 65.7681 39.2214 65.7681 37.9766 64.5233C36.7318 63.2785 36.7318 61.2603 37.9766 60.0155L46.9922 50.9999L37.9766 41.9843C36.7318 40.7395 36.7318 38.7213 37.9766 37.4765C39.2214 36.2317 41.2396 36.2317 42.4844 37.4765L51.5 46.4921L60.5156 37.4765C61.7604 36.2317 63.7787 36.2317 65.0234 37.4765Z"fill=#909090>'),nF=eU('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 103 102"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M51.5 14.8747C31.5487 14.8747 15.375 31.0485 15.375 50.9997C15.375 70.951 31.5487 87.1247 51.5 87.1247C71.4513 87.1247 87.625 70.951 87.625 50.9997C87.625 31.0485 71.4513 14.8747 51.5 14.8747ZM9 50.9997C9 27.5276 28.0279 8.49974 51.5 8.49974C74.9721 8.49974 94 27.5276 94 50.9997C94 74.4718 74.9721 93.4997 51.5 93.4997C28.0279 93.4997 9 74.4718 9 50.9997ZM65.0234 37.4765C66.2682 38.7213 66.2682 40.7395 65.0234 41.9843L56.0078 50.9999L65.0234 60.0155C66.2682 61.2603 66.2682 63.2785 65.0234 64.5233C63.7786 65.7681 61.7604 65.7681 60.5156 64.5233L51.5 55.5077L42.4844 64.5233C41.2396 65.7681 39.2214 65.7681 37.9766 64.5233C36.7318 63.2785 36.7318 61.2603 37.9766 60.0155L46.9922 50.9999L37.9766 41.9843C36.7318 40.7395 36.7318 38.7213 37.9766 37.4765C39.2214 36.2317 41.2396 36.2317 42.4844 37.4765L51.5 46.4921L60.5156 37.4765C61.7604 36.2317 63.7787 36.2317 65.0234 37.4765Z"fill=#909090>');let n$=e=>{tr();let t=()=>e.size||"m";return Q(()=>Q(()=>"m"===t())()?nJ():Q(()=>"s"===t())()?nq():nF())};var nV=eU('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15.55 5.85123C18.9459 7.81184 20.1094 12.1541 18.1488 15.55C16.1882 18.9459 11.8459 20.1094 8.44998 18.1488C8.01952 17.9003 7.46909 18.0478 7.22056 18.4782C6.97203 18.9087 7.11952 19.4591 7.54998 19.7076C11.8068 22.1653 17.2499 20.7068 19.7076 16.45C22.1653 12.1932 20.7068 6.75005 16.45 4.29239C12.1932 1.83472 6.75003 3.29321 4.29236 7.55001C4.04383 7.98047 4.19132 8.53091 4.62178 8.77943C5.05224 9.02796 5.60268 8.88048 5.8512 8.45001C7.81181 5.05413
10312.1541 3.89062 15.55 5.85123Z">'),nG=eU('<svg xmlns=http://www.w3.org/2000/svg width=44 height=44 viewBox="0 0 44 44"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M22 2.99951C11.5066 2.99951 3 11.5061 3 21.9995C3 32.4929 11.5066 40.9995 22 40.9995C22.8284 40.9995 23.5 41.6711 23.5 42.4995C23.5 43.3279 22.8284 43.9995 22 43.9995C9.84974 43.9995 0 34.1498 0 21.9995C0 9.84925 9.84974 -0.000488281 22 -0.000488281C34.1503 -0.000488281 44 9.84925 44 21.9995C44 22.8279 43.3284 23.4995 42.5 23.4995C41.6716 23.4995 41 22.8279 41 21.9995C41 11.5061 32.4934 2.99951 22 2.99951Z">'),nz=eU('<svg width=72 height=72 viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><path d="M24 56.7846C35.479 63.412 50.1572 59.479 56.7846 47.9999C63.412 36.5209 59.479 21.8427 48 15.2153C36.521 8.58791 21.8428 12.5209 15.2154 23.9999"stroke-width=4 stroke-linecap=round stroke-linejoin=round>');let nQ=e=>{let t=tr(),n=()=>e.size||"xs",r=()=>e.fill||t.colors.icon.tertiary,o=te` 104 0% { 105 transform: rotate(0deg); 106 } 107 100% { 108 transform: rotate(360deg); 109 } 110 `,i=e7` 111 animation: ${o} 1s linear infinite; 112 `;return Q(()=>{var t,o,a,s,c,l;return Q(()=>"xs"===n())()?(o=(t=nV()).firstChild,G(n=>{var a=m(i,e.class),s=r();return a!==n.e&&eW(t,"class",n.e=a),s!==n.t&&eW(o,"fill",n.t=s),n},{e:void 0,t:void 0}),t):Q(()=>"s"===n())()?(s=(a=nG()).firstChild,G(t=>{var n=m(i,e.class),o=r();return n!==t.e&&eW(a,"class",t.e=n),o!==t.t&&eW(s,"fill",t.t=o),t},{e:void 0,t:void 0}),a):(l=(c=nz()).firstChild,G(t=>{var n=m(i,e.class),o=r();return n!==t.e&&eW(c,"class",t.e=n),o!==t.t&&eW(l,"stroke",t.t=o),t},{e:void 0,t:void 0}),c)})};var nY=eU('<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 viewBox="0 0 16 16"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M5.56608 4.42584C5.82527 3.32158 6.8176 2.5 8.00001 2.5C9.38072 2.5 10.5 3.61929 10.5 5C10.5 5.63026 10.3391 6.0386 10.1264 6.34455C9.90018 6.66993 9.58561 6.92478 9.18864 7.20877C9.12579 7.25372 9.05873 7.30025 8.9887 7.34883C8.27392 7.84472 7.25001 8.55507 7.25001 10V10.25C7.25001 10.6642 7.5858 11 8.00001 11C8.41422 11 8.75001 10.6642 8.75001 10.25V10C8.75001 9.36502 9.10777 9.1096 9.94554 8.51149L10.0614 8.42873C10.4769 8.13147 10.9748 7.75194 11.358 7.20076C11.7547 6.63015 12 5.91973 12 5C12 2.79086 10.2091 1 8.00001 1C6.10564 1 4.5205 2.31615 4.10577 4.08308C4.01112 4.48634 4.26129 4.88997 4.66454 4.98462C5.0678 5.07927 5.47143 4.8291 5.56608 4.42584ZM8.00001 15C8.60752 15 9.10001 14.5075 9.10001 13.9C9.10001 13.2925 8.60752 12.8 8.00001 12.8C7.39249 12.8 6.90001 13.2925 6.90001 13.9C6.90001 14.5075 7.39249 15 8.00001 15Z">');let nZ=e=>{var t,n;let r=tr(),o=()=>e.fill||r.colors.icon.secondary;return n=(t=nY()).firstChild,G(()=>eW(n,"fill",o())),t};var n0=eU('<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 viewBox="0 0 16 16"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M3.56176 1.87482C3.8379 1.87482 4.06176 2.09867 4.06176 2.37482V3.69674C5.09916 2.7469 6.48174 2.16666 7.99996 2.16666C11.2216 2.16666 13.8333 4.77834 13.8333 8C13.8333 11.2217 11.2216 13.8333 7.99996 13.8333C4.7783 13.8333 2.16663 11.2217 2.16663 8C2.16663 7.72385 2.39048 7.5 2.66663 7.5C2.94277 7.5 3.16663 7.72385 3.16663 8C3.16663 10.6694 5.33058 12.8333 7.99996 12.8333C10.6693 12.8333 12.8333 10.6694 12.8333 8C12.8333 5.33062 10.6693 3.16666 7.99996 3.16666C6.68645 3.16666 5.49513 3.69037 4.62354 4.54148H6.22843C6.50457 4.54148 6.72843 4.76534 6.72843 5.04148C6.72843 5.31763 6.50457 5.54148 6.22843 5.54148H3.56176C3.28562 5.54148 3.06176 5.31763 3.06176 5.04148V2.37482C3.06176 2.09867 3.28562 1.87482 3.56176 1.87482Z">');let n1=e=>{var t,n;let r=tr();return n=(t=n0()).firstChild,G(()=>eW(n,"fill",r.colors.text.primary)),t};var n2=eU('<svg xmlns=http://www.w3.org/2000/svg width=16 height=17 viewBox="0 0 16 17"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M1 4.12695C1 3.07754 1 2.55284 1.19202 2.14684C1.38986 1.72856 1.7266 1.39181 2.14489 1.19397C2.55088 1.00195 3.07559 1.00195 4.125 1.00195C5.17441 1.00195 5.69912 1.00195 6.10511 1.19397C6.5234 1.39181 6.86014 1.72856 7.05798 2.14684C7.25 2.55284 7.25 3.07754 7.25 4.12695C7.25 5.17636 7.25 5.70107 7.05798 6.10706C6.86014 6.52535 6.5234 6.8621 6.10511 7.05993C5.69912 7.25195 5.17441 7.25195 4.125 7.25195C3.07559 7.25195 2.55088 7.25195 2.14489 7.05993C1.7266 6.8621 1.38986 6.52535 1.19202 6.10706C1 5.70107 1 5.17636 1 4.12695ZM2.5 3.30195C2.5 3.02193 2.5 2.88191 2.5545 2.77496C2.60243 2.68088 2.67892 2.60439 2.773 2.55645C2.87996 2.50195 3.01997 2.50195 3.3 2.50195H4.95C5.23003 2.50195 5.37004 2.50195 5.477 2.55645C5.57108 2.60439 5.64757 2.68088 5.6955 2.77496C5.75 2.88191 5.75 3.02193 5.75 3.30195V4.95195C5.75 5.23198 5.75 5.37199 5.6955 5.47895C5.64757 5.57303 5.57108 5.64952 5.477 5.69746C5.37004 5.75195 5.23003 5.75195 4.95 5.75195H3.3C3.01997 5.75195 2.87996 5.75195 2.773 5.69746C2.67892 5.64952 2.60243 5.57303 2.5545 5.47895C2.5 5.37199 2.5 5.23198 2.5 4.95195V3.3
1120195ZM1 11.877C1 10.8275 1 10.3028 1.19202 9.89684C1.38986 9.47856 1.7266 9.14181 2.14489 8.94397C2.55088 8.75195 3.07559 8.75195 4.125 8.75195C5.17441 8.75195 5.69912 8.75195 6.10511 8.94397C6.5234 9.14181 6.86014 9.47856 7.05798 9.89684C7.25 10.3028 7.25 10.8275 7.25 11.877C7.25 12.9264 7.25 13.4511 7.05798 13.8571C6.86014 14.2753 6.5234 14.6121 6.10511 14.8099C5.69912 15.002 5.17441 15.002 4.125 15.002C3.07559 15.002 2.55088 15.002 2.14489 14.8099C1.7266 14.6121 1.38986 14.2753 1.19202 13.8571C1 13.4511 1 12.9264 1 11.877ZM2.5 11.052C2.5 10.7719 2.5 10.6319 2.5545 10.525C2.60243 10.4309 2.67892 10.3544 2.773 10.3064C2.87996 10.252 3.01997 10.252 3.3 10.252H4.95C5.23003 10.252 5.37004 10.252 5.477 10.3064C5.57108 10.3544 5.64757 10.4309 5.6955 10.525C5.75 10.6319 5.75 10.7719 5.75 11.052V12.702C5.75 12.982 5.75 13.122 5.6955 13.2289C5.64757 13.323 5.57108 13.3995 5.477 13.4475C5.37004 13.502 5.23003 13.502 4.95 13.502H3.3C3.01997 13.502 2.87996 13.502 2.773 13.4475C2.67892 13.3995 2.60243 13.323 2.5545 13.2289C2.5 13.122 2.5 12.982 2.5 12.702V11.052ZM8.94202 2.14684C8.75 2.55284 8.75 3.07754 8.75 4.12695C8.75 5.17636 8.75 5.70107 8.94202 6.10706C9.13986 6.52535 9.4766 6.8621 9.89489 7.05993C10.3009 7.25195 10.8256 7.25195 11.875 7.25195C12.9244 7.25195 13.4491 7.25195 13.8551 7.05993C14.2734 6.8621 14.6101 6.52535 14.808 6.10706C15 5.70107 15 5.17636 15 4.12695C15 3.07754 15 2.55284 14.808 2.14684C14.6101 1.72856 14.2734 1.39181 13.8551 1.19397C13.4491 1.00195 12.9244 1.00195 11.875 1.00195C10.8256 1.00195 10.3009 1.00195 9.89489 1.19397C9.4766 1.39181 9.13986 1.72856 8.94202 2.14684ZM10.3045 2.77496C10.25 2.88191 10.25 3.02193 10.25 3.30195V4.95195C10.25 5.23198 10.25 5.37199 10.3045 5.47895C10.3524 5.57303 10.4289 5.64952 10.523 5.69746C10.63 5.75195 10.77 5.75195 11.05 5.75195H12.7C12.98 5.75195 13.12 5.75195 13.227 5.69746C13.3211 5.64952 13.3976 5.57303 13.4455 5.47895C13.5 5.37199 13.5 5.23198 13.5 4.95195V3.30195C13.5 3.02193 13.5 2.88191 13.4455 2.77496C13.3976 2.68088 13.3211 2.60439 13.227 2.55645C13.12 2.50195 12.98 2.50195 12.7 2.50195H11.05C10.77 2.50195 10.63 2.50195 10.523 2.55645C10.4289 2.60439 10.3524 2.68088 10.3045 2.77496ZM8.80727 9.13518C8.75 9.26242 8.75 9.4256 8.75 9.75195C8.75 10.0783 8.75 10.2415 8.80727 10.3687C8.87245 10.5136 8.9884 10.6295 9.13323 10.6947C9.26047 10.752 9.42365 10.752 9.75 10.752C10.0764 10.752 10.2395 10.752 10.3668 10.6947C10.5116 10.6295 10.6276 10.5136 10.6927 10.3687C10.75 10.2415 10.75 10.0783 10.75 9.75195C10.75 9.4256 10.75 9.26242 10.6927 9.13518C10.6276 8.99035 10.5116 8.8744 10.3668 8.80922C10.2395 8.75195 10.0764 8.75195 9.75 8.75195C9.42365 8.75195 9.26047 8.75195 9.13323 8.80922C8.9884 8.8744 8.87245 8.99035 8.80727 9.13518ZM10.87 11.8771C10.87 11.546 10.87 11.3805 10.9289 11.2517C10.9938 11.1098 11.1077 10.9959 11.2497 10.931C11.3784 10.8721 11.5439 10.8721 11.875 10.8721C12.2061 10.8721 12.3716 10.8721 12.5003 10.931C12.6423 10.9959 12.7562 11.1098 12.8211 11.2517C12.88 11.3805 12.88 11.546 12.88 11.8771C12.88 12.2081 12.88 12.3737 12.8211 12.5024C12.7562 12.6444 12.6423 12.7583 12.5003 12.8232C12.3716 12.8821 12.2061 12.8821 11.875 12.8821C11.5439 12.8821 11.3784 12.8821 11.2497 12.8232C11.1077 12.7583 10.9938 12.6444 10.9289 12.5024C10.87 12.3737 10.87 12.2081 10.87 11.8771ZM8.80727 13.3852C8.75 13.5124 8.75 13.6756 8.75 14.002C8.75 14.3283 8.75 14.4915 8.80727 14.6187C8.87245 14.7636 8.9884 14.8795 9.13323 14.9447C9.26047 15.002 9.42365 15.002 9.75 15.002C10.0764 15.002 10.2395 15.002 10.3668 14.9447C10.5116 14.8795 10.6276 14.7636 10.6927 14.6187C10.75 14.4915 10.75 14.3283 10.75 14.002C10.75 13.6756 10.75 13.5124 10.6927 13.3852C10.6276 13.2404 10.5116 13.1244 10.3668 13.0592C10.2395 13.002 10.0764 13.002 9.75 13.002C9.42365 13.002 9.26047 13.002 9.13323 13.0592C8.9884 13.1244 8.87245 13.2404 8.80727 13.3852ZM13 9.75195C13 9.4256 13 9.26242 13.0573 9.13518C13.1224 8.99035 13.2384 8.8744 13.3832 8.80922C13.5105 8.75195 13.6736 8.75195 14 8.75195C14.3264 8.75195 14.4895 8.75195 14.6168 8.80922C14.7616 8.8744 14.8776 8.99035 14.9427 9.13518C15 9.26242 15 9.4256 15 9.75195C15 10.0783 15 10.2415 14.9427 10.3687C14.8776 10.5136 14.7616 10.6295 14.6168 10.6947C14.4895 10.752 14.3264 10.752 14 10.752C13.6736 10.752 13.5105 10.752 13.3832 10.6947C13.2384 10.6295 13.1224 10.5136 13.0573 10.3687C13 10.2415 13 10.0783 13 9.75195ZM13.0573 13.3852C13 13.5124 13 13.6756 13 14.002C13 14.3283 13 14.4915 13.0573 14.6187C13.1224 14.7636 13.2384 14.8795 13.3832 14.9447C13.5105 15.002 13.6736 15.002 14 15.002C14.3264 15.002 14.4895 15.002 14.6168 14.9447C14.7616 14.8795 14.8776 14.7636 14.9427 14.6187C15 14.4915 15 14.3283 15 14.002C15 13.6756 15 13.5124 14.9427 13.3852C14.8776 13.2404 14.7616 13.1244 14.6168 13.0592C14.4895 13.002 14.3264 13.002 14 13.002C13.6736 13.002 13.5105 13.002 13.3832 13.0592C13.2384 13.1244 13.1224 13.2404 13.0573 13.3852Z">');let n5=e=>{var t,n;let r=tr(),o=()=>e.fill||r.colors.icon.secondary;return n=(t=n2()).firstChild,G(()=>eW(n,"fill",o())),t},n3=ti.button` 113 padding: 0; 114 display: flex; 115 justify-content: center;
116 align-items: center; 117 width: 32px; 118 height: 32px; 119 border-radius: 50%; 120 background-color: transparent; 121 border: none; 122 cursor: pointer; 123 124 transition: transform 0.125s ease-in-out; 125 126 ${tR} { 127 &:hover { 128 transform: scale(1.04); 129 } 130 } 131 132 &:active { 133 transform: scale(0.96); 134 } 135 136 ${tE} { 137 &:active { 138 transform: scale(0.92); 139 } 140 } 141`,n6=e=>{let t=nS(e),n=()=>e.icon||"close";return em(n3,ew({get class(){return e.class},onClick:()=>e.onClick(),"data-tc-icon-button":"true"},t,{get children(){return[em(eN,{get when(){return!!e.children},get children(){return e.children}}),em(eN,{get when(){return!e.children},get children(){return em(eS,{get children(){return[em(eT,{get when(){return"close"===n()},get children(){return em(nL,{get fill(){return e.fill}})}}),em(eT,{get when(){return"arrow"===n()},get children(){return em(nx,{get fill(){return e.fill}})}}),em(eT,{get when(){return"question"===n()},get children(){return em(nZ,{get fill(){return e.fill}})}}),em(eT,{get when(){return"string"!=typeof n()},get children(){return n()}})]}})}})]}}))},n4={m:"24px",s:"16px",none:"0"},n8=ti.div` 142 display: flex; 143 position: fixed; 144 z-index: 1000; 145 left: 0; 146 top: 0; 147 width: 100%; 148 height: 100%; 149 background-color: rgba(0, 0, 0, 0.4); 150 padding: 20px 0; 151 overflow-y: auto; 152 153 ${t_("mobile")} { 154 padding-bottom: 0; 155 } 156`,n9=e7` 157 box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 16px 64px rgba(0, 0, 0, 0.16); 158 width: fit-content; 159 margin: auto; 160 161 ${t_("mobile")} { 162 width: 100%; 163 height: fit-content; 164 margin: auto 0 0 0; 165 } 166`,n7=ti.div` 167 position: relative; 168 min-height: 100px; 169 width: 416px; 170 padding: 44px 56px 24px; 171 172 box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.04); 173 174 background-color: ${e=>e.theme.colors.background.primary}; 175 border-radius: ${e=>n4[e.theme.borderRadius]}; 176 177 ${t_("mobile")} { 178 width: 100%; 179 border-radius: 24px 24px 0px 0px; 180 } 181`,re=ti(n6)` 182 position: absolute; 183 right: 16px; 184 top: 12px; 185`;ti.div` 186 display: flex; 187 justify-content: space-between; 188 align-items: center; 189 padding: 16px 16px 16px 18px; 190 border-radius: 0 0 ${e=>n4[e.theme.borderRadius]} 191 ${e=>n4[e.theme.borderRadius]}; 192`,ti(n6)` 193 background-color: ${e=>td(e.theme.colors.icon.secondary,.12)}; 194`;class rt{constructor(){D(this,"currentTime",0)}}let rn=class{constructor(){D(this,"currentTime",0),D(this,"playbackRate",1),D(this,"startTime",null),D(this,"timeline",new rt),D(this,"finished",Promise.resolve(this)),D(this,"effect",null),D(this,"id",""),D(this,"pending",!1),D(this,"playState","finished"),D(this,"replaceState","active"),D(this,"ready",Promise.resolve(this)),D(this,"oncancel",null),D(this,"onfinish",null),D(this,"onremove",null)}static create(){return rn._instance||(function(...e){(0,g.logWarning)(e)}("Animation is not supported in this environment: please consider using the `web-animations-js` polyfill to provide a fallback implementation of the Web Animations API."),rn._instance=new rn),rn._instance}cancel(){}finish(){}pause(){}play(){}reverse(){}addEventListener(e,t,n){}dispatchEvent(e){return!1}removeEventListener(e,t,n){}updatePlaybackRate(e){}commitStyles(){}persist(){}};function rr(e,t,n){return"animate"in e?e.animate(t,n):rn.create()}D(rn,"_instance",null);var ro=eU("<div>");let ri=function(e,t){let n=e=>{var n,r;"Escape"===e.key&&(null==(n=document.activeElement)||n.blur(),null==(r=t())||r())};document.body.addEventListener("keydown",n),ee(()=>document.body.removeEventListener("keydown",n))},ra=function(e,t){let{isEnabled:n,onClose:r}=t();if(!n||"android"!==ns().os)return;window.history.pushState(nI,"");let o=e=>{e.preventDefault(),r()};window.addEventListener("popstate",o,{once:!0}),ee(()=>{window.removeEventListener("popstate",o),no(()=>{var e;(null==(e=window.history.state)?void 0:e[nP])===!0&&window.history.back()})})},rs=e=>{let t=tr(),n=nS(e);return z(()=>{e.opened?document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=th(-document.documentElement.scrollTop),document.body.classList.add(tc)):(document.body.classList.remove(tc),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto")}),em(nD,{onBeforeEnter:e=>{let t=tw("mobile")?200:100;rr(e,[{opacity:0}
194,{opacity:1}],{duration:t}),tw("mobile")&&rr(e.firstElementChild,[{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:t})},onExit:(e,t)=>{let n=tw("mobile")?200:100,r=rr(e,[{opacity:1},{opacity:0}],{duration:n});if(tw("mobile")){let o=rr(e.firstElementChild,[{transform:"translateY(0)"},{transform:"translateY(390px)"}],{duration:n});Promise.all([r.finished,o.finished]).then(t)}else r.finished.then(t)},get children(){return em(eN,{get when(){return e.opened},get children(){return em(n8,ew({"data-tc-modal":"true"},n,{get children(){var r=ro();return eB(ra,r,()=>({isEnabled:!0,onClose:()=>e.onClose()})),eB(ri,r,()=>()=>e.onClose()),eH(r,em(n7,{get class(){return e.class},get children(){return[em(re,{icon:"close",onClick:()=>e.onClose()}),Q(()=>e.children)]}})),G(()=>eX(r,m(n9,e7` 195 border-radius: ${n4[t.borderRadius]}; 196 background-color: ${t.colors.background.tint}; 197 198 ${t_("mobile")} { 199 border-radius: ${n4[t.borderRadius]} 200 ${n4[t.borderRadius]} 0 0; 201 } 202 `))),r}}))}})}})},rc=ti.div` 203 width: 52px; 204 height: 52px; 205 background: transparent; 206 position: absolute; 207 right: 0; 208 bottom: 0; 209 210 display: flex; 211 align-items: center; 212 justify-content: center; 213 transition: transform 0.125s ease-in-out; 214`,rl=ti.button` 215 display: flex; 216 align-items: center; 217 justify-content: center; 218 position: relative; 219 background-color: ${e=>e.theme.colors.background.qr}; 220 border-radius: 0; 221 padding: ${th(0)} 0; 222 height: ${th(270)}; 223 width: ${th(270)}; 224 225 overflow: hidden; 226 cursor: pointer; 227 border: none; 228 229 ${tR} { 230 &:hover { 231 ${rc.class} { 232 transform: scale(1.04); 233 } 234 } 235 } 236 237 &:active { 238 ${rc.class} { 239 transform: scale(0.96); 240 } 241 } 242 243 ${tE} { 244 &:active { 245 ${rc.class} { 246 transform: scale(0.92); 247 } 248 } 249 } 250`,ru=ti.div` 251 position: relative; 252 253 width: fit-content; 254 margin: 0 auto; 255 256 > div:first-child { 257 display: flex; 258 align-items: center; 259 justify-content: center; 260 } 261`,rd=ti.div` 262 position: absolute; 263 width: ${th(56)}; 264 height: ${th(56)}; 265 background: lightgray; 266 267 display: flex; 268 align-items: center; 269 justify-content: center; 270`,rh=ti(n_)` 271 width: ${e=>th(e.size)}; 272 height: ${e=>th(e.size)}; 273 border-radius: 100000px; 274 background-color: transparent; 275`;ti.div` 276 position: absolute; 277 bottom: 14px; 278 left: 50%; 279 transform: translate(-50%, 0); 280 281 display: flex; 282 gap: 6px; 283 align-items: center; 284 border-radius: 18px; 285 min-width: 126px; 286 padding: 9px 16px 9px 10px; 287 288 filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08)); 289 background-color: ${e=>e.theme.colors.background.segment}; 290`;var rf={exports:{}};(o=function(){var e,t,n,r,o,i,a,s=function(e,t){var n=e,r=l[t],o=null,i=0,a=null,s=[],c={},u=function(e,t){o=function(e){for(var t=Array(e),n=0;n<e;n+=1){t[n]=Array(e);for(var r=0;r<e;r+=1)t[n][r]=null}return t}(i=4*n+17),h(0,0),h(i-7,0),h(0,i-7),w(),b(),R(e,t),n>=7&&_(e),null==a&&(a=T(n,r,s)),N(a,t)},h=function(e,t){for(var n=-1;n<=7;n+=1)if(!(e+n<=-1)&&!(i<=e+n))for(var r=-1;r<=7;r+=1)t+r<=-1||i<=t+r||(0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4?o[e+n][t+r]=!0:o[e+n][t+r]=!1)},O=function(){for(var e=0,t=0,n=0;n<8;n+=1){u(!0,n);var r=d.getLostPoint(c);(0==n||e>r)&&(e=r,t=n)}return t},b=function(){for(var e=8;e<i-8;e+=1)null==o[e][6]&&(o[e][6]=e%2==0);for(var t=8;t<i-8;t+=1)null==o[6][t]&&(o[6][t]=t%2==0)},w=function(){for(var e=d.getPatternPosition(n),t=0;t<e.length;t+=1)for(var r=0;r<e.length;r+=1){var i=e[t],a=e[r];if(null==o[i][a])for(var s=-2;s<=2;s+=1)for(var c=-2;c<=2;c+=1)-2==s||2==s||-2==c||2==c||0==s&&0==c?o[i+s][a+c]=!0:o[i+s][a+c]=!1}},_=function(e){for(var t=d.getBCHTypeNumber(n),r=0;r<18;r+=1){var a=!e&&(t>>r&1)==1;o[Math.floor(r/3)][r%3+i-8-3]=a}for(var r=0;r<18;r+=1){var a=!e&&(t>>r&1)==1;o[r%3+i-8-3][Math.floor(r/3)]=a}},R=function(e,t){for(var n=r<<3|t,a=d.getBCHTypeInfo(n),s=0;s<15;s+=1){var c=!e&&(a>>s&1)==1;s<6?o[s][8]=c:s<8?o[s+1][8]=c:o[i-15+s][8]=c}for(var s=0;s<15;s+=1){var c=!e&&(a>>s&1)==1;s<8?o[8][i-s-1]=c:s<9?o[8][15-s-1+1]=c:o[8][15-s-1]=c}o[i-8][8]=!e},N=function(e,t){for(var n=-1,r=i-1,a=7,s=0,c=d.getMaskFunction(t),l=i-1;l>0;l-=2)for(6==l&&(l-=1);;){for(var u=0;u<2;u+=1)if(null==o[r][l-u]){var h=!1;s<e.length&&(h=(e[s]>>>a&1)==1),c(r,l-u)&&(h=!h),o[r][l-u]=h,-1==(a-=1)&&(s+=1,a=7)}if((r+=n)<0||i<=r){r-=n,n=-n;break}}},S=function(e,t){for(var n=0,r=0,o=0,i=Array(t.length),a=Array(t.length),s=0;s<t.length;s+=1){var c=t[s].dataCount,l=t[s].totalCount-c;r=Math.max(r,c),o=Math.max(o,l),i[s]=Array(c);for(var u=0;u<i[s].length;u+=1)i[s][u]=255&e.getBuffer()[u+n];n+=c;var h=d.getErrorCorrectPolynomial(l),g=f(i[s],h.getLength()-1).mod(h);a[s]=Array(h.getLength()-1);for(var u=0;u<a[s].length;u+=1){var p=u+g.getLength()-a[s].length;a[s][u]=p>=0?g.getAt(p):0}}for(var v=0,u=0;u<t.length;u+=1)v+=t[u].totalCount;for(var m=Array(v),y=0,u=0;u<r;u+=1)for(var s=0;s<t.length;s+=1)u<i[s].length&&(m[y]=i[s][u],y+=1);for(var u=0;u<o;u+=1)for(var s=0;s<t.length;s+=1)u<a[s].length&&(m[y]=a[s][u],y+=1);return m},T=function(e,t,n){for(var r=g.getRSBlocks(e,t),o=p(),i=0;i<n.length;i+=1){var a=n[i];o.put(a.getMode(),4),o.put(a.getLength(),d.getLengthInBits(a.getMode(),e)),a.write(o)}for(var s=0,i=0;i<r.length;i+=1)s+=r[i].dataCount;if(o.getLengthInBits()>8*s)throw"code length overflow. ("+o.getLengthInBits()+">"+8*s+")";for(o.getLengthInBits()+4<=8*s&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*s)&&(o.put(236,8),!(o.getLengthInBits()>=8*s));)o.put(17,8);return S(o,r)};c.addData=function(e,t){var n=null;switch(t=t||"Byte"){case"Numeric":n=v(e);break;case"Alphanumeric":n=m(e);break;case"Byte":n=y(e);break;case"Kanji":n=C(e);break;default:throw"mode:"+t}s.push(n),a=null},c.isDark=function(e,t){if(e<0||i<=e||t<0||i<=t)throw e+","+t;return o[e][t]},c.getModuleCount=function(){return i},c.make=function(){if(n<1){for(var e=1;e<40;e++){for(var t=g.getRSBlocks(e,r),o=p(),i=0;i<s.length;i++){var a=s[i];o.put(a.getMode(),4),o.put(a.getLength(),d.getLengthInBits(a.getMode(),e)),a.write(o)}for(var c=0,i=0;i<t.length;i++)c+=t[i].dataCount;if(o.getLengthInBits()<=8*c)break}n=e}u(!1,O())},c.createTableTag=function(e,t){e=e||2;var n="";n+='<table style=" border-width: 0px; border-style: none; border-collapse: collapse; padding: 0px; margin: '+(t=void 0===t?4*e:t)+'px;"><tbody>';for(var r=0;r<c.getModuleCount();r+=1){n+="<tr>";for(var o=0;o<c.getModuleCount();o+=1)n+='<td style=" border-width: 0px; border-style: none; border-collapse: collapse; padding: 0px; margin: 0px; width: '+e+"px; height: "+e+"px; background-color: "+(c.isDark(r,o)?"#000000":"#ffffff")+';"/>';n+="</tr>"}return n+"</tbody></table>"},c.createSvgTag=function(e,t,n,r){var o={};"object"==typeof arguments[0]&&(o=arguments[0],e=o.cellSize,t=o.margin,n=o.alt,r=o.title),e=e||2,t=void 0===t?4*e:t,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-description":null,(r="string"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||"qrcode-title":null;var i,a,s,l,u=c.getModuleCount()*e+2*t,d="";for(l="l"+e+",0 0,"+e+" -"+e+",0 0,-"+e+"z ",d+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"'+(o.scalable?"":' width="'+u+'px" height="'+u+'px"')+(' viewB
290ox="0 0 '+u+" ")+u+'" preserveAspectRatio="xMinYMin meet"'+(r.text||n.text?' role="img" aria-labelledby="'+A([r.id,n.id].join(" ").trim())+'"':"")+">"+(r.text?'<title id="'+A(r.id)+'">'+A(r.text)+"</title>":"")+(n.text?'<description id="'+A(n.id)+'">'+A(n.text)+"</description>":"")+'<rect width="100%" height="100%" fill="white" cx="0" cy="0"/><path d="',a=0;a<c.getModuleCount();a+=1)for(i=0,s=a*e+t;i<c.getModuleCount();i+=1)c.isDark(a,i)&&(d+="M"+(i*e+t)+","+s+l);return d+'" stroke="transparent" fill="black"/></svg>'},c.createDataURL=function(e,t){e=e||2,t=void 0===t?4*e:t;var n=c.getModuleCount()*e+2*t,r=t,o=n-t;return E(n,n,function(t,n){if(!(r<=t)||!(t<o)||!(r<=n)||!(n<o))return 1;var i=Math.floor((t-r)/e),a=Math.floor((n-r)/e);return c.isDark(a,i)?0:1})},c.createImgTag=function(e,t,n){e=e||2,t=void 0===t?4*e:t;var r=c.getModuleCount()*e+2*t,o="";return o+='<img src="'+c.createDataURL(e,t)+'" width="'+r+'" height="'+r+'"',n&&(o+=' alt="'+A(n)+'"'),o+="/>"};var A=function(e){for(var t="",n=0;n<e.length;n+=1){var r=e.charAt(n);switch(r){case"<":t+="<";break;case">":t+=">";break;case"&":t+="&";break;case'"':t+=""";break;default:t+=r}}return t},D=function(e){e=void 0===e?2:e;var t,n,r,o,i,a=1*c.getModuleCount()+2*e,s=e,l=a-e,u={"ââ":"â","â ":"â"," â":"â"," ":" "},d={"ââ":"â","â ":"â"," â":" "," ":" "},h="";for(t=0;t<a;t+=2){for(n=0,r=Math.floor((t-s)/1),o=Math.floor((t+1-s)/1);n<a;n+=1)i="â",s<=n&&n<l&&s<=t&&t<l&&c.isDark(r,Math.floor((n-s)/1))&&(i=" "),s<=n&&n<l&&s<=t+1&&t+1<l&&c.isDark(o,Math.floor((n-s)/1))?i+=" ":i+="â",h+=e<1&&t+1>=l?d[i]:u[i];h+="\n"}return a%2&&e>0?h.substring(0,h.length-a-1)+Array(a+1).join("â"):h.substring(0,h.length-1)};return c.createASCII=function(e,t){if((e=e||1)<2)return D(t);e-=1,t=void 0===t?2*e:t;var n,r,o,i,a=c.getModuleCount()*e+2*t,s=t,l=a-t,u=Array(e+1).join("ââ"),d=Array(e+1).join(" "),h="",f="";for(n=0;n<a;n+=1){for(r=0,o=Math.floor((n-s)/e),f="";r<a;r+=1)i=1,s<=r&&r<l&&s<=n&&n<l&&c.isDark(o,Math.floor((r-s)/e))&&(i=0),f+=i?u:d;for(o=0;o<e;o+=1)h+=f+"\n"}return h.substring(0,h.length-1)},c.renderTo2dContext=function(e,t){t=t||2;for(var n=c.getModuleCount(),r=0;r<n;r++)for(var o=0;o<n;o++)e.fillStyle=c.isDark(r,o)?"black":"white",e.fillRect(r*t,o*t,t,t)},c};s.stringToBytesFuncs={default:function(e){for(var t=[],n=0;n<e.length;n+=1){var r=e.charCodeAt(n);t.push(255&r)}return t}},s.stringToBytes=s.stringToBytesFuncs.default,s.createStringToBytes=function(e,t){var n=function(){for(var n=w(e),r=function(){var e=n.read();if(-1==e)throw"eof";return e},o=0,i={};;){var a=n.read();if(-1==a)break;var s=r(),c=r(),l=r(),u=String.fromCharCode(a<<8|s),d=c<<8|l;i[u]=d,o+=1}if(o!=t)throw o+" != "+t;return i}();return function(e){for(var t=[],r=0;r<e.length;r+=1){var o=e.charCodeAt(r);if(o<128)t.push(o);else{var i=n[e.charAt(r)];"number"==typeof i?(255&i)==i?t.push(i):(t.push(i>>>8),t.push(255&i)):t.push(63)}}return t}};var c={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},l={L:1,M:0,Q:3,H:2},u={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},d=(e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t={},n=function(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t},t.getBCHTypeInfo=function(e){for(var t=e<<10;n(t)-n(1335)>=0;)t^=1335<<n(t)-n(1335);return(e<<10|t)^21522},t.getBCHTypeNumber=function(e){for(var t=e<<12;n(t)-n(7973)>=0;)t^=7973<<n(t)-n(7973);return e<<12|t},t.getPatternPosition=function(t){return e[t-1]},t.getMaskFunction=function(e){switch(e){case u.PATTERN000:return function(e,t){return(e+t)%2==0};case u.PATTERN001:return function(e,t){return e%2==0}
290;case u.PATTERN010:return function(e,t){return t%3==0};case u.PATTERN011:return function(e,t){return(e+t)%3==0};case u.PATTERN100:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case u.PATTERN101:return function(e,t){return e*t%2+e*t%3==0};case u.PATTERN110:return function(e,t){return(e*t%2+e*t%3)%2==0};case u.PATTERN111:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw"bad maskPattern:"+e}},t.getErrorCorrectPolynomial=function(e){for(var t=f([1],0),n=0;n<e;n+=1)t=t.multiply(f([1,h.gexp(n)],0));return t},t.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case c.MODE_NUMBER:return 10;case c.MODE_ALPHA_NUM:return 9;case c.MODE_8BIT_BYTE:case c.MODE_KANJI:return 8;default:throw"mode:"+e}else if(t<27)switch(e){case c.MODE_NUMBER:return 12;case c.MODE_ALPHA_NUM:return 11;case c.MODE_8BIT_BYTE:return 16;case c.MODE_KANJI:return 10;default:throw"mode:"+e}else if(t<41)switch(e){case c.MODE_NUMBER:return 14;case c.MODE_ALPHA_NUM:return 13;case c.MODE_8BIT_BYTE:return 16;case c.MODE_KANJI:return 12;default:throw"mode:"+e}else throw"type:"+t},t.getLostPoint=function(e){for(var t=e.getModuleCount(),n=0,r=0;r<t;r+=1)for(var o=0;o<t;o+=1){for(var i=0,a=e.isDark(r,o),s=-1;s<=1;s+=1)if(!(r+s<0)&&!(t<=r+s))for(var c=-1;c<=1;c+=1)o+c<0||t<=o+c||0==s&&0==c||a!=e.isDark(r+s,o+c)||(i+=1);i>5&&(n+=3+i-5)}for(var r=0;r<t-1;r+=1)for(var o=0;o<t-1;o+=1){var l=0;e.isDark(r,o)&&(l+=1),e.isDark(r+1,o)&&(l+=1),e.isDark(r,o+1)&&(l+=1),e.isDark(r+1,o+1)&&(l+=1),(0==l||4==l)&&(n+=3)}for(var r=0;r<t;r+=1)for(var o=0;o<t-6;o+=1)e.isDark(r,o)&&!e.isDark(r,o+1)&&e.isDark(r,o+2)&&e.isDark(r,o+3)&&e.isDark(r,o+4)&&!e.isDark(r,o+5)&&e.isDark(r,o+6)&&(n+=40);for(var o=0;o<t;o+=1)for(var r=0;r<t-6;r+=1)e.isDark(r,o)&&!e.isDark(r+1,o)&&e.isDark(r+2,o)&&e.isDark(r+3,o)&&e.isDark(r+4,o)&&!e.isDark(r+5,o)&&e.isDark(r+6,o)&&(n+=40);for(var u=0,o=0;o<t;o+=1)for(var r=0;r<t;r+=1)e.isDark(r,o)&&(u+=1);return n+Math.abs(100*u/t/t-50)/5*10},t),h=function(){for(var e=Array(256),t=Array(256),n=0;n<8;n+=1)e[n]=1<<n;for(var n=8;n<256;n+=1)e[n]=e[n-4]^e[n-5]^e[n-6]^e[n-8];for(var n=0;n<255;n+=1)t[e[n]]=n;var r={};return r.glog=function(e){if(e<1)throw"glog("+e+")";return t[e]},r.gexp=function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]},r}();function f(e,t){if(void 0===e.length)throw e.length+"/"+t;var n=function(){for(var n=0;n<e.length&&0==e[n];)n+=1;for(var r=Array(e.length-n+t),o=0;o<e.length-n;o+=1)r[o]=e[o+n];return r}(),r={};return r.getAt=function(e){return n[e]},r.getLength=function(){return n.length},r.multiply=function(e){for(var t=Array(r.getLength()+e.getLength()-1),n=0;n<r.getLength();n+=1)for(var o=0;o<e.getLength();o+=1)t[n+o]^=h.gexp(h.glog(r.getAt(n))+h.glog(e.getAt(o)));return f(t,0)},r.mod=function(e){if(r.getLength()-e.getLength()<0)return r;for(var t=h.glog(r.getAt(0))-h.glog(e.getAt(0)),n=Array(r.getLength()),o=0;o<r.getLength();o+=1)n[o]=r.getAt(o);for(var o=0;o<e.getLength();o+=1)n[o]^=h.gexp(h.glog(e.getAt(o))+t);return f(n,0).mod(e)},r}var g=(r=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],o=function(e,t){var n={};return n.totalCount=e,n.dataCount=t,n},i={},a=function(e,t){switch(t){case l.L:return r[(e-1)*4+0];case l.M:return r[(e-1)*4+1];case l.Q:return r[(e-1)*4+2];case l.H:return r[(e-1)*4+3];default:return}},i.getRSBlocks=function(e,t){var n=a(e,t);if(void 0===n)throw"bad rs block @ typeNumber:"+e+"/errorCorrectionLevel:"+t;for(var r=n.length/3,i=[],s=0;s<r;s+=1)for(var c=n[3*s+0],l=n[3*s+1],u=n[3*s+2],d=0;d<c;d+=1)i.push(o(l,u));return i},i),p=function(){var e=[],t=0,n={};return n.getBuffer=function(){return e},n.getAt=function(t){return(e[Math.floor(t/8)]>>>7-t%8&1)==1},n.put=function(e,t){for(var r=0;r<t;r+=1)n.putBit((e>>>t-r-1&1)==1)},n.getLengthInBits=function(){return t},n.putBit=function(n){var r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1},n},v=function(e){var t=c.MODE_NUMBER,n={};n.getMode=function(){return t},n.getLength=function(t){return e.length},n.write=function(t){for(var n=0;n+2<e.length;)t.put(r(e.substring(n,n+3)),10),n+=3;n<e.length&&(e.length-n==1?t.put(r(e.substring(n,n+1)),4):e.length-n==2&&t.put(r(e.substring(n,n+2)),7))};var r=function(e){for(var t=0,n=0;n<e.length;n+=1)t=10*t+o(e.charAt(n));return t},o=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-48;throw"illegal char :"+e};return n},m=function(e){var t=c.MODE_ALPHA_NUM,n={};n.getMode=function(){return t},n.getLength=function(t){return e.length},n.write=function(t){for(var n=0;n+1<e.length;)t.put(45*r(e.charAt(n))+r(e.charAt(n+1)),11),n+=2;n<e.length&&t.put(r(e.charAt(n)),6)};var r=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-48;if("A"<=e&&e<="Z")return e.charCodeAt(0)-65+10;switch(e){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+e}};return n},y=function(e){var t=c.MODE_8BIT_BYTE,n=s.stringToBytes(e),r={};return r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){for(var t=0;t<n.length;t+=1)e.put(n[t],8)},r},C=function(e){var t=c.MODE_KANJI,n=s.stringToBytesFuncs.SJIS;if(!n)throw"sjis not supported.";!function(e,t){var r=n("å");
290if(2!=r.length||(r[0]<<8|r[1])!=38726)throw"sjis not supported."}(0,0);var r=n(e),o={};return o.getMode=function(){return t},o.getLength=function(e){return~~(r.length/2)},o.write=function(e){for(var t=0;t+1<r.length;){var n=(255&r[t])<<8|255&r[t+1];if(33088<=n&&n<=40956)n-=33088;else if(57408<=n&&n<=60351)n-=49472;else throw"illegal char at "+(t+1)+"/"+n;n=(n>>>8&255)*192+(255&n),e.put(n,13),t+=2}if(t<r.length)throw"illegal char at "+(t+1)},o},O=function(){var e=[],t={};return t.writeByte=function(t){e.push(255&t)},t.writeShort=function(e){t.writeByte(e),t.writeByte(e>>>8)},t.writeBytes=function(e,n,r){n=n||0,r=r||e.length;for(var o=0;o<r;o+=1)t.writeByte(e[o+n])},t.writeString=function(e){for(var n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},t.toByteArray=function(){return e},t.toString=function(){var t="";t+="[";for(var n=0;n<e.length;n+=1)n>0&&(t+=","),t+=e[n];return t+"]"},t},b=function(){var e=0,t=0,n=0,r="",o={},i=function(e){r+=String.fromCharCode(a(63&e))},a=function(e){if(e<0);else if(e<26)return 65+e;else if(e<52)return 97+(e-26);else if(e<62)return 48+(e-52);else if(62==e)return 43;else if(63==e)return 47;throw"n:"+e};return o.writeByte=function(r){for(e=e<<8|255&r,t+=8,n+=1;t>=6;)i(e>>>t-6),t-=6},o.flush=function(){if(t>0&&(i(e<<6-t),e=0,t=0),n%3!=0)for(var o=3-n%3,a=0;a<o;a+=1)r+="="},o.toString=function(){return r},o},w=function(e){var t=0,n=0,r=0,o={};o.read=function(){for(;r<8;){if(t>=e.length){if(0==r)return -1;throw"unexpected end of file./"+r}var o=e.charAt(t);if(t+=1,"="==o)return r=0,-1;o.match(/^\s$/)||(n=n<<6|i(o.charCodeAt(0)),r+=6)}var a=n>>>r-8&255;return r-=8,a};var i=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(43==e)return 62;if(47==e)return 63;throw"c:"+e};return o},_=function(e,t){var n=Array(e*t),r={};r.setPixel=function(t,r,o){n[r*e+t]=o},r.write=function(n){n.writeString("GIF87a"),n.writeShort(e),n.writeShort(t),n.writeByte(128),n.writeByte(0),n.writeByte(0),n.writeByte(0),n.writeByte(0),n.writeByte(0),n.writeByte(255),n.writeByte(255),n.writeByte(255),n.writeString(","),n.writeShort(0),n.writeShort(0),n.writeShort(e),n.writeShort(t),n.writeByte(0);var r=i(2);n.writeByte(2);for(var o=0;r.length-o>255;)n.writeByte(255),n.writeBytes(r,o,255),o+=255;n.writeByte(r.length-o),n.writeBytes(r,o,r.length-o),n.writeByte(0),n.writeString(";")};var o=function(e){var t=0,n=0,r={};return r.write=function(r,o){if(r>>>o!=0)throw"length over";for(;t+o>=8;)e.writeByte(255&(r<<t|n)),o-=8-t,r>>>=8-t,n=0,t=0;n=r<<t|n,t+=o},r.flush=function(){t>0&&e.writeByte(n)},r},i=function(e){for(var t=1<<e,r=(1<<e)+1,i=e+1,s=a(),c=0;c<t;c+=1)s.add(String.fromCharCode(c));s.add(String.fromCharCode(t)),s.add(String.fromCharCode(r));var l=O(),u=o(l);u.write(t,i);var d=0,h=String.fromCharCode(n[0]);for(d+=1;d<n.length;){var f=String.fromCharCode(n[d]);d+=1,s.contains(h+f)?h+=f:(u.write(s.indexOf(h),i),4095>s.size()&&(s.size()==1<<i&&(i+=1),s.add(h+f)),h=f)}return u.write(s.indexOf(h),i),u.write(r,i),u.flush(),l.toByteArray()},a=function(){var e={},t=0,n={};return n.add=function(r){if(n.contains(r))throw"dup key:"+r;e[r]=t,t+=1},n.size=function(){return t},n.indexOf=function(t){return e[t]},n.contains=function(t){return void 0!==e[t]},n};return r},E=function(e,t,n){for(var r=_(e,t),o=0;o<t;o+=1)for(var i=0;i<e;i+=1)r.setPixel(i,o,n(i,o));var a=O();r.write(a);for(var s=b(),c=a.toByteArray(),l=0;l<c.length;l+=1)s.writeByte(c[l]);return s.flush(),"data:image/gif;base64,"+s};return s}()).stringToBytesFuncs["UTF-8"]=function(e){return function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?t.push(192|r>>6,128|63&r):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t}(e)},i=function(){return o},rf.exports=i();let rg=rf.exports;var rp=eU("<div>");let rv=e=>{let t,n,r;V(!1);let[o,i]=V(54);return z(()=>{let o=rg(0,"M");if(o.addData(e.sourceUrl),o.make(),t){let e=o.getModuleCount(),a=5*e,s=tr().theme==I.DARK?"white":"black",c=(t,n)=>t<7&&n<7||t<7&&n>=e-7||t>=e-7&&n<7,l=Math.round(270/(5*e)*1e5)/1e5,u=t=>{let n=Math.ceil(56/(5*t));return{sizeCells:n,offsetCells:Math.ceil((e-n)/2)}},d=(t,n)=>{let{sizeCells:r}=u(l),o=Math.floor(e/2);return Math.sqrt(Math.pow(t-o,2)+Math.pow(n-o,2))<=(r+3)/2},h=`<svg width="${a}" height="${a}" viewBox="0 0 ${a} ${a}" fill="none" xmlns="http://www.w3.org/2000/svg">`,f=(e,t)=>{h+=`<rect 291 x="${5*t}" 292 y="${5*e}" 293 width="35" 294 height="5" 295 fill="${s}" 296 rx="4" 297 /><rect 298 x="${5*t}" 299 y="${(e+6)*5}" 300 width="35" 301 height="5" 302 fill="${s}" 303 rx="4" 304 /><rect 305 x="${5*t}" 306 y="${5*e}" 307 width="5" 308 height="35" 309 fill="${s}" 310 rx="4" 311 /><rect 312 x="${(t+6)*5}" 313 y="${5*e}" 314 width="5" 315 height="35" 316 fill="${s}" 317 rx="4" 318 /><rect 319 x="${(t+2)*5}" 320 y="${(e+2)*5}" 321 width="15" 322 height="15" 323 rx="4" 324 fill="${s}" 325 />`};f(0,0),f(0,e-7),f(e-7,0);let g=(e,t)=>`<rect 326 x="${e+.375}" 327 y="${t+.375}" 328 width="4.25" 329 height="4.25" 330 rx="${4.25/3}" 331 fill="${s}" 332 />`;for(let t=0;t<e;t++)for(let n=0;n<e;n++)!o.isDark(t,n)||c(t,n)||d(t,n)||(h+=g(5*n,5*t));if(h+="</svg>",t.innerHTML=h,r){let{sizeCells:e,offsetCells:t}=u(l),n=5*e,o=5*t;r.style.top=th(o),r.style.left=th(o),r.style.height=th(n),r.style.width=th(n),r.style.borderRadius=th(1e6),i(Math.round(54/l))}n&&(n.style.transform=`scale(${l})`)}}),em(rl,{get class(){return e.class},get children(){return[em(ru,{ref(e){var t=n;"function"==typeof t?t(e):n=e},get children(){var a,s;return[(a=rp(),"function"==typeof(s=t)?eB(s,a):t=a,a),em(eN,{get when(){return e.imageUrl},get children(){return em(rd,{ref(e){var t=r;"function"==typeof t?t(e):r=e},get children(){return em(rh,{get src(){return e.imageUrl},alt:"",get size(){return o()}})}})}})]}}),em(nD,{onBeforeEnter:e=>{rr(e,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(e,t)=>
332{rr(e,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then(()=>{t()})}})]}})};function rm(e,t,n){let r=e[t]||t.trim().split(".").reduce((e,t)=>e?e[t]:void 0,e);return void 0!==r?r:n}var ry=(e,t,n=/{{([^{}]+)}}/g)=>e.replace(n,(e,n)=>rm(t,n,"")),rC=(e={},t="undefined"!=typeof navigator&&navigator.language in e?navigator.language:(t=>null!=(t=Object.keys(e)[0])?t:"")())=>{let[n,r]=V(t),[o,i]=tB(e);return[(e,t,r)=>{let i=rm(o[n()],e,r||"");return"function"==typeof i?i(t):"string"==typeof i?ry(i,t||{}):i},{add(e,t){i(e,e=>Object.assign(e||{},t))},locale:e=>e?r(e):n(),dict:e=>rm(o,e)}]},rO=et({}),rb=()=>en(rO);let rw=ti.div` 333 font-style: normal; 334 font-weight: ${e=>e.fontWeight}; 335 font-size: ${e=>e.fontSize}; 336 line-height: ${e=>e.lineHeight}; 337 338 color: ${e=>e.color}; 339`,r_=e=>{let t;let n=tr(),[r]=rb(),o=()=>e.color||n.colors.text.primary,i=ew({fontSize:"14px",fontWeight:"510",lineHeight:"130%"},e);return z(()=>{t&&"unset"!==i.cursor&&"pointer"!==getComputedStyle(t).cursor&&(t.style.cursor="default")}),em(rw,{get fontSize(){return i.fontSize},get fontWeight(){return i.fontWeight},get lineHeight(){return i.lineHeight},get color(){return o()},get class(){return i.class},ref(e){var n=t;"function"==typeof n?n(e):t=e},"data-tc-text":"true",get children(){var a;return Q(()=>!!i.translationKey)()?r(i.translationKey,i.translationValues,null==(a=i.children)?void 0:a.toString()):i.children}})},rE=ti.div` 340 position: relative; 341 342 &::after { 343 content: ''; 344 display: block; 345 position: absolute; 346 top: 0; 347 bottom: 0; 348 left: 0; 349 right: 0; 350 border: 0.5px solid rgba(0, 0, 0, 0.08); 351 352 border-radius: inherit; 353 } 354`,rR=ti(n_)` 355 width: 100%; 356 height: 100%; 357 border-radius: inherit; 358`,rN=e=>em(rE,{get class(){return e.class},get children(){return em(rR,{get src(){return e.src}})}}),rS={m:"16px",s:"12px",none:"0"},rT={m:"6px",s:"6px",none:"0"};ti.button` 359 position: relative; 360 cursor: pointer; 361 border: none; 362 background-color: unset; 363 padding: 8px 4px; 364 width: 92px; 365 display: flex; 366 flex-direction: column; 367 align-items: center; 368 369 transition: transform 0.125s ease-in-out; 370 371 ${tR} { 372 &:hover { 373 transform: scale(1.04); 374 } 375 } 376 377 &:active { 378 transform: scale(0.96); 379 } 380 381 ${t_("mobile")} { 382 padding: 8px 4px; 383 width: 82px; 384 } 385 386 ${tE} { 387 &:active { 388 transform: scale(0.92); 389 } 390 } 391`,ti(rN)` 392 width: 60px; 393 height: 60px; 394 border-radius: ${e=>rS[e.theme.borderRadius]}; 395 396 margin-bottom: 8px; 397`,ti(n_)` 398 position: absolute; 399 right: 10px; 400 top: 50px; 401 width: 24px; 402 height: 24px; 403 border-radius: ${e=>rT[e.theme.borderRadius]}; 404 box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08); 405`,ti(r_)` 406 max-width: 90px; 407 font-weight: 510; 408 white-space: nowrap; 409 text-overflow: ellipsis; 410 overflow: hidden; 411 412 ${t_("mobile")} { 413 max-width: 80px; 414 } 415`,ti(r_)` 416 font-weight: ${e=>e.colorPrimary?"510":"400"}; 417 max-width: 90px; 418 white-space: nowrap; 419 text-overflow: ellipsis; 420 overflow: hidden; 421 color: ${e=>e.colorPrimary?e.theme.colors.text.primary:e.theme.colors.text.secondary}; 422 423 ${t_("mobile")} { 424 max-width: 80px; 425 } 426`;let rA=ti.h1` 427 font-style: normal; 428 font-weight: 590; 429 font-size: 20px; 430 line-height: 28px; 431 432 text-align: center; 433 434 color: ${e=>e.theme.colors.text.primary}; 435 436 margin-top: 0; 437 margin-bottom: 0; 438 439 cursor: default; 440`,rD=e=>{let[t]=rb();return em(rA,{get class(){return e.class},"data-tc-h1":"true",get children(){var n;return Q(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString()):e.children}})},rP=ti.h2` 441 font-style: normal; 442 font-weight: 400; 443 font-size: 16px; 444 line-height: 22px; 445 446 text-align: center; 447 448 color: ${e=>e.theme.colors.text.secondary}; 449 450 margin-top: 0; 451 margin-bottom: 32px; 452 453 cursor: default; 454`,rI=e=>{let[t]=rb();return em(rP,{get class(){return e.class},"data-tc-h2":"true",get children(){var n;return Q(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString()):e.children}})},rK=ti.h3` 455 font-style: normal; 456 font-weight: 510; 457 font-size: 16px; 458 line-height: 20px; 459 460 color: ${e=>e.theme.colors.text.primary}; 461 462 margin-top: 0; 463 margin-bottom: 0; 464 465 cursor: default; 466`,rk=e=>{let[t]=rb();return em(rK,{"data-tc-h3":"true",get class(){return e.class},get children(){var n;return Q(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString()):e.children}})},rx={m:"16px",s:"12px",none:"0"},rM={m:"6px",s:"6px",none:"0"};ti.div` 467 width: 60px; 468 height: 60px; 469 padding: 8px; 470 margin-bottom: 8px; 471 border-radius: ${e=>rx[e.theme.borderRadius]}; 472 background-color: ${e=>e.theme.colors.background.tint}; 473 display: grid; 474 grid-template: 1fr 1fr / 1fr 1fr; 475 gap: 4px; 476`,ti(rN)`
477 width: 20px; 478 height: 20px; 479 border-radius: ${e=>rM[e.theme.borderRadius]}; 480`;let rL=ti.a` 481 display: block; 482 text-decoration: unset; 483`;var rU=eU('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path fill-rule=evenodd clip-rule=evenodd d="M7.76228 2.09998H10.2378C11.0458 2.09997 11.7067 2.09996 12.2438 2.14384C12.7997 2.18926 13.3017 2.28614 13.7706 2.52505C14.5045 2.89896 15.1011 3.49558 15.475 4.22941C15.7139 4.6983 15.8108 5.20038 15.8562 5.75629C15.9001 6.29337 15.9001 6.95422 15.9001 7.76227V8.1H16.2377C17.0457 8.09999 17.7066 8.09998 18.2437 8.14386C18.7996 8.18928 19.3017 8.28616 19.7705 8.52507C20.5044 8.89898 21.101 9.4956 21.4749 10.2294C21.7138 10.6983 21.8107 11.2004 21.8561 11.7563C21.9 12.2934 21.9 12.9542 21.9 13.7623V16.2377C21.9 17.0458 21.9 17.7066 21.8561 18.2437C21.8107 18.7996 21.7138 19.3017 21.4749 19.7706C21.101 20.5044 20.5044 21.101 19.7705 21.4749C19.3017 21.7138 18.7996 21.8107 18.2437 21.8561C17.7066 21.9 17.0458 21.9 16.2378 21.9H13.7623C12.9543 21.9 12.2934 21.9 11.7563 21.8561C11.2004 21.8107 10.6983 21.7138 10.2294 21.4749C9.49561 21.101 8.89898 20.5044 8.52508 19.7706C8.28616 19.3017 8.18928 18.7996 8.14386 18.2437C8.09998 17.7066 8.09999 17.0458 8.1 16.2377V15.9H7.76227C6.95426 15.9 6.29335 15.9 5.75629 15.8561C5.20038 15.8107 4.6983 15.7138 4.22941 15.4749C3.49558 15.101 2.89896 14.5044 2.52505 13.7705C2.28614 13.3017 2.18926 12.7996 2.14384 12.2437C2.09996 11.7066 2.09997 11.0458 2.09998 10.2377V7.76228C2.09997 6.95424 2.09996 6.29336 2.14384 5.75629C2.18926 5.20038 2.28614 4.6983 2.52505 4.22941C2.89896 3.49558 3.49558 2.89896 4.22941 2.52505C4.6983 2.28614 5.20038 2.18926 5.75629 2.14384C6.29336 2.09996 6.95425 2.09997 7.76228 2.09998ZM8.1 14.1V13.7623C8.09999 12.9542 8.09998 12.2934 8.14386 11.7563C8.18928 11.2004 8.28616 10.6983 8.52508 10.2294C8.89898 9.4956 9.49561 8.89898 10.2294 8.52507C10.6983 8.28616 11.2004 8.18928 11.7563 8.14386C12.2934 8.09998 12.9542 8.09999 13.7623 8.1H14.1001V7.79998C14.1001 6.94505 14.0994 6.35798 14.0622 5.90287C14.0259 5.45827 13.9593 5.21944 13.8712 5.0466C13.6699 4.65146 13.3486 4.3302 12.9535 4.12886C12.7806 4.04079 12.5418 3.97419 12.0972 3.93786C11.6421 3.90068 11.055 3.89998 10.2001 3.89998H7.79998C6.94505 3.89998 6.35798 3.90068 5.90287 3.93786C5.45827 3.97419 5.21944 4.04079 5.0466 4.12886C4.65146 4.3302 4.3302 4.65146 4.12886 5.0466C4.04079 5.21944 3.97419 5.45827 3.93786 5.90287C3.90068 6.35798 3.89998 6.94505 3.89998 7.79998V10.2C3.89998 11.0549 3.90068 11.642 3.93786 12.0971C3.97419 12.5417 4.04079 12.7805 4.12886 12.9534C4.3302 13.3485 4.65146 13.6698 5.0466 13.8711C5.21944 13.9592 5.45827 14.0258 5.90287 14.0621C6.35798 14.0993 6.94505 14.1 7.79998 14.1H8.1ZM11.0466 10.1289C11.2195 10.0408 11.4583 9.97421 11.9029 9.93788C12.358 9.9007 12.9451 9.9 13.8 9.9H16.2C17.0549 9.9 17.642 9.9007 18.0971 9.93788C18.5417 9.97421 18.7805 10.0408 18.9534 10.1289C19.3485 10.3302 19.6698 10.6515 19.8711 11.0466C19.9592 11.2195 20.0258 11.4583 20.0621 11.9029C20.0993 12.358 20.1 12.9451 20.1 13.8V16.2C20.1 17.0549 20.0993 17.642 20.0621 18.0971C20.0258 18.5417 19.9592 18.7805 19.8711 18.9534C19.6698 19.3485 19.3485 19.6698 18.9534 19.8711C18.7805 19.9592 18.5417 20.0258 18.0971 20.0621C17.642 20.0993 17.0549 20.1 16.2 20.1H13.8C12.9451 20.1 12.358 20.0993 11.9029 20.0621C11.4583 20.0258 11.2195 19.9592 11.0466 19.8711C10.6515 19.6698 10.3302 19.3485 10.1289 18.9534C10.0408 18.7805 9.97421 18.5417 9.93788 18.0971C9.9007 17.642 9.9 17.0549 9.9 16.2V13.8C9.9 12.9451 9.9007 12.358 9.93788 11.9029C9.97421 11.4583 10.0408 11.2195 10.1289 11.0466C10.3302 10.6515 10.6515 10.3302 11.0466 10.1289Z">');let rW=e=>{var t,n;let r=tr(),o=()=>e.fill||r.colors.icon.primary;return n=(t=rU()).firstChild,G(r=>{var i=e.class,a=o();return i!==r.e&&eW(t,"class",r.e=i),a!==r.t&&eW(n,"fill",r.t=a),r},{e:void 0,t:void 0}),t};var rX=eU('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8.7624 3.10001C7.95435 3.1 7.29349 3.09999 6.75642 3.14387C6.2005 3.18929 5.69842 3.28617 5.22954 3.52508C4.4957 3.89899 3.89908 4.49561 3.52517 5.22944C3.28626 5.69833 3.18938 6.20041 3.14396 6.75632C3.10008 7.2934 3.10009 7.95424 3.1001 8.76229V15.2377C3.10009 16.
4830458 3.10008 16.7066 3.14396 17.2437C3.18938 17.7996 3.28626 18.3017 3.52517 18.7706C3.89908 19.5044 4.4957 20.101 5.22954 20.4749C5.69842 20.7138 6.2005 20.8107 6.75642 20.8561C7.29349 20.9 7.95434 20.9 8.76239 20.9H12.0001C12.4972 20.9 12.9001 20.4971 12.9001 20C12.9001 19.503 12.4972 19.1 12.0001 19.1H8.8001C7.94517 19.1 7.3581 19.0993 6.90299 19.0621C6.45839 19.0258 6.21956 18.9592 6.04672 18.8711C5.65158 18.6698 5.33032 18.3485 5.12898 17.9534C5.04092 17.7805 4.97431 17.5417 4.93798 17.0971C4.9008 16.642 4.9001 16.0549 4.9001 15.2V8.80001C4.9001 7.94508 4.9008 7.35801 4.93798 6.9029C4.97431 6.4583 5.04092 6.21947 5.12898 6.04663C5.33032 5.65149 5.65158 5.33023 6.04672 5.12889C6.21956 5.04082 6.45839 4.97422 6.90299 4.93789C7.3581 4.90071 7.94517 4.90001 8.8001 4.90001H12.0001C12.4972 4.90001 12.9001 4.49706 12.9001 4.00001C12.9001 3.50295 12.4972 3.10001 12.0001 3.10001H8.7624Z"></path><path d="M17.6364 7.3636C17.2849 7.01212 16.7151 7.01212 16.3636 7.3636C16.0121 7.71507 16.0121 8.28492 16.3636 8.63639L18.8272 11.1H9.00001C8.50295 11.1 8.10001 11.5029 8.10001 12C8.10001 12.497 8.50295 12.9 9.00001 12.9H18.8272L16.3636 15.3636C16.0121 15.7151 16.0121 16.2849 16.3636 16.6364C16.7151 16.9879 17.2849 16.9879 17.6364 16.6364L21.6364 12.6364C21.9879 12.2849 21.9879 11.7151 21.6364 11.3636L17.6364 7.3636Z">');let rj=e=>{var t,n,r;let o=tr(),i=()=>e.fill||o.colors.icon.primary;return r=(n=(t=rX()).firstChild).nextSibling,G(e=>{var t=i(),o=i();return t!==e.e&&eW(n,"fill",e.e=t),o!==e.t&&eW(r,"fill",e.t=o),e},{e:void 0,t:void 0}),t},rB={m:"8px",s:"4px",none:"0"},rH={m:"16px",s:"8px",none:"0"},rJ=ti.div` 484 width: 256px; 485 box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); 486 border-radius: ${e=>rH[e.theme.borderRadius]}; 487 488 background-color: ${e=>e.theme.colors.background.primary} 489 490 color: ${e=>e.theme.colors.text.primary} 491`,rq=ti.ul` 492 background-color: ${e=>e.theme.colors.background.primary}; 493 padding: 8px; 494`,rF=ti.button` 495 display: flex; 496 align-items: center; 497 gap: 8px; 498 height: 40px; 499 padding-left: 8px; 500 width: 100%; 501 502 background-color: ${e=>e.theme.colors.background.primary}; 503 border: none; 504 border-radius: ${e=>rB[e.theme.borderRadius]}; 505 cursor: pointer; 506 507 transition: background-color, transform 0.1s ease-in-out; 508 509 &:hover { 510 background-color: ${e=>e.theme.colors.background.secondary}; 511 } 512 513 &:active { 514 transform: scale(0.96); 515 } 516`,r$=et();var rV=eU("<li>");let rG=e=>em(r_,{get translationKey(){return e.translationKey},fontSize:"15px",fontWeight:"590",get children(){return e.children}}),rz=ti(nT)` 517 background-color: ${e=>e.theme.colors.connectButton.background}; 518 color: ${e=>e.theme.colors.connectButton.foreground}; 519 box-shadow: ${e=>`0 4px 24px ${td(e.theme.colors.constant.black,.16)}`}; 520 padding: 8px 16px 8px 12px; 521 522 display: flex; 523 align-items: center; 524 gap: 4px; 525 height: 40px; 526`,rQ=ti(rz)` 527 padding: 12px 16px; 528 min-width: 148px; 529 justify-content: center; 530 background-color: ${e=>e.theme.colors.background.primary}; 531`,rY=ti(nT)` 532 min-width: 148px; 533 height: 40px; 534 535 background-color: ${e=>e.theme.colors.background.primary}; 536 color: ${e=>e.theme.colors.connectButton.foreground}; 537 box-shadow: ${e=>`0 4px 24px ${td(e.theme.colors.constant.black,.16)}`}; 538 539 display: flex; 540 align-items: center; 541 justify-content: center; 542`,rZ=ti(nQ)` 543 height: 18px; 544 width: 18px; 545`,r0=ti.div` 546 width: fit-content; 547 display: flex; 548 flex-direction: column; 549 align-items: flex-end; 550`,r1=ti(e=>{let t=en(r$),[n,r]=V(!1),o=()=>P(void 0,null,function*(){let e=(0,p.toUserFriendlyAddress)(t.account.address);yield function(e){return P(this,null,function*(){try{if(!(null==navigator?void 0:navigator.clipboard))throw new K("Clipboard API not available");return yield navigator.clipboard.writeText(e)}catch(e){}(function(e){let t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}finally{document.body.removeChild(t)}})(e)})}(e),r(!0),setTimeout(()=>r(!1),1e3)}),i=()=>{t.disconnect(),e.onClose()};return em(rJ,{ref(t){var n=e.ref;"function"==typeof n?n(t):e.ref=t},get class(){return e.class},"data-tc-dropdown":"true",get children(){return em(rq,{get children(){var a,s;return[(eH(a=rV(),em(rF,{onClick:()=>o(),get children(){return[em(rW,{}),em(eN,{get when(){return!n()},get children(){return em(rG,{translationKey:"button.dropdown.copy",children:"Copy address"})}}),em(eN,{get when(){return n()},get children(){return em(rG,{translationKey:"button.dropdown.copied",children:"Address copied!"})}})]}})),a),(eH(s=rV(),em(rF,{onClick:()=>i(),get children(){return[em(rj,{}),em(rG,{translationKey:"button.dropdown.disconnect",children:"Disconnect"})]}})),s)]}})}})})` 551 box-sizing: border-box; 552 overflow: hidden; 553 margin-top: 12px; 554`,r2=((e,t)=>e.concat(t,t+"-start",t+"-end"),Math.min),r5=Math.max,r3=Math.round,r6=Math.floor,r4=e=>({x:e,y:e}
554),r8={left:"right",right:"left",bottom:"top",top:"bottom"};function r9(e){return e.split("-")[0]}function r7(e){return["top","bottom"].includes(r9(e))?"y":"x"}function oe(e){let{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ot(e,t,n){let r,{reference:o,floating:i}=e,a=r7(t),s="x"===r7(t)?"y":"x",c="y"===s?"height":"width",l=r9(t),u="y"===a,d=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,f=o[c]/2-i[c]/2;switch(l){case"top":r={x:d,y:o.y-i.height};break;case"bottom":r={x:d,y:o.y+o.height};break;case"right":r={x:o.x+o.width,y:h};break;case"left":r={x:o.x-i.width,y:h};break;default:r={x:o.x,y:o.y}}switch(t.split("-")[1]){case"start":r[s]-=f*(n&&u?-1:1);break;case"end":r[s]+=f*(n&&u?-1:1)}return r}let on=(e,t,n)=>P(void 0,null,function*(){let{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),c=yield null==a.isRTL?void 0:a.isRTL(t),l=yield a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=ot(l,r,c),h=r,f={},g=0;for(let n=0;n<s.length;n++){let{name:i,fn:p}=s[n],{x:v,y:m,data:y,reset:C}=yield p({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,re
554cts:l,platform:a,elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=m?m:d,f=A(T({},f),{[i]:T(T({},f[i]),y)}),C&&g<=50&&(g++,"object"==typeof C&&(C.placement&&(h=C.placement),C.rects&&(l=!0===C.rects?yield a.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:d}=ot(l,h,c)),n=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}});function or(){return"undefined"!=typeof window}function oo(e){return os(e)?(e.nodeName||"").toLowerCase():"#document"}function oi(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function oa(e){var t;return null==(t=(os(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function os(e){return!!or()&&(e instanceof Node||e instanceof oi(e).Node)}function oc(e){return!!or()&&(e instanceof Element||e instanceof oi(e).Element)}function ol(e){return!!or()&&(e instanceof HTMLElement||e instanceof oi(e).HTMLElement)}function ou(e){return!!or()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof oi(e).ShadowRoot)}function od(e){let{overflow:t,overflowX:n,overflowY:r,display:o}=ov(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function oh(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(e){return!1}})}function of(e){let t=og(),n=oc(e)?ov(e):e;return["transform","translate","scale","rotate","perspective"].some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some(e=>(n.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(n.contain||"").includes(e))}function og(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}function op(e){return["html","body","#document"].includes(oo(e))}function ov(e){return oi(e).getComputedStyle(e)}function om(e){return oc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oy(e){if("html"===oo(e))return e;let t=e.assignedSlot||e.parentNode||ou(e)&&e.host||oa(e);return ou(t)?t.host:t}function oC(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let o=function e(t){let n=oy(t);return op(n)?t.ownerDocument?t.ownerDocument.body:t.body:ol(n)&&od(n)?n:e(n)}(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=oi(o);if(i){let e=oO(a);return t.concat(a,a.visualViewport||[],od(o)?o:[],e&&n?oC(e):[])}return t.concat(o,oC(o,[],n))}function oO(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ob(e){let t=ov(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=ol(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=r3(n)!==i||r3(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function ow(e){return oc(e)?e:e.contextElement}function o_(e){let t=ow(e);if(!ol(t))return r4(1);let n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ob(t),a=(i?r3(n.width):n.width)/r,s=(i?r3(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}let oE=r4(0);function oR(e){let t=oi(e);return og()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:oE}function oN(e,t,n,r){var o;void 0===t&&(t=!1),void 0===n&&(n=!1);let i=e.getBoundingClientRect(),a=ow(e),s=r4(1);t&&(r?oc(r)&&(s=o_(r)):s=o_(e));let c=(void 0===(o=n)&&(o=!1),r&&(!o||r===oi(a))&&o)?oR(a):r4(0),l=(i.left+c.x)/s.x,u=(i.top+c.y)/s.y,d=i.width/s.x,h=i.height/s.y;if(a){let e=oi(a),t=r&&oc(r)?oi(r):r,n=e,o=oO(n);for(;o&&r&&t!==n;){let e=o_(o),t=o.getBoundingClientRect(),r=ov(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,d*=e.x,h*=e.y,l+=i,u+=a,o=oO(n=oi(o))}}return oe({width:d,height:h,x:l,y:u})}function oS(e,t){let n=om(e).scrollLeft;return t?t.left+n:oN(oa(e)).left+n}function oT(e,t,n){void 0===n&&(n=!1);let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:oS(e,r)),y:r.top+t.scrollTop}}function oA(e,t,n){let r;if("viewport"===t)r=function(e,t){let n=oi(e),r=oa(e),o=n.visualVie
554wport,i=r.clientWidth,a=r.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;let e=og();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:s,y:c}}(e,n);else if("document"===t)r=function(e){let t=oa(e),n=om(e),r=e.ownerDocument.body,o=r5(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=r5(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),a=-n.scrollLeft+oS(e),s=-n.scrollTop;return"rtl"===ov(r).direction&&(a+=r5(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(oa(e));else if(oc(t))r=function(e,t){let n=oN(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ol(e)?o_(e):r4(1),a=e.clientWidth*i.x;return{width:a,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{let n=oR(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return oe(r)}function oD(e){return"static"===ov(e).position}function oP(e,t){if(!ol(e)||"fixed"===ov(e).position)return null;if(t)return t(e);let n=e.offsetParent;return oa(e)===n&&(n=n.ownerDocument.body),n}function oI(e,t){let n=oi(e);if(oh(e))return n;if(!ol(e)){let t=oy(e);for(;t&&!op(t);){if(oc(t)&&!oD(t))return t;t=oy(t)}return n}let r=oP(e,t);for(;r&&["table","td","th"].includes(oo(r))&&oD(r);)r=oP(r,t);return r&&op(r)&&oD(r)&&!of(r)?n:r||function(e){let t=oy(e);for(;ol(t)&&!op(t);){if(of(t))return t;if(oh(t))break;t=oy(t)}return null}(e)||n}let oK={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e,i="fixed"===o,a=oa(r),s=!!t&&oh(t.floating);if(r===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},l=r4(1),u=r4(0),d=ol(r);if((d||!d&&!i)&&(("body"!==oo(r)||od(a))&&(c=om(r)),ol(r))){let e=oN(r);l=o_(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let h=!a||d||i?r4(0):oT(a,c,!0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+h.x,y:n.y*l.y-c.scrollTop*l.y+u.y+h.y}},getDocumentElement:oa,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e,i=[..."clippingAncestors"===n?oh(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=oC(e,[],!1).filter(e=>oc(e)&&"body"!==oo(e)),o=null,i="fixed"===ov(e).position,a=i?oy(e):e;for(;oc(a)&&!op(a);){let t=ov(a),n=of(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&!!o&&["absolute","fixed"].includes(o.position)||od(a)&&!n&&function e(t,n){let r=oy(t);return!(r===n||!oc(r)||op(r))&&("fixed"===ov(r).position||e(r,n))}(e,a))?r=r.filter(e=>e!==a):o=t,a=oy(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce((e,n)=>{let r=oA(t,n,o);return e.top=r5(r.top,e.top),e.right=r2(r.right,e.right),e.bottom=r2(r.bottom,e.bottom),e.left=r5(r.left,e.left),e},oA(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:oI,getElementRects:function(e){return P(this,null,function*(){let t=this.getOffsetParent||oI,n=this.getDimensions,r=yield n(e.floating);return{reference:function(e,t,n){let r=ol(t),o=oa(t),i="fixed"===n,a=oN(e,!0,i,t),s={scrollLeft:0,scrollTop:0},c=r4(0);if(r||!r&&!i){if(("body"!==oo(t)||od(o))&&(s=om(t)),r){let e=oN(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=oS(o))}let l=!o||r||i?r4(0):oT(o,s);return{x:a.left+s.scrollLeft-c.x-l.x,y:a.top+s.scrollTop-c.y-l.y,width:a.width,height:a.height}}(e.reference,(yield t(e.floating)),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=ob(e);return{width:t,height:n}},getScale:o_,isElement:oc,isRTL:function(e){return"rtl"===ov(e).direction}};function ok(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ox(e,t,n,r){let o;void 0===r&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,u=ow(e),d=i||a?[...u?oC(u):[],...oC(t)]:[];d.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)});let h=u&&c?function(e,t){let n,r=null,o=oa(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return!function a(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),i();let l=e.getBoundingClientRect(),{left:u,top:d,width:h,height:f}=l;if(s||t(),!h||!f)return;let g=r6(d),p=r6(o.clientWidth-(u+h)),v={rootMargin:-g+"px "+-p+"px "+-r6(o.clientHeight-(d+f))+"px "+-r6(u)+"px",threshold:r5(0,r2(1,c))||1},m=!0;function y(t){let r=t[0].intersectionRatio;if(r!==c){if(!m)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||ok(l,e.getBoundingClientRect())||a(),m=!1}try{r=new IntersectionObserver(y,A(T({},v),{root:o.ownerDocument}))}catch(e){r=new IntersectionObserver(y,v)}r.observe(e)}(!0),i}(u,n):null,f=-1,g=null;s&&(g=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=g)||e.observe(t)})),n()}),u&&!l&&g.observe(u),g.observe(t));let p=l?oN(e):null;return l&&function t(){let r=oN(e);p&&!ok(p,r)&&n(),p=r,o=requestAnimationFrame(t)}(),n(),()=>{var e;
554d.forEach(e=>{i&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==h||h(),null==(e=g)||e.disconnect(),g=null,l&&cancelAnimationFrame(o)}}let oM=(e,t,n)=>{let r=new Map,o=T({platform:oK},n),i=A(T({},o.platform),{_c:r});return on(e,t,A(T({},o),{platform:i}))},oL=et(),oU=et();var oW=eU("<okxc-root data-tc-dropdown-container=true>",!0,!1);let oX=()=>{let e;let t=tr(),n=en(oL),r=en(r$),[o,i]=V(!1),[a,s]=V(n.account),[c,l]=V(!n.account),[u,d]=V(),[h,f]=V(),v=function(e,t,n){let r=()=>{var e;return null!=(e=null==n?void 0:n.placement)?e:"bottom"},o=()=>{var e;return null!=(e=null==n?void 0:n.strategy)?e:"absolute"},[i,a]=V({x:null,y:null,placement:r(),strategy:o(),middlewareData:{}}),[s,c]=V();z(()=>{let e=s();if(e)throw e.value});let l=Q(()=>(e(),t(),{}));function u(){let i=e(),s=t();if(i&&s){let e=l();oM(i,s,{middleware:null==n?void 0:n.middleware,placement:r(),strategy:o()}).then(t=>{e===l()&&a(t)},e=>{c(e)})}}return z(()=>{let i=e(),a=t();if(null==n||n.middleware,r(),o(),i&&a){if(null!=n&&n.whileElementsMounted){let e=n.whileElementsMounted(i,a,u);e&&ee(e)}else u()}}),{get x(){return i().x},get y(){return i().y},get placement(){return i().placement},get strategy(){return i().strategy},get middlewareData(){return i().middlewareData},update:u}}(h,u,{whileElementsMounted:ox,placement:"bottom-end"}),m=()=>{let e=a();if(e){let t=(0,p.toUserFriendlyAddress)(e.address);return t.slice(0,4)+"â¦"+t.slice(-4)}return""};r.connectionRestored.then(()=>l(!1));let y=n.onStatusChange(e=>{if(!e){i(!1),s(null),l(!1);return}s(e.account),l(!1)}),C=t=>{if(!a()||!o())return;let n=h().contains(t.target),r=e.contains(t.target);n||r||i(!1)};Z(()=>{document.body.addEventListener("click",C)}),ee(()=>{document.body.removeEventListener("click",C),y()});let O=()=>P(void 0,null,function*(){try{yield r.openModal()}catch(e){(0,g.logDebug)("connect error")}});return em(eY,{component:ts,get children(){return[em(eN,{get when(){return c()},get children(){return em(rY,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return em(rZ,{})}})}}),em(eN,{get when(){return!c()},get children(){return[em(eN,{get when(){return!a()},get children(){return em(rz,{onClick:O,"data-tc-connect-button":"true",scale:"s",get children(){return[em(nW,{get fill(){return t.colors.connectButton.foreground}}),em(r_,{translationKey:"button.connectWallet",fontSize:"15px",lineHeight:"18px",fontWeight:"590",get color(){return t.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),em(eN,{get when(){return a()},get children(){return em(r0,{get children(){return[em(rQ,{onClick:()=>i(e=>!e),ref:f,"data-tc-dropdown-button":"true",scale:"s",get children(){return[em(r_,{fontSize:"15px",fontWeight:"590",lineHeight:"18px",get children(){return m()}}),em(nx,{direction:"bottom"})]}}),em(eQ,{get children(){var b=oW();return eB(d,b),b.style.setProperty("z-index","999"),b._$owner=B,eH(b,em(nD,{onBeforeEnter:e=>{rr(e,[{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(e,t)=>{rr(e,[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(t)},get children(){return em(eN,{get when(){return o()},get children(){return em(r1,{get hidden(){return!o()},onClose:()=>i(!1),ref(t){var n=e;"function"==typeof n?n(t):e=t}})}})}})),G(e=>{var t,n,r=v.strategy,o=`${null!=(t=v.y)?t:0}px`,i=`${null!=(n=v.x)?n:0}px`;return r!==e.e&&(null!=(e.e=r)?b.style.setProperty("position",r):b.style.removeProperty("position")),o!==e.t&&(null!=(e.t=o)?b.style.setProperty("top",o):b.style.removeProperty("top")),i!==e.a&&(null!=(e.a=i)?b.style.setProperty("left",i):b.style.removeProperty("left")),e},{e:void 0,t:void 0,a:void 0}),b}})]}})}})]}})]}})},oj=ti(rs)` 555 padding-left: 0; 556 padding-right: 0; 557 padding-top: 0; 558 559 ${t_("mobile")} { 560 padding-left: 0; 561 padding-right: 0; 562 min-height: 364px; 563 } 564`,oB=ti(rD)` 565 padding: 12px 24px; 566 text-align: left; 567`,oH=ti.div``,oJ=ti.div` 568 flex: 1; 569 display: flex; 570 flex-direction: column; 571 align-items: center; 572 justify-content: center; 573 min-height: ${e=>e.isDeclined?"200px":"325px"};; 574 gap: 24px; 575`,oq=ti(n6)` 576 position: absolute; 577 top: 12px; 578 left: 16px; 579`,oF=ti(rI)` 580 margin-bottom: 0; 581 padding: 16px 24px 24px 24px; 582 min-height: 44px; 583 font-color: ${e=>e.theme.colors.text.contrast}; 584`,o$=ti.div` 585 margin-top: 24px; 586 margin-left: 24px; 587 margin-right: 24px; 588 display: flex; 589 justify-content: center; 590`,oV=ti.div` 591 display: flex; 592 justify-content: center; 593 align-items: center; 594`;function oG(e,t){let n=function(e,t,n){let r=new URL(e);return r.searchParams.append("ret",n),r.toString()}(e,0,"string"==typeof t?t:t.returnStrategy);if(!(0,g.isTelegramUrl)(e))return n;let r=n.slice(n.lastIndexOf("&")+1);return n.slice(0,n.lastIndexOf("&"))+"-"+(0,g.encodeTelegramUrlParameters)(r)}let oz="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAleSURBVHgB7V27chNJFG3LPGweLhkDZV7l2S9Yk5FhZ2TY4UaGbDPwFxhHSwZkZLa/wHZGJpGx0Wq/YIcqMK7iJYN5G7TnNH1Fe/TW9IzGUp+qUc+MJXl0T/e5/bw9pDKKIAjye3t705VKZRqXU0gD3saRHxoayuM6b78f98q4V0YaSorbT5GWDh06VArDsKwyiCGVEdDg3759m8PpVRhwRv00tkuUSAbSx4cPHy6CkFBlAD0lwBj9Bk6vG6NXgWv1/ft3hb/r48ePHzrlfZ7zsJHL5fQxPDxcTXnA2OrIkSM1/xtkFJGs9ZqMnhBw8eLFGRhyyTY6DUsDf/78WX358kWfu8TRo0c1GSMjI/UI2cCxtrW1taFSRmoESG6HoW8pIy9i9A8fPmijR3N1UmAJISGjo6OaEAshSsby8+fPV1VKSIUA5PhbMPYdcZyUlo8fP2rDp2X0RqBMkYyTJ0/qc4PUiEiUAEoNDLyiTI7/+vWrev/+vc7tWcSxY8dSJyIRAiA3AYx9D6es1egcXy6XM2v4KKJEgIRV+I/lJJz1sHKMCxcuLCDX05mxDq92d3fVmzdvNAkHBeKX+PzGYU/j+efGxsZ2UIJLyiGcEUAne/z48b/w0HdxOUK5ef36ta7VHFTwN3z69Ek7bZQA+i+SkJ+YmPgbJdrJD3MiQUZyCjxlrnn37p3OQf2EEydOaFmCHPEyRMmYdSFJsQmA5LCroMAaDmXm1atXB0puOgF9wunTp8U30EHPw0HHkqRYEkS9h+Ef4XSEUkOt73W1MkmwdFOS0LfEg5L0JyQphF/4V3WJrgkwdfuHPGfVcmdnRz9gv0NIINh+AOYgTzuobDxRXaArAmh85PT7PKfxeQwa6KAJkgAputYtCR0TYGSnmvMH0fiCKAndyFFHTpgOF8b/h+eDbnwbrB3xIEDE5U4cc67dN7KqCeOv89wbfz9se8BGBdqq3c+2RQAbWVLPZ23HG78WtIlpdGpb0WbtfK4tAtA0X0ISSJ+OR33QNqYNFBibtURLJwzdZx/+XVa/Xr582df1/LigjVgK0CXDyyvtOOWmJcDovmaS3QvttnDX19f1w8Q5+B2ukObz0EaWP7jfyh80rQUh96/gS25w8KQT6XHVIDP9LrHRi+dhl4XpSd3AUOd8o/c1LAFGenh4p9sF3r59K8TPcWCq0fsaEtCN9Hj8Am3GsRDCjArWRV0CmPuVqfX0W7dymqBySK3o3Llzt+u9py4Bkvu99MSH+E74j6V6bYMaAuzcT+frEQ8cBzd9Rnmc34j+vYYAn/vdQ2yJUnAr+rd9BFy6dImzGHzudwyWAvEF0RrRPgKQ+xeY+tzvHpKhRWEEVQLYYkN1Sc/jOSjzdw4SZJoL58PazrhKADqPZpiyL8PX+91DZncTtjO2JUjLj9f+5CBtqlwud13uaQJMp9sMz2WYzcM9KO1RGdIEiPzQ+L67OTnYMmRWA1Ul6CpfZLqFR3KQqZooBdrmQgBnt6m9vT3lkSwsiZ/hS45aZFYiOqt+bmzEX+nj4jtcfper5yEBpps60H6ALbPz589XMIDAu5k6VlY4HhQPhUIhc7/r7NmzFdqcth9C59ttPOc9VpE4vTBLyNrImivk83m9CA
594S/b5E+IOBNr//pQWyN9kCQQ+6Y4oVv/aYHqeqjBAS5ilm56Kq4e7SGpTZTJCCI3PRIGJba5ClBvgSkDMvW+aoE+S6I9GDZOt/27GiPZOAJ6DE8AT0GnbCeuMLFyB7pwLJ1mU5YE5C15no/w7J12ZeAHoDrjAnGtcuZ4HY6mpRHOpDMDvXZoQQ95YWXoPRghcEJSUXIC18C0oMQgAaZliC9pjWLBKytram4KBaLKmsQW4OIkl6CytGZyclJZyM+6+vrlbjgd/Tr89DePGh7Lfy4+A9JwFWQLsJFVvwasYZgWIOJiQmelra2ti5L3fMxX+oFOPVwC0vqtfRrAkwUWR1H0yNZSJxS2Fxnek0AWNFzLthA8A2y5EDbispgUKao7/GFkcVZCuw3eLiHCfCkFWd7ezvkuZ3dN/nC4HQeyYBTUQyq9esqAZChVaZehpIB7SolQOSHqFraliETbMLDISxp3xT5IfZldcZJZmoVFQ9HkIhawKp9fx8Bz549KyIJJaK4hxswQ0us0egeBTVij1LwgKnFmEdMWPHklqN/qyGAzpiDNNQsXwriw8799cLg1xBgdhvSTHEWr0c8NMv9+n6jD0oHXTcREn1n3E+wTTU2NsZTav9v9d7TsMKP6uhNpqySyhimR/ugzVrlfqIhAaZGtMF2gZeizmGFul9ttgVK0yYvhswWxSF30jgb9DVilB7TsxzChsvN3ttS1EzsuBVOKOXeAH4ae3NQes6cOaNzP46brTYAahk3lHumwJGM48uusC+ba4krfip7XVCuGS2RKdtTMP7dlp9RbQBtgzvKtJC9P2gM2kbq/MZmLdEWAWwbQIJm6Q9YCnwruRa0iRntou7Ptrt7a9v9zqYHb1b+mSfhFyLh6+ft3s5W6GgDB/iDbfgDzqSbk26KQY+uEjE+ne6jTj7f8Q4axilzRfe1QSfBNj4qJoto7T5UHaKrPWRAwpNBJyFq/BcvXtxXXaDrXZQMCVU54nwXCUjUz2AVc3x8vNowpex0k/MFTjZyq/zc2kSHu+T2hf3aWGMji7PaWNU06ypm427k5qS7cXJyMkDOKOCUkRd172m/b2XIqmYntZ1GcLKZ5+7ubhk5Yw0PNSotZuYWloSDvv6Yv+PUqVN6YMV0LzxA39gf6KzcVg7gfFWG6TtaUn1QGpjjmfON4Sk5i643d3a+nzCrqXBQm3hg9h9NszSY2DhOZl6nAVYq2KfDZzeSs4HMNI+aTlE5RqLrkuzSwGvZXyWrsUllb3lrDk/IgSkzNpIIUlkY1ogIth16XWOSiWjW4LmWG/bjd1u37wSprsyLEkEwjCNLRJoxS2USMvWd7RdrrJd7BD/gzJB2O9PioidLIxkmH6VgAadz9n2SQELoK1wHEKehKTHU9YjR9WxljtsmKTWN0NO1qWw/oNjP4HShYkIn2yAhJIOSRamiI+c5S0q0tDBXm4EQbWCzD7xsvlwzo8EsStlMM7fXQ2YWBwsZJALG+b1iYpk6RGiM/pgLUnppdBuZXZ3NFYTI9dOGCAYXn2J0L6SBSfcNzdFx4l7ZpDQ2+6mYllACSlkxeBT/A6Mt6rTZ7SrDAAAAAElFTkSuQmCC";var oQ=eU('<svg><path fill-rule=evenodd clip-rule=evenodd d="M96 51C96 75.8528 75.8528 96 51 96C26.1472 96 6 75.8528 6 51C6 26.1472 26.1472 6 51 6C75.8528 6 96 26.1472 96 51ZM102 51C102 79.1665 79.1665 102 51 102C22.8335 102 0 79.1665 0 51C0 22.8335 22.8335 0 51 0C79.1665 0 102 22.8335 102 51Z"fill-opacity=0.2></svg>',!1,!0),oY=eU('<svg><path fill-rule=evenodd clip-rule=evenodd d="M6 51H0C0 79.1665 22.8335 102 51 102V96C26.1472 96 6 75.8528 6 51Z"></svg>',!1,!0);let oZ=e=>em(o1,{get children(){return[em(o2,{}),em(o5,{src:oz})]}}),o0=e=>em(o1,{get children(){return em(o5,{src:oz})}}),o1=ti.div` 595 position: relative; 596 height: 102px; 597 width: 102px; 598`,o2=ti(e=>{let t=tr(),n=te` 599 0% { 600 transform: rotate(0deg); 601 } 602 100% { 603 transform: rotate(360deg); 604 } 605 `;return em(ti.svg` 606 animation: ${n} 2s linear infinite; 607 transform-origin: center; 608 `,{xmlns:"http://www.w3.org/2000/svg",width:"102",height:"102",viewBox:"0 0 102 102",fill:"none",get children(){var r,o;return[(r=oQ(),G(()=>eW(r,"fill",t.colors.text.primary)),r),(o=oY(),G(()=>eW(o,"fill",t.colors.text.primary)),o)]}})})` 609 height: 102px; 610 width: 102px; 611 position: absolute; 612 top: 50%; 613 left: 50%; 614 transform: translate(-50%, -50%); 615`,o5=ti(n_)` 616 position: absolute; 617 width: 86px; 618 height: 86px; 619 border-radius: 44px; 620 top: 50%; 621 left: 50%; 622 transform: translate(-50%, -50%); 623`,o3=e=>[em(oB,{translationKey:"walletModal.mobileConnectionModal.OKXConnect"}),em(o$,{get children(){return[em(eN,{get when(){return e.sessionConnecting()},get children(){return em(oV,{get children(){return em(oZ,{})}})}}),em(eN,{get when(){return Q(()=>null!==e.universalLink)()&&!e.sessionConnecting()},get children(){return em(rv,{imageUrl:oz,get sourceUrl(){return oG(e.universalLink,"none")},disableCopy:!0})}})]}}),em(oF,{translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){return{name:e.walletInfo.name}},get children(){return["Scan the QR code below with your phoneâs or ",Q(()=>e.walletInfo.name),"âs camera"]}})];ti(rD)` 624 padding: 12px 64px; 625`;let o6=ti(rD)` 626 max-width: 262px; 627`,o4=ti(o6)` 628 font-size: 14px; 629 color: ${e=>e.theme.colors.text.primary}; 630`,o8=ti(nT)` 631 background-color: transparent; 632 color: ${e=>e.theme.colors.text.primary}; 633 padding: 0px; 634`,o9=ti.div` 635 margin: 30px 0; 636 width: 100%; 637 display: flex; 638 flex-direction: column; 639 justify-content: center; 640 align-items: center; 641 gap: 16px; 642 643 ${t_("mobile")} { 644 height: 160px; 645 align-items: center; 646 } 647`,o7=ti(n$)` 648 margin-bottom: 16px; 649`,ie=ti.div` 650 display: flex; 651 flex-direction: column; 652 justify-content: center; 653 align-items: center; 654 gap: 12px; 655 width: 100%; 656`,it=ti.div` 657 background-color: ${e=>e.theme.colors.text.primary}; 658 height: 48px; 659 width: calc(100% - 48px); 660 justify-content: center; 661 border-radius: 24px; 662 display: flex; 663 align-items: center; 664 gap: 8px; 665`;ti(r_)` 666 max-width: 262px; 667 font-weight: 400; 668 font-size: 16px; 669 line-height: 20px; 670 text-align: center; 671 margin-top: 10px; 672 color: ${e=>e.theme.colors.text.contrast}; 673`;let ir=ti(nT)` 674 height: 48px; 675 width: 262px; 676 border-radius: 999px; 677 display: flex; 678 justify-content: center; 679 align-items: center; 680 padding: 12px 24px; 681`;ti(ir)` 682 background-color: ${e=>e.theme.colors.text.primary}; 683`,ti(ir)` 684 background-color: transparent; 685 border-color: ${e=>e.theme.colors.border.secondary}; 686 border-width: 0.5px; 687 border-style: solid; 688`;let io=ti(o6)` 689 font-size: 14px; 690 color: ${e=>e.theme.colors.background.primary}; 691`;ti(o6)` 692 font-size: 14px; 693 color: ${e=>e.theme.colors.text.primary}; 694`;let ii=ti.div` 695 padding-top: 16px; 696 padding-left: 16px; 697 padding-right: 16px; 698 display: flex; 699 align-items: center; 700 gap: 12px; 701 border-top: 0.5px solid 702 ${e=>td(e.theme.colors.icon.secondary,.2)}; 703 margin-top: 24px; 704`,ia=ti(n_)` 705 width: 32px; 706 height: 32px; 707 border-radius: 16px; 708`,is=ti(e=>em(rL,ew({get href(){return e.href},get target(){return e.blank?"_blank":"_self"},get class(){return e.class},get onClick(){return e.onClick}},()=>e.blank?{rel:"noreferrer noopener"}:{},{get children(){return e.children}})))` 709 margin-left: auto; 710 display: flex; 711`,ic=ti.div` 712 display: flex; 713 margin-top: 24px; 714 gap: 8px; 715 align-items: center; 716 justify-content: center; 717`,il=ti(n_)` 718 width: 27px; 719 height: 21px; 720 object-fit: contain; 721`,iu=e=>em(o9,{get children(){return[em(oZ,{}),em(eN,{get when(){return e.loadingTextTranslationKey||e.loadingTextTranslationKey},get children(){return em(o6,{get translationKey(){return e.loadingTextTranslationKey},get children(){return e.loadingText}})}})]}}),id=e=>{let[t]=rb();return Q(()=>{var n;return t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString())})};
721var ih=eU('<svg width=40 height=12 viewBox="0 0 40 12"fill=none xmlns=http://www.w3.org/2000/svg><g clip-path=url(#clip0_4356_43883)><path d="M11.7336 0H0.269322C0.198282 0 0.130151 0.0282212 0.0799182 0.0784542C0.0296852 0.128687 0.00146484 0.196817 0.00146484 0.267857V11.7321C0.00146484 11.8032 0.0296852 11.8713 0.0799182 11.9215C0.130151 11.9718 0.198282 12 0.269322 12H11.7336C11.8046 12 11.8728 11.9718 11.923 11.9215C11.9732 11.8713 12.0015 11.8032 12.0015 11.7321V0.267857C12.0015 0.196817 11.9732 0.128687 11.923 0.0784542C11.8728 0.0282212 11.8046 0 11.7336 0ZM8.00129 7.73303C8.00129 7.80407 7.97307 7.87221 7.92283 7.92244C7.8726 7.97267 7.80447 8.00089 7.73343 8.00089H4.26736C4.19632 8.00089 4.12819 7.97267 4.07795 7.92244C4.02772 7.87221 3.9995 7.80407 3.9995 7.73303V4.26643C3.9995 4.19539 4.02772 4.12726 4.07795 4.07702C4.12819 4.02679 4.19632 3.99857 4.26736 3.99857H7.73343C7.80447 3.99857 7.8726 4.02679 7.92283 4.07702C7.97307 4.12726 8.00129 4.19539 8.00129 4.26643V7.73303Z"></path><path d="M35.7391 4.00018H32.2725C32.2015 4.00018 32.1333 4.0284 32.0831 4.07864C32.0329 4.12887 32.0046 4.197 32.0046 4.26804V7.73465C32.0046 7.80569 32.0329 7.87382 32.0831 7.92405C32.1333 7.97428 32.2015 8.0025 32.2725 8.0025H35.7391C35.8101 8.0025 35.8783 7.97428 35.9285 7.92405C35.9787 7.87382 36.007 7.80569 36.007 7.73465V4.26697C36.0067 4.19611 35.9783 4.12826 35.9281 4.07826C35.8779 4.02825 35.81 4.00018 35.7391 4.00018Z"></path><path d="M31.7379 0H28.2713C28.2002 0 28.1321 0.0282212 28.0819 0.0784542C28.0316 0.128687 28.0034 0.196817 28.0034 0.267857V3.73446C28.0034 3.8055 28.0316 3.87364 28.0819 3.92387C28.1321 3.9741 28.2002 4.00232 28.2713 4.00232H31.7379C31.8089 4.00232 31.8771 3.9741 31.9273 3.92387C31.9775 3.87364 32.0057 3.8055 32.0057 3.73446V0.267857C32.0057 0.196817 31.9775 0.128687 31.9273 0.0784542C31.8771 0.0282212 31.8089 0 31.7379 0Z"></path><path d="M39.7376 0H36.271C36.2 0 36.1319 0.0282212 36.0816 0.0784542C36.0314 0.128687 36.0032 0.196817 36.0032 0.267857V3.73446C36.0032 3.8055 36.0314 3.87364 36.0816 3.92387C36.1319 3.9741 36.2 4.00232 36.271 4.00232H39.7376C39.8087 4.00232 39.8768 3.9741 39.927 3.92387C39.9773 3.87364 40.0055 3.8055 40.0055 3.73446V0.267857C40.0055 0.232682 39.9986 0.19785 39.9851 0.165352C39.9716 0.132854 39.9519 0.103327 39.927 0.0784542C39.9022 0.0535813 39.8726 0.0338512 39.8401 0.0203901C39.8076 0.00692902 39.7728 0 39.7376 0Z"></path><path d="M31.7379 7.99982H28.2713C28.2002 7.99982 28.1321 8.02804 28.0819 8.07827C28.0316 8.1285 28.0034 8.19663 28.0034 8.26767V11.7321C28.0034 11.8032 28.0316 11.8713 28.0819 11.9215C28.1321 11.9718 28.2002 12 28.2713 12H31.7379C31.8089 12 31.8771 11.9718 31.9273 11.9215C31.9775 11.8713 32.0057 11.8032 32.0057 11.7321V8.2666C32.0055 8.19575 31.9771 8.12789 31.9269 8.07789C31.8767 8.02789 31.8087 7.99982 31.7379 7.99982Z"></path><path d="M39.7376 7.99982H36.271C36.2 7.99982 36.1319 8.02804 36.0816 8.07827C36.0314 8.1285 36.0032 8.19663 36.0032 8.26767V11.7321C36.0032 11.8032 36.0314 11.8713 36.0816 11.9215C36.1319 11.9718 36.2 12 36.271 12H39.7376C39.8087 12 39.8768 11.9718 39.927 11.9215C39.9773 11.8713 40.0055 11.8032 40.0055 11.7321V8.2666C40.0052 8.19575 39.9769 8.12789 39.9267 8.07789C39.8765 8.02789 39.8085 7.99982 39.7376 7.99982Z"></path><path d="M25.733 0H22.2664C22.1954 0 22.1272 0.0282212 22.077 0.0784542C22.0268 0.128687 21.9985 0.196817 21.9985 0.267857V3.73446C21.9985 3.8055 22.0268 3.87364 22.077 3.92387C22.1272 3.9741 22.1954 4.00232 22.2664 4.00232H25.733C25.804 4.00232 25.8722 3.9741 25.9224 3.92387C25.9726 3.87364 26.0009 3.8055 26.0009 3.73446V0.267857C26.0009 0.196817 25.9726 0.128687 25.9224 0.0784542C25.8722 0.0282212 25.804 0 25.733 0Z"></path><path d="M25.733 7.99982H22.2664C22.1954 7.99982 22.1272 8.02804 22.077 8.07827C22.0268 8.1285 21.9985 8.19663 21.9985 8.26767V11.7321C21.9985 11.8032 22.0268 11.8713 22.077 11.9215C22.1272 11.9718 22.1954 12 22.2664 12H25.733C25.804 12 25.8722 11.9718 25.9224 11.9215C25.9726 11.8713 26.0009 11.8032 26.0009 11.7321V8.2666C26.0006 8.19575 25.9722 8.12789 25.922 8.07789C25.8718 8.02789 25.8039 7.99982 25.733 7.99982Z"></path>
721<path d="M21.9996 4.26375C21.9996 4.19271 21.9714 4.12458 21.9212 4.07435C21.8709 4.02411 21.8028 3.99589 21.7317 3.99589H17.9994V0.267857C17.9994 0.196817 17.9712 0.128687 17.921 0.0784542C17.8707 0.0282212 17.8026 0 17.7316 0H14.2687C14.1977 0 14.1295 0.0282212 14.0793 0.0784542C14.0291 0.128687 14.0009 0.196817 14.0009 0.267857V11.7273C14.0009 11.7984 14.0291 11.8665 14.0793 11.9167C14.1295 11.967 14.1977 11.9952 14.2687 11.9952H17.7353C17.8064 11.9952 17.8745 11.967 17.9247 11.9167C17.975 11.8665 18.0032 11.7984 18.0032 11.7273V7.99661H21.7366C21.8076 7.99661 21.8757 7.96839 21.926 7.91815C21.9762 7.86792 22.0044 7.79979 22.0044 7.72875L21.9996 4.26375Z"></path></g><defs><clipPath id=clip0_4356_43883><rect width=40.0039 height=12 fill=white>');let ig=e=>{var t,n,r,o,i,a,s,c,l,u;let d=tr(),h=()=>e.fill||d.colors.disable;return u=(l=(c=(s=(a=(i=(o=(r=(n=(t=ih()).firstChild.firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,G(e=>{var t=h(),d=h(),f=h(),g=h(),p=h(),v=h(),m=h(),y=h(),C=h();return t!==e.e&&eW(n,"fill",e.e=t),d!==e.t&&eW(r,"fill",e.t=d),f!==e.a&&eW(o,"fill",e.a=f),g!==e.o&&eW(i,"fill",e.o=g),p!==e.i&&eW(a,"fill",e.i=p),v!==e.n&&eW(s,"fill",e.n=v),m!==e.s&&eW(c,"fill",e.s=m),y!==e.h&&eW(l,"fill",e.h=y),C!==e.r&&eW(u,"fill",e.r=C),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),t},ip=e=>{let t=tr(),n=()=>{(0,g.reportEvent)(g.OKXReportType.CLICK,g.Report_ChooseType_Download_Click,"")};return[em(eN,{get when(){return!t8()},get children(){return em(ii,{get children(){return[em(ia,{src:oz}),em(rk,{get children(){return e.wallet.name}}),em(is,{href:g.downloadUrl,onClick:n,blank:!0,get children(){return[em(r_,{get color(){return t.colors.text.contrast},get children(){return em(id,{translationKey:"common.get",children:"GET"})}}),em(nx,{direction:"right"})]}})]}})}}),em(ic,{get children(){return[em(r_,{get color(){return t.colors.disable},get children(){return em(id,{translationKey:"walletModal.mobileConnectionModal.PoweredBy",children:"PoweredBy"})}}),em(ig,{})]}})]},iv=e=>em(o8,{get leftIcon(){return em(n1,{})},get onClick(){return e.onRetry},get children(){return em(o4,{translationKey:"common.retry",children:"Retry"})}}),im=e=>[em(o7,{size:"s"}),em(o6,{translationKey:"walletModal.mobileConnectionModal.connectionDeclined",children:"Connection declined"}),em(eN,{get when(){return e.showRetry},get children(){return em(ie,{get children(){return em(iv,{get onRetry(){return e.onRetry}})}})}})],iy=e=>{let t=tr();return[em(ie,{get children(){return[em(oZ,{}),em(o6,{translationKey:"walletModal.mobileConnectionModal.continueIn",children:"Continue the transaction in OKX Wallet"})]}}),em(ie,{get children(){return[em(it,{get onClick(){return e.onOpenQR},get children(){return[em(n5,{get fill(){return t.colors.background.primary}}),em(io,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Codes"})]}}),em(iv,{get onRetry(){return e.onRetry}})]}})]},iC=ti.div` 722 display: flex; 723 flex-direction: column; 724 justify-content: center; 725 align-items: center; 726 width: 100%; 727 gap: 12px; 728`,iO=ti(r_)` 729 max-width: 262px; 730 font-weight: 400; 731 font-size: 16px; 732 line-height: 20px; 733 text-align: center; 734 margin-top: 10px; 735 color: ${e=>e.theme.colors.text.contrast}; 736`,ib=ti(ir)` 737 background-color: ${e=>e.theme.colors.text.primary}; 738 margin-left: 24px; 739 width: calc(100% - 48px); 740 margin-right: 24px; 741`,iw=ti(o6)` 742 font-size: 14px; 743 color: ${e=>e.theme.colors.background.primary}; 744`,i_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAKuSURBVHgB7d3RcdpAFIXhYyfvUIKowHQQUkFEBQwVABXIVAAd4BJIBXIqEOlAHSAqUPYCiZmMsfHo4rNozjdzkzxkPGt+Wxit177D2wZhfhz/TsJ0IZeowmyO8zPMMz5oECYPU2tcpsDhA/giGUBfcFsnwztWESyy7bPCGVlkC23zZP899vvr060svi0zOA1QRL7YNk5uD/wdXr7ikc/3/T78kUJYUgvwAGH5ZpegLfQKl6WyADWE5h5CpQBkCkCmAGQKQKYAZApApgBkX+Gs3+8jyzJ0u81eXM9mM2w2G3hI0xSj0ajRmqqq2q+pLEt4c73Nmud57WG9XrutqSiK2sNqtXK/LR3tJajT6cBL08/Ga9JzAJkCkCkAmQKQKQCZApApAJkCkCkAmQKQKQCZApApAJkCkLkHsI2LttrtdvDm/q2JtiO2WCzQhEWcz+f7fze9l287WLamyWSCJm5mR8xrkiSpPWy32zpEjPJ9RMw7YiEAPNhnkHbE5CwFIFMAMgUgUwAyBSBTADIFIFMAMgUgUwAyBSBTADIFIFMAsmgD2Pkwj+1N28GKeZvU/ZCeHYjz2JJcLpfo9XqNN1PsbdkBvel0iibs7YzHY7eDg6dct9h0SK8lW5I6pCefQgHIFIBMAcgUgEwByBSATAHIFIBMAcgUgEwByBSATAHIdEjvA65xSM99R8wOsnlE+HtIz8NwOGx8SM/YLp03/QIHMj0HkCkAmQKQKQCZApApAJkCkCkAmQVo772D+FUWoISwbCzALwjLbwuwhrD8e+xzXPGnQmleneK0xCDihbZ1EnvgvxwDlHj5/fJyfbbZ8eql/wm39VF0i/OEdzyCv8i2ziMulODwJHFL71zMk+PM5f0ObxuEScM8hOmHifewVVzs7kKJw2ssu9Y/n/uPfwA3U3U3Q3Ht+AAAAABJRU5ErkJggg==",iE=e=>{let t=e=>{switch(e.getTag()){case g.OKX_APP_WALLET:return em(il,{src:i_});case g.OKX_INJECT_WALLET:return em(il,{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAAoCAYAAABerrI1AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZOSURBVHgB7VlrbFNVHP/dR2/XPVv26tYyOwmogGE8RMg06xJjIDzcEKOEKOOLiR/c+GIiH8zYF1ATw5QYjY8wEyJiEDcfkcSEbfrFYLKNx4cJCW0GOMbG7LDr+rr3+D+37Vbm2nU41mL4Jb/d2557zs7v/F/n3AIzw0k8THQR2QKxl3iU6MA8wxwVw9LMw9G5zIugXgAsQ9iLeRCWCRaayWJ3DQcAlqF0Yo4Qo9dmZC7qcJfIpFiaThfmCCF6ZchsCHN5WE7loaqqKtTVzewFbrcbbW1tCfs6HA40NDQkbOd9+Rj3AkldgP4xSwaaeMK+TqczaV8SnIoLzgki/od4IOp+wQNR9wvmRZTH40EmIaXiy2sN50zggpqamhK2d3d3o6urC4nQ19d3x6LkyxL2lizCkxVWVIxP4KFF+YCqQcjP8Ughrc/HQh3lI952U1+/G/9F1GxwuVwJRXFBtbW1mA12iwXvlhej2myCGgrrM5NEPj0RgsCIdE/kV0kVEDQIbfljvhbLDOIyIqZetlvxXUUJ1mfLCIeCsz6vSQyKxhq8RXm917Y9s296e9pFNVaU460yC/KUuU2FkeHkkGoWx4YPD9Y91RzfllZRr9isaCyKxsxdBoAoyhA94wdcW5yTFkubKLssorG4ACrTIvGSCBq1a2QZJuqRz+gzv6FtI/8LjfHPInK8480Thw45eJeUdun3AtZdK1FwMUBudKcgSgWQ8nKRvXUr8ra/BBSVQDSSNt8lCENfQbzRRpb1kyj+dPx+VzWr0uWjdFObkiiz2axzJvB0nOzowNumZ8ZxKQi2ZSnac25g+9mRqcMSzVQpK0PhkU8wnGPDsZ4wLvzih9cno/qRR1G/qhk2+6sIX6yHODEwNaCuUIQsMifrNJtTSumtra16LUoEC6XjRAWYjh7o7Oy847uTl0/j4O+fIscfxoefXYEpGIIoUOpWDCg//i16/GXYd9KP66PhuKkx2CwyPtiVjXXFV4HzNUDQO9kWEaYhCKUlpZhKZKVU26fjzOBZPSbGFQltzqJJF8yt24mbWVa8fsKH63/FC+IQ6DsVrx334UbIDsG6h2cJ+ppLiF6JRsVWk5ZEcfXWoC5KI/68ogBXi7N0F8zetA0dF0MYvK1GV/7fGCax3/TQTemeSF7ngsRIYebCtfCAIz2ifEOR7MUnrjF8UV0ETQ3D8PBS/PpHMGl6p70FLgxMUPKwQdNnL0TE6bsNcmGY0iPKSKsbS8kCiTpnM+HMCqpXgQCyjdKs/f8OcOtQfWJGEiIRDSRGJm3UV2TpqVMFxmgMamzSDY+tL8SY34NVdpG8KUndorpU85iEsK8/aiRBtx6XQsUATLJ40iJqZWGlXkR191NJGO0oRk0yjvf/iB1rslCal9j/ShcZsG2FAuHmCUT2DuJkPHGSD/SlVKfa29sjE0iAZHWKHy2mv0Ib8FCNyWdTcQXo12PXOrFjbT1adxej8esJDN0KIHaQYGQhq0XCRy9mozhnEOFLp2CIitHHECLuHBLVjrS8zJSyDXj8yGYEtVCkxGBKWFluKT7fehBCYBF+OB9A9yUVuSYJq+0Snl8jIyiO4lrPbmxUXHo86gMIalQEgzzuqYyJcuEe/NiVDEvffBrKklw9nqa8ILLqCpNRv/xZvLBsE5ZY7JhgQdzy38aXPacwcrMT7y0+R/mAXC1acFk0qsJU9ozV1/fGRLUSm7CAyC01w7Z/HYSsSNFk+qoL+gRjIrngEFQ97iipUX4TcGblMMqMPsR2ESK0iJ+JWZ5gSFhtqu13xxJFOxYY3iEPxr53Q99za7GtaVQQi7giX3FZo2RNolXizhIvbFl+vR7psUZXjS8IxZYqyy1cEB87VhT4BwtxAxYQXtcoFFmBcZlFL7jcWjFhOrWp+0KDhvcrPciRo64aTfuMLKkppS3GDX1vx8aNr3S/ETcRrVhAePtHYAgIyKqks
7445UQZ6k4NwSdpd5YHMRGc4DERzKeIOqW9KiyaX9WnCCOeFF+Ik/+Jiy0xa6MwnP2T9r8iTAtLpi0WMQnGZaIfryzzAeJm1O3kBFhg9ZlMNZuNjzx0+np4yUq3Q7iAeIqYhUWBm5ih7K2pOvRvWsdQUV6zhhiVd7ghPnj5T7U5I+7BbnArYVHuhW/v1WodSd82fgPHg20OjkMhvcAAAAASUVORK5CYII="});case g.OKX_TG_WALLET:return em(il,{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAAoCAYAAACxbNkLAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAnUSURBVHgBrVlrbFxHFT5z967tddx4/Urc4LrrVirETogJBCFBGic/UqAVsSXUCNFAgtQKCQmFfwUJjIVUIfGjEVRFqIi2ilBDEbFDS6GAlKSlaoJ4mMY0CaHOJrZSnMTxOvF7d+cwrzMz17vr9RpOctf3zp3HeX7nzFwGy+iVbG8PD/L7AFgvIKYYY4gIDAoJGQPx0jWIZ9VXDZFvbbt+UZIYDDNkw/kYG+hjQ2n4H8guOoi9yYDn+8W6h2WzZAo8QdB1tgKyQDTrbqyoxKiEBH8OmojRM2hFyEnkc8DgSD6IScEysFaBpDCM506KGbeh1rNdSGmacWSekazFDCPebGh/I21uTrcqg4I2tNYcxjDcvRahAvUjLcOxmwvutcZBcYpKa1wtJN/pS7aZf+KZ7lUn+Q7tWyW67KNG2zZtYkSu72k11O2mZzfksv2wBmKD870piC1dVg+BWsdonxn3cM4mFwyMrjHiZwysg1F31MyqTmQJ5uax7dZaZEdkbr5gT1/81VNQAQVCmH6jX+BGGK19TlYyAc0VV9JKih9wca76qnbJleihxnIjHkeaX1sGTXxGrKjulYfoFZXCOEhwqowCZV7nZGpax6vHinInboapfvovchvrxAhhn3NbrRBEci/0lKXdFJzrMbs2sooFCsVk3VKTXEc/WCeQmiYXMrEq/6Jp1cCgejNtPe1PhjcN3TyCksxEH4IBGuO04kk7p3U7iUFqVeyACikEbRMPkZ17y2XS79yBP//6umyQWG7BSPbeeG8Cdh3YpJam8DYhoQS+fmUeTh69RlODGU9RyXoOfAA2pKpB5yzyX2A2yhAqphAVp8b0BpuNRyir/OaHackUKzXB5p1JaBGCWQuqCXQ2lgK9/L1/l1y8ub0GdrdvUpYjbaCHEmuQR1gIVTQwFkkVyLQbAis7A9POrmPHWJBiDcuzhBoOrXNrmNcTM4YVyxQimKD107jydAtkKwqFOufqBKvQjXmsluPHvdfAQImA8tUqFFogkNKm4IVx63p2Ura6GaVQpE1fw+UspIAe0cQsGjAicQgZKhTITK2zvJrR5AoV2QS5KxBzVQOzRRq6eFqJ1DIcNQAZUSw2wFrkUaAQbeFoq0Wj4hUn5px7KGLgCahKKDNejuMmb5mecnlZjRikXYvL+YWorXGorWxc1yXjNlZssjTQz8t4DWq3NouhXV9lKFv+VEbs2FwP+rUY7WV0lDO4IaD3xtUFW1Vrt9Q3UpjXnhmT74nDiD06BaR3PthgRWVUCRrvSn24DmqTMdt/IbcOzow+DJnbW+DKdDPML26EnOhXG0JGjB/O59iJ0VwwlPlCQ7qkQC8JgQiwfb+l2LR7H+aerTXFm69vPiuEXig6eeeDSfj277rNIC+1+glCvFpY2giDw1+Dq5NbYJGvbBRVmDF4IYjHBi70FQoWyC60NSB/Ibchl6CaTPUxrmFRfiWyKkDU8+u6xG49xN1f0g/D0yd/AJeud8JingMVeKUuuaeMIR6MZ3N/7/rljcOFAvmFofp1RSfayhpRwztaANA5h5cHMjkHp3KGqnKtkLff289eGzkI2WwtVErCFZMCj57+2OBkf0QgTpsyKxg4AVFnfW4YkM8cXVlSHoVMla0E0eFP6/xVWOb3734eaLO31mtmMffdzcecpYLl2dpdumIG5liBZdsA2uusJI6LQXJkwFuzTfjGvx6F/xflgPcf/O1UigSiXQolSFt4SNhVDKGNKBNbKjRXlSci23WTQU9f3M/uLCTKxstqLxFTybOZhefleiGdC/hk8pxys7lMDuan8/aswey71U+iPgYt7dUlhWm5txpupOfBP/pZiLfC8FiPAPCy4Reh2jiDR9oT0LOpGt76zyL8/NJc5H0YsJ7U4OVkSPmH9Ol+Nd/HnxrD1599v6QlfjL+caitD/1RNhudf/M2fGPL3yL9Wz77BDQ+huUR0lBXQxV87r4a6E0loL5KnenApelsQc7N5sXzTNXhEE3Bod2HSnZmt8Vz07kV3Wo2k4XE+hiYaswANaP9a0H/+h0PQTlpQjF4W0scDm9dDzs2VKk2H09Hp3NF52hNBLtC9LfP6siKMVdWllejCXZmY0pnG62gIsPX39cFsyWmXScssP/+WvjSB9dBa62uIMZmcvDc+Rl4orMO2tbpWvrynVxR1iYWeSpEs4/xj5gsRaC8OPkwbrp6x4iFtdxcvA7cYYum9roQHu+8C/aKGEkat5L04sUZOD46B099osEKI+nmXM7kyyglGEuFlmHKoKy4ZksTRhl34VHUVePi5aLHy862BPy0pynS5+Z8Hp58+xZcyOThpYea4R5PmJwYOz6bK7o3yYvG0PgGoTMrZBfKCeRZ1cQOmhOjIprJXL8CieY2+/zm+Cwc+EMePnl3DWxtroZ/Ti3B0fN3oDrG4NjelohlJP1jchEY8qKc1MaDTGiczEK3fwa6qjxjtghIZRGaA4qIoI7WT1+DJU8gSWcnFtTl03N7NkBbXVgwflQgXCkdZzkMh27LbBiEqDAfeaTeBH1xahK5RgGLOSRBk+zk7T1bE/CpLzZF3DF/1ztwE3dAOfrOmUl4dlcLdDVVRdpHJpdKuk02z0+wn2W2o90sGF3TSbM9PDFh7rYZXnYFf+vBXCzaGLJneep3MbsOf/T6UbZUvq5VYf+VzevhWx9ttJny4B8n4K335wv7iumu8ZqOQGg0Dbb85OacOXqW4BevSPKqolX3peMufaYNrsxRGGO3C+qqCmdZW+M5tVy5KyauF9+9DTuPj8HIrSUYFxA+cnOxaF/BwwsLh+5OB0GAQ8QAWsZ84UxsqT2NruPM4ZacxvgmFazaCvbO7KGWV/L7tj8DYTijoHc118RsFvpeHYddv7oK00u5gveCt4zY0g7I2QMBgyec0fRBvUqx3JWjagvBiTFtITov8C3qFEDjyF+NLc1VUz0Buz/0i4rrUAKs5VcuwIHMoY60EujxhuFT4u8Rt1GgzyKIVJCSZrX2kXDRMknHyWCRzh2XIOQR3XiyOm7veAX2dL2M4Am6lisRg4HRx+4/Qlyq+qLvydazwnifFret9IJ552rMiyV6RnM+YET2cg612TzEwB0gMX/KtsYRVlM1ixNTD7BsPg6VkAAM8bky/82LX37g+367hdTnp7qTwrH6ufxoTFsFD598ScD7Tqeblh940UE5o70Ii3yWsF/LtRNNz22ANy48ys5d3SPPhVakULwXwH1q28bw0NBntJsVFYjox1PdqZj45ioLXvntyO8T/TxvRCGgtuBRmJDdOF3No39ypP+nxfPQmff2nv7Tua+mauKxfaK1ezaXT8rKbkkgcWN1mJ6cz56GoOpI+lBHyY/J/wUwVKGzeWclZQAAAABJRU5ErkJggg=="});default:return em(il,{src:i_})}};return[em(iC,{get children(){return[em(o0,{}),em(iO,{translationKey:"walletModal.mobileConnectionModal.appAndTelegram.text",children:"OKX Wallet supports OKX app and Telegram Mini Apps"})]}}),em(iC,{get children(){return em(eR,{get each(){return e.connector},children:n=>em(ib,{get leftIcon(){return t(n)},onClick:()=>e.walletConnectClick(n),get children(){return em(iw,{get translationKey(){return n.walletNameKey},get children(){return n.walletName}})}})})}})]},iR=e=>{var t,n,r;tr();let[o,i]=V(!1),[a,s]=V(!1),c=Q(()=>(e.walletConnector.length>1||1==e.walletConnector.length&&e.walletConnector[0].getTag()!==g.O
744KX_APP_WALLET)&&!a()),[l,u]=V(null),d=en(r$),h=()=>null===e.universalLinkParams()&&!e.connectError();z(()=>{var a=e.universalLinkParams();let s=c(),l=o(),d=h();if(s==t||l||d||(s?((0,g.reportEvent)(g.OKXReportType.PAGE_IN,g.Report_Proceed_Proceed_View,""),(0,g.reportEvent)(g.OKXReportType.PAGE_OUT,g.Report_ChooseType_ConnectWallet_View,"")):((0,g.reportEvent)(g.OKXReportType.PAGE_OUT,g.Report_Proceed_Proceed_View,""),(0,g.reportEvent)(g.OKXReportType.PAGE_IN,g.Report_ChooseType_ConnectWallet_View,"")),t=s),l==n||d||(l?(0,g.reportEvent)(g.OKXReportType.PAGE_IN,g.Report_Proceed_QRCode_View,""):(0,g.reportEvent)(g.OKXReportType.PAGE_OUT,g.Report_Proceed_QRCode_View,""),n=l),d!=r&&(d?(0,g.reportEvent)(g.OKXReportType.PAGE_IN,g.Report_Loading_ConnectWallet_View,""):(0,g.reportEvent)(g.OKXReportType.PAGE_OUT,g.Report_Loading_ConnectWallet_View,""),r=d),a){e.setLastSelectedWalletInfo(A(T({},e.wallet),{openMethod:"universal-link"})),(0,g.logDebug)(`createEffect ${JSON.stringify(a)}`);var f=a.connectRequest;f&&u((0,g.getAppWalletShortDeepLink)(f.topic,f.clientId))}e.connectError()&&i(!1)}),Z(()=>P(void 0,null,function*(){try{yield e.connect().catch(e=>(0,g.logDebug)(`MobileConnectionModal onMount error ${JSON.stringify(e)}`))}catch(e){console.error("Error while connecting:",e)}}));let f=()=>{s(!1),(0,g.reportEvent)(g.OKXReportType.CLICK,g.Report_Proceed_Retry_Click,"");try{e.connect()}catch(e){console.error("Error while connecting:",e)}},p=()=>{(0,g.reportEvent)(g.OKXReportType.CLICK,g.Report_Proceed_QRCode_Click,""),i(!0),e.setLastSelectedWalletInfo(A(T({},e.wallet),{openMethod:"qrcode"}))},v=()=>{i(!1),e.setLastSelectedWalletInfo(A(T({},e.wallet),{openMethod:"universal-link"}))},m=()=>{o()?v():e.onBackClick()},y=t=>{var n=e.universalLinkParams();switch(t.getTag()){case g.OKX_APP_WALLET:(0,g.reportEvent)(g.OKXReportType.CLICK,g.Report_ChooseType_ConnectWallet_Click,JSON.stringify({Report_WalletType_Key:"app"})),tN()?(s(!0),n&&t.openWallet(n)):p();return;case g.OKX_TG_WALLET:(0,g.reportEvent)(g.OKXReportType.CLICK,g.Report_ChooseType_ConnectWallet_Click,JSON.stringify({Report_WalletType_Key:"tgminiwallet"})),null==d||d.closeModal(),n&&t.openWallet(n);break;case g.OKX_INJECT_WALLET:null==d||d.closeModal(),n&&t.openWallet(n)}};return V(!1),z(()=>{}),em(oH,{"data-tc-wallets-modal-connection-mobile":"true",get children(){return[em(eN,{get when(){return!e.backDisabled},get children(){return em(oq,{icon:"arrow",onClick:m})}}),em(eN,{get when(){return Q(()=>null===e.universalLinkParams())()&&!e.connectError()},get children(){return[em(oB,{children:"OKX Connect"}),em(iu,{}),em(ip,{get wallet(){return e.wallet}})]}}),em(eN,{get when(){return null!==e.universalLinkParams()||e.connectError()},get children(){return[em(eN,{get when(){return Q(()=>!!o())()&&!e.connectError()},get children(){return em(o3,{get universalLink(){return l()},get walletInfo(){return e.wallet},get sessionConnecting(){return e.sessionConnecting}})}}),em(eN,{get when(){return!o()},get children(){return[em(oB,{children:"OKX Connect"}),em(oJ,{get isDeclined(){return e.connectError()},get children(){return[em(eN,{get when(){return e.connectError()},get children(){return em(im,{onRetry:f,get showRetry(){return e.showRetry}})}}),em(eN,{get when(){return!e.connectError()},get children(){return[em(eN,{get when(){return c()},get children(){return em(iE,{get connector(){return e.walletConnector},walletConnectClick:y})}}),em(eN,{get when(){return!c()},get children(){return em(iy,{onOpenQR:p,onRetry:f})}})]}})]}}),em(ip,{get wallet(){return e.wallet}})]}})]}})]}})},iN=ti.div``,iS=ti.div` 745 flex: 1; 746 display: flex; 747 flex-direction: column; 748 align-items: center; 749 justify-content: center; 750 min-height: 200px; 751 margin-bottom: 16px; 752`,iT=ti(rI)` 753 margin-bottom: 0; 754 padding: 10px 24px 0px 24px; 755 font-size: 14px; 756 font-color: ${e=>e.theme.colors.text.contrast}; 757`,iA=ti.div` 758 margin-top: 24px; 759 margin-left: 24px; 760 margin-right: 24px; 761 margin-bottom: 10px; 762`,iD=ti.div` 763 display: flex; 764 justify-content: center; 765 align-items: center; 766`,iP=e=>[em(iA,{get children(){return[em(eN,{get when(){return e.sessionConnecting()},get children(){return em(iD,{get children(){return em(oZ,{})}})}}),em(eN,{get when(){return Q(()=>null!==e.universalLink)()&&!e.sessionConnecting()},get children(){return em(rv,{imageUrl:oz,get sourceUrl(){return oG(e.universalLink,"none")},disableCopy:!0})}})]}}),em(iT,{translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){return{name:e.walletInfo.name}},get children(){return["Scan the QR code below with your phoneâs or ",Q(()=>e.walletInfo.name),"âs camera"]}})],iI=ti.div` 767 display: flex; 768 flex-direction: row; 769 justify-content: center; 770 align-items: center; 771 padding-bottom: 20px; 772 margin-top: 10px; 773 border-bottom: 0.5px solid ${e=>td(e.theme.colors.icon.secondary,.2)}; 774 width: 100%; 775`,iK=ti.div` 776 flex: 1; 777 margin-left: 16px; 778 display: flex; 779 flex-direction: column; 780`,ik=ti(rD)` 781 font-weight: 500; 782 font-size: 18px; 783 text-align: left; 784`,ix=ti(r_)` 785 font-weight: 500; 786 font-size: 14px; 787 margin-top: 5px; 788 color: ${e=>e.theme.colors.text.contrast}; 789`,iM=ti(n_)` 790 width: 48px; 791 height: 48px; 792 margin-left: 24px; 793`,iL=ti(nT)` 794 border-radius: 20px; 795 padding: 6px 14px; 796 margin-right: 24px; 797 display: inline-flex; 798 background-color: transparent; 799 border: 0.5px solid ${e=>e.theme.colors.text.secondary};; 800 white-space: nowrap; 801 cursor: pointer; 802`,iU=ti(r_)` 803 font-size: 12px; 804 font-weight: 400; 805 color: ${e=>e.theme.colors.text.primary}; 806`,iW=e=>em(iI,{get children(){return[em(iM,{src:i_}),em(iK,{get children(){return[em(ik,{translationKey:"walletModal.mobileConnectionModal.connectInjectedOpening",children:"Opening OKX Wallet..."}),em(ix,{translationKey:"walletModal.mobileConnectionModal.connectInjectedConfirm",children:"Confirm in OKX Wallet extension"})]}}),em(iL,{get onClick(){return e.injectedRetry},get children(){return em(iU,{translationKey:"common.retry",children:"Retry"})}})]}}),iX=e=>{let t=e.connector.some(e=>e.getTag()===g.OKX_APP_WALLET);return[em(eN,{get when(){return e.injectedOpen()},get children(){return em(iW,{get injectedRetry(){return e.injectedRetry}})}}),em(eN,{when:t,get children(){return em(iP,{get universalLink(){return e.qrLink()},get walletInfo(){return e.wallet},get sessionConnecting(){return e.sessionConnecting}})}})]},ij=e=>{var t,n;tr(),en(r$);let[r,o]=V(null),i=Q(()=>null===r()),[a,s]=V(!1),c=()=>null===e.universalLinkParams()&&!e.connectError();e.setLastSelectedWalletInfo(A(T({},e.wallet),{openMethod:"qrcode"}));let l=Q(()=>null===e.universalLinkParams()&&!e.connectError()),u=Q(()=>null!==e.universalLinkParams()||e.connectError()),d=Q(()=>u()&&e.connectError()),h=Q(()=>u()&&!e.connectError());z(()=>{(0,g.logDebug)("TON customEvent.detail :::",z);var r=e.universalLinkParams();(0,g.logDebug)("TON customEvent.detail :::",JSON.stringify(r));let o=i(),a=c();if(o==t||a||(o?((0,g.reportEvent)(g.OKXReportType.PAGE_IN,g.Report_ChooseType_ConnectWallet_View,""),(0,g.reportEvent)(g.OKXReportType.PAGE_OUT,g.Report_Proceed_QRCode_View,"")):((0,g.reportEvent)(g.OKXReportType.PAGE_OUT,g.Report_ChooseType_ConnectWallet_View,""),(0,g.reportEvent)(g.OKXReportType.PAGE_IN,g.Report_Proceed_QRCode_View,"")),t=o),a!=n&&(a?(0,g.reportEvent)(g.OKXReportType.PAGE_IN,g.Report_Loading_ConnectWallet_View,""):(0,g.reportEvent)(g.OKXReportType.PAGE_OUT,g.Report_Loading_ConnectWallet_View,""),n=a),r){e.setLastSelectedWalletInfo(A(T({},e.wallet),{openMethod:"universal-link"}));var l=r.connectRequest;l&&p((0,g.getAppWalletShortDeepLink)(l.topic,l.clientId));var u=e.walletConnector.find(e=>e.getTag()===g.OKX_INJECT_WALLET);u&&(u.openWallet(r),s(!0),e.setLastSelectedWalletInfo(A(T({},e.wallet),{openMethod:"inject"})))}});let[f,p]=V(null);Z(()=>P(void 0,null,function*(){try{yield e.connect().catch(e=>(0,g.logDebug)("DesktopConnectionModal connect catch error ",JSON.stringify(e)))}catch(e){(0,g.logDebug)("DesktopConnectionModal connect error ",JSON.stringify(e))}}));let v=()=>{o(null),(0,g.reportEvent)(g.OKXReportType.CLICK,g.Report_Proceed_Retry_Click,"");try{e.connect()}catch(e){console.error("Error while connecting:",e)}},m=()=>{var t=e.walletConnector.find(e=>e.getTag()===g.OKX_INJECT_WALLET);t&&y(t)},y=t=>{var n=e.universalLinkParams();n&&(t.openWallet(n),e.setLastSelectedWalletInfo(A(T({},e.wallet),{openMethod:"inject"})))};return em(iN,{"data-tc-wallets-modal-connection-mobile":"true",get children(){return[em(oB,{children:"OKX Connect"}),em(eN,{get when(){return l()},get children(){return[em(iu,{}),em(ip,{get wallet(){return e.wallet}})]}}),em(eN,{get when(){return u()},get children(){return[em(eN,{get when(){return d()},get children(){return em(iS,{get children(){return em(im,{onRetry:v,get showRetry(){return e.showRetry}})}})}}),em(eN,{get when(){return h()},get children(){return em(iS,{get children(){return em(iX,{get connector(){return e.walletConnector},get wallet(){return e.wallet},get sessionConnecting(){return e.sessionConnecting},qrLink:()=>f(),injectedRetry:m,injectedOpen:a})}})}}),em(ip,{get wallet(){return e.wallet}})]}})]}})},iB=e=>{let{locale:t}=rb()[1];z(()=>t(e.language));let n=Q(()=>tN()||tV());return z(()=>{e.opened&&tT()}),em(oj,{get opened(){return e.opened},onClose:()=>e.onClose("action-cancelled"),"data-tc-wallets-modal-container":"true",get children(){return[em(eN,{get when(){return e.loadingBeforeConnect()},get children(){return[em(oB,{get children(){var r;return null==(r=e.walletInfo)?void 0:r.name}}),em(iu,{})]}}),em(eN,{get when(){return!e.loadingBeforeConnect()},get children(){return em(eY,{get component(){return n()?iR:ij},get wallet(){return e.walletInfo},onBackClick:()=>{},backDisabled:!0,get connect(){return e.connect},get universalLinkParams(){return e.universalLinkParams},get lastSelectedWalletInfo(){return e.lastSelectedWalletInfo},get setLastSelectedWalletInfo(){return e.setLastSelectedWalletInfo},get connectError(){return e.connectError},get showRetry(){return e.showRetry},get sessionConnecting(){return e.sessionConnecting},get walletConnector(){return e.walletConnector()}})}})]}})},iH=()=>{let e=en(r$),t=en(oL),[n,r]=V(!1),[o,i]=V(!1),a=()=>{var e;return(null==(e=tq.connectRequestParameters)?void 0:e.state)==="loading"},[s,c]=V(null);window.addEventListener("okx-ton-connect-connection-info-before-jump",e=>{(0,g.logDebug)("TON :::",JSON.stringify(e.detail)),e.detail&&"connectInfo"in e.detail&&c(e.detail.connectInfo)});let l=Q(()=>{var e;if(!a())return null==(e=tq.connectRequestParameters)?void 0:e.value}),u=t=>{e.closeModal(t)};return ee(t.onStatusChange(e=>{e&&u("wallet-selected")},()=>{r(!0)})),em(iB,{get opened(){return ng()},get walletInfo(){return np()},loadingBeforeConnect:()=>{var e;return(null==(e=tq.connectRequestParameters)?void 0:e.state)==="loading"},connect:()=>new Promise((n,o)=>{c(null),r(!1),e.handleConnect(e=>P(void 0,null,function*(){var n;return yield t.connect({openUniversalLink:!t8()&&!tV()&&tN(),tonProof:null==(n=l())?void 0:n.tonProof,redirect:null==e?void 0:e.returnStrategy,tmaReturnUrl:null==e?void 0:e.tmaReturnUrl})})).then(e=>{n(e)}).catch(e=>{u("action-cancelled"),(0,g.logDebug)("TonSingleWalletModal connect error",JSON.stringify(e)),o(e)})}),onClose:u,universalLinkParams:s,get lastSelectedWalletInfo(){return nm()}
806,setLastSelectedWalletInfo:nC,get language(){return tq.language},connectError:n,walletConnector:()=>(t1(!1),tq.walletConnector.filter(e=>e.enable)),showRetry:!0,sessionConnecting:o})},iJ={common:{openWallet:"æå¼é±å
",get:"è·å",close:"å
³é",retry:"åè¯ä¸æ¬¡"},button:{connectWallet:"è¿æ¥é±å
",dropdown:{copy:"å¤å¶å°å",copied:"å°åå·²å¤å¶",disconnect:"æå¼è¿æ¥"}},notifications:{confirm:{header:"æå¼ {{ name }} è¿è¡ç¡®è®¤"},transactionSent:{header:"å·²åé",text:"å³å°å®æï¼è¯·ç¨å"},transactionCanceled:{header:"已忶",text:"è´¦æ·æªåç任使´æ¹"}},walletModal:{mobileConnectionModal:{OKXConnect:"OKX Connect",showQR:"å±ç¤ºäºç»´ç ",scanQR:"ä½¿ç¨ææºææ¬§æé±å
çç¸æºæ«æä¸æ¹äºç»´ç ",continueIn:"卿¬§æé±å
ä¸ç»§ç»å®æ",connectionDeclined:"è¿æ¥å¤±è´¥",PoweredBy:"Powered by",appAndTelegram:{header:"è¿æ¥æ¬§æé±å
",text:"欧æé±å
å¯å¨æ¬§æ App å Telegram 使ç¨"},connectApp:"欧æ App",connectMini:"欧æ Mini Wallet",connectInjected:"欧æé±å
æä»¶",connectInjectedOpening:"æ£å¨æå¼æ¬§æé±å
...",connectInjectedConfirm:"请å¨é±å
æä»¶ç¡®è®¤è¿æ¥"}},actionModal:{confirmTransaction:{header:"å¨ {{ name }} ä¸ç¡®è®¤",text:"请ç¨å"},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"}},iq={en_US:iF({common:{openWallet:"Open wallet",get:"Get",close:"Close",retry:"Retry"},button:{connectWallet:"Connect wallet",dropdown:{copy:"Copy address",copied:"Address copied",disconnect:"Disconnect"}},notifications:{confirm:{header:"Open {{ name }} to\xa0confirm."},transactionSent:{header:"Sent",text:"This action\xa0will be\xa0completed in\xa0a\xa0few seconds."},transactionCanceled:{header:"Canceled",text:"Thereâll be no changes to your account."},transactionError:{header:"Error",text:"Thereâll be no changes to your account."}},walletModal:{mobileConnectionModal:{OKXConnect:"OKX Connect",showQR:"Show QR Code",scanQR:"Scan the\xa0QR code below with your phoneâs\xa0or\xa0{{ name }}âs camera",continueIn:"Proceed in OKX Wallet",connectionDeclined:"Connection failed",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"OKX Wallet is available on OKX App and Telegram"},connectApp:"OKX App",connectMini:"OKX Mini Wallet",connectInjected:"OKX Wallet extension",connectInjectedOpening:"Opening OKX Wallet...",connectInjectedConfirm:"Confirm in OKX Wallet extension"}},actionModal:{confirmTransaction:{header:"Confirm in\xa0{{ name }}",text:"Itâll only take a moment."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"}}),ru_RU:iF({common:{openWallet:"ÐÑкÑÑÑÑ ÐºÐ¾Ñелек",get:"ÐÐÐУЧÐТЬ",close:"ÐакÑÑÑÑ",retry:"ÐовÑоÑиÑÑ Ð¿Ð¾Ð¿ÑÑкÑ"},button:{connectWallet:"ÐодклÑÑиÑÑ ÐºÐ¾Ñелек",dropdown:{copy:"СкопиÑоваÑÑ Ð°Ð´ÑеÑ",copied:"ÐдÑÐµÑ ÑкопиÑован.",disconnect:"ÐÑклÑÑиÑÑ"}},notifications:{confirm:{header:"ÐÑкÑойÑе {{ name }} Ð´Ð»Ñ Ð¿Ð¾Ð´ÑвеÑÐ¶Ð´ÐµÐ½Ð¸Ñ ÑÑанзакÑии."},transactionSent:{header:"ТÑанзакÑÐ¸Ñ Ð¾ÑпÑавлена",text:"ТÑанзакÑÐ¸Ñ Ð±ÑÐ´ÐµÑ Ð¾Ð±ÑабоÑана ÑеÑез неÑколÑко ÑекÑнд."},transactionCanceled:{header:"ТÑанзакÑÐ¸Ñ Ð¾Ñменена",text:"Ðзменений в аккаÑнÑе не бÑдеÑ."}},walletModal:{mobileConnectionModal:{showQR:"ÐоказаÑÑ QR-код",scanQR:"ÐÑÑканиÑÑйÑе QR-код ниже Ñ Ð¿Ð¾Ð¼Ð¾ÑÑÑ ÐºÐ°Ð¼ÐµÑÑ Ð½Ð° ÑелеÑоне или {{ name }}",continueIn:"ÐÑодолжиÑÑ Ð²Ñполнение ÑÑанзакÑии в ÐоÑелÑке OKX",connectionDeclined:"ÐодклÑÑение оÑклонено",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"ÐоÑелек OKX доÑÑÑпен в пÑиложении OKX и в Telegram"},connectApp:"ÐодклÑÑиÑÑÑÑ Ðº пÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ OKX",connectMini:"ÐодклÑÑиÑÑÑÑ Ðº мини-ÐоÑелÑÐºÑ OKX"}},actionModal:{confirmTransaction:{header:"ÐодÑвеÑдиÑе ÑÑанзакÑÐ¸Ñ Ð² {{ name }}",text:"ÐÑо Ð·Ð°Ð¹Ð¼ÐµÑ Ð²Ñего неÑколÑко ÑекÑнд."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"}}),zh_CN:iF(iJ),zh:iF(iJ),ar_AE:iF({common:{openWallet:"ÙØªØ Ù
ØÙظة",get:"ØØµÙÙ",close:"Ø¥ØºÙØ§Ù",retry:"إعادة اÙÙ
ØØ§ÙÙØ©"},button:{connectWallet:"ربط اÙÙ
ØÙظة",dropdown:{copy:"ÙØ³Ø® Ø§ÙØ¹ÙÙØ§Ù",copied:"تÙ
ÙØ³Ø® Ø§ÙØ¹ÙÙØ§Ù",disconnect:"Ø¥ÙØºØ§Ø¡ Ø§ÙØ±Ø¨Ø·"}},notifications:{confirm:{header:"Ø§ÙØªØ {{ name }} ÙØªØ£ÙÙØ¯ اÙÙ
عاÙ
ÙØ©."},transactionSent:{header:"Ø£ÙØ±Ø³Ùت اÙÙ
عاÙ
ÙØ©",text:"ستتÙ
Ù
Ø¹Ø§ÙØ¬Ø© Ù
عاÙ
ÙØªÙ Ù٠غضÙÙ Ø«ÙØ§ÙÙ ÙÙÙÙØ©."},transactionCanceled:{header:"Ø£ÙÙØºÙت اÙÙ
عاÙ
ÙØ©",text:"Ù٠تطرأ Ø£ÙØ© تغÙÙØ±Ø§Øª عÙÙ ØØ³Ø§Ø¨Ù."}},walletModal:{mobileConnectionModal:{showQR:"عرض رÙ
ز QR",scanQ
806R:"اÙ
Ø³Ø Ø±Ù
ز QR Ø£Ø¯ÙØ§Ù باستخداÙ
ÙØ§Ù
ÙØ±Ø§ ÙØ§ØªÙÙ Ø£Ù ÙØ§Ù
ÙØ±Ø§ ÙØ§ØªÙ {{ name }}",continueIn:"Ù
تابعة اÙÙ
عاÙ
ÙØ© ÙÙ Ù
ØÙظة OKX",connectionDeclined:"ÙØ´Ù Ø§ÙØ§ØªØµØ§Ù",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"Ù
ØÙظة OKX Ù
ØªØ§ØØ© عÙ٠تطبÙÙ OKX ÙTelegram"},connectApp:"Ø§ÙØ±Ø¨Ø· بتطبÙÙ OKX",connectMini:"Ø§ÙØ±Ø¨Ø· بÙ
ØÙظة OKX اÙÙ
صغرة"}},actionModal:{confirmTransaction:{header:"تأÙÙØ¯ اÙÙ
عاÙ
ÙØ© ÙÙ {{ name }}",text:"ÙÙ ÙØ³ØªØºØ±Ù Ø§ÙØ£Ù
ر سÙÙ ÙØØ¸Ø§Øª."}}}),cs_CZ:iF({common:{openWallet:"OtevÅ\xedt penÄženku",get:"Z\xedskat",close:"ZavÅ\xedt",retry:"Zkusit znovu"},button:{connectWallet:"PÅipojit penÄženku",dropdown:{copy:"Kop\xedrovat adresu",copied:"Adresa zkop\xedrov\xe1na",disconnect:"Odpojit"}},notifications:{confirm:{header:"OtevÅete {{ name }} a potvrÄte transakci."},transactionSent:{header:"Transakce odesl\xe1na",text:"VaÅ¡e transakce bude zruÅ¡ena bÄhem nÄkolika sekund."},transactionCanceled:{header:"Transakce zruÅ¡ena",text:"Na vaÅ¡em \xfaÄtu nedojde k ž\xe1dn\xfdm zmÄn\xe1m."}},walletModal:{mobileConnectionModal:{showQR:"Zobrazit QR k\xf3d",scanQR:"Naskenujte n\xedže uveden\xfd QR k\xf3d pomoc\xed kamery telefonu nebo {{ name }}",continueIn:"PotvrÄte transakci v OKX PenÄžence.",connectionDeclined:"PÅipojen\xed selhalo",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"OKX PenÄženka je k dispozici v aplikaci OKX a na s\xedti Telegram."},connectApp:"PÅipojit k aplikaci OKX",connectMini:"PÅipojit k minipenÄžence OKX"}},actionModal:{confirmTransaction:{header:"PotvrÄte transakci na {{ name }}.",text:"Zabere to jen chvilku."}}}),de_DE:iF({common:{openWallet:"Wallet \xf6ffnen",get:"Erhalten",close:"Schlie\xdfen",retry:"Wiederholen"},button:{connectWallet:"Wallet verkn\xfcpfen",dropdown:{copy:"Adresse kopieren",copied:"Adresse kopiert",disconnect:"Trennen"}},notifications:{confirm:{header:"{{ name }} \xf6ffnen und Transaktion best\xe4tigen."},transactionSent:{header:"Transaktion gesendet",text:"Ihre Transaktion wird in wenigen Sekunden bearbeitet."},transactionCanceled:{header:"Transaktion storniert",text:"Es werden keine \xc4nderungen an Ihrem Konto vorgenommen."}},walletModal:{mobileConnectionModal:{showQR:"QR-Code anzeigen",scanQR:"Scannen Sie den QR-Code unten mit der Kamera Ihres Telefons oder {{ name }}",continueIn:"Setzen Sie die Transaktion in der OKX Wallet fort",connectionDeclined:"Verbindung fehlgeschlagen",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"OKX Wallet ist in der OKX App und auf Telegram verf\xfcgbar"},connectApp:"Mit der OKX-App verbinden",connectMini:"Mit der OKX-Mini-Wallet verbinden"}},actionModal:{confirmTransaction:{header:"Transaktion in {{ name }} best\xe4tigen",text:"Es dauert nur einen Augenblick."}}}),es_ES:iF({common:{openWallet:"Abrir wallet",get:"Consigue",close:"Cerrar",retry:"Volver a intentar"},button:{connectWallet:"Conectar billetera",dropdown:{copy:"Copiar direcci\xf3n",copied:"Direcci\xf3n copiada",disconnect:"Desconectar"}},notifications:{confirm:{header:"Abre {{ name }} para confirmar la transacci\xf3n."},transactionSent:{header:"Transacci\xf3n enviada",text:"Tu transacci\xf3n se procesar\xe1 en unos segundos."},transactionCanceled:{header:"Transacci\xf3n cancelada",text:"No se realizar\xe1n cambios en tu cuenta."}},walletModal:{mobileConnectionModal:{showQR:"Mostrar c\xf3digo QR",scanQR:"Escanea el siguiente c\xf3digo QR con la c\xe1mara de tu tel\xe9fono o de tu {{ name }}",continueIn:"Continuar con la transacci\xf3n en OKX Wallet",connectionDeclined:"Error de conexi\xf3n",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"OKX Wallet est\xe1 disponible en la OKX app y en Telegram"},connectApp:"Conectarse a la OKX app",connectMini:"Conectarse a la OKX Mini Wallet"}},actionModal:{confirmTransaction:{header:"Confirma la transacci\xf3n de {{ name }}",text:"Solo te llevar\xe1 un momento."}}}),es_LAT:iF({common:{openWallet:"Abrir billetera",get:"Obtener",close:"Cerrar",retry:"Reintentar"},button:{connectWallet:"Conectar billetera",dropdown:{copy:"Copiar direcci\xf3n",copied:"Direcci\xf3n copiada",disconnect:"Desconectar"}},notifications:{confirm:{header:"Abre {{ name }} para confirmar la transacci\xf3n."},transactionSent:{header:"Transacci\xf3n enviada",text:"Tu transacci\xf3n se procesar\xe1 en unos segundos."},transactionCanceled:{header:"Transacci\xf3n cancelada",text:"No habr\xe1 cambios en tu cuenta."}},walletModal:{mobileConnectionModal:{showQR:"Mostrar c\xf3digo QR",scanQ
806R:"Escanea el siguiente c\xf3digo QR con la c\xe1mara de tu tel\xe9fono o {{ name }}",continueIn:"Contin\xfaa la transacci\xf3n en OKX Wallet",connectionDeclined:"Error de conexi\xf3n",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"OKX Wallet est\xe1 disponible en la aplicaci\xf3n de OKX y Telegram"},connectApp:"Con\xe9ctate a la aplicaci\xf3n de OKX",connectMini:"Con\xe9ctate a la OKX\xa0Mini Wallet"}},actionModal:{confirmTransaction:{header:"Confirmar la transacci\xf3n en {{ name }}",text:"Solo tomar\xe1 un momento."}}}),fr_FR:iF({common:{openWallet:"Portefeuille ouvert",get:"Obtenir",close:"Fermer",retry:"R\xe9essayer"},button:{connectWallet:"Connecter le portefeuille",dropdown:{copy:"Copier lâadresse",copied:"Adresse copi\xe9e",disconnect:"D\xe9connecter"}},notifications:{confirm:{header:"Ouvrir {{ name }} pour confirmer la transaction."},transactionSent:{header:"Transaction envoy\xe9e",text:"Votre transaction sera trait\xe9e en quelques secondes."},transactionCanceled:{header:"Transaction annul\xe9e",text:"Aucun changement ne sera apport\xe9 \xe0 votre compte."}},walletModal:{mobileConnectionModal:{showQR:"Afficher le code QR",scanQR:"Scannez le code QR ci-dessous avec la cam\xe9ra de votre t\xe9l\xe9phone ou de votre {{ name }}.",continueIn:"Poursuivre la transaction dans OKX Wallet",connectionDeclined:"\xc9chec de la connexion",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"OKX Wallet est disponible sur OKX App et Telegram"},connectApp:"Se connecter \xe0 lâappli OKX",connectMini:"Se connecter \xe0 OKX Mini Wallet"}},actionModal:{confirmTransaction:{header:"Confirmer la transaction dans {{ name }}",text:"Cela ne prendra qu'un instant."}}}),id_ID:iF({common:{openWallet:"Buka wallet",get:"Dapatkan",close:"Tutup",retry:"Coba lagi"},button:{connectWallet:"Hubungkan wallet",dropdown:{copy:"Salin alamat",copied:"Alamat disalin",disconnect:"Putuskan sambungan"}},notifications:{confirm:{header:"Buka {{ name }} untuk mengonfirmasi transaksi."},transactionSent:{header:"Transaksi terkirim",text:"Transaksi Anda akan diproses dalam bebera
806pa detik."},transactionCanceled:{header:"Transaksi dibatalkan",text:"Tidak akan ada perubahan pada akun Anda."}},walletModal:{mobileConnectionModal:{showQR:"Tampilkan Kode QR",scanQR:"Pindai kode QR di bawah dengan kamera ponsel atau {{ name }} Anda",continueIn:"Lanjutkan transaksi di OKX Wallet",connectionDeclined:"Koneksi gagal",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"OKX Wallet tersedia di OKX App dan Telegram"},connectApp:"Hubungkan ke OKX App",connectMini:"Hubungkan ke OKX Mini Wallet"}},actionModal:{confirmTransaction:{header:"Konfirmasi transaksi pada {{ name }}",text:"Hanya perlu beberapa saat."}}}),it_IT:iF({common:{openWallet:"Apri portafoglio",get:"Ottieni",close:"Chiudi",retry:"Riprova"},button:{connectWallet:"Connetti il portafoglio",dropdown:{copy:"Copia indirizzo",copied:"Indirizzo copiato",disconnect:"Disconnetti"}},notifications:{confirm:{header:"Apri {{ name }} per confermare la transazione."},transactionSent:{header:"Transazione inviata",text:"La transazione verr\xe0 elaborata in pochi secondi."},transactionCanceled:{header:"Transazione annullata",text:"Il tuo conto non subir\xe0 modifiche."}},walletModal:{mobileConnectionModal:{showQR:"Mostra il codice QR",scanQR:"Scansiona il codice QR di seguito con la fotocamera del tuo smartphone o {{ name }}",continueIn:"Continua la transazione in OKX Wallet",connectionDeclined:"Collegamento non riuscito",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"OKX Wallet \xe8 disponibile sull'app OKX e Telegram"},connectApp:"Connettiti all'app OKX",connectMini:"Connettiti a OKX Mini Wallet"}},actionModal:{confirmTransaction:{header:"Conferma la transazione in {{ name }}",text:"Ci vorr\xe0 solo un secondo."}}}),nl_NL:iF({common:{openWallet:"Wallet openen",get:"Krijgen",close:"Sluiten",retry:"Opnieuw proberen"},button:{connectWallet:"Wallet koppelen",dropdown:{copy:"Adres kopi\xebren",copied:"Adres gekopieerd",disconnect:"Verbinding verbreken"}},notifications:{confirm:{header:"Open {{ name }} om de transactie te bevestigen."},transactionSent:{header:"Transactie verstuurd",text:"Je transactie wordt binnen een paar seconden verwerkt."},transactionCanceled:{header:"Transactie geannuleerd",text:"Er verandert niets aan je account."}},walletModal:{mobileConnectionModal:{showQR:"QR-code weergeven",scanQR:"Scan de QR-code hieronder met de camera van je telefoon of de camera van{{ name }}",continueIn:"Ga verder met de transactie in OKX Wallet",connectionDeclined:"Koppelen mislukt",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"OKX Wallet is beschikbaar op OKX App en Telegram"},connectApp:"Koppelen met de OKX-app",connectMini:"Koppelen met OKX Mini Wallet"}},actionModal:{confirmTransaction:{header:"De transactie in {{ name }} bevestigen",text:"Het is zo gebeurd."}}}),pl_PL:iF({common:{openWallet:"Otw\xf3rz portfel",get:"Otrzymaj",close:"Zamknij",retry:"Spr\xf3buj ponownie"},button:{connectWallet:"PoÅÄ
cz portfel",dropdown:{copy:"Kopiuj adres",copied:"Adres skopiowany",disconnect:"RozÅÄ
cz"}},notifications:{confirm:{header:"Otw\xf3rz {{ name }}, aby potwierdziÄ transakcjÄ."},transactionSent:{header:"WysÅano transakcjÄ",text:"Transakcja zostanie przetworzona w ciÄ
gu kilku sekund."},transactionCanceled:{header:"Anulowano transakcjÄ",text:"Na koncie nie zostanÄ
wprowadzone żadne zmiany."}},walletModal:{mobileConnectionModal:{showQR:"Pokaż kod QR",scanQR:"Zeskanuj poniższy kod QR za pomocÄ
aparatu w telefonie lub {{ name }}",continueIn:"Kontynuuj transakcjÄ w OKX Wallet",connectionDeclined:"PoÅÄ
czenie nieudane",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"OKX Wallet jest dostÄpny w aplikacji OKX i Telegramie"},connectApp:"PoÅÄ
cz z aplikacjÄ
OKX",connectMini:"PoÅÄ
cz z OKX Mini Wallet"}},actionModal:{confirmTransaction:{header:"Potwierdź transakcjÄ w {{ name }}",text:"To zajmie tylko chwilÄ."}}}),pt_BR:iF({common:{openWallet:"Abrir carteira",get:"Receber",close:"Fechar",retry:"Tentar novamente"},button:{connectWallet:"Conectar carteira",dropdown:{copy:"Copiar endere\xe7o",copied:"Endere\xe7o copiado",disconnect:"Desconectar"}},notifications:{confirm:{header:"Abrir {{ name }} para confirmar a transa\xe7\xe3o."},transactionSent:{header:"Transa\xe7\xe3o enviada",text:"Sua transa\xe7\xe3o ser\xe1 processada em alguns segundos."},transactionCanceled:{header:"Transa\xe7\xe3o cancelada",text:"N\xe3o haver\xe1 altera\xe7\xf5es em sua conta."}},walletModal:{mobileConnectionModal:{showQR:"Mostrar C\xf3digo QR",scanQ
806R:"Digitalize o c\xf3digo QR abaixo com a c\xe2mera do seu telefone ou do {{ name }}",continueIn:"Continuar a transa\xe7\xe3o na OKX Wallet",connectionDeclined:"Falha na conex\xe3o",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"A OKX Wallet est\xe1 dispon\xedvel na OKX App e no Telegram"},connectApp:"Conecte-se \xe0 OKX App",connectMini:"Conecte-se \xe0 OKX Mini Wallet"}},actionModal:{confirmTransaction:{header:"Confirmar a transa\xe7\xe3o em {{ name }}",text:"Isso levar\xe1 apenas um momento."}}}),pt_PT:iF({common:{openWallet:"Abrir carteira",get:"Receber",close:"Fechar",retry:"Tentar novamente"},button:{connectWallet:"Associar carteira",dropdown:{copy:"Copiar endere\xe7o",copied:"Endere\xe7o copiado",disconnect:"Desassociar"}},notifications:{confirm:{header:"Abra {{ name }} para confirmar a transa\xe7\xe3o."},transactionSent:{header:"Transa\xe7\xe3o efetuada",text:"A sua transa\xe7\xe3o ser\xe1 processada dentro de poucos segundos."},transactionCanceled:{header:"Transa\xe7\xe3o cancelada",text:"N\xe3o ser\xe3o feitas altera\xe7\xf5es \xe0 sua conta."}},walletModal:{mobileConnectionModal:{showQR:"Mostrar c\xf3digo QR",scanQR:"Leia o c\xf3digo QR abaixo com a c\xe2mara do seu telem\xf3vel ou {{ name }}",continueIn:"Continuar a transa\xe7\xe3o na OKX Wallet",connectionDeclined:"Falha na liga\xe7\xe3o",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"A OKX Wallet est\xe1 dispon\xedvel na Aplica\xe7\xe3o da OKX e no Telegram"},connectApp:"Associar \xe0 Aplica\xe7\xe3o da OKX",connectMini:"Associar \xe0 OKX Mini Wallet"}},actionModal:{confirmTransaction:{header:"Confirmar a transa\xe7\xe3o na {{ name }}",text:"Demora apenas um momento."}}}),ro_RO:iF({common:{openWallet:"DeschideÈi portofelul",get:"PrimiÈi",close:"\xcenchideÈi",retry:"Re\xeencercaÈi"},button:{connectWallet:"ConectaÈi portofelul",dropdown:{copy:"CopiaÈi adresa",copied:"AdresÄ copiatÄ",disconnect:"DeconectaÈi"}},notifications:{confirm:{header:"DeschideÈi {{ name }} pentru a confirma tranzacÈia."},transactionSent:{header:"TranzacÈie trimisÄ",text:"TranzacÈia dvs. va fi procesatÄ \xeen c\xe2teva secunde."},transactionCanceled:{header:"TranzacÈie anulatÄ",text:"Nu va exista nicio modificare \xeen cont."}},walletModal:{mobileConnectionModal:{showQR:"ScanaÈi codul QR",scanQR:"ScanaÈi codul QR mai jos cu camera telefonului sau a {{ name }}",continueIn:"ContinuaÈi tranzacÈia \xeen OKX Wallet",connectionDeclined:"Conexiunea a eÈuat",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"OKX Wallet este disponibil din aplicaÈia OKX Èi Telegram"},connectApp:"ConectaÈi-vÄ la aplicaÈia OKX",connectMini:"ConectaÈi-vÄ la OKX Mini Wallet"}},actionModal:{confirmTransaction:{header:"ConfirmaÈi tranzacÈia \xeen {{ name }}",text:"Va dura doar un moment."}}}),tr_TR:iF({common:{openWallet:"C\xfczdanı a\xe7",get:"Al",close:"Kapat",retry:"Tekrar Dene"},button:{connectWallet:"C\xfczdanı baÄla",dropdown:{copy:"Adresi kopyala",copied:"Adres kopyalandı!",disconnect:"BaÄlantıyı kes"}},notifications:{confirm:{header:"İÅlemi onaylamak i\xe7in {{ name }} \xf6gesini a\xe7ın."},transactionSent:{header:"İÅlem g\xf6nderildi.",text:"İÅleminiz birka\xe7 saniye i\xe7inde ger\xe7ekleÅtirilecek."},transactionCanceled:{header:"İÅlem iptal edildi!",text:"Hesabınızda deÄiÅiklik olmayacak."}},walletModal:{mobileConnectionModal:{showQR:"QR Kodunu G\xf6ster",scanQR:"AÅaÄıdaki QR kodunu telefonunuzun veya {{ name }} cihazınızın kamerasıyla tarayın.",continueIn:"İÅleme OKX Web3 C\xfczdanâda devam edin.",connectionDeclined:"BaÄlantı baÅarısız.",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"OKX Web3 C\xfczdan, OKX Uygulamasında ve Telegramâda kullanıma sunuldu"},connectApp:"OKX Uygulamasına BaÄlan",connectMini:"OKX Mini C\xfczdanına BaÄlan"}},actionModal:{confirmTransaction:{header:"{{ name }} Konumunda İÅlemi Onaylayın",text:"Bu yalnızca bir dakikanızı alacak."}}}),uk_UA:iF({common:{openWallet:"ÐÑдкÑиÑий гаманеÑÑ",get:"ÐÑÑимаÑи",close:"ÐакÑиÑи",retry:"ÐовÑоÑиÑи ÑпÑобÑ"},button:{connectWallet:"ÐÑдклÑÑиÑи гаманеÑÑ",dropdown:{copy:"ÐопÑÑваÑи адÑеÑÑ",copied:"ÐдÑеÑÑ ÑкопÑйовано",disconnect:"ÐÑдклÑÑиÑи"}},notifications:{confirm:{header:"ÐÑдкÑийÑе {{ name }}, Ñоб пÑдÑвеÑдиÑи ÑÑанзакÑÑÑ."},transactionSent:{header:"ТÑанзакÑÑÑ Ð½Ð°Ð´ÑÑлано",text:"ÐаÑÑ ÑÑанзакÑÑÑ Ð±Ñде обÑоблено ÑеÑез кÑлÑка ÑекÑнд."},transactionCanceled:{header:"ТÑанзакÑÑÑ ÑкаÑовано",text:"У ваÑÐ¾Ð¼Ñ Ð°ÐºÐ°ÑнÑÑ Ð½Ðµ бÑде змÑн."}},walletModal:{mobileConnectionModal:{showQR:"ÐоказаÑи QR-код",scanQR:"ÐÑдÑканÑйÑе наведений нижÑе QR-код за Ð´Ð¾Ð¿Ð¾Ð¼Ð¾Ð³Ð¾Ñ ÐºÐ°Ð¼ÐµÑи Ñвого ÑелеÑона або {{ name }}",continueIn:"ÐÑодовжÑе ÑÑанзакÑÑÑ Ð² OKX Wallet",connectionDeclined:"Ðомилка пÑдклÑÑеннÑ",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"OKX ÐаманеÑÑ Ð´Ð¾ÑÑÑпний Ñ Ð·Ð°ÑÑоÑÑÐ½ÐºÑ OKX Ñ Telegram"},connectApp:"ÐÑдклÑÑиÑиÑÑ Ð´Ð¾ заÑÑоÑÑнка OKX",connectMini:"ÐÑдклÑÑиÑиÑÑ Ð´Ð¾ мÑнÑгаманÑÑ OKX"}},actionModal:{confirmTransaction:{header:"ÐÑдÑвеÑдÑÑе ÑÑанзакÑÑÑ Ð² {{ name }}",text:"Це займе лиÑе миÑÑ."}}}),vi_VN:iF({common:{openWallet:"Má» v\xed",get:"Nháºn",close:"Ä\xf3ng",retry:"Thá» lại"},button:{connectWallet:"Kết ná»i v\xed",dropdown:{copy:"Sao ch\xe9p Äá»a chá»",copied:"Ä\xe3 sao ch\xe9p Äá»a chá»",disconnect:"Ngắt kết ná»i"}},notifications:{confirm:{header:"Má» {{ name }} Äá» x\xe1c nháºn giao dá»ch."},transactionSent:{header:"Ä\xe3 gá»i giao dá»ch",text:"Giao dá»ch cá»§a bạn sẽ ÄÆ°á»£c xá» l\xfd trong v\xe0i gi\xe2y."},transactionCanceled:{header:"Ä\xe3 há»§y giao dá»ch",text:"Kh\xf4ng c\xf3 thay Äá»i n\xe0o vá»i t\xe0i khoản cá»§a bạn."}},walletModal:{mobileConnectionModal:{showQR:"Hiá»n thá» m\xe3 QR",scanQ
806R:"Qu\xe9t m\xe3 QR b\xean dưá»i bằng m\xe1y ảnh Äiá»n thoại hoặc {{ name }} cá»§a bạn",continueIn:"Tiếp tục giao dá»ch tr\xean V\xed Web3 OKX",connectionDeclined:"Kết ná»i kh\xf4ng th\xe0nh c\xf4ng",PoweredBy:"Powered by",appAndTelegram:{header:"Connect to OKX Wallet",text:"V\xed Web3 OKX hiá»n c\xf3 tr\xean cả Ứng dụng OKX v\xe0 Telegram"},connectApp:"Kết ná»i Ứng dụng OKX",connectMini:"Kết ná»i V\xed Web3 OKX Mini"}},actionModal:{confirmTransaction:{header:"X\xe1c nháºn giao dá»ch trong {{ name }}",text:"N\xf3 chá» mất ch\xfat thá»i gian."}}}),zh_TW:iF({common:{openWallet:"æéé¢å
",get:"ç²å",close:"éé",retry:"é試"},button:{connectWallet:"飿¥é¢å
",dropdown:{copy:"è¤è£½å°å",copied:"å°åå·²è¤è£½",disconnect:"æ·é飿¥"}},notifications:{confirm:{header:"æé {{ name }} 以確èªäº¤æ"},transactionSent:{header:"交æå·²ç¼é",text:"交æå³å°å®æï¼è«ç¨å"},transactionCanceled:{header:"交æå·²åæ¶",text:"è³¬æ¶æªç¼ç任使´æ¹"}},walletModal:{mobileConnectionModal:{OKXConnect:"OKX Connect",showQR:"å±ç¤ºäºç¶ç¢¼",scanQR:"ä½¿ç¨ææ©æ OKX é¢å
çç¸æ©ææä¸æ¹äºç¶ç¢¼",continueIn:"å¨ OKX é¢å
ä¸ç¹¼çºå®æ",connectionDeclined:"飿¥å¤±æ",PoweredBy:"Powered by",appAndTelegram:{header:"飿¥ OKX é¢å
",text:" OKX é¢å
å¯å¨ OKX App å Telegram 使ç¨"},connectApp:"飿¥ OKX App",connectMini:"飿¥ OKX Mini Wallet"}},actionModal:{confirmTransaction:{header:"å¨ {{ name }} ä¸ç¢ºèªäº¤æ",text:"è«ç¨å"}}})};function iF(e){let t=n=>{Object.entries(n).forEach(([r,o])=>{if("object"==typeof o&&o)return t(o);
806if("string"==typeof o){if("$"===o[0]){let t=o.slice(1).split("."),i=e;t.forEach(e=>{if(e in i)i=i[e];else throw Error(`Cannot parse translations: there is no property ${e} in translation`)}),n[r]=i}"\\$"===o.slice(0,2)&&(n[r]=o.slice(1))}})};return t(e),e}let i$=ti.div` 807 display: flex; 808 flex-direction: column; 809 align-items: center; 810 padding-bottom: 8px; 811`,iV=ti(rD)` 812 margin-top: 16px; 813`,iG=ti(r_)` 814 font-weight: 400; 815 font-size: 16px; 816 line-height: 20px; 817 text-align: center; 818 max-width: 250px; 819 margin-top: 10px; 820 color: ${e=>e.theme.colors.text.contrast}; 821`;ti(nT)` 822 min-width: 112px; 823 margin-top: 32px; 824`,ti(nQ)` 825 height: 16px; 826 width: 16px; 827`;let iz=ti.div` 828 margin-top: 24px; 829 background-color: ${e=>e.theme.colors.text.primary}; 830 height: 48px; 831 width: 262px; 832 justify-content: center; 833 border-radius: 24px; 834 display: flex; 835 align-items: center; 836 gap: 8px; 837`,iQ=e=>{let t=nS(e),n=en(r$);V(!0);let[r,o]=V(!1),i=tr(),{action:a}=en(i2);z(()=>{o(!!a&&"sent"in a&&a.sent)});let s=()=>{(0,g.logDebug)("ActionModal ====> onOpenWallet "),null==n||n.openWallet()};return em(i$,ew(t,{get children(){return[Q(()=>e.icon),em(iV,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues},get children(){return e.headDefaultString}}),em(iG,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),em(eN,{get when(){return null==n?void 0:n.showActionButton()},get children(){return[em(eN,{get when(){return"close"===e.showButton},get children(){return em(iz,{onClick:()=>e.onClose(),get children(){return em(r_,{fontWeight:700,fontSize:"16px",get color(){return i.colors.background.primary},get children(){return em(id,{translationKey:"common.close",children:"Close"})}})}})}}),em(eN,{get when(){return"open-wallet"===e.showButton},get children(){return em(iz,{onClick:s,get children(){return em(r_,{fontWeight:700,fontSize:"16px",get color(){return i.colors.background.primary},get children(){return em(id,{translationKey:"common.openWallet",children:"Open wallet"})}})}})}})]}})]}}))},iY=e=>{let t=en(r$),[n]=rb(),r=()=>t.walletName?t.walletName:n("common.yourWallet",{},"Your wallet");return em(iQ,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:r()}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return em(oZ,{})},onClose:()=>e.onClose(),get showButton(){return tN()?"open-wallet":void 0},"data-tc-confirm-modal":"true"})},iZ=e=>em(iQ,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return em(n$,{size:"m"})},onClose:()=>
837e.onClose(),get showButton(){return tN()?"close":void 0},"data-tc-transaction-canceled-modal":"true"}),i0=e=>em(iQ,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return em(nH,{size:"m"})},onClose:()=>e.onClose(),get showButton(){return tN()?"close":void 0},"data-tc-transaction-sent-modal":"true"}),i1=e=>em(iQ,{headerTranslationKey:"actionModal.transactionError.header",textTranslationKey:"actionModal.transactionCanceled.text",headDefaultString:"Error",get icon(){return em(n$,{size:"m"})},onClose:()=>e.onClose(),get showButton(){return tN()?"close":void 0},"data-tc-transaction-error-modal":"true"}),i2=et({action:null}),i5=e=>(z(()=>{console.log("ActionsModal",e.action)}),em(i2.Provider,{get value(){return{action:e.action}},get children(){return em(rs,{get opened(){var t;return null!==e.action&&(null==(t=e.action)?void 0:t.openModal)===!0},onClose:()=>e.setAction(null),"data-tc-actions-modal-container":"true",get children(){return em(eS,{get children(){return[em(eT,{get when(){return"transaction-sent"===e.action.name},get children(){return em(i0,{onClose:()=>e.setAction(null)})}}),em(eT,{get when(){return"transaction-canceled"===e.action.name},get children(){return em(iZ,{onClose:()=>e.setAction(null)})}}),em(eT,{get when(){return"confirm-transaction"===e.action.name},get children(){return em(iY,{onClose:()=>e.setAction(null)})}}),em(eT,{get when(){return"transaction-error"===e.action.name},get children(){return em(i1,{onClose:()=>e.setAction(null)})}})]}})}})}})),i3={constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#0098EA",telegramButton:"#0098EA",qrFill:"#000000",icon:{primary:"#0F0F0F",secondary:"#7A8999",tertiary:"#C1CAD2",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#FFFFFF",secondary:"#F1F3F5",segment:"#FFFFFF",tint:"#F1F3F5",qr:"#FFFFFF"},text:{primary:"#000000",secondary:"#6A7785",contrast:"#909090"},border:{primary:"#00000014",secondary:"#00000024"},disable:"#B3B3B3"},i6={constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#E5E5EA",telegramButton:"#31A6F5",qrFill:"#FFFFFF",icon:{primary:"#E5E5EA",secondary:"#909099",tertiary:"#434347",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#121214",secondary:"#18181A",segment:"#262629",tint:"#222224",qr:"#121214"},text:{primary:"#FFFFFF",secondary:"#7D7D85",contrast:"#909090"},border:{primary:"#FFFFFF1F",secondary:"#FFFFFF30"},disable:"#5B5B5B"},[i4,i8]=tB({theme:I.LIGHT,colors:i3,borderRadius:"m"}),i9={[I.LIGHT]:i3,[I.DARK]:i6};function i7(e){i8({theme:e,colors:i9[e]})}I.LIGHT,I.DARK;let ae=e=>{let t=rC(iq,tq.language);return nr(),nn(),em(rO.Provider,{value:t,get children(){return em(r$.Provider,{get value(){return e.connectUI},get children(){return em(oL.Provider,{get value(){return tq.connector},get children(){return[em(tu,{}),em(tn,{theme:i4,get children(){return[em(eN,{get when(){return tq.buttonRootId},get children(){return em(eQ,{get mount(){return document.getElementById(tq.buttonRootId)},get children(){return em(oX,{})}})}}),em(eY,{component:ts,style:{position:"relative","z-index":3001},get children(){return[em(iH,{}),em(i5,{get action(){return nO()},setAction:nb})]}})]}})]}})}})}})},at={openSingleWalletModal:e=>{(0,g.logDebug)(`tonWidgetController : openSingleWalletModal : ${JSON.stringify(e)}`),setTimeout(()=>nf({status:"opened",closeReason:null,walletInfo:e}))},closeSingleWalletModal:e=>void setTimeout(()=>nf({status:"closed",closeReason:e})),setAction:e=>void setTimeout(()=>nb(e)),clearAction:()=>void setTimeout(()=>{console.log("clearAction"),nb(null)}),getSelectedWalletInfo:()=>nm(),removeSelectedWalletInfo:()=>nC(null),renderApp:(e,t)=>eL(()=>em(ae,{connectUI:t}),document.getElementById(e))};function an(e){return"[object Object]"===Object.prototype.toString.call(e)}function ar(e){var t,n;return!1!==an(e)&&(void 0===(t=e.constructor)||!1!==an(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}function ao(e,t){return e?y(t,e,{arrayMerge:(e,t,n)=>t,isMergeableObject:ar}):t}class ai{constructor(){D(this,"consumers",[]),z(()=>{let e=nO();
837this.consumers.forEach(t=>t(e))})}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter(t=>t!==e)}}}var aa=((a=aa||{}).OKX_UI_CONNECTION_STARTED="okx-connect-ui-connection-started",a.OKX_UI_CONNECTION_COMPLETED="okx-connect-ui-connection-completed",a.OKX_UI_CONNECTION_ERROR="okx-connect-ui-connection-error",a.OKX_UI_CONNECTION_RESTORING_STARTED="okx-connect-ui-connection-restoring-started",a.OKX_UI_CONNECTION_RESTORING_COMPLETED="okx-connect-ui-connection-restoring-completed",a.OKX_UI_CONNECTION_RESTORING_ERROR="okx-connect-ui-connection-restoring-error",a.OKX_UI_DISCONNECTION="okx-connect-ui-disconnection",a.OKX_UI_TRANSACTION_SENT_FOR_SIGNATURE="okx-connect-ui-transaction-sent-for-signature",a.OKX_UI_TRANSACTION_SIGNED="okx-connect-ui-transaction-signed",a.OKX_UI_TRANSACTION_SIGNING_FAILED="okx-connect-ui-transaction-signing-failed",a);class as{constructor(e){var t;D(this,"eventPrefix","okx-connect-ui-"),D(this,"OKXConnectUiVersion"),D(this,"OKXtonConnectSdkVersion",null),D(this,"eventDispatcher"),this.eventDispatcher=null!=(t=null==e?void 0:e.eventDispatcher)?t:new p.BrowserEventDispatcher,this.OKXConnectUiVersion=e.tonConnectUiVersion,this.init().catch()}get version(){return(0,p.createVersionInfo)({okx_ton_connect_sdk_lib:this.OKXtonConnectSdkVersion,okx_connect_ui_lib:this.OKXConnectUiVersion})}init(){return P(this,null,function*(){try{yield this.setRequestVersionHandler(),this.OKXtonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch(e){console.log("okx-ton-connect-response-version init error ====> requestTonConnectSdkVersion")}})}setRequestVersionHandler(){return P(this,null,function*(){yield this.eventDispatcher.addEventListener("okx-connect-ui-request-version",()=>P(this,null,function*(){yield this.eventDispatcher.dispatchEvent("okx-connect-ui-response-version",(0,p.createResponseVersionEvent)(this.OKXConnectUiVersion))}))})}requestTonConnectSdkVersion(){return P(this,null,function*(){return new Promise((e,t)=>P(this,null,function*(){try{yield this.eventDispatcher.addEventListener("okx-ton-connect-response-version",t=>{e(t.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("okx-ton-connect-request-version",(0,p.createRequestVersionEvent)())}catch(e){console.log(`okx-ton-connect-response-version ====> ${e.message}`),t(e)}}))})}dispatchUserActionEvent(e){var t;try{null==(t=this.eventDispatcher)||t.dispatchEvent(`${this.eventPrefix}${e.type}`,e).catch()}catch(e){}}trackConnectionStarted(...e){try{let t=(0,p.createConnectionStartedEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionCompleted(...e){try{let t=(0,p.createConnectionCompletedEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionError(...e){try{let t=(0,p.createConnectionErrorEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionRestoringStarted(...e){try{let t=(0,p.createConnectionRestoringStartedEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionRestoringCompleted(...e){try{let t=(0,p.createConnectionRestoringCompletedEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackConnectionRestoringError(...e){try{let t=(0,p.createConnectionRestoringErrorEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackDisconnection(...e){try{let t=(0,p.createDisconnectionEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackTransactionSentForSignature(...e){try{let t=(0,p.createTransactionSentForSignatureEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackTransactionSigned(...e){try{let t=(0,p.createTransactionSignedEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}trackTransactionSigningFailed(...e){try{let t=(0,p.createTransactionSigningFailedEvent)(this.version,...e);this.dispatchUserActionEvent(t)}catch(e){}}}class ac{constructor(e){D(this,"consumers",[]),D(this,"getWalltsInfo"),D(this,"state",nh()),this.getWalltsInfo=e.getWalltsInfo,z(()=>{let e=nh();
837this.state=e,this.consumers.forEach(t=>t(e))})}open(e){return P(this,null,function*(){let t=this.getWalltsInfo().find(t=>t$(t,e));if(t)return this.openSingleWalletModal(t);throw new K(`Trying to open modal window with unknown wallet "${e}".`)})}close(e="action-cancelled"){at.closeSingleWalletModal(e)}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter(t=>t!==e)}}handleConnect(e,t){return P(this,null,function*(){return new Promise((n,r)=>{try{e(t).then(e=>{n(e),(0,g.logDebug)("TonSingleWalletModalManager result >>>",JSON.stringify(e))}).catch(e=>{r(e),(0,g.logDebug)("TonSingleWalletModalManager error >>>",JSON.stringify(e))})}catch(e){r(e),(0,g.logDebug)("TonSingleWalletModalManager catch error >>>",JSON.stringify(e))}})})}openSingleWalletModal(e){return P(this,null,function*(){return ty()&&tC(),at.openSingleWalletModal(e),new Promise(e=>{let t=this.onStateChange(n=>{let{status:r}=n;"opened"===r&&(t(),e())})})})}}let al=["en_US","ru_RU","zh_CN","zh","ar_AE","cs_CZ","de_DE","es_ES","es_LAT","fr_FR","id_ID","it_IT","nl_NL","pl_PL","pt_BR","pt_PT","ro_RO","tr_TR","uk_UA","vi_VN","zh_TW"];function au(e){return al.includes(e)}class ad{constructor(e){if(D(this,"walletInfoStorage",new nc("okx-wallet-connect-ui-ton_wallet-info")),D(this,"tracker"),D(this,"walletInfo",null),D(this,"systemThemeChangeUnsubscribe",null),D(this,"actionsConfiguration"),D(this,"walletsList"),D(this,"connectRequestParametersCallback"),D(this,"connector"),D(this,"singleWalletModal"),D(this,"transactionModal"),D(this,"connectionRestored",Promise.resolve(!1)),D(this,"dispose"),(0,g.logDebug)("OKXTonConnectUI constructor() option:",JSON.stringify(e)),e&&"dappMetaData"in e&&e.dappMetaData)this.connector=new p.OKXTonConnect({metaData:e.dappMetaData}),this.connector.registerConnector(this.getWalletConnector());else throw new K("You have to specify a `dappMetaData`in the options.");e.language&&!au(e.language.toString())&&(e.language="en_US"),this.tracker=new as({eventDispatcher:null,tonConnectUiVersion:"1"}),this.singleWalletModal=new ac({getWalltsInfo:()=>p.OKXTonConnect.getWallets()}),this.transactionModal=new ai,this.walletsList=this.getWallets(),function e(t){"complete"!==document.readyState?window.addEventListener("load",()=>no(()=>e(t)),{once:!0}):t.forEach(e=>{new window.Image().src=e})}([...new Set(this.walletsList.map(e=>e.imageUrl))]);let t=this.normalizeWidgetRoot(void 0);this.subscribeToWalletChange(),(null==e?void 0:e.restoreConnection)!==!1&&(this.connectionRestored=function(e){return P(this,null,function*(){return yield new Promise(e=>requestAnimationFrame(e)),e()})}(()=>P(this,null,function*(){return this.tracker.trackConnectionRestoringStarted(),yield this.connector.restoreConnection(),this.connector.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):(this.tracker.trackConnectionRestoringError("Connection was not restored"),this.walletInfoStorage.removeWalletInfo()),this.connector.connected}))),this.uiOptions=ao(e,{uiPreferences:{theme:"SYSTEM"}}),tF({connector:this.connector,preferredWalletAppName:void 0,walletConnector:this.getWalletConnector()}),this.dispose=at.renderApp(t,this)}static getWallets(){return p.OKXTonConnect.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?T(T({},this.connector.wallet),this.walletInfo):null}get walletName(){if(this.wallet&&"name"in this.wallet)return this.wallet.name}set uiOptions(e){var t,n,r;(0,g.logDebug)("OKXTonConnectUI uiOptions() called"),this.checkButtonRootExist(e.buttonRootId),this.actionsConfiguration=e.actionsConfiguration,(null==(t=e.uiPreferences)?void 0:t.theme)&&((null==(n=e.uiPreferences)?void 0:n.theme)!=="SYSTEM"?(null==(r=this.systemThemeChangeUnsubscribe)||r.call(this),i7(e.uiPreferences.theme)):(i7(ne()),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=nt(i7)))),tF(t=>{var n,r;let o=ao(T(T(T({},e.language&&{language:e.language}),!!(null==(n=e.actionsConfiguration)?void 0:n.returnStrategy)&&{returnStrategy:e.actionsConfiguration.returnStrategy}),(null==(r=e.actionsConfiguration)?void 0:r.tmaReturnUrl)&&{tmaReturnUrl:e.actionsConfiguration.tmaReturnUrl}),tx(t));return void 0!==e.buttonRootId&&(o.buttonRootId=e.buttonRootId),o})}getWalletConnector(){let e;return e=[],t7()||e.push(g.AppwalletConnector.getConnector()),tV()&&e.push(g.TgwalletConnector.getConnector()),e}destory(){this.dispose&&this.dispose()}setConnectRequestParameters(e){var t;tF({connectRequestParameters:e}),(null==e?void 0:e.state)!=="ready"&&e||null==(t=this.connectRequestParametersCallback)||t.call(this,{tonProof:e.value.tonProof})}getWallets(){return[(0,g.creatOKXWalletInfo)(),(0,g.creatOKXMiniAppWalletInfo)()]}onStatusChange(e,t){return this.connector.onStatusChange(t=>
837P(this,null,function*(){if(t){yield this.getSelectedWalletInfo(t);let n=this.getWalletInfo(t);(0,g.logDebug)("OKXTonConnectUI onStatusChange info :",JSON.stringify(n)),(0,g.logDebug)("OKXTonConnectUI onStatusChange wallet :",JSON.stringify(t)),e(T(T({},t),n||this.getWallets()[0]))}else e(t)}),t)}handleConnect(e){return P(this,null,function*(){return this.singleWalletModal.handleConnect(e,this.actionsConfiguration)})}openModal(){return P(this,null,function*(){return(0,g.logDebug)("OKXTonConnectUI openModal() called"),new Promise((e,t)=>P(this,null,function*(){yield Promise.all([this.waitForWalletConnection({}),this.openSingleWalletModal("okxAppWallet")]).catch(e=>{t(e)})}))})}closeModal(e){this.closeSingleWalletModal(e)}waitForWalletConnection(e){return P(this,null,function*(){return new Promise((e,t)=>{let n=n=>P(this,null,function*(){n?(this.tracker.trackConnectionCompleted(n),o(),e(n)):(this.tracker.trackConnectionError("Connection was cancelled"),o(),t(new K("Wallet was not connected")))}),r=e=>{this.tracker.trackConnectionError(e.message),o(),t(e)},o=this.onStatusChange(e=>n(e),e=>r(e))})})}onModalStateChange(e){return this.onSingleWalletModalStateChange(e)}get modalState(){return this.singleWalletModalState}openSingleWalletModal(e){return P(this,null,function*(){this.tracker.trackConnectionStarted();try{return this.singleWalletModal.open(e)}catch(e){throw this.tracker.trackConnectionError(e.message),e}})}closeSingleWalletModal(e){"action-cancelled"===e&&this.tracker.trackConnectionError("Connection was cancelled"),this.singleWalletModal.close(e)}onSingleWalletModalStateChange(e){return this.singleWalletModal.onStateChange(e)}get singleWalletModalState(){return this.singleWalletModal.state}disconnect(){return(0,g.logDebug)("OKXTonConnectUI disconnect() called"),this.tracker.trackDisconnection(this.wallet,"dapp"),at.clearAction(),at.removeSelectedWalletInfo(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(e,t){return P(this,null,function*(){return(0,g.logDebug)("OKXTonConnectUI sendTransaction() called"),this.sendTransactionInner(e,{returnStrategy:null==t?void 0:t.returnStrategy,modals:null==t?void 0:t.modals})})}sendTransactionInner(e,t){return P(this,null,function*(){var n,r;if(this.tracker.trackTransactionSentForSignature(this.wallet,e),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,e,"Wallet was not connected"),new K("Connect wallet to send a transaction.");ty()&&tC();let o={returnStrategy:tw("mobile")&&(null==(n=nm())?void 0:n.openMethod)!=="qrcode"?null==t?void 0:t.returnStrategy:"none",modals:null==t?void 0:t.modals,tmaReturnUrl:null!=(r=null==t?void 0:t.tmaReturnUrl)?r:"back"},{modals:i,returnStrategy:a,tmaReturnUrl:s}=this.getModalsAndNotificationsConfiguration(o);at.setAction({name:"confirm-transaction",openModal:i.includes("before"),sent:!1});let c=new AbortController,l=this.onTransactionModalStateChange(e=>{null!=e&&e.openModal||l()}),u=A(T({},e),{redirect:a});try{let t=yield this.waitForSendTransaction({transaction:u,signal:c.signal},()=>{var e,t;c.signal.aborted||(!this.connector.openUniversalLink&&t6(this.walletInfo,null==(e=nm())?void 0:e.openMethod)&&(t=this.walletInfo,(0,g.logDebug)("wallets openTonWallet"),tV()&&t3(t,s)),at.setAction({name:"confirm-transaction",openModal:i.includes("before"),sent:!0}))});return this.tracker.trackTransactionSigned(this.wallet,e,t),at.setAction({name:"transaction-sent",openModal:i.includes("success")}),t}catch(e){if(e instanceof g.OKXConnectError)throw e.code===g.OKX_CONNECT_ERROR_CODES.USER_REJECTS_ERROR?at.setAction({name:"transaction-canceled",openModal:i.includes("error")}):at.setAction({name:"transaction-error",openModal:i.includes("error")}),e;throw at.setAction({name:"transaction-error",openModal:i.includes("error")}),new K("Unhandled error:"+e)}finally{l()}})}waitForSendTransaction(e,t){return P(this,null,function*(){return new Promise((n,r)=>{var o;let{transaction:i,signal:a}=e;if(a.aborted)return this.tracker.trackTransactionSigningFailed(this.wallet,i,"Transaction was cancelled"),r(new K("Transaction was not sent"));let s=e=>P(this,null,function*(){n(e)}),c=e=>{r(e)},l=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,i,"Transaction was cancelled"),r(new K("Transaction was not sent"))};a.addEventListener("abort",l,{once:!0}),this.connector.sendTransaction(i,{doNotOpenWallet:!(tN()&&(null==(o=nm())?void 0:o.openMethod)!=="qrcode"),onRequestSent:t}).then(e=>(a.removeEventListener("abort",l),s(e))).catch(e=>(this.tracker.trackTransactionSigningFailed(this.wallet,i,e.message),a.removeEventListener("abort",l),c(e)))})})}onTransactionModalStateChange(e){return this.transactionModal.onStateChange(e)}subscribeToWalletChange(){this.connector.onStatusChange(e=>
837P(this,null,function*(){var t;e?(yield this.updateWalletInfo(e),this.setPreferredWalletAppName((null==(t=this.walletInfo)?void 0:t.appName)||e.device.appName)):this.walletInfoStorage.removeWalletInfo()}))}setPreferredWalletAppName(e){tF({preferredWalletAppName:e})}getSelectedWalletInfo(e){return P(this,null,function*(){let t,n=at.getSelectedWalletInfo();if(!n)return null;if("name"in n)t=n;else{let r=this.walletsList.find(t=>t$(t,e.device.appName));if(!r)throw new K(`Cannot find WalletInfo for the '${e.device.appName}' wallet`);t=T(T({},r),n)}return t})}updateWalletInfo(e){return P(this,null,function*(){this.walletInfo=this.getWalletInfo(e),(0,g.logDebug)("updateWalletInfo ---this.walletInfo -",JSON.stringify(this.walletInfo))})}getWalletInfo(e){(0,g.logDebug)("getWalletInfo ----",JSON.stringify(e));let t=this.walletsList.find(t=>t$(t,e.device.appName))||null;return(0,g.logDebug)("getWalletInfo ---info -",JSON.stringify(t)),t}normalizeWidgetRoot(e){if(!e||!document.getElementById(e)){e="okxton-widget-root";let t=document.createElement("div");t.id=e,document.body.appendChild(t)}return e}checkButtonRootExist(e){if(null!=e&&!document.getElementById(e))throw new K(`${e} element not found in the document.`)}getModalsAndNotificationsConfiguration(e){var t,n,r;let o=["before","success","error"],i=["before"];(null==(t=this.actionsConfiguration)?void 0:t.modals)&&(i="all"===this.actionsConfiguration.modals?o:this.actionsConfiguration.modals),(null==e?void 0:e.modals)&&(i="all"===e.modals?o:e.modals);let a=(null==e?void 0:e.returnStrategy)||(null==(n=this.actionsConfiguration)?void 0:n.returnStrategy)||"back";return{modals:i,tmaReturnUrl:(null==e?void 0:e.tmaReturnUrl)||(null==(r=this.actionsConfiguration)?void 0:r.tmaReturnUrl)||"back",returnStrategy:a}}showActionButton(){return t5(this.walletInfo)&&tN()}openWallet(e,t){var n;null==(n=this.connector.provider)||n.connectorOpenWallet()}}class ah{constructor(e){D(this,"okxTonConnectUI"),D(this,"connectionRestored",Promise.resolve(!1)),(0,g.logDebug)("okx-connect-ton-ui-wrapper constructor called"),window&&window.okxConnectTonUIinwindow&&window.okxConnectTonUIinwindow instanceof ad?(this.okxTonConnectUI=window.okxConnectTonUIinwindow,(0,g.logDebug)("okx-connect-ton-ui-wrapper constructor old called")):(this.okxTonConnectUI=new ad(e),(0,g.logDebug)("okx-connect-ton-ui-wrapper constructor new called"),window&&(window.okxConnectTonUIinwindow=this.okxTonConnectUI))}static getWallets(){return ad.getWallets()}get connected(){return this.okxTonConnectUI.connected}get account(){return this.okxTonConnectUI.account}get wallet(){return this.okxTonConnectUI.wallet}get walletName(){return this.okxTonConnectUI.walletName}set uiOptions(e){this.okxTonConnectUI.uiOptions=e}setConnectRequestParameters(e){this.okxTonConnectUI.setConnectRequestParameters(e)}getWallets(){return this.okxTonConnectUI.getWallets()}onStatusChange(e,t){return this.okxTonConnectUI.onStatusChange(e,t)}handleConnect(e){return P(this,null,function*(){return this.okxTonConnectUI.handleConnect(e)})}openModal(){return P(this,null,function*(){return this.okxTonConnectUI.openModal()})}closeModal(e){return this.okxTonConnectUI.closeModal(e)}onModalStateChange(e){return this.okxTonConnectUI.onModalStateChange(e)}get modalState(){return this.okxTonConnectUI.modalState}disconnect(){return this.okxTonConnectUI.disconnect()}sendTransaction(e,t){return P(this,null,function*(){return this.okxTonConnectUI.sendTransaction(e,t)})}showActionButton(){return this.okxTonConnectUI.showActionButton()}openWallet(e,t){this.okxTonConnectUI.openWallet(e,t)}}let[af,ag]=V({status:"closed",closeReason:null});Q(()=>"opened"===af().status);let[ap,av]=V({status:"closed",closeReason:null}),am=Q(()=>"opened"===ap().status),ay=Q(()=>{let e=ap();return"opened"===e.status?e.walletInfo:null}),aC="undefined"!=typeof window?new nl:void 0,[aO,ab]=V((null==aC?void 0:aC.getLastSelectedWalletInfo())||null),aw=e=>{aC||(aC=new nl),e?(tg(`modals-state.ts: setLastSelectedWalletInfo ${JSON.stringify(e)}`),aC.setLastSelectedWalletInfo(e)):(tg("modals-state.ts: setLastSelectedWalletInfo removeLastSelectedWalletInfo"),aC.removeLastSelectedWalletInfo()),ab(e)},[a_,aE]=V(null),aR=()=>{let e=en(r$),t=en(oU),[n,r]=V(null),[o,i]=V(!1),[a,s]=V(!1),c=t=>{e.closeModal(t)};return null==t||t.on("okx_engine_connect_params",e=>{(0,g.logDebug)(`UniversalSigneWalletModal okx_engine_connect_params ${JSON.stringify(e)}`),r(e)}),null==t||t.on("session_connecting",()=>{(0,g.logDebug)("UniversalSigneWalletModal session_connecting }"),s(!0)}),z(()=>{am()||(i(!1),r(null),s(!1))}),em(iB,{get opened(){return am()},get walletInfo(){return ay()},loadingBeforeConnect:()=>!1,connect:()=>new Promise((n,o)=>{var a,l,u,d;tH.connectRequestParameters&&new K("connect params is nil");let h=T({},JSON.parse(JSON.stringify(tH.connectRequestParameters)));h.sessionConfig={},h.sessionConfig.openUniversalUrl=(u=null==(a=tH.connectRequestParameters)?void 0:a.namespaces,d=null==(l=tH.connectRequestParameters)?void 0:l.optionalNamespaces,!t8()&&!tZ(u,d)&&tN()),i(!1),r(null),s(!1),e.handleConnect(e=>(h.sessionConfig.tmaReturnUrl=null==e?void 0:e.tmaReturnUrl,h.sessionConfig.redirect=null==e?void 0:e.returnStrategy,t.connect(h))).then(e=>{e?(c("wallet-selected"),n(e)):(i(!0),c("action-cancelled"))}).catch(e=>{i(!0),(0,g.logDebug)("UniversalSingleWalletModal connect error",JSON.stringify(e)),o(e)})}),onClose:c,universalLinkParams:n,get lastSelectedWalletInfo(){return aO()},setLastSelectedWalletInfo:aw,connectError:o,showRetry:!1,walletConnector:()=>(t1(),tH.walletConnector.filter(e=>e.enable)),get language(){return tH.language},sessionConnecting:a})},[aN,aS]=tB({theme:I.LIGHT,colors:i3,borderRadius:"m"}),aT={[I.LIGHT]:i3,[I.DARK]:i6};function aA(e){aS({theme:e,colors:aT[e]})}I.LIGHT,I.DARK;let aD=e=>{let t=rC(iq,tH.language);return nr(),nn(),em(rO.Provider,{value:t,get children(){return em(r$.Provider,{get value(){return e.connectUI},get children(){return em(oU.Provider,{get value(){return tH.connector},get children(){return[em(tu,{}),em(tn,{theme:aN,get children(){return em(eY,{component:ts,style:{position:"relative","z-index":3001},get children(){return[em(aR,{}),em(i5,{get action(){return a_()},setAction:aE})]}})}})]}})}})}})},aP={openSingleWalletModal:e=>{(0,g.logDebug)(`universalWidgetController : openSingleWalletModal : ${JSON.stringify(e)}`),setTimeout(()=>av({status:"opened",closeReason:null,walletInfo:e}))},closeSingleWalletModal:e=>void setTimeout(()=>av({status:"closed",closeReason:e})),setAction:e=>void setTimeout(()=>aE(e)),renderUniversalApp:(e,t)=>eL(()=>em(aD,{connectUI:t}),document.getElementById(e))};class aI{constructor(){D(this,"listeners",[])}listen(e){this.listeners.push(e)}
837trigger(e){this.listeners.forEach(t=>t(e))}}class aK{constructor(e){D(this,"consumers",[]),D(this,"getWalltsInfo"),D(this,"connectSignal",new aI),D(this,"state",ap()),this.getWalltsInfo=e.getWalltsInfo,z(()=>{let e=ap();this.state=e,this.consumers.forEach(t=>t(e))})}open(e,t){return P(this,null,function*(){(0,g.logDebug)(`UniversalSingleWalletModalManager : open : ${JSON.stringify(t)}`);let n=this.getWalltsInfo().find(t=>t$(t,e));if(n)return this.openSingleWalletModal(n,t);throw new K(`Trying to open modal window with unknown wallet "${e}".`)})}close(e="action-cancelled"){aP.closeSingleWalletModal(e)}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter(t=>t!==e)}}handleConnect(e,t){return P(this,null,function*(){return new Promise((n,r)=>{try{e(t).then(e=>{n(e),(0,g.logDebug)("UniversalSingleWalletModalManager result >>>",JSON.stringify(e)),this.connectSignal.trigger(e)}).catch(e=>{r(e),(0,g.logDebug)("UniversalSingleWalletModalManager error >>>",JSON.stringify(e)),this.connectSignal.trigger(e)})}catch(e){r(e),(0,g.logDebug)("UniversalSingleWalletModalManager catch error >>>",JSON.stringify(e)),this.connectSignal.trigger(e)}})})}openSingleWalletModal(e,t){return P(this,null,function*(){var n;if((0,g.logDebug)(`UniversalSingleWalletModalManager : openSingleWalletModal : ${JSON.stringify(t)}`),ty()&&tC(),tJ({connectRequestParameters:t}),t1(),!tH.walletConnector.some(e=>e.enable))throw new g.OKXConnectError(g.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED);let r=new Promise((e,t)=>{this.connectSignal.listen(n=>{n instanceof Error?t(n):e(n)})});if(1!=tH.walletConnector.length||(null==(n=tH.walletConnector[0])?void 0:n.getTag())!==g.O
837KX_INJECT_WALLET)return aP.openSingleWalletModal(e),r;{let e=tH.walletConnector[0];t.sessionConfig={};let n=tH.connector;if(n)return null==n||n.once("okx_engine_connect_params",t=>{e.openWallet(t)}),null==n?void 0:n.connect(t)}})}}var ak=function(e){if(e.length>=255)throw TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var r=0;r<e.length;r++){var o=e.charAt(r),i=o.charCodeAt(0);if(255!==t[i])throw TypeError(o+" is ambiguous");t[i]=r}var a=e.length,s=e.charAt(0),c=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function u(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;for(var n=0,r=0,o=0;e[n]===s;)r++,n++;for(var i=(e.length-n)*c+1>>>0,l=new Uint8Array(i);e[n];){var u=t[e.charCodeAt(n)];if(255===u)return;for(var d=0,h=i-1;(0!==u||d<o)&&-1!==h;h--,d++)u+=a*l[h]>>>0,l[h]=u%256>>>0,u=u/256>>>0;if(0!==u)throw Error("Non-zero carry");o=d,n++}for(var f=i-o;f!==i&&0===l[f];)f++;for(var g=new Uint8Array(r+(i-f)),p=r;f!==i;)g[p++]=l[f++];return g}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,o=0,i=t.length;o!==i&&0===t[o];)o++,n++;for(var c=(i-o)*l+1>>>0,u=new Uint8Array(c);o!==i;){for(var d=t[o],h=0,f=c-1;(0!==d||h<r)&&-1!==f;f--,h++)d+=256*u[f]>>>0,u[f]=d%a>>>0,d=d/a>>>0;if(0!==d)throw Error("Non-zero carry");r=h,o++}for(var g=c-r;g!==c&&0===u[g];)g++;for(var p=s.repeat(n);g<c;++g)p+=e.charAt(u[g]);return p},decodeUnsafe:u,decode:function(e){var t=u(e);if(t)return t;throw Error("Non-base"+a+" character")}}}("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),ax={};Object.defineProperty(ax,"__esModule",{value:!0}),ax.OKXInjectWalletName=ax.OKXMiniWalletName=ax.OKXWalletName=void 0,ax.creatOKXWalletInfo=function(){return{appName:"okxAppWallet",name:ax.OKXWalletName,imageUrl:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png"}},ax.creatOKXMiniAppWalletInfo=function(){return{appName:"okxMiniApp",name:ax.OKXMiniWalletName,imageUrl:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png"}},ax.creatOKXInjectWalletInfo=function(){return{appName:"okxInjectWallet",name:ax.OKXInjectWalletName,imageUrl:""}},ax.OKXWalletName="OKX Wallet",ax.OKXMiniWalletName="OKX Mini Wallet",ax.OKXInjectWalletName="OKX Inject Wallet";let aM=class{constructor(e,t){D(this,"singleWalletModal"),D(this,"actionsConfiguration"),D(this,"systemThemeChangeUnsubscribe",null),D(this,"universalProvider"),(0,g.logDebug)("OKXUniversalConnectUI constructor options:",JSON.stringify(e)),this.singleWalletModal=new aK({getWalltsInfo:()=>aM.getWallets()});let n=this.normalizeWidgetRoot(void 0);this.universalProvider=t,this.uiOptions=ao(e,{uiPreferences:{theme:"SYSTEM"},dappMetaData:e.dappMetaData}),tJ({connector:t,walletConnector:e.connector,dappMetaData:e.dappMetaData}),aP.renderUniversalApp(n,this)}static getWallets(){return[(0,g.creatOKXWalletInfo)(),(0,g.creatOKXMiniAppWalletInfo)(),ax.creatOKXInjectWalletInfo()]}set uiOptions(e){var t,n,r;(0,g.logDebug)("OKXUniversalConnectUI uiOptions() called"),this.actionsConfiguration=e.actionsConfiguration,(null==(t=e.uiPreferences)?void 0:t.theme)&&((null==(n=e.uiPreferences)?void 0:n.theme)!=="SYSTEM"?(null==(r=this.systemThemeChangeUnsubscribe)||r.call(this),aA(e.uiPreferences.theme)):(aA(ne()),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=nt(aA)))),e.language&&!au(e.language.toString())&&(e.language="en_US"),tJ(t=>{var n;return ao(T(T({},e.language&&{language:e.language}),!!(null==(n=e.actionsConfiguration)?void 0:n.returnStrategy)&&{returnStrategy:e.actionsConfiguration.returnStrategy}),tx(t))})}request(e,t,n){return P(this,null,function*(){var r,o,i,a,s,c,l,u;if((0,g.logDebug)("OKXUniversalConnectUI request() called"),!this.session)throw new K("Connect wallet to send a transaction.");let d={returnStrategy:tw("mobile")&&(null==(r=aO())?void 0:r.openMethod)!=="qrcode"?null==n?void 0:n.returnStrategy:"none",modals:null==n?void 0:n.modals,tmaReturnUrl:null!=(o=null==n?void 0:n.tmaReturnUrl)?o:"back"},{modals:h,returnStrategy:f,tmaReturnUrl:p}=this.getModalsAndNotificationsConfiguration(d),v=A(T({},e),{redirect:f}),m=this.universalProvider.showRequestModal(v,t);t4(this.getConnectWallet())||aP.setAction({name:"confirm-transaction",openModal:h.includes("before")&&m,sent:!1}),!(null==(i=this.session.sessionConfig)?void 0:i.openUniversalUrl)&&m&&t6(this.getConnectWallet(),null==(a=aO())?void 0:a.openMethod)&&(c=this.getConnectWallet(),l=p,u=this.session.namespaces,(0,g.logDebug)("wallets openUniversalWallet"),tV()&&t2(u)&&t3(c,l)),this.session.sessionConfig&&(this.session.sessionConfig.openUniversalUrl=this.session.sessionConfig.openUniversalUrl&&tN()&&(null==(s=aO())?void 0:s.openMethod)!=="qrcode");try{let e=yield this.universalProvider.request(v,t);return aP.setAction({name:"transaction-sent",openModal:h.includes("success")&&m}),e}catch(e){if((0,g.logDebug)(`OKXUniversalConnectUI request ==> ${typeof e} ==> is core OKXConnectError: ${e instanceof g.OKXConnectError} ==> is universal-provider OKXConnectError: ${e instanceof C.OKXConnectError} ==> ${JSON.stringify(e)}`),e instanceof g.OKXConnectError||e instanceof C.OKXConnectError)throw(0,g.logDebug)(`OKXUniversalConnectUI request ==> ${JSON.stringify(e)}`),e.code===g.OKX_CONNECT_ERROR_CODES.USER_REJECTS_ERROR?aP.setAction({name:"transaction-canceled",openModal:h.includes("error")&&m}):aP.setAction({name:"transaction-error",openModal:h.includes("error")&&m}),e;throw aP.setAction({name:"transaction-error",openModal:h.includes("error")&&m}),new K("Unhandled error:"+e)}})}getModalsAndNotificationsConfiguration(e){var t,n,r;let o=["before","success","error"],i=["before"];(null==(t=this.actionsConfiguration)?void 0:t.modals)&&(i="all"===this.actionsConfiguration.modals?o:this.actionsConfiguration.modals),(null==e?void 0:e.modals)&&(i="all"===e.modals?o:e.modals);let a=(null==e?void 0:e.returnStrategy)||(null==(n=this.actionsConfiguration)?void 0:n.returnStrategy)||"back";return{modals:i,tmaReturnUrl:(null==e?void 0:e.tmaReturnUrl)||(null==(r=this.actionsConfiguration)?void 0:r.tmaReturnUrl)||"back",returnStrategy:a}}static init(e){return P(this,null,function*(){if((0,g.logDebug)("OKXUniversalConnectUI init() called"),window&&window.okxConnectUniversalUIinwindow instanceof aM)return(0,g.logDebug)("OKXUniversalConnectUI init() old called"),window.okxConnectUniversalUIinwindow;if(this.initPromise)return(0,g.logDebug)("OKXUniversalConnectUI init() is waiting for ongoing initialization"),this.initPromise;this.initPromise=P(this,null,function*(){if(!e||!e.dappMetaData)throw new K("You have to specify a `dappMetaData` in the options.");if((0,g.logDebug)("OKXUniversalConnectUI init() new called"),!e.connector||0===e.connector.length){let t;e.connector=(t=[],t7()||t.push(g.AppwalletConnector.getConnector()),!tV()&&tN()||t.push(g.TgwalletConnector.getConnector()),t8()&&t.pu
837sh(g.OkxwalletInjectConnector.getConnector()),t)}let t=yield C.OKXUniversalProvider.init({dappMetaData:e.dappMetaData,connector:e.connector}),n=new aM(e,t);return window&&(window.okxConnectUniversalUIinwindow=n),n});try{return yield this.initPromise}finally{this.initPromise=null}})}normalizeWidgetRoot(e){if(!e||!document.getElementById(e)){e="universal-widget-root";let t=document.createElement("div");t.id=e,document.body.appendChild(t)}return e}getWallets(){return aM.getWallets()}handleConnect(e){return P(this,null,function*(){return this.singleWalletModal.handleConnect(e,this.actionsConfiguration)})}checkConnectMethods(e,t){return P(this,null,function*(){if((0,g.logDebug)("checkConnectMethods connectParams>>>>",JSON.stringify(e)),(0,g.logDebug)("checkConnectMethods responseItems>>>>",JSON.stringify(t)),this.universalProvider.session&&e&&e.length>0&&(!t||0===t.length)){var n=e[0];if(n){if("sync_all_addresses"===n.method)return;let e=[];try{let t=yield(0,C.connectMethodsAdaptOldVersion)(n,this.universalProvider.session);(0,g.logDebug)("checkConnectMethods callBackParams111>>>>",JSON.stringify(t));let r={};ty()&&(r.returnStrategy="tg://resolve"),(0,g.logDebug)("checkConnectMethods requestItem>>>>",JSON.stringify(n)),(0,g.logDebug)("checkConnectMethods callBackParams222>>>>",JSON.stringify(t)),this.request(n,n.chainId,r).then(r=>{let o=r;if((0,g.logDebug)(`checkConnectMethods then resultItem ====> ${JSON.stringify(o)}`),"wallet_addEthereumChain"===n.method)o={method:n.method,chainId:n.chainId,result:""};else if("personal_sign"===n.method)o={method:n.method,chainId:n.chainId,result:o};else if("btc_signMessage"===n.method)o.chainId=n.chainId;else if("solana_signMessage"===n.method){let e=o.result;o.chainId=n.chainId,o.result=A(T({},t),{signature:ak.decode(e)})}else if("sui_signMessage"===n.method||"sui_signPersonalMessage"===n.method){let e=o.result;o.chainId=n.chainId,o.result=A(T({},t),{signature:e})}else if("aptos_signMessage"===n.method){let e=o.result;e.startsWith("0x")&&(e=e.slice(2,e.length)),o.chainId=n.chainId,o.result=A(T({},t),{signature:e})}else"cosmos_signArbitrary"===n.method&&"string"==typeof o.result&&(o.chainId=n.chainId,o.result=JSON.parse(o.result));e.push(o),(0,g.logDebug)(`OKXUniversalConnectUI checkConnectMethods success result ====> ${JSON.stringify(e)}`),this.universalProvider.events.emit("connect_signResponse",e)}).catch(t=>{let r=(0,C.creatNotSupportMethodItemReplay)(n);e.push(r),(0,g.logDebug)(`OKXUniversalConnectUI checkConnectMethods error ====> ${JSON.stringify(t)}`),this.universalProvider.events.emit("connect_signResponse",e)})}catch(r){let t=(0,C.creatNotSupportMethodItemReplay)(n);e.push(t),(0,g.logDebug)(`OKXUniversalConnectUI checkConnectMethods error ====> ${JSON.stringify(r)}`),this.universalProvider.events.emit("connect_signResponse",e)}}else console.log("checkConnectMethods requestItem is nil",JSON.stringify(e))}})}openModalAndSign(e,t){return P(this,null,function*(){(0,g.logDebug)("OKXUniversalConnectUI openModalAndSign() called");let n=A(T({},e),{signRequest:t});return(0,g.logDebug)("OKXUniversalConnectUI openModalAndSign() opts:",JSON.stringify(e)),(0,g.logDebug)("OKXUniversalConnectUI openModalAndSign() signRequest:",JSON.stringify(t)),yield this.openModal(n)})}openModal(e){return P(this,null,function*(){(0,g.logDebug)("OKXUniversalConnectUI openModal() called");try{if(this.connected())return this.session;var t=yield this.singleWalletModal.open("okxAppWallet",e);return this.checkConnectMethods(e.signRequest,null==t?void 0:t.signResponse),t}catch(e){throw e}})}closeModal(e){this.singleWalletModal.close(e)}openWallet(e,t){this.universalProvider.openWallet(e,t)}onSingleWalletModalStateChange(e){return console.log("ui - onSingleWalletModalStateChange",e),this.singleWalletModal.onStateChange(e)}onModalStateChange(e){return console.log("ui - onModalStateChange",e),this.onSingleWalletModalStateChange(e)}showActionButton(){return t5(this.getConnectWallet())&&tN()}getUniversalProvider(){return this.universalProvider}getConnectWallet(){var e,t;return(0,g.logDebug)(`this.session?.wallet?.appName ${null==(t=null==(e=this.universalProvider.session)?void 0:e.wallet)?void 0:t.appName}`),this.getWallets().find(e=>{var t,n;return t$(e,null==(n=null==(t=this.universalProvider.session)?void 0:t.wallet)?void 0:n.appName)})}get session(){return this.universalProvider.session}setDefaultChain(e,t){this.universalProvider.setDefaultChain(e,t)}on(e,t){this.universalProvider.on(e,t)}once(e,t){this.universalProvider.once(e,t)}removeListener(e,t){this.universalProvider.removeListener(e,t)}off(e,t){this.universalProvider.off(e,t)}get walletName(){var e,t;return(0,g.logDebug)(`this.getConnectWallet()?.walletName ${null==(e=this.getConnectWallet())?void 0:e.name}`),null==(t=this.getConnectWallet())?void 0:t.name}disconnect(){return this.universalProvider.disconnect()}connected(){return this.universalProvider.connected()}requestAccountsWithNamespace(e){return this.universalProvider.requestAccountsWithNamespace(e)}requestDefaultChainWithNamespace(e){return this.universalProvider.requestDefaultChainWithNamespace(e)}};D(aM,"initPromise",null)},71860:function(e){"use strict";
837e.exports=JSON.parse('{"name":"@okxconnect/core","version":"1.7.0","description":"OKX Connect core","main":"./src/index.js","keywords":["OKXConnect","OKX Connect"],"scripts":{"build":"npx tsc","local":"yarn install && npx tsc","remove":"rm -rf ./src && rm -rf ./node_modules"},"author":"OKX Wallet","license":"MIT","dependencies":{"@stablelib/ed25519":"^1.0.2","@stablelib/random":"^1.0.1","@stablelib/sha256":"1.0.1","bs58":"^5.0.0","core-js":"2.6.12","cross-fetch":"^4.0.0","crypto-js":"^4.2.0","eventemitter3":"^5.0.1","isutf8":"^4.0.0","localforage":"^1.10.0","multiformats":"9.4.2","process":"^0.11.10","tweetnacl":"^1.0.3","tweetnacl-util":"^0.15.1","ua-parser-js":"^1.0.35","uint8arrays":"3.1.0"},"devDependencies":{"@types/crypto-js":"^4.2.2","@types/ua-parser-js":"^0.7.36","assert":"^2.1.0","eslint":"^9.7.0","events":"^3.3.0","jest":"^29.7.0","ts-loader":"^9.5.1","typescript":"^5.5.2"},"peerDependencies":{"@solana/web3.js":"^1.78.4"}}')}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.