diff --git a/docs/assets/index-144ce7bf.js b/docs/assets/index-a3dae48b.js similarity index 91% rename from docs/assets/index-144ce7bf.js rename to docs/assets/index-a3dae48b.js index e09c720..175ab8a 100644 --- a/docs/assets/index-144ce7bf.js +++ b/docs/assets/index-a3dae48b.js @@ -1150,7 +1150,7 @@ PERFORMANCE OF THIS SOFTWARE. width: 16px; `,Q0=ae(Bt)` margin-top: 32px; -`,E1=e=>{const t=sl(e),n=On(wo),[r,o]=Ze(!0),[i,a]=Ze(!1);cn(()=>{const f=Tr();a(!!f&&"sent"in f&&f.sent)});let l;n!=null&&n.wallet&&"universalLink"in n.wallet&&(n.wallet.openMethod==="universal-link"||io(n.wallet.universalLink)&&yr())&&(l=n.wallet.universalLink);let s;n!=null&&n.wallet&&"deepLink"in n.wallet&&(n.wallet.openMethod==="custom-deeplink"||io(n.wallet.deepLink)&&yr())&&(s=n.wallet.deepLink);const c=()=>{const f=Tr(),m="returnStrategy"in f?f.returnStrategy:pt.returnStrategy,h=!r();o(!1),io(l)?cl(l,{returnStrategy:m,twaReturnUrl:"twaReturnUrl"in f?f.twaReturnUrl:pt.twaReturnUrl,forceRedirect:h}):ul(l,s,{returnStrategy:m,forceRedirect:h},()=>{})};return y(V9,mr(t,{get children(){return[Pe(()=>e.icon),y(K9,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),y(q9,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),y(Ke,{get when(){return!i()&&(e.showButton==="open-wallet"&&l||e.showButton!=="open-wallet")},get children(){return y(G9,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return y(Q9,{})}})}}),y(Ke,{get when(){return i()},get children(){return[y(Ke,{get when(){return e.showButton!=="open-wallet"},get children(){return y(Q0,{onClick:()=>e.onClose(),get children(){return y(Nt,{translationKey:"common.close",children:"Close"})}})}}),y(Ke,{get when(){return e.showButton==="open-wallet"&&l},get children(){return y(Q0,{onClick:c,get children(){return y(Nt,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},Y9=e=>{const t=On(wo),[n]=Sr(),r=()=>t.wallet&&"name"in t.wallet?t.wallet.name:n("common.yourWallet",{},"Your wallet");return y(E1,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:r()}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return y(Wr,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},Z9=e=>y(E1,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return y(hc,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),J9=e=>y(E1,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return y(C1,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),X9=()=>y(rg,{get opened(){var e;return Pe(()=>Tr()!==null)()&&((e=Tr())==null?void 0:e.openModal)===!0},get enableAndroidBackHandler(){return pt.enableAndroidBackHandler},onClose:()=>li(null),"data-tc-actions-modal-container":"true",get children(){return y(il,{get children(){return[y(yn,{get when(){return Tr().name==="transaction-sent"},get children(){return y(J9,{onClose:()=>li(null)})}}),y(yn,{get when(){return Tr().name==="transaction-canceled"},get children(){return y(Z9,{onClose:()=>li(null)})}}),y(yn,{get when(){return Tr().name==="confirm-transaction"},get children(){return y(Y9,{onClose:()=>li(null)})}})]}})}}),eb=()=>{const{locale:e}=Sr()[1];cn(()=>e(pt.language)),cn(()=>{x0()&&$s()});const t=On(Ui),n=On(wo),[r,o]=Ze(!1),i=()=>{var c;return((c=pt.connectRequestParameters)==null?void 0:c.state)==="loading"},a=Pe(()=>{var c;if(!i())return(c=pt.connectRequestParameters)==null?void 0:c.value}),l=c=>{n.closeSingleWalletModal(c)},s=t.onStatusChange(c=>{c&&l("wallet-selected")});return jn(s),jn(()=>{o(!1)}),y(yg,{get opened(){return x0()},get enableAndroidBackHandler(){return pt.enableAndroidBackHandler},onClose:()=>l("action-cancelled"),onClickQuestion:()=>o(c=>!c),"data-tc-wallets-modal-container":"true",get children(){return[y(Ke,{get when(){return r()},get children(){return y(xg,{onBackClick:()=>o(!1)})}}),y(Ke,{get when(){return!r()},get children(){return[y(Ke,{get when(){return i()},get children(){return[y(bg,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),y(wg,{get children(){return y(Wr,{size:"m"})}})]}}),y(Ke,{get when(){return!i()},get children(){return y(Ai,{get component(){return Yr()?Sg:Cg},get wallet(){return l4()},get additionalRequest(){return a()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},tb=e=>{const t=_y(k4,pt.language);return t4(),e4(),y(ag.Provider,{value:t,get children(){return y(wo.Provider,{get value(){return e.tonConnectUI},get children(){return y(Ui.Provider,{get value(){return pt.connector},get children(){return[y(K3,{}),y(z3,{theme:R4,get children(){return[y(Ke,{get when(){return pt.buttonRootId},get children(){return y(W2,{get mount(){return document.getElementById(pt.buttonRootId)},get children(){return y(L8,{})}})}}),y(Ai,{component:Ar,get children(){return[y(z9,{}),y(eb,{}),y(X9,{})]}})]}})]}})}})}})},Hn={openWalletsModal:()=>void setTimeout(()=>b0({status:"opened",closeReason:null})),closeWalletsModal:e=>void setTimeout(()=>b0({status:"closed",closeReason:e})),openSingleWalletModal:e=>{setTimeout(()=>C0({status:"opened",closeReason:null,walletInfo:e}))},closeSingleWalletModal:e=>void setTimeout(()=>C0({status:"closed",closeReason:e})),setAction:e=>void setTimeout(()=>li(e)),clearAction:()=>void setTimeout(()=>li(null)),getSelectedWalletInfo:()=>s4(),removeSelectedWalletInfo:()=>wn(null),renderApp:(e,t)=>_3(()=>y(tb,{tonConnectUI:t}),document.getElementById(e))};class nb{constructor(t){qe(this,"connector"),qe(this,"setConnectRequestParametersCallback"),qe(this,"consumers",[]),qe(this,"tracker"),qe(this,"state",Zu()),this.connector=t.connector,this.tracker=t.tracker,this.setConnectRequestParametersCallback=t.setConnectRequestParametersCallback,cn(()=>{const n=Zu();this.state=n,this.consumers.forEach(r=>r(n))})}open(){return yt(this,null,function*(){this.tracker.trackConnectionStarted();const n=(yield this.connector.getWallets()).find(ic);return n?this.connectEmbeddedWallet(n):this.openWalletsModal()})}close(t="action-cancelled"){t==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),Hn.closeWalletsModal(t)}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(n=>n!==t)}}connectEmbeddedWallet(t){const n=o=>{wn(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},r=pt.connectRequestParameters;(r==null?void 0:r.state)==="loading"?this.setConnectRequestParametersCallback(n):n(r==null?void 0:r.value)}openWalletsModal(){return yt(this,null,function*(){return yr()&&y1(),Hn.openWalletsModal(),new Promise(t=>{const n=this.onStateChange(r=>{const{status:o}=r;o==="opened"&&(n(),t())})})})}}class rb{constructor(t){qe(this,"connector"),qe(this,"consumers",[]),this.connector=t.connector,cn(()=>{const n=Tr();this.consumers.forEach(r=>r(n))})}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(n=>n!==t)}}}class ob{constructor(t){qe(this,"connector"),qe(this,"setConnectRequestParametersCallback"),qe(this,"consumers",[]),qe(this,"tracker"),qe(this,"state",Ms()),this.connector=t.connector,this.tracker=t.tracker,this.setConnectRequestParametersCallback=t.setConnectRequestParametersCallback,cn(()=>{const n=Ms();this.state=n,this.consumers.forEach(r=>r(n))})}open(t){return yt(this,null,function*(){this.tracker.trackConnectionStarted();const n=yield this.connector.getWallets(),r=_1(n,pt.walletsListConfiguration),o=r.find(ic);if(!!o)return this.connectEmbeddedWallet(o);const l=r.filter(Ss).find(f=>Vr(f,t));if(!!l)return this.openSingleWalletModal(l);const c=`Trying to open modal window with unknown wallet "${t}".`;throw this.tracker.trackConnectionError(c),new Xt(c)})}close(t="action-cancelled"){t==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),Hn.closeSingleWalletModal("action-cancelled")}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(n=>n!==t)}}connectEmbeddedWallet(t){const n=o=>{wn(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},r=pt.connectRequestParameters;(r==null?void 0:r.state)==="loading"?this.setConnectRequestParametersCallback(n):n(r==null?void 0:r.value)}openSingleWalletModal(t){return yt(this,null,function*(){return yr()&&y1(),Hn.openSingleWalletModal(t),new Promise(n=>{const r=this.onStateChange(o=>{const{status:i}=o;i==="opened"&&(r(),n())})})})}}class ib{constructor(t){qe(this,"eventPrefix","ton-connect-ui-"),qe(this,"tonConnectUiVersion"),qe(this,"tonConnectSdkVersion",null),qe(this,"eventDispatcher");var n;this.eventDispatcher=(n=t==null?void 0:t.eventDispatcher)!=null?n:new C2,this.tonConnectUiVersion=t.tonConnectUiVersion,this.init().catch()}get version(){return zo({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return yt(this,null,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch{}})}setRequestVersionHandler(){return yt(this,null,function*(){yield this.eventDispatcher.addEventListener("ton-connect-ui-request-version",()=>yt(this,null,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-ui-response-version",u2(this.tonConnectUiVersion))}))})}requestTonConnectSdkVersion(){return yt(this,null,function*(){return new Promise((t,n)=>yt(this,null,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-response-version",r=>{t(r.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-request-version",c2())}catch(r){n(r)}}))})}dispatchUserActionEvent(t){var n;try{(n=this.eventDispatcher)==null||n.dispatchEvent(`${this.eventPrefix}${t.type}`,t).catch()}catch{}}trackConnectionStarted(...t){try{const n=d2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionCompleted(...t){try{const n=f2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionError(...t){try{const n=h2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringStarted(...t){try{const n=p2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringCompleted(...t){try{const n=g2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringError(...t){try{const n=m2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackDisconnection(...t){try{const n=w2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSentForSignature(...t){try{const n=v2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigned(...t){try{const n=y2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigningFailed(...t){try{const n=b2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}}const ab="2.0.11-beta.6";class lb{constructor(t){qe(this,"walletInfoStorage",new i4),qe(this,"preferredWalletStorage",new a4),qe(this,"tracker"),qe(this,"walletInfo",null),qe(this,"systemThemeChangeUnsubscribe",null),qe(this,"actionsConfiguration"),qe(this,"walletsList"),qe(this,"primaryWalletAppName"),qe(this,"connectRequestParametersCallback"),qe(this,"connector"),qe(this,"modal"),qe(this,"singleWalletModal"),qe(this,"transactionModal"),qe(this,"connectionRestored",Promise.resolve(!1));var n;if(t&&"connector"in t&&t.connector)this.connector=t.connector;else if(t&&"manifestUrl"in t&&t.manifestUrl)this.connector=new Wo({manifestUrl:t.manifestUrl,eventDispatcher:t==null?void 0:t.eventDispatcher});else throw new Xt("You have to specify a `manifestUrl` or a `connector` in the options.");this.tracker=new ib({eventDispatcher:t==null?void 0:t.eventDispatcher,tonConnectUiVersion:ab}),this.modal=new nb({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:i=>{this.connectRequestParametersCallback=i}}),this.singleWalletModal=new ob({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:i=>{this.connectRequestParametersCallback=i}}),this.transactionModal=new rb({connector:this.connector}),this.walletsList=this.getWallets(),this.primaryWalletAppName=t.primaryWalletAppName===null?void 0:(n=t.primaryWalletAppName)!=null?n:"tonkeeper",this.walletsList.then(i=>z2(T8(i.map(a=>a.imageUrl))));const r=this.normalizeWidgetRoot(t==null?void 0:t.widgetRootId);this.subscribeToWalletChange(),(t==null?void 0:t.restoreConnection)!==!1&&(this.connectionRestored=n4(()=>yt(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(t,{uiPreferences:{theme:"SYSTEM"}});const o=this.preferredWalletStorage.getPreferredWalletAppName();Pl({connector:this.connector,preferredWalletAppName:o,primaryWalletAppName:this.primaryWalletAppName}),Hn.renderApp(r,this)}static getWallets(){return Wo.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?Ct(Ct({},this.connector.wallet),this.walletInfo):null}set uiOptions(t){var n,r,o,i,a;this.checkButtonRootExist(t.buttonRootId),this.actionsConfiguration=t.actionsConfiguration,(n=t.uiPreferences)!=null&&n.theme?((r=t.uiPreferences)==null?void 0:r.theme)!=="SYSTEM"?((o=this.systemThemeChangeUnsubscribe)==null||o.call(this),Vc(t.uiPreferences.theme,t.uiPreferences.colorsSet)):(Vc(Y3(),t.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=Z3(Vc))):(i=t.uiPreferences)!=null&&i.colorsSet&&O4(t.uiPreferences.colorsSet),(a=t.uiPreferences)!=null&&a.borderRadius&&j4(t.uiPreferences.borderRadius),Pl(l=>{var s,c;const f=ao(Ct(Ct(Ct(Ct(Ct({},t.hasOwnProperty("primaryWalletAppName")&&{primaryWalletAppName:t.primaryWalletAppName===null?void 0:t.primaryWalletAppName}),t.language&&{language:t.language}),!!((s=t.actionsConfiguration)!=null&&s.returnStrategy)&&{returnStrategy:t.actionsConfiguration.returnStrategy}),!!((c=t.actionsConfiguration)!=null&&c.twaReturnUrl)&&{twaReturnUrl:t.actionsConfiguration.twaReturnUrl}),!!t.walletsListConfiguration&&{walletsListConfiguration:t.walletsListConfiguration}),Li(l));return t.buttonRootId!==void 0&&(f.buttonRootId=t.buttonRootId),t.enableAndroidBackHandler!==void 0&&(f.enableAndroidBackHandler=t.enableAndroidBackHandler),f})}setConnectRequestParameters(t){var n;Pl({connectRequestParameters:t}),((t==null?void 0:t.state)==="ready"||!t)&&((n=this.connectRequestParametersCallback)==null||n.call(this,t==null?void 0:t.value))}getWallets(){return yt(this,null,function*(){return this.connector.getWallets()})}onStatusChange(t,n){return this.connector.onStatusChange(r=>yt(this,null,function*(){if(r){const o=yield this.getSelectedWalletInfo(r);t(Ct(Ct({},r),o||this.walletInfoStorage.getWalletInfo()))}else t(r)}),n)}openModal(){return yt(this,null,function*(){return this.modal.open()})}closeModal(t){this.modal.close(t)}onModalStateChange(t){return this.modal.onStateChange(t)}get modalState(){return this.modal.state}openSingleWalletModal(t){return yt(this,null,function*(){return this.singleWalletModal.open(t)})}closeSingleWalletModal(t){this.singleWalletModal.close(t)}onSingleWalletModalStateChange(t){return this.singleWalletModal.onStateChange(t)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(){return yt(this,null,function*(){const n=(yield this.getWallets()).find(ic);return n?yield this.connectEmbeddedWallet(n):yield this.connectExternalWallet()})}disconnect(){return this.tracker.trackDisconnection(this.wallet,"dapp"),Hn.clearAction(),Hn.removeSelectedWalletInfo(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(t,n){return yt(this,null,function*(){if(this.tracker.trackTransactionSentForSignature(this.wallet,t),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,t,"Wallet was not connected"),new Xt("Connect wallet to send a transaction.");yr()&&y1();const{notifications:r,modals:o,returnStrategy:i,twaReturnUrl:a,skipRedirectToWallet:l}=this.getModalsAndNotificationsConfiguration(n);Hn.setAction({name:"confirm-transaction",showNotification:r.includes("before"),openModal:o.includes("before"),sent:!1});const s=()=>{c.signal.aborted||(Hn.setAction({name:"confirm-transaction",showNotification:r.includes("before"),openModal:o.includes("before"),sent:!0}),this.walletInfo&&"universalLink"in this.walletInfo&&(this.walletInfo.openMethod==="universal-link"||this.walletInfo.openMethod==="custom-deeplink")&&(io(this.walletInfo.universalLink)?cl(this.walletInfo.universalLink,{returnStrategy:i,twaReturnUrl:a||pt.twaReturnUrl,forceRedirect:!1}):ul(this.walletInfo.universalLink,this.walletInfo.deepLink,{returnStrategy:i,forceRedirect:!1},()=>{})))},c=new AbortController,f=this.onTransactionModalStateChange(m=>{m!=null&&m.openModal||(f(),m||c.abort())});try{const m=yield this.waitForSendTransaction({transaction:t,signal:c.signal},s);return this.tracker.trackTransactionSigned(this.wallet,t,m),Hn.setAction({name:"transaction-sent",showNotification:r.includes("success"),openModal:o.includes("success")}),m}catch(m){throw Hn.setAction({name:"transaction-canceled",showNotification:r.includes("error"),openModal:o.includes("error")}),m instanceof Ve?m:(console.error(m),new Xt("Unhandled error:"+m))}finally{f()}})}connectEmbeddedWallet(t){return yt(this,null,function*(){const n=o=>{wn(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},r=pt.connectRequestParameters;return(r==null?void 0:r.state)==="loading"?this.connectRequestParametersCallback=n:n(r==null?void 0:r.value),yield this.waitForWalletConnection({ignoreErrors:!1})})}connectExternalWallet(){return yt(this,null,function*(){const t=new AbortController;Hn.openWalletsModal();const n=this.onModalStateChange(r=>{const{status:o,closeReason:i}=r;o!=="opened"&&(n(),i==="action-cancelled"&&t.abort())});return yield this.waitForWalletConnection({ignoreErrors:!0,signal:t.signal})})}waitForWalletConnection(t){return yt(this,null,function*(){return new Promise((n,r)=>{this.tracker.trackConnectionStarted();const{ignoreErrors:o=!1,signal:i=null}=t;if(i&&i.aborted)return this.tracker.trackConnectionError("Connection was cancelled"),r(new Xt("Wallet was not connected"));const a=c=>yt(this,null,function*(){if(c)this.tracker.trackConnectionCompleted(c),s(),n(c);else{if(this.tracker.trackConnectionError("Connection was cancelled"),o)return;s(),r(new Xt("Wallet was not connected"))}}),l=c=>{this.tracker.trackConnectionError(c.message),!o&&(s(),r(c))},s=this.onStatusChange(c=>a(c),c=>l(c));i&&i.addEventListener("abort",()=>{s(),r(new Xt("Wallet was not connected"))},{once:!0})})})}waitForSendTransaction(t,n){return yt(this,null,function*(){return new Promise((r,o)=>{const{transaction:i,signal:a}=t;if(a.aborted)return this.tracker.trackTransactionSigningFailed(this.wallet,i,"Transaction was cancelled"),o(new Xt("Transaction was not sent"));const l=f=>yt(this,null,function*(){r(f)}),s=f=>{o(f)},c=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,i,"Transaction was cancelled"),o(new Xt("Transaction was not sent"))};a.addEventListener("abort",c,{once:!0}),this.connector.sendTransaction(i,{onRequestSent:n,signal:a}).then(f=>(a.removeEventListener("abort",c),l(f))).catch(f=>(a.removeEventListener("abort",c),s(f)))})})}onTransactionModalStateChange(t){return this.transactionModal.onStateChange(t)}subscribeToWalletChange(){this.connector.onStatusChange(t=>yt(this,null,function*(){var n;t?(yield this.updateWalletInfo(t),this.setPreferredWalletAppName(((n=this.walletInfo)==null?void 0:n.appName)||t.device.appName)):this.walletInfoStorage.removeWalletInfo()}))}setPreferredWalletAppName(t){this.preferredWalletStorage.setPreferredWalletAppName(t),Pl({preferredWalletAppName:t})}getSelectedWalletInfo(t){return yt(this,null,function*(){let n=Hn.getSelectedWalletInfo();if(!n)return null;let r;if("name"in n)r=n;else{const i=_1(yield this.walletsList,pt.walletsListConfiguration).find(a=>Vr(a,t.device.appName));if(!i)throw new Xt(`Cannot find WalletInfo for the '${t.device.appName}' wallet`);r=Ct(Ct({},i),n)}return r})}updateWalletInfo(t){return yt(this,null,function*(){const n=yield this.getSelectedWalletInfo(t);if(n){this.walletInfo=n,this.walletInfoStorage.setWalletInfo(n);return}const r=this.walletInfoStorage.getWalletInfo();if(r){this.walletInfo=r;return}this.walletInfo=(yield this.walletsList).find(o=>Vr(o,t.device.appName))||null})}normalizeWidgetRoot(t){if(!t||!document.getElementById(t)){t="tc-widget-root";const n=document.createElement("div");n.id=t,document.body.appendChild(n)}return t}checkButtonRootExist(t){if(t!=null&&!document.getElementById(t))throw new Xt(`${t} element not found in the document.`)}getModalsAndNotificationsConfiguration(t){var n,r,o,i,a,l;const s=["before","success","error"];let c=s;(n=this.actionsConfiguration)!=null&&n.notifications&&((r=this.actionsConfiguration)==null?void 0:r.notifications)!=="all"&&(c=this.actionsConfiguration.notifications),t!=null&&t.notifications&&(t.notifications==="all"?c=s:c=t.notifications);let f=["before"];(o=this.actionsConfiguration)!=null&&o.modals&&(this.actionsConfiguration.modals==="all"?f=s:f=this.actionsConfiguration.modals),t!=null&&t.modals&&(t.modals==="all"?f=s:f=t.modals);const m=(t==null?void 0:t.returnStrategy)||((i=this.actionsConfiguration)==null?void 0:i.returnStrategy)||"back",h=(t==null?void 0:t.twaReturnUrl)||((a=this.actionsConfiguration)==null?void 0:a.twaReturnUrl);let w=(t==null?void 0:t.skipRedirectToWallet)||((l=this.actionsConfiguration)==null?void 0:l.skipRedirectToWallet)||"ios";return yr()&&(w="never"),{notifications:c,modals:f,returnStrategy:m,twaReturnUrl:h,skipRedirectToWallet:w}}}function Ag(){return typeof window<"u"}function sb(){return!Ag()}const Lg=$t.createContext(null);let tu=null;const cb=e=>{var t=e,{children:n}=t,r=Ym(t,["children"]);return Ag()&&!tu&&(tu=new lb(r)),t2(Lg.Provider,{value:tu,children:n})},ub=$t.memo(cb);class A1 extends Xt{constructor(...t){super(...t),Object.setPrototypeOf(this,A1.prototype)}}class L1 extends A1{constructor(...t){super(...t),Object.setPrototypeOf(this,L1.prototype)}}function db(e){if(!e)throw new L1("You should add on the top of the app to use TonConnect");return!0}function dl(){const e=$t.useContext(Lg),t=$t.useCallback(n=>{e&&(e.uiOptions=n)},[e]);return sb()?[null,()=>{}]:(db(e),[e,t])}const Y0="ton-connect-button",fb=({className:e,style:t})=>{const[n,r]=dl();return $t.useEffect(()=>(r({buttonRootId:Y0}),()=>r({buttonRootId:null})),[r]),t2("div",{id:Y0,className:e,style:Qm({width:"fit-content"},t)})},hb=$t.memo(fb);function pb(){const[e]=dl(),[t,n]=$t.useState((e==null?void 0:e.wallet)||null);return $t.useEffect(()=>{if(e)return n(e.wallet),e.onStatusChange(r=>{n(r)})},[e]),t}const Ol={[bt.LIGHT]:{constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#0098EA",telegramButton:"#0098EA",icon:{primary:"#0F0F0F",secondary:"#7A8999",tertiary:"#C1CAD2",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#FFFFFF",secondary:"#F1F3F5",segment:"#FFFFFF",tint:"#F1F3F5",qr:"#F1F3F5"},text:{primary:"#0F0F0F",secondary:"#6A7785"}},[bt.DARK]:{constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#E5E5EA",telegramButton:"#31A6F5",icon:{primary:"#E5E5EA",secondary:"#909099",tertiary:"#434347",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#121214",secondary:"#18181A",segment:"#262629",tint:"#222224",qr:"#F1F3F5"},text:{primary:"#E5E5EA",secondary:"#7D7D85"}}},gb=({theme:e})=>{const[t,n]=dl(),[r,o]=$t.useState(Ol[e]);$t.useEffect(()=>{o(Ol[e])},[e]);const i=(a,l,s)=>{n({uiPreferences:{colorsSet:{[e]:{[l]:s?{...r[l],[s]:a}:a}}}}),o(c=>({...c,[l]:s?{...c[l],[s]:a}:a})),Ol[e]={...Ol[e],[l]:s?{...r[l],[s]:a}:a}};return Qe("div",{className:"colors-container",children:Object.entries(r).map(([a,l])=>typeof l=="object"?Et("div",{children:[Et("span",{children:[a,":"]}),Object.entries(l).map(([s,c])=>Et("label",{children:[s,Qe("input",{type:"color",value:r[a][s],onChange:f=>i(f.target.value,a,s)})]},a+s))]},a):Et("div",{children:[Et("span",{children:[a,":"]}),Qe("label",{children:Qe("input",{type:"color",value:r[a],onChange:s=>i(s.target.value,a)})})]}))})};const mb=()=>{const[e,t]=$t.useState(!1),[n,r]=$t.useState(bt.LIGHT);return Et(Vg,{children:[Qe("button",{onClick:()=>t(!0),children:"change colors"}),e&&Et("div",{className:"modal",children:[Qe("button",{onClick:()=>t(!1),children:"close"}),Et("div",{className:"modal__toggle",children:[Qe("a",{href:"#",style:{color:n===bt.LIGHT?"blue":"white"},onClick:()=>r(bt.LIGHT),children:"LIGHT"}),Qe("a",{href:"#",style:{color:n===bt.DARK?"blue":"white"},onClick:()=>r(bt.DARK),children:"DARK"})]}),Qe(gb,{theme:n})]})]})},vb=()=>{const[e,t]=$t.useState([!0,!1,!1,!0,!0,!0]),[n,r]=$t.useState("back"),[o,i]=$t.useState("ios"),[a,l]=$t.useState([]),[s,c]=dl(),f=x=>{c({language:x})},m=x=>{c({primaryWalletAppName:x==="unset"?"tonkeeper":x==="disabled"?null:x})},h=x=>{c({uiPreferences:{theme:x}})},w=x=>{c({uiPreferences:{borderRadius:x}})},L=x=>{t(T=>T.map((I,d)=>d===x?!I:I))},P=()=>{if(!n){r("back");return}c({actionsConfiguration:{returnStrategy:n}})},C=()=>{if(!o){i("ios");return}c({actionsConfiguration:{skipRedirectToWallet:o}})};return $t.useEffect(()=>{const x=["before","success","error"],T=x.map((d,R)=>e[R]?d:void 0).filter(d=>d),I=x.map((d,R)=>e[R+3]?d:void 0).filter(d=>d);c({actionsConfiguration:{modals:T,notifications:I}})},[e]),$t.useEffect(()=>{s.getWallets().then(l)},[]),Et("footer",{className:"footer",children:[Et("div",{children:[Qe("label",{children:"primary wallet"}),Et("select",{onChange:x=>m(x.target.value),children:[Qe("option",{value:"unset",children:"unset"}),Qe("option",{value:"disabled",children:"disabled"}),a.map(x=>Qe("option",{value:x.appName,children:x.name},x.appName))]})]}),Et("div",{children:[Qe("label",{children:"language"}),Et("select",{onChange:x=>f(x.target.value),children:[Qe("option",{value:"en",children:"en"}),Qe("option",{value:"ru",children:"ru"})]})]}),Et("div",{children:[Qe("label",{children:"theme"}),Et("select",{onChange:x=>h(x.target.value),children:[Qe("option",{value:bt.DARK,children:"dark"}),Qe("option",{value:bt.LIGHT,children:"light"}),Qe("option",{value:"SYSTEM",children:"system"})]})]}),Et("div",{children:[Qe("label",{children:"borders"}),Et("select",{onChange:x=>w(x.target.value),children:[Qe("option",{value:"m",children:"m"}),Qe("option",{value:"s",children:"s"}),Qe("option",{value:"none",children:"none"})]})]}),Et("div",{className:"footer-checkbox-container",children:[Qe("span",{children:"modals"}),Et("label",{children:["before",Qe("input",{type:"checkbox",checked:e[0],onChange:()=>L(0)})]}),Et("label",{children:["success",Qe("input",{type:"checkbox",checked:e[1],onChange:()=>L(1)})]}),Et("label",{children:["error",Qe("input",{type:"checkbox",checked:e[2],onChange:()=>L(2)})]})]}),Et("div",{className:"footer-checkbox-container",children:[Qe("span",{children:"notifications"}),Et("label",{children:["before",Qe("input",{type:"checkbox",checked:e[3],onChange:()=>L(3)})]}),Et("label",{children:["success",Qe("input",{type:"checkbox",checked:e[4],onChange:()=>L(4)})]}),Et("label",{children:["error",Qe("input",{type:"checkbox",checked:e[5],onChange:()=>L(5)})]})]}),Qe("div",{children:Qe(mb,{})}),Qe("div",{children:Et("label",{children:["return strategy:",Qe("input",{style:{width:"200px"},value:n,onChange:x=>r(x.target.value),onBlur:P})]})}),Qe("div",{children:Et("label",{children:[Qe("div",{children:"skip redirect to wallet:"}),Qe("div",{children:"('ios', 'never', 'always')"}),Qe("input",{style:{width:"200px"},value:o,onChange:x=>i(x.target.value),onBlur:C})]})})]})};const yb=()=>Et("header",{children:[Qe("span",{children:"My App with React UI by Tonkeeper"}),Qe(hb,{})]});var Tg={exports:{}};(function(e,t){(function(n,r){e.exports=r($t)})(Mg,function(n){return function(r){var o={};function i(a){if(o[a])return o[a].exports;var l=o[a]={i:a,l:!1,exports:{}};return r[a].call(l.exports,l,l.exports,i),l.l=!0,l.exports}return i.m=r,i.c=o,i.d=function(a,l,s){i.o(a,l)||Object.defineProperty(a,l,{enumerable:!0,get:s})},i.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},i.t=function(a,l){if(1&l&&(a=i(a)),8&l||4&l&&typeof a=="object"&&a&&a.__esModule)return a;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:a}),2&l&&typeof a!="string")for(var c in a)i.d(s,c,(function(f){return a[f]}).bind(null,c));return s},i.n=function(a){var l=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(l,"a",l),l},i.o=function(a,l){return Object.prototype.hasOwnProperty.call(a,l)},i.p="",i(i.s=48)}([function(r,o){r.exports=n},function(r,o){var i=r.exports={version:"2.6.12"};typeof __e=="number"&&(__e=i)},function(r,o,i){var a=i(26)("wks"),l=i(17),s=i(3).Symbol,c=typeof s=="function";(r.exports=function(f){return a[f]||(a[f]=c&&s[f]||(c?s:l)("Symbol."+f))}).store=a},function(r,o){var i=r.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=i)},function(r,o,i){r.exports=!i(8)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(r,o){var i={}.hasOwnProperty;r.exports=function(a,l){return i.call(a,l)}},function(r,o,i){var a=i(7),l=i(16);r.exports=i(4)?function(s,c,f){return a.f(s,c,l(1,f))}:function(s,c,f){return s[c]=f,s}},function(r,o,i){var a=i(10),l=i(35),s=i(23),c=Object.defineProperty;o.f=i(4)?Object.defineProperty:function(f,m,h){if(a(f),m=s(m,!0),a(h),l)try{return c(f,m,h)}catch{}if("get"in h||"set"in h)throw TypeError("Accessors not supported!");return"value"in h&&(f[m]=h.value),f}},function(r,o){r.exports=function(i){try{return!!i()}catch{return!0}}},function(r,o,i){var a=i(40),l=i(22);r.exports=function(s){return a(l(s))}},function(r,o,i){var a=i(11);r.exports=function(l){if(!a(l))throw TypeError(l+" is not an object!");return l}},function(r,o){r.exports=function(i){return typeof i=="object"?i!==null:typeof i=="function"}},function(r,o){r.exports={}},function(r,o,i){var a=i(39),l=i(27);r.exports=Object.keys||function(s){return a(s,l)}},function(r,o){r.exports=!0},function(r,o,i){var a=i(3),l=i(1),s=i(53),c=i(6),f=i(5),m=function(h,w,L){var P,C,x,T=h&m.F,I=h&m.G,d=h&m.S,R=h&m.P,j=h&m.B,W=h&m.W,U=I?l:l[w]||(l[w]={}),k=U.prototype,N=I?a:d?a[w]:(a[w]||{}).prototype;for(P in I&&(L=w),L)(C=!T&&N&&N[P]!==void 0)&&f(U,P)||(x=C?N[P]:L[P],U[P]=I&&typeof N[P]!="function"?L[P]:j&&C?s(x,a):W&&N[P]==x?function(O){var $=function(B,ee,Z){if(this instanceof O){switch(arguments.length){case 0:return new O;case 1:return new O(B);case 2:return new O(B,ee)}return new O(B,ee,Z)}return O.apply(this,arguments)};return $.prototype=O.prototype,$}(x):R&&typeof x=="function"?s(Function.call,x):x,R&&((U.virtual||(U.virtual={}))[P]=x,h&m.R&&k&&!k[P]&&c(k,P,x)))};m.F=1,m.G=2,m.S=4,m.P=8,m.B=16,m.W=32,m.U=64,m.R=128,r.exports=m},function(r,o){r.exports=function(i,a){return{enumerable:!(1&i),configurable:!(2&i),writable:!(4&i),value:a}}},function(r,o){var i=0,a=Math.random();r.exports=function(l){return"Symbol(".concat(l===void 0?"":l,")_",(++i+a).toString(36))}},function(r,o,i){var a=i(22);r.exports=function(l){return Object(a(l))}},function(r,o){o.f={}.propertyIsEnumerable},function(r,o,i){var a=i(52)(!0);i(34)(String,"String",function(l){this._t=String(l),this._i=0},function(){var l,s=this._t,c=this._i;return c>=s.length?{value:void 0,done:!0}:(l=a(s,c),this._i+=l.length,{value:l,done:!1})})},function(r,o){var i=Math.ceil,a=Math.floor;r.exports=function(l){return isNaN(l=+l)?0:(l>0?a:i)(l)}},function(r,o){r.exports=function(i){if(i==null)throw TypeError("Can't call method on "+i);return i}},function(r,o,i){var a=i(11);r.exports=function(l,s){if(!a(l))return l;var c,f;if(s&&typeof(c=l.toString)=="function"&&!a(f=c.call(l))||typeof(c=l.valueOf)=="function"&&!a(f=c.call(l))||!s&&typeof(c=l.toString)=="function"&&!a(f=c.call(l)))return f;throw TypeError("Can't convert object to primitive value")}},function(r,o){var i={}.toString;r.exports=function(a){return i.call(a).slice(8,-1)}},function(r,o,i){var a=i(26)("keys"),l=i(17);r.exports=function(s){return a[s]||(a[s]=l(s))}},function(r,o,i){var a=i(1),l=i(3),s=l["__core-js_shared__"]||(l["__core-js_shared__"]={});(r.exports=function(c,f){return s[c]||(s[c]=f!==void 0?f:{})})("versions",[]).push({version:a.version,mode:i(14)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(r,o){r.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(r,o,i){var a=i(7).f,l=i(5),s=i(2)("toStringTag");r.exports=function(c,f,m){c&&!l(c=m?c:c.prototype,s)&&a(c,s,{configurable:!0,value:f})}},function(r,o,i){i(62);for(var a=i(3),l=i(6),s=i(12),c=i(2)("toStringTag"),f="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),m=0;mdocument.F=Object<\/script>"),h.close(),m=h.F;L--;)delete m.prototype[s[L]];return m()};r.exports=Object.create||function(h,w){var L;return h!==null?(f.prototype=a(h),L=new f,f.prototype=null,L[c]=h):L=m(),w===void 0?L:l(L,w)}},function(r,o,i){var a=i(5),l=i(9),s=i(57)(!1),c=i(25)("IE_PROTO");r.exports=function(f,m){var h,w=l(f),L=0,P=[];for(h in w)h!=c&&a(w,h)&&P.push(h);for(;m.length>L;)a(w,h=m[L++])&&(~s(P,h)||P.push(h));return P}},function(r,o,i){var a=i(24);r.exports=Object("z").propertyIsEnumerable(0)?Object:function(l){return a(l)=="String"?l.split(""):Object(l)}},function(r,o,i){var a=i(39),l=i(27).concat("length","prototype");o.f=Object.getOwnPropertyNames||function(s){return a(s,l)}},function(r,o,i){var a=i(24),l=i(2)("toStringTag"),s=a(function(){return arguments}())=="Arguments";r.exports=function(c){var f,m,h;return c===void 0?"Undefined":c===null?"Null":typeof(m=function(w,L){try{return w[L]}catch{}}(f=Object(c),l))=="string"?m:s?a(f):(h=a(f))=="Object"&&typeof f.callee=="function"?"Arguments":h}},function(r,o){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch{typeof window=="object"&&(i=window)}r.exports=i},function(r,o){var i=/-?\d+(\.\d+)?%?/g;r.exports=function(a){return a.match(i)}},function(r,o,i){Object.defineProperty(o,"__esModule",{value:!0}),o.getBase16Theme=o.createStyling=o.invertTheme=void 0;var a=C(i(49)),l=C(i(76)),s=C(i(81)),c=C(i(89)),f=C(i(93)),m=function(k){if(k&&k.__esModule)return k;var N={};if(k!=null)for(var O in k)Object.prototype.hasOwnProperty.call(k,O)&&(N[O]=k[O]);return N.default=k,N}(i(94)),h=C(i(132)),w=C(i(133)),L=C(i(138)),P=i(139);function C(k){return k&&k.__esModule?k:{default:k}}var x=m.default,T=(0,c.default)(x),I=(0,L.default)(w.default,P.rgb2yuv,function(k){var N,O=(0,s.default)(k,3),$=O[0],B=O[1],ee=O[2];return[(N=$,N<.25?1:N<.5?.9-N:1.1-N),B,ee]},P.yuv2rgb,h.default),d=function(k){return function(N){return{className:[N.className,k.className].filter(Boolean).join(" "),style:(0,l.default)({},N.style||{},k.style||{})}}},R=function(k,N){var O=(0,c.default)(N);for(var $ in k)O.indexOf($)===-1&&O.push($);return O.reduce(function(B,ee){return B[ee]=function(Z,q){if(Z===void 0)return q;if(q===void 0)return Z;var ye=Z===void 0?"undefined":(0,a.default)(Z),$e=q===void 0?"undefined":(0,a.default)(q);switch(ye){case"string":switch($e){case"string":return[q,Z].filter(Boolean).join(" ");case"object":return d({className:Z,style:q});case"function":return function(Fe){for(var Te=arguments.length,le=Array(Te>1?Te-1:0),ge=1;ge1?Te-1:0),ge=1;ge1?Te-1:0),ge=1;ge1?Te-1:0),ge=1;ge1?Te-1:0),ge=1;ge2?O-2:0),B=2;B3?N-3:0),$=3;$1&&arguments[1]!==void 0?arguments[1]:{},ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Z=B.defaultBase16,q=Z===void 0?x:Z,ye=B.base16Themes,$e=ye===void 0?null:ye,Fe=U(ee,$e);Fe&&(ee=(0,l.default)({},Fe,ee));var Te=T.reduce(function(Be,Re){return Be[Re]=ee[Re]||q[Re],Be},{}),le=(0,c.default)(ee).reduce(function(Be,Re){return T.indexOf(Re)===-1&&(Be[Re]=ee[Re]),Be},{}),ge=k(Te),ke=R(le,ge);return(0,f.default)(j,2).apply(void 0,[ke].concat(O))},3),o.getBase16Theme=function(k,N){if(k&&k.extend&&(k=k.extend),typeof k=="string"){var O=k.split(":"),$=(0,s.default)(O,2),B=$[0],ee=$[1];k=(N||{})[B]||m[B],ee==="inverted"&&(k=W(k))}return k&&k.hasOwnProperty("base00")?k:void 0})},function(r,o,i){var a,l=typeof Reflect=="object"?Reflect:null,s=l&&typeof l.apply=="function"?l.apply:function(d,R,j){return Function.prototype.apply.call(d,R,j)};a=l&&typeof l.ownKeys=="function"?l.ownKeys:Object.getOwnPropertySymbols?function(d){return Object.getOwnPropertyNames(d).concat(Object.getOwnPropertySymbols(d))}:function(d){return Object.getOwnPropertyNames(d)};var c=Number.isNaN||function(d){return d!=d};function f(){f.init.call(this)}r.exports=f,r.exports.once=function(d,R){return new Promise(function(j,W){function U(){k!==void 0&&d.removeListener("error",k),j([].slice.call(arguments))}var k;R!=="error"&&(k=function(N){d.removeListener(R,U),W(N)},d.once("error",k)),d.once(R,U)})},f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var m=10;function h(d){if(typeof d!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof d)}function w(d){return d._maxListeners===void 0?f.defaultMaxListeners:d._maxListeners}function L(d,R,j,W){var U,k,N,O;if(h(j),(k=d._events)===void 0?(k=d._events=Object.create(null),d._eventsCount=0):(k.newListener!==void 0&&(d.emit("newListener",R,j.listener?j.listener:j),k=d._events),N=k[R]),N===void 0)N=k[R]=j,++d._eventsCount;else if(typeof N=="function"?N=k[R]=W?[j,N]:[N,j]:W?N.unshift(j):N.push(j),(U=w(d))>0&&N.length>U&&!N.warned){N.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+N.length+" "+String(R)+" listeners added. Use emitter.setMaxListeners() to increase limit");$.name="MaxListenersExceededWarning",$.emitter=d,$.type=R,$.count=N.length,O=$,console&&console.warn&&console.warn(O)}return d}function P(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function C(d,R,j){var W={fired:!1,wrapFn:void 0,target:d,type:R,listener:j},U=P.bind(W);return U.listener=j,W.wrapFn=U,U}function x(d,R,j){var W=d._events;if(W===void 0)return[];var U=W[R];return U===void 0?[]:typeof U=="function"?j?[U.listener||U]:[U]:j?function(k){for(var N=new Array(k.length),O=0;O0&&(k=R[0]),k instanceof Error)throw k;var N=new Error("Unhandled error."+(k?" ("+k.message+")":""));throw N.context=k,N}var O=U[d];if(O===void 0)return!1;if(typeof O=="function")s(O,this,R);else{var $=O.length,B=I(O,$);for(j=0;j<$;++j)s(B[j],this,R)}return!0},f.prototype.addListener=function(d,R){return L(this,d,R,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(d,R){return L(this,d,R,!0)},f.prototype.once=function(d,R){return h(R),this.on(d,C(this,d,R)),this},f.prototype.prependOnceListener=function(d,R){return h(R),this.prependListener(d,C(this,d,R)),this},f.prototype.removeListener=function(d,R){var j,W,U,k,N;if(h(R),(W=this._events)===void 0)return this;if((j=W[d])===void 0)return this;if(j===R||j.listener===R)--this._eventsCount==0?this._events=Object.create(null):(delete W[d],W.removeListener&&this.emit("removeListener",d,j.listener||R));else if(typeof j!="function"){for(U=-1,k=j.length-1;k>=0;k--)if(j[k]===R||j[k].listener===R){N=j[k].listener,U=k;break}if(U<0)return this;U===0?j.shift():function(O,$){for(;$+1=0;W--)this.removeListener(d,R[W]);return this},f.prototype.listeners=function(d){return x(this,d,!0)},f.prototype.rawListeners=function(d){return x(this,d,!1)},f.listenerCount=function(d,R){return typeof d.listenerCount=="function"?d.listenerCount(R):T.call(d,R)},f.prototype.listenerCount=T,f.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(r,o,i){r.exports.Dispatcher=i(140)},function(r,o,i){r.exports=i(142)},function(r,o,i){o.__esModule=!0;var a=c(i(50)),l=c(i(65)),s=typeof l.default=="function"&&typeof a.default=="symbol"?function(f){return typeof f}:function(f){return f&&typeof l.default=="function"&&f.constructor===l.default&&f!==l.default.prototype?"symbol":typeof f};function c(f){return f&&f.__esModule?f:{default:f}}o.default=typeof l.default=="function"&&s(a.default)==="symbol"?function(f){return f===void 0?"undefined":s(f)}:function(f){return f&&typeof l.default=="function"&&f.constructor===l.default&&f!==l.default.prototype?"symbol":f===void 0?"undefined":s(f)}},function(r,o,i){r.exports={default:i(51),__esModule:!0}},function(r,o,i){i(20),i(29),r.exports=i(30).f("iterator")},function(r,o,i){var a=i(21),l=i(22);r.exports=function(s){return function(c,f){var m,h,w=String(l(c)),L=a(f),P=w.length;return L<0||L>=P?s?"":void 0:(m=w.charCodeAt(L))<55296||m>56319||L+1===P||(h=w.charCodeAt(L+1))<56320||h>57343?s?w.charAt(L):m:s?w.slice(L,L+2):h-56320+(m-55296<<10)+65536}}},function(r,o,i){var a=i(54);r.exports=function(l,s,c){if(a(l),s===void 0)return l;switch(c){case 1:return function(f){return l.call(s,f)};case 2:return function(f,m){return l.call(s,f,m)};case 3:return function(f,m,h){return l.call(s,f,m,h)}}return function(){return l.apply(s,arguments)}}},function(r,o){r.exports=function(i){if(typeof i!="function")throw TypeError(i+" is not a function!");return i}},function(r,o,i){var a=i(38),l=i(16),s=i(28),c={};i(6)(c,i(2)("iterator"),function(){return this}),r.exports=function(f,m,h){f.prototype=a(c,{next:l(1,h)}),s(f,m+" Iterator")}},function(r,o,i){var a=i(7),l=i(10),s=i(13);r.exports=i(4)?Object.defineProperties:function(c,f){l(c);for(var m,h=s(f),w=h.length,L=0;w>L;)a.f(c,m=h[L++],f[m]);return c}},function(r,o,i){var a=i(9),l=i(58),s=i(59);r.exports=function(c){return function(f,m,h){var w,L=a(f),P=l(L.length),C=s(h,P);if(c&&m!=m){for(;P>C;)if((w=L[C++])!=w)return!0}else for(;P>C;C++)if((c||C in L)&&L[C]===m)return c||C||0;return!c&&-1}}},function(r,o,i){var a=i(21),l=Math.min;r.exports=function(s){return s>0?l(a(s),9007199254740991):0}},function(r,o,i){var a=i(21),l=Math.max,s=Math.min;r.exports=function(c,f){return(c=a(c))<0?l(c+f,0):s(c,f)}},function(r,o,i){var a=i(3).document;r.exports=a&&a.documentElement},function(r,o,i){var a=i(5),l=i(18),s=i(25)("IE_PROTO"),c=Object.prototype;r.exports=Object.getPrototypeOf||function(f){return f=l(f),a(f,s)?f[s]:typeof f.constructor=="function"&&f instanceof f.constructor?f.constructor.prototype:f instanceof Object?c:null}},function(r,o,i){var a=i(63),l=i(64),s=i(12),c=i(9);r.exports=i(34)(Array,"Array",function(f,m){this._t=c(f),this._i=0,this._k=m},function(){var f=this._t,m=this._k,h=this._i++;return!f||h>=f.length?(this._t=void 0,l(1)):l(0,m=="keys"?h:m=="values"?f[h]:[h,f[h]])},"values"),s.Arguments=s.Array,a("keys"),a("values"),a("entries")},function(r,o){r.exports=function(){}},function(r,o){r.exports=function(i,a){return{value:a,done:!!i}}},function(r,o,i){r.exports={default:i(66),__esModule:!0}},function(r,o,i){i(67),i(73),i(74),i(75),r.exports=i(1).Symbol},function(r,o,i){var a=i(3),l=i(5),s=i(4),c=i(15),f=i(37),m=i(68).KEY,h=i(8),w=i(26),L=i(28),P=i(17),C=i(2),x=i(30),T=i(31),I=i(69),d=i(70),R=i(10),j=i(11),W=i(18),U=i(9),k=i(23),N=i(16),O=i(38),$=i(71),B=i(72),ee=i(32),Z=i(7),q=i(13),ye=B.f,$e=Z.f,Fe=$.f,Te=a.Symbol,le=a.JSON,ge=le&&le.stringify,ke=C("_hidden"),Be=C("toPrimitive"),Re={}.propertyIsEnumerable,Ge=w("symbol-registry"),mt=w("symbols"),J=w("op-symbols"),re=Object.prototype,te=typeof Te=="function"&&!!ee.f,se=a.QObject,ue=!se||!se.prototype||!se.prototype.findChild,Ae=s&&h(function(){return O($e({},"a",{get:function(){return $e(this,"a",{value:7}).a}})).a!=7})?function(H,oe,we){var Oe=ye(re,oe);Oe&&delete re[oe],$e(H,oe,we),Oe&&H!==re&&$e(re,oe,Oe)}:$e,We=function(H){var oe=mt[H]=O(Te.prototype);return oe._k=H,oe},De=te&&typeof Te.iterator=="symbol"?function(H){return typeof H=="symbol"}:function(H){return H instanceof Te},it=function(H,oe,we){return H===re&&it(J,oe,we),R(H),oe=k(oe,!0),R(we),l(mt,oe)?(we.enumerable?(l(H,ke)&&H[ke][oe]&&(H[ke][oe]=!1),we=O(we,{enumerable:N(0,!1)})):(l(H,ke)||$e(H,ke,N(1,{})),H[ke][oe]=!0),Ae(H,oe,we)):$e(H,oe,we)},gt=function(H,oe){R(H);for(var we,Oe=I(oe=U(oe)),Ie=0,Ce=Oe.length;Ce>Ie;)it(H,we=Oe[Ie++],oe[we]);return H},ze=function(H){var oe=Re.call(this,H=k(H,!0));return!(this===re&&l(mt,H)&&!l(J,H))&&(!(oe||!l(this,H)||!l(mt,H)||l(this,ke)&&this[ke][H])||oe)},xt=function(H,oe){if(H=U(H),oe=k(oe,!0),H!==re||!l(mt,oe)||l(J,oe)){var we=ye(H,oe);return!we||!l(mt,oe)||l(H,ke)&&H[ke][oe]||(we.enumerable=!0),we}},Mt=function(H){for(var oe,we=Fe(U(H)),Oe=[],Ie=0;we.length>Ie;)l(mt,oe=we[Ie++])||oe==ke||oe==m||Oe.push(oe);return Oe},un=function(H){for(var oe,we=H===re,Oe=Fe(we?J:U(H)),Ie=[],Ce=0;Oe.length>Ce;)!l(mt,oe=Oe[Ce++])||we&&!l(re,oe)||Ie.push(mt[oe]);return Ie};te||(f((Te=function(){if(this instanceof Te)throw TypeError("Symbol is not a constructor!");var H=P(arguments.length>0?arguments[0]:void 0),oe=function(we){this===re&&oe.call(J,we),l(this,ke)&&l(this[ke],H)&&(this[ke][H]=!1),Ae(this,H,N(1,we))};return s&&ue&&Ae(re,H,{configurable:!0,set:oe}),We(H)}).prototype,"toString",function(){return this._k}),B.f=xt,Z.f=it,i(41).f=$.f=Mt,i(19).f=ze,ee.f=un,s&&!i(14)&&f(re,"propertyIsEnumerable",ze,!0),x.f=function(H){return We(C(H))}),c(c.G+c.W+c.F*!te,{Symbol:Te});for(var St="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),kt=0;St.length>kt;)C(St[kt++]);for(var Vt=q(C.store),Y=0;Vt.length>Y;)T(Vt[Y++]);c(c.S+c.F*!te,"Symbol",{for:function(H){return l(Ge,H+="")?Ge[H]:Ge[H]=Te(H)},keyFor:function(H){if(!De(H))throw TypeError(H+" is not a symbol!");for(var oe in Ge)if(Ge[oe]===H)return oe},useSetter:function(){ue=!0},useSimple:function(){ue=!1}}),c(c.S+c.F*!te,"Object",{create:function(H,oe){return oe===void 0?O(H):gt(O(H),oe)},defineProperty:it,defineProperties:gt,getOwnPropertyDescriptor:xt,getOwnPropertyNames:Mt,getOwnPropertySymbols:un});var K=h(function(){ee.f(1)});c(c.S+c.F*K,"Object",{getOwnPropertySymbols:function(H){return ee.f(W(H))}}),le&&c(c.S+c.F*(!te||h(function(){var H=Te();return ge([H])!="[null]"||ge({a:H})!="{}"||ge(Object(H))!="{}"})),"JSON",{stringify:function(H){for(var oe,we,Oe=[H],Ie=1;arguments.length>Ie;)Oe.push(arguments[Ie++]);if(we=oe=Oe[1],(j(oe)||H!==void 0)&&!De(H))return d(oe)||(oe=function(Ce,nt){if(typeof we=="function"&&(nt=we.call(this,Ce,nt)),!De(nt))return nt}),Oe[1]=oe,ge.apply(le,Oe)}}),Te.prototype[Be]||i(6)(Te.prototype,Be,Te.prototype.valueOf),L(Te,"Symbol"),L(Math,"Math",!0),L(a.JSON,"JSON",!0)},function(r,o,i){var a=i(17)("meta"),l=i(11),s=i(5),c=i(7).f,f=0,m=Object.isExtensible||function(){return!0},h=!i(8)(function(){return m(Object.preventExtensions({}))}),w=function(P){c(P,a,{value:{i:"O"+ ++f,w:{}}})},L=r.exports={KEY:a,NEED:!1,fastKey:function(P,C){if(!l(P))return typeof P=="symbol"?P:(typeof P=="string"?"S":"P")+P;if(!s(P,a)){if(!m(P))return"F";if(!C)return"E";w(P)}return P[a].i},getWeak:function(P,C){if(!s(P,a)){if(!m(P))return!0;if(!C)return!1;w(P)}return P[a].w},onFreeze:function(P){return h&&L.NEED&&m(P)&&!s(P,a)&&w(P),P}}},function(r,o,i){var a=i(13),l=i(32),s=i(19);r.exports=function(c){var f=a(c),m=l.f;if(m)for(var h,w=m(c),L=s.f,P=0;w.length>P;)L.call(c,h=w[P++])&&f.push(h);return f}},function(r,o,i){var a=i(24);r.exports=Array.isArray||function(l){return a(l)=="Array"}},function(r,o,i){var a=i(9),l=i(41).f,s={}.toString,c=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];r.exports.f=function(f){return c&&s.call(f)=="[object Window]"?function(m){try{return l(m)}catch{return c.slice()}}(f):l(a(f))}},function(r,o,i){var a=i(19),l=i(16),s=i(9),c=i(23),f=i(5),m=i(35),h=Object.getOwnPropertyDescriptor;o.f=i(4)?h:function(w,L){if(w=s(w),L=c(L,!0),m)try{return h(w,L)}catch{}if(f(w,L))return l(!a.f.call(w,L),w[L])}},function(r,o){},function(r,o,i){i(31)("asyncIterator")},function(r,o,i){i(31)("observable")},function(r,o,i){o.__esModule=!0;var a,l=i(77),s=(a=l)&&a.__esModule?a:{default:a};o.default=s.default||function(c){for(var f=1;fx;)for(var d,R=m(arguments[x++]),j=T?l(R).concat(T(R)):l(R),W=j.length,U=0;W>U;)d=j[U++],a&&!I.call(R,d)||(P[d]=R[d]);return P}:h},function(r,o,i){o.__esModule=!0;var a=s(i(82)),l=s(i(85));function s(c){return c&&c.__esModule?c:{default:c}}o.default=function(c,f){if(Array.isArray(c))return c;if((0,a.default)(Object(c)))return function(m,h){var w=[],L=!0,P=!1,C=void 0;try{for(var x,T=(0,l.default)(m);!(L=(x=T.next()).done)&&(w.push(x.value),!h||w.length!==h);L=!0);}catch(I){P=!0,C=I}finally{try{!L&&T.return&&T.return()}finally{if(P)throw C}}return w}(c,f);throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(r,o,i){r.exports={default:i(83),__esModule:!0}},function(r,o,i){i(29),i(20),r.exports=i(84)},function(r,o,i){var a=i(42),l=i(2)("iterator"),s=i(12);r.exports=i(1).isIterable=function(c){var f=Object(c);return f[l]!==void 0||"@@iterator"in f||s.hasOwnProperty(a(f))}},function(r,o,i){r.exports={default:i(86),__esModule:!0}},function(r,o,i){i(29),i(20),r.exports=i(87)},function(r,o,i){var a=i(10),l=i(88);r.exports=i(1).getIterator=function(s){var c=l(s);if(typeof c!="function")throw TypeError(s+" is not iterable!");return a(c.call(s))}},function(r,o,i){var a=i(42),l=i(2)("iterator"),s=i(12);r.exports=i(1).getIteratorMethod=function(c){if(c!=null)return c[l]||c["@@iterator"]||s[a(c)]}},function(r,o,i){r.exports={default:i(90),__esModule:!0}},function(r,o,i){i(91),r.exports=i(1).Object.keys},function(r,o,i){var a=i(18),l=i(13);i(92)("keys",function(){return function(s){return l(a(s))}})},function(r,o,i){var a=i(15),l=i(1),s=i(8);r.exports=function(c,f){var m=(l.Object||{})[c]||Object[c],h={};h[c]=f(m),a(a.S+a.F*s(function(){m(1)}),"Object",h)}},function(r,o,i){(function(a){var l=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],s=/^\s+|\s+$/g,c=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,f=/\{\n\/\* \[wrapped with (.+)\] \*/,m=/,? & /,h=/^[-+]0x[0-9a-f]+$/i,w=/^0b[01]+$/i,L=/^\[object .+?Constructor\]$/,P=/^0o[0-7]+$/i,C=/^(?:0|[1-9]\d*)$/,x=parseInt,T=typeof a=="object"&&a&&a.Object===Object&&a,I=typeof self=="object"&&self&&self.Object===Object&&self,d=T||I||Function("return this")();function R(Y,K,H){switch(H.length){case 0:return Y.call(K);case 1:return Y.call(K,H[0]);case 2:return Y.call(K,H[0],H[1]);case 3:return Y.call(K,H[0],H[1],H[2])}return Y.apply(K,H)}function j(Y,K){return!!(Y&&Y.length)&&function(H,oe,we){if(oe!=oe)return function(Ce,nt,_t,vt){for(var Dt=Ce.length,Tt=_t+(vt?1:-1);vt?Tt--:++Tt-1}function W(Y){return Y!=Y}function U(Y,K){for(var H=Y.length,oe=0;H--;)Y[H]===K&&oe++;return oe}function k(Y,K){for(var H=-1,oe=Y.length,we=0,Oe=[];++H2?O:void 0);function Re(Y){return St(Y)?le(Y):{}}function Ge(Y){return!(!St(Y)||function(K){return!!q&&q in K}(Y))&&(function(K){var H=St(K)?Fe.call(K):"";return H=="[object Function]"||H=="[object GeneratorFunction]"}(Y)||function(K){var H=!1;if(K!=null&&typeof K.toString!="function")try{H=!!(K+"")}catch{}return H}(Y)?Te:L).test(function(K){if(K!=null){try{return ye.call(K)}catch{}try{return K+""}catch{}}return""}(Y))}function mt(Y,K,H,oe){for(var we=-1,Oe=Y.length,Ie=H.length,Ce=-1,nt=K.length,_t=ge(Oe-Ie,0),vt=Array(nt+_t),Dt=!oe;++Ce1&&ut.reverse(),vt&&nt1?"& ":"")+K[oe],K=K.join(H>2?", ":" "),Y.replace(c,`{ +`,E1=e=>{const t=sl(e),n=On(wo),[r,o]=Ze(!0),[i,a]=Ze(!1);cn(()=>{const f=Tr();a(!!f&&"sent"in f&&f.sent)});let l;n!=null&&n.wallet&&"universalLink"in n.wallet&&(n.wallet.openMethod==="universal-link"||io(n.wallet.universalLink)&&yr())&&(l=n.wallet.universalLink);let s;n!=null&&n.wallet&&"deepLink"in n.wallet&&(n.wallet.openMethod==="custom-deeplink"||io(n.wallet.deepLink)&&yr())&&(s=n.wallet.deepLink);const c=()=>{const f=Tr(),m="returnStrategy"in f?f.returnStrategy:pt.returnStrategy,h=!r();o(!1),io(l)?cl(l,{returnStrategy:m,twaReturnUrl:"twaReturnUrl"in f?f.twaReturnUrl:pt.twaReturnUrl,forceRedirect:h}):ul(l,s,{returnStrategy:m,forceRedirect:h},()=>{})};return y(V9,mr(t,{get children(){return[Pe(()=>e.icon),y(K9,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),y(q9,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),y(Ke,{get when(){return!i()&&(e.showButton==="open-wallet"&&l||e.showButton!=="open-wallet")},get children(){return y(G9,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return y(Q9,{})}})}}),y(Ke,{get when(){return i()},get children(){return[y(Ke,{get when(){return e.showButton!=="open-wallet"},get children(){return y(Q0,{onClick:()=>e.onClose(),get children(){return y(Nt,{translationKey:"common.close",children:"Close"})}})}}),y(Ke,{get when(){return e.showButton==="open-wallet"&&l},get children(){return y(Q0,{onClick:c,get children(){return y(Nt,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},Y9=e=>{const t=On(wo),[n]=Sr(),r=()=>t.wallet&&"name"in t.wallet?t.wallet.name:n("common.yourWallet",{},"Your wallet");return y(E1,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:r()}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return y(Wr,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},Z9=e=>y(E1,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return y(hc,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),J9=e=>y(E1,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return y(C1,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),X9=()=>y(rg,{get opened(){var e;return Pe(()=>Tr()!==null)()&&((e=Tr())==null?void 0:e.openModal)===!0},get enableAndroidBackHandler(){return pt.enableAndroidBackHandler},onClose:()=>li(null),"data-tc-actions-modal-container":"true",get children(){return y(il,{get children(){return[y(yn,{get when(){return Tr().name==="transaction-sent"},get children(){return y(J9,{onClose:()=>li(null)})}}),y(yn,{get when(){return Tr().name==="transaction-canceled"},get children(){return y(Z9,{onClose:()=>li(null)})}}),y(yn,{get when(){return Tr().name==="confirm-transaction"},get children(){return y(Y9,{onClose:()=>li(null)})}})]}})}}),eb=()=>{const{locale:e}=Sr()[1];cn(()=>e(pt.language)),cn(()=>{x0()&&$s()});const t=On(Ui),n=On(wo),[r,o]=Ze(!1),i=()=>{var c;return((c=pt.connectRequestParameters)==null?void 0:c.state)==="loading"},a=Pe(()=>{var c;if(!i())return(c=pt.connectRequestParameters)==null?void 0:c.value}),l=c=>{n.closeSingleWalletModal(c)},s=t.onStatusChange(c=>{c&&l("wallet-selected")});return jn(s),jn(()=>{o(!1)}),y(yg,{get opened(){return x0()},get enableAndroidBackHandler(){return pt.enableAndroidBackHandler},onClose:()=>l("action-cancelled"),onClickQuestion:()=>o(c=>!c),"data-tc-wallets-modal-container":"true",get children(){return[y(Ke,{get when(){return r()},get children(){return y(xg,{onBackClick:()=>o(!1)})}}),y(Ke,{get when(){return!r()},get children(){return[y(Ke,{get when(){return i()},get children(){return[y(bg,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),y(wg,{get children(){return y(Wr,{size:"m"})}})]}}),y(Ke,{get when(){return!i()},get children(){return y(Ai,{get component(){return Yr()?Sg:Cg},get wallet(){return l4()},get additionalRequest(){return a()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},tb=e=>{const t=_y(k4,pt.language);return t4(),e4(),y(ag.Provider,{value:t,get children(){return y(wo.Provider,{get value(){return e.tonConnectUI},get children(){return y(Ui.Provider,{get value(){return pt.connector},get children(){return[y(K3,{}),y(z3,{theme:R4,get children(){return[y(Ke,{get when(){return pt.buttonRootId},get children(){return y(W2,{get mount(){return document.getElementById(pt.buttonRootId)},get children(){return y(L8,{})}})}}),y(Ai,{component:Ar,get children(){return[y(z9,{}),y(eb,{}),y(X9,{})]}})]}})]}})}})}})},Hn={openWalletsModal:()=>void setTimeout(()=>b0({status:"opened",closeReason:null})),closeWalletsModal:e=>void setTimeout(()=>b0({status:"closed",closeReason:e})),openSingleWalletModal:e=>{setTimeout(()=>C0({status:"opened",closeReason:null,walletInfo:e}))},closeSingleWalletModal:e=>void setTimeout(()=>C0({status:"closed",closeReason:e})),setAction:e=>void setTimeout(()=>li(e)),clearAction:()=>void setTimeout(()=>li(null)),getSelectedWalletInfo:()=>s4(),removeSelectedWalletInfo:()=>wn(null),renderApp:(e,t)=>_3(()=>y(tb,{tonConnectUI:t}),document.getElementById(e))};class nb{constructor(t){qe(this,"connector"),qe(this,"setConnectRequestParametersCallback"),qe(this,"consumers",[]),qe(this,"tracker"),qe(this,"state",Zu()),this.connector=t.connector,this.tracker=t.tracker,this.setConnectRequestParametersCallback=t.setConnectRequestParametersCallback,cn(()=>{const n=Zu();this.state=n,this.consumers.forEach(r=>r(n))})}open(){return yt(this,null,function*(){this.tracker.trackConnectionStarted();const n=(yield this.connector.getWallets()).find(ic);return n?this.connectEmbeddedWallet(n):this.openWalletsModal()})}close(t="action-cancelled"){t==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),Hn.closeWalletsModal(t)}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(n=>n!==t)}}connectEmbeddedWallet(t){const n=o=>{wn(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},r=pt.connectRequestParameters;(r==null?void 0:r.state)==="loading"?this.setConnectRequestParametersCallback(n):n(r==null?void 0:r.value)}openWalletsModal(){return yt(this,null,function*(){return yr()&&y1(),Hn.openWalletsModal(),new Promise(t=>{const n=this.onStateChange(r=>{const{status:o}=r;o==="opened"&&(n(),t())})})})}}class rb{constructor(t){qe(this,"connector"),qe(this,"consumers",[]),this.connector=t.connector,cn(()=>{const n=Tr();this.consumers.forEach(r=>r(n))})}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(n=>n!==t)}}}class ob{constructor(t){qe(this,"connector"),qe(this,"setConnectRequestParametersCallback"),qe(this,"consumers",[]),qe(this,"tracker"),qe(this,"state",Ms()),this.connector=t.connector,this.tracker=t.tracker,this.setConnectRequestParametersCallback=t.setConnectRequestParametersCallback,cn(()=>{const n=Ms();this.state=n,this.consumers.forEach(r=>r(n))})}open(t){return yt(this,null,function*(){this.tracker.trackConnectionStarted();const n=yield this.connector.getWallets(),r=_1(n,pt.walletsListConfiguration),o=r.find(ic);if(!!o)return this.connectEmbeddedWallet(o);const l=r.filter(Ss).find(f=>Vr(f,t));if(!!l)return this.openSingleWalletModal(l);const c=`Trying to open modal window with unknown wallet "${t}".`;throw this.tracker.trackConnectionError(c),new Xt(c)})}close(t="action-cancelled"){t==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),Hn.closeSingleWalletModal("action-cancelled")}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(n=>n!==t)}}connectEmbeddedWallet(t){const n=o=>{wn(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},r=pt.connectRequestParameters;(r==null?void 0:r.state)==="loading"?this.setConnectRequestParametersCallback(n):n(r==null?void 0:r.value)}openSingleWalletModal(t){return yt(this,null,function*(){return yr()&&y1(),Hn.openSingleWalletModal(t),new Promise(n=>{const r=this.onStateChange(o=>{const{status:i}=o;i==="opened"&&(r(),n())})})})}}class ib{constructor(t){qe(this,"eventPrefix","ton-connect-ui-"),qe(this,"tonConnectUiVersion"),qe(this,"tonConnectSdkVersion",null),qe(this,"eventDispatcher");var n;this.eventDispatcher=(n=t==null?void 0:t.eventDispatcher)!=null?n:new C2,this.tonConnectUiVersion=t.tonConnectUiVersion,this.init().catch()}get version(){return zo({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return yt(this,null,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch{}})}setRequestVersionHandler(){return yt(this,null,function*(){yield this.eventDispatcher.addEventListener("ton-connect-ui-request-version",()=>yt(this,null,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-ui-response-version",u2(this.tonConnectUiVersion))}))})}requestTonConnectSdkVersion(){return yt(this,null,function*(){return new Promise((t,n)=>yt(this,null,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-response-version",r=>{t(r.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-request-version",c2())}catch(r){n(r)}}))})}dispatchUserActionEvent(t){var n;try{(n=this.eventDispatcher)==null||n.dispatchEvent(`${this.eventPrefix}${t.type}`,t).catch()}catch{}}trackConnectionStarted(...t){try{const n=d2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionCompleted(...t){try{const n=f2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionError(...t){try{const n=h2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringStarted(...t){try{const n=p2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringCompleted(...t){try{const n=g2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringError(...t){try{const n=m2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackDisconnection(...t){try{const n=w2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSentForSignature(...t){try{const n=v2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigned(...t){try{const n=y2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigningFailed(...t){try{const n=b2(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}}const ab="2.0.12";class lb{constructor(t){qe(this,"walletInfoStorage",new i4),qe(this,"preferredWalletStorage",new a4),qe(this,"tracker"),qe(this,"walletInfo",null),qe(this,"systemThemeChangeUnsubscribe",null),qe(this,"actionsConfiguration"),qe(this,"walletsList"),qe(this,"primaryWalletAppName"),qe(this,"connectRequestParametersCallback"),qe(this,"connector"),qe(this,"modal"),qe(this,"singleWalletModal"),qe(this,"transactionModal"),qe(this,"connectionRestored",Promise.resolve(!1));var n;if(t&&"connector"in t&&t.connector)this.connector=t.connector;else if(t&&"manifestUrl"in t&&t.manifestUrl)this.connector=new Wo({manifestUrl:t.manifestUrl,eventDispatcher:t==null?void 0:t.eventDispatcher});else throw new Xt("You have to specify a `manifestUrl` or a `connector` in the options.");this.tracker=new ib({eventDispatcher:t==null?void 0:t.eventDispatcher,tonConnectUiVersion:ab}),this.modal=new nb({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:i=>{this.connectRequestParametersCallback=i}}),this.singleWalletModal=new ob({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:i=>{this.connectRequestParametersCallback=i}}),this.transactionModal=new rb({connector:this.connector}),this.walletsList=this.getWallets(),this.primaryWalletAppName=t.primaryWalletAppName===null?void 0:(n=t.primaryWalletAppName)!=null?n:"tonkeeper",this.walletsList.then(i=>z2(T8(i.map(a=>a.imageUrl))));const r=this.normalizeWidgetRoot(t==null?void 0:t.widgetRootId);this.subscribeToWalletChange(),(t==null?void 0:t.restoreConnection)!==!1&&(this.connectionRestored=n4(()=>yt(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(t,{uiPreferences:{theme:"SYSTEM"}});const o=this.preferredWalletStorage.getPreferredWalletAppName();Pl({connector:this.connector,preferredWalletAppName:o,primaryWalletAppName:this.primaryWalletAppName}),Hn.renderApp(r,this)}static getWallets(){return Wo.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?Ct(Ct({},this.connector.wallet),this.walletInfo):null}set uiOptions(t){var n,r,o,i,a;this.checkButtonRootExist(t.buttonRootId),this.actionsConfiguration=t.actionsConfiguration,(n=t.uiPreferences)!=null&&n.theme?((r=t.uiPreferences)==null?void 0:r.theme)!=="SYSTEM"?((o=this.systemThemeChangeUnsubscribe)==null||o.call(this),Vc(t.uiPreferences.theme,t.uiPreferences.colorsSet)):(Vc(Y3(),t.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=Z3(Vc))):(i=t.uiPreferences)!=null&&i.colorsSet&&O4(t.uiPreferences.colorsSet),(a=t.uiPreferences)!=null&&a.borderRadius&&j4(t.uiPreferences.borderRadius),Pl(l=>{var s,c;const f=ao(Ct(Ct(Ct(Ct(Ct({},t.hasOwnProperty("primaryWalletAppName")&&{primaryWalletAppName:t.primaryWalletAppName===null?void 0:t.primaryWalletAppName}),t.language&&{language:t.language}),!!((s=t.actionsConfiguration)!=null&&s.returnStrategy)&&{returnStrategy:t.actionsConfiguration.returnStrategy}),!!((c=t.actionsConfiguration)!=null&&c.twaReturnUrl)&&{twaReturnUrl:t.actionsConfiguration.twaReturnUrl}),!!t.walletsListConfiguration&&{walletsListConfiguration:t.walletsListConfiguration}),Li(l));return t.buttonRootId!==void 0&&(f.buttonRootId=t.buttonRootId),t.enableAndroidBackHandler!==void 0&&(f.enableAndroidBackHandler=t.enableAndroidBackHandler),f})}setConnectRequestParameters(t){var n;Pl({connectRequestParameters:t}),((t==null?void 0:t.state)==="ready"||!t)&&((n=this.connectRequestParametersCallback)==null||n.call(this,t==null?void 0:t.value))}getWallets(){return yt(this,null,function*(){return this.connector.getWallets()})}onStatusChange(t,n){return this.connector.onStatusChange(r=>yt(this,null,function*(){if(r){const o=yield this.getSelectedWalletInfo(r);t(Ct(Ct({},r),o||this.walletInfoStorage.getWalletInfo()))}else t(r)}),n)}openModal(){return yt(this,null,function*(){return this.modal.open()})}closeModal(t){this.modal.close(t)}onModalStateChange(t){return this.modal.onStateChange(t)}get modalState(){return this.modal.state}openSingleWalletModal(t){return yt(this,null,function*(){return this.singleWalletModal.open(t)})}closeSingleWalletModal(t){this.singleWalletModal.close(t)}onSingleWalletModalStateChange(t){return this.singleWalletModal.onStateChange(t)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(){return yt(this,null,function*(){const n=(yield this.getWallets()).find(ic);return n?yield this.connectEmbeddedWallet(n):yield this.connectExternalWallet()})}disconnect(){return this.tracker.trackDisconnection(this.wallet,"dapp"),Hn.clearAction(),Hn.removeSelectedWalletInfo(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(t,n){return yt(this,null,function*(){if(this.tracker.trackTransactionSentForSignature(this.wallet,t),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,t,"Wallet was not connected"),new Xt("Connect wallet to send a transaction.");yr()&&y1();const{notifications:r,modals:o,returnStrategy:i,twaReturnUrl:a,skipRedirectToWallet:l}=this.getModalsAndNotificationsConfiguration(n);Hn.setAction({name:"confirm-transaction",showNotification:r.includes("before"),openModal:o.includes("before"),sent:!1});const s=()=>{c.signal.aborted||(Hn.setAction({name:"confirm-transaction",showNotification:r.includes("before"),openModal:o.includes("before"),sent:!0}),this.walletInfo&&"universalLink"in this.walletInfo&&(this.walletInfo.openMethod==="universal-link"||this.walletInfo.openMethod==="custom-deeplink")&&(io(this.walletInfo.universalLink)?cl(this.walletInfo.universalLink,{returnStrategy:i,twaReturnUrl:a||pt.twaReturnUrl,forceRedirect:!1}):ul(this.walletInfo.universalLink,this.walletInfo.deepLink,{returnStrategy:i,forceRedirect:!1},()=>{})))},c=new AbortController,f=this.onTransactionModalStateChange(m=>{m!=null&&m.openModal||(f(),m||c.abort())});try{const m=yield this.waitForSendTransaction({transaction:t,signal:c.signal},s);return this.tracker.trackTransactionSigned(this.wallet,t,m),Hn.setAction({name:"transaction-sent",showNotification:r.includes("success"),openModal:o.includes("success")}),m}catch(m){throw Hn.setAction({name:"transaction-canceled",showNotification:r.includes("error"),openModal:o.includes("error")}),m instanceof Ve?m:(console.error(m),new Xt("Unhandled error:"+m))}finally{f()}})}connectEmbeddedWallet(t){return yt(this,null,function*(){const n=o=>{wn(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},r=pt.connectRequestParameters;return(r==null?void 0:r.state)==="loading"?this.connectRequestParametersCallback=n:n(r==null?void 0:r.value),yield this.waitForWalletConnection({ignoreErrors:!1})})}connectExternalWallet(){return yt(this,null,function*(){const t=new AbortController;Hn.openWalletsModal();const n=this.onModalStateChange(r=>{const{status:o,closeReason:i}=r;o!=="opened"&&(n(),i==="action-cancelled"&&t.abort())});return yield this.waitForWalletConnection({ignoreErrors:!0,signal:t.signal})})}waitForWalletConnection(t){return yt(this,null,function*(){return new Promise((n,r)=>{this.tracker.trackConnectionStarted();const{ignoreErrors:o=!1,signal:i=null}=t;if(i&&i.aborted)return this.tracker.trackConnectionError("Connection was cancelled"),r(new Xt("Wallet was not connected"));const a=c=>yt(this,null,function*(){if(c)this.tracker.trackConnectionCompleted(c),s(),n(c);else{if(this.tracker.trackConnectionError("Connection was cancelled"),o)return;s(),r(new Xt("Wallet was not connected"))}}),l=c=>{this.tracker.trackConnectionError(c.message),!o&&(s(),r(c))},s=this.onStatusChange(c=>a(c),c=>l(c));i&&i.addEventListener("abort",()=>{s(),r(new Xt("Wallet was not connected"))},{once:!0})})})}waitForSendTransaction(t,n){return yt(this,null,function*(){return new Promise((r,o)=>{const{transaction:i,signal:a}=t;if(a.aborted)return this.tracker.trackTransactionSigningFailed(this.wallet,i,"Transaction was cancelled"),o(new Xt("Transaction was not sent"));const l=f=>yt(this,null,function*(){r(f)}),s=f=>{o(f)},c=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,i,"Transaction was cancelled"),o(new Xt("Transaction was not sent"))};a.addEventListener("abort",c,{once:!0}),this.connector.sendTransaction(i,{onRequestSent:n,signal:a}).then(f=>(a.removeEventListener("abort",c),l(f))).catch(f=>(a.removeEventListener("abort",c),s(f)))})})}onTransactionModalStateChange(t){return this.transactionModal.onStateChange(t)}subscribeToWalletChange(){this.connector.onStatusChange(t=>yt(this,null,function*(){var n;t?(yield this.updateWalletInfo(t),this.setPreferredWalletAppName(((n=this.walletInfo)==null?void 0:n.appName)||t.device.appName)):this.walletInfoStorage.removeWalletInfo()}))}setPreferredWalletAppName(t){this.preferredWalletStorage.setPreferredWalletAppName(t),Pl({preferredWalletAppName:t})}getSelectedWalletInfo(t){return yt(this,null,function*(){let n=Hn.getSelectedWalletInfo();if(!n)return null;let r;if("name"in n)r=n;else{const i=_1(yield this.walletsList,pt.walletsListConfiguration).find(a=>Vr(a,t.device.appName));if(!i)throw new Xt(`Cannot find WalletInfo for the '${t.device.appName}' wallet`);r=Ct(Ct({},i),n)}return r})}updateWalletInfo(t){return yt(this,null,function*(){const n=yield this.getSelectedWalletInfo(t);if(n){this.walletInfo=n,this.walletInfoStorage.setWalletInfo(n);return}const r=this.walletInfoStorage.getWalletInfo();if(r){this.walletInfo=r;return}this.walletInfo=(yield this.walletsList).find(o=>Vr(o,t.device.appName))||null})}normalizeWidgetRoot(t){if(!t||!document.getElementById(t)){t="tc-widget-root";const n=document.createElement("div");n.id=t,document.body.appendChild(n)}return t}checkButtonRootExist(t){if(t!=null&&!document.getElementById(t))throw new Xt(`${t} element not found in the document.`)}getModalsAndNotificationsConfiguration(t){var n,r,o,i,a,l;const s=["before","success","error"];let c=s;(n=this.actionsConfiguration)!=null&&n.notifications&&((r=this.actionsConfiguration)==null?void 0:r.notifications)!=="all"&&(c=this.actionsConfiguration.notifications),t!=null&&t.notifications&&(t.notifications==="all"?c=s:c=t.notifications);let f=["before"];(o=this.actionsConfiguration)!=null&&o.modals&&(this.actionsConfiguration.modals==="all"?f=s:f=this.actionsConfiguration.modals),t!=null&&t.modals&&(t.modals==="all"?f=s:f=t.modals);const m=(t==null?void 0:t.returnStrategy)||((i=this.actionsConfiguration)==null?void 0:i.returnStrategy)||"back",h=(t==null?void 0:t.twaReturnUrl)||((a=this.actionsConfiguration)==null?void 0:a.twaReturnUrl);let w=(t==null?void 0:t.skipRedirectToWallet)||((l=this.actionsConfiguration)==null?void 0:l.skipRedirectToWallet)||"ios";return yr()&&(w="never"),{notifications:c,modals:f,returnStrategy:m,twaReturnUrl:h,skipRedirectToWallet:w}}}function Ag(){return typeof window<"u"}function sb(){return!Ag()}const Lg=$t.createContext(null);let tu=null;const cb=e=>{var t=e,{children:n}=t,r=Ym(t,["children"]);return Ag()&&!tu&&(tu=new lb(r)),t2(Lg.Provider,{value:tu,children:n})},ub=$t.memo(cb);class A1 extends Xt{constructor(...t){super(...t),Object.setPrototypeOf(this,A1.prototype)}}class L1 extends A1{constructor(...t){super(...t),Object.setPrototypeOf(this,L1.prototype)}}function db(e){if(!e)throw new L1("You should add on the top of the app to use TonConnect");return!0}function dl(){const e=$t.useContext(Lg),t=$t.useCallback(n=>{e&&(e.uiOptions=n)},[e]);return sb()?[null,()=>{}]:(db(e),[e,t])}const Y0="ton-connect-button",fb=({className:e,style:t})=>{const[n,r]=dl();return $t.useEffect(()=>(r({buttonRootId:Y0}),()=>r({buttonRootId:null})),[r]),t2("div",{id:Y0,className:e,style:Qm({width:"fit-content"},t)})},hb=$t.memo(fb);function pb(){const[e]=dl(),[t,n]=$t.useState((e==null?void 0:e.wallet)||null);return $t.useEffect(()=>{if(e)return n(e.wallet),e.onStatusChange(r=>{n(r)})},[e]),t}const Ol={[bt.LIGHT]:{constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#0098EA",telegramButton:"#0098EA",icon:{primary:"#0F0F0F",secondary:"#7A8999",tertiary:"#C1CAD2",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#FFFFFF",secondary:"#F1F3F5",segment:"#FFFFFF",tint:"#F1F3F5",qr:"#F1F3F5"},text:{primary:"#0F0F0F",secondary:"#6A7785"}},[bt.DARK]:{constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#E5E5EA",telegramButton:"#31A6F5",icon:{primary:"#E5E5EA",secondary:"#909099",tertiary:"#434347",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#121214",secondary:"#18181A",segment:"#262629",tint:"#222224",qr:"#F1F3F5"},text:{primary:"#E5E5EA",secondary:"#7D7D85"}}},gb=({theme:e})=>{const[t,n]=dl(),[r,o]=$t.useState(Ol[e]);$t.useEffect(()=>{o(Ol[e])},[e]);const i=(a,l,s)=>{n({uiPreferences:{colorsSet:{[e]:{[l]:s?{...r[l],[s]:a}:a}}}}),o(c=>({...c,[l]:s?{...c[l],[s]:a}:a})),Ol[e]={...Ol[e],[l]:s?{...r[l],[s]:a}:a}};return Qe("div",{className:"colors-container",children:Object.entries(r).map(([a,l])=>typeof l=="object"?Et("div",{children:[Et("span",{children:[a,":"]}),Object.entries(l).map(([s,c])=>Et("label",{children:[s,Qe("input",{type:"color",value:r[a][s],onChange:f=>i(f.target.value,a,s)})]},a+s))]},a):Et("div",{children:[Et("span",{children:[a,":"]}),Qe("label",{children:Qe("input",{type:"color",value:r[a],onChange:s=>i(s.target.value,a)})})]}))})};const mb=()=>{const[e,t]=$t.useState(!1),[n,r]=$t.useState(bt.LIGHT);return Et(Vg,{children:[Qe("button",{onClick:()=>t(!0),children:"change colors"}),e&&Et("div",{className:"modal",children:[Qe("button",{onClick:()=>t(!1),children:"close"}),Et("div",{className:"modal__toggle",children:[Qe("a",{href:"#",style:{color:n===bt.LIGHT?"blue":"white"},onClick:()=>r(bt.LIGHT),children:"LIGHT"}),Qe("a",{href:"#",style:{color:n===bt.DARK?"blue":"white"},onClick:()=>r(bt.DARK),children:"DARK"})]}),Qe(gb,{theme:n})]})]})},vb=()=>{const[e,t]=$t.useState([!0,!1,!1,!0,!0,!0]),[n,r]=$t.useState("back"),[o,i]=$t.useState("ios"),[a,l]=$t.useState([]),[s,c]=dl(),f=x=>{c({language:x})},m=x=>{c({primaryWalletAppName:x==="unset"?"tonkeeper":x==="disabled"?null:x})},h=x=>{c({uiPreferences:{theme:x}})},w=x=>{c({uiPreferences:{borderRadius:x}})},L=x=>{t(T=>T.map((I,d)=>d===x?!I:I))},P=()=>{if(!n){r("back");return}c({actionsConfiguration:{returnStrategy:n}})},C=()=>{if(!o){i("ios");return}c({actionsConfiguration:{skipRedirectToWallet:o}})};return $t.useEffect(()=>{const x=["before","success","error"],T=x.map((d,R)=>e[R]?d:void 0).filter(d=>d),I=x.map((d,R)=>e[R+3]?d:void 0).filter(d=>d);c({actionsConfiguration:{modals:T,notifications:I}})},[e]),$t.useEffect(()=>{s.getWallets().then(l)},[]),Et("footer",{className:"footer",children:[Et("div",{children:[Qe("label",{children:"primary wallet"}),Et("select",{onChange:x=>m(x.target.value),children:[Qe("option",{value:"unset",children:"unset"}),Qe("option",{value:"disabled",children:"disabled"}),a.map(x=>Qe("option",{value:x.appName,children:x.name},x.appName))]})]}),Et("div",{children:[Qe("label",{children:"language"}),Et("select",{onChange:x=>f(x.target.value),children:[Qe("option",{value:"en",children:"en"}),Qe("option",{value:"ru",children:"ru"})]})]}),Et("div",{children:[Qe("label",{children:"theme"}),Et("select",{onChange:x=>h(x.target.value),children:[Qe("option",{value:bt.DARK,children:"dark"}),Qe("option",{value:bt.LIGHT,children:"light"}),Qe("option",{value:"SYSTEM",children:"system"})]})]}),Et("div",{children:[Qe("label",{children:"borders"}),Et("select",{onChange:x=>w(x.target.value),children:[Qe("option",{value:"m",children:"m"}),Qe("option",{value:"s",children:"s"}),Qe("option",{value:"none",children:"none"})]})]}),Et("div",{className:"footer-checkbox-container",children:[Qe("span",{children:"modals"}),Et("label",{children:["before",Qe("input",{type:"checkbox",checked:e[0],onChange:()=>L(0)})]}),Et("label",{children:["success",Qe("input",{type:"checkbox",checked:e[1],onChange:()=>L(1)})]}),Et("label",{children:["error",Qe("input",{type:"checkbox",checked:e[2],onChange:()=>L(2)})]})]}),Et("div",{className:"footer-checkbox-container",children:[Qe("span",{children:"notifications"}),Et("label",{children:["before",Qe("input",{type:"checkbox",checked:e[3],onChange:()=>L(3)})]}),Et("label",{children:["success",Qe("input",{type:"checkbox",checked:e[4],onChange:()=>L(4)})]}),Et("label",{children:["error",Qe("input",{type:"checkbox",checked:e[5],onChange:()=>L(5)})]})]}),Qe("div",{children:Qe(mb,{})}),Qe("div",{children:Et("label",{children:["return strategy:",Qe("input",{style:{width:"200px"},value:n,onChange:x=>r(x.target.value),onBlur:P})]})}),Qe("div",{children:Et("label",{children:[Qe("div",{children:"skip redirect to wallet:"}),Qe("div",{children:"('ios', 'never', 'always')"}),Qe("input",{style:{width:"200px"},value:o,onChange:x=>i(x.target.value),onBlur:C})]})})]})};const yb=()=>Et("header",{children:[Qe("span",{children:"My App with React UI by Tonkeeper"}),Qe(hb,{})]});var Tg={exports:{}};(function(e,t){(function(n,r){e.exports=r($t)})(Mg,function(n){return function(r){var o={};function i(a){if(o[a])return o[a].exports;var l=o[a]={i:a,l:!1,exports:{}};return r[a].call(l.exports,l,l.exports,i),l.l=!0,l.exports}return i.m=r,i.c=o,i.d=function(a,l,s){i.o(a,l)||Object.defineProperty(a,l,{enumerable:!0,get:s})},i.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},i.t=function(a,l){if(1&l&&(a=i(a)),8&l||4&l&&typeof a=="object"&&a&&a.__esModule)return a;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:a}),2&l&&typeof a!="string")for(var c in a)i.d(s,c,(function(f){return a[f]}).bind(null,c));return s},i.n=function(a){var l=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(l,"a",l),l},i.o=function(a,l){return Object.prototype.hasOwnProperty.call(a,l)},i.p="",i(i.s=48)}([function(r,o){r.exports=n},function(r,o){var i=r.exports={version:"2.6.12"};typeof __e=="number"&&(__e=i)},function(r,o,i){var a=i(26)("wks"),l=i(17),s=i(3).Symbol,c=typeof s=="function";(r.exports=function(f){return a[f]||(a[f]=c&&s[f]||(c?s:l)("Symbol."+f))}).store=a},function(r,o){var i=r.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=i)},function(r,o,i){r.exports=!i(8)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(r,o){var i={}.hasOwnProperty;r.exports=function(a,l){return i.call(a,l)}},function(r,o,i){var a=i(7),l=i(16);r.exports=i(4)?function(s,c,f){return a.f(s,c,l(1,f))}:function(s,c,f){return s[c]=f,s}},function(r,o,i){var a=i(10),l=i(35),s=i(23),c=Object.defineProperty;o.f=i(4)?Object.defineProperty:function(f,m,h){if(a(f),m=s(m,!0),a(h),l)try{return c(f,m,h)}catch{}if("get"in h||"set"in h)throw TypeError("Accessors not supported!");return"value"in h&&(f[m]=h.value),f}},function(r,o){r.exports=function(i){try{return!!i()}catch{return!0}}},function(r,o,i){var a=i(40),l=i(22);r.exports=function(s){return a(l(s))}},function(r,o,i){var a=i(11);r.exports=function(l){if(!a(l))throw TypeError(l+" is not an object!");return l}},function(r,o){r.exports=function(i){return typeof i=="object"?i!==null:typeof i=="function"}},function(r,o){r.exports={}},function(r,o,i){var a=i(39),l=i(27);r.exports=Object.keys||function(s){return a(s,l)}},function(r,o){r.exports=!0},function(r,o,i){var a=i(3),l=i(1),s=i(53),c=i(6),f=i(5),m=function(h,w,L){var P,C,x,T=h&m.F,I=h&m.G,d=h&m.S,R=h&m.P,j=h&m.B,W=h&m.W,U=I?l:l[w]||(l[w]={}),k=U.prototype,N=I?a:d?a[w]:(a[w]||{}).prototype;for(P in I&&(L=w),L)(C=!T&&N&&N[P]!==void 0)&&f(U,P)||(x=C?N[P]:L[P],U[P]=I&&typeof N[P]!="function"?L[P]:j&&C?s(x,a):W&&N[P]==x?function(O){var $=function(B,ee,Z){if(this instanceof O){switch(arguments.length){case 0:return new O;case 1:return new O(B);case 2:return new O(B,ee)}return new O(B,ee,Z)}return O.apply(this,arguments)};return $.prototype=O.prototype,$}(x):R&&typeof x=="function"?s(Function.call,x):x,R&&((U.virtual||(U.virtual={}))[P]=x,h&m.R&&k&&!k[P]&&c(k,P,x)))};m.F=1,m.G=2,m.S=4,m.P=8,m.B=16,m.W=32,m.U=64,m.R=128,r.exports=m},function(r,o){r.exports=function(i,a){return{enumerable:!(1&i),configurable:!(2&i),writable:!(4&i),value:a}}},function(r,o){var i=0,a=Math.random();r.exports=function(l){return"Symbol(".concat(l===void 0?"":l,")_",(++i+a).toString(36))}},function(r,o,i){var a=i(22);r.exports=function(l){return Object(a(l))}},function(r,o){o.f={}.propertyIsEnumerable},function(r,o,i){var a=i(52)(!0);i(34)(String,"String",function(l){this._t=String(l),this._i=0},function(){var l,s=this._t,c=this._i;return c>=s.length?{value:void 0,done:!0}:(l=a(s,c),this._i+=l.length,{value:l,done:!1})})},function(r,o){var i=Math.ceil,a=Math.floor;r.exports=function(l){return isNaN(l=+l)?0:(l>0?a:i)(l)}},function(r,o){r.exports=function(i){if(i==null)throw TypeError("Can't call method on "+i);return i}},function(r,o,i){var a=i(11);r.exports=function(l,s){if(!a(l))return l;var c,f;if(s&&typeof(c=l.toString)=="function"&&!a(f=c.call(l))||typeof(c=l.valueOf)=="function"&&!a(f=c.call(l))||!s&&typeof(c=l.toString)=="function"&&!a(f=c.call(l)))return f;throw TypeError("Can't convert object to primitive value")}},function(r,o){var i={}.toString;r.exports=function(a){return i.call(a).slice(8,-1)}},function(r,o,i){var a=i(26)("keys"),l=i(17);r.exports=function(s){return a[s]||(a[s]=l(s))}},function(r,o,i){var a=i(1),l=i(3),s=l["__core-js_shared__"]||(l["__core-js_shared__"]={});(r.exports=function(c,f){return s[c]||(s[c]=f!==void 0?f:{})})("versions",[]).push({version:a.version,mode:i(14)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(r,o){r.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(r,o,i){var a=i(7).f,l=i(5),s=i(2)("toStringTag");r.exports=function(c,f,m){c&&!l(c=m?c:c.prototype,s)&&a(c,s,{configurable:!0,value:f})}},function(r,o,i){i(62);for(var a=i(3),l=i(6),s=i(12),c=i(2)("toStringTag"),f="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),m=0;mdocument.F=Object<\/script>"),h.close(),m=h.F;L--;)delete m.prototype[s[L]];return m()};r.exports=Object.create||function(h,w){var L;return h!==null?(f.prototype=a(h),L=new f,f.prototype=null,L[c]=h):L=m(),w===void 0?L:l(L,w)}},function(r,o,i){var a=i(5),l=i(9),s=i(57)(!1),c=i(25)("IE_PROTO");r.exports=function(f,m){var h,w=l(f),L=0,P=[];for(h in w)h!=c&&a(w,h)&&P.push(h);for(;m.length>L;)a(w,h=m[L++])&&(~s(P,h)||P.push(h));return P}},function(r,o,i){var a=i(24);r.exports=Object("z").propertyIsEnumerable(0)?Object:function(l){return a(l)=="String"?l.split(""):Object(l)}},function(r,o,i){var a=i(39),l=i(27).concat("length","prototype");o.f=Object.getOwnPropertyNames||function(s){return a(s,l)}},function(r,o,i){var a=i(24),l=i(2)("toStringTag"),s=a(function(){return arguments}())=="Arguments";r.exports=function(c){var f,m,h;return c===void 0?"Undefined":c===null?"Null":typeof(m=function(w,L){try{return w[L]}catch{}}(f=Object(c),l))=="string"?m:s?a(f):(h=a(f))=="Object"&&typeof f.callee=="function"?"Arguments":h}},function(r,o){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch{typeof window=="object"&&(i=window)}r.exports=i},function(r,o){var i=/-?\d+(\.\d+)?%?/g;r.exports=function(a){return a.match(i)}},function(r,o,i){Object.defineProperty(o,"__esModule",{value:!0}),o.getBase16Theme=o.createStyling=o.invertTheme=void 0;var a=C(i(49)),l=C(i(76)),s=C(i(81)),c=C(i(89)),f=C(i(93)),m=function(k){if(k&&k.__esModule)return k;var N={};if(k!=null)for(var O in k)Object.prototype.hasOwnProperty.call(k,O)&&(N[O]=k[O]);return N.default=k,N}(i(94)),h=C(i(132)),w=C(i(133)),L=C(i(138)),P=i(139);function C(k){return k&&k.__esModule?k:{default:k}}var x=m.default,T=(0,c.default)(x),I=(0,L.default)(w.default,P.rgb2yuv,function(k){var N,O=(0,s.default)(k,3),$=O[0],B=O[1],ee=O[2];return[(N=$,N<.25?1:N<.5?.9-N:1.1-N),B,ee]},P.yuv2rgb,h.default),d=function(k){return function(N){return{className:[N.className,k.className].filter(Boolean).join(" "),style:(0,l.default)({},N.style||{},k.style||{})}}},R=function(k,N){var O=(0,c.default)(N);for(var $ in k)O.indexOf($)===-1&&O.push($);return O.reduce(function(B,ee){return B[ee]=function(Z,q){if(Z===void 0)return q;if(q===void 0)return Z;var ye=Z===void 0?"undefined":(0,a.default)(Z),$e=q===void 0?"undefined":(0,a.default)(q);switch(ye){case"string":switch($e){case"string":return[q,Z].filter(Boolean).join(" ");case"object":return d({className:Z,style:q});case"function":return function(Fe){for(var Te=arguments.length,le=Array(Te>1?Te-1:0),ge=1;ge1?Te-1:0),ge=1;ge1?Te-1:0),ge=1;ge1?Te-1:0),ge=1;ge1?Te-1:0),ge=1;ge2?O-2:0),B=2;B3?N-3:0),$=3;$1&&arguments[1]!==void 0?arguments[1]:{},ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Z=B.defaultBase16,q=Z===void 0?x:Z,ye=B.base16Themes,$e=ye===void 0?null:ye,Fe=U(ee,$e);Fe&&(ee=(0,l.default)({},Fe,ee));var Te=T.reduce(function(Be,Re){return Be[Re]=ee[Re]||q[Re],Be},{}),le=(0,c.default)(ee).reduce(function(Be,Re){return T.indexOf(Re)===-1&&(Be[Re]=ee[Re]),Be},{}),ge=k(Te),ke=R(le,ge);return(0,f.default)(j,2).apply(void 0,[ke].concat(O))},3),o.getBase16Theme=function(k,N){if(k&&k.extend&&(k=k.extend),typeof k=="string"){var O=k.split(":"),$=(0,s.default)(O,2),B=$[0],ee=$[1];k=(N||{})[B]||m[B],ee==="inverted"&&(k=W(k))}return k&&k.hasOwnProperty("base00")?k:void 0})},function(r,o,i){var a,l=typeof Reflect=="object"?Reflect:null,s=l&&typeof l.apply=="function"?l.apply:function(d,R,j){return Function.prototype.apply.call(d,R,j)};a=l&&typeof l.ownKeys=="function"?l.ownKeys:Object.getOwnPropertySymbols?function(d){return Object.getOwnPropertyNames(d).concat(Object.getOwnPropertySymbols(d))}:function(d){return Object.getOwnPropertyNames(d)};var c=Number.isNaN||function(d){return d!=d};function f(){f.init.call(this)}r.exports=f,r.exports.once=function(d,R){return new Promise(function(j,W){function U(){k!==void 0&&d.removeListener("error",k),j([].slice.call(arguments))}var k;R!=="error"&&(k=function(N){d.removeListener(R,U),W(N)},d.once("error",k)),d.once(R,U)})},f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var m=10;function h(d){if(typeof d!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof d)}function w(d){return d._maxListeners===void 0?f.defaultMaxListeners:d._maxListeners}function L(d,R,j,W){var U,k,N,O;if(h(j),(k=d._events)===void 0?(k=d._events=Object.create(null),d._eventsCount=0):(k.newListener!==void 0&&(d.emit("newListener",R,j.listener?j.listener:j),k=d._events),N=k[R]),N===void 0)N=k[R]=j,++d._eventsCount;else if(typeof N=="function"?N=k[R]=W?[j,N]:[N,j]:W?N.unshift(j):N.push(j),(U=w(d))>0&&N.length>U&&!N.warned){N.warned=!0;var $=new Error("Possible EventEmitter memory leak detected. "+N.length+" "+String(R)+" listeners added. Use emitter.setMaxListeners() to increase limit");$.name="MaxListenersExceededWarning",$.emitter=d,$.type=R,$.count=N.length,O=$,console&&console.warn&&console.warn(O)}return d}function P(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function C(d,R,j){var W={fired:!1,wrapFn:void 0,target:d,type:R,listener:j},U=P.bind(W);return U.listener=j,W.wrapFn=U,U}function x(d,R,j){var W=d._events;if(W===void 0)return[];var U=W[R];return U===void 0?[]:typeof U=="function"?j?[U.listener||U]:[U]:j?function(k){for(var N=new Array(k.length),O=0;O0&&(k=R[0]),k instanceof Error)throw k;var N=new Error("Unhandled error."+(k?" ("+k.message+")":""));throw N.context=k,N}var O=U[d];if(O===void 0)return!1;if(typeof O=="function")s(O,this,R);else{var $=O.length,B=I(O,$);for(j=0;j<$;++j)s(B[j],this,R)}return!0},f.prototype.addListener=function(d,R){return L(this,d,R,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(d,R){return L(this,d,R,!0)},f.prototype.once=function(d,R){return h(R),this.on(d,C(this,d,R)),this},f.prototype.prependOnceListener=function(d,R){return h(R),this.prependListener(d,C(this,d,R)),this},f.prototype.removeListener=function(d,R){var j,W,U,k,N;if(h(R),(W=this._events)===void 0)return this;if((j=W[d])===void 0)return this;if(j===R||j.listener===R)--this._eventsCount==0?this._events=Object.create(null):(delete W[d],W.removeListener&&this.emit("removeListener",d,j.listener||R));else if(typeof j!="function"){for(U=-1,k=j.length-1;k>=0;k--)if(j[k]===R||j[k].listener===R){N=j[k].listener,U=k;break}if(U<0)return this;U===0?j.shift():function(O,$){for(;$+1=0;W--)this.removeListener(d,R[W]);return this},f.prototype.listeners=function(d){return x(this,d,!0)},f.prototype.rawListeners=function(d){return x(this,d,!1)},f.listenerCount=function(d,R){return typeof d.listenerCount=="function"?d.listenerCount(R):T.call(d,R)},f.prototype.listenerCount=T,f.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(r,o,i){r.exports.Dispatcher=i(140)},function(r,o,i){r.exports=i(142)},function(r,o,i){o.__esModule=!0;var a=c(i(50)),l=c(i(65)),s=typeof l.default=="function"&&typeof a.default=="symbol"?function(f){return typeof f}:function(f){return f&&typeof l.default=="function"&&f.constructor===l.default&&f!==l.default.prototype?"symbol":typeof f};function c(f){return f&&f.__esModule?f:{default:f}}o.default=typeof l.default=="function"&&s(a.default)==="symbol"?function(f){return f===void 0?"undefined":s(f)}:function(f){return f&&typeof l.default=="function"&&f.constructor===l.default&&f!==l.default.prototype?"symbol":f===void 0?"undefined":s(f)}},function(r,o,i){r.exports={default:i(51),__esModule:!0}},function(r,o,i){i(20),i(29),r.exports=i(30).f("iterator")},function(r,o,i){var a=i(21),l=i(22);r.exports=function(s){return function(c,f){var m,h,w=String(l(c)),L=a(f),P=w.length;return L<0||L>=P?s?"":void 0:(m=w.charCodeAt(L))<55296||m>56319||L+1===P||(h=w.charCodeAt(L+1))<56320||h>57343?s?w.charAt(L):m:s?w.slice(L,L+2):h-56320+(m-55296<<10)+65536}}},function(r,o,i){var a=i(54);r.exports=function(l,s,c){if(a(l),s===void 0)return l;switch(c){case 1:return function(f){return l.call(s,f)};case 2:return function(f,m){return l.call(s,f,m)};case 3:return function(f,m,h){return l.call(s,f,m,h)}}return function(){return l.apply(s,arguments)}}},function(r,o){r.exports=function(i){if(typeof i!="function")throw TypeError(i+" is not a function!");return i}},function(r,o,i){var a=i(38),l=i(16),s=i(28),c={};i(6)(c,i(2)("iterator"),function(){return this}),r.exports=function(f,m,h){f.prototype=a(c,{next:l(1,h)}),s(f,m+" Iterator")}},function(r,o,i){var a=i(7),l=i(10),s=i(13);r.exports=i(4)?Object.defineProperties:function(c,f){l(c);for(var m,h=s(f),w=h.length,L=0;w>L;)a.f(c,m=h[L++],f[m]);return c}},function(r,o,i){var a=i(9),l=i(58),s=i(59);r.exports=function(c){return function(f,m,h){var w,L=a(f),P=l(L.length),C=s(h,P);if(c&&m!=m){for(;P>C;)if((w=L[C++])!=w)return!0}else for(;P>C;C++)if((c||C in L)&&L[C]===m)return c||C||0;return!c&&-1}}},function(r,o,i){var a=i(21),l=Math.min;r.exports=function(s){return s>0?l(a(s),9007199254740991):0}},function(r,o,i){var a=i(21),l=Math.max,s=Math.min;r.exports=function(c,f){return(c=a(c))<0?l(c+f,0):s(c,f)}},function(r,o,i){var a=i(3).document;r.exports=a&&a.documentElement},function(r,o,i){var a=i(5),l=i(18),s=i(25)("IE_PROTO"),c=Object.prototype;r.exports=Object.getPrototypeOf||function(f){return f=l(f),a(f,s)?f[s]:typeof f.constructor=="function"&&f instanceof f.constructor?f.constructor.prototype:f instanceof Object?c:null}},function(r,o,i){var a=i(63),l=i(64),s=i(12),c=i(9);r.exports=i(34)(Array,"Array",function(f,m){this._t=c(f),this._i=0,this._k=m},function(){var f=this._t,m=this._k,h=this._i++;return!f||h>=f.length?(this._t=void 0,l(1)):l(0,m=="keys"?h:m=="values"?f[h]:[h,f[h]])},"values"),s.Arguments=s.Array,a("keys"),a("values"),a("entries")},function(r,o){r.exports=function(){}},function(r,o){r.exports=function(i,a){return{value:a,done:!!i}}},function(r,o,i){r.exports={default:i(66),__esModule:!0}},function(r,o,i){i(67),i(73),i(74),i(75),r.exports=i(1).Symbol},function(r,o,i){var a=i(3),l=i(5),s=i(4),c=i(15),f=i(37),m=i(68).KEY,h=i(8),w=i(26),L=i(28),P=i(17),C=i(2),x=i(30),T=i(31),I=i(69),d=i(70),R=i(10),j=i(11),W=i(18),U=i(9),k=i(23),N=i(16),O=i(38),$=i(71),B=i(72),ee=i(32),Z=i(7),q=i(13),ye=B.f,$e=Z.f,Fe=$.f,Te=a.Symbol,le=a.JSON,ge=le&&le.stringify,ke=C("_hidden"),Be=C("toPrimitive"),Re={}.propertyIsEnumerable,Ge=w("symbol-registry"),mt=w("symbols"),J=w("op-symbols"),re=Object.prototype,te=typeof Te=="function"&&!!ee.f,se=a.QObject,ue=!se||!se.prototype||!se.prototype.findChild,Ae=s&&h(function(){return O($e({},"a",{get:function(){return $e(this,"a",{value:7}).a}})).a!=7})?function(H,oe,we){var Oe=ye(re,oe);Oe&&delete re[oe],$e(H,oe,we),Oe&&H!==re&&$e(re,oe,Oe)}:$e,We=function(H){var oe=mt[H]=O(Te.prototype);return oe._k=H,oe},De=te&&typeof Te.iterator=="symbol"?function(H){return typeof H=="symbol"}:function(H){return H instanceof Te},it=function(H,oe,we){return H===re&&it(J,oe,we),R(H),oe=k(oe,!0),R(we),l(mt,oe)?(we.enumerable?(l(H,ke)&&H[ke][oe]&&(H[ke][oe]=!1),we=O(we,{enumerable:N(0,!1)})):(l(H,ke)||$e(H,ke,N(1,{})),H[ke][oe]=!0),Ae(H,oe,we)):$e(H,oe,we)},gt=function(H,oe){R(H);for(var we,Oe=I(oe=U(oe)),Ie=0,Ce=Oe.length;Ce>Ie;)it(H,we=Oe[Ie++],oe[we]);return H},ze=function(H){var oe=Re.call(this,H=k(H,!0));return!(this===re&&l(mt,H)&&!l(J,H))&&(!(oe||!l(this,H)||!l(mt,H)||l(this,ke)&&this[ke][H])||oe)},xt=function(H,oe){if(H=U(H),oe=k(oe,!0),H!==re||!l(mt,oe)||l(J,oe)){var we=ye(H,oe);return!we||!l(mt,oe)||l(H,ke)&&H[ke][oe]||(we.enumerable=!0),we}},Mt=function(H){for(var oe,we=Fe(U(H)),Oe=[],Ie=0;we.length>Ie;)l(mt,oe=we[Ie++])||oe==ke||oe==m||Oe.push(oe);return Oe},un=function(H){for(var oe,we=H===re,Oe=Fe(we?J:U(H)),Ie=[],Ce=0;Oe.length>Ce;)!l(mt,oe=Oe[Ce++])||we&&!l(re,oe)||Ie.push(mt[oe]);return Ie};te||(f((Te=function(){if(this instanceof Te)throw TypeError("Symbol is not a constructor!");var H=P(arguments.length>0?arguments[0]:void 0),oe=function(we){this===re&&oe.call(J,we),l(this,ke)&&l(this[ke],H)&&(this[ke][H]=!1),Ae(this,H,N(1,we))};return s&&ue&&Ae(re,H,{configurable:!0,set:oe}),We(H)}).prototype,"toString",function(){return this._k}),B.f=xt,Z.f=it,i(41).f=$.f=Mt,i(19).f=ze,ee.f=un,s&&!i(14)&&f(re,"propertyIsEnumerable",ze,!0),x.f=function(H){return We(C(H))}),c(c.G+c.W+c.F*!te,{Symbol:Te});for(var St="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),kt=0;St.length>kt;)C(St[kt++]);for(var Vt=q(C.store),Y=0;Vt.length>Y;)T(Vt[Y++]);c(c.S+c.F*!te,"Symbol",{for:function(H){return l(Ge,H+="")?Ge[H]:Ge[H]=Te(H)},keyFor:function(H){if(!De(H))throw TypeError(H+" is not a symbol!");for(var oe in Ge)if(Ge[oe]===H)return oe},useSetter:function(){ue=!0},useSimple:function(){ue=!1}}),c(c.S+c.F*!te,"Object",{create:function(H,oe){return oe===void 0?O(H):gt(O(H),oe)},defineProperty:it,defineProperties:gt,getOwnPropertyDescriptor:xt,getOwnPropertyNames:Mt,getOwnPropertySymbols:un});var K=h(function(){ee.f(1)});c(c.S+c.F*K,"Object",{getOwnPropertySymbols:function(H){return ee.f(W(H))}}),le&&c(c.S+c.F*(!te||h(function(){var H=Te();return ge([H])!="[null]"||ge({a:H})!="{}"||ge(Object(H))!="{}"})),"JSON",{stringify:function(H){for(var oe,we,Oe=[H],Ie=1;arguments.length>Ie;)Oe.push(arguments[Ie++]);if(we=oe=Oe[1],(j(oe)||H!==void 0)&&!De(H))return d(oe)||(oe=function(Ce,nt){if(typeof we=="function"&&(nt=we.call(this,Ce,nt)),!De(nt))return nt}),Oe[1]=oe,ge.apply(le,Oe)}}),Te.prototype[Be]||i(6)(Te.prototype,Be,Te.prototype.valueOf),L(Te,"Symbol"),L(Math,"Math",!0),L(a.JSON,"JSON",!0)},function(r,o,i){var a=i(17)("meta"),l=i(11),s=i(5),c=i(7).f,f=0,m=Object.isExtensible||function(){return!0},h=!i(8)(function(){return m(Object.preventExtensions({}))}),w=function(P){c(P,a,{value:{i:"O"+ ++f,w:{}}})},L=r.exports={KEY:a,NEED:!1,fastKey:function(P,C){if(!l(P))return typeof P=="symbol"?P:(typeof P=="string"?"S":"P")+P;if(!s(P,a)){if(!m(P))return"F";if(!C)return"E";w(P)}return P[a].i},getWeak:function(P,C){if(!s(P,a)){if(!m(P))return!0;if(!C)return!1;w(P)}return P[a].w},onFreeze:function(P){return h&&L.NEED&&m(P)&&!s(P,a)&&w(P),P}}},function(r,o,i){var a=i(13),l=i(32),s=i(19);r.exports=function(c){var f=a(c),m=l.f;if(m)for(var h,w=m(c),L=s.f,P=0;w.length>P;)L.call(c,h=w[P++])&&f.push(h);return f}},function(r,o,i){var a=i(24);r.exports=Array.isArray||function(l){return a(l)=="Array"}},function(r,o,i){var a=i(9),l=i(41).f,s={}.toString,c=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];r.exports.f=function(f){return c&&s.call(f)=="[object Window]"?function(m){try{return l(m)}catch{return c.slice()}}(f):l(a(f))}},function(r,o,i){var a=i(19),l=i(16),s=i(9),c=i(23),f=i(5),m=i(35),h=Object.getOwnPropertyDescriptor;o.f=i(4)?h:function(w,L){if(w=s(w),L=c(L,!0),m)try{return h(w,L)}catch{}if(f(w,L))return l(!a.f.call(w,L),w[L])}},function(r,o){},function(r,o,i){i(31)("asyncIterator")},function(r,o,i){i(31)("observable")},function(r,o,i){o.__esModule=!0;var a,l=i(77),s=(a=l)&&a.__esModule?a:{default:a};o.default=s.default||function(c){for(var f=1;fx;)for(var d,R=m(arguments[x++]),j=T?l(R).concat(T(R)):l(R),W=j.length,U=0;W>U;)d=j[U++],a&&!I.call(R,d)||(P[d]=R[d]);return P}:h},function(r,o,i){o.__esModule=!0;var a=s(i(82)),l=s(i(85));function s(c){return c&&c.__esModule?c:{default:c}}o.default=function(c,f){if(Array.isArray(c))return c;if((0,a.default)(Object(c)))return function(m,h){var w=[],L=!0,P=!1,C=void 0;try{for(var x,T=(0,l.default)(m);!(L=(x=T.next()).done)&&(w.push(x.value),!h||w.length!==h);L=!0);}catch(I){P=!0,C=I}finally{try{!L&&T.return&&T.return()}finally{if(P)throw C}}return w}(c,f);throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(r,o,i){r.exports={default:i(83),__esModule:!0}},function(r,o,i){i(29),i(20),r.exports=i(84)},function(r,o,i){var a=i(42),l=i(2)("iterator"),s=i(12);r.exports=i(1).isIterable=function(c){var f=Object(c);return f[l]!==void 0||"@@iterator"in f||s.hasOwnProperty(a(f))}},function(r,o,i){r.exports={default:i(86),__esModule:!0}},function(r,o,i){i(29),i(20),r.exports=i(87)},function(r,o,i){var a=i(10),l=i(88);r.exports=i(1).getIterator=function(s){var c=l(s);if(typeof c!="function")throw TypeError(s+" is not iterable!");return a(c.call(s))}},function(r,o,i){var a=i(42),l=i(2)("iterator"),s=i(12);r.exports=i(1).getIteratorMethod=function(c){if(c!=null)return c[l]||c["@@iterator"]||s[a(c)]}},function(r,o,i){r.exports={default:i(90),__esModule:!0}},function(r,o,i){i(91),r.exports=i(1).Object.keys},function(r,o,i){var a=i(18),l=i(13);i(92)("keys",function(){return function(s){return l(a(s))}})},function(r,o,i){var a=i(15),l=i(1),s=i(8);r.exports=function(c,f){var m=(l.Object||{})[c]||Object[c],h={};h[c]=f(m),a(a.S+a.F*s(function(){m(1)}),"Object",h)}},function(r,o,i){(function(a){var l=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],s=/^\s+|\s+$/g,c=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,f=/\{\n\/\* \[wrapped with (.+)\] \*/,m=/,? & /,h=/^[-+]0x[0-9a-f]+$/i,w=/^0b[01]+$/i,L=/^\[object .+?Constructor\]$/,P=/^0o[0-7]+$/i,C=/^(?:0|[1-9]\d*)$/,x=parseInt,T=typeof a=="object"&&a&&a.Object===Object&&a,I=typeof self=="object"&&self&&self.Object===Object&&self,d=T||I||Function("return this")();function R(Y,K,H){switch(H.length){case 0:return Y.call(K);case 1:return Y.call(K,H[0]);case 2:return Y.call(K,H[0],H[1]);case 3:return Y.call(K,H[0],H[1],H[2])}return Y.apply(K,H)}function j(Y,K){return!!(Y&&Y.length)&&function(H,oe,we){if(oe!=oe)return function(Ce,nt,_t,vt){for(var Dt=Ce.length,Tt=_t+(vt?1:-1);vt?Tt--:++Tt-1}function W(Y){return Y!=Y}function U(Y,K){for(var H=Y.length,oe=0;H--;)Y[H]===K&&oe++;return oe}function k(Y,K){for(var H=-1,oe=Y.length,we=0,Oe=[];++H2?O:void 0);function Re(Y){return St(Y)?le(Y):{}}function Ge(Y){return!(!St(Y)||function(K){return!!q&&q in K}(Y))&&(function(K){var H=St(K)?Fe.call(K):"";return H=="[object Function]"||H=="[object GeneratorFunction]"}(Y)||function(K){var H=!1;if(K!=null&&typeof K.toString!="function")try{H=!!(K+"")}catch{}return H}(Y)?Te:L).test(function(K){if(K!=null){try{return ye.call(K)}catch{}try{return K+""}catch{}}return""}(Y))}function mt(Y,K,H,oe){for(var we=-1,Oe=Y.length,Ie=H.length,Ce=-1,nt=K.length,_t=ge(Oe-Ie,0),vt=Array(nt+_t),Dt=!oe;++Ce1&&ut.reverse(),vt&&nt1?"& ":"")+K[oe],K=K.join(H>2?", ":" "),Y.replace(c,`{ /* [wrapped with `+K+`] */ `)}function gt(Y,K){return!!(K=K??9007199254740991)&&(typeof Y=="number"||C.test(Y))&&Y>-1&&Y%1==0&&Y1&&s--,f=6*s<1?a+6*(l-a)*s:2*s<1?l:3*s<2?a+(l-a)*(2/3-s)*6:a,c[L]=255*f;return c}},function(r,o,i){(function(a){var l=typeof a=="object"&&a&&a.Object===Object&&a,s=typeof self=="object"&&self&&self.Object===Object&&self,c=l||s||Function("return this")();function f(k,N,O){switch(O.length){case 0:return k.call(N);case 1:return k.call(N,O[0]);case 2:return k.call(N,O[0],O[1]);case 3:return k.call(N,O[0],O[1],O[2])}return k.apply(N,O)}function m(k,N){for(var O=-1,$=N.length,B=k.length;++O<$;)k[B+O]=N[O];return k}var h=Object.prototype,w=h.hasOwnProperty,L=h.toString,P=c.Symbol,C=h.propertyIsEnumerable,x=P?P.isConcatSpreadable:void 0,T=Math.max;function I(k){return d(k)||function(N){return function(O){return function($){return!!$&&typeof $=="object"}(O)&&function($){return $!=null&&function(B){return typeof B=="number"&&B>-1&&B%1==0&&B<=9007199254740991}($.length)&&!function(B){var ee=function(Z){var q=typeof Z;return!!Z&&(q=="object"||q=="function")}(B)?L.call(B):"";return ee=="[object Function]"||ee=="[object GeneratorFunction]"}($)}(O)}(N)&&w.call(N,"callee")&&(!C.call(N,"callee")||L.call(N)=="[object Arguments]")}(k)||!!(x&&k&&k[x])}var d=Array.isArray,R,j,W,U=(j=function(k){var N=(k=function $(B,ee,Z,q,ye){var $e=-1,Fe=B.length;for(Z||(Z=I),ye||(ye=[]);++$e0&&Z(Te)?ee>1?$(Te,ee-1,Z,q,ye):m(ye,Te):q||(ye[ye.length]=Te)}return ye}(k,1)).length,O=N;for(R;O--;)if(typeof k[O]!="function")throw new TypeError("Expected a function");return function(){for(var $=0,B=N?k[$].apply(this,arguments):arguments[0];++$2?s-2:0),f=2;f"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var g,_=L(v);if(b){var A=L(this).constructor;g=Reflect.construct(_,arguments,A)}else g=_.apply(this,arguments);return x(this,g)}}i.r(o);var I=i(0),d=i.n(I);function R(){var v=this.constructor.getDerivedStateFromProps(this.props,this.state);v!=null&&this.setState(v)}function j(v){this.setState((function(b){var g=this.constructor.getDerivedStateFromProps(v,b);return g??null}).bind(this))}function W(v,b){try{var g=this.props,_=this.state;this.props=v,this.state=b,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(g,_)}finally{this.props=g,this.state=_}}function U(v){var b=v.prototype;if(!b||!b.isReactComponent)throw new Error("Can only polyfill class components");if(typeof v.getDerivedStateFromProps!="function"&&typeof b.getSnapshotBeforeUpdate!="function")return v;var g=null,_=null,A=null;if(typeof b.componentWillMount=="function"?g="componentWillMount":typeof b.UNSAFE_componentWillMount=="function"&&(g="UNSAFE_componentWillMount"),typeof b.componentWillReceiveProps=="function"?_="componentWillReceiveProps":typeof b.UNSAFE_componentWillReceiveProps=="function"&&(_="UNSAFE_componentWillReceiveProps"),typeof b.componentWillUpdate=="function"?A="componentWillUpdate":typeof b.UNSAFE_componentWillUpdate=="function"&&(A="UNSAFE_componentWillUpdate"),g!==null||_!==null||A!==null){var z=v.displayName||v.name,V=typeof v.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. diff --git a/docs/index.html b/docs/index.html index 9ac87e5..fd2da93 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,7 +8,7 @@ Demo Dapp with @tonkeeper/tonconnect-ui-react - + diff --git a/package-lock.json b/package-lock.json index 173dbb4..d73caf0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "demo-dapp-react-ui", "version": "0.0.0", "dependencies": { - "@tonkeeper/tonconnect-ui-react": "^2.0.11-beta.9", + "@tonkeeper/tonconnect-ui-react": "^2.0.12", "eruda": "^2.11.2", "react": "^17.0.0", "react-dom": "^17.0.0", @@ -58,10 +58,10 @@ }, "../sdk/packages/ui-react": { "name": "@tonkeeper/tonconnect-ui-react", - "version": "2.0.11-beta.9", + "version": "2.0.12", "license": "Apache-2.0", "dependencies": { - "@tonkeeper/tonconnect-ui": "2.0.11-beta.6" + "@tonkeeper/tonconnect-ui": "2.0.12" }, "devDependencies": { "@types/react": "^18.0.26", @@ -2374,7 +2374,7 @@ "@tonkeeper/tonconnect-ui-react": { "version": "file:../sdk/packages/ui-react", "requires": { - "@tonkeeper/tonconnect-ui": "2.0.11-beta.6", + "@tonkeeper/tonconnect-ui": "2.0.12", "@types/react": "^18.0.26", "@types/react-dom": "^18.0.9", "@vitejs/plugin-react": "^3.0.0", diff --git a/package.json b/package.json index 684330d..46a2b10 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "preview": "vite preview" }, "dependencies": { - "@tonkeeper/tonconnect-ui-react": "^2.0.11-beta.9", + "@tonkeeper/tonconnect-ui-react": "^2.0.12", "eruda": "^2.11.2", "react": "^17.0.0", "react-dom": "^17.0.0",