@tonconnect/ui 2.4.0-beta.4 → 2.4.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tonconnect-ui.min.js +20 -20
- package/dist/tonconnect-ui.min.js.map +1 -1
- package/lib/index.cjs +16 -3
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +5 -1
- package/lib/index.mjs +16 -3
- package/lib/index.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TON_CONNECT_UI={})}(this,function(e){"use strict";var t,n,r,o,i,a,s,l,c=Object.defineProperty,d=Object.defineProperties,u=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,f=(e,t,n)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m=(e,t)=>{for(var n in t||(t={}))p.call(t,n)&&f(e,n,t[n]);if(h)for(var n of h(t))g.call(t,n)&&f(e,n,t[n]);return e},w=(e,t)=>d(e,u(t)),v=(e,t)=>{var n={};for(var r in e)p.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&h)for(var r of h(e))t.indexOf(r)<0&&g.call(e,r)&&(n[r]=e[r]);return n},y=(e,t,n)=>new Promise((r,o)=>{var i=e=>{try{s(n.next(e))}catch(Gr){o(Gr)}},a=e=>{try{s(n.throw(e))}catch(Gr){o(Gr)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,a);s((n=n.apply(e,t)).next())});function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function C(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch(r){}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var x,S,k,_,E={exports:{}};const R=b((x||(x=1,k=E.exports,_=function(){var e={};function t(e){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e))throw new TypeError("invalid encoding")}return e.decodeUTF8=function(e){if("string"!=typeof e)throw new TypeError("expected string");var t,n=unescape(encodeURIComponent(e)),r=new Uint8Array(n.length);for(t=0;t<n.length;t++)r[t]=n.charCodeAt(t);return r},e.encodeUTF8=function(e){var t,n=[];for(t=0;t<e.length;t++)n.push(String.fromCharCode(e[t]));return decodeURIComponent(escape(n.join("")))},"undefined"==typeof atob?void 0!==Buffer.from?(e.encodeBase64=function(e){return Buffer.from(e).toString("base64")},e.decodeBase64=function(e){return t(e),new Uint8Array(Array.prototype.slice.call(Buffer.from(e,"base64"),0))}):(e.encodeBase64=function(e){return new Buffer(e).toString("base64")},e.decodeBase64=function(e){return t(e),new Uint8Array(Array.prototype.slice.call(new Buffer(e,"base64"),0))}):(e.encodeBase64=function(e){var t,n=[],r=e.length;for(t=0;t<r;t++)n.push(String.fromCharCode(e[t]));return btoa(n.join(""))},e.decodeBase64=function(e){t(e);var n,r=atob(e),o=new Uint8Array(r.length);for(n=0;n<r.length;n++)o[n]=r.charCodeAt(n);return o}),e},(S=E).exports?S.exports=_():(k.nacl||(k.nacl={}),k.nacl.util=_())),E.exports));function T(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var I={exports:{}};const O=C(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var M;var A=(M||(M=1,function(e){!function(e){var t=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;t++)n[t]=e[t];return n},n=function(){throw new Error("no PRNG")},r=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var i=t(),a=t([1]),s=t([56129,1]),l=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),c=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),u=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),h=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t,n,r){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n,e[t+4]=r>>24&255,e[t+5]=r>>16&255,e[t+6]=r>>8&255,e[t+7]=255&r}function g(e,t,n,r,o){var i,a=0;for(i=0;i<o;i++)a|=e[t+i]^n[r+i];return(1&a-1>>>8)-1}function f(e,t,n,r){return g(e,t,n,r,16)}function m(e,t,n,r){return g(e,t,n,r,32)}function w(e,t,n,r){!function(e,t,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,c=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,d=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,g=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,f=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,m=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,w=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,v=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,y=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,b=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,C=i,x=a,S=s,k=l,_=c,E=d,R=u,T=h,I=p,O=g,M=f,A=m,L=w,N=v,W=y,P=b,U=0;U<20;U+=2)C^=(o=(L^=(o=(I^=(o=(_^=(o=C+L|0)<<7|o>>>25)+C|0)<<9|o>>>23)+_|0)<<13|o>>>19)+I|0)<<18|o>>>14,E^=(o=(x^=(o=(N^=(o=(O^=(o=E+x|0)<<7|o>>>25)+E|0)<<9|o>>>23)+O|0)<<13|o>>>19)+N|0)<<18|o>>>14,M^=(o=(R^=(o=(S^=(o=(W^=(o=M+R|0)<<7|o>>>25)+M|0)<<9|o>>>23)+W|0)<<13|o>>>19)+S|0)<<18|o>>>14,P^=(o=(A^=(o=(T^=(o=(k^=(o=P+A|0)<<7|o>>>25)+P|0)<<9|o>>>23)+k|0)<<13|o>>>19)+T|0)<<18|o>>>14,C^=(o=(k^=(o=(S^=(o=(x^=(o=C+k|0)<<7|o>>>25)+C|0)<<9|o>>>23)+x|0)<<13|o>>>19)+S|0)<<18|o>>>14,E^=(o=(_^=(o=(T^=(o=(R^=(o=E+_|0)<<7|o>>>25)+E|0)<<9|o>>>23)+R|0)<<13|o>>>19)+T|0)<<18|o>>>14,M^=(o=(O^=(o=(I^=(o=(A^=(o=M+O|0)<<7|o>>>25)+M|0)<<9|o>>>23)+A|0)<<13|o>>>19)+I|0)<<18|o>>>14,P^=(o=(W^=(o=(N^=(o=(L^=(o=P+W|0)<<7|o>>>25)+P|0)<<9|o>>>23)+L|0)<<13|o>>>19)+N|0)<<18|o>>>14;C=C+i|0,x=x+a|0,S=S+s|0,k=k+l|0,_=_+c|0,E=E+d|0,R=R+u|0,T=T+h|0,I=I+p|0,O=O+g|0,M=M+f|0,A=A+m|0,L=L+w|0,N=N+v|0,W=W+y|0,P=P+b|0,e[0]=C>>>0&255,e[1]=C>>>8&255,e[2]=C>>>16&255,e[3]=C>>>24&255,e[4]=x>>>0&255,e[5]=x>>>8&255,e[6]=x>>>16&255,e[7]=x>>>24&255,e[8]=S>>>0&255,e[9]=S>>>8&255,e[10]=S>>>16&255,e[11]=S>>>24&255,e[12]=k>>>0&255,e[13]=k>>>8&255,e[14]=k>>>16&255,e[15]=k>>>24&255,e[16]=_>>>0&255,e[17]=_>>>8&255,e[18]=_>>>16&255,e[19]=_>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=R>>>0&255,e[25]=R>>>8&255,e[26]=R>>>16&255,e[27]=R>>>24&255,e[28]=T>>>0&255,e[29]=T>>>8&255,e[30]=T>>>16&255,e[31]=T>>>24&255,e[32]=I>>>0&255,e[33]=I>>>8&255,e[34]=I>>>16&255,e[35]=I>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=M>>>0&255,e[41]=M>>>8&255,e[42]=M>>>16&255,e[43]=M>>>24&255,e[44]=A>>>0&255,e[45]=A>>>8&255,e[46]=A>>>16&255,e[47]=A>>>24&255,e[48]=L>>>0&255,e[49]=L>>>8&255,e[50]=L>>>16&255,e[51]=L>>>24&255,e[52]=N>>>0&255,e[53]=N>>>8&255,e[54]=N>>>16&255,e[55]=N>>>24&255,e[56]=W>>>0&255,e[57]=W>>>8&255,e[58]=W>>>16&255,e[59]=W>>>24&255,e[60]=P>>>0&255,e[61]=P>>>8&255,e[62]=P>>>16&255,e[63]=P>>>24&255}(e,t,n,r)}function v(e,t,n,r){!function(e,t,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,c=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,d=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,g=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,f=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,m=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,w=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,v=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,y=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,b=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,C=0;C<20;C+=2)i^=(o=(w^=(o=(p^=(o=(c^=(o=i+w|0)<<7|o>>>25)+i|0)<<9|o>>>23)+c|0)<<13|o>>>19)+p|0)<<18|o>>>14,d^=(o=(a^=(o=(v^=(o=(g^=(o=d+a|0)<<7|o>>>25)+d|0)<<9|o>>>23)+g|0)<<13|o>>>19)+v|0)<<18|o>>>14,f^=(o=(u^=(o=(s^=(o=(y^=(o=f+u|0)<<7|o>>>25)+f|0)<<9|o>>>23)+y|0)<<13|o>>>19)+s|0)<<18|o>>>14,b^=(o=(m^=(o=(h^=(o=(l^=(o=b+m|0)<<7|o>>>25)+b|0)<<9|o>>>23)+l|0)<<13|o>>>19)+h|0)<<18|o>>>14,i^=(o=(l^=(o=(s^=(o=(a^=(o=i+l|0)<<7|o>>>25)+i|0)<<9|o>>>23)+a|0)<<13|o>>>19)+s|0)<<18|o>>>14,d^=(o=(c^=(o=(h^=(o=(u^=(o=d+c|0)<<7|o>>>25)+d|0)<<9|o>>>23)+u|0)<<13|o>>>19)+h|0)<<18|o>>>14,f^=(o=(g^=(o=(p^=(o=(m^=(o=f+g|0)<<7|o>>>25)+f|0)<<9|o>>>23)+m|0)<<13|o>>>19)+p|0)<<18|o>>>14,b^=(o=(y^=(o=(v^=(o=(w^=(o=b+y|0)<<7|o>>>25)+b|0)<<9|o>>>23)+w|0)<<13|o>>>19)+v|0)<<18|o>>>14;e[0]=i>>>0&255,e[1]=i>>>8&255,e[2]=i>>>16&255,e[3]=i>>>24&255,e[4]=d>>>0&255,e[5]=d>>>8&255,e[6]=d>>>16&255,e[7]=d>>>24&255,e[8]=f>>>0&255,e[9]=f>>>8&255,e[10]=f>>>16&255,e[11]=f>>>24&255,e[12]=b>>>0&255,e[13]=b>>>8&255,e[14]=b>>>16&255,e[15]=b>>>24&255,e[16]=u>>>0&255,e[17]=u>>>8&255,e[18]=u>>>16&255,e[19]=u>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=p>>>0&255,e[25]=p>>>8&255,e[26]=p>>>16&255,e[27]=p>>>24&255,e[28]=g>>>0&255,e[29]=g>>>8&255,e[30]=g>>>16&255,e[31]=g>>>24&255}(e,t,n,r)}var y=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function b(e,t,n,r,o,i,a){var s,l,c=new Uint8Array(16),d=new Uint8Array(64);for(l=0;l<16;l++)c[l]=0;for(l=0;l<8;l++)c[l]=i[l];for(;o>=64;){for(w(d,c,a,y),l=0;l<64;l++)e[t+l]=n[r+l]^d[l];for(s=1,l=8;l<16;l++)s=s+(255&c[l])|0,c[l]=255&s,s>>>=8;o-=64,t+=64,r+=64}if(o>0)for(w(d,c,a,y),l=0;l<o;l++)e[t+l]=n[r+l]^d[l];return 0}function C(e,t,n,r,o){var i,a,s=new Uint8Array(16),l=new Uint8Array(64);for(a=0;a<16;a++)s[a]=0;for(a=0;a<8;a++)s[a]=r[a];for(;n>=64;){for(w(l,s,o,y),a=0;a<64;a++)e[t+a]=l[a];for(i=1,a=8;a<16;a++)i=i+(255&s[a])|0,s[a]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(w(l,s,o,y),a=0;a<n;a++)e[t+a]=l[a];return 0}function x(e,t,n,r,o){var i=new Uint8Array(32);v(i,r,o,y);for(var a=new Uint8Array(8),s=0;s<8;s++)a[s]=r[s+16];return C(e,t,n,a,i)}function S(e,t,n,r,o,i,a){var s=new Uint8Array(32);v(s,i,a,y);for(var l=new Uint8Array(8),c=0;c<8;c++)l[c]=i[c+16];return b(e,t,n,r,o,l,s)}var k=function(e){var t,n,r,o,i,a,s,l;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,n=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|n<<3),r=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(n>>>10|r<<6),o=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(r>>>7|o<<9),i=255&e[8]|(255&e[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,a=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(i>>>14|a<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(a>>>11|s<<5),l=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|l<<8),this.r[9]=l>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function _(e,t,n,r,o,i){var a=new k(i);return a.update(n,r,o),a.finish(e,t),0}function E(e,t,n,r,o,i){var a=new Uint8Array(16);return _(a,0,n,r,o,i),f(e,t,a,0)}function R(e,t,n,r,o){var i;if(n<32)return-1;for(S(e,0,t,0,n,r,o),_(e,16,e,32,n-32,e),i=0;i<16;i++)e[i]=0;return 0}function I(e,t,n,r,o){var i,a=new Uint8Array(32);if(n<32)return-1;if(x(a,0,32,r,o),0!==E(t,16,t,32,n-32,a))return-1;for(S(e,0,t,0,n,r,o),i=0;i<32;i++)e[i]=0;return 0}function M(e,t){var n;for(n=0;n<16;n++)e[n]=0|t[n]}function A(e){var t,n,r=1;for(t=0;t<16;t++)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-65536*r;e[0]+=r-1+37*(r-1)}function L(e,t,n){for(var r,o=~(n-1),i=0;i<16;i++)r=o&(e[i]^t[i]),e[i]^=r,t[i]^=r}function N(e,n){var r,o,i,a=t(),s=t();for(r=0;r<16;r++)s[r]=n[r];for(A(s),A(s),A(s),o=0;o<2;o++){for(a[0]=s[0]-65517,r=1;r<15;r++)a[r]=s[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=s[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,L(s,a,1-i)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function W(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return N(n,e),N(r,t),m(n,0,r,0)}function P(e){var t=new Uint8Array(32);return N(t,e),1&t[0]}function U(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function D(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function j(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function B(e,t,n){var r,o,i=0,a=0,s=0,l=0,c=0,d=0,u=0,h=0,p=0,g=0,f=0,m=0,w=0,v=0,y=0,b=0,C=0,x=0,S=0,k=0,_=0,E=0,R=0,T=0,I=0,O=0,M=0,A=0,L=0,N=0,W=0,P=n[0],U=n[1],D=n[2],j=n[3],B=n[4],$=n[5],q=n[6],K=n[7],F=n[8],H=n[9],V=n[10],z=n[11],Z=n[12],G=n[13],Y=n[14],Q=n[15];i+=(r=t[0])*P,a+=r*U,s+=r*D,l+=r*j,c+=r*B,d+=r*$,u+=r*q,h+=r*K,p+=r*F,g+=r*H,f+=r*V,m+=r*z,w+=r*Z,v+=r*G,y+=r*Y,b+=r*Q,a+=(r=t[1])*P,s+=r*U,l+=r*D,c+=r*j,d+=r*B,u+=r*$,h+=r*q,p+=r*K,g+=r*F,f+=r*H,m+=r*V,w+=r*z,v+=r*Z,y+=r*G,b+=r*Y,C+=r*Q,s+=(r=t[2])*P,l+=r*U,c+=r*D,d+=r*j,u+=r*B,h+=r*$,p+=r*q,g+=r*K,f+=r*F,m+=r*H,w+=r*V,v+=r*z,y+=r*Z,b+=r*G,C+=r*Y,x+=r*Q,l+=(r=t[3])*P,c+=r*U,d+=r*D,u+=r*j,h+=r*B,p+=r*$,g+=r*q,f+=r*K,m+=r*F,w+=r*H,v+=r*V,y+=r*z,b+=r*Z,C+=r*G,x+=r*Y,S+=r*Q,c+=(r=t[4])*P,d+=r*U,u+=r*D,h+=r*j,p+=r*B,g+=r*$,f+=r*q,m+=r*K,w+=r*F,v+=r*H,y+=r*V,b+=r*z,C+=r*Z,x+=r*G,S+=r*Y,k+=r*Q,d+=(r=t[5])*P,u+=r*U,h+=r*D,p+=r*j,g+=r*B,f+=r*$,m+=r*q,w+=r*K,v+=r*F,y+=r*H,b+=r*V,C+=r*z,x+=r*Z,S+=r*G,k+=r*Y,_+=r*Q,u+=(r=t[6])*P,h+=r*U,p+=r*D,g+=r*j,f+=r*B,m+=r*$,w+=r*q,v+=r*K,y+=r*F,b+=r*H,C+=r*V,x+=r*z,S+=r*Z,k+=r*G,_+=r*Y,E+=r*Q,h+=(r=t[7])*P,p+=r*U,g+=r*D,f+=r*j,m+=r*B,w+=r*$,v+=r*q,y+=r*K,b+=r*F,C+=r*H,x+=r*V,S+=r*z,k+=r*Z,_+=r*G,E+=r*Y,R+=r*Q,p+=(r=t[8])*P,g+=r*U,f+=r*D,m+=r*j,w+=r*B,v+=r*$,y+=r*q,b+=r*K,C+=r*F,x+=r*H,S+=r*V,k+=r*z,_+=r*Z,E+=r*G,R+=r*Y,T+=r*Q,g+=(r=t[9])*P,f+=r*U,m+=r*D,w+=r*j,v+=r*B,y+=r*$,b+=r*q,C+=r*K,x+=r*F,S+=r*H,k+=r*V,_+=r*z,E+=r*Z,R+=r*G,T+=r*Y,I+=r*Q,f+=(r=t[10])*P,m+=r*U,w+=r*D,v+=r*j,y+=r*B,b+=r*$,C+=r*q,x+=r*K,S+=r*F,k+=r*H,_+=r*V,E+=r*z,R+=r*Z,T+=r*G,I+=r*Y,O+=r*Q,m+=(r=t[11])*P,w+=r*U,v+=r*D,y+=r*j,b+=r*B,C+=r*$,x+=r*q,S+=r*K,k+=r*F,_+=r*H,E+=r*V,R+=r*z,T+=r*Z,I+=r*G,O+=r*Y,M+=r*Q,w+=(r=t[12])*P,v+=r*U,y+=r*D,b+=r*j,C+=r*B,x+=r*$,S+=r*q,k+=r*K,_+=r*F,E+=r*H,R+=r*V,T+=r*z,I+=r*Z,O+=r*G,M+=r*Y,A+=r*Q,v+=(r=t[13])*P,y+=r*U,b+=r*D,C+=r*j,x+=r*B,S+=r*$,k+=r*q,_+=r*K,E+=r*F,R+=r*H,T+=r*V,I+=r*z,O+=r*Z,M+=r*G,A+=r*Y,L+=r*Q,y+=(r=t[14])*P,b+=r*U,C+=r*D,x+=r*j,S+=r*B,k+=r*$,_+=r*q,E+=r*K,R+=r*F,T+=r*H,I+=r*V,O+=r*z,M+=r*Z,A+=r*G,L+=r*Y,N+=r*Q,b+=(r=t[15])*P,a+=38*(x+=r*D),s+=38*(S+=r*j),l+=38*(k+=r*B),c+=38*(_+=r*$),d+=38*(E+=r*q),u+=38*(R+=r*K),h+=38*(T+=r*F),p+=38*(I+=r*H),g+=38*(O+=r*V),f+=38*(M+=r*z),m+=38*(A+=r*Z),w+=38*(L+=r*G),v+=38*(N+=r*Y),y+=38*(W+=r*Q),i=(r=(i+=38*(C+=r*U))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),i=(r=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),i+=o-1+37*(o-1),e[0]=i,e[1]=a,e[2]=s,e[3]=l,e[4]=c,e[5]=d,e[6]=u,e[7]=h,e[8]=p,e[9]=g,e[10]=f,e[11]=m,e[12]=w,e[13]=v,e[14]=y,e[15]=b}function $(e,t){B(e,t,t)}function q(e,n){var r,o=t();for(r=0;r<16;r++)o[r]=n[r];for(r=253;r>=0;r--)$(o,o),2!==r&&4!==r&&B(o,o,n);for(r=0;r<16;r++)e[r]=o[r]}function K(e,n){var r,o=t();for(r=0;r<16;r++)o[r]=n[r];for(r=250;r>=0;r--)$(o,o),1!==r&&B(o,o,n);for(r=0;r<16;r++)e[r]=o[r]}function F(e,n,r){var o,i,a=new Uint8Array(32),l=new Float64Array(80),c=t(),d=t(),u=t(),h=t(),p=t(),g=t();for(i=0;i<31;i++)a[i]=n[i];for(a[31]=127&n[31]|64,a[0]&=248,U(l,r),i=0;i<16;i++)d[i]=l[i],h[i]=c[i]=u[i]=0;for(c[0]=h[0]=1,i=254;i>=0;--i)L(c,d,o=a[i>>>3]>>>(7&i)&1),L(u,h,o),D(p,c,u),j(c,c,u),D(u,d,h),j(d,d,h),$(h,p),$(g,c),B(c,u,c),B(u,d,p),D(p,c,u),j(c,c,u),$(d,c),j(u,h,g),B(c,u,s),D(c,c,h),B(u,u,c),B(c,h,g),B(h,d,l),$(d,p),L(c,d,o),L(u,h,o);for(i=0;i<16;i++)l[i+16]=c[i],l[i+32]=u[i],l[i+48]=d[i],l[i+64]=h[i];var f=l.subarray(32),m=l.subarray(16);return q(f,f),B(m,m,f),N(e,m),0}function H(e,t){return F(e,t,o)}function V(e,t){return n(t,32),H(e,t)}function z(e,t,n){var o=new Uint8Array(32);return F(o,n,t),v(e,r,o,y)}k.prototype.blocks=function(e,t,n){for(var r,o,i,a,s,l,c,d,u,h,p,g,f,m,w,v,y,b,C,x=this.fin?0:2048,S=this.h[0],k=this.h[1],_=this.h[2],E=this.h[3],R=this.h[4],T=this.h[5],I=this.h[6],O=this.h[7],M=this.h[8],A=this.h[9],L=this.r[0],N=this.r[1],W=this.r[2],P=this.r[3],U=this.r[4],D=this.r[5],j=this.r[6],B=this.r[7],$=this.r[8],q=this.r[9];n>=16;)h=u=0,h+=(S+=8191&(r=255&e[t+0]|(255&e[t+1])<<8))*L,h+=(k+=8191&(r>>>13|(o=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*q),h+=(_+=8191&(o>>>10|(i=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*$),h+=(E+=8191&(i>>>7|(a=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*B),u=(h+=(R+=8191&(a>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*j))>>>13,h&=8191,h+=(T+=s>>>1&8191)*(5*D),h+=(I+=8191&(s>>>14|(l=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*U),h+=(O+=8191&(l>>>11|(c=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*P),h+=(M+=8191&(c>>>8|(d=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*W),p=u+=(h+=(A+=d>>>5|x)*(5*N))>>>13,p+=S*N,p+=k*L,p+=_*(5*q),p+=E*(5*$),u=(p+=R*(5*B))>>>13,p&=8191,p+=T*(5*j),p+=I*(5*D),p+=O*(5*U),p+=M*(5*P),u+=(p+=A*(5*W))>>>13,p&=8191,g=u,g+=S*W,g+=k*N,g+=_*L,g+=E*(5*q),u=(g+=R*(5*$))>>>13,g&=8191,g+=T*(5*B),g+=I*(5*j),g+=O*(5*D),g+=M*(5*U),f=u+=(g+=A*(5*P))>>>13,f+=S*P,f+=k*W,f+=_*N,f+=E*L,u=(f+=R*(5*q))>>>13,f&=8191,f+=T*(5*$),f+=I*(5*B),f+=O*(5*j),f+=M*(5*D),m=u+=(f+=A*(5*U))>>>13,m+=S*U,m+=k*P,m+=_*W,m+=E*N,u=(m+=R*L)>>>13,m&=8191,m+=T*(5*q),m+=I*(5*$),m+=O*(5*B),m+=M*(5*j),w=u+=(m+=A*(5*D))>>>13,w+=S*D,w+=k*U,w+=_*P,w+=E*W,u=(w+=R*N)>>>13,w&=8191,w+=T*L,w+=I*(5*q),w+=O*(5*$),w+=M*(5*B),v=u+=(w+=A*(5*j))>>>13,v+=S*j,v+=k*D,v+=_*U,v+=E*P,u=(v+=R*W)>>>13,v&=8191,v+=T*N,v+=I*L,v+=O*(5*q),v+=M*(5*$),y=u+=(v+=A*(5*B))>>>13,y+=S*B,y+=k*j,y+=_*D,y+=E*U,u=(y+=R*P)>>>13,y&=8191,y+=T*W,y+=I*N,y+=O*L,y+=M*(5*q),b=u+=(y+=A*(5*$))>>>13,b+=S*$,b+=k*B,b+=_*j,b+=E*D,u=(b+=R*U)>>>13,b&=8191,b+=T*P,b+=I*W,b+=O*N,b+=M*L,C=u+=(b+=A*(5*q))>>>13,C+=S*q,C+=k*$,C+=_*B,C+=E*j,u=(C+=R*D)>>>13,C&=8191,C+=T*U,C+=I*P,C+=O*W,C+=M*N,S=h=8191&(u=(u=((u+=(C+=A*L)>>>13)<<2)+u|0)+(h&=8191)|0),k=p+=u>>>=13,_=g&=8191,E=f&=8191,R=m&=8191,T=w&=8191,I=v&=8191,O=y&=8191,M=b&=8191,A=C&=8191,t+=16,n-=16;this.h[0]=S,this.h[1]=k,this.h[2]=_,this.h[3]=E,this.h[4]=R,this.h[5]=T,this.h[6]=I,this.h[7]=O,this.h[8]=M,this.h[9]=A},k.prototype.finish=function(e,t){var n,r,o,i,a=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,a[0]=this.h[0]+5,n=a[0]>>>13,a[0]&=8191,i=1;i<10;i++)a[i]=this.h[i]+n,n=a[i]>>>13,a[i]&=8191;for(a[9]-=8192,r=(1^n)-1,i=0;i<10;i++)a[i]&=r;for(r=~r,i=0;i<10;i++)this.h[i]=this.h[i]&r|a[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},k.prototype.update=function(e,t,n){var r,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),r=0;r<o;r++)this.buffer[this.leftover+r]=e[t+r];if(n-=o,t+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(e,t,o),t+=o,n-=o),n){for(r=0;r<n;r++)this.buffer[this.leftover+r]=e[t+r];this.leftover+=n}};var Z=R,G=I,Y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Q(e,t,n,r){for(var o,i,a,s,l,c,d,u,h,p,g,f,m,w,v,y,b,C,x,S,k,_,E,R,T,I,O=new Int32Array(16),M=new Int32Array(16),A=e[0],L=e[1],N=e[2],W=e[3],P=e[4],U=e[5],D=e[6],j=e[7],B=t[0],$=t[1],q=t[2],K=t[3],F=t[4],H=t[5],V=t[6],z=t[7],Z=0;r>=128;){for(x=0;x<16;x++)S=8*x+Z,O[x]=n[S+0]<<24|n[S+1]<<16|n[S+2]<<8|n[S+3],M[x]=n[S+4]<<24|n[S+5]<<16|n[S+6]<<8|n[S+7];for(x=0;x<80;x++)if(o=A,i=L,a=N,s=W,l=P,c=U,d=D,h=B,p=$,g=q,f=K,m=F,w=H,v=V,E=65535&(_=z),R=_>>>16,T=65535&(k=j),I=k>>>16,E+=65535&(_=(F>>>14|P<<18)^(F>>>18|P<<14)^(P>>>9|F<<23)),R+=_>>>16,T+=65535&(k=(P>>>14|F<<18)^(P>>>18|F<<14)^(F>>>9|P<<23)),I+=k>>>16,E+=65535&(_=F&H^~F&V),R+=_>>>16,T+=65535&(k=P&U^~P&D),I+=k>>>16,E+=65535&(_=Y[2*x+1]),R+=_>>>16,T+=65535&(k=Y[2*x]),I+=k>>>16,k=O[x%16],R+=(_=M[x%16])>>>16,T+=65535&k,I+=k>>>16,T+=(R+=(E+=65535&_)>>>16)>>>16,E=65535&(_=C=65535&E|R<<16),R=_>>>16,T=65535&(k=b=65535&T|(I+=T>>>16)<<16),I=k>>>16,E+=65535&(_=(B>>>28|A<<4)^(A>>>2|B<<30)^(A>>>7|B<<25)),R+=_>>>16,T+=65535&(k=(A>>>28|B<<4)^(B>>>2|A<<30)^(B>>>7|A<<25)),I+=k>>>16,R+=(_=B&$^B&q^$&q)>>>16,T+=65535&(k=A&L^A&N^L&N),I+=k>>>16,u=65535&(T+=(R+=(E+=65535&_)>>>16)>>>16)|(I+=T>>>16)<<16,y=65535&E|R<<16,E=65535&(_=f),R=_>>>16,T=65535&(k=s),I=k>>>16,R+=(_=C)>>>16,T+=65535&(k=b),I+=k>>>16,L=o,N=i,W=a,P=s=65535&(T+=(R+=(E+=65535&_)>>>16)>>>16)|(I+=T>>>16)<<16,U=l,D=c,j=d,A=u,$=h,q=p,K=g,F=f=65535&E|R<<16,H=m,V=w,z=v,B=y,x%16==15)for(S=0;S<16;S++)k=O[S],E=65535&(_=M[S]),R=_>>>16,T=65535&k,I=k>>>16,k=O[(S+9)%16],E+=65535&(_=M[(S+9)%16]),R+=_>>>16,T+=65535&k,I+=k>>>16,b=O[(S+1)%16],E+=65535&(_=((C=M[(S+1)%16])>>>1|b<<31)^(C>>>8|b<<24)^(C>>>7|b<<25)),R+=_>>>16,T+=65535&(k=(b>>>1|C<<31)^(b>>>8|C<<24)^b>>>7),I+=k>>>16,b=O[(S+14)%16],R+=(_=((C=M[(S+14)%16])>>>19|b<<13)^(b>>>29|C<<3)^(C>>>6|b<<26))>>>16,T+=65535&(k=(b>>>19|C<<13)^(C>>>29|b<<3)^b>>>6),I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,O[S]=65535&T|I<<16,M[S]=65535&E|R<<16;E=65535&(_=B),R=_>>>16,T=65535&(k=A),I=k>>>16,k=e[0],R+=(_=t[0])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[0]=A=65535&T|I<<16,t[0]=B=65535&E|R<<16,E=65535&(_=$),R=_>>>16,T=65535&(k=L),I=k>>>16,k=e[1],R+=(_=t[1])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[1]=L=65535&T|I<<16,t[1]=$=65535&E|R<<16,E=65535&(_=q),R=_>>>16,T=65535&(k=N),I=k>>>16,k=e[2],R+=(_=t[2])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[2]=N=65535&T|I<<16,t[2]=q=65535&E|R<<16,E=65535&(_=K),R=_>>>16,T=65535&(k=W),I=k>>>16,k=e[3],R+=(_=t[3])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[3]=W=65535&T|I<<16,t[3]=K=65535&E|R<<16,E=65535&(_=F),R=_>>>16,T=65535&(k=P),I=k>>>16,k=e[4],R+=(_=t[4])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[4]=P=65535&T|I<<16,t[4]=F=65535&E|R<<16,E=65535&(_=H),R=_>>>16,T=65535&(k=U),I=k>>>16,k=e[5],R+=(_=t[5])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[5]=U=65535&T|I<<16,t[5]=H=65535&E|R<<16,E=65535&(_=V),R=_>>>16,T=65535&(k=D),I=k>>>16,k=e[6],R+=(_=t[6])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[6]=D=65535&T|I<<16,t[6]=V=65535&E|R<<16,E=65535&(_=z),R=_>>>16,T=65535&(k=j),I=k>>>16,k=e[7],R+=(_=t[7])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[7]=j=65535&T|I<<16,t[7]=z=65535&E|R<<16,Z+=128,r-=128}return r}function J(e,t,n){var r,o=new Int32Array(8),i=new Int32Array(8),a=new Uint8Array(256),s=n;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,Q(o,i,t,n),n%=128,r=0;r<n;r++)a[r]=t[s-n+r];for(a[n]=128,a[(n=256-128*(n<112?1:0))-9]=0,p(a,n-8,s/536870912|0,s<<3),Q(o,i,a,n),r=0;r<8;r++)p(e,8*r,o[r],i[r]);return 0}function X(e,n){var r=t(),o=t(),i=t(),a=t(),s=t(),l=t(),d=t(),u=t(),h=t();j(r,e[1],e[0]),j(h,n[1],n[0]),B(r,r,h),D(o,e[0],e[1]),D(h,n[0],n[1]),B(o,o,h),B(i,e[3],n[3]),B(i,i,c),B(a,e[2],n[2]),D(a,a,a),j(s,o,r),j(l,a,i),D(d,a,i),D(u,o,r),B(e[0],s,l),B(e[1],u,d),B(e[2],d,l),B(e[3],s,u)}function ee(e,t,n){var r;for(r=0;r<4;r++)L(e[r],t[r],n)}function te(e,n){var r=t(),o=t(),i=t();q(i,n[2]),B(r,n[0],i),B(o,n[1],i),N(e,o),e[31]^=P(r)<<7}function ne(e,t,n){var r,o;for(M(e[0],i),M(e[1],a),M(e[2],a),M(e[3],i),o=255;o>=0;--o)ee(e,t,r=n[o/8|0]>>(7&o)&1),X(t,e),X(e,e),ee(e,t,r)}function re(e,n){var r=[t(),t(),t(),t()];M(r[0],d),M(r[1],u),M(r[2],a),B(r[3],d,u),ne(e,r,n)}function oe(e,r,o){var i,a=new Uint8Array(64),s=[t(),t(),t(),t()];for(o||n(r,32),J(a,r,32),a[0]&=248,a[31]&=127,a[31]|=64,re(s,a),te(e,s),i=0;i<32;i++)r[i+32]=e[i];return 0}var ie=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var n,r,o,i;for(r=63;r>=32;--r){for(n=0,o=r-32,i=r-12;o<i;++o)t[o]+=n-16*t[r]*ie[o-(r-32)],n=Math.floor((t[o]+128)/256),t[o]-=256*n;t[o]+=n,t[r]=0}for(n=0,o=0;o<32;o++)t[o]+=n-(t[31]>>4)*ie[o],n=t[o]>>8,t[o]&=255;for(o=0;o<32;o++)t[o]-=n*ie[o];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=255&t[r]}function se(e){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,n)}function le(e,n,r,o){var i,a,s=new Uint8Array(64),l=new Uint8Array(64),c=new Uint8Array(64),d=new Float64Array(64),u=[t(),t(),t(),t()];J(s,o,32),s[0]&=248,s[31]&=127,s[31]|=64;var h=r+64;for(i=0;i<r;i++)e[64+i]=n[i];for(i=0;i<32;i++)e[32+i]=s[32+i];for(J(c,e.subarray(32),r+32),se(c),re(u,c),te(e,u),i=32;i<64;i++)e[i]=o[i];for(J(l,e,r+64),se(l),i=0;i<64;i++)d[i]=0;for(i=0;i<32;i++)d[i]=c[i];for(i=0;i<32;i++)for(a=0;a<32;a++)d[i+a]+=l[i]*s[a];return ae(e.subarray(32),d),h}function ce(e,n,r,o){var s,c=new Uint8Array(32),d=new Uint8Array(64),u=[t(),t(),t(),t()],p=[t(),t(),t(),t()];if(r<64)return-1;if(function(e,n){var r=t(),o=t(),s=t(),c=t(),d=t(),u=t(),p=t();return M(e[2],a),U(e[1],n),$(s,e[1]),B(c,s,l),j(s,s,e[2]),D(c,e[2],c),$(d,c),$(u,d),B(p,u,d),B(r,p,s),B(r,r,c),K(r,r),B(r,r,s),B(r,r,c),B(r,r,c),B(e[0],r,c),$(o,e[0]),B(o,o,c),W(o,s)&&B(e[0],e[0],h),$(o,e[0]),B(o,o,c),W(o,s)?-1:(P(e[0])===n[31]>>7&&j(e[0],i,e[0]),B(e[3],e[0],e[1]),0)}(p,o))return-1;for(s=0;s<r;s++)e[s]=n[s];for(s=0;s<32;s++)e[s+32]=o[s];if(J(d,e,r),se(d),ne(u,p,d),re(p,n.subarray(32)),X(u,p),te(c,u),r-=64,m(n,0,c,0)){for(s=0;s<r;s++)e[s]=0;return-1}for(s=0;s<r;s++)e[s]=n[s+64];return r}var de,ue=16,he=64,pe=32,ge=64;function fe(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function me(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function we(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:v,crypto_stream_xor:S,crypto_stream:x,crypto_stream_salsa20_xor:b,crypto_stream_salsa20:C,crypto_onetimeauth:_,crypto_onetimeauth_verify:E,crypto_verify_16:f,crypto_verify_32:m,crypto_secretbox:R,crypto_secretbox_open:I,crypto_scalarmult:F,crypto_scalarmult_base:H,crypto_box_beforenm:z,crypto_box_afternm:Z,crypto_box:function(e,t,n,r,o,i){var a=new Uint8Array(32);return z(a,o,i),Z(e,t,n,r,a)},crypto_box_open:function(e,t,n,r,o,i){var a=new Uint8Array(32);return z(a,o,i),G(e,t,n,r,a)},crypto_box_keypair:V,crypto_hash:J,crypto_sign:le,crypto_sign_keypair:oe,crypto_sign_open:ce,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:ue,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:he,crypto_sign_PUBLICKEYBYTES:pe,crypto_sign_SECRETKEYBYTES:ge,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:l,L:ie,pack25519:N,unpack25519:U,M:B,A:D,S:$,Z:j,pow2523:K,add:X,set25519:M,modL:ae,scalarmult:ne,scalarbase:re},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,n){me(e,t,n),fe(n,t);for(var r=new Uint8Array(32+e.length),o=new Uint8Array(r.length),i=0;i<e.length;i++)r[i+32]=e[i];return R(o,r,r.length,t,n),o.subarray(ue)},e.secretbox.open=function(e,t,n){me(e,t,n),fe(n,t);for(var r=new Uint8Array(ue+e.length),o=new Uint8Array(r.length),i=0;i<e.length;i++)r[i+ue]=e[i];return r.length<32||0!==I(o,r,r.length,t,n)?null:o.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=ue,e.scalarMult=function(e,t){if(me(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var n=new Uint8Array(32);return F(n,e,t),n},e.scalarMult.base=function(e){if(me(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return H(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,n,r,o){var i=e.box.before(r,o);return e.secretbox(t,n,i)},e.box.before=function(e,t){me(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var n=new Uint8Array(32);return z(n,e,t),n},e.box.after=e.secretbox,e.box.open=function(t,n,r,o){var i=e.box.before(r,o);return e.secretbox.open(t,n,i)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return V(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(me(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return H(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(me(e,t),t.length!==ge)throw new Error("bad secret key size");var n=new Uint8Array(he+e.length);return le(n,e,e.length,t),n},e.sign.open=function(e,t){if(me(e,t),t.length!==pe)throw new Error("bad public key size");var n=new Uint8Array(e.length),r=ce(n,e,e.length,t);if(r<0)return null;for(var o=new Uint8Array(r),i=0;i<o.length;i++)o[i]=n[i];return o},e.sign.detached=function(t,n){for(var r=e.sign(t,n),o=new Uint8Array(he),i=0;i<o.length;i++)o[i]=r[i];return o},e.sign.detached.verify=function(e,t,n){if(me(e,t,n),t.length!==he)throw new Error("bad signature size");if(n.length!==pe)throw new Error("bad public key size");var r,o=new Uint8Array(he+e.length),i=new Uint8Array(he+e.length);for(r=0;r<he;r++)o[r]=t[r];for(r=0;r<e.length;r++)o[r+he]=e[r];return ce(i,o,o.length,n)>=0},e.sign.keyPair=function(){var e=new Uint8Array(pe),t=new Uint8Array(ge);return oe(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(me(e),e.length!==ge)throw new Error("bad secret key size");for(var t=new Uint8Array(pe),n=0;n<t.length;n++)t[n]=e[32+n];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(me(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(pe),n=new Uint8Array(ge),r=0;r<32;r++)n[r]=e[r];return oe(t,n,!0),{publicKey:t,secretKey:n}},e.sign.publicKeyLength=pe,e.sign.secretKeyLength=ge,e.sign.seedLength=32,e.sign.signatureLength=he,e.hash=function(e){me(e);var t=new Uint8Array(64);return J(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return me(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===g(e,0,t,0,e.length)},e.setPRNG=function(e){n=e},(de="undefined"!=typeof self?self.crypto||self.msCrypto:null)&&de.getRandomValues?e.setPRNG(function(e,t){var n,r=new Uint8Array(t);for(n=0;n<t;n+=65536)de.getRandomValues(r.subarray(n,n+Math.min(t-n,65536)));for(n=0;n<t;n++)e[n]=r[n];we(r)}):void 0!==T&&(de=O)&&de.randomBytes&&e.setPRNG(function(e,t){var n,r=de.randomBytes(t);for(n=0;n<t;n++)e[n]=r[n];we(r)})}(e.exports?e.exports:self.nacl=self.nacl||{})}(I)),I.exports);const L=b(A);var N,W,P,U,D,j,B;e.CONNECT_EVENT_ERROR_CODES=void 0,(N=e.CONNECT_EVENT_ERROR_CODES||(e.CONNECT_EVENT_ERROR_CODES={}))[N.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",N[N.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",N[N.MANIFEST_NOT_FOUND_ERROR=2]="MANIFEST_NOT_FOUND_ERROR",N[N.MANIFEST_CONTENT_ERROR=3]="MANIFEST_CONTENT_ERROR",N[N.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",N[N.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",N[N.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",e.CONNECT_ITEM_ERROR_CODES=void 0,(W=e.CONNECT_ITEM_ERROR_CODES||(e.CONNECT_ITEM_ERROR_CODES={}))[W.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",W[W.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",e.SEND_TRANSACTION_ERROR_CODES=void 0,(P=e.SEND_TRANSACTION_ERROR_CODES||(e.SEND_TRANSACTION_ERROR_CODES={}))[P.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",P[P.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",P[P.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",P[P.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",P[P.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",e.SIGN_DATA_ERROR_CODES=void 0,(U=e.SIGN_DATA_ERROR_CODES||(e.SIGN_DATA_ERROR_CODES={}))[U.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",U[U.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",U[U.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",U[U.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",U[U.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",(j=D||(D={}))[j.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",j[j.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",j[j.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",j[j.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",e.CHAIN=void 0,(B=e.CHAIN||(e.CHAIN={})).MAINNET="-239",B.TESTNET="-3";const $={encode:function(e,t=!1){let n;return e instanceof Uint8Array?n=e:("string"!=typeof e&&(e=JSON.stringify(e)),n=R.decodeUTF8(e)),function(e,t){const n=R.encodeBase64(e);return t?encodeURIComponent(n):n}(n,t)},decode:function(e,t=!1){const n=function(e,t){return t&&(e=decodeURIComponent(e)),R.decodeBase64(e)}(e,t);return{toString:()=>R.encodeUTF8(n),toObject(){try{return JSON.parse(R.encodeUTF8(n))}catch(e){return null}},toUint8Array:()=>n}}};function q(e){let t="";return e.forEach(e=>{t+=("0"+(255&e).toString(16)).slice(-2)}),t}function K(e){if(e.length%2!=0)throw new Error(`Cannot convert ${e} to bytesArray`);const t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n/2]=parseInt(e.slice(n,n+2),16);return t}class F{constructor(e){this.nonceLength=24,this.keyPair=e?this.createKeypairFromString(e):this.createKeypair(),this.sessionId=q(this.keyPair.publicKey)}createKeypair(){return L.box.keyPair()}createKeypairFromString(e){return{publicKey:K(e.publicKey),secretKey:K(e.secretKey)}}createNonce(){return L.randomBytes(this.nonceLength)}encrypt(e,t){const n=(new TextEncoder).encode(e),r=this.createNonce();return function(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(r,L.box(n,r,t,this.keyPair.secretKey))}decrypt(e,t){const[n,r]=function(e,t){if(t>=e.length)throw new Error("Index is out of buffer");return[e.slice(0,t),e.slice(t)]}(e,this.nonceLength),o=L.box.open(r,n,t,this.keyPair.secretKey);if(!o)throw new Error(`Decryption error: \n message: ${e.toString()} \n sender pubkey: ${t.toString()} \n keypair pubkey: ${this.keyPair.publicKey.toString()} \n keypair secretkey: ${this.keyPair.secretKey.toString()}`);return(new TextDecoder).decode(o)}stringifyKeypair(){return{publicKey:q(this.keyPair.publicKey),secretKey:q(this.keyPair.secretKey)}}}function H(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function V(e,t,n,r){return new(n||(n=Promise))(function(t,o){function i(e){try{s(r.next(e))}catch(t){o(t)}}function a(e){try{s(r.throw(e))}catch(t){o(t)}}function s(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n(function(e){e(r)})).then(i,a)}s((r=r.apply(e,[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class z extends Error{get info(){return""}constructor(e,t){super(e,t),this.message=`${z.prefix} ${this.constructor.name}${this.info?": "+this.info:""}${e?"\n"+e:""}`,Object.setPrototypeOf(this,z.prototype)}}z.prefix="[TON_CONNECT_SDK_ERROR]";class Z extends z{get info(){return"Passed DappMetadata is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,Z.prototype)}}class G extends z{get info(){return"Passed `tonconnect-manifest.json` contains errors. Check format of your manifest. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...e){super(...e),Object.setPrototypeOf(this,G.prototype)}}class Y extends z{get info(){return"Manifest not found. Make sure you added `tonconnect-manifest.json` to the root of your app or passed correct manifestUrl. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...e){super(...e),Object.setPrototypeOf(this,Y.prototype)}}class Q extends z{get info(){return"Wallet connection called but wallet already connected. To avoid the error, disconnect the wallet before doing a new connection."}constructor(...e){super(...e),Object.setPrototypeOf(this,Q.prototype)}}class J extends z{get info(){return"Send transaction or other protocol methods called while wallet is not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,J.prototype)}}class X extends z{get info(){return"There is an attempt to connect to the injected wallet while it is not exists in the webpage."}constructor(...e){super(...e),Object.setPrototypeOf(this,X.prototype)}}class ee extends z{get info(){return"Wallet doesn't support requested feature method."}constructor(e,t){super(e,t),Object.setPrototypeOf(this,ee.prototype)}}class te extends z{get info(){return"Missing required features. You need to update your wallet."}constructor(e,t){super(e,t),Object.setPrototypeOf(this,te.prototype)}}class ne extends z{constructor(e,t){super(e,t),this.name="WalletWrongNetworkError",Object.setPrototypeOf(this,ne.prototype)}}class re extends z{get info(){return"User rejects the action in the wallet."}constructor(...e){super(...e),Object.setPrototypeOf(this,re.prototype)}}class oe extends z{get info(){return"Request to the wallet contains errors."}constructor(...e){super(...e),Object.setPrototypeOf(this,oe.prototype)}}class ie extends z{get info(){return"App tries to send rpc request to the injected wallet while not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,ie.prototype)}}class ae extends z{get info(){return"Storage was not specified in the `DappMetadata` and default `localStorage` was not detected in the environment."}constructor(...e){super(...e),Object.setPrototypeOf(this,ae.prototype)}}class se extends z{get info(){return"An error occurred while fetching the wallets list."}constructor(...e){super(...e),Object.setPrototypeOf(this,se.prototype)}}class le extends z{get info(){return"Passed address is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,le.prototype)}}class ce extends z{get info(){return"Passed hex is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,ce.prototype)}}class de extends z{constructor(...e){super(...e),Object.setPrototypeOf(this,de.prototype)}}const ue={[e.CONNECT_EVENT_ERROR_CODES.UNKNOWN_ERROR]:de,[e.CONNECT_EVENT_ERROR_CODES.USER_REJECTS_ERROR]:re,[e.CONNECT_EVENT_ERROR_CODES.BAD_REQUEST_ERROR]:oe,[e.CONNECT_EVENT_ERROR_CODES.UNKNOWN_APP_ERROR]:ie,[e.CONNECT_EVENT_ERROR_CODES.MANIFEST_NOT_FOUND_ERROR]:Y,[e.CONNECT_EVENT_ERROR_CODES.MANIFEST_CONTENT_ERROR]:G};const he=new class{parseError(e){let t=de;return e.code in ue&&(t=ue[e.code]||de),new t(e.message)}};class pe{isError(e){return"error"in e}}const ge={[e.SEND_TRANSACTION_ERROR_CODES.UNKNOWN_ERROR]:de,[e.SEND_TRANSACTION_ERROR_CODES.USER_REJECTS_ERROR]:re,[e.SEND_TRANSACTION_ERROR_CODES.BAD_REQUEST_ERROR]:oe,[e.SEND_TRANSACTION_ERROR_CODES.UNKNOWN_APP_ERROR]:ie};const fe=new class extends pe{convertToRpcRequest(e){return{method:"sendTransaction",params:[JSON.stringify(e)]}}parseAndThrowError(e){let t=de;throw e.error.code in ge&&(t=ge[e.error.code]||de),new t(e.error.message)}convertFromRpcResponse(e){return{boc:e.result}}},me={[e.SIGN_DATA_ERROR_CODES.UNKNOWN_ERROR]:de,[e.SIGN_DATA_ERROR_CODES.USER_REJECTS_ERROR]:re,[e.SIGN_DATA_ERROR_CODES.BAD_REQUEST_ERROR]:oe,[e.SIGN_DATA_ERROR_CODES.UNKNOWN_APP_ERROR]:ie};const we=new class extends pe{convertToRpcRequest(e){return{method:"signData",params:[JSON.stringify(e)]}}parseAndThrowError(e){let t=de;throw e.error.code in me&&(t=me[e.error.code]||de),new t(e.error.message)}convertFromRpcResponse(e){return e.result}};class ve{constructor(e,t){this.storage=e,this.storeKey="ton-connect-storage_http-bridge-gateway::"+t}storeLastEventId(e){return V(this,0,void 0,function*(){return this.storage.setItem(this.storeKey,e)})}removeLastEventId(){return V(this,0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getLastEventId(){return V(this,0,void 0,function*(){const e=yield this.storage.getItem(this.storeKey);return e||null})}}function ye(e,t){return function(e){return"/"===e.slice(-1)?e.slice(0,-1):e}(e)+"/"+t}function be(e){if(!e)return!1;const t=new URL(e);return"tg:"===t.protocol||"t.me"===t.hostname}function Ce(e){return!!e&&(e.includes("ton_addr")||e.includes("ton--5Faddr"))}function xe(e){return e.replaceAll(".","%2E").replaceAll("-","%2D").replaceAll("_","%5F").replaceAll("&","-").replaceAll("=","__").replaceAll("%","--")}function Se(e){return e.replaceAll("--","%").replaceAll("__","=").replaceAll("-","&").replaceAll("%5F","_").replaceAll("%2D","-").replaceAll("%2E",".")}function ke(e,t){return V(this,0,void 0,function*(){return new Promise((t,n)=>{setTimeout(()=>t(),e)})})}function _e(e){const t=new AbortController;return(null==e?void 0:e.aborted)?t.abort():null==e||e.addEventListener("abort",()=>t.abort(),{once:!0}),t}function Ee(e,t){return V(this,0,void 0,function*(){var n,r;const o=null!==(n=null==t?void 0:t.attempts)&&void 0!==n?n:10,i=null!==(r=null==t?void 0:t.delayMs)&&void 0!==r?r:200,a=_e(null==t?void 0:t.signal);if("function"!=typeof e)throw new z("Expected a function, got "+typeof e);let s,l=0;for(;l<o;){if(a.signal.aborted)throw new z(`Aborted after attempts ${l}`);try{return yield e({signal:a.signal})}catch(c){s=c,l++,l<o&&(yield ke(i))}}throw s})}function Re(...e){try{console.debug("[TON_CONNECT_SDK]",...e)}catch(t){}}function Te(...e){try{console.error("[TON_CONNECT_SDK]",...e)}catch(t){}}class Ie{get isReady(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)===EventSource.OPEN}get isClosed(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)!==EventSource.OPEN}get isConnecting(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)===EventSource.CONNECTING}constructor(e,t,n,r,o,i){this.bridgeUrl=t,this.sessionId=n,this.listener=r,this.errorsListener=o,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.defaultReconnectDelay=2e3,this.defaultResendDelay=5e3,this.eventSource=function(e,t){let n=null,r=null,o=null,i=null,a=null;const s=(s,...l)=>V(this,0,void 0,function*(){if(i=null!=s?s:null,null==a||a.abort(),a=_e(s),a.signal.aborted)throw new z("Resource creation was aborted");r=null!=l?l:null;const c=e(a.signal,...l);o=c;const d=yield c;if(o!==c&&d!==n)throw yield t(d),new z("Resource creation was aborted by a new resource creation");return n=d,n});return{create:s,current:()=>null!=n?n:null,dispose:()=>V(this,0,void 0,function*(){try{const r=n;n=null;const i=o;o=null;try{null==a||a.abort()}catch(e){}yield Promise.allSettled([r?t(r):Promise.resolve(),i?t(yield i):Promise.resolve()])}catch(e){}}),recreate:e=>V(this,0,void 0,function*(){const t=n,a=o,l=r,c=i;if(yield ke(e),t===n&&a===o&&l===r&&c===i)return yield s(i,...null!=l?l:[]);throw new z("Resource recreation was aborted by a new resource creation")})}}((e,t,n)=>V(this,0,void 0,function*(){const r={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:e,openingDeadlineMS:t,traceId:n};return yield function(e){return V(this,0,void 0,function*(){return yield function(e,t){const n=null==t?void 0:t.timeout,r=_e(null==t?void 0:t.signal);return new Promise((t,o)=>V(this,0,void 0,function*(){if(r.signal.aborted)return void o(new z("Operation aborted"));let i;void 0!==n&&(i=setTimeout(()=>{r.abort(),o(new z(`Timeout after ${n}ms`))},n)),r.signal.addEventListener("abort",()=>{clearTimeout(i),o(new z("Operation aborted"))},{once:!0});const a={timeout:n,abort:r.signal};yield e((...e)=>{clearTimeout(i),t(...e)},()=>{clearTimeout(i),o()},a)}))}((t,n,r)=>V(this,0,void 0,function*(){var o;const i=_e(r.signal).signal;if(i.aborted)return void n(new z("Bridge connection aborted"));const a=new URL(ye(e.bridgeUrl,e.ssePath));a.searchParams.append("client_id",e.sessionId);const s=yield e.bridgeGatewayStorage.getLastEventId();if(s&&a.searchParams.append("last_event_id",s),e.traceId&&a.searchParams.append("trace_id",e.traceId),i.aborted)return void n(new z("Bridge connection aborted"));const l=new EventSource(a.toString());l.onerror=r=>V(this,0,void 0,function*(){if(i.aborted)return l.close(),void n(new z("Bridge connection aborted"));try{const n=yield e.errorHandler(l,r);n!==l&&l.close(),n&&n!==l&&t(n)}catch(o){l.close(),n(o)}}),l.onopen=()=>{if(i.aborted)return l.close(),void n(new z("Bridge connection aborted"));t(l)},l.onmessage=t=>{if(i.aborted)return l.close(),void n(new z("Bridge connection aborted"));e.messageHandler(t)},null===(o=e.signal)||void 0===o||o.addEventListener("abort",()=>{l.close(),n(new z("Bridge connection aborted"))})}),{timeout:e.openingDeadlineMS,signal:e.signal})})}(r)}),e=>V(this,0,void 0,function*(){e.close()})),this.bridgeGatewayStorage=new ve(e,t),this.analytics=null==i?void 0:i.scoped({bridge_url:t,client_id:n})}registerSession(e){return V(this,0,void 0,function*(){var t,n,r;try{null===(t=this.analytics)||void 0===t||t.emitBridgeClientConnectStarted({trace_id:null==e?void 0:e.traceId});const r=Date.now();yield this.eventSource.create(null==e?void 0:e.signal,null==e?void 0:e.openingDeadlineMS,null==e?void 0:e.traceId);const o=Date.now()-r;null===(n=this.analytics)||void 0===n||n.emitBridgeClientConnectEstablished({bridge_connect_duration:o,trace_id:null==e?void 0:e.traceId})}catch(o){throw null===(r=this.analytics)||void 0===r||r.emitBridgeClientConnectError({trace_id:null==e?void 0:e.traceId,error_message:String(o)}),o}})}send(e,t,n,r){return V(this,0,void 0,function*(){var o;const i={};"number"==typeof r?i.ttl=r:(i.ttl=null==r?void 0:r.ttl,i.signal=null==r?void 0:r.signal,i.attempts=null==r?void 0:r.attempts,i.traceId=null==r?void 0:r.traceId);const a=new URL(ye(this.bridgeUrl,this.postPath));a.searchParams.append("client_id",this.sessionId),a.searchParams.append("to",t),a.searchParams.append("ttl",((null==i?void 0:i.ttl)||this.defaultTtl).toString()),a.searchParams.append("topic",n),(null==i?void 0:i.traceId)&&a.searchParams.append("trace_id",i.traceId);const s=$.encode(e);yield Ee(e=>V(this,0,void 0,function*(){const t=yield this.post(a,s,e.signal);if(!t.ok)throw new z(`Bridge send failed, status ${t.status}`)}),{attempts:null!==(o=null==i?void 0:i.attempts)&&void 0!==o?o:Number.MAX_SAFE_INTEGER,delayMs:this.defaultResendDelay,signal:null==i?void 0:i.signal})})}pause(){this.eventSource.dispose().catch(e=>Te(`Bridge pause failed, ${e}`))}unPause(){return V(this,0,void 0,function*(){yield this.eventSource.recreate(0)})}close(){return V(this,0,void 0,function*(){yield this.eventSource.dispose().catch(e=>Te(`Bridge close failed, ${e}`))})}setListener(e){this.listener=e}setErrorsListener(e){this.errorsListener=e}post(e,t,n){return V(this,0,void 0,function*(){const r=yield fetch(e,{method:"post",body:t,signal:n});if(!r.ok)throw new z(`Bridge send failed, status ${r.status}`);return r})}errorsHandler(e,t){return V(this,0,void 0,function*(){if(this.isConnecting)throw e.close(),new z("Bridge error, failed to connect");if(!this.isReady){if(this.isClosed)return e.close(),Re(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new z("Bridge error, unknown state")}try{this.errorsListener(t)}catch(n){}})}messagesHandler(e){return V(this,0,void 0,function*(){if(e.data===this.heartbeatMessage)return;if(yield this.bridgeGatewayStorage.storeLastEventId(e.lastEventId),this.isClosed)return;let t;try{const n=JSON.parse(e.data);t={message:n.message,from:n.from,traceId:n.trace_id}}catch(n){throw new z(`Bridge message parse failed, message ${e.data}`)}this.listener(t)})}}function Oe(e){return!("connectEvent"in e)}class Me{constructor(e){this.storage=e,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(e){return V(this,0,void 0,function*(){if("injected"===e.type||"wallet-connect"===e.type)return this.storage.setItem(this.storeKey,JSON.stringify(e));if(!Oe(e)){const t={sessionKeyPair:e.session.sessionCrypto.stringifyKeypair(),walletPublicKey:e.session.walletPublicKey,bridgeUrl:e.session.bridgeUrl},n={type:"http",connectEvent:e.connectEvent,session:t,lastWalletEventId:e.lastWalletEventId,nextRpcRequestId:e.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(n))}const t={type:"http",connectionSource:e.connectionSource,sessionCrypto:e.sessionCrypto.stringifyKeypair(),createdAt:Date.now()};return this.storage.setItem(this.storeKey,JSON.stringify(t))})}removeConnection(){return V(this,0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return V(this,0,void 0,function*(){const e=yield this.storage.getItem(this.storeKey);if(!e)return null;const t=JSON.parse(e);if("injected"===t.type||"wallet-connect"===t.type)return t;if(!function(e){return!("connectEvent"in e)}(t)){const e=new F(t.session.sessionKeyPair);return{type:"http",connectEvent:t.connectEvent,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId,session:{sessionCrypto:e,bridgeUrl:t.session.bridgeUrl,walletPublicKey:t.session.walletPublicKey}}}return function(e){var t;return Date.now()-(null!==(t=e.createdAt)&&void 0!==t?t:0)>3e5}(t)?(yield this.removeConnection(),null):{type:"http",sessionCrypto:new F(t.sessionCrypto),connectionSource:t.connectionSource}})}getHttpConnection(){return V(this,0,void 0,function*(){const e=yield this.getConnection();if(!e)throw new z("Trying to read HTTP connection source while nothing is stored");if("http"!==e.type)throw new z(`Trying to read HTTP connection source while ${e.type} connection is stored`);return e})}getHttpPendingConnection(){return V(this,0,void 0,function*(){const e=yield this.getConnection();if(!e)throw new z("Trying to read HTTP connection source while nothing is stored");if("http"!==e.type)throw new z(`Trying to read HTTP connection source while ${e.type} connection is stored`);if(!Oe(e))throw new z("Trying to read HTTP-pending connection while http connection is stored");return e})}getInjectedConnection(){return V(this,0,void 0,function*(){const e=yield this.getConnection();if(!e)throw new z("Trying to read Injected bridge connection source while nothing is stored");if("injected"!==(null==e?void 0:e.type))throw new z(`Trying to read Injected bridge connection source while ${e.type} connection is stored`);return e})}getWalletConnectConnection(){return V(this,0,void 0,function*(){const e=yield this.getConnection();if(!e)throw new z("Trying to read wallet connect bridge connection source while nothing is stored");if("wallet-connect"!==(null==e?void 0:e.type))throw new z(`Trying to read wallet connect bridge connection source while ${e.type} connection is stored`);return e})}storedConnectionType(){return V(this,0,void 0,function*(){const e=yield this.storage.getItem(this.storeKey);if(!e)return null;return JSON.parse(e).type})}storeLastWalletEventId(e){return V(this,0,void 0,function*(){const t=yield this.getConnection();if(t&&"http"===t.type&&!Oe(t))return t.lastWalletEventId=e,this.storeConnection(t)})}getLastWalletEventId(){return V(this,0,void 0,function*(){const e=yield this.getConnection();if(e&&"lastWalletEventId"in e)return e.lastWalletEventId})}increaseNextRpcRequestId(){return V(this,0,void 0,function*(){const e=yield this.getConnection();if(e&&"nextRpcRequestId"in e){const t=e.nextRpcRequestId||0;return e.nextRpcRequestId=t+1,this.storeConnection(e)}})}getNextRpcRequestId(){return V(this,0,void 0,function*(){const e=yield this.getConnection();return e&&"nextRpcRequestId"in e&&e.nextRpcRequestId||0})}}let Ae;const Le=new Uint8Array(16);function Ne(){if(!Ae){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ae=crypto.getRandomValues.bind(crypto)}return Ae(Le)}const We=[];for(let zp=0;zp<256;++zp)We.push((zp+256).toString(16).slice(1));const Pe={};function Ue(e,t,n){var r,o,i;let a;if(e)a=De(null!==(i=null!==(r=e.random)&&void 0!==r?r:null===(o=e.rng)||void 0===o?void 0:o.call(e))&&void 0!==i?i:Ne(),e.msecs,e.seq,t,n);else{const e=Date.now(),r=Ne();!function(e,t,n){var r,o;null!==(r=e.msecs)&&void 0!==r||(e.msecs=-1/0),null!==(o=e.seq)&&void 0!==o||(e.seq=0),t>e.msecs?(e.seq=n[6]<<23|n[7]<<16|n[8]<<8|n[9],e.msecs=t):(e.seq=e.seq+1|0,0===e.seq&&e.msecs++)}(Pe,e,r),a=De(r,Pe.msecs,Pe.seq,t,n)}return null!=t?t:function(e,t=0){return(We[e[t+0]]+We[e[t+1]]+We[e[t+2]]+We[e[t+3]]+"-"+We[e[t+4]]+We[e[t+5]]+"-"+We[e[t+6]]+We[e[t+7]]+"-"+We[e[t+8]]+We[e[t+9]]+"-"+We[e[t+10]]+We[e[t+11]]+We[e[t+12]]+We[e[t+13]]+We[e[t+14]]+We[e[t+15]]).toLowerCase()}(a)}function De(e,t,n,r,o=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(r){if(o<0||o+16>r.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`)}else r=new Uint8Array(16),o=0;return null!=t||(t=Date.now()),null!=n||(n=127*e[6]<<24|e[7]<<16|e[8]<<8|e[9]),r[o++]=t/1099511627776&255,r[o++]=t/4294967296&255,r[o++]=t/16777216&255,r[o++]=t/65536&255,r[o++]=t/256&255,r[o++]=255&t,r[o++]=112|n>>>28&15,r[o++]=n>>>20&255,r[o++]=128|n>>>14&63,r[o++]=n>>>6&255,r[o++]=n<<2&255|3&e[10],r[o++]=e[11],r[o++]=e[12],r[o++]=e[13],r[o++]=e[14],r[o++]=e[15],r}class je{static fromStorage(e,t){return V(this,0,void 0,function*(){const n=new Me(e),r=yield n.getHttpConnection();return Oe(r)?new je(e,r.connectionSource,t):new je(e,{bridgeUrl:r.session.bridgeUrl},t)})}constructor(e,t,n){var r;this.storage=e,this.walletConnectionSource=t,this.analyticsManager=n,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=12e3,this.defaultRetryTimeoutMS=2e3,this.connectionStorage=new Me(e),this.analytics=null===(r=this.analyticsManager)||void 0===r?void 0:r.scoped()}connect(e,t){var n,r;const o=null!==(n=null==t?void 0:t.traceId)&&void 0!==n?n:Ue(),i=_e(null==t?void 0:t.signal);null===(r=this.abortController)||void 0===r||r.abort(),this.abortController=i,this.closeGateways();const a=new F;this.session={sessionCrypto:a,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:a}).then(()=>V(this,0,void 0,function*(){i.signal.aborted||(yield Ee(e=>{var n;return this.openGateways(a,{openingDeadlineMS:null!==(n=null==t?void 0:t.openingDeadlineMS)&&void 0!==n?n:this.defaultOpeningDeadlineMS,signal:null==e?void 0:e.signal,traceId:o})},{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:i.signal}))}));const s="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(s,e,{traceId:o})}restoreConnection(e){return V(this,0,void 0,function*(){var t,n,r;const o=null!==(t=null==e?void 0:e.traceId)&&void 0!==t?t:Ue(),i=_e(null==e?void 0:e.signal);if(null===(n=this.abortController)||void 0===n||n.abort(),this.abortController=i,i.signal.aborted)return;this.closeGateways();const a=yield this.connectionStorage.getHttpConnection();if(!a)return;if(i.signal.aborted)return;const s=null!==(r=null==e?void 0:e.openingDeadlineMS)&&void 0!==r?r:this.defaultOpeningDeadlineMS;if(Oe(a))return this.session={sessionCrypto:a.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways(a.sessionCrypto,{openingDeadlineMS:s,signal:null==i?void 0:i.signal,traceId:null==e?void 0:e.traceId});if(Array.isArray(this.walletConnectionSource))throw new z("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=a.session,this.gateway&&(Re("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new Ie(this.storage,this.walletConnectionSource.bridgeUrl,a.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this),this.analyticsManager),!i.signal.aborted){this.listeners.forEach(e=>e(Object.assign(Object.assign({},a.connectEvent),{traceId:o})));try{yield Ee(e=>this.gateway.registerSession({openingDeadlineMS:s,signal:e.signal,traceId:o}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:i.signal})}catch(l){return void(yield this.disconnect({signal:i.signal,traceId:o}))}}})}sendRequest(e,t){var n;const r={};return"function"==typeof t?r.onRequestSent=t:(r.onRequestSent=null==t?void 0:t.onRequestSent,r.signal=null==t?void 0:t.signal,r.attempts=null==t?void 0:t.attempts,r.traceId=null==t?void 0:t.traceId),null!==(n=r.traceId)&&void 0!==n||(r.traceId=Ue()),new Promise((t,n)=>V(this,0,void 0,function*(){var o,i;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new z("Trying to send bridge request without session");const a=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),Re("Send http-bridge request:",Object.assign(Object.assign({},e),{id:a}));const s=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{id:a})),K(this.session.walletPublicKey));try{null===(o=this.analytics)||void 0===o||o.emitBridgeClientMessageSent({bridge_url:this.gateway.bridgeUrl,client_id:this.session.sessionCrypto.sessionId,wallet_id:this.session.walletPublicKey,message_id:a,request_type:e.method,trace_id:r.traceId}),yield this.gateway.send(s,this.session.walletPublicKey,e.method,{attempts:null==r?void 0:r.attempts,signal:null==r?void 0:r.signal,traceId:r.traceId}),null===(i=null==r?void 0:r.onRequestSent)||void 0===i||i.call(r),this.pendingRequests.set(a.toString(),t)}catch(l){n(l)}}))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(e){return V(this,0,void 0,function*(){var t;const n=null!==(t=null==e?void 0:e.traceId)&&void 0!==t?t:Ue();return new Promise(t=>V(this,0,void 0,function*(){let r=!1,o=null;const i=()=>{r||(r=!0,this.removeBridgeAndSession().then(t))};try{this.closeGateways();const t=_e(null==e?void 0:e.signal);o=setTimeout(()=>{t.abort()},this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:i,signal:t.signal,attempts:1,traceId:n})}catch(a){Re("Disconnect error:",a),r||this.removeBridgeAndSession().then(t)}finally{o&&clearTimeout(o),i()}}))})}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter(t=>t!==e)}pause(){var e;null===(e=this.gateway)||void 0===e||e.pause(),this.pendingGateways.forEach(e=>e.pause())}unPause(){return V(this,0,void 0,function*(){const e=this.pendingGateways.map(e=>e.unPause());this.gateway&&e.push(this.gateway.unPause()),yield Promise.all(e)})}pendingGatewaysListener(e,t,n){return V(this,0,void 0,function*(){if(this.pendingGateways.includes(e))return this.closeGateways({except:e}),this.gateway&&(Re("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=t,this.gateway=e,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(n);yield e.close()})}gatewayListener(e){return V(this,0,void 0,function*(){var t,n,r;const o=null!==(t=e.traceId)&&void 0!==t?t:Ue();let i;try{i=JSON.parse(this.session.sessionCrypto.decrypt($.decode(e.message).toUint8Array(),K(e.from)))}catch(l){throw null===(n=this.analytics)||void 0===n||n.emitBridgeClientMessageDecodeError({bridge_url:this.session.bridgeUrl,client_id:this.session.sessionCrypto.sessionId,wallet_id:e.from,error_message:String(l),trace_id:null==e?void 0:e.traceId}),l}Re("Wallet message received:",i);const a="event"in i?i.event:"";if(null===(r=this.analytics)||void 0===r||r.emitBridgeClientMessageReceived({bridge_url:this.session.bridgeUrl,client_id:this.session.sessionCrypto.sessionId,wallet_id:e.from,message_id:String(i.id),request_type:a,trace_id:null==e?void 0:e.traceId}),!("event"in i)){const e=i.id.toString(),t=this.pendingRequests.get(e);return t?(t(Object.assign(Object.assign({},i),{traceId:o})),void this.pendingRequests.delete(e)):void Re(`Response id ${e} doesn't match any request's id`)}if(void 0!==i.id){const e=yield this.connectionStorage.getLastWalletEventId();if(void 0!==e&&i.id<=e)return void Te(`Received event id (=${i.id}) must be greater than stored last wallet event id (=${e}) `);"connect"!==i.event&&(yield this.connectionStorage.storeLastWalletEventId(i.id))}const s=this.listeners;"connect"===i.event&&(yield this.updateSession(i,e.from)),"disconnect"===i.event&&(Re("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),s.forEach(e=>e(Object.assign(Object.assign({},i),{traceId:o})))})}gatewayErrorsListener(e){return V(this,0,void 0,function*(){throw new z(`Bridge error ${JSON.stringify(e)}`)})}updateSession(e,t){return V(this,0,void 0,function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:t});const n=e.payload.items.find(e=>"ton_addr"===e.name),r=Object.assign(Object.assign({},e),{payload:Object.assign(Object.assign({},e.payload),{items:[n]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:e.id,connectEvent:r,nextRpcRequestId:0})})}removeBridgeAndSession(){return V(this,0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}generateUniversalLink(e,t,n){return be(e)?this.generateTGUniversalLink(e,t,n):this.generateRegularUniversalLink(e,t,n)}generateRegularUniversalLink(e,t,n){const r=new URL(e);return r.searchParams.append("v",2..toString()),r.searchParams.append("id",this.session.sessionCrypto.sessionId),r.searchParams.append("trace_id",n.traceId),r.searchParams.append("r",JSON.stringify(t)),r.toString()}generateTGUniversalLink(e,t,n){const r="tonconnect-"+xe(this.generateRegularUniversalLink("about:blank",t,n).split("?")[1]),o=this.convertToDirectLink(e),i=new URL(o);return i.searchParams.append("startapp",r),i.toString()}convertToDirectLink(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}openGateways(e,t){return V(this,0,void 0,function*(){var n;const r=null!==(n=null==t?void 0:t.traceId)&&void 0!==n?n:Ue();return Array.isArray(this.walletConnectionSource)?(this.pendingGateways.map(e=>e.close().catch()),this.pendingGateways=this.walletConnectionSource.map(t=>{const n=new Ie(this.storage,t.bridgeUrl,e.sessionId,()=>{},()=>{},this.analyticsManager);return n.setListener(e=>this.pendingGatewaysListener(n,t.bridgeUrl,e)),n}),void(yield Promise.allSettled(this.pendingGateways.map(e=>Ee(n=>{var o;return this.pendingGateways.some(t=>t===e)?e.registerSession({openingDeadlineMS:null!==(o=null==t?void 0:t.openingDeadlineMS)&&void 0!==o?o:this.defaultOpeningDeadlineMS,signal:n.signal,traceId:r}):e.close()},{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:null==t?void 0:t.signal}))))):(this.gateway&&(Re("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new Ie(this.storage,this.walletConnectionSource.bridgeUrl,e.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this),this.analyticsManager),yield this.gateway.registerSession({openingDeadlineMS:null==t?void 0:t.openingDeadlineMS,signal:null==t?void 0:t.signal,traceId:r}))})}closeGateways(e){var t;null===(t=this.gateway)||void 0===t||t.close(),this.pendingGateways.filter(t=>t!==(null==e?void 0:e.except)).forEach(e=>e.close()),this.pendingGateways=[]}}function Be(e,t){return $e(e,[t])}function $e(e,t){return!(!e||"object"!=typeof e)&&t.every(t=>t in e)}let qe=class e{static getInstance(){return e.instance||(e.instance=new e),e.instance}constructor(){this.storage={}}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return null!==(t=this.storage[e])&&void 0!==t?t:null}key(e){var t;const n=Object.keys(this.storage);return e<0||e>=n.length?null:null!==(t=n[e])&&void 0!==t?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}};function Ke(){if("undefined"!=typeof window)return window}function Fe(){if("undefined"!=typeof document)return document}function He(){var e,t,n,r;const o=null===(t=null===(e=Ke())||void 0===e?void 0:e.location)||void 0===t?void 0:t.origin,i=null===(r=null===(n=Ke())||void 0===n?void 0:n.location)||void 0===r?void 0:r.pathname;return o&&i?o+i:""}function Ve(){if(function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}())return localStorage;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)throw new z("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return qe.getInstance()}class ze{static fromStorage(e,t){return V(this,0,void 0,function*(){const n=new Me(e),r=yield n.getInjectedConnection();return new ze(e,r.jsBridgeKey,t)})}static isWalletInjected(e){return ze.isWindowContainsWallet(this.window,e)}static isInsideWalletBrowser(e){return!!ze.isWindowContainsWallet(this.window,e)&&this.window[e].tonconnect.isWalletBrowser}static getCurrentlyInjectedWallets(){if(!this.window)return[];return function(){const e=Ke();if(!e)return[];try{return Object.entries(e)}catch(t){return[]}}().filter(([e,t])=>function(e){try{return!(!Be(e,"tonconnect")||!Be(e.tonconnect,"walletInfo"))&&$e(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch(t){return!1}}(t)).map(([e,t])=>({name:t.tonconnect.walletInfo.name,appName:t.tonconnect.walletInfo.app_name,aboutUrl:t.tonconnect.walletInfo.about_url,imageUrl:t.tonconnect.walletInfo.image,tondns:t.tonconnect.walletInfo.tondns,jsBridgeKey:e,injected:!0,embedded:t.tonconnect.isWalletBrowser,platforms:t.tonconnect.walletInfo.platforms,features:t.tonconnect.walletInfo.features}))}static isWindowContainsWallet(e,t){return!!e&&t in e&&"object"==typeof e[t]&&"tonconnect"in e[t]}constructor(e,t,n){this.injectedWalletKey=t,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const r=ze.window;if(!ze.isWindowContainsWallet(r,t))throw new X;this.connectionStorage=new Me(e),this.injectedWallet=r[t].tonconnect,n&&(this.analytics=n.scoped({bridge_key:t,wallet_app_name:this.injectedWallet.deviceInfo.appName,wallet_app_version:this.injectedWallet.deviceInfo.appVersion}))}connect(e,t){this._connect(2,e,t)}restoreConnection(e){return V(this,0,void 0,function*(){var t,n,r,o;const i=null!==(t=null==e?void 0:e.traceId)&&void 0!==t?t:Ue();try{Re("Injected Provider restoring connection..."),null===(n=this.analytics)||void 0===n||n.emitJsBridgeCall({js_bridge_method:"restoreConnection",trace_id:i});const e=yield this.injectedWallet.restoreConnection({traceId:i});null===(r=this.analytics)||void 0===r||r.emitJsBridgeResponse({js_bridge_method:"restoreConnection",trace_id:i}),Re("Injected Provider restoring connection response",e),"connect"===e.event?(this.makeSubscriptions({traceId:i}),this.listeners.forEach(t=>t(Object.assign(Object.assign({},e),{traceId:i})))):yield this.connectionStorage.removeConnection()}catch(a){null===(o=this.analytics)||void 0===o||o.emitJsBridgeError({js_bridge_method:"restoreConnection",error_message:String(a),trace_id:i}),yield this.connectionStorage.removeConnection(),console.error(a)}})}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(e){return V(this,0,void 0,function*(){var t;const n=null!==(t=null==e?void 0:e.traceId)&&void 0!==t?t:Ue();return new Promise(e=>{const t=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(e)};try{this.injectedWallet.disconnect(),t()}catch(r){Re(r),this.sendRequest({method:"disconnect",params:[]},{onRequestSent:t,traceId:n})}})})}closeAllListeners(){var e;this.listenSubscriptions=!1,this.listeners=[],null===(e=this.unsubscribeCallback)||void 0===e||e.call(this)}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter(t=>t!==e)}sendRequest(e,t){return V(this,0,void 0,function*(){var n,r,o;const i={};"function"==typeof t?(i.onRequestSent=t,i.traceId=Ue()):(i.onRequestSent=null==t?void 0:t.onRequestSent,i.signal=null==t?void 0:t.signal,i.attempts=null==t?void 0:t.attempts,i.traceId=null!==(n=null==t?void 0:t.traceId)&&void 0!==n?n:Ue());const a=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),Re("Send injected-bridge request:",Object.assign(Object.assign({},e),{id:a})),null===(r=this.analytics)||void 0===r||r.emitJsBridgeCall({js_bridge_method:"send"});const s=this.injectedWallet.send(Object.assign(Object.assign({},e),{id:a}),{traceId:i.traceId});return s.then(e=>{var t;null===(t=this.analytics)||void 0===t||t.emitJsBridgeResponse({js_bridge_method:"send"}),Re("Wallet message received:",e)}).catch(e=>{var t;null===(t=this.analytics)||void 0===t||t.emitJsBridgeError({js_bridge_method:"send",error_message:String(e)})}),null===(o=null==i?void 0:i.onRequestSent)||void 0===o||o.call(i),s})}_connect(e,t,n){return V(this,0,void 0,function*(){var r,o,i,a;const s=null!==(r=null==n?void 0:n.traceId)&&void 0!==r?r:Ue();try{Re(`Injected Provider connect request: protocolVersion: ${e}, message:`,t),null===(o=this.analytics)||void 0===o||o.emitJsBridgeCall({js_bridge_method:"connect",trace_id:s});const n=yield this.injectedWallet.connect(e,t,{traceId:s});null===(i=this.analytics)||void 0===i||i.emitJsBridgeResponse({js_bridge_method:"connect"}),Re("Injected Provider connect response:",n),"connect"===n.event&&(yield this.updateSession(),this.makeSubscriptions({traceId:s})),this.listeners.forEach(e=>e(Object.assign(Object.assign({},n),{traceId:s})))}catch(l){null===(a=this.analytics)||void 0===a||a.emitJsBridgeError({js_bridge_method:"connect",error_message:String(l),trace_id:s}),Re("Injected Provider connect error:",l);const e={event:"connect_error",payload:{code:0,message:null==l?void 0:l.toString()}};this.listeners.forEach(t=>t(Object.assign(Object.assign({},e),{traceId:s})))}})}makeSubscriptions(e){var t,n,r;this.listenSubscriptions=!0,null===(t=this.analytics)||void 0===t||t.emitJsBridgeCall({js_bridge_method:"listen",trace_id:e.traceId});try{this.unsubscribeCallback=this.injectedWallet.listen(e=>{var t;const n=null!==(t=e.traceId)&&void 0!==t?t:Ue();Re("Wallet message received:",e),this.listenSubscriptions&&this.listeners.forEach(t=>t(Object.assign(Object.assign({},e),{traceId:n}))),"disconnect"===e.event&&this.disconnect({traceId:n})}),null===(n=this.analytics)||void 0===n||n.emitJsBridgeResponse({js_bridge_method:"listen",trace_id:e.traceId})}catch(o){throw null===(r=this.analytics)||void 0===r||r.emitJsBridgeError({js_bridge_method:"listen",error_message:String(o),trace_id:e.traceId}),o}}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}ze.window=Ke();class Ze{constructor(){this.localStorage=Ve()}getItem(e){return V(this,0,void 0,function*(){return this.localStorage.getItem(e)})}removeItem(e){return V(this,0,void 0,function*(){this.localStorage.removeItem(e)})}setItem(e,t){return V(this,0,void 0,function*(){this.localStorage.setItem(e,t)})}}function Ge(e){return Qe(e)&&e.injected}function Ye(e){return Ge(e)&&e.embedded}function Qe(e){return"jsBridgeKey"in e}function Je(e){return"bridgeUrl"in e}const Xe=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://walletbot.me/tonconnect-bridge/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!0},{name:"SignData",types:["text","binary","cell"]}]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!0},{name:"SignData",types:["text","binary","cell"]}]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://static.mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",deepLink:"mytonwallet-tc://",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1},{name:"SignData",types:["text","binary","cell"]}]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!0},{name:"SignData",types:["text","binary","cell"]}]},{app_name:"bitgetTonWallet",name:"Bitget Wallet",image:"https://raw.githubusercontent.com/bitgetwallet/download/refs/heads/main/logo/png/bitget_wallet_logo_288_mini.png",about_url:"https://web3.bitget.com",deepLink:"bitkeep://",bridge:[{type:"js",key:"bitgetTonWallet"},{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","chrome"],universal_url:"https://bkcode.vip/ton-connect",features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"okxMiniWallet",name:"OKX Mini Wallet",image:"https://static.okx.com/cdn/assets/imgs/2411/8BE1A4A434D8F58A.png",about_url:"https://www.okx.com/web3",universal_url:"https://t.me/OKX_WALLET_BOT?attach=wallet",bridge:[{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"binanceWeb3TonWallet",name:"Binance Wallet",image:"https://public.bnbstatic.com/static/binance-w3w/ton-provider/binancew3w.png",about_url:"https://www.binance.com/en/web3wallet",deepLink:"bnc://app.binance.com/cedefi/ton-connect",bridge:[{type:"js",key:"binancew3w"},{type:"sse",url:"https://wallet.binance.com/tonbridge/bridge"}],platforms:["ios","android","macos","windows","linux"],universal_url:"https://app.binance.com/cedefi/ton-connect",features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"fintopio-tg",name:"Fintopio",image:"https://raw.githubusercontent.com/fintopio/ton-pub/refs/heads/main/logos/tonconnect-icon.png",about_url:"https://fintopio.com",universal_url:"https://t.me/fintopio?attach=wallet",bridge:[{type:"sse",url:"https://wallet-bridge.fintopio.com/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"okxTonWallet",name:"OKX Wallet",image:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png",about_url:"https://www.okx.com/web3",universal_url:"https://www.okx.com/download?appendQuery=true&deeplink=okx://web3/wallet/tonconnect",bridge:[{type:"js",key:"okxTonWallet"},{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["chrome","safari","firefox","ios","android"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"hot",name:"HOT",image:"https://raw.githubusercontent.com/hot-dao/media/main/logo.png",about_url:"https://hot-labs.org/",universal_url:"https://t.me/herewalletbot?attach=wallet",bridge:[{type:"sse",url:"https://sse-bridge.hot-labs.org"},{type:"js",key:"hotWallet"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"bybitTonWallet",name:"Bybit Wallet",image:"https://raw.githubusercontent.com/bybit-web3/bybit-web3.github.io/main/docs/images/bybit-logo.png",about_url:"https://www.bybit.com/web3",universal_url:"https://app.bybit.com/ton-connect",deepLink:"bybitapp://",bridge:[{type:"js",key:"bybitTonWallet"},{type:"sse",url:"https://api-node.bybit.com/spot/api/web3/bridge/ton/bridge"}],platforms:["ios","android","chrome"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"dewallet",name:"DeWallet",image:"https://raw.githubusercontent.com/delab-team/manifests-images/main/WalletAvatar.png",about_url:"https://delabwallet.com",universal_url:"https://t.me/dewallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.dewallet.pro/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"safepalwallet",name:"SafePal",image:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",about_url:"https://www.safepal.com",universal_url:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",bridge:[{type:"sse",url:"https://ton-bridge.safepal.com/tonbridge/v1/bridge"},{type:"js",key:"safepalwallet"}],platforms:["ios","android","chrome","firefox"],features:[{name:"SendTransaction",maxMessages:1,extraCurrencySupported:!1}]},{app_name:"GateWallet",name:"GateWallet",image:"https://img.gatedataimg.com/prd-ordinal-imgs/036f07bb8730716e/gateio-0925.png",about_url:"https://www.gate.io/",bridge:[{type:"js",key:"gatetonwallet"},{type:"sse",url:"https://dapp.gateio.services/tonbridge_api/bridge/v1"}],platforms:["ios","android"],universal_url:"https://gate.onelink.me/Hls0/web3?gate_web3_wallet_universal_type=ton_connect",features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"BitgetWeb3",name:"BitgetWeb3",image:"https://img.bitgetimg.com/image/third/1731638059795.png",about_url:"https://www.bitget.com",universal_url:"https://t.me/BitgetOfficialBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","windows","macos","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"],features:[{name:"SendTransaction",maxMessages:1,extraCurrencySupported:!1}]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"bitgetWalletLite",name:"Bitget Wallet Lite",image:"https://raw.githubusercontent.com/bitgetwallet/download/refs/heads/main/logo/png/bitget_wallet_lite_logo_288.png",about_url:"https://web3.bitget.com",universal_url:"https://t.me/BitgetWallet_TGBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1}]},{app_name:"tomoWallet",name:"Tomo Wallet",image:"https://pub.tomo.inc/logo.png",about_url:"https://www.tomo.inc/",universal_url:"https://t.me/tomowalletbot?attach=wallet",bridge:[{type:"sse",url:"https://go-bridge.tomo.inc/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"miraiapp-tg",name:"Mirai Mini App",image:"https://cdn.mirailabs.co/miraihub/miraiapp-tg-icon-288.png",about_url:"https://mirai.app",universal_url:"https://t.me/MiraiAppBot?attach=wallet",bridge:[{type:"sse",url:"https://bridge.mirai.app"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1},{name:"SignData",types:["text","binary","cell"]}]},{app_name:"Architec.ton",name:"Architec.ton",image:"https://raw.githubusercontent.com/Architec-Ton/wallet-tma/refs/heads/dev/public/images/arcwallet_logo.png",about_url:"https://architecton.tech",universal_url:"https://t.me/architec_ton_bot?attach=wallet",bridge:[{type:"sse",url:"https://tc.architecton.su/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1}]},{app_name:"tokenpocket",name:"TokenPocket",image:"https://hk.tpstatic.net/logo/tokenpocket.png",about_url:"https://www.tokenpocket.pro",universal_url:"https://tp-lab.tptool.pro/ton-connect/",bridge:[{type:"js",key:"tokenpocket"},{type:"sse",url:"https://ton-connect.mytokenpocket.vip/bridge"}],platforms:["ios","android"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"uxuyWallet",name:"UXUY Wallet",image:"https://chain-cdn.uxuy.com/logo/square_288.png",about_url:"https://docs.uxuy.com",universal_url:"https://t.me/UXUYbot?attach=wallet",bridge:[{type:"sse",url:"https://bridge.uxuy.me/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"tonkeeper-pro",name:"Tonkeeper Pro",image:"https://tonkeeper.com/assets/tonconnect-icon-pro.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com/pro",universal_url:"https://app.tonkeeper.com/pro/ton-connect",deepLink:"tonkeeper-pro-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"}],platforms:["ios","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!0},{name:"SignData",types:["text","binary","cell"]}]},{app_name:"nicegramWallet",name:"Nicegram Wallet",image:"https://static.nicegram.app/icon.png",about_url:"https://nicegram.app",universal_url:"https://nicegram.app/tc",deepLink:"nicegram-tc://",bridge:[{type:"sse",url:"https://tc.nicegram.app/bridge"},{type:"js",key:"nicegramWallet"}],platforms:["ios","android"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1}]},{app_name:"echoooTonWallet",name:"EchoooWallet",image:"https://cdn.echooo.xyz/front-end/source/images/logo/echooo-ton.png",about_url:"https://www.echooo.xyz",universal_url:"https://www.echooo.xyz/ton-connect",deepLink:"echooo://",bridge:[{type:"js",key:"echoooTonWallet"},{type:"sse",url:"https://ton-connect-bridge.echooo.link/bridge"}],platforms:["ios","android"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1}]},{app_name:"blitzwallet",name:"BLITZ wallet",image:"https://blitzwallet.cfd/wallet/public/logo.png",about_url:"https://blitzwallet.cfd",universal_url:"https://t.me/blitz_wallet_bot?attach=wallet",bridge:[{type:"sse",url:"https://blitzwallet.cfd/bridge/"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"koloWeb3Wallet",name:"Kolo",image:"https://raw.githubusercontent.com/onidev1/tc-assets/refs/heads/main/kolo_logo_288.png",about_url:"https://kolo.xyz",universal_url:"https://t.me/kolo?attach=wallet",bridge:[{type:"sse",url:"https://web3-bridge.kolo.in/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1}]},{app_name:"imToken",name:"imToken",image:"https://aws-v2-cdn.token.im/orbit/token-v2/icons/logo-ton-connect.png",about_url:"https://token.im",universal_url:"https://connect.token.im/link/ton-connect",deepLink:"imtokenv2://link/ton-connect",bridge:[{type:"sse",url:"https://connect.token.im/tonbridge"},{type:"js",key:"imToken"}],platforms:["ios","android"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1}]},{app_name:"cactuslink",name:"Cactus Link",image:"https://downloads.mycactus.com/288_cactus_link.png",about_url:"https://www.mycactus.com/defi-connector",bridge:[{type:"js",key:"cactuslink_ton"}],platforms:["chrome"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1},{name:"SignData",types:["text","binary"]}]},{app_name:"onekey",name:"OneKey",image:"https://uni.onekey-asset.com/static/logo/onekey-x288.png",about_url:"https://onekey.so",bridge:[{type:"js",key:"onekeyTonWallet"}],platforms:["chrome"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]}];let et=!1,tt=null;function nt(){return et}function rt(){if("undefined"==typeof window)return;if(document.getElementById("ton-connect-qa-banner"))return;const e=document.createElement("div");e.id="ton-connect-qa-banner",e.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n background: linear-gradient(90deg, #ff6b6b, #ff8e8e);\n color: white;\n padding: 12px 20px;\n text-align: center;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n font-weight: 600;\n font-size: 14px;\n z-index: 999999;\n box-shadow: 0 2px 8px rgba(0,0,0,0.2);\n animation: slideDown 0.3s ease-out;\n user-select: none;\n pointer-events: none;\n ",e.innerHTML="\n 🚨 QA Mode Active - Validation Disabled (Unsafe for Production)\n ";const t=document.createElement("style");t.textContent="\n @keyframes slideDown {\n from { transform: translateY(-100%); }\n to { transform: translateY(0); }\n }\n ",document.head.appendChild(t),document.body.appendChild(e),ot()}function ot(){if("undefined"==typeof window)return;if(document.getElementById("ton-connect-qa-mode-styles"))return;const e=document.createElement("style");e.id="ton-connect-qa-mode-styles",e.textContent="\n body.qa-mode-active {\n padding-top: 48px !important;\n }\n \n body.qa-mode-active header {\n margin-top: 48px !important;\n }\n \n body.qa-mode-active .qa-mode-control {\n top: 128px !important;\n }\n ",document.head.appendChild(e),document.body.classList.add("qa-mode-active")}class it{constructor(e){var t;this.walletsListDTOCache=null,this.walletsListDTOCacheCreationTimestamp=null,nt()?this.walletsListSource="https://raw.githubusercontent.com/ton-connect/wallets-list-staging/refs/heads/main/wallets-v2.json":this.walletsListSource=null!==(t=null==e?void 0:e.walletsListSource)&&void 0!==t?t:"https://config.ton.org/wallets-v2.json",this.cacheTTLMs=null==e?void 0:e.cacheTTLMs}getWallets(){return V(this,0,void 0,function*(){const[e,t]=yield Promise.all([this.fetchWalletsListDTO(),this.getCurrentlyInjectedWallets()]);return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(e),t)})}getEmbeddedWallet(){return V(this,0,void 0,function*(){const e=(yield this.getWallets()).filter(Ye);return 1===e.length?e[0]:null})}fetchWalletsListDTO(){return V(this,0,void 0,function*(){return this.cacheTTLMs&&this.walletsListDTOCacheCreationTimestamp&&Date.now()>this.walletsListDTOCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListDTOCache=null),this.walletsListDTOCache||(this.walletsListDTOCache=this.fetchWalletsListFromSource(),this.walletsListDTOCache.then(()=>{this.walletsListDTOCacheCreationTimestamp=Date.now()}).catch(()=>{this.walletsListDTOCache=null,this.walletsListDTOCacheCreationTimestamp=null})),this.walletsListDTOCache})}fetchWalletsListFromSource(){return V(this,0,void 0,function*(){let e=[];try{const t=yield fetch(this.walletsListSource);if(e=yield t.json(),!Array.isArray(e))throw new se("Wrong wallets list format, wallets list must be an array.");const n=e.filter(e=>!this.isCorrectWalletConfigDTO(e));n.length&&(Te(`Wallet(s) ${n.map(e=>(null==e?void 0:e.name)||"unknown").join(", ")} config format is wrong. They were removed from the wallets list.`),e=e.filter(e=>this.isCorrectWalletConfigDTO(e)))}catch(t){Te(t),e=Xe}return e})}getCurrentlyInjectedWallets(){if(!nt())return[];try{return ze.getCurrentlyInjectedWallets()}catch(e){return Te(e),[]}}walletConfigDTOListToWalletConfigList(e){return e.map(e=>{const t={name:e.name,appName:e.app_name,imageUrl:e.image,aboutUrl:e.about_url,tondns:e.tondns,platforms:e.platforms,features:e.features};return e.bridge.forEach(n=>{if("sse"===n.type&&(t.bridgeUrl=n.url,t.universalLink=e.universal_url,t.deepLink=e.deepLink),"js"===n.type){const e=n.key;t.jsBridgeKey=e,t.injected=ze.isWalletInjected(e),t.embedded=ze.isInsideWalletBrowser(e)}}),t})}mergeWalletsLists(e,t){return[...new Set(e.concat(t).map(e=>e.name)).values()].map(n=>{const r=e.find(e=>e.name===n),o=t.find(e=>e.name===n);return Object.assign(Object.assign({},r&&Object.assign({},r)),o&&Object.assign({},o))})}isCorrectWalletConfigDTO(e){if(!e||"object"!=typeof e)return!1;if(!("name"in e&&"image"in e&&"about_url"in e&&"platforms"in e&&"app_name"in e))return!1;if(!e.platforms||!Array.isArray(e.platforms)||!e.platforms.length)return!1;if(!("bridge"in e)||!Array.isArray(e.bridge)||!e.bridge.length)return!1;const t=e.bridge;if(t.some(e=>!e||"object"!=typeof e||!("type"in e)))return!1;const n=t.find(e=>"sse"===e.type);if(n&&("object"!=typeof n||!("url"in n)||!n.url||!e.universal_url))return!1;const r=t.find(e=>"js"===e.type);return!!(!r||"object"==typeof r&&"key"in r&&r.key)}}function at(e,t){const n=e.includes("SendTransaction"),r=lt(e,"SendTransaction"),o={minMessages:t.requiredMessagesNumber,extraCurrencyRequired:t.requireExtraCurrencies};if(!n&&!r)throw new ee("Wallet doesn't support SendTransaction feature.",{cause:{requiredFeature:{featureName:"SendTransaction",value:o}}});if(t.requireExtraCurrencies&&(!r||!r.extraCurrencySupported))throw new ee("Wallet is not able to handle such SendTransaction request. Extra currencies support is required.",{cause:{requiredFeature:{featureName:"SendTransaction",value:o}}});if(r&&void 0!==r.maxMessages){if(r.maxMessages<t.requiredMessagesNumber)throw new ee(`Wallet is not able to handle such SendTransaction request. Max support messages number is ${r.maxMessages}, but ${t.requiredMessagesNumber} is required.`,{cause:{requiredFeature:{featureName:"SendTransaction",value:o}}})}else!function(...e){try{console.warn("[TON_CONNECT_SDK]",...e)}catch(t){}}("Connected wallet didn't provide information about max allowed messages in the SendTransaction request. Request may be rejected by the wallet.")}function st(e,t){if("object"!=typeof t)return!0;const{sendTransaction:n,signData:r}=t;if(n){const t=lt(e,"SendTransaction");if(!t)return!1;if(!function(e,t){const n=void 0===t.minMessages||t.minMessages<=e.maxMessages,r=!t.extraCurrencyRequired||e.extraCurrencySupported;return!(!n||!r)}(t,n))return!1}if(r){const t=lt(e,"SignData");if(!t)return!1;if(!function(e,t){return t.types.every(t=>e.types.includes(t))}(t,r))return!1}return!0}function lt(e,t){return e.find(e=>e&&"object"==typeof e&&e.name===t)}function ct(){return{type:"request-version"}}function dt(e){return{type:"response-version",version:e}}function ut(e){return{ton_connect_sdk_lib:e.ton_connect_sdk_lib,ton_connect_ui_lib:e.ton_connect_ui_lib}}function ht(e,t,n){var r,o,i,a,s,l,c,d,u,h,p;const g=(null===(r=null==t?void 0:t.connectItems)||void 0===r?void 0:r.tonProof)&&"proof"in t.connectItems.tonProof?"ton_proof":"ton_addr";return{wallet_address:null!==(i=null===(o=null==t?void 0:t.account)||void 0===o?void 0:o.address)&&void 0!==i?i:null,wallet_state_init:null!==(a=null==t?void 0:t.account.walletStateInit)&&void 0!==a?a:null,wallet_type:null!==(s=null==t?void 0:t.device.appName)&&void 0!==s?s:null,wallet_version:null!==(l=null==t?void 0:t.device.appVersion)&&void 0!==l?l:null,auth_type:g,custom_data:Object.assign({client_id:null!==(c=null==n?void 0:n.clientId)&&void 0!==c?c:null,wallet_id:null!==(d=null==n?void 0:n.walletId)&&void 0!==d?d:null,chain_id:null!==(h=null===(u=null==t?void 0:t.account)||void 0===u?void 0:u.chain)&&void 0!==h?h:null,provider:null!==(p=null==t?void 0:t.provider)&&void 0!==p?p:null},ut(e))}}function pt(e,t){return{type:"connection-started",custom_data:ut(e),trace_id:null!=t?t:null}}function gt(e,t,n,r){return Object.assign({type:"connection-completed",is_success:!0,trace_id:null!=r?r:null},ht(e,t,n))}function ft(e,t,n,r,o){var i,a;return{type:"connection-error",is_success:!1,error_message:t,error_code:null!=n?n:null,trace_id:null!=o?o:null,custom_data:Object.assign({client_id:null!==(i=null==r?void 0:r.clientId)&&void 0!==i?i:null,wallet_id:null!==(a=null==r?void 0:r.walletId)&&void 0!==a?a:null},ut(e))}}function mt(e,t){return{type:"connection-restoring-started",custom_data:ut(e),trace_id:null!=t?t:null}}function wt(e,t,n,r){return Object.assign({type:"connection-restoring-completed",is_success:!0,trace_id:null!=r?r:null},ht(e,t,n))}function vt(e,t,n){return{type:"connection-restoring-error",is_success:!1,error_message:t,trace_id:null!=n?n:null,custom_data:ut(e)}}function yt(e,t){var n,r,o,i;return{valid_until:null!==(n=String(t.validUntil))&&void 0!==n?n:null,from:null!==(i=null!==(r=t.from)&&void 0!==r?r:null===(o=null==e?void 0:e.account)||void 0===o?void 0:o.address)&&void 0!==i?i:null,messages:t.messages.map(e=>{var t,n;return{address:null!==(t=e.address)&&void 0!==t?t:null,amount:null!==(n=e.amount)&&void 0!==n?n:null}})}}function bt(e,t,n,r,o){return Object.assign(Object.assign({type:"transaction-sent-for-signature",trace_id:null!=o?o:null},ht(e,t,r)),yt(t,n))}function Ct(e,t,n,r,o,i){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:r.boc,trace_id:null!=i?i:null},ht(e,t,o)),yt(t,n))}function xt(e,t,n,r,o,i,a){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:r,error_code:null!=o?o:null,trace_id:null!=a?a:null},ht(e,t,i)),function(e,t){var n,r,o,i;return{valid_until:null!==(n=String(t.validUntil))&&void 0!==n?n:null,from:null!==(i=null!==(r=t.from)&&void 0!==r?r:null===(o=null==e?void 0:e.account)||void 0===o?void 0:o.address)&&void 0!==i?i:null,messages:t.messages.map(e=>{var t,n,r,o;return{address:null!==(t=e.address)&&void 0!==t?t:null,amount:null!==(n=e.amount)&&void 0!==n?n:null,payload:null!==(r=e.payload)&&void 0!==r?r:null,state_init:null!==(o=e.stateInit)&&void 0!==o?o:null}})}}(t,n))}function St(e,t,n,r,o){return Object.assign({type:"sign-data-request-initiated",data:n,trace_id:null!=o?o:null},ht(e,t,r))}function kt(e,t,n,r,o,i){return Object.assign({type:"sign-data-request-completed",is_success:!0,data:n,signed_data:r,trace_id:null!=i?i:null},ht(e,t,o))}function _t(e,t,n,r,o,i,a){return Object.assign({type:"sign-data-request-failed",is_success:!1,data:n,error_message:r,error_code:null!=o?o:null,trace_id:null!=a?a:null},ht(e,t,i))}function Et(e,t,n,r,o){return Object.assign({type:"disconnection",scope:n,trace_id:null!=o?o:null},ht(e,t,r))}function Rt(e,t,n,r){return{type:"wallet-modal-opened",visible_wallets:t,client_id:null!=n?n:null,custom_data:e,trace_id:null!=r?r:null}}function Tt(e,t,n,r,o,i,a,s){var l;let c=i;return!c&&o&&(c=be(o)?"tg_link":"external_link"),{type:"selected-wallet",wallets_menu:r,visible_wallets:t,client_id:null!=a?a:null,custom_data:e,trace_id:null!=s?s:null,wallet_redirect_method:c,wallet_redirect_link:o||void 0,wallet_type:null!==(l=null==n?void 0:n.appName)&&void 0!==l?l:null}}class It{get version(){return ut({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}constructor(e){this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=null==e?void 0:e.eventDispatcher,this.tonConnectSdkVersion=e.tonConnectSdkVersion,this.init().catch()}init(){return V(this,0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch(e){}})}setRequestVersionHandler(){return V(this,0,void 0,function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",()=>V(this,0,void 0,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",dt(this.tonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return V(this,0,void 0,function*(){return new Promise((e,t)=>V(this,0,void 0,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",t=>{e(t.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",{type:"request-version"})}catch(n){t(n)}}))})}dispatchUserActionEvent(e){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${e.type}`,e).catch()}catch(t){}}trackConnectionStarted(...e){try{const t=pt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionCompleted(...e){try{const t=gt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionError(...e){try{const t=ft(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionRestoringStarted(...e){try{const t=mt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionRestoringCompleted(...e){try{const t=wt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionRestoringError(...e){try{const t=vt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackDisconnection(...e){try{const t=Et(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackTransactionSentForSignature(...e){try{const t=bt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackTransactionSigned(...e){try{const t=Ct(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackTransactionSigningFailed(...e){try{const t=xt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackDataSentForSignature(...e){try{const t=St(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackDataSigned(...e){try{const t=kt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackDataSigningFailed(...e){try{const t=_t(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}}const Ot="3.4.0-beta.2";function Mt(e,t=!1){const{wc:n,hex:r}=Nt(e);let o=81;t&&(o|=128);const i=new Int8Array(34);i[0]=o,i[1]=n,i.set(r,2);const a=new Uint8Array(36);return a.set(i),a.set(Wt(i),34),$.encode(a).replace(/\+/g,"-").replace(/\//g,"_")}function At(e){try{return Lt(e),!0}catch(t){return!1}}function Lt(e){const t=e.replace(/-/g,"+").replace(/_/g,"/");let n;try{n=$.decode(t).toUint8Array()}catch(u){throw new le(`Invalid base64 encoding in address: ${e}`)}if(36!==n.length)throw new le(`Invalid address length: ${e}`);const r=n.slice(0,34),o=n.slice(34,36),i=Wt(r);if(!o.every((e,t)=>e===i[t]))throw new le(`Invalid checksum in address: ${e}`);let a=r[0],s=!1,l=!1;if(128&a&&(s=!0,a^=128),17!==a&&81!==a)throw new le(`Unknown address tag: ${a}`);l=17===a;let c=null;c=255===r[1]?-1:r[1];const d=r.slice(2);if(0!==c&&-1!==c)throw new le(`Invalid workchain: ${c}`);return{wc:c,hex:Array.from(d).map(e=>e.toString(16).padStart(2,"0")).join(""),testOnly:s,isBounceable:l}}function Nt(e){if(!e.includes(":"))throw new le(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(2!==t.length)throw new le(`Wrong address ${e}. Address must include ":" only once.`);const n=parseInt(t[0]);if(0!==n&&-1!==n)throw new le(`Wrong address ${e}. WC must be eq 0 or -1, but ${n} received.`);const r=t[1];if(64!==(null==r?void 0:r.length))throw new le(`Wrong address ${e}. Hex part must be 64bytes length, but ${null==r?void 0:r.length} received.`);return{wc:n,hex:Ut(r)}}function Wt(e){let t=0;const n=new Uint8Array(e.length+2);n.set(e);for(let r of n){let e=128;for(;e>0;)t<<=1,r&e&&(t+=1),e>>=1,t>65535&&(t&=65535,t^=4129)}return new Uint8Array([Math.floor(t/256),t%256])}const Pt={};for(let zp=0;zp<=255;zp++){let e=zp.toString(16);e.length<2&&(e="0"+e),Pt[e]=zp}function Ut(e){const t=(e=e.toLowerCase()).length;if(t%2!=0)throw new ce("Hex string must have length a multiple of 2: "+e);const n=t/2,r=new Uint8Array(n);for(let o=0;o<n;o++){const t=2*o,n=e.substring(t,t+2);if(!Pt.hasOwnProperty(n))throw new ce("Invalid hex character: "+n);r[o]=Pt[n]}return r}const Dt=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,jt=/^[A-Za-z0-9\-_]+$/,Bt=/^-?\d+$/,$t=/^\d+$/;function qt(e){return"number"==typeof e&&!isNaN(e)}function Kt(e){return"string"==typeof e&&e.length>0}function Ft(e){return Kt(e)&&(function(e){try{return Nt(e),!0}catch(t){return!1}}(e)||At(e))}function Ht(e){return Kt(e)&&/^-?\d+$/.test(e)}function Vt(e){return"string"==typeof e&&(Dt.test(e)||jt.test(e))&&e.startsWith("te6cc")}function zt(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Zt(e,t){return Object.keys(e).some(e=>!t.includes(e))}function Gt(e){if(!zt(e))return"Request must be an object";if(Zt(e,["validUntil","network","from","messages"]))return"Request contains extra properties";if(e.validUntil){if(!qt(e.validUntil))return"Incorrect 'validUntil'";const t=Math.floor(Date.now()/1e3),n=t+300;e.validUntil>n&&console.warn(`validUntil (${e.validUntil}) is more than 5 minutes from now (${t})`)}if(void 0!==e.network&&!Ht(e.network))return"Invalid 'network' format";if(void 0!==e.from&&!Ft(e.from))return"Invalid 'from' address format";if(t=e.messages,!Array.isArray(t)||0===e.messages.length)return"'messages' is required";var t;for(let n=0;n<e.messages.length;n++){const t=Yt(e.messages[n],n);if(t)return t}return null}function Yt(e,t){if(!zt(e))return`Message at index ${t} must be an object`;if(Zt(e,["address","amount","stateInit","payload","extraCurrency"]))return`Message at index ${t} contains extra properties`;if(!Kt(e.address))return`'address' is required in message at index ${t}`;if(!At(e.address))return`Wrong 'address' format in message at index ${t}`;if(!Kt(e.amount))return`'amount' is required in message at index ${t}`;if(!/^[0-9]+$/.test(e.amount))return`Incorrect 'amount' in message at index ${t}`;if(!(void 0===e.stateInit||Kt(e.stateInit)&&Vt(e.stateInit)))return`Invalid 'stateInit' in message at index ${t}`;if(!(void 0===e.payload||Kt(e.payload)&&Vt(e.payload)))return`Invalid 'payload' in message at index ${t}`;if(void 0!==e.extraCurrency){if(!zt(e.extraCurrency))return`Invalid 'extraCurrency' in message at index ${t}`;for(const[n,r]of Object.entries(e.extraCurrency))if(!Bt.test(n)||"string"!=typeof r||!$t.test(r))return`Invalid 'extraCurrency' format in message at index ${t}`}return null}function Qt(e){if(!zt(e))return"Request must be an object";if(Zt(e,["tonProof"]))return"Request contains extra properties";if(void 0!==e.tonProof){if("string"!=typeof e.tonProof)return"Invalid 'tonProof'";const t=e.tonProof;if(0===t.length)return"Empty 'tonProof' payload";const n=function(){try{return"undefined"!=typeof window&&window.location?window.location.hostname:null}catch(e){return null}}();if(!n)return null;const r=(new TextEncoder).encode(n).length;if(r>128)return"Current domain exceeds 128 bytes limit";const o=(new TextEncoder).encode(t).length;if(o>128)return"'tonProof' payload exceeds 128 bytes limit";if(r+o>222)return"'tonProof' domain + payload exceeds 222 bytes limit"}return null}function Jt(e){if(!zt(e))return"Payload must be an object";if(!Kt(e.type))return"'type' is required";switch(e.type){case"text":return function(e){if(Zt(e,["type","text","network","from"]))return"Text payload contains extra properties";if(!Kt(e.text))return"'text' is required";if(void 0!==e.network&&!Ht(e.network))return"Invalid 'network' format";if(void 0!==e.from&&!Ft(e.from))return"Invalid 'from'";return null}(e);case"binary":return function(e){if(Zt(e,["type","bytes","network","from"]))return"Binary payload contains extra properties";if(!Kt(e.bytes))return"'bytes' is required";if(void 0!==e.network&&!Ht(e.network))return"Invalid 'network' format";if(void 0!==e.from&&!Ft(e.from))return"Invalid 'from'";return null}(e);case"cell":return function(e){if(Zt(e,["type","schema","cell","network","from"]))return"Cell payload contains extra properties";if(!Kt(e.schema))return"'schema' is required";if(!Kt(e.cell))return"'cell' is required";if(!Vt(e.cell))return"Invalid 'cell' format (must be valid base64)";if(void 0!==e.network&&!Ht(e.network))return"Invalid 'network' format";if(void 0!==e.from&&!Ft(e.from))return"Invalid 'from'";return null}(e);default:return"Invalid 'type' value"}}function Xt(e){if("string"!=typeof e)return;const t=e.length+(4-e.length%4)%4;return e.replace(/-/g,"+").replace(/_/g,"/").padEnd(t,"=")}class en{constructor(e={}){var t,n,r,o,i;this.events=[],this.timeoutId=null,this.isProcessing=!1,this.backoff=1,this.shouldSend=!0,this.batchTimeoutMs=null!==(t=e.batchTimeoutMs)&&void 0!==t?t:2e3,this.currentBatchTimeoutMs=this.batchTimeoutMs,this.maxBatchSize=null!==(n=e.maxBatchSize)&&void 0!==n?n:100,this.analyticsUrl=null!==(r=e.analyticsUrl)&&void 0!==r?r:"https://analytics.ton.org/events",this.enabled=null===(o=e.enabled)||void 0===o||o,this.baseEvent={subsystem:"dapp-sdk",version:Ot,client_environment:null===(i=e.environment)||void 0===i?void 0:i.getClientEnvironment()},this.addWindowFocusAndBlurSubscriptions()}scoped(e){return new Proxy(this,{get(t,n){const r=n.toString();if(r.startsWith("emit")){const n=r.replace("emit",""),o=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return function(n){const r=Object.fromEntries(Object.entries(null!=e?e:{}).map(([e,t])=>[e,"function"==typeof t?t():t]));return t.emit(Object.assign(Object.assign({event_name:o},r),n))}}return t[n]}})}emit(e){var t;if(!this.enabled)return;const n=null!==(t=e.trace_id)&&void 0!==t?t:Ue(),r=Object.assign(Object.assign(Object.assign({},this.baseEvent),e),{event_id:Ue(),client_timestamp:Math.floor(Date.now()/1e3),trace_id:n});nt()&&Re(r),this.events.push(r),this.events.length>=this.maxBatchSize?this.flush():this.startTimeout()}startTimeout(){this.timeoutId||this.isProcessing||(this.timeoutId=setTimeout(()=>{this.flush()},this.currentBatchTimeoutMs))}flush(){return V(this,0,void 0,function*(){if(this.isProcessing||0===this.events.length||!this.shouldSend)return;this.clearTimeout(),this.isProcessing=!0;const e=this.extractEventsToSend();try{yield this.processEventsBatch(e),Re("Analytics events sent successfully")}catch(t){this.restoreEvents(e),Te("Failed to send analytics events:",t)}finally{this.isProcessing=!1,this.scheduleNextFlushIfNeeded()}})}clearTimeout(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}extractEventsToSend(){const e=this.events.slice(0,this.maxBatchSize);return this.events=this.events.slice(this.maxBatchSize),e}processEventsBatch(e){return V(this,0,void 0,function*(){Re("Sending analytics events...",e.length);try{const t=yield this.sendEvents(e);this.handleResponse(t)}catch(t){this.handleUnknownError(t)}})}handleResponse(e){const{status:t,statusText:n}=e;this.isTooManyRequests(t)?this.handleTooManyRequests(t,n):this.isClientError(t)?this.handleClientError(t,n):this.isServerError(t)&&this.handleUnknownError({status:t,statusText:n})}restoreEvents(e){this.events.unshift(...e)}scheduleNextFlushIfNeeded(){this.events.length>0&&this.startTimeout()}sendEvents(e){return V(this,0,void 0,function*(){return yield fetch(this.analyticsUrl,{method:"POST",headers:{"Content-Type":"application/json","X-Client-Timestamp":Math.floor(Date.now()/1e3).toString()},body:JSON.stringify(e)})})}isClientError(e){return e>=en.HTTP_STATUS.CLIENT_ERROR_START&&e<en.HTTP_STATUS.SERVER_ERROR_START}isServerError(e){return e>=en.HTTP_STATUS.SERVER_ERROR_START}isTooManyRequests(e){return e===en.HTTP_STATUS.TOO_MANY_REQUESTS}handleClientError(e,t){Te("Failed to send analytics events:",new z(`Analytics API error: ${e} ${t}`))}handleUnknownError(e){if(this.backoff<en.MAX_BACKOFF_ATTEMPTS)throw this.backoff++,this.currentBatchTimeoutMs*=en.BACKOFF_MULTIPLIER,new z(`Unknown analytics API error: ${e}`);return this.currentBatchTimeoutMs=this.batchTimeoutMs,void(this.backoff=1)}handleTooManyRequests(e,t){throw new z(`Analytics API error: ${e} ${t}`)}addWindowFocusAndBlurSubscriptions(){const e=Fe();if(e)try{e.addEventListener("visibilitychange",()=>{e.hidden?(this.clearTimeout(),this.shouldSend=!1):(this.shouldSend=!0,this.scheduleNextFlushIfNeeded())})}catch(t){Te("Cannot subscribe to the document.visibilitychange: ",t)}}setEnabled(e){this.enabled=e}isEnabled(){return this.enabled}getPendingEventsCount(){return this.events.length}}en.HTTP_STATUS={TOO_MANY_REQUESTS:429,CLIENT_ERROR_START:400,SERVER_ERROR_START:500},en.MAX_BACKOFF_ATTEMPTS=5,en.BACKOFF_MULTIPLIER=2;class tn{constructor(){this.window=Ke()}dispatchEvent(e,t){return V(this,0,void 0,function*(){var n;const r=new CustomEvent(e,{detail:t});null===(n=this.window)||void 0===n||n.dispatchEvent(r)})}addEventListener(e,t,n){return V(this,0,void 0,function*(){var r;return null===(r=this.window)||void 0===r||r.addEventListener(e,t,n),()=>{var n;return null===(n=this.window)||void 0===n?void 0:n.removeEventListener(e,t)}})}}function nn(e){return{"@tonconnect/sdk":e.ton_connect_sdk_lib||"","@tonconnect/ui":e.ton_connect_ui_lib||""}}function rn(e){var t,n,r,o,i,a,s,l;return{versions:nn(e.custom_data),network_id:null!==(t=e.custom_data.chain_id)&&void 0!==t?t:"",client_id:null!==(n=e.custom_data.client_id)&&void 0!==n?n:"",wallet_id:null!==(r=e.custom_data.wallet_id)&&void 0!==r?r:"",wallet_address:null!==(o=e.wallet_address)&&void 0!==o?o:"",wallet_app_name:null!==(i=e.wallet_type)&&void 0!==i?i:"",wallet_app_version:null!==(a=e.wallet_version)&&void 0!==a?a:"",wallet_state_init:null!==(s=e.wallet_state_init)&&void 0!==s?s:"",trace_id:null!==(l=e.trace_id)&&void 0!==l?l:void 0}}class on{getClientEnvironment(){return""}getBrowser(){return""}getLocale(){return""}getPlatform(){return""}getTelegramUser(){}}const an={};function sn(){return void 0!==an.UniversalConnectorCls&&void 0!==an.walletConnectOptions}const ln="0";class cn{constructor(e){this.type="injected",this.listeners=[],this.connector=void 0,this.connectionStorage=new Me(e);const{projectId:t,metadata:n}=function(){if(void 0===an.walletConnectOptions)throw new z("Wallet Connect is not initialized.");return an.walletConnectOptions}();this.config={networks:[{namespace:"ton",chains:[{id:-239,chainNamespace:"ton",caipNetworkId:"ton:-239",name:"TON",nativeCurrency:{name:"TON",symbol:"TON",decimals:9},rpcUrls:{default:{http:[]}}},{id:-3,chainNamespace:"ton",caipNetworkId:"ton:-3",name:"TON",nativeCurrency:{name:"TON",symbol:"TON",decimals:9},rpcUrls:{default:{http:[]}}}],methods:["ton_sendMessage","ton_signData"],events:[]}],projectId:t,metadata:n}}static fromStorage(e){return V(this,0,void 0,function*(){return new cn(e)})}initialize(){return V(this,0,void 0,function*(){return this.connector||(this.connector=yield function(){if(void 0===an.UniversalConnectorCls)throw new z("Wallet Connect is not initialized.");return an.UniversalConnectorCls}().init(this.config)),this.connector})}connect(e,t){var n,r;const o=null!==(n=null==t?void 0:t.traceId)&&void 0!==n?n:Ue(),i=_e(null==t?void 0:t.signal);null===(r=this.abortController)||void 0===r||r.abort(),this.abortController=i,this._connect(e,{traceId:o,signal:i.signal,abortController:i}).catch(e=>Re("WalletConnect connect unexpected error",e))}_connect(t,n){return V(this,0,void 0,function*(){var r,o;const i=yield this.initialize();if(null===(r=n.signal)||void 0===r?void 0:r.aborted)return Re("WalletConnect connect aborted before start"),void this.clearAbortController(n.abortController);const a=t.items.find(e=>"ton_proof"===e.name),s=a?[{domain:new URL(this.config.metadata.url).hostname,chains:["ton:-239"],nonce:"",uri:"ton_proof",ttl:0,statement:a.payload}]:void 0;Re("Connecting through this.connector.connect");try{yield i.connect({authentication:s})}catch(l){if(null===(o=n.signal)||void 0===o?void 0:o.aborted)return Re("WalletConnect connect aborted via signal"),void this.clearAbortController(n.abortController);Re("WalletConnect connect error",l);const t={id:0,event:"connect_error",traceId:n.traceId,payload:{code:e.CONNECT_EVENT_ERROR_CODES.USER_REJECTS_ERROR,message:"User declined the connection"}};return Re("WalletConnect connect response:",t),this.emit(t),void this.clearAbortController(n.abortController)}Re("Connected through this.connector.connect");try{yield this.onConnect(i,Object.assign(Object.assign({},n),{includeTonProof:!0}))}catch(l){Re("WalletConnect onConnect error",l),yield this.disconnect({traceId:n.traceId,signal:n.signal})}finally{this.clearAbortController(n.abortController)}})}restoreConnection(e){return V(this,0,void 0,function*(){var t,n;const r=null!==(t=null==e?void 0:e.traceId)&&void 0!==t?t:Ue(),o=_e(null==e?void 0:e.signal);if(null===(n=this.abortController)||void 0===n||n.abort(),this.abortController=o,!o.signal.aborted)try{Re("Restoring WalletConnect connection...");if(!(yield this.connectionStorage.getWalletConnectConnection())||o.signal.aborted)return;const e=yield this.initialize();if(o.signal.aborted)return;yield this.onConnect(e,{includeTonProof:!1,traceId:r,signal:o.signal}),Re("WalletConnect successfully restored.")}catch(i){Re("WalletConnect restore error",i),yield this.disconnect({traceId:r,signal:o.signal})}finally{this.clearAbortController(o)}})}closeConnection(){var e;null===(e=this.abortController)||void 0===e||e.abort(),this.abortController=void 0,this.disconnect()}disconnect(e){return V(this,0,void 0,function*(){var t,n;const r=_e(null==e?void 0:e.signal);if(null===(t=this.abortController)||void 0===t||t.abort(),this.abortController=r,!r.signal.aborted)try{if(yield this.connectionStorage.removeConnection(),r.signal.aborted)return;yield null===(n=this.connector)||void 0===n?void 0:n.disconnect()}catch(o){Re("WalletConnect disconnect error",o)}finally{this.clearAbortController(r)}})}sendRequest(e,t){return V(this,0,void 0,function*(){var n,r,o,i;if(!this.connector)throw new z("Wallet Connect not initialized");const a={};"function"==typeof t?a.onRequestSent=t:(a.onRequestSent=null==t?void 0:t.onRequestSent,a.signal=null==t?void 0:t.signal,a.attempts=null==t?void 0:t.attempts,a.traceId=null==t?void 0:t.traceId),null!==(n=a.traceId)&&void 0!==n||(a.traceId=Ue());try{if(null===(r=a.signal)||void 0===r?void 0:r.aborted)throw new z("WalletConnect request aborted");if(Re("Send wallet-connect request:",Object.assign(Object.assign({},e),{id:ln})),"sendTransaction"===e.method){const t=JSON.parse(e.params[0]),{network:n}=t,r=H(t,["network"]),i=this.connector.request({method:"ton_sendMessage",params:r},`ton:${n}`);null===(o=null==a?void 0:a.onRequestSent)||void 0===o||o.call(a);const s=yield i;return Re("Wallet message received:",{result:s,id:ln}),{result:s,id:ln,traceId:a.traceId}}if("signData"===e.method){const t=JSON.parse(e.params[0]),{network:n}=t,r=H(t,["network"]),o=this.connector.request({method:"ton_signData",params:r},`ton:${n}`);null===(i=null==a?void 0:a.onRequestSent)||void 0===i||i.call(a);const s=yield o;return Re("Wallet message received:",{result:s,id:ln}),{result:s,traceId:a.traceId,id:ln}}if("disconnect"===e.method)return{id:ln,traceId:a.traceId}}catch(s){Re("WalletConnect request error",s,s.stack);const e=yield this.handleWalletConnectError(s,{traceId:a.traceId});return Re("Wallet message received:",e),e}return{id:ln,error:{code:D.UNKNOWN_ERROR,message:"Not implemented."},traceId:a.traceId}})}handleWalletConnectError(t,n){return V(this,0,void 0,function*(){if("object"==typeof t&&null!==t){const r=String("message"in t?t.message:"msg"in t?t.msg:t);return r.toLowerCase().includes("reject")?{id:ln,traceId:n.traceId,error:{code:e.SEND_TRANSACTION_ERROR_CODES.USER_REJECTS_ERROR,message:r}}:r.toLowerCase().includes("tonvalidationerror")?{id:ln,traceId:n.traceId,error:{code:e.SEND_TRANSACTION_ERROR_CODES.BAD_REQUEST_ERROR,message:r}}:{id:ln,traceId:n.traceId,error:{code:e.SEND_TRANSACTION_ERROR_CODES.UNKNOWN_ERROR,message:r}}}return{id:ln,traceId:n.traceId,error:{code:e.SEND_TRANSACTION_ERROR_CODES.UNKNOWN_ERROR,message:String(t)}}})}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter(t=>t!==e)}buildTonProof(e){var t,n,r;const o=null===(t=e.provider.session.authentication)||void 0===t?void 0:t[0],i=null===(n=null==o?void 0:o.p)||void 0===n?void 0:n.iat,a=null===(r=null==o?void 0:o.p)||void 0===r?void 0:r.statement;if(!i||!a)return;const s=o.p.domain;return{name:"ton_proof",proof:{timestamp:Math.floor(new Date(i).getTime()/1e3),domain:{lengthBytes:s.length,value:s},payload:a,signature:o.s.s}}}onConnect(t,n){return V(this,0,void 0,function*(){var r,o,i,a;if(null===(r=n.signal)||void 0===r?void 0:r.aborted)return void Re("WalletConnect onConnect aborted");const s=t.provider.session,l=s.namespaces.ton;if(!(null===(o=null==l?void 0:l.accounts)||void 0===o?void 0:o[0]))return void(yield this.disconnectWithError({traceId:n.traceId,code:e.CONNECT_EVENT_ERROR_CODES.BAD_REQUEST_ERROR,message:"Connection error. No TON accounts connected."}));const c=l.accounts[0],[,d,u]=c.split(":",3),h=null===(i=s.sessionProperties)||void 0===i?void 0:i.ton_getPublicKey;if(!h)return void(yield this.disconnectWithError({traceId:n.traceId,code:e.CONNECT_EVENT_ERROR_CODES.BAD_REQUEST_ERROR,message:"Connection error. No sessionProperties.ton_getPublicKey provided."}));const p=null===(a=s.sessionProperties)||void 0===a?void 0:a.ton_getStateInit;if(!p)return void(yield this.disconnectWithError({traceId:n.traceId,code:e.CONNECT_EVENT_ERROR_CODES.BAD_REQUEST_ERROR,message:"Connection error. No sessionProperties.ton_getStateInit provided."}));t.provider.once("session_delete",()=>V(this,0,void 0,function*(){try{yield this.connectionStorage.removeConnection();const e={event:"disconnect",traceId:Ue(),payload:{}};Re("Wallet message received:",e),this.emit(e)}catch(e){Re("Error while deleting session",e)}}));const g=(null==n?void 0:n.includeTonProof)?this.buildTonProof(t):void 0,f={items:[{name:"ton_addr",address:At(u)?function({wc:e,hex:t}){return`${e}:${t}`}(Lt(u)):u,network:d,publicKey:h,walletStateInit:p},...g?[g]:[]],device:{appName:"wallet_connect",appVersion:"",maxProtocolVersion:2,features:this.buildFeatureList(l.methods),platform:"browser"}};Re("WalletConnect connect response:",{event:"connect",payload:f,id:0}),this.emit({event:"connect",payload:f,traceId:n.traceId}),yield this.storeConnection()})}buildFeatureList(e){const t=[];return e.includes("ton_sendMessage")&&t.push("SendTransaction",{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}),e.includes("ton_signData")&&t.push({name:"SignData",types:["text","binary","cell"]}),t}disconnectWithError(e){return V(this,0,void 0,function*(){yield this.disconnect();const t={code:e.code,message:e.message};Re("WalletConnect connect response:",{event:"connect_error",id:0,payload:t}),this.emit({event:"connect_error",traceId:e.traceId,payload:t})})}clearAbortController(e){this.abortController===e&&(this.abortController=void 0)}emit(e,t){(null!=t?t:this.listeners).forEach(t=>t(e))}storeConnection(){return this.connectionStorage.storeConnection({type:"wallet-connect"})}}class dn{static getWallets(){return this.walletsList.getWallets()}get connected(){return null!==this._wallet}get account(){var e;return(null===(e=this._wallet)||void 0===e?void 0:e.account)||null}get wallet(){return this._wallet}set wallet(e){this._wallet=e,this.statusChangeSubscriptions.forEach(e=>e(this._wallet))}constructor(e){var t,n;this.walletsList=new it,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[];const r=(null==e?void 0:e.manifestUrl)||function(){var e;const t=null===(e=Ke())||void 0===e?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}();this.dappSettings={manifestUrl:r,storage:(null==e?void 0:e.storage)||new Ze},this.walletsRequiredFeatures=null==e?void 0:e.walletsRequiredFeatures,this.walletsList=new it({walletsListSource:null==e?void 0:e.walletsListSource,cacheTTLMs:null==e?void 0:e.walletsListCacheTTLMs});const o=null!==(t=null==e?void 0:e.eventDispatcher)&&void 0!==t?t:new tn;this.tracker=new It({eventDispatcher:o,tonConnectSdkVersion:Ot}),this.environment=null!==(n=null==e?void 0:e.environment)&&void 0!==n?n:new on,this.analytics=new en({environment:this.environment});const i=this.environment.getTelegramUser();if(function(e,t){e.addEventListener("ton-connect-ui-wallet-modal-opened",e=>{var n;const{detail:r}=e;t.emitConnectionStarted({client_id:r.client_id||"",versions:nn(r.custom_data),main_screen:r.visible_wallets,trace_id:null!==(n=r.trace_id)&&void 0!==n?n:void 0})}),e.addEventListener("ton-connect-ui-selected-wallet",e=>{var n,r;const{detail:o}=e;t.emitConnectionSelectedWallet({client_id:o.client_id||"",versions:nn(o.custom_data),main_screen:o.visible_wallets,wallets_menu:o.wallets_menu,trace_id:null!==(n=o.trace_id)&&void 0!==n?n:void 0,wallet_app_name:null!==(r=o.wallet_type)&&void 0!==r?r:"",wallet_redirect_method:o.wallet_redirect_method,wallet_redirect_link:o.wallet_redirect_link})}),e.addEventListener("ton-connect-connection-completed",e=>{const{detail:n}=e;t.emitConnectionCompleted(rn(n))}),e.addEventListener("ton-connect-connection-error",e=>{var n,r;const{detail:o}=e;t.emitConnectionError({client_id:o.custom_data.client_id||"",wallet_id:o.custom_data.wallet_id||"",error_code:null!==(n=o.error_code)&&void 0!==n?n:0,error_message:o.error_message,trace_id:null!==(r=o.trace_id)&&void 0!==r?r:void 0})}),e.addEventListener("ton-connect-disconnection",e=>{const{detail:n}=e;t.emitDisconnection(rn(n))}),e.addEventListener("ton-connect-transaction-sent-for-signature",e=>{const{detail:n}=e;t.emitTransactionSent(rn(n))}),e.addEventListener("ton-connect-transaction-signed",e=>{const{detail:n}=e;t.emitTransactionSigned(Object.assign(Object.assign({},rn(n)),{signed_boc:e.detail.signed_transaction}))}),e.addEventListener("ton-connect-transaction-signing-failed",e=>{var n;const{detail:r}=e;t.emitTransactionSigningFailed(Object.assign(Object.assign({},rn(r)),{valid_until:Number(r.valid_until),messages:r.messages.map(e=>{var t,n,r,o;return{address:null!==(t=e.address)&&void 0!==t?t:"",amount:null!==(n=e.amount)&&void 0!==n?n:"",payload:null!==(r=e.payload)&&void 0!==r?r:"",state_init:null!==(o=e.state_init)&&void 0!==o?o:""}}),error_message:r.error_message,error_code:null!==(n=r.error_code)&&void 0!==n?n:0}))}),e.addEventListener("ton-connect-sign-data-request-initiated",e=>{const{detail:n}=e;null==t||t.emitSignDataRequestInitiated(rn(n))}),e.addEventListener("ton-connect-sign-data-request-completed",e=>{const{detail:n}=e;null==t||t.emitSignDataRequestCompleted(rn(n))}),e.addEventListener("ton-connect-sign-data-request-failed",e=>{var n;const{detail:r}=e;let o,i="";"text"===r.data.type&&(i=r.data.text),"cell"===r.data.type&&(i=r.data.cell,o=r.data.schema),"binary"===r.data.type&&(i=r.data.bytes),null==t||t.emitSignDataRequestFailed(Object.assign(Object.assign({},rn(r)),{sign_data_type:r.data.type,sign_data_value:i,sign_data_schema:o,error_code:null!==(n=r.error_code)&&void 0!==n?n:0,error_message:r.error_message}))})}(o,this.analytics.scoped({locale:this.environment.getLocale(),browser:this.environment.getBrowser(),platform:this.environment.getPlatform(),tg_id:null==i?void 0:i.id,tma_is_premium:null==i?void 0:i.isPremium,manifest_json_url:r,origin_url:He})),!this.dappSettings.manifestUrl)throw new Z("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new Me(this.dappSettings.storage),(null==e?void 0:e.disableAutoPauseConnection)||this.addWindowFocusAndBlurSubscriptions()}getWallets(){return this.walletsList.getWallets()}onStatusChange(e,t){return this.statusChangeSubscriptions.push(e),t&&this.statusChangeErrorSubscriptions.push(t),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(t=>t!==e),t&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(e=>e!==t))}}connect(e,t,n){var r,o,i;const a=Object.assign({},n);if("object"==typeof t&&null!==t&&"tonProof"in t&&(a.request=t),"object"==typeof t&&null!==t&&("openingDeadlineMS"in t||"signal"in t||"request"in t||"traceId"in t)&&(a.request=null==t?void 0:t.request,a.openingDeadlineMS=null==t?void 0:t.openingDeadlineMS,a.signal=null==t?void 0:t.signal),a.request){const e=Qt(a.request);if(e){if(!nt())throw new z("ConnectAdditionalRequest validation failed: "+e);console.error("ConnectAdditionalRequest validation failed: "+e)}}if(this.connected)throw new Q;const s=_e(null==a?void 0:a.signal);if(null===(r=this.abortController)||void 0===r||r.abort(),this.abortController=s,s.signal.aborted)throw new z("Connection was aborted");null===(o=this.provider)||void 0===o||o.closeConnection(),this.provider=this.createProvider(e),s.signal.addEventListener("abort",()=>{var e;null===(e=this.provider)||void 0===e||e.closeConnection(),this.provider=null});const l=null!==(i=null==a?void 0:a.traceId)&&void 0!==i?i:Ue();return this.tracker.trackConnectionStarted(l),this.provider.connect(this.createConnectRequest(null==a?void 0:a.request),{openingDeadlineMS:null==a?void 0:a.openingDeadlineMS,signal:s.signal,traceId:l})}restoreConnection(e){return V(this,0,void 0,function*(){var t,n,r;const o=null!==(t=null==e?void 0:e.traceId)&&void 0!==t?t:Ue();this.tracker.trackConnectionRestoringStarted(o);const i=_e(null==e?void 0:e.signal);if(null===(n=this.abortController)||void 0===n||n.abort(),this.abortController=i,i.signal.aborted)return void this.tracker.trackConnectionRestoringError("Connection restoring was aborted",o);const[a,s]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(i.signal.aborted)return void this.tracker.trackConnectionRestoringError("Connection restoring was aborted",o);let l=null;try{switch(a){case"http":l=yield je.fromStorage(this.dappSettings.storage,this.analytics);break;case"injected":l=yield ze.fromStorage(this.dappSettings.storage,this.analytics);break;case"wallet-connect":l=yield cn.fromStorage(this.dappSettings.storage);break;default:if(!s)return;l=this.createProvider(s)}}catch(h){return Re("Provider is not restored",h),this.tracker.trackConnectionRestoringError("Provider is not restored",o),yield this.bridgeConnectionStorage.removeConnection(),null==l||l.closeConnection(),void(l=null)}if(i.signal.aborted)return null==l||l.closeConnection(),void this.tracker.trackConnectionRestoringError("Connection restoring was aborted",o);if(!l)return Te("Provider is not restored"),void this.tracker.trackConnectionRestoringError("Provider is not restored",o);null===(r=this.provider)||void 0===r||r.closeConnection(),this.provider=l,l.listen(this.walletEventsListener.bind(this));const c=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted",o),null==l||l.closeConnection(),l=null};i.signal.addEventListener("abort",c);const d=Ee(t=>V(this,0,void 0,function*(){if(yield null==l?void 0:l.restoreConnection({openingDeadlineMS:null==e?void 0:e.openingDeadlineMS,signal:t.signal,traceId:o}),i.signal.removeEventListener("abort",c),this.connected){const e=this.getSessionInfo();this.tracker.trackConnectionRestoringCompleted(this.wallet,e,o)}else this.tracker.trackConnectionRestoringError("Connection restoring failed",o)}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:2e3,signal:null==e?void 0:e.signal}),u=new Promise(e=>setTimeout(()=>e(),12e3));return Promise.race([d,u])})}sendTransaction(e,t){return V(this,0,void 0,function*(){var n,r,o,i;const a={};"function"==typeof t?a.onRequestSent=t:(a.onRequestSent=null==t?void 0:t.onRequestSent,a.signal=null==t?void 0:t.signal,a.traceId=null==t?void 0:t.traceId);const s=Gt(e);if(s){if(!nt())throw new z("SendTransactionRequest validation failed: "+s);console.error("SendTransactionRequest validation failed: "+s)}const l=_e(null==a?void 0:a.signal);if(l.signal.aborted)throw new z("Transaction sending was aborted");this.checkConnection();const c=e.messages.length,d=e.messages.some(e=>e.extraCurrency&&Object.keys(e.extraCurrency).length>0);at(this.wallet.device.features,{requiredMessagesNumber:c,requireExtraCurrencies:d});const u=this.getSessionInfo(),h=null!==(n=null==a?void 0:a.traceId)&&void 0!==n?n:Ue();this.tracker.trackTransactionSentForSignature(this.wallet,e,u,h);const{validUntil:p,messages:g}=e,f=H(e,["validUntil","messages"]),m=e.from||this.account.address,w=e.network||this.account.chain;if((null===(r=this.wallet)||void 0===r?void 0:r.account.chain)&&w!==this.wallet.account.chain){if(!nt())throw new ne("Wallet connected to a wrong network",{cause:{expectedChainId:null===(o=this.wallet)||void 0===o?void 0:o.account.chain,actualChainId:w}});console.error("Wallet connected to a wrong network",{expectedChainId:null===(i=this.wallet)||void 0===i?void 0:i.account.chain,actualChainId:w})}const v=yield this.provider.sendRequest(fe.convertToRpcRequest(Object.assign(Object.assign({},f),{from:m,network:w,valid_until:p,messages:g.map(e=>{var{extraCurrency:t,payload:n,stateInit:r}=e,o=H(e,["extraCurrency","payload","stateInit"]);return Object.assign(Object.assign({},o),{payload:Xt(n),stateInit:Xt(r),extra_currency:t})})})),{onRequestSent:a.onRequestSent,signal:l.signal,traceId:h});if(fe.isError(v))return this.tracker.trackTransactionSigningFailed(this.wallet,e,v.error.message,v.error.code,u,h),fe.parseAndThrowError(v);const y=fe.convertFromRpcResponse(v);return this.tracker.trackTransactionSigned(this.wallet,e,y,u,h),Object.assign(Object.assign({},y),{traceId:v.traceId})})}signData(e,t){return V(this,0,void 0,function*(){var n,r,o,i;const a=_e(null==t?void 0:t.signal);if(a.signal.aborted)throw new z("data sending was aborted");const s=Jt(e);if(s){if(!nt())throw new z("SignDataPayload validation failed: "+s);console.error("SignDataPayload validation failed: "+s)}this.checkConnection(),function(e,t){const n=e.find(e=>e&&"object"==typeof e&&"SignData"===e.name);if(!n)throw new ee("Wallet doesn't support SignData feature.",{cause:{requiredFeature:{featureName:"SignData",value:{types:t.requiredTypes}}}});const r=t.requiredTypes.filter(e=>!n.types.includes(e));if(r.length)throw new ee(`Wallet doesn't support required SignData types: ${r.join(", ")}.`,{cause:{requiredFeature:{featureName:"SignData",value:{types:r}}}})}(this.wallet.device.features,{requiredTypes:[e.type]});const l=this.getSessionInfo(),c=null!==(n=null==t?void 0:t.traceId)&&void 0!==n?n:Ue();this.tracker.trackDataSentForSignature(this.wallet,e,l,c);const d=e.from||this.account.address,u=e.network||this.account.chain;if((null===(r=this.wallet)||void 0===r?void 0:r.account.chain)&&u!==this.wallet.account.chain){if(!nt())throw new ne("Wallet connected to a wrong network",{cause:{expectedChainId:null===(o=this.wallet)||void 0===o?void 0:o.account.chain,actualChainId:u}});console.error("Wallet connected to a wrong network",{expectedChainId:null===(i=this.wallet)||void 0===i?void 0:i.account.chain,actualChainId:u})}const h=yield this.provider.sendRequest(we.convertToRpcRequest(Object.assign(Object.assign(Object.assign({},e),"cell"===e.type?{cell:Xt(e.cell)}:{}),{from:d,network:u})),{onRequestSent:null==t?void 0:t.onRequestSent,signal:a.signal,traceId:c});if(we.isError(h))return this.tracker.trackDataSigningFailed(this.wallet,e,h.error.message,h.error.code,l,c),we.parseAndThrowError(h);const p=we.convertFromRpcResponse(h);return this.tracker.trackDataSigned(this.wallet,e,p,l,c),Object.assign(Object.assign({},p),{traceId:c})})}setConnectionNetwork(e){if(this.connected)throw new z("Cannot change network while wallet is connected");this.desiredChainId=e}disconnect(e){return V(this,0,void 0,function*(){var t,n;if(!this.connected)throw new J;const r=_e(null==e?void 0:e.signal),o=this.abortController;if(this.abortController=r,r.signal.aborted)throw new z("Disconnect was aborted");const i=null!==(t=null==e?void 0:e.traceId)&&void 0!==t?t:Ue();this.onWalletDisconnected("dapp",{traceId:i}),yield null===(n=this.provider)||void 0===n?void 0:n.disconnect({signal:r.signal,traceId:i}),null==o||o.abort()})}getSessionId(){return V(this,0,void 0,function*(){if(!this.provider)return null;try{const e=yield this.bridgeConnectionStorage.getConnection();return e&&"http"===e.type?"sessionCrypto"in e?e.sessionCrypto.sessionId:e.session.sessionCrypto.sessionId:null}catch(e){return null}})}getSessionInfo(){var e;if("http"!==(null===(e=this.provider)||void 0===e?void 0:e.type))return null;if(!("session"in this.provider))return null;try{const e=this.provider.session;if(!e)return null;const t=e.sessionCrypto.sessionId;let n=null;return"walletPublicKey"in e&&(n=e.walletPublicKey),{clientId:t,walletId:n}}catch(t){return null}}pauseConnection(){var e;"http"===(null===(e=this.provider)||void 0===e?void 0:e.type)&&this.provider.pause()}unPauseConnection(){var e;return"http"!==(null===(e=this.provider)||void 0===e?void 0:e.type)?Promise.resolve():this.provider.unPause()}addWindowFocusAndBlurSubscriptions(){const e=Fe();if(e)try{e.addEventListener("visibilitychange",()=>{e.hidden?this.pauseConnection():this.unPauseConnection().catch(()=>{})})}catch(t){Te("Cannot subscribe to the document.visibilitychange: ",t)}}createProvider(e){let t;return t=!Array.isArray(e)&&"jsBridgeKey"in e?new ze(this.dappSettings.storage,e.jsBridgeKey,this.analytics):!Array.isArray(e)&&function(e){return"type"in e&&"wallet-connect"===e.type}(e)?new cn(this.dappSettings.storage):new je(this.dappSettings.storage,e,this.analytics),t.listen(this.walletEventsListener.bind(this)),t}walletEventsListener(e){switch(e.event){case"connect":this.onWalletConnected(e.payload,{traceId:e.traceId});break;case"connect_error":this.tracker.trackConnectionError(e.payload.message,e.payload.code,this.getSessionInfo(),e.traceId);const t=he.parseError(e.payload);this.onWalletConnectError(t);break;case"disconnect":this.onWalletDisconnected("wallet",{traceId:e.traceId})}}onWalletConnected(t,n){var r,o;const i=t.items.find(e=>"ton_addr"===e.name),a=t.items.find(e=>"ton_proof"===e.name);if(!i)throw new z("ton_addr connection item was not found");if(!st(t.device.features,this.walletsRequiredFeatures))return null===(r=this.provider)||void 0===r||r.disconnect(),void this.onWalletConnectError(new te("Wallet does not support required features",{cause:{connectEvent:t}}));const s={device:t.device,provider:this.provider.type,account:{address:i.address,chain:i.network,walletStateInit:i.walletStateInit,publicKey:i.publicKey}};if(this.desiredChainId&&s.account.chain!==this.desiredChainId){const e=this.desiredChainId,t=s.account.chain;return null===(o=this.provider)||void 0===o||o.disconnect(),void this.onWalletConnectError(new ne("Wallet connected to a wrong network",{cause:{expectedChainId:e,actualChainId:t}}))}if(a){const t=function(e){if(!zt(e))return"ton_proof item must be an object";if(Zt(e,["error","proof","name"]))return"ton_proof item contains extra properties";const t=Object.prototype.hasOwnProperty.call(e,"proof"),n=Object.prototype.hasOwnProperty.call(e,"error");if(!t&&!n)return"'ton_proof' item must contain either 'proof' or 'error'";if(t&&n)return"'ton_proof' item must contain either 'proof' or 'error', not both";if(t){const t=e.proof;if(!zt(t))return"Invalid 'proof' object";if(Zt(t,["timestamp","domain","payload","signature"]))return"ton_proof item contains extra properties";if(!qt(t.timestamp))return"Invalid 'proof.timestamp'";const n=t.domain;if(!zt(n))return"Invalid 'proof.domain'";if(!qt(n.lengthBytes))return"Invalid 'proof.domain.lengthBytes'";if(!Kt(n.value))return"Invalid 'proof.domain.value'";try{if(("undefined"!=typeof TextEncoder?(new TextEncoder).encode(n.value).length:n.value.length)!==n.lengthBytes)return"'proof.domain.lengthBytes' does not match 'proof.domain.value'"}catch(r){}if(!Kt(t.payload))return"Invalid 'proof.payload'";if(!Kt(t.signature)||!Dt.test(t.signature))return"Invalid 'proof.signature' format"}if(n){const t=e.error;if(!zt(t))return"Invalid 'error' object";if(Zt(t,["code","message"]))return"ton_proof error contains extra properties";if(!qt(t.code))return"Invalid 'error.code'";if(!Kt(t.message))return"Invalid 'error.message'"}return null}(a);let n;if(t)nt()&&console.error("TonProofItem validation failed: "+t),n={name:"ton_proof",error:{code:e.CONNECT_ITEM_ERROR_CODES.UNKNOWN_ERROR,message:t}};else try{if("proof"in a)n={name:"ton_proof",proof:{timestamp:a.proof.timestamp,domain:{lengthBytes:a.proof.domain.lengthBytes,value:a.proof.domain.value},payload:a.proof.payload,signature:a.proof.signature}};else{if(!("error"in a))throw new z("Invalid data format");n={name:"ton_proof",error:{code:a.error.code,message:a.error.message}}}}catch(c){n={name:"ton_proof",error:{code:e.CONNECT_ITEM_ERROR_CODES.UNKNOWN_ERROR,message:"Invalid data format"}}}s.connectItems={tonProof:n}}this.wallet=s;const l=this.getSessionInfo();this.tracker.trackConnectionCompleted(s,l,null==n?void 0:n.traceId)}onWalletConnectError(e){if(this.statusChangeErrorSubscriptions.forEach(t=>t(e)),Re(e),e instanceof Y||e instanceof G)throw Te(e),e}onWalletDisconnected(e,t){const n=this.getSessionInfo();this.tracker.trackDisconnection(this.wallet,e,n,null==t?void 0:t.traceId),this.wallet=null}checkConnection(){if(!this.connected)throw new J}createConnectRequest(e){const t=[Object.assign({name:"ton_addr"},this.desiredChainId?{network:this.desiredChainId}:{})];return(null==e?void 0:e.tonProof)&&t.push({name:"ton_proof",payload:e.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:t}}}dn.walletsList=new it,dn.isWalletInjected=e=>ze.isWalletInjected(e),dn.isInsideWalletBrowser=e=>ze.isInsideWalletBrowser(e);const un=Symbol("solid-proxy"),hn="function"==typeof Proxy,pn=Symbol("solid-track"),gn={equals:(e,t)=>e===t};let fn=er;const mn=1,wn=2,vn={owned:null,cleanups:null,context:null,owner:null},yn={};var bn=null;let Cn=null,xn=null,Sn=null,kn=null,_n=0;function En(e,t){const n=xn,r=bn,o=0===e.length,i=void 0===t?r:t,a=o?vn:{owned:null,cleanups:null,context:i?i.context:null,owner:i},s=o?e:()=>e(()=>Nn(()=>or(a)));bn=a,xn=null;try{return Xn(s,!0)}finally{xn=n,bn=r}}function Rn(e,t){const n={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},gn,t):gn).equals||void 0};return[Zn.bind(n),e=>("function"==typeof e&&(e=e(n.value)),Gn(n,e))]}function Tn(e,t,n){Yn(Qn(e,t,!0,mn))}function In(e,t,n){Yn(Qn(e,t,!1,mn))}function On(e,t,n){fn=tr;const r=Qn(e,t,!1,mn);n&&n.render||(r.user=!0),kn?kn.push(r):Yn(r)}function Mn(e,t,n){n=n?Object.assign({},gn,n):gn;const r=Qn(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Yn(r),Zn.bind(r)}function An(e,t,n){let r,o,i;r=!0,o=e,i={};let a=null,s=yn,l=!1,c="initialValue"in i,d=!1;const u=new Set,[h,p]=(i.storage||Rn)(i.initialValue),[g,f]=Rn(void 0),[m,w]=Rn(void 0,{equals:!1}),[v,y]=Rn(c?"ready":"unresolved");function b(e,t,n,r){return a===e&&(a=null,void 0!==r&&(c=!0),e!==s&&t!==s||!i.onHydrated||queueMicrotask(()=>i.onHydrated(r,{value:t})),s=yn,function(e,t){Xn(()=>{void 0===t&&p(()=>e),y(void 0!==t?"errored":c?"ready":"unresolved"),f(t);for(const e of u.keys())e.decrement();u.clear()},!1)}(t,n)),t}function C(){const e=h(),t=g();if(void 0!==t&&!a)throw t;return xn&&xn.user,e}function x(e=!0){if(!1!==e&&l)return;l=!1;const t=d?d():r;if(null==t||!1===t)return void b(a,Nn(h));let n;const i=s!==yn?s:Nn(()=>{try{return o(t,{value:h(),refetching:e})}catch(r){n=r}});var u;if(void 0===n)return(u=i)&&"object"==typeof u&&"then"in u?(a=i,"v"in i?(1===i.s?b(a,i.v,void 0,t):b(a,void 0,ir(i.v),t),i):(l=!0,queueMicrotask(()=>l=!1),Xn(()=>{y(c?"refreshing":"pending"),w()},!1),i.then(e=>b(i,e,void 0,t),e=>b(i,void 0,ir(e),t)))):(b(a,i,void 0,t),i);b(a,void 0,ir(n),t)}Object.defineProperties(C,{state:{get:()=>v()},error:{get:()=>g()},loading:{get(){const e=v();return"pending"===e||"refreshing"===e}},latest:{get(){if(!c)return C();const e=g();if(e&&!a)throw e;return h()}}});let S=bn;return d?Tn(()=>(S=bn,x(!1))):x(!1),[C,{refetch:e=>Bn(S,()=>x(e)),mutate:p}]}function Ln(e){return Xn(e,!1)}function Nn(e){if(null===xn)return e();const t=xn;xn=null;try{return e()}finally{xn=t}}function Wn(e,t,n){const r=Array.isArray(e);let o;return n=>{let i;if(r){i=Array(e.length);for(let t=0;t<e.length;t++)i[t]=e[t]()}else i=e();const a=Nn(()=>t(i,o,n));return o=i,a}}function Pn(e){On(()=>Nn(e))}function Un(e){return null===bn||(null===bn.cleanups?bn.cleanups=[e]:bn.cleanups.push(e)),e}function Dn(){return xn}function jn(){return bn}function Bn(e,t){const n=bn,r=xn;bn=e,xn=null;try{return Xn(t,!0)}catch(o){ar(o)}finally{bn=n,xn=r}}function $n(e){const t=xn,n=bn;return Promise.resolve().then(()=>{xn=t,bn=n,Xn(e,!1),xn=bn=null})}const[qn,Kn]=Rn(!1);function Fn(){return[qn,$n]}function Hn(e,t){const n=Symbol("context");return{id:n,Provider:lr(n),defaultValue:e}}function Vn(e){let t;return bn&&bn.context&&void 0!==(t=bn.context[e.id])?t:e.defaultValue}function zn(e){const t=Mn(e),n=Mn(()=>sr(t()));return n.toArray=()=>{const e=n();return Array.isArray(e)?e:null!=e?[e]:[]},n}function Zn(){if(this.sources&&this.state)if(this.state===mn)Yn(this);else{const e=Sn;Sn=null,Xn(()=>nr(this),!1),Sn=e}if(xn){const e=this.observers?this.observers.length:0;xn.sources?(xn.sources.push(this),xn.sourceSlots.push(e)):(xn.sources=[this],xn.sourceSlots=[e]),this.observers?(this.observers.push(xn),this.observerSlots.push(xn.sources.length-1)):(this.observers=[xn],this.observerSlots=[xn.sources.length-1])}return this.value}function Gn(e,t,n){let r=e.value;return e.comparator&&e.comparator(r,t)||(e.value=t,e.observers&&e.observers.length&&Xn(()=>{for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t],r=Cn&&Cn.running;r&&Cn.disposed.has(n),(r?n.tState:n.state)||(n.pure?Sn.push(n):kn.push(n),n.observers&&rr(n)),r||(n.state=mn)}if(Sn.length>1e6)throw Sn=[],new Error},!1)),t}function Yn(e){if(!e.fn)return;or(e);const t=_n;!function(e,t,n){let r;const o=bn,i=xn;xn=bn=e;try{r=e.fn(t)}catch(a){return e.pure&&(e.state=mn,e.owned&&e.owned.forEach(or),e.owned=null),e.updatedAt=n+1,ar(a)}finally{xn=i,bn=o}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?Gn(e,r):e.value=r,e.updatedAt=n)}(e,e.value,t)}function Qn(e,t,n,r=mn,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:bn,context:bn?bn.context:null,pure:n};return null===bn||bn!==vn&&(bn.owned?bn.owned.push(i):bn.owned=[i]),i}function Jn(e){if(0===e.state)return;if(e.state===wn)return nr(e);if(e.suspense&&Nn(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<_n);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if((e=t[n]).state===mn)Yn(e);else if(e.state===wn){const n=Sn;Sn=null,Xn(()=>nr(e,t[0]),!1),Sn=n}}function Xn(e,t){if(Sn)return e();let n=!1;t||(Sn=[]),kn?n=!0:kn=[],_n++;try{const t=e();return function(e){Sn&&(er(Sn),Sn=null);if(e)return;const t=kn;kn=null,t.length&&Xn(()=>fn(t),!1)}(n),t}catch(r){n||(kn=null),Sn=null,ar(r)}}function er(e){for(let t=0;t<e.length;t++)Jn(e[t])}function tr(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Jn(r)}for(t=0;t<n;t++)Jn(e[t])}function nr(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const e=r.state;e===mn?r!==t&&(!r.updatedAt||r.updatedAt<_n)&&Jn(r):e===wn&&nr(r,t)}}}function rr(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=wn,n.pure?Sn.push(n):kn.push(n),n.observers&&rr(n))}}function or(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){const e=r.pop(),o=t.observerSlots.pop();n<r.length&&(e.sourceSlots[o]=n,r[n]=e,t.observerSlots[n]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)or(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)or(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function ir(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function ar(e,t=bn){throw ir(e)}function sr(e){if("function"==typeof e&&!e.length)return sr(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=sr(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function lr(e,t){return function(t){let n;return In(()=>n=Nn(()=>(bn.context=w(m({},bn.context),{[e]:t.value}),zn(()=>t.children))),void 0),n}}const cr=Symbol("fallback");function dr(e){for(let t=0;t<e.length;t++)e[t]()}function ur(e,t){return Nn(()=>e(t||{}))}function hr(){return!0}const pr={get:(e,t,n)=>t===un?n:e.get(t),has:(e,t)=>t===un||e.has(t),set:hr,deleteProperty:hr,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:hr,deleteProperty:hr}),ownKeys:e=>e.keys()};function gr(e){return(e="function"==typeof e?e():e)?e:{}}function fr(){for(let e=0,t=this.length;e<t;++e){const t=this[e]();if(void 0!==t)return t}}function mr(...e){let t=!1;for(let a=0;a<e.length;a++){const n=e[a];t=t||!!n&&un in n,e[a]="function"==typeof n?(t=!0,Mn(n)):n}if(hn&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){const r=gr(e[n])[t];if(void 0!==r)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in gr(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(gr(e[n])));return[...new Set(t)]}},pr);const n={},r=Object.create(null);for(let a=e.length-1;a>=0;a--){const t=e[a];if(!t)continue;const o=Object.getOwnPropertyNames(t);for(let e=o.length-1;e>=0;e--){const i=o[e];if("__proto__"===i||"constructor"===i)continue;const a=Object.getOwnPropertyDescriptor(t,i);if(r[i]){const e=n[i];e&&(a.get?e.push(a.get.bind(t)):void 0!==a.value&&e.push(()=>a.value))}else r[i]=a.get?{enumerable:!0,configurable:!0,get:fr.bind(n[i]=[a.get.bind(t)])}:void 0!==a.value?a:void 0}}const o={},i=Object.keys(r);for(let a=i.length-1;a>=0;a--){const e=i[a],t=r[e];t&&t.get?Object.defineProperty(o,e,t):o[e]=t?t.value:void 0}return o}function wr(e,...t){if(hn&&un in e){const n=new Set(t.length>1?t.flat():t[0]),r=t.map(t=>new Proxy({get:n=>t.includes(n)?e[n]:void 0,has:n=>t.includes(n)&&n in e,keys:()=>t.filter(t=>t in e)},pr));return r.push(new Proxy({get:t=>n.has(t)?void 0:e[t],has:t=>!n.has(t)&&t in e,keys:()=>Object.keys(e).filter(e=>!n.has(e))},pr)),r}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),a=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let s=!1,l=0;for(const e of t)e.includes(o)&&(s=!0,a?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;s||(a?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}const vr=e=>`Stale read from <${e}>.`;function yr(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Mn(function(e,t,n={}){let r=[],o=[],i=[],a=0,s=t.length>1?[]:null;return Un(()=>dr(i)),()=>{let l,c,d=e()||[],u=d.length;return d[pn],Nn(()=>{let e,t,p,g,f,m,w,v,y;if(0===u)0!==a&&(dr(i),i=[],r=[],o=[],a=0,s&&(s=[])),n.fallback&&(r=[cr],o[0]=En(e=>(i[0]=e,n.fallback())),a=1);else if(0===a){for(o=new Array(u),c=0;c<u;c++)r[c]=d[c],o[c]=En(h);a=u}else{for(p=new Array(u),g=new Array(u),s&&(f=new Array(u)),m=0,w=Math.min(a,u);m<w&&r[m]===d[m];m++);for(w=a-1,v=u-1;w>=m&&v>=m&&r[w]===d[v];w--,v--)p[v]=o[w],g[v]=i[w],s&&(f[v]=s[w]);for(e=new Map,t=new Array(v+1),c=v;c>=m;c--)y=d[c],l=e.get(y),t[c]=void 0===l?-1:l,e.set(y,c);for(l=m;l<=w;l++)y=r[l],c=e.get(y),void 0!==c&&-1!==c?(p[c]=o[l],g[c]=i[l],s&&(f[c]=s[l]),c=t[c],e.set(y,c)):i[l]();for(c=m;c<u;c++)c in p?(o[c]=p[c],i[c]=g[c],s&&(s[c]=f[c],s[c](c))):o[c]=En(h);o=o.slice(0,a=u),r=d.slice(0)}return o});function h(e){if(i[c]=e,s){const[e,n]=Rn(c);return s[c]=n,t(d[c],e)}return t(d[c])}}}(()=>e.each,e.children,t||void 0))}function br(e){const t=e.keyed,n=Mn(()=>e.when,void 0,void 0),r=t?n:Mn(n,void 0,{equals:(e,t)=>!e==!t});return Mn(()=>{const o=r();if(o){const i=e.children;return"function"==typeof i&&i.length>0?Nn(()=>i(t?o:()=>{if(!Nn(r))throw vr("Show");return n()})):i}return e.fallback},void 0,void 0)}function Cr(e){const t=zn(()=>e.children),n=Mn(()=>{const e=t(),n=Array.isArray(e)?e:[e];let r=()=>{};for(let t=0;t<n.length;t++){const e=t,o=n[t],i=r,a=Mn(()=>i()?void 0:o.when,void 0,void 0),s=o.keyed?a:Mn(a,void 0,{equals:(e,t)=>!e==!t});r=()=>i()||(s()?[e,a,o]:void 0)}return r});return Mn(()=>{const t=n()();if(!t)return e.fallback;const[r,o,i]=t,a=i.children;return"function"==typeof a&&a.length>0?Nn(()=>a(i.keyed?o():()=>{var e;if((null==(e=Nn(n)())?void 0:e[0])!==r)throw vr("Match");return o()})):a},void 0,void 0)}function xr(e){return e}const Sr=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"]),kr=new Set(["innerHTML","textContent","innerText","children"]),_r=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Er=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});const Rr=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Tr=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Ir={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Or=e=>Mn(()=>e());const Mr="_$DX_DELEGATE";function Ar(e,t,n,r){let o;const i=()=>{const t=r?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},a=t?()=>Nn(()=>document.importNode(o||(o=i()),!0)):()=>(o||(o=i())).cloneNode(!0);return a.cloneNode=a,a}function Lr(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function Nr(e,t){null==t?e.removeAttribute("class"):e.className=t}function Wr(e,t={},n,r){const o={};return In(()=>o.children=$r(e,t.children,o.children)),In(()=>"function"==typeof t.ref&&Pr(t.ref,e)),In(()=>function(e,t,n,r,o={},i=!1){t||(t={});for(const a in o)if(!(a in t)){if("children"===a)continue;o[a]=jr(e,a,null,o[a],n,i,t)}for(const a in t){if("children"===a)continue;const r=t[a];o[a]=jr(e,a,r,o[a],n,i,t)}}(e,t,n,0,o,!0)),o}function Pr(e,t,n){return Nn(()=>e(t,n))}function Ur(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return $r(e,t,r,n);In(r=>$r(e,t(),r,n),r)}function Dr(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function jr(e,t,n,r,o,i,a){let s,l,c,d,u;if("style"===t)return function(e,t,n){if(!t)return n?Lr(e,"style"):t;const r=e.style;if("string"==typeof t)return r.cssText=t;let o,i;for(i in"string"==typeof n&&(r.cssText=n=void 0),n||(n={}),t||(t={}),n)null==t[i]&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}(e,n,r);if("classList"===t)return function(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,a;for(i=0,a=o.length;i<a;i++){const r=o[i];r&&"undefined"!==r&&!t[r]&&(Dr(e,r,!1),delete n[r])}for(i=0,a=r.length;i<a;i++){const o=r[i],a=!!t[o];o&&"undefined"!==o&&n[o]!==a&&a&&(Dr(e,o,!0),n[o]=a)}return n}(e,n,r);if(n===r)return r;if("ref"===t)i||n(e);else if("on:"===t.slice(0,3)){const o=t.slice(3);r&&e.removeEventListener(o,r,"function"!=typeof r&&r),n&&e.addEventListener(o,n,"function"!=typeof n&&n)}else if("oncapture:"===t.slice(0,10)){const o=t.slice(10);r&&e.removeEventListener(o,r,!0),n&&e.addEventListener(o,n,!0)}else if("on"===t.slice(0,2)){const o=t.slice(2).toLowerCase(),i=Rr.has(o);if(!i&&r){const t=Array.isArray(r)?r[0]:r;e.removeEventListener(o,t)}(i||n)&&(function(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,"function"!=typeof n&&n)}(e,o,n,i),i&&function(e,t=window.document){const n=t[Mr]||(t[Mr]=new Set);for(let r=0,o=e.length;r<o;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,Br))}}([o]))}else if("attr:"===t.slice(0,5))Lr(e,t.slice(5),n);else if("bool:"===t.slice(0,5))!function(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}(e,t.slice(5),n);else if((u="prop:"===t.slice(0,5))||(c=kr.has(t))||!o&&((d=function(e,t){const n=Er[e];return"object"==typeof n?n[t]?n.$:void 0:n}(t,e.tagName))||(l=Sr.has(t)))||(s=e.nodeName.includes("-")||"is"in a))u&&(t=t.slice(5),l=!0),"class"===t||"className"===t?Nr(e,n):!s||l||c?e[d||t]=n:e[(h=t,h.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase()))]=n;else{const r=o&&t.indexOf(":")>-1&&Ir[t.split(":")[0]];r?function(e,t,n,r){null==r?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}(e,r,t,n):Lr(e,_r[t]||t,n)}var h;return n}function Br(e){let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),a=()=>{const r=t[n];if(r&&!t.disabled){const o=t[`${n}Data`];if(void 0!==o?r.call(t,o,e):r.call(t,e),e.cancelBubble)return}return t.host&&"string"!=typeof t.host&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},s=()=>{for(;a()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>t||document}),e.composedPath){const n=e.composedPath();i(n[0]);for(let e=0;e<n.length-2&&(t=n[e],a());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===o)break}}else s();i(r)}function $r(e,t,n,r,o){for(;"function"==typeof n;)n=n();if(t===n)return n;const i=typeof t,a=void 0!==r;if(e=a&&n[0]&&n[0].parentNode||e,"string"===i||"number"===i){if("number"===i&&(t=t.toString())===n)return n;if(a){let o=n[0];o&&3===o.nodeType?o.data!==t&&(o.data=t):o=document.createTextNode(t),n=Fr(e,n,r,o)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===i)n=Fr(e,n,r);else{if("function"===i)return In(()=>{let o=t();for(;"function"==typeof o;)o=o();n=$r(e,o,n,r)}),()=>n;if(Array.isArray(t)){const i=[],s=n&&Array.isArray(n);if(qr(i,t,n,o))return In(()=>n=$r(e,i,n,r,!0)),()=>n;if(0===i.length){if(n=Fr(e,n,r),a)return n}else s?0===n.length?Kr(e,i,r):function(e,t,n){let r=n.length,o=t.length,i=r,a=0,s=0,l=t[o-1].nextSibling,c=null;for(;a<o||s<i;)if(t[a]!==n[s]){for(;t[o-1]===n[i-1];)o--,i--;if(o===a){const t=i<r?s?n[s-1].nextSibling:n[i-s]:l;for(;s<i;)e.insertBefore(n[s++],t)}else if(i===s)for(;a<o;)c&&c.has(t[a])||t[a].remove(),a++;else if(t[a]===n[i-1]&&n[s]===t[o-1]){const r=t[--o].nextSibling;e.insertBefore(n[s++],t[a++].nextSibling),e.insertBefore(n[--i],r),t[o]=n[i]}else{if(!c){c=new Map;let e=s;for(;e<i;)c.set(n[e],e++)}const r=c.get(t[a]);if(null!=r)if(s<r&&r<i){let l,d=a,u=1;for(;++d<o&&d<i&&null!=(l=c.get(t[d]))&&l===r+u;)u++;if(u>r-s){const o=t[a];for(;s<r;)e.insertBefore(n[s++],o)}else e.replaceChild(n[s++],t[a++])}else a++;else t[a++].remove()}}else a++,s++}(e,n,i):(n&&Fr(e),Kr(e,i));n=i}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=Fr(e,n,r,t);Fr(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}}return n}function qr(e,t,n,r){let o=!1;for(let i=0,a=t.length;i<a;i++){let a,s=t[i],l=n&&n[e.length];if(null==s||!0===s||!1===s);else if("object"==(a=typeof s)&&s.nodeType)e.push(s);else if(Array.isArray(s))o=qr(e,s,l)||o;else if("function"===a)if(r){for(;"function"==typeof s;)s=s();o=qr(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||o}else e.push(s),o=!0;else{const t=String(s);l&&3===l.nodeType&&l.data===t?e.push(l):e.push(document.createTextNode(t))}}return o}function Kr(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function Fr(e,t,n,r){if(void 0===n)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let r=!1;for(let i=t.length-1;i>=0;i--){const a=t[i];if(o!==a){const t=a.parentNode===e;r||i?t&&a.remove():t?e.replaceChild(o,a):e.insertBefore(o,n)}else r=!0}}else e.insertBefore(o,n);return[o]}function Hr(e,t=!1){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}function Vr(e){const{useShadow:t}=e,n=document.createTextNode(""),r=jn();let o;return On(()=>{o||(o=Bn(r,()=>Mn(()=>e.children)));const i=e.mount||document.body;if(i instanceof HTMLHeadElement){const[e,t]=Rn(!1),n=()=>t(!0);En(t=>Ur(i,()=>e()?t():o(),null)),Un(n)}else{const r=Hr(e.isSVG?"g":"div",e.isSVG),a=t&&r.attachShadow?r.attachShadow({mode:"open"}):r;Object.defineProperty(r,"_$host",{get:()=>n.parentNode,configurable:!0}),Ur(a,o),i.appendChild(r),e.ref&&e.ref(r),Un(()=>i.removeChild(r))}},void 0,{render:!0}),n}function zr(e){const[,t]=wr(e,["component"]);return function(e,t){const n=Mn(e);return Mn(()=>{const e=n();switch(typeof e){case"function":return Nn(()=>e(t));case"string":const n=Tr.has(e),r=Hr(e,n);return Wr(r,t,n),r}})}(()=>e.component,t)}var Zr=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))(Zr||{});let Gr={data:""},Yr=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Qr=/\/\*[^]*?\*\/| +/g,Jr=/\n+/g,Xr=(e,t)=>{let n="",r="",o="";for(let i in e){let a=e[i];"@"==i[0]?"i"==i[1]?n=i+" "+a+";":r+="f"==i[1]?Xr(a,i):i+"{"+Xr(a,"k"==i[1]?"":t)+"}":"object"==typeof a?r+=Xr(a,t?t.replace(/([^,])+/g,e=>i.replace(/(^:.*)|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):i):null!=a&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Xr.p?Xr.p(i,a):i+":"+a+";")}return n+(t&&o?t+"{"+o+"}":o)+r},eo={},to=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+to(e[n]);return t}return e};function no(e){let t=this||{},n=e.call?e(t.p):e;return((e,t,n,r,o)=>{let i=to(e),a=eo[i]||(eo[i]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(i));if(!eo[a]){let t=i!==e?e:(e=>{let t,n,r=[{}];for(;t=Yr.exec(e.replace(Qr,""));)t[4]?r.shift():t[3]?(n=t[3].replace(Jr," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(Jr," ").trim();return r[0]})(e);eo[a]=Xr(o?{["@keyframes "+a]:t}:t,n?"":"."+a)}let s=n&&eo.g?eo.g:null;return n&&(eo.g=eo[a]),l=eo[a],c=t,d=r,(u=s)?c.data=c.data.replace(u,l):-1===c.data.indexOf(l)&&(c.data=d?l+c.data:c.data+l),a;var l,c,d,u})(n.unshift?n.raw?((e,t,n)=>e.reduce((e,r,o)=>{let i=t[o];if(i&&i.call){let e=i(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;i=t?"."+t:e&&"object"==typeof e?e.props?"":Xr(e,""):!1===e?"":e}return e+r+(null==i?"":i)},""))(n,[].slice.call(arguments,1),t.p):n.reduce((e,n)=>Object.assign(e,n&&n.call?n(t.p):n),{}):n,(r=t.target,"object"==typeof window?((r?r.querySelector("#_goober"):window._goober)||Object.assign((r||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:r||Gr),t.g,t.o,t.k);var r}no.bind({g:1});let ro=no.bind({k:1});const oo=Hn();function io(e){return ur(oo.Provider,{value:e.theme,get children(){return e.children}})}function ao(){return Vn(oo)}function so(e){let t=this||{};return(...n)=>{const r=r=>{const o=mr(r,{theme:Vn(oo)}),i=mr(o,{get class(){const e=o.class,r="class"in o&&/^go[0-9]+/.test(e);return[e,no.apply({target:t.target,o:r,p:o,g:t.g},n)].filter(Boolean).join(" ")}}),[a,s]=wr(i,["as","theme"]),l=s,c=a.as||e;let d;return"function"==typeof c?d=c(l):1==t.g?(d=document.createElement(c),Wr(d,l)):d=zr(mr({component:c},l)),d};return r.class=e=>Nn(()=>no.apply({target:t.target,p:e,g:t.g},n)),r}}const lo=new Proxy(so,{get:(e,t)=>e(t)});function co(){const e=so.call({g:1},"div").apply(null,arguments);return function(t){return e(t),null}}const uo="tc-root",ho="tc-disable-scroll",po="tc-using-mouse",go=()=>{document.body.addEventListener("mousedown",()=>document.body.classList.add(po)),document.body.addEventListener("keydown",e=>{"Tab"===e.key&&document.body.classList.remove(po)});return ur(co`
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TON_CONNECT_UI={})}(this,function(e){"use strict";var t,n,r,o,i,a,s,l,c=Object.defineProperty,d=Object.defineProperties,u=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,f=(e,t,n)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m=(e,t)=>{for(var n in t||(t={}))p.call(t,n)&&f(e,n,t[n]);if(h)for(var n of h(t))g.call(t,n)&&f(e,n,t[n]);return e},w=(e,t)=>d(e,u(t)),v=(e,t)=>{var n={};for(var r in e)p.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&h)for(var r of h(e))t.indexOf(r)<0&&g.call(e,r)&&(n[r]=e[r]);return n},y=(e,t,n)=>new Promise((r,o)=>{var i=e=>{try{s(n.next(e))}catch(Gr){o(Gr)}},a=e=>{try{s(n.throw(e))}catch(Gr){o(Gr)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,a);s((n=n.apply(e,t)).next())});function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function C(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch(r){}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var x,S,k,_,E={exports:{}};const R=b((x||(x=1,k=E.exports,_=function(){var e={};function t(e){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e))throw new TypeError("invalid encoding")}return e.decodeUTF8=function(e){if("string"!=typeof e)throw new TypeError("expected string");var t,n=unescape(encodeURIComponent(e)),r=new Uint8Array(n.length);for(t=0;t<n.length;t++)r[t]=n.charCodeAt(t);return r},e.encodeUTF8=function(e){var t,n=[];for(t=0;t<e.length;t++)n.push(String.fromCharCode(e[t]));return decodeURIComponent(escape(n.join("")))},"undefined"==typeof atob?void 0!==Buffer.from?(e.encodeBase64=function(e){return Buffer.from(e).toString("base64")},e.decodeBase64=function(e){return t(e),new Uint8Array(Array.prototype.slice.call(Buffer.from(e,"base64"),0))}):(e.encodeBase64=function(e){return new Buffer(e).toString("base64")},e.decodeBase64=function(e){return t(e),new Uint8Array(Array.prototype.slice.call(new Buffer(e,"base64"),0))}):(e.encodeBase64=function(e){var t,n=[],r=e.length;for(t=0;t<r;t++)n.push(String.fromCharCode(e[t]));return btoa(n.join(""))},e.decodeBase64=function(e){t(e);var n,r=atob(e),o=new Uint8Array(r.length);for(n=0;n<r.length;n++)o[n]=r.charCodeAt(n);return o}),e},(S=E).exports?S.exports=_():(k.nacl||(k.nacl={}),k.nacl.util=_())),E.exports));function T(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var I={exports:{}};const O=C(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var M;var A=(M||(M=1,function(e){!function(e){var t=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;t++)n[t]=e[t];return n},n=function(){throw new Error("no PRNG")},r=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var i=t(),a=t([1]),s=t([56129,1]),l=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),c=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),u=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),h=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t,n,r){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n,e[t+4]=r>>24&255,e[t+5]=r>>16&255,e[t+6]=r>>8&255,e[t+7]=255&r}function g(e,t,n,r,o){var i,a=0;for(i=0;i<o;i++)a|=e[t+i]^n[r+i];return(1&a-1>>>8)-1}function f(e,t,n,r){return g(e,t,n,r,16)}function m(e,t,n,r){return g(e,t,n,r,32)}function w(e,t,n,r){!function(e,t,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,c=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,d=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,g=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,f=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,m=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,w=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,v=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,y=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,b=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,C=i,x=a,S=s,k=l,_=c,E=d,R=u,T=h,I=p,O=g,M=f,A=m,L=w,N=v,W=y,P=b,U=0;U<20;U+=2)C^=(o=(L^=(o=(I^=(o=(_^=(o=C+L|0)<<7|o>>>25)+C|0)<<9|o>>>23)+_|0)<<13|o>>>19)+I|0)<<18|o>>>14,E^=(o=(x^=(o=(N^=(o=(O^=(o=E+x|0)<<7|o>>>25)+E|0)<<9|o>>>23)+O|0)<<13|o>>>19)+N|0)<<18|o>>>14,M^=(o=(R^=(o=(S^=(o=(W^=(o=M+R|0)<<7|o>>>25)+M|0)<<9|o>>>23)+W|0)<<13|o>>>19)+S|0)<<18|o>>>14,P^=(o=(A^=(o=(T^=(o=(k^=(o=P+A|0)<<7|o>>>25)+P|0)<<9|o>>>23)+k|0)<<13|o>>>19)+T|0)<<18|o>>>14,C^=(o=(k^=(o=(S^=(o=(x^=(o=C+k|0)<<7|o>>>25)+C|0)<<9|o>>>23)+x|0)<<13|o>>>19)+S|0)<<18|o>>>14,E^=(o=(_^=(o=(T^=(o=(R^=(o=E+_|0)<<7|o>>>25)+E|0)<<9|o>>>23)+R|0)<<13|o>>>19)+T|0)<<18|o>>>14,M^=(o=(O^=(o=(I^=(o=(A^=(o=M+O|0)<<7|o>>>25)+M|0)<<9|o>>>23)+A|0)<<13|o>>>19)+I|0)<<18|o>>>14,P^=(o=(W^=(o=(N^=(o=(L^=(o=P+W|0)<<7|o>>>25)+P|0)<<9|o>>>23)+L|0)<<13|o>>>19)+N|0)<<18|o>>>14;C=C+i|0,x=x+a|0,S=S+s|0,k=k+l|0,_=_+c|0,E=E+d|0,R=R+u|0,T=T+h|0,I=I+p|0,O=O+g|0,M=M+f|0,A=A+m|0,L=L+w|0,N=N+v|0,W=W+y|0,P=P+b|0,e[0]=C>>>0&255,e[1]=C>>>8&255,e[2]=C>>>16&255,e[3]=C>>>24&255,e[4]=x>>>0&255,e[5]=x>>>8&255,e[6]=x>>>16&255,e[7]=x>>>24&255,e[8]=S>>>0&255,e[9]=S>>>8&255,e[10]=S>>>16&255,e[11]=S>>>24&255,e[12]=k>>>0&255,e[13]=k>>>8&255,e[14]=k>>>16&255,e[15]=k>>>24&255,e[16]=_>>>0&255,e[17]=_>>>8&255,e[18]=_>>>16&255,e[19]=_>>>24&255,e[20]=E>>>0&255,e[21]=E>>>8&255,e[22]=E>>>16&255,e[23]=E>>>24&255,e[24]=R>>>0&255,e[25]=R>>>8&255,e[26]=R>>>16&255,e[27]=R>>>24&255,e[28]=T>>>0&255,e[29]=T>>>8&255,e[30]=T>>>16&255,e[31]=T>>>24&255,e[32]=I>>>0&255,e[33]=I>>>8&255,e[34]=I>>>16&255,e[35]=I>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=M>>>0&255,e[41]=M>>>8&255,e[42]=M>>>16&255,e[43]=M>>>24&255,e[44]=A>>>0&255,e[45]=A>>>8&255,e[46]=A>>>16&255,e[47]=A>>>24&255,e[48]=L>>>0&255,e[49]=L>>>8&255,e[50]=L>>>16&255,e[51]=L>>>24&255,e[52]=N>>>0&255,e[53]=N>>>8&255,e[54]=N>>>16&255,e[55]=N>>>24&255,e[56]=W>>>0&255,e[57]=W>>>8&255,e[58]=W>>>16&255,e[59]=W>>>24&255,e[60]=P>>>0&255,e[61]=P>>>8&255,e[62]=P>>>16&255,e[63]=P>>>24&255}(e,t,n,r)}function v(e,t,n,r){!function(e,t,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,c=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,d=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,g=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,f=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,m=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,w=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,v=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,y=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,b=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,C=0;C<20;C+=2)i^=(o=(w^=(o=(p^=(o=(c^=(o=i+w|0)<<7|o>>>25)+i|0)<<9|o>>>23)+c|0)<<13|o>>>19)+p|0)<<18|o>>>14,d^=(o=(a^=(o=(v^=(o=(g^=(o=d+a|0)<<7|o>>>25)+d|0)<<9|o>>>23)+g|0)<<13|o>>>19)+v|0)<<18|o>>>14,f^=(o=(u^=(o=(s^=(o=(y^=(o=f+u|0)<<7|o>>>25)+f|0)<<9|o>>>23)+y|0)<<13|o>>>19)+s|0)<<18|o>>>14,b^=(o=(m^=(o=(h^=(o=(l^=(o=b+m|0)<<7|o>>>25)+b|0)<<9|o>>>23)+l|0)<<13|o>>>19)+h|0)<<18|o>>>14,i^=(o=(l^=(o=(s^=(o=(a^=(o=i+l|0)<<7|o>>>25)+i|0)<<9|o>>>23)+a|0)<<13|o>>>19)+s|0)<<18|o>>>14,d^=(o=(c^=(o=(h^=(o=(u^=(o=d+c|0)<<7|o>>>25)+d|0)<<9|o>>>23)+u|0)<<13|o>>>19)+h|0)<<18|o>>>14,f^=(o=(g^=(o=(p^=(o=(m^=(o=f+g|0)<<7|o>>>25)+f|0)<<9|o>>>23)+m|0)<<13|o>>>19)+p|0)<<18|o>>>14,b^=(o=(y^=(o=(v^=(o=(w^=(o=b+y|0)<<7|o>>>25)+b|0)<<9|o>>>23)+w|0)<<13|o>>>19)+v|0)<<18|o>>>14;e[0]=i>>>0&255,e[1]=i>>>8&255,e[2]=i>>>16&255,e[3]=i>>>24&255,e[4]=d>>>0&255,e[5]=d>>>8&255,e[6]=d>>>16&255,e[7]=d>>>24&255,e[8]=f>>>0&255,e[9]=f>>>8&255,e[10]=f>>>16&255,e[11]=f>>>24&255,e[12]=b>>>0&255,e[13]=b>>>8&255,e[14]=b>>>16&255,e[15]=b>>>24&255,e[16]=u>>>0&255,e[17]=u>>>8&255,e[18]=u>>>16&255,e[19]=u>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=p>>>0&255,e[25]=p>>>8&255,e[26]=p>>>16&255,e[27]=p>>>24&255,e[28]=g>>>0&255,e[29]=g>>>8&255,e[30]=g>>>16&255,e[31]=g>>>24&255}(e,t,n,r)}var y=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function b(e,t,n,r,o,i,a){var s,l,c=new Uint8Array(16),d=new Uint8Array(64);for(l=0;l<16;l++)c[l]=0;for(l=0;l<8;l++)c[l]=i[l];for(;o>=64;){for(w(d,c,a,y),l=0;l<64;l++)e[t+l]=n[r+l]^d[l];for(s=1,l=8;l<16;l++)s=s+(255&c[l])|0,c[l]=255&s,s>>>=8;o-=64,t+=64,r+=64}if(o>0)for(w(d,c,a,y),l=0;l<o;l++)e[t+l]=n[r+l]^d[l];return 0}function C(e,t,n,r,o){var i,a,s=new Uint8Array(16),l=new Uint8Array(64);for(a=0;a<16;a++)s[a]=0;for(a=0;a<8;a++)s[a]=r[a];for(;n>=64;){for(w(l,s,o,y),a=0;a<64;a++)e[t+a]=l[a];for(i=1,a=8;a<16;a++)i=i+(255&s[a])|0,s[a]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(w(l,s,o,y),a=0;a<n;a++)e[t+a]=l[a];return 0}function x(e,t,n,r,o){var i=new Uint8Array(32);v(i,r,o,y);for(var a=new Uint8Array(8),s=0;s<8;s++)a[s]=r[s+16];return C(e,t,n,a,i)}function S(e,t,n,r,o,i,a){var s=new Uint8Array(32);v(s,i,a,y);for(var l=new Uint8Array(8),c=0;c<8;c++)l[c]=i[c+16];return b(e,t,n,r,o,l,s)}var k=function(e){var t,n,r,o,i,a,s,l;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,n=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|n<<3),r=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(n>>>10|r<<6),o=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(r>>>7|o<<9),i=255&e[8]|(255&e[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,a=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(i>>>14|a<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(a>>>11|s<<5),l=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|l<<8),this.r[9]=l>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function _(e,t,n,r,o,i){var a=new k(i);return a.update(n,r,o),a.finish(e,t),0}function E(e,t,n,r,o,i){var a=new Uint8Array(16);return _(a,0,n,r,o,i),f(e,t,a,0)}function R(e,t,n,r,o){var i;if(n<32)return-1;for(S(e,0,t,0,n,r,o),_(e,16,e,32,n-32,e),i=0;i<16;i++)e[i]=0;return 0}function I(e,t,n,r,o){var i,a=new Uint8Array(32);if(n<32)return-1;if(x(a,0,32,r,o),0!==E(t,16,t,32,n-32,a))return-1;for(S(e,0,t,0,n,r,o),i=0;i<32;i++)e[i]=0;return 0}function M(e,t){var n;for(n=0;n<16;n++)e[n]=0|t[n]}function A(e){var t,n,r=1;for(t=0;t<16;t++)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-65536*r;e[0]+=r-1+37*(r-1)}function L(e,t,n){for(var r,o=~(n-1),i=0;i<16;i++)r=o&(e[i]^t[i]),e[i]^=r,t[i]^=r}function N(e,n){var r,o,i,a=t(),s=t();for(r=0;r<16;r++)s[r]=n[r];for(A(s),A(s),A(s),o=0;o<2;o++){for(a[0]=s[0]-65517,r=1;r<15;r++)a[r]=s[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=s[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,L(s,a,1-i)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function W(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return N(n,e),N(r,t),m(n,0,r,0)}function P(e){var t=new Uint8Array(32);return N(t,e),1&t[0]}function U(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function D(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function j(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function B(e,t,n){var r,o,i=0,a=0,s=0,l=0,c=0,d=0,u=0,h=0,p=0,g=0,f=0,m=0,w=0,v=0,y=0,b=0,C=0,x=0,S=0,k=0,_=0,E=0,R=0,T=0,I=0,O=0,M=0,A=0,L=0,N=0,W=0,P=n[0],U=n[1],D=n[2],j=n[3],B=n[4],q=n[5],$=n[6],K=n[7],F=n[8],H=n[9],V=n[10],z=n[11],Z=n[12],G=n[13],Y=n[14],Q=n[15];i+=(r=t[0])*P,a+=r*U,s+=r*D,l+=r*j,c+=r*B,d+=r*q,u+=r*$,h+=r*K,p+=r*F,g+=r*H,f+=r*V,m+=r*z,w+=r*Z,v+=r*G,y+=r*Y,b+=r*Q,a+=(r=t[1])*P,s+=r*U,l+=r*D,c+=r*j,d+=r*B,u+=r*q,h+=r*$,p+=r*K,g+=r*F,f+=r*H,m+=r*V,w+=r*z,v+=r*Z,y+=r*G,b+=r*Y,C+=r*Q,s+=(r=t[2])*P,l+=r*U,c+=r*D,d+=r*j,u+=r*B,h+=r*q,p+=r*$,g+=r*K,f+=r*F,m+=r*H,w+=r*V,v+=r*z,y+=r*Z,b+=r*G,C+=r*Y,x+=r*Q,l+=(r=t[3])*P,c+=r*U,d+=r*D,u+=r*j,h+=r*B,p+=r*q,g+=r*$,f+=r*K,m+=r*F,w+=r*H,v+=r*V,y+=r*z,b+=r*Z,C+=r*G,x+=r*Y,S+=r*Q,c+=(r=t[4])*P,d+=r*U,u+=r*D,h+=r*j,p+=r*B,g+=r*q,f+=r*$,m+=r*K,w+=r*F,v+=r*H,y+=r*V,b+=r*z,C+=r*Z,x+=r*G,S+=r*Y,k+=r*Q,d+=(r=t[5])*P,u+=r*U,h+=r*D,p+=r*j,g+=r*B,f+=r*q,m+=r*$,w+=r*K,v+=r*F,y+=r*H,b+=r*V,C+=r*z,x+=r*Z,S+=r*G,k+=r*Y,_+=r*Q,u+=(r=t[6])*P,h+=r*U,p+=r*D,g+=r*j,f+=r*B,m+=r*q,w+=r*$,v+=r*K,y+=r*F,b+=r*H,C+=r*V,x+=r*z,S+=r*Z,k+=r*G,_+=r*Y,E+=r*Q,h+=(r=t[7])*P,p+=r*U,g+=r*D,f+=r*j,m+=r*B,w+=r*q,v+=r*$,y+=r*K,b+=r*F,C+=r*H,x+=r*V,S+=r*z,k+=r*Z,_+=r*G,E+=r*Y,R+=r*Q,p+=(r=t[8])*P,g+=r*U,f+=r*D,m+=r*j,w+=r*B,v+=r*q,y+=r*$,b+=r*K,C+=r*F,x+=r*H,S+=r*V,k+=r*z,_+=r*Z,E+=r*G,R+=r*Y,T+=r*Q,g+=(r=t[9])*P,f+=r*U,m+=r*D,w+=r*j,v+=r*B,y+=r*q,b+=r*$,C+=r*K,x+=r*F,S+=r*H,k+=r*V,_+=r*z,E+=r*Z,R+=r*G,T+=r*Y,I+=r*Q,f+=(r=t[10])*P,m+=r*U,w+=r*D,v+=r*j,y+=r*B,b+=r*q,C+=r*$,x+=r*K,S+=r*F,k+=r*H,_+=r*V,E+=r*z,R+=r*Z,T+=r*G,I+=r*Y,O+=r*Q,m+=(r=t[11])*P,w+=r*U,v+=r*D,y+=r*j,b+=r*B,C+=r*q,x+=r*$,S+=r*K,k+=r*F,_+=r*H,E+=r*V,R+=r*z,T+=r*Z,I+=r*G,O+=r*Y,M+=r*Q,w+=(r=t[12])*P,v+=r*U,y+=r*D,b+=r*j,C+=r*B,x+=r*q,S+=r*$,k+=r*K,_+=r*F,E+=r*H,R+=r*V,T+=r*z,I+=r*Z,O+=r*G,M+=r*Y,A+=r*Q,v+=(r=t[13])*P,y+=r*U,b+=r*D,C+=r*j,x+=r*B,S+=r*q,k+=r*$,_+=r*K,E+=r*F,R+=r*H,T+=r*V,I+=r*z,O+=r*Z,M+=r*G,A+=r*Y,L+=r*Q,y+=(r=t[14])*P,b+=r*U,C+=r*D,x+=r*j,S+=r*B,k+=r*q,_+=r*$,E+=r*K,R+=r*F,T+=r*H,I+=r*V,O+=r*z,M+=r*Z,A+=r*G,L+=r*Y,N+=r*Q,b+=(r=t[15])*P,a+=38*(x+=r*D),s+=38*(S+=r*j),l+=38*(k+=r*B),c+=38*(_+=r*q),d+=38*(E+=r*$),u+=38*(R+=r*K),h+=38*(T+=r*F),p+=38*(I+=r*H),g+=38*(O+=r*V),f+=38*(M+=r*z),m+=38*(A+=r*Z),w+=38*(L+=r*G),v+=38*(N+=r*Y),y+=38*(W+=r*Q),i=(r=(i+=38*(C+=r*U))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),i=(r=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),i+=o-1+37*(o-1),e[0]=i,e[1]=a,e[2]=s,e[3]=l,e[4]=c,e[5]=d,e[6]=u,e[7]=h,e[8]=p,e[9]=g,e[10]=f,e[11]=m,e[12]=w,e[13]=v,e[14]=y,e[15]=b}function q(e,t){B(e,t,t)}function $(e,n){var r,o=t();for(r=0;r<16;r++)o[r]=n[r];for(r=253;r>=0;r--)q(o,o),2!==r&&4!==r&&B(o,o,n);for(r=0;r<16;r++)e[r]=o[r]}function K(e,n){var r,o=t();for(r=0;r<16;r++)o[r]=n[r];for(r=250;r>=0;r--)q(o,o),1!==r&&B(o,o,n);for(r=0;r<16;r++)e[r]=o[r]}function F(e,n,r){var o,i,a=new Uint8Array(32),l=new Float64Array(80),c=t(),d=t(),u=t(),h=t(),p=t(),g=t();for(i=0;i<31;i++)a[i]=n[i];for(a[31]=127&n[31]|64,a[0]&=248,U(l,r),i=0;i<16;i++)d[i]=l[i],h[i]=c[i]=u[i]=0;for(c[0]=h[0]=1,i=254;i>=0;--i)L(c,d,o=a[i>>>3]>>>(7&i)&1),L(u,h,o),D(p,c,u),j(c,c,u),D(u,d,h),j(d,d,h),q(h,p),q(g,c),B(c,u,c),B(u,d,p),D(p,c,u),j(c,c,u),q(d,c),j(u,h,g),B(c,u,s),D(c,c,h),B(u,u,c),B(c,h,g),B(h,d,l),q(d,p),L(c,d,o),L(u,h,o);for(i=0;i<16;i++)l[i+16]=c[i],l[i+32]=u[i],l[i+48]=d[i],l[i+64]=h[i];var f=l.subarray(32),m=l.subarray(16);return $(f,f),B(m,m,f),N(e,m),0}function H(e,t){return F(e,t,o)}function V(e,t){return n(t,32),H(e,t)}function z(e,t,n){var o=new Uint8Array(32);return F(o,n,t),v(e,r,o,y)}k.prototype.blocks=function(e,t,n){for(var r,o,i,a,s,l,c,d,u,h,p,g,f,m,w,v,y,b,C,x=this.fin?0:2048,S=this.h[0],k=this.h[1],_=this.h[2],E=this.h[3],R=this.h[4],T=this.h[5],I=this.h[6],O=this.h[7],M=this.h[8],A=this.h[9],L=this.r[0],N=this.r[1],W=this.r[2],P=this.r[3],U=this.r[4],D=this.r[5],j=this.r[6],B=this.r[7],q=this.r[8],$=this.r[9];n>=16;)h=u=0,h+=(S+=8191&(r=255&e[t+0]|(255&e[t+1])<<8))*L,h+=(k+=8191&(r>>>13|(o=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*$),h+=(_+=8191&(o>>>10|(i=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*q),h+=(E+=8191&(i>>>7|(a=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*B),u=(h+=(R+=8191&(a>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*j))>>>13,h&=8191,h+=(T+=s>>>1&8191)*(5*D),h+=(I+=8191&(s>>>14|(l=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*U),h+=(O+=8191&(l>>>11|(c=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*P),h+=(M+=8191&(c>>>8|(d=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*W),p=u+=(h+=(A+=d>>>5|x)*(5*N))>>>13,p+=S*N,p+=k*L,p+=_*(5*$),p+=E*(5*q),u=(p+=R*(5*B))>>>13,p&=8191,p+=T*(5*j),p+=I*(5*D),p+=O*(5*U),p+=M*(5*P),u+=(p+=A*(5*W))>>>13,p&=8191,g=u,g+=S*W,g+=k*N,g+=_*L,g+=E*(5*$),u=(g+=R*(5*q))>>>13,g&=8191,g+=T*(5*B),g+=I*(5*j),g+=O*(5*D),g+=M*(5*U),f=u+=(g+=A*(5*P))>>>13,f+=S*P,f+=k*W,f+=_*N,f+=E*L,u=(f+=R*(5*$))>>>13,f&=8191,f+=T*(5*q),f+=I*(5*B),f+=O*(5*j),f+=M*(5*D),m=u+=(f+=A*(5*U))>>>13,m+=S*U,m+=k*P,m+=_*W,m+=E*N,u=(m+=R*L)>>>13,m&=8191,m+=T*(5*$),m+=I*(5*q),m+=O*(5*B),m+=M*(5*j),w=u+=(m+=A*(5*D))>>>13,w+=S*D,w+=k*U,w+=_*P,w+=E*W,u=(w+=R*N)>>>13,w&=8191,w+=T*L,w+=I*(5*$),w+=O*(5*q),w+=M*(5*B),v=u+=(w+=A*(5*j))>>>13,v+=S*j,v+=k*D,v+=_*U,v+=E*P,u=(v+=R*W)>>>13,v&=8191,v+=T*N,v+=I*L,v+=O*(5*$),v+=M*(5*q),y=u+=(v+=A*(5*B))>>>13,y+=S*B,y+=k*j,y+=_*D,y+=E*U,u=(y+=R*P)>>>13,y&=8191,y+=T*W,y+=I*N,y+=O*L,y+=M*(5*$),b=u+=(y+=A*(5*q))>>>13,b+=S*q,b+=k*B,b+=_*j,b+=E*D,u=(b+=R*U)>>>13,b&=8191,b+=T*P,b+=I*W,b+=O*N,b+=M*L,C=u+=(b+=A*(5*$))>>>13,C+=S*$,C+=k*q,C+=_*B,C+=E*j,u=(C+=R*D)>>>13,C&=8191,C+=T*U,C+=I*P,C+=O*W,C+=M*N,S=h=8191&(u=(u=((u+=(C+=A*L)>>>13)<<2)+u|0)+(h&=8191)|0),k=p+=u>>>=13,_=g&=8191,E=f&=8191,R=m&=8191,T=w&=8191,I=v&=8191,O=y&=8191,M=b&=8191,A=C&=8191,t+=16,n-=16;this.h[0]=S,this.h[1]=k,this.h[2]=_,this.h[3]=E,this.h[4]=R,this.h[5]=T,this.h[6]=I,this.h[7]=O,this.h[8]=M,this.h[9]=A},k.prototype.finish=function(e,t){var n,r,o,i,a=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,a[0]=this.h[0]+5,n=a[0]>>>13,a[0]&=8191,i=1;i<10;i++)a[i]=this.h[i]+n,n=a[i]>>>13,a[i]&=8191;for(a[9]-=8192,r=(1^n)-1,i=0;i<10;i++)a[i]&=r;for(r=~r,i=0;i<10;i++)this.h[i]=this.h[i]&r|a[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},k.prototype.update=function(e,t,n){var r,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),r=0;r<o;r++)this.buffer[this.leftover+r]=e[t+r];if(n-=o,t+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(e,t,o),t+=o,n-=o),n){for(r=0;r<n;r++)this.buffer[this.leftover+r]=e[t+r];this.leftover+=n}};var Z=R,G=I,Y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Q(e,t,n,r){for(var o,i,a,s,l,c,d,u,h,p,g,f,m,w,v,y,b,C,x,S,k,_,E,R,T,I,O=new Int32Array(16),M=new Int32Array(16),A=e[0],L=e[1],N=e[2],W=e[3],P=e[4],U=e[5],D=e[6],j=e[7],B=t[0],q=t[1],$=t[2],K=t[3],F=t[4],H=t[5],V=t[6],z=t[7],Z=0;r>=128;){for(x=0;x<16;x++)S=8*x+Z,O[x]=n[S+0]<<24|n[S+1]<<16|n[S+2]<<8|n[S+3],M[x]=n[S+4]<<24|n[S+5]<<16|n[S+6]<<8|n[S+7];for(x=0;x<80;x++)if(o=A,i=L,a=N,s=W,l=P,c=U,d=D,h=B,p=q,g=$,f=K,m=F,w=H,v=V,E=65535&(_=z),R=_>>>16,T=65535&(k=j),I=k>>>16,E+=65535&(_=(F>>>14|P<<18)^(F>>>18|P<<14)^(P>>>9|F<<23)),R+=_>>>16,T+=65535&(k=(P>>>14|F<<18)^(P>>>18|F<<14)^(F>>>9|P<<23)),I+=k>>>16,E+=65535&(_=F&H^~F&V),R+=_>>>16,T+=65535&(k=P&U^~P&D),I+=k>>>16,E+=65535&(_=Y[2*x+1]),R+=_>>>16,T+=65535&(k=Y[2*x]),I+=k>>>16,k=O[x%16],R+=(_=M[x%16])>>>16,T+=65535&k,I+=k>>>16,T+=(R+=(E+=65535&_)>>>16)>>>16,E=65535&(_=C=65535&E|R<<16),R=_>>>16,T=65535&(k=b=65535&T|(I+=T>>>16)<<16),I=k>>>16,E+=65535&(_=(B>>>28|A<<4)^(A>>>2|B<<30)^(A>>>7|B<<25)),R+=_>>>16,T+=65535&(k=(A>>>28|B<<4)^(B>>>2|A<<30)^(B>>>7|A<<25)),I+=k>>>16,R+=(_=B&q^B&$^q&$)>>>16,T+=65535&(k=A&L^A&N^L&N),I+=k>>>16,u=65535&(T+=(R+=(E+=65535&_)>>>16)>>>16)|(I+=T>>>16)<<16,y=65535&E|R<<16,E=65535&(_=f),R=_>>>16,T=65535&(k=s),I=k>>>16,R+=(_=C)>>>16,T+=65535&(k=b),I+=k>>>16,L=o,N=i,W=a,P=s=65535&(T+=(R+=(E+=65535&_)>>>16)>>>16)|(I+=T>>>16)<<16,U=l,D=c,j=d,A=u,q=h,$=p,K=g,F=f=65535&E|R<<16,H=m,V=w,z=v,B=y,x%16==15)for(S=0;S<16;S++)k=O[S],E=65535&(_=M[S]),R=_>>>16,T=65535&k,I=k>>>16,k=O[(S+9)%16],E+=65535&(_=M[(S+9)%16]),R+=_>>>16,T+=65535&k,I+=k>>>16,b=O[(S+1)%16],E+=65535&(_=((C=M[(S+1)%16])>>>1|b<<31)^(C>>>8|b<<24)^(C>>>7|b<<25)),R+=_>>>16,T+=65535&(k=(b>>>1|C<<31)^(b>>>8|C<<24)^b>>>7),I+=k>>>16,b=O[(S+14)%16],R+=(_=((C=M[(S+14)%16])>>>19|b<<13)^(b>>>29|C<<3)^(C>>>6|b<<26))>>>16,T+=65535&(k=(b>>>19|C<<13)^(C>>>29|b<<3)^b>>>6),I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,O[S]=65535&T|I<<16,M[S]=65535&E|R<<16;E=65535&(_=B),R=_>>>16,T=65535&(k=A),I=k>>>16,k=e[0],R+=(_=t[0])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[0]=A=65535&T|I<<16,t[0]=B=65535&E|R<<16,E=65535&(_=q),R=_>>>16,T=65535&(k=L),I=k>>>16,k=e[1],R+=(_=t[1])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[1]=L=65535&T|I<<16,t[1]=q=65535&E|R<<16,E=65535&(_=$),R=_>>>16,T=65535&(k=N),I=k>>>16,k=e[2],R+=(_=t[2])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[2]=N=65535&T|I<<16,t[2]=$=65535&E|R<<16,E=65535&(_=K),R=_>>>16,T=65535&(k=W),I=k>>>16,k=e[3],R+=(_=t[3])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[3]=W=65535&T|I<<16,t[3]=K=65535&E|R<<16,E=65535&(_=F),R=_>>>16,T=65535&(k=P),I=k>>>16,k=e[4],R+=(_=t[4])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[4]=P=65535&T|I<<16,t[4]=F=65535&E|R<<16,E=65535&(_=H),R=_>>>16,T=65535&(k=U),I=k>>>16,k=e[5],R+=(_=t[5])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[5]=U=65535&T|I<<16,t[5]=H=65535&E|R<<16,E=65535&(_=V),R=_>>>16,T=65535&(k=D),I=k>>>16,k=e[6],R+=(_=t[6])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[6]=D=65535&T|I<<16,t[6]=V=65535&E|R<<16,E=65535&(_=z),R=_>>>16,T=65535&(k=j),I=k>>>16,k=e[7],R+=(_=t[7])>>>16,T+=65535&k,I+=k>>>16,I+=(T+=(R+=(E+=65535&_)>>>16)>>>16)>>>16,e[7]=j=65535&T|I<<16,t[7]=z=65535&E|R<<16,Z+=128,r-=128}return r}function J(e,t,n){var r,o=new Int32Array(8),i=new Int32Array(8),a=new Uint8Array(256),s=n;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,Q(o,i,t,n),n%=128,r=0;r<n;r++)a[r]=t[s-n+r];for(a[n]=128,a[(n=256-128*(n<112?1:0))-9]=0,p(a,n-8,s/536870912|0,s<<3),Q(o,i,a,n),r=0;r<8;r++)p(e,8*r,o[r],i[r]);return 0}function X(e,n){var r=t(),o=t(),i=t(),a=t(),s=t(),l=t(),d=t(),u=t(),h=t();j(r,e[1],e[0]),j(h,n[1],n[0]),B(r,r,h),D(o,e[0],e[1]),D(h,n[0],n[1]),B(o,o,h),B(i,e[3],n[3]),B(i,i,c),B(a,e[2],n[2]),D(a,a,a),j(s,o,r),j(l,a,i),D(d,a,i),D(u,o,r),B(e[0],s,l),B(e[1],u,d),B(e[2],d,l),B(e[3],s,u)}function ee(e,t,n){var r;for(r=0;r<4;r++)L(e[r],t[r],n)}function te(e,n){var r=t(),o=t(),i=t();$(i,n[2]),B(r,n[0],i),B(o,n[1],i),N(e,o),e[31]^=P(r)<<7}function ne(e,t,n){var r,o;for(M(e[0],i),M(e[1],a),M(e[2],a),M(e[3],i),o=255;o>=0;--o)ee(e,t,r=n[o/8|0]>>(7&o)&1),X(t,e),X(e,e),ee(e,t,r)}function re(e,n){var r=[t(),t(),t(),t()];M(r[0],d),M(r[1],u),M(r[2],a),B(r[3],d,u),ne(e,r,n)}function oe(e,r,o){var i,a=new Uint8Array(64),s=[t(),t(),t(),t()];for(o||n(r,32),J(a,r,32),a[0]&=248,a[31]&=127,a[31]|=64,re(s,a),te(e,s),i=0;i<32;i++)r[i+32]=e[i];return 0}var ie=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var n,r,o,i;for(r=63;r>=32;--r){for(n=0,o=r-32,i=r-12;o<i;++o)t[o]+=n-16*t[r]*ie[o-(r-32)],n=Math.floor((t[o]+128)/256),t[o]-=256*n;t[o]+=n,t[r]=0}for(n=0,o=0;o<32;o++)t[o]+=n-(t[31]>>4)*ie[o],n=t[o]>>8,t[o]&=255;for(o=0;o<32;o++)t[o]-=n*ie[o];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=255&t[r]}function se(e){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,n)}function le(e,n,r,o){var i,a,s=new Uint8Array(64),l=new Uint8Array(64),c=new Uint8Array(64),d=new Float64Array(64),u=[t(),t(),t(),t()];J(s,o,32),s[0]&=248,s[31]&=127,s[31]|=64;var h=r+64;for(i=0;i<r;i++)e[64+i]=n[i];for(i=0;i<32;i++)e[32+i]=s[32+i];for(J(c,e.subarray(32),r+32),se(c),re(u,c),te(e,u),i=32;i<64;i++)e[i]=o[i];for(J(l,e,r+64),se(l),i=0;i<64;i++)d[i]=0;for(i=0;i<32;i++)d[i]=c[i];for(i=0;i<32;i++)for(a=0;a<32;a++)d[i+a]+=l[i]*s[a];return ae(e.subarray(32),d),h}function ce(e,n,r,o){var s,c=new Uint8Array(32),d=new Uint8Array(64),u=[t(),t(),t(),t()],p=[t(),t(),t(),t()];if(r<64)return-1;if(function(e,n){var r=t(),o=t(),s=t(),c=t(),d=t(),u=t(),p=t();return M(e[2],a),U(e[1],n),q(s,e[1]),B(c,s,l),j(s,s,e[2]),D(c,e[2],c),q(d,c),q(u,d),B(p,u,d),B(r,p,s),B(r,r,c),K(r,r),B(r,r,s),B(r,r,c),B(r,r,c),B(e[0],r,c),q(o,e[0]),B(o,o,c),W(o,s)&&B(e[0],e[0],h),q(o,e[0]),B(o,o,c),W(o,s)?-1:(P(e[0])===n[31]>>7&&j(e[0],i,e[0]),B(e[3],e[0],e[1]),0)}(p,o))return-1;for(s=0;s<r;s++)e[s]=n[s];for(s=0;s<32;s++)e[s+32]=o[s];if(J(d,e,r),se(d),ne(u,p,d),re(p,n.subarray(32)),X(u,p),te(c,u),r-=64,m(n,0,c,0)){for(s=0;s<r;s++)e[s]=0;return-1}for(s=0;s<r;s++)e[s]=n[s+64];return r}var de,ue=16,he=64,pe=32,ge=64;function fe(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function me(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function we(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:v,crypto_stream_xor:S,crypto_stream:x,crypto_stream_salsa20_xor:b,crypto_stream_salsa20:C,crypto_onetimeauth:_,crypto_onetimeauth_verify:E,crypto_verify_16:f,crypto_verify_32:m,crypto_secretbox:R,crypto_secretbox_open:I,crypto_scalarmult:F,crypto_scalarmult_base:H,crypto_box_beforenm:z,crypto_box_afternm:Z,crypto_box:function(e,t,n,r,o,i){var a=new Uint8Array(32);return z(a,o,i),Z(e,t,n,r,a)},crypto_box_open:function(e,t,n,r,o,i){var a=new Uint8Array(32);return z(a,o,i),G(e,t,n,r,a)},crypto_box_keypair:V,crypto_hash:J,crypto_sign:le,crypto_sign_keypair:oe,crypto_sign_open:ce,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:ue,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:he,crypto_sign_PUBLICKEYBYTES:pe,crypto_sign_SECRETKEYBYTES:ge,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:l,L:ie,pack25519:N,unpack25519:U,M:B,A:D,S:q,Z:j,pow2523:K,add:X,set25519:M,modL:ae,scalarmult:ne,scalarbase:re},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,n){me(e,t,n),fe(n,t);for(var r=new Uint8Array(32+e.length),o=new Uint8Array(r.length),i=0;i<e.length;i++)r[i+32]=e[i];return R(o,r,r.length,t,n),o.subarray(ue)},e.secretbox.open=function(e,t,n){me(e,t,n),fe(n,t);for(var r=new Uint8Array(ue+e.length),o=new Uint8Array(r.length),i=0;i<e.length;i++)r[i+ue]=e[i];return r.length<32||0!==I(o,r,r.length,t,n)?null:o.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=ue,e.scalarMult=function(e,t){if(me(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var n=new Uint8Array(32);return F(n,e,t),n},e.scalarMult.base=function(e){if(me(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return H(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,n,r,o){var i=e.box.before(r,o);return e.secretbox(t,n,i)},e.box.before=function(e,t){me(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var n=new Uint8Array(32);return z(n,e,t),n},e.box.after=e.secretbox,e.box.open=function(t,n,r,o){var i=e.box.before(r,o);return e.secretbox.open(t,n,i)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return V(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(me(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return H(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(me(e,t),t.length!==ge)throw new Error("bad secret key size");var n=new Uint8Array(he+e.length);return le(n,e,e.length,t),n},e.sign.open=function(e,t){if(me(e,t),t.length!==pe)throw new Error("bad public key size");var n=new Uint8Array(e.length),r=ce(n,e,e.length,t);if(r<0)return null;for(var o=new Uint8Array(r),i=0;i<o.length;i++)o[i]=n[i];return o},e.sign.detached=function(t,n){for(var r=e.sign(t,n),o=new Uint8Array(he),i=0;i<o.length;i++)o[i]=r[i];return o},e.sign.detached.verify=function(e,t,n){if(me(e,t,n),t.length!==he)throw new Error("bad signature size");if(n.length!==pe)throw new Error("bad public key size");var r,o=new Uint8Array(he+e.length),i=new Uint8Array(he+e.length);for(r=0;r<he;r++)o[r]=t[r];for(r=0;r<e.length;r++)o[r+he]=e[r];return ce(i,o,o.length,n)>=0},e.sign.keyPair=function(){var e=new Uint8Array(pe),t=new Uint8Array(ge);return oe(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(me(e),e.length!==ge)throw new Error("bad secret key size");for(var t=new Uint8Array(pe),n=0;n<t.length;n++)t[n]=e[32+n];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(me(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(pe),n=new Uint8Array(ge),r=0;r<32;r++)n[r]=e[r];return oe(t,n,!0),{publicKey:t,secretKey:n}},e.sign.publicKeyLength=pe,e.sign.secretKeyLength=ge,e.sign.seedLength=32,e.sign.signatureLength=he,e.hash=function(e){me(e);var t=new Uint8Array(64);return J(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return me(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===g(e,0,t,0,e.length)},e.setPRNG=function(e){n=e},(de="undefined"!=typeof self?self.crypto||self.msCrypto:null)&&de.getRandomValues?e.setPRNG(function(e,t){var n,r=new Uint8Array(t);for(n=0;n<t;n+=65536)de.getRandomValues(r.subarray(n,n+Math.min(t-n,65536)));for(n=0;n<t;n++)e[n]=r[n];we(r)}):void 0!==T&&(de=O)&&de.randomBytes&&e.setPRNG(function(e,t){var n,r=de.randomBytes(t);for(n=0;n<t;n++)e[n]=r[n];we(r)})}(e.exports?e.exports:self.nacl=self.nacl||{})}(I)),I.exports);const L=b(A);var N,W,P,U,D,j,B;e.CONNECT_EVENT_ERROR_CODES=void 0,(N=e.CONNECT_EVENT_ERROR_CODES||(e.CONNECT_EVENT_ERROR_CODES={}))[N.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",N[N.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",N[N.MANIFEST_NOT_FOUND_ERROR=2]="MANIFEST_NOT_FOUND_ERROR",N[N.MANIFEST_CONTENT_ERROR=3]="MANIFEST_CONTENT_ERROR",N[N.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",N[N.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",N[N.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",e.CONNECT_ITEM_ERROR_CODES=void 0,(W=e.CONNECT_ITEM_ERROR_CODES||(e.CONNECT_ITEM_ERROR_CODES={}))[W.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",W[W.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",e.SEND_TRANSACTION_ERROR_CODES=void 0,(P=e.SEND_TRANSACTION_ERROR_CODES||(e.SEND_TRANSACTION_ERROR_CODES={}))[P.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",P[P.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",P[P.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",P[P.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",P[P.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",e.SIGN_DATA_ERROR_CODES=void 0,(U=e.SIGN_DATA_ERROR_CODES||(e.SIGN_DATA_ERROR_CODES={}))[U.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",U[U.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",U[U.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",U[U.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",U[U.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",(j=D||(D={}))[j.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",j[j.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",j[j.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",j[j.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",e.CHAIN=void 0,(B=e.CHAIN||(e.CHAIN={})).MAINNET="-239",B.TESTNET="-3";const q={encode:function(e,t=!1){let n;return e instanceof Uint8Array?n=e:("string"!=typeof e&&(e=JSON.stringify(e)),n=R.decodeUTF8(e)),function(e,t){const n=R.encodeBase64(e);return t?encodeURIComponent(n):n}(n,t)},decode:function(e,t=!1){const n=function(e,t){return t&&(e=decodeURIComponent(e)),R.decodeBase64(e)}(e,t);return{toString:()=>R.encodeUTF8(n),toObject(){try{return JSON.parse(R.encodeUTF8(n))}catch(e){return null}},toUint8Array:()=>n}}};function $(e){let t="";return e.forEach(e=>{t+=("0"+(255&e).toString(16)).slice(-2)}),t}function K(e){if(e.length%2!=0)throw new Error(`Cannot convert ${e} to bytesArray`);const t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n/2]=parseInt(e.slice(n,n+2),16);return t}class F{constructor(e){this.nonceLength=24,this.keyPair=e?this.createKeypairFromString(e):this.createKeypair(),this.sessionId=$(this.keyPair.publicKey)}createKeypair(){return L.box.keyPair()}createKeypairFromString(e){return{publicKey:K(e.publicKey),secretKey:K(e.secretKey)}}createNonce(){return L.randomBytes(this.nonceLength)}encrypt(e,t){const n=(new TextEncoder).encode(e),r=this.createNonce();return function(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(r,L.box(n,r,t,this.keyPair.secretKey))}decrypt(e,t){const[n,r]=function(e,t){if(t>=e.length)throw new Error("Index is out of buffer");return[e.slice(0,t),e.slice(t)]}(e,this.nonceLength),o=L.box.open(r,n,t,this.keyPair.secretKey);if(!o)throw new Error(`Decryption error: \n message: ${e.toString()} \n sender pubkey: ${t.toString()} \n keypair pubkey: ${this.keyPair.publicKey.toString()} \n keypair secretkey: ${this.keyPair.secretKey.toString()}`);return(new TextDecoder).decode(o)}stringifyKeypair(){return{publicKey:$(this.keyPair.publicKey),secretKey:$(this.keyPair.secretKey)}}}function H(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function V(e,t,n,r){return new(n||(n=Promise))(function(t,o){function i(e){try{s(r.next(e))}catch(t){o(t)}}function a(e){try{s(r.throw(e))}catch(t){o(t)}}function s(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n(function(e){e(r)})).then(i,a)}s((r=r.apply(e,[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class z extends Error{get info(){return""}constructor(e,t){super(e,t),this.message=`${z.prefix} ${this.constructor.name}${this.info?": "+this.info:""}${e?"\n"+e:""}`,Object.setPrototypeOf(this,z.prototype)}}z.prefix="[TON_CONNECT_SDK_ERROR]";class Z extends z{get info(){return"Passed DappMetadata is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,Z.prototype)}}class G extends z{get info(){return"Passed `tonconnect-manifest.json` contains errors. Check format of your manifest. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...e){super(...e),Object.setPrototypeOf(this,G.prototype)}}class Y extends z{get info(){return"Manifest not found. Make sure you added `tonconnect-manifest.json` to the root of your app or passed correct manifestUrl. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...e){super(...e),Object.setPrototypeOf(this,Y.prototype)}}class Q extends z{get info(){return"Wallet connection called but wallet already connected. To avoid the error, disconnect the wallet before doing a new connection."}constructor(...e){super(...e),Object.setPrototypeOf(this,Q.prototype)}}class J extends z{get info(){return"Send transaction or other protocol methods called while wallet is not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,J.prototype)}}class X extends z{get info(){return"There is an attempt to connect to the injected wallet while it is not exists in the webpage."}constructor(...e){super(...e),Object.setPrototypeOf(this,X.prototype)}}class ee extends z{get info(){return"Wallet doesn't support requested feature method."}constructor(e,t){super(e,t),Object.setPrototypeOf(this,ee.prototype)}}class te extends z{get info(){return"Missing required features. You need to update your wallet."}constructor(e,t){super(e,t),Object.setPrototypeOf(this,te.prototype)}}class ne extends z{constructor(e,t){super(e,t),this.name="WalletWrongNetworkError",Object.setPrototypeOf(this,ne.prototype)}}class re extends z{get info(){return"User rejects the action in the wallet."}constructor(...e){super(...e),Object.setPrototypeOf(this,re.prototype)}}class oe extends z{get info(){return"Request to the wallet contains errors."}constructor(...e){super(...e),Object.setPrototypeOf(this,oe.prototype)}}class ie extends z{get info(){return"App tries to send rpc request to the injected wallet while not connected."}constructor(...e){super(...e),Object.setPrototypeOf(this,ie.prototype)}}class ae extends z{get info(){return"Storage was not specified in the `DappMetadata` and default `localStorage` was not detected in the environment."}constructor(...e){super(...e),Object.setPrototypeOf(this,ae.prototype)}}class se extends z{get info(){return"An error occurred while fetching the wallets list."}constructor(...e){super(...e),Object.setPrototypeOf(this,se.prototype)}}class le extends z{get info(){return"Passed address is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,le.prototype)}}class ce extends z{get info(){return"Passed hex is in incorrect format."}constructor(...e){super(...e),Object.setPrototypeOf(this,ce.prototype)}}class de extends z{constructor(...e){super(...e),Object.setPrototypeOf(this,de.prototype)}}const ue={[e.CONNECT_EVENT_ERROR_CODES.UNKNOWN_ERROR]:de,[e.CONNECT_EVENT_ERROR_CODES.USER_REJECTS_ERROR]:re,[e.CONNECT_EVENT_ERROR_CODES.BAD_REQUEST_ERROR]:oe,[e.CONNECT_EVENT_ERROR_CODES.UNKNOWN_APP_ERROR]:ie,[e.CONNECT_EVENT_ERROR_CODES.MANIFEST_NOT_FOUND_ERROR]:Y,[e.CONNECT_EVENT_ERROR_CODES.MANIFEST_CONTENT_ERROR]:G};const he=new class{parseError(e){let t=de;return e.code in ue&&(t=ue[e.code]||de),new t(e.message)}};class pe{isError(e){return"error"in e}}const ge={[e.SEND_TRANSACTION_ERROR_CODES.UNKNOWN_ERROR]:de,[e.SEND_TRANSACTION_ERROR_CODES.USER_REJECTS_ERROR]:re,[e.SEND_TRANSACTION_ERROR_CODES.BAD_REQUEST_ERROR]:oe,[e.SEND_TRANSACTION_ERROR_CODES.UNKNOWN_APP_ERROR]:ie};const fe=new class extends pe{convertToRpcRequest(e){return{method:"sendTransaction",params:[JSON.stringify(e)]}}parseAndThrowError(e){let t=de;throw e.error.code in ge&&(t=ge[e.error.code]||de),new t(e.error.message)}convertFromRpcResponse(e){return{boc:e.result}}},me={[e.SIGN_DATA_ERROR_CODES.UNKNOWN_ERROR]:de,[e.SIGN_DATA_ERROR_CODES.USER_REJECTS_ERROR]:re,[e.SIGN_DATA_ERROR_CODES.BAD_REQUEST_ERROR]:oe,[e.SIGN_DATA_ERROR_CODES.UNKNOWN_APP_ERROR]:ie};const we=new class extends pe{convertToRpcRequest(e){return{method:"signData",params:[JSON.stringify(e)]}}parseAndThrowError(e){let t=de;throw e.error.code in me&&(t=me[e.error.code]||de),new t(e.error.message)}convertFromRpcResponse(e){return e.result}};class ve{constructor(e,t){this.storage=e,this.storeKey="ton-connect-storage_http-bridge-gateway::"+t}storeLastEventId(e){return V(this,0,void 0,function*(){return this.storage.setItem(this.storeKey,e)})}removeLastEventId(){return V(this,0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getLastEventId(){return V(this,0,void 0,function*(){const e=yield this.storage.getItem(this.storeKey);return e||null})}}function ye(e,t){return function(e){return"/"===e.slice(-1)?e.slice(0,-1):e}(e)+"/"+t}function be(e){if(!e)return!1;const t=new URL(e);return"tg:"===t.protocol||"t.me"===t.hostname}function Ce(e){return!!e&&(e.includes("ton_addr")||e.includes("ton--5Faddr"))}function xe(e){return e.replaceAll(".","%2E").replaceAll("-","%2D").replaceAll("_","%5F").replaceAll("&","-").replaceAll("=","__").replaceAll("%","--")}function Se(e){return e.replaceAll("--","%").replaceAll("__","=").replaceAll("-","&").replaceAll("%5F","_").replaceAll("%2D","-").replaceAll("%2E",".")}function ke(e,t){return V(this,0,void 0,function*(){return new Promise((t,n)=>{setTimeout(()=>t(),e)})})}function _e(e){const t=new AbortController;return(null==e?void 0:e.aborted)?t.abort():null==e||e.addEventListener("abort",()=>t.abort(),{once:!0}),t}function Ee(e,t){return V(this,0,void 0,function*(){var n,r;const o=null!==(n=null==t?void 0:t.attempts)&&void 0!==n?n:10,i=null!==(r=null==t?void 0:t.delayMs)&&void 0!==r?r:200,a=_e(null==t?void 0:t.signal);if("function"!=typeof e)throw new z("Expected a function, got "+typeof e);let s,l=0;for(;l<o;){if(a.signal.aborted)throw new z(`Aborted after attempts ${l}`);try{return yield e({signal:a.signal})}catch(c){s=c,l++,l<o&&(yield ke(i))}}throw s})}function Re(...e){try{console.debug("[TON_CONNECT_SDK]",...e)}catch(t){}}function Te(...e){try{console.error("[TON_CONNECT_SDK]",...e)}catch(t){}}class Ie{get isReady(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)===EventSource.OPEN}get isClosed(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)!==EventSource.OPEN}get isConnecting(){const e=this.eventSource.current();return(null==e?void 0:e.readyState)===EventSource.CONNECTING}constructor(e,t,n,r,o,i){this.bridgeUrl=t,this.sessionId=n,this.listener=r,this.errorsListener=o,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.defaultReconnectDelay=2e3,this.defaultResendDelay=5e3,this.eventSource=function(e,t){let n=null,r=null,o=null,i=null,a=null;const s=(s,...l)=>V(this,0,void 0,function*(){if(i=null!=s?s:null,null==a||a.abort(),a=_e(s),a.signal.aborted)throw new z("Resource creation was aborted");r=null!=l?l:null;const c=e(a.signal,...l);o=c;const d=yield c;if(o!==c&&d!==n)throw yield t(d),new z("Resource creation was aborted by a new resource creation");return n=d,n});return{create:s,current:()=>null!=n?n:null,dispose:()=>V(this,0,void 0,function*(){try{const r=n;n=null;const i=o;o=null;try{null==a||a.abort()}catch(e){}yield Promise.allSettled([r?t(r):Promise.resolve(),i?t(yield i):Promise.resolve()])}catch(e){}}),recreate:e=>V(this,0,void 0,function*(){const t=n,a=o,l=r,c=i;if(yield ke(e),t===n&&a===o&&l===r&&c===i)return yield s(i,...null!=l?l:[]);throw new z("Resource recreation was aborted by a new resource creation")})}}((e,t,n)=>V(this,0,void 0,function*(){const r={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:e,openingDeadlineMS:t,traceId:n};return yield function(e){return V(this,0,void 0,function*(){return yield function(e,t){const n=null==t?void 0:t.timeout,r=_e(null==t?void 0:t.signal);return new Promise((t,o)=>V(this,0,void 0,function*(){if(r.signal.aborted)return void o(new z("Operation aborted"));let i;void 0!==n&&(i=setTimeout(()=>{r.abort(),o(new z(`Timeout after ${n}ms`))},n)),r.signal.addEventListener("abort",()=>{clearTimeout(i),o(new z("Operation aborted"))},{once:!0});const a={timeout:n,abort:r.signal};yield e((...e)=>{clearTimeout(i),t(...e)},()=>{clearTimeout(i),o()},a)}))}((t,n,r)=>V(this,0,void 0,function*(){var o;const i=_e(r.signal).signal;if(i.aborted)return void n(new z("Bridge connection aborted"));const a=new URL(ye(e.bridgeUrl,e.ssePath));a.searchParams.append("client_id",e.sessionId);const s=yield e.bridgeGatewayStorage.getLastEventId();if(s&&a.searchParams.append("last_event_id",s),e.traceId&&a.searchParams.append("trace_id",e.traceId),i.aborted)return void n(new z("Bridge connection aborted"));const l=new EventSource(a.toString());l.onerror=r=>V(this,0,void 0,function*(){if(i.aborted)return l.close(),void n(new z("Bridge connection aborted"));try{const n=yield e.errorHandler(l,r);n!==l&&l.close(),n&&n!==l&&t(n)}catch(o){l.close(),n(o)}}),l.onopen=()=>{if(i.aborted)return l.close(),void n(new z("Bridge connection aborted"));t(l)},l.onmessage=t=>{if(i.aborted)return l.close(),void n(new z("Bridge connection aborted"));e.messageHandler(t)},null===(o=e.signal)||void 0===o||o.addEventListener("abort",()=>{l.close(),n(new z("Bridge connection aborted"))})}),{timeout:e.openingDeadlineMS,signal:e.signal})})}(r)}),e=>V(this,0,void 0,function*(){e.close()})),this.bridgeGatewayStorage=new ve(e,t),this.analytics=null==i?void 0:i.scoped({bridge_url:t,client_id:n})}registerSession(e){return V(this,0,void 0,function*(){var t,n,r;try{null===(t=this.analytics)||void 0===t||t.emitBridgeClientConnectStarted({trace_id:null==e?void 0:e.traceId});const r=Date.now();yield this.eventSource.create(null==e?void 0:e.signal,null==e?void 0:e.openingDeadlineMS,null==e?void 0:e.traceId);const o=Date.now()-r;null===(n=this.analytics)||void 0===n||n.emitBridgeClientConnectEstablished({bridge_connect_duration:o,trace_id:null==e?void 0:e.traceId})}catch(o){throw null===(r=this.analytics)||void 0===r||r.emitBridgeClientConnectError({trace_id:null==e?void 0:e.traceId,error_message:String(o)}),o}})}send(e,t,n,r){return V(this,0,void 0,function*(){var o;const i={};"number"==typeof r?i.ttl=r:(i.ttl=null==r?void 0:r.ttl,i.signal=null==r?void 0:r.signal,i.attempts=null==r?void 0:r.attempts,i.traceId=null==r?void 0:r.traceId);const a=new URL(ye(this.bridgeUrl,this.postPath));a.searchParams.append("client_id",this.sessionId),a.searchParams.append("to",t),a.searchParams.append("ttl",((null==i?void 0:i.ttl)||this.defaultTtl).toString()),a.searchParams.append("topic",n),(null==i?void 0:i.traceId)&&a.searchParams.append("trace_id",i.traceId);const s=q.encode(e);yield Ee(e=>V(this,0,void 0,function*(){const t=yield this.post(a,s,e.signal);if(!t.ok)throw new z(`Bridge send failed, status ${t.status}`)}),{attempts:null!==(o=null==i?void 0:i.attempts)&&void 0!==o?o:Number.MAX_SAFE_INTEGER,delayMs:this.defaultResendDelay,signal:null==i?void 0:i.signal})})}pause(){this.eventSource.dispose().catch(e=>Te(`Bridge pause failed, ${e}`))}unPause(){return V(this,0,void 0,function*(){yield this.eventSource.recreate(0)})}close(){return V(this,0,void 0,function*(){yield this.eventSource.dispose().catch(e=>Te(`Bridge close failed, ${e}`))})}setListener(e){this.listener=e}setErrorsListener(e){this.errorsListener=e}post(e,t,n){return V(this,0,void 0,function*(){const r=yield fetch(e,{method:"post",body:t,signal:n});if(!r.ok)throw new z(`Bridge send failed, status ${r.status}`);return r})}errorsHandler(e,t){return V(this,0,void 0,function*(){if(this.isConnecting)throw e.close(),new z("Bridge error, failed to connect");if(!this.isReady){if(this.isClosed)return e.close(),Re(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new z("Bridge error, unknown state")}try{this.errorsListener(t)}catch(n){}})}messagesHandler(e){return V(this,0,void 0,function*(){if(e.data===this.heartbeatMessage)return;if(yield this.bridgeGatewayStorage.storeLastEventId(e.lastEventId),this.isClosed)return;let t;try{const n=JSON.parse(e.data);t={message:n.message,from:n.from,traceId:n.trace_id}}catch(n){throw new z(`Bridge message parse failed, message ${e.data}`)}this.listener(t)})}}function Oe(e){return!("connectEvent"in e)}let Me;const Ae=new Uint8Array(16);function Le(){if(!Me){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Me=crypto.getRandomValues.bind(crypto)}return Me(Ae)}const Ne=[];for(let zp=0;zp<256;++zp)Ne.push((zp+256).toString(16).slice(1));const We={};function Pe(e,t,n){var r,o,i;let a;if(e)a=Ue(null!==(i=null!==(r=e.random)&&void 0!==r?r:null===(o=e.rng)||void 0===o?void 0:o.call(e))&&void 0!==i?i:Le(),e.msecs,e.seq,t,n);else{const e=Date.now(),r=Le();!function(e,t,n){var r,o;null!==(r=e.msecs)&&void 0!==r||(e.msecs=-1/0),null!==(o=e.seq)&&void 0!==o||(e.seq=0),t>e.msecs?(e.seq=n[6]<<23|n[7]<<16|n[8]<<8|n[9],e.msecs=t):(e.seq=e.seq+1|0,0===e.seq&&e.msecs++)}(We,e,r),a=Ue(r,We.msecs,We.seq,t,n)}return null!=t?t:function(e,t=0){return(Ne[e[t+0]]+Ne[e[t+1]]+Ne[e[t+2]]+Ne[e[t+3]]+"-"+Ne[e[t+4]]+Ne[e[t+5]]+"-"+Ne[e[t+6]]+Ne[e[t+7]]+"-"+Ne[e[t+8]]+Ne[e[t+9]]+"-"+Ne[e[t+10]]+Ne[e[t+11]]+Ne[e[t+12]]+Ne[e[t+13]]+Ne[e[t+14]]+Ne[e[t+15]]).toLowerCase()}(a)}function Ue(e,t,n,r,o=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(r){if(o<0||o+16>r.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`)}else r=new Uint8Array(16),o=0;return null!=t||(t=Date.now()),null!=n||(n=127*e[6]<<24|e[7]<<16|e[8]<<8|e[9]),r[o++]=t/1099511627776&255,r[o++]=t/4294967296&255,r[o++]=t/16777216&255,r[o++]=t/65536&255,r[o++]=t/256&255,r[o++]=255&t,r[o++]=112|n>>>28&15,r[o++]=n>>>20&255,r[o++]=128|n>>>14&63,r[o++]=n>>>6&255,r[o++]=n<<2&255|3&e[10],r[o++]=e[11],r[o++]=e[12],r[o++]=e[13],r[o++]=e[14],r[o++]=e[15],r}class De{static fromStorage(e,t){return V(this,0,void 0,function*(){const n=yield e.getHttpConnection();return Oe(n)?new De(e,n.connectionSource,t):new De(e,{bridgeUrl:n.session.bridgeUrl},t)})}constructor(e,t,n){var r;this.connectionStorage=e,this.walletConnectionSource=t,this.analyticsManager=n,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=12e3,this.defaultRetryTimeoutMS=2e3,this.optionalOpenGateways=3,this.analytics=null===(r=this.analyticsManager)||void 0===r?void 0:r.scoped()}connect(e,t){var n,r;const o=null!==(n=null==t?void 0:t.traceId)&&void 0!==n?n:Pe(),i=_e(null==t?void 0:t.signal);null===(r=this.abortController)||void 0===r||r.abort(),this.abortController=i,this.closeGateways();const a=new F;this.session={sessionCrypto:a,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:a}).then(()=>V(this,0,void 0,function*(){i.signal.aborted||(yield Ee(e=>{var n;return this.openGateways(a,{openingDeadlineMS:null!==(n=null==t?void 0:t.openingDeadlineMS)&&void 0!==n?n:this.defaultOpeningDeadlineMS,signal:null==e?void 0:e.signal,traceId:o})},{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:i.signal}))}));const s="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(s,e,{traceId:o})}restoreConnection(e){return V(this,0,void 0,function*(){var t,n,r;const o=null!==(t=null==e?void 0:e.traceId)&&void 0!==t?t:Pe(),i=_e(null==e?void 0:e.signal);if(null===(n=this.abortController)||void 0===n||n.abort(),this.abortController=i,i.signal.aborted)return;this.closeGateways();const a=yield this.connectionStorage.getHttpConnection();if(!a)return;if(i.signal.aborted)return;const s=null!==(r=null==e?void 0:e.openingDeadlineMS)&&void 0!==r?r:this.defaultOpeningDeadlineMS;if(Oe(a))return this.session={sessionCrypto:a.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways(a.sessionCrypto,{openingDeadlineMS:s,signal:null==i?void 0:i.signal,traceId:null==e?void 0:e.traceId});if(Array.isArray(this.walletConnectionSource))throw new z("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=a.session,this.gateway&&(Re("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new Ie(this.connectionStorage.storage,this.walletConnectionSource.bridgeUrl,a.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this),this.analyticsManager),!i.signal.aborted){this.listeners.forEach(e=>e(Object.assign(Object.assign({},a.connectEvent),{traceId:o})));try{yield Ee(e=>this.gateway.registerSession({openingDeadlineMS:s,signal:e.signal,traceId:o}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:i.signal})}catch(l){return void(yield this.disconnect({signal:i.signal,traceId:o}))}}})}sendRequest(e,t){var n;const r={};return"function"==typeof t?r.onRequestSent=t:(r.onRequestSent=null==t?void 0:t.onRequestSent,r.signal=null==t?void 0:t.signal,r.attempts=null==t?void 0:t.attempts,r.traceId=null==t?void 0:t.traceId),null!==(n=r.traceId)&&void 0!==n||(r.traceId=Pe()),new Promise((t,n)=>V(this,0,void 0,function*(){var o,i;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new z("Trying to send bridge request without session");const a=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),Re("Send http-bridge request:",Object.assign(Object.assign({},e),{id:a}));const s=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{id:a})),K(this.session.walletPublicKey));try{null===(o=this.analytics)||void 0===o||o.emitBridgeClientMessageSent({bridge_url:this.gateway.bridgeUrl,client_id:this.session.sessionCrypto.sessionId,wallet_id:this.session.walletPublicKey,message_id:a,request_type:e.method,trace_id:r.traceId}),yield this.gateway.send(s,this.session.walletPublicKey,e.method,{attempts:null==r?void 0:r.attempts,signal:null==r?void 0:r.signal,traceId:r.traceId}),null===(i=null==r?void 0:r.onRequestSent)||void 0===i||i.call(r),this.pendingRequests.set(a.toString(),t)}catch(l){n(l)}}))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(e){return V(this,0,void 0,function*(){var t;const n=null!==(t=null==e?void 0:e.traceId)&&void 0!==t?t:Pe();return new Promise(t=>V(this,0,void 0,function*(){let r=!1,o=null;const i=()=>{r||(r=!0,this.removeBridgeAndSession().then(t))};try{this.closeGateways();const t=_e(null==e?void 0:e.signal);o=setTimeout(()=>{t.abort()},this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:i,signal:t.signal,attempts:1,traceId:n})}catch(a){Re("Disconnect error:",a),r||this.removeBridgeAndSession().then(t)}finally{o&&clearTimeout(o),i()}}))})}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter(t=>t!==e)}pause(){var e;null===(e=this.gateway)||void 0===e||e.pause(),this.pendingGateways.forEach(e=>e.pause())}unPause(){return V(this,0,void 0,function*(){const e=this.pendingGateways.map(e=>e.unPause());this.gateway&&e.push(this.gateway.unPause()),yield Promise.all(e)})}pendingGatewaysListener(e,t,n){return V(this,0,void 0,function*(){if(this.pendingGateways.includes(e))return this.closeGateways({except:e}),this.gateway&&(Re("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=t,this.gateway=e,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(n);yield e.close()})}gatewayListener(e){return V(this,0,void 0,function*(){var t,n,r;const o=null!==(t=e.traceId)&&void 0!==t?t:Pe();let i;try{i=JSON.parse(this.session.sessionCrypto.decrypt(q.decode(e.message).toUint8Array(),K(e.from)))}catch(l){throw null===(n=this.analytics)||void 0===n||n.emitBridgeClientMessageDecodeError({bridge_url:this.session.bridgeUrl,client_id:this.session.sessionCrypto.sessionId,wallet_id:e.from,error_message:String(l),trace_id:null==e?void 0:e.traceId}),l}Re("Wallet message received:",i);const a="event"in i?i.event:"";if(null===(r=this.analytics)||void 0===r||r.emitBridgeClientMessageReceived({bridge_url:this.session.bridgeUrl,client_id:this.session.sessionCrypto.sessionId,wallet_id:e.from,message_id:String(i.id),request_type:a,trace_id:null==e?void 0:e.traceId}),!("event"in i)){const e=i.id.toString(),t=this.pendingRequests.get(e);return t?(t(Object.assign(Object.assign({},i),{traceId:o})),void this.pendingRequests.delete(e)):void Re(`Response id ${e} doesn't match any request's id`)}if(void 0!==i.id){const e=yield this.connectionStorage.getLastWalletEventId();if(void 0!==e&&i.id<=e)return void Te(`Received event id (=${i.id}) must be greater than stored last wallet event id (=${e}) `);"connect"!==i.event&&(yield this.connectionStorage.storeLastWalletEventId(i.id))}const s=this.listeners;"connect"===i.event&&(yield this.updateSession(i,e.from)),"disconnect"===i.event&&(Re("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),s.forEach(e=>e(Object.assign(Object.assign({},i),{traceId:o})))})}gatewayErrorsListener(e){return V(this,0,void 0,function*(){throw new z(`Bridge error ${JSON.stringify(e)}`)})}updateSession(e,t){return V(this,0,void 0,function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:t});const n=e.payload.items.find(e=>"ton_addr"===e.name),r=Object.assign(Object.assign({},e),{payload:Object.assign(Object.assign({},e.payload),{items:[n]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:e.id,connectEvent:r,nextRpcRequestId:0})})}removeBridgeAndSession(){return V(this,0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}generateUniversalLink(e,t,n){return be(e)?this.generateTGUniversalLink(e,t,n):this.generateRegularUniversalLink(e,t,n)}generateRegularUniversalLink(e,t,n){const r=new URL(e);return r.searchParams.append("v",2..toString()),r.searchParams.append("id",this.session.sessionCrypto.sessionId),r.searchParams.append("trace_id",n.traceId),r.searchParams.append("r",JSON.stringify(t)),r.toString()}generateTGUniversalLink(e,t,n){const r="tonconnect-"+xe(this.generateRegularUniversalLink("about:blank",t,n).split("?")[1]),o=this.convertToDirectLink(e),i=new URL(o);return i.searchParams.append("startapp",r),i.toString()}convertToDirectLink(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}openGateways(e,t){return V(this,0,void 0,function*(){var n;const r=null!==(n=null==t?void 0:t.traceId)&&void 0!==n?n:Pe();if(Array.isArray(this.walletConnectionSource)){this.pendingGateways.map(e=>e.close().catch()),this.pendingGateways=this.walletConnectionSource.map(t=>{const n=new Ie(this.connectionStorage.storage,t.bridgeUrl,e.sessionId,()=>{},()=>{},this.analyticsManager);return n.setListener(e=>this.pendingGatewaysListener(n,t.bridgeUrl,e)),n});const n=Math.max(this.pendingGateways.length-this.optionalOpenGateways,1);return void(yield function(e,t){return V(this,0,void 0,function*(){if(t<=0)return[];if(t>e.length)throw new RangeError("count cannot be greater than the number of promises");const n=new Array(e.length);let r=0;return new Promise(o=>{e.forEach((e,i)=>{Promise.resolve(e).then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",reason:e})).then(e=>{n[i]=e,r++,r===t&&o(n)})})})})}(this.pendingGateways.map(e=>Ee(n=>{var o;return this.pendingGateways.some(t=>t===e)?e.registerSession({openingDeadlineMS:null!==(o=null==t?void 0:t.openingDeadlineMS)&&void 0!==o?o:this.defaultOpeningDeadlineMS,signal:n.signal,traceId:r}):e.close()},{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:null==t?void 0:t.signal})),n))}return this.gateway&&(Re("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new Ie(this.connectionStorage.storage,this.walletConnectionSource.bridgeUrl,e.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this),this.analyticsManager),yield this.gateway.registerSession({openingDeadlineMS:null==t?void 0:t.openingDeadlineMS,signal:null==t?void 0:t.signal,traceId:r})})}closeGateways(e){var t;null===(t=this.gateway)||void 0===t||t.close(),this.pendingGateways.filter(t=>t!==(null==e?void 0:e.except)).forEach(e=>e.close()),this.pendingGateways=[]}}function je(e,t){return Be(e,[t])}function Be(e,t){return!(!e||"object"!=typeof e)&&t.every(t=>t in e)}let qe=class e{static getInstance(){return e.instance||(e.instance=new e),e.instance}constructor(){this.storage={}}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return null!==(t=this.storage[e])&&void 0!==t?t:null}key(e){var t;const n=Object.keys(this.storage);return e<0||e>=n.length?null:null!==(t=n[e])&&void 0!==t?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}};function $e(){if("undefined"!=typeof window)return window}function Ke(){if("undefined"!=typeof document)return document}function Fe(){var e,t,n,r;const o=null===(t=null===(e=$e())||void 0===e?void 0:e.location)||void 0===t?void 0:t.origin,i=null===(r=null===(n=$e())||void 0===n?void 0:n.location)||void 0===r?void 0:r.pathname;return o&&i?o+i:""}function He(){if(function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}())return localStorage;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)throw new z("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return qe.getInstance()}class Ve{static fromStorage(e,t){return V(this,0,void 0,function*(){const n=yield e.getInjectedConnection();return new Ve(e,n.jsBridgeKey,t)})}static isWalletInjected(e){return Ve.isWindowContainsWallet(this.window,e)}static isInsideWalletBrowser(e){return!!Ve.isWindowContainsWallet(this.window,e)&&this.window[e].tonconnect.isWalletBrowser}static getCurrentlyInjectedWallets(){if(!this.window)return[];return function(){const e=$e();if(!e)return[];try{return Object.entries(e)}catch(t){return[]}}().filter(([e,t])=>function(e){try{return!(!je(e,"tonconnect")||!je(e.tonconnect,"walletInfo"))&&Be(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch(t){return!1}}(t)).map(([e,t])=>({name:t.tonconnect.walletInfo.name,appName:t.tonconnect.walletInfo.app_name,aboutUrl:t.tonconnect.walletInfo.about_url,imageUrl:t.tonconnect.walletInfo.image,tondns:t.tonconnect.walletInfo.tondns,jsBridgeKey:e,injected:!0,embedded:t.tonconnect.isWalletBrowser,platforms:t.tonconnect.walletInfo.platforms,features:t.tonconnect.walletInfo.features}))}static isWindowContainsWallet(e,t){return!!e&&t in e&&"object"==typeof e[t]&&"tonconnect"in e[t]}constructor(e,t,n){this.connectionStorage=e,this.injectedWalletKey=t,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const r=Ve.window;if(!Ve.isWindowContainsWallet(r,t))throw new X;this.injectedWallet=r[t].tonconnect,n&&(this.analytics=n.scoped({bridge_key:t,wallet_app_name:this.injectedWallet.deviceInfo.appName,wallet_app_version:this.injectedWallet.deviceInfo.appVersion}))}connect(e,t){this._connect(2,e,t)}restoreConnection(e){return V(this,0,void 0,function*(){var t,n,r,o;const i=null!==(t=null==e?void 0:e.traceId)&&void 0!==t?t:Pe();try{Re("Injected Provider restoring connection..."),null===(n=this.analytics)||void 0===n||n.emitJsBridgeCall({js_bridge_method:"restoreConnection",trace_id:i});const e=yield this.injectedWallet.restoreConnection({traceId:i});null===(r=this.analytics)||void 0===r||r.emitJsBridgeResponse({js_bridge_method:"restoreConnection",trace_id:i}),Re("Injected Provider restoring connection response",e),"connect"===e.event?(this.makeSubscriptions({traceId:i}),this.listeners.forEach(t=>t(Object.assign(Object.assign({},e),{traceId:i})))):yield this.connectionStorage.removeConnection()}catch(a){null===(o=this.analytics)||void 0===o||o.emitJsBridgeError({js_bridge_method:"restoreConnection",error_message:String(a),trace_id:i}),yield this.connectionStorage.removeConnection(),console.error(a)}})}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(e){return V(this,0,void 0,function*(){var t;const n=null!==(t=null==e?void 0:e.traceId)&&void 0!==t?t:Pe();return new Promise(e=>{const t=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(e)};try{this.injectedWallet.disconnect(),t()}catch(r){Re(r),this.sendRequest({method:"disconnect",params:[]},{onRequestSent:t,traceId:n})}})})}closeAllListeners(){var e;this.listenSubscriptions=!1,this.listeners=[],null===(e=this.unsubscribeCallback)||void 0===e||e.call(this)}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter(t=>t!==e)}sendRequest(e,t){return V(this,0,void 0,function*(){var n,r,o;const i={};"function"==typeof t?(i.onRequestSent=t,i.traceId=Pe()):(i.onRequestSent=null==t?void 0:t.onRequestSent,i.signal=null==t?void 0:t.signal,i.attempts=null==t?void 0:t.attempts,i.traceId=null!==(n=null==t?void 0:t.traceId)&&void 0!==n?n:Pe());const a=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),Re("Send injected-bridge request:",Object.assign(Object.assign({},e),{id:a})),null===(r=this.analytics)||void 0===r||r.emitJsBridgeCall({js_bridge_method:"send"});const s=this.injectedWallet.send(Object.assign(Object.assign({},e),{id:a}),{traceId:i.traceId});return s.then(e=>{var t;null===(t=this.analytics)||void 0===t||t.emitJsBridgeResponse({js_bridge_method:"send"}),Re("Wallet message received:",e)}).catch(e=>{var t;null===(t=this.analytics)||void 0===t||t.emitJsBridgeError({js_bridge_method:"send",error_message:String(e)})}),null===(o=null==i?void 0:i.onRequestSent)||void 0===o||o.call(i),s})}_connect(e,t,n){return V(this,0,void 0,function*(){var r,o,i,a;const s=null!==(r=null==n?void 0:n.traceId)&&void 0!==r?r:Pe();try{Re(`Injected Provider connect request: protocolVersion: ${e}, message:`,t),null===(o=this.analytics)||void 0===o||o.emitJsBridgeCall({js_bridge_method:"connect",trace_id:s});const n=yield this.injectedWallet.connect(e,t,{traceId:s});null===(i=this.analytics)||void 0===i||i.emitJsBridgeResponse({js_bridge_method:"connect"}),Re("Injected Provider connect response:",n),"connect"===n.event&&(yield this.updateSession(),this.makeSubscriptions({traceId:s})),this.listeners.forEach(e=>e(Object.assign(Object.assign({},n),{traceId:s})))}catch(l){null===(a=this.analytics)||void 0===a||a.emitJsBridgeError({js_bridge_method:"connect",error_message:String(l),trace_id:s}),Re("Injected Provider connect error:",l);const e={event:"connect_error",payload:{code:0,message:null==l?void 0:l.toString()}};this.listeners.forEach(t=>t(Object.assign(Object.assign({},e),{traceId:s})))}})}makeSubscriptions(e){var t,n,r;this.listenSubscriptions=!0,null===(t=this.analytics)||void 0===t||t.emitJsBridgeCall({js_bridge_method:"listen",trace_id:e.traceId});try{this.unsubscribeCallback=this.injectedWallet.listen(e=>{var t;const n=null!==(t=e.traceId)&&void 0!==t?t:Pe();Re("Wallet message received:",e),this.listenSubscriptions&&this.listeners.forEach(t=>t(Object.assign(Object.assign({},e),{traceId:n}))),"disconnect"===e.event&&this.disconnect({traceId:n})}),null===(n=this.analytics)||void 0===n||n.emitJsBridgeResponse({js_bridge_method:"listen",trace_id:e.traceId})}catch(o){throw null===(r=this.analytics)||void 0===r||r.emitJsBridgeError({js_bridge_method:"listen",error_message:String(o),trace_id:e.traceId}),o}}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}Ve.window=$e();class ze{constructor(e,t){this.storage=e,this.walletsListManager=t,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(e){return V(this,0,void 0,function*(){if("injected"===e.type||"wallet-connect"===e.type)return this.storage.setItem(this.storeKey,JSON.stringify(e));if(!Oe(e)){const t={sessionKeyPair:e.session.sessionCrypto.stringifyKeypair(),walletPublicKey:e.session.walletPublicKey,bridgeUrl:e.session.bridgeUrl},n={type:"http",connectEvent:e.connectEvent,session:t,lastWalletEventId:e.lastWalletEventId,nextRpcRequestId:e.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(n))}const t={type:"http",connectionSource:e.connectionSource,sessionCrypto:e.sessionCrypto.stringifyKeypair(),createdAt:Date.now()};return this.storage.setItem(this.storeKey,JSON.stringify(t))})}removeConnection(){return V(this,0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return V(this,0,void 0,function*(){try{const e=yield this.storage.getItem(this.storeKey);if(!e)return null;const t=JSON.parse(e);if("injected"===t.type||"wallet-connect"===t.type)return t;if(!function(e){return!("connectEvent"in e)}(t)){const e=new F(t.session.sessionKeyPair);return yield this.actualizeBridgeConnection({type:"http",connectEvent:t.connectEvent,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId,session:{sessionCrypto:e,bridgeUrl:t.session.bridgeUrl,walletPublicKey:t.session.walletPublicKey}})}return function(e){var t;return Date.now()-(null!==(t=e.createdAt)&&void 0!==t?t:0)>3e5}(t)?(yield this.removeConnection(),null):{type:"http",sessionCrypto:new F(t.sessionCrypto),connectionSource:t.connectionSource}}catch(e){return Re("Error retrieving connection",e),null}})}getHttpConnection(){return V(this,0,void 0,function*(){const e=yield this.getConnection();if(!e)throw new z("Trying to read HTTP connection source while nothing is stored");if("http"!==e.type)throw new z(`Trying to read HTTP connection source while ${e.type} connection is stored`);return e})}getHttpPendingConnection(){return V(this,0,void 0,function*(){const e=yield this.getConnection();if(!e)throw new z("Trying to read HTTP connection source while nothing is stored");if("http"!==e.type)throw new z(`Trying to read HTTP connection source while ${e.type} connection is stored`);if(!Oe(e))throw new z("Trying to read HTTP-pending connection while http connection is stored");return e})}getInjectedConnection(){return V(this,0,void 0,function*(){const e=yield this.getConnection();if(!e)throw new z("Trying to read Injected bridge connection source while nothing is stored");if("injected"!==(null==e?void 0:e.type))throw new z(`Trying to read Injected bridge connection source while ${e.type} connection is stored`);return e})}getWalletConnectConnection(){return V(this,0,void 0,function*(){const e=yield this.getConnection();if(!e)throw new z("Trying to read wallet connect bridge connection source while nothing is stored");if("wallet-connect"!==(null==e?void 0:e.type))throw new z(`Trying to read wallet connect bridge connection source while ${e.type} connection is stored`);return e})}storedConnectionType(){return V(this,0,void 0,function*(){const e=yield this.storage.getItem(this.storeKey);if(!e)return null;return JSON.parse(e).type})}storeLastWalletEventId(e){return V(this,0,void 0,function*(){const t=yield this.getConnection();if(t&&"http"===t.type&&!Oe(t))return t.lastWalletEventId=e,this.storeConnection(t)})}getLastWalletEventId(){return V(this,0,void 0,function*(){const e=yield this.getConnection();if(e&&"lastWalletEventId"in e)return e.lastWalletEventId})}increaseNextRpcRequestId(){return V(this,0,void 0,function*(){const e=yield this.getConnection();if(e&&"nextRpcRequestId"in e){const t=e.nextRpcRequestId||0;return e.nextRpcRequestId=t+1,this.storeConnection(e)}})}getNextRpcRequestId(){return V(this,0,void 0,function*(){const e=yield this.getConnection();return e&&"nextRpcRequestId"in e&&e.nextRpcRequestId||0})}actualizeBridgeConnection(e){return V(this,0,void 0,function*(){try{const t=e.connectEvent.payload.device.appName,n=yield this.walletsListManager.getRemoteWallet(t);if(n.bridgeUrl===e.session.bridgeUrl)return e;const r=Object.assign(Object.assign({},e),{session:Object.assign(Object.assign({},e.session),{bridgeUrl:n.bridgeUrl})});return yield this.storeConnection(r),r}catch(t){return Re("Failed to actualize bridge connection",t),e}})}}class Ze{constructor(){this.localStorage=He()}getItem(e){return V(this,0,void 0,function*(){return this.localStorage.getItem(e)})}removeItem(e){return V(this,0,void 0,function*(){this.localStorage.removeItem(e)})}setItem(e,t){return V(this,0,void 0,function*(){this.localStorage.setItem(e,t)})}}function Ge(e){return Qe(e)&&e.injected}function Ye(e){return Ge(e)&&e.embedded}function Qe(e){return"jsBridgeKey"in e}function Je(e){return"bridgeUrl"in e}const Xe=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://walletbot.me/tonconnect-bridge/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!0},{name:"SignData",types:["text","binary","cell"]}]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!0},{name:"SignData",types:["text","binary","cell"]}]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://static.mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",deepLink:"mytonwallet-tc://",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1},{name:"SignData",types:["text","binary","cell"]}]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!0},{name:"SignData",types:["text","binary","cell"]}]},{app_name:"bitgetTonWallet",name:"Bitget Wallet",image:"https://raw.githubusercontent.com/bitgetwallet/download/refs/heads/main/logo/png/bitget_wallet_logo_288_mini.png",about_url:"https://web3.bitget.com",deepLink:"bitkeep://",bridge:[{type:"js",key:"bitgetTonWallet"},{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","chrome"],universal_url:"https://bkcode.vip/ton-connect",features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"okxMiniWallet",name:"OKX Mini Wallet",image:"https://static.okx.com/cdn/assets/imgs/2411/8BE1A4A434D8F58A.png",about_url:"https://www.okx.com/web3",universal_url:"https://t.me/OKX_WALLET_BOT?attach=wallet",bridge:[{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"binanceWeb3TonWallet",name:"Binance Wallet",image:"https://public.bnbstatic.com/static/binance-w3w/ton-provider/binancew3w.png",about_url:"https://www.binance.com/en/web3wallet",deepLink:"bnc://app.binance.com/cedefi/ton-connect",bridge:[{type:"js",key:"binancew3w"},{type:"sse",url:"https://wallet.binance.com/tonbridge/bridge"}],platforms:["ios","android","macos","windows","linux"],universal_url:"https://app.binance.com/cedefi/ton-connect",features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"fintopio-tg",name:"Fintopio",image:"https://raw.githubusercontent.com/fintopio/ton-pub/refs/heads/main/logos/tonconnect-icon.png",about_url:"https://fintopio.com",universal_url:"https://t.me/fintopio?attach=wallet",bridge:[{type:"sse",url:"https://wallet-bridge.fintopio.com/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"okxTonWallet",name:"OKX Wallet",image:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png",about_url:"https://www.okx.com/web3",universal_url:"https://www.okx.com/download?appendQuery=true&deeplink=okx://web3/wallet/tonconnect",bridge:[{type:"js",key:"okxTonWallet"},{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["chrome","safari","firefox","ios","android"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"hot",name:"HOT",image:"https://raw.githubusercontent.com/hot-dao/media/main/logo.png",about_url:"https://hot-labs.org/",universal_url:"https://t.me/herewalletbot?attach=wallet",bridge:[{type:"sse",url:"https://sse-bridge.hot-labs.org"},{type:"js",key:"hotWallet"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"bybitTonWallet",name:"Bybit Wallet",image:"https://raw.githubusercontent.com/bybit-web3/bybit-web3.github.io/main/docs/images/bybit-logo.png",about_url:"https://www.bybit.com/web3",universal_url:"https://app.bybit.com/ton-connect",deepLink:"bybitapp://",bridge:[{type:"js",key:"bybitTonWallet"},{type:"sse",url:"https://api-node.bybit.com/spot/api/web3/bridge/ton/bridge"}],platforms:["ios","android","chrome"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"dewallet",name:"DeWallet",image:"https://raw.githubusercontent.com/delab-team/manifests-images/main/WalletAvatar.png",about_url:"https://delabwallet.com",universal_url:"https://t.me/dewallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.dewallet.pro/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"safepalwallet",name:"SafePal",image:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",about_url:"https://www.safepal.com",universal_url:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",bridge:[{type:"sse",url:"https://ton-bridge.safepal.com/tonbridge/v1/bridge"},{type:"js",key:"safepalwallet"}],platforms:["ios","android","chrome","firefox"],features:[{name:"SendTransaction",maxMessages:1,extraCurrencySupported:!1}]},{app_name:"GateWallet",name:"GateWallet",image:"https://img.gatedataimg.com/prd-ordinal-imgs/036f07bb8730716e/gateio-0925.png",about_url:"https://www.gate.io/",bridge:[{type:"js",key:"gatetonwallet"},{type:"sse",url:"https://dapp.gateio.services/tonbridge_api/bridge/v1"}],platforms:["ios","android"],universal_url:"https://gate.onelink.me/Hls0/web3?gate_web3_wallet_universal_type=ton_connect",features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"BitgetWeb3",name:"BitgetWeb3",image:"https://img.bitgetimg.com/image/third/1731638059795.png",about_url:"https://www.bitget.com",universal_url:"https://t.me/BitgetOfficialBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","windows","macos","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"],features:[{name:"SendTransaction",maxMessages:1,extraCurrencySupported:!1}]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"bitgetWalletLite",name:"Bitget Wallet Lite",image:"https://raw.githubusercontent.com/bitgetwallet/download/refs/heads/main/logo/png/bitget_wallet_lite_logo_288.png",about_url:"https://web3.bitget.com",universal_url:"https://t.me/BitgetWallet_TGBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1}]},{app_name:"tomoWallet",name:"Tomo Wallet",image:"https://pub.tomo.inc/logo.png",about_url:"https://www.tomo.inc/",universal_url:"https://t.me/tomowalletbot?attach=wallet",bridge:[{type:"sse",url:"https://go-bridge.tomo.inc/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"miraiapp-tg",name:"Mirai Mini App",image:"https://cdn.mirailabs.co/miraihub/miraiapp-tg-icon-288.png",about_url:"https://mirai.app",universal_url:"https://t.me/MiraiAppBot?attach=wallet",bridge:[{type:"sse",url:"https://bridge.mirai.app"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1},{name:"SignData",types:["text","binary","cell"]}]},{app_name:"Architec.ton",name:"Architec.ton",image:"https://raw.githubusercontent.com/Architec-Ton/wallet-tma/refs/heads/dev/public/images/arcwallet_logo.png",about_url:"https://architecton.tech",universal_url:"https://t.me/architec_ton_bot?attach=wallet",bridge:[{type:"sse",url:"https://tc.architecton.su/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1}]},{app_name:"tokenpocket",name:"TokenPocket",image:"https://hk.tpstatic.net/logo/tokenpocket.png",about_url:"https://www.tokenpocket.pro",universal_url:"https://tp-lab.tptool.pro/ton-connect/",bridge:[{type:"js",key:"tokenpocket"},{type:"sse",url:"https://ton-connect.mytokenpocket.vip/bridge"}],platforms:["ios","android"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"uxuyWallet",name:"UXUY Wallet",image:"https://chain-cdn.uxuy.com/logo/square_288.png",about_url:"https://docs.uxuy.com",universal_url:"https://t.me/UXUYbot?attach=wallet",bridge:[{type:"sse",url:"https://bridge.uxuy.me/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"tonkeeper-pro",name:"Tonkeeper Pro",image:"https://tonkeeper.com/assets/tonconnect-icon-pro.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com/pro",universal_url:"https://app.tonkeeper.com/pro/ton-connect",deepLink:"tonkeeper-pro-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"}],platforms:["ios","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!0},{name:"SignData",types:["text","binary","cell"]}]},{app_name:"nicegramWallet",name:"Nicegram Wallet",image:"https://static.nicegram.app/icon.png",about_url:"https://nicegram.app",universal_url:"https://nicegram.app/tc",deepLink:"nicegram-tc://",bridge:[{type:"sse",url:"https://tc.nicegram.app/bridge"},{type:"js",key:"nicegramWallet"}],platforms:["ios","android"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1}]},{app_name:"echoooTonWallet",name:"EchoooWallet",image:"https://cdn.echooo.xyz/front-end/source/images/logo/echooo-ton.png",about_url:"https://www.echooo.xyz",universal_url:"https://www.echooo.xyz/ton-connect",deepLink:"echooo://",bridge:[{type:"js",key:"echoooTonWallet"},{type:"sse",url:"https://ton-connect-bridge.echooo.link/bridge"}],platforms:["ios","android"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1}]},{app_name:"blitzwallet",name:"BLITZ wallet",image:"https://blitzwallet.cfd/wallet/public/logo.png",about_url:"https://blitzwallet.cfd",universal_url:"https://t.me/blitz_wallet_bot?attach=wallet",bridge:[{type:"sse",url:"https://blitzwallet.cfd/bridge/"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]},{app_name:"koloWeb3Wallet",name:"Kolo",image:"https://raw.githubusercontent.com/onidev1/tc-assets/refs/heads/main/kolo_logo_288.png",about_url:"https://kolo.xyz",universal_url:"https://t.me/kolo?attach=wallet",bridge:[{type:"sse",url:"https://web3-bridge.kolo.in/bridge"}],platforms:["ios","android","macos","windows","linux"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1}]},{app_name:"imToken",name:"imToken",image:"https://aws-v2-cdn.token.im/orbit/token-v2/icons/logo-ton-connect.png",about_url:"https://token.im",universal_url:"https://connect.token.im/link/ton-connect",deepLink:"imtokenv2://link/ton-connect",bridge:[{type:"sse",url:"https://connect.token.im/tonbridge"},{type:"js",key:"imToken"}],platforms:["ios","android"],features:[{name:"SendTransaction",maxMessages:255,extraCurrencySupported:!1}]},{app_name:"cactuslink",name:"Cactus Link",image:"https://downloads.mycactus.com/288_cactus_link.png",about_url:"https://www.mycactus.com/defi-connector",bridge:[{type:"js",key:"cactuslink_ton"}],platforms:["chrome"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1},{name:"SignData",types:["text","binary"]}]},{app_name:"onekey",name:"OneKey",image:"https://uni.onekey-asset.com/static/logo/onekey-x288.png",about_url:"https://onekey.so",bridge:[{type:"js",key:"onekeyTonWallet"}],platforms:["chrome"],features:[{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}]}];let et=!1,tt=null;function nt(){return et}function rt(){if("undefined"==typeof window)return;if(document.getElementById("ton-connect-qa-banner"))return;const e=document.createElement("div");e.id="ton-connect-qa-banner",e.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n background: linear-gradient(90deg, #ff6b6b, #ff8e8e);\n color: white;\n padding: 12px 20px;\n text-align: center;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n font-weight: 600;\n font-size: 14px;\n z-index: 999999;\n box-shadow: 0 2px 8px rgba(0,0,0,0.2);\n animation: slideDown 0.3s ease-out;\n user-select: none;\n pointer-events: none;\n ",e.innerHTML="\n 🚨 QA Mode Active - Validation Disabled (Unsafe for Production)\n ";const t=document.createElement("style");t.textContent="\n @keyframes slideDown {\n from { transform: translateY(-100%); }\n to { transform: translateY(0); }\n }\n ",document.head.appendChild(t),document.body.appendChild(e),ot()}function ot(){if("undefined"==typeof window)return;if(document.getElementById("ton-connect-qa-mode-styles"))return;const e=document.createElement("style");e.id="ton-connect-qa-mode-styles",e.textContent="\n body.qa-mode-active {\n padding-top: 48px !important;\n }\n \n body.qa-mode-active header {\n margin-top: 48px !important;\n }\n \n body.qa-mode-active .qa-mode-control {\n top: 128px !important;\n }\n ",document.head.appendChild(e),document.body.classList.add("qa-mode-active")}class it{constructor(e){var t;this.walletsListDTOCache=null,this.walletsListDTOCacheCreationTimestamp=null,nt()?this.walletsListSource="https://raw.githubusercontent.com/ton-connect/wallets-list-staging/refs/heads/main/wallets-v2.json":this.walletsListSource=null!==(t=null==e?void 0:e.walletsListSource)&&void 0!==t?t:"https://config.ton.org/wallets-v2.json",this.cacheTTLMs=null==e?void 0:e.cacheTTLMs,this.onDownloadDurationMeasured=null==e?void 0:e.onDownloadDurationMeasured}getWallets(){return V(this,0,void 0,function*(){const[e,t]=yield Promise.all([this.fetchWalletsListDTO(),this.getCurrentlyInjectedWallets()]);return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(e),t)})}getEmbeddedWallet(){return V(this,0,void 0,function*(){const e=(yield this.getWallets()).filter(Ye);return 1===e.length?e[0]:null})}fetchWalletsListDTO(){return V(this,0,void 0,function*(){return this.cacheTTLMs&&this.walletsListDTOCacheCreationTimestamp&&Date.now()>this.walletsListDTOCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListDTOCache=null),this.walletsListDTOCache||(this.walletsListDTOCache=this.fetchWalletsListFromSource(),this.walletsListDTOCache.then(()=>{this.walletsListDTOCacheCreationTimestamp=Date.now()}).catch(()=>{this.walletsListDTOCache=null,this.walletsListDTOCacheCreationTimestamp=null})),this.walletsListDTOCache})}getRemoteWallet(e){return V(this,0,void 0,function*(){const t=(yield this.getWallets()).find(t=>t.appName===e);if(!t)throw new z(`Wallet info not found for appName: "${e}"`);if(!Je(t))throw new z(`Wallet "${e}" is not remote`);return t})}fetchWalletsListFromSource(){return V(this,0,void 0,function*(){var e,t;let n=[];const r=performance.now();try{const t=yield fetch(this.walletsListSource);if(n=yield t.json(),!Array.isArray(n))throw new se("Wrong wallets list format, wallets list must be an array.");const o=n.filter(e=>!this.isCorrectWalletConfigDTO(e));o.length&&(Te(`Wallet(s) ${o.map(e=>(null==e?void 0:e.name)||"unknown").join(", ")} config format is wrong. They were removed from the wallets list.`),n=n.filter(e=>this.isCorrectWalletConfigDTO(e)));const i=performance.now(),a=Math.round(i-r);null===(e=this.onDownloadDurationMeasured)||void 0===e||e.call(this,a)}catch(o){Te(o),n=Xe,null===(t=this.onDownloadDurationMeasured)||void 0===t||t.call(this,void 0)}return n})}getCurrentlyInjectedWallets(){if(!nt())return[];try{return Ve.getCurrentlyInjectedWallets()}catch(e){return Te(e),[]}}walletConfigDTOListToWalletConfigList(e){return e.map(e=>{const t={name:e.name,appName:e.app_name,imageUrl:e.image,aboutUrl:e.about_url,tondns:e.tondns,platforms:e.platforms,features:e.features};return e.bridge.forEach(n=>{if("sse"===n.type&&(t.bridgeUrl=n.url,t.universalLink=e.universal_url,t.deepLink=e.deepLink),"js"===n.type){const e=n.key;t.jsBridgeKey=e,t.injected=Ve.isWalletInjected(e),t.embedded=Ve.isInsideWalletBrowser(e)}}),t})}mergeWalletsLists(e,t){return[...new Set(e.concat(t).map(e=>e.name)).values()].map(n=>{const r=e.find(e=>e.name===n),o=t.find(e=>e.name===n);return Object.assign(Object.assign({},r&&Object.assign({},r)),o&&Object.assign({},o))})}isCorrectWalletConfigDTO(e){if(!e||"object"!=typeof e)return!1;if(!("name"in e&&"image"in e&&"about_url"in e&&"platforms"in e&&"app_name"in e))return!1;if(!e.platforms||!Array.isArray(e.platforms)||!e.platforms.length)return!1;if(!("bridge"in e)||!Array.isArray(e.bridge)||!e.bridge.length)return!1;const t=e.bridge;if(t.some(e=>!e||"object"!=typeof e||!("type"in e)))return!1;const n=t.find(e=>"sse"===e.type);if(n&&("object"!=typeof n||!("url"in n)||!n.url||!e.universal_url))return!1;const r=t.find(e=>"js"===e.type);return!!(!r||"object"==typeof r&&"key"in r&&r.key)}}function at(e,t){const n=e.includes("SendTransaction"),r=lt(e,"SendTransaction"),o={minMessages:t.requiredMessagesNumber,extraCurrencyRequired:t.requireExtraCurrencies};if(!n&&!r)throw new ee("Wallet doesn't support SendTransaction feature.",{cause:{requiredFeature:{featureName:"SendTransaction",value:o}}});if(t.requireExtraCurrencies&&(!r||!r.extraCurrencySupported))throw new ee("Wallet is not able to handle such SendTransaction request. Extra currencies support is required.",{cause:{requiredFeature:{featureName:"SendTransaction",value:o}}});if(r&&void 0!==r.maxMessages){if(r.maxMessages<t.requiredMessagesNumber)throw new ee(`Wallet is not able to handle such SendTransaction request. Max support messages number is ${r.maxMessages}, but ${t.requiredMessagesNumber} is required.`,{cause:{requiredFeature:{featureName:"SendTransaction",value:o}}})}else!function(...e){try{console.warn("[TON_CONNECT_SDK]",...e)}catch(t){}}("Connected wallet didn't provide information about max allowed messages in the SendTransaction request. Request may be rejected by the wallet.")}function st(e,t){if("object"!=typeof t)return!0;const{sendTransaction:n,signData:r}=t;if(n){const t=lt(e,"SendTransaction");if(!t)return!1;if(!function(e,t){const n=void 0===t.minMessages||t.minMessages<=e.maxMessages,r=!t.extraCurrencyRequired||e.extraCurrencySupported;return!(!n||!r)}(t,n))return!1}if(r){const t=lt(e,"SignData");if(!t)return!1;if(!function(e,t){return t.types.every(t=>e.types.includes(t))}(t,r))return!1}return!0}function lt(e,t){return e.find(e=>e&&"object"==typeof e&&e.name===t)}function ct(){return{type:"request-version"}}function dt(e){return{type:"response-version",version:e}}function ut(e){return{ton_connect_sdk_lib:e.ton_connect_sdk_lib,ton_connect_ui_lib:e.ton_connect_ui_lib}}function ht(e,t,n){var r,o,i,a,s,l,c,d,u,h,p;const g=(null===(r=null==t?void 0:t.connectItems)||void 0===r?void 0:r.tonProof)&&"proof"in t.connectItems.tonProof?"ton_proof":"ton_addr";return{wallet_address:null!==(i=null===(o=null==t?void 0:t.account)||void 0===o?void 0:o.address)&&void 0!==i?i:null,wallet_state_init:null!==(a=null==t?void 0:t.account.walletStateInit)&&void 0!==a?a:null,wallet_type:null!==(s=null==t?void 0:t.device.appName)&&void 0!==s?s:null,wallet_version:null!==(l=null==t?void 0:t.device.appVersion)&&void 0!==l?l:null,auth_type:g,custom_data:Object.assign({client_id:null!==(c=null==n?void 0:n.clientId)&&void 0!==c?c:null,wallet_id:null!==(d=null==n?void 0:n.walletId)&&void 0!==d?d:null,chain_id:null!==(h=null===(u=null==t?void 0:t.account)||void 0===u?void 0:u.chain)&&void 0!==h?h:null,provider:null!==(p=null==t?void 0:t.provider)&&void 0!==p?p:null},ut(e))}}function pt(e,t){return{type:"connection-started",custom_data:ut(e),trace_id:null!=t?t:null}}function gt(e,t,n,r){return Object.assign({type:"connection-completed",is_success:!0,trace_id:null!=r?r:null},ht(e,t,n))}function ft(e,t,n,r,o){var i,a;return{type:"connection-error",is_success:!1,error_message:t,error_code:null!=n?n:null,trace_id:null!=o?o:null,custom_data:Object.assign({client_id:null!==(i=null==r?void 0:r.clientId)&&void 0!==i?i:null,wallet_id:null!==(a=null==r?void 0:r.walletId)&&void 0!==a?a:null},ut(e))}}function mt(e,t){return{type:"connection-restoring-started",custom_data:ut(e),trace_id:null!=t?t:null}}function wt(e,t,n,r){return Object.assign({type:"connection-restoring-completed",is_success:!0,trace_id:null!=r?r:null},ht(e,t,n))}function vt(e,t,n){return{type:"connection-restoring-error",is_success:!1,error_message:t,trace_id:null!=n?n:null,custom_data:ut(e)}}function yt(e,t){var n,r,o,i;return{valid_until:null!==(n=String(t.validUntil))&&void 0!==n?n:null,from:null!==(i=null!==(r=t.from)&&void 0!==r?r:null===(o=null==e?void 0:e.account)||void 0===o?void 0:o.address)&&void 0!==i?i:null,messages:t.messages.map(e=>{var t,n;return{address:null!==(t=e.address)&&void 0!==t?t:null,amount:null!==(n=e.amount)&&void 0!==n?n:null}})}}function bt(e,t,n,r,o){return Object.assign(Object.assign({type:"transaction-sent-for-signature",trace_id:null!=o?o:null},ht(e,t,r)),yt(t,n))}function Ct(e,t,n,r,o,i){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:r.boc,trace_id:null!=i?i:null},ht(e,t,o)),yt(t,n))}function xt(e,t,n,r,o,i,a){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:r,error_code:null!=o?o:null,trace_id:null!=a?a:null},ht(e,t,i)),function(e,t){var n,r,o,i;return{valid_until:null!==(n=String(t.validUntil))&&void 0!==n?n:null,from:null!==(i=null!==(r=t.from)&&void 0!==r?r:null===(o=null==e?void 0:e.account)||void 0===o?void 0:o.address)&&void 0!==i?i:null,messages:t.messages.map(e=>{var t,n,r,o;return{address:null!==(t=e.address)&&void 0!==t?t:null,amount:null!==(n=e.amount)&&void 0!==n?n:null,payload:null!==(r=e.payload)&&void 0!==r?r:null,state_init:null!==(o=e.stateInit)&&void 0!==o?o:null}})}}(t,n))}function St(e,t,n,r,o){return Object.assign({type:"sign-data-request-initiated",data:n,trace_id:null!=o?o:null},ht(e,t,r))}function kt(e,t,n,r,o,i){return Object.assign({type:"sign-data-request-completed",is_success:!0,data:n,signed_data:r,trace_id:null!=i?i:null},ht(e,t,o))}function _t(e,t,n,r,o,i,a){return Object.assign({type:"sign-data-request-failed",is_success:!1,data:n,error_message:r,error_code:null!=o?o:null,trace_id:null!=a?a:null},ht(e,t,i))}function Et(e,t,n,r,o){return Object.assign({type:"disconnection",scope:n,trace_id:null!=o?o:null},ht(e,t,r))}function Rt(e,t,n,r){return{type:"wallet-modal-opened",visible_wallets:t,client_id:null!=n?n:null,custom_data:e,trace_id:null!=r?r:null}}function Tt(e,t,n,r,o,i,a,s){var l;let c=i;return!c&&o&&(c=be(o)?"tg_link":"external_link"),{type:"selected-wallet",wallets_menu:r,visible_wallets:t,client_id:null!=a?a:null,custom_data:e,trace_id:null!=s?s:null,wallet_redirect_method:c,wallet_redirect_link:o||void 0,wallet_type:null!==(l=null==n?void 0:n.appName)&&void 0!==l?l:null}}class It{get version(){return ut({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}constructor(e){this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=null==e?void 0:e.eventDispatcher,this.tonConnectSdkVersion=e.tonConnectSdkVersion,this.init().catch()}init(){return V(this,0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch(e){}})}setRequestVersionHandler(){return V(this,0,void 0,function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",()=>V(this,0,void 0,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",dt(this.tonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return V(this,0,void 0,function*(){return new Promise((e,t)=>V(this,0,void 0,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",t=>{e(t.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",{type:"request-version"})}catch(n){t(n)}}))})}dispatchUserActionEvent(e){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${e.type}`,e).catch()}catch(t){}}trackConnectionStarted(...e){try{const t=pt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionCompleted(...e){try{const t=gt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionError(...e){try{const t=ft(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionRestoringStarted(...e){try{const t=mt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionRestoringCompleted(...e){try{const t=wt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackConnectionRestoringError(...e){try{const t=vt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackDisconnection(...e){try{const t=Et(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackTransactionSentForSignature(...e){try{const t=bt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackTransactionSigned(...e){try{const t=Ct(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackTransactionSigningFailed(...e){try{const t=xt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackDataSentForSignature(...e){try{const t=St(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackDataSigned(...e){try{const t=kt(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}trackDataSigningFailed(...e){try{const t=_t(this.version,...e);this.dispatchUserActionEvent(t)}catch(t){}}}const Ot="3.4.0-beta.6";function Mt(e,t=!1){const{wc:n,hex:r}=Nt(e);let o=81;t&&(o|=128);const i=new Int8Array(34);i[0]=o,i[1]=n,i.set(r,2);const a=new Uint8Array(36);return a.set(i),a.set(Wt(i),34),q.encode(a).replace(/\+/g,"-").replace(/\//g,"_")}function At(e){try{return Lt(e),!0}catch(t){return!1}}function Lt(e){const t=e.replace(/-/g,"+").replace(/_/g,"/");let n;try{n=q.decode(t).toUint8Array()}catch(u){throw new le(`Invalid base64 encoding in address: ${e}`)}if(36!==n.length)throw new le(`Invalid address length: ${e}`);const r=n.slice(0,34),o=n.slice(34,36),i=Wt(r);if(!o.every((e,t)=>e===i[t]))throw new le(`Invalid checksum in address: ${e}`);let a=r[0],s=!1,l=!1;if(128&a&&(s=!0,a^=128),17!==a&&81!==a)throw new le(`Unknown address tag: ${a}`);l=17===a;let c=null;c=255===r[1]?-1:r[1];const d=r.slice(2);if(0!==c&&-1!==c)throw new le(`Invalid workchain: ${c}`);return{wc:c,hex:Array.from(d).map(e=>e.toString(16).padStart(2,"0")).join(""),testOnly:s,isBounceable:l}}function Nt(e){if(!e.includes(":"))throw new le(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(2!==t.length)throw new le(`Wrong address ${e}. Address must include ":" only once.`);const n=parseInt(t[0]);if(0!==n&&-1!==n)throw new le(`Wrong address ${e}. WC must be eq 0 or -1, but ${n} received.`);const r=t[1];if(64!==(null==r?void 0:r.length))throw new le(`Wrong address ${e}. Hex part must be 64bytes length, but ${null==r?void 0:r.length} received.`);return{wc:n,hex:Ut(r)}}function Wt(e){let t=0;const n=new Uint8Array(e.length+2);n.set(e);for(let r of n){let e=128;for(;e>0;)t<<=1,r&e&&(t+=1),e>>=1,t>65535&&(t&=65535,t^=4129)}return new Uint8Array([Math.floor(t/256),t%256])}const Pt={};for(let zp=0;zp<=255;zp++){let e=zp.toString(16);e.length<2&&(e="0"+e),Pt[e]=zp}function Ut(e){const t=(e=e.toLowerCase()).length;if(t%2!=0)throw new ce("Hex string must have length a multiple of 2: "+e);const n=t/2,r=new Uint8Array(n);for(let o=0;o<n;o++){const t=2*o,n=e.substring(t,t+2);if(!Pt.hasOwnProperty(n))throw new ce("Invalid hex character: "+n);r[o]=Pt[n]}return r}const Dt=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,jt=/^[A-Za-z0-9\-_]+$/,Bt=/^-?\d+$/,qt=/^\d+$/;function $t(e){return"number"==typeof e&&!isNaN(e)}function Kt(e){return"string"==typeof e&&e.length>0}function Ft(e){return Kt(e)&&(function(e){try{return Nt(e),!0}catch(t){return!1}}(e)||At(e))}function Ht(e){return Kt(e)&&/^-?\d+$/.test(e)}function Vt(e){return"string"==typeof e&&(Dt.test(e)||jt.test(e))&&e.startsWith("te6cc")}function zt(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Zt(e,t){return Object.keys(e).some(e=>!t.includes(e))}function Gt(e){if(!zt(e))return"Request must be an object";if(Zt(e,["validUntil","network","from","messages"]))return"Request contains extra properties";if(e.validUntil){if(!$t(e.validUntil))return"Incorrect 'validUntil'";const t=Math.floor(Date.now()/1e3),n=t+300;e.validUntil>n&&console.warn(`validUntil (${e.validUntil}) is more than 5 minutes from now (${t})`)}if(void 0!==e.network&&!Ht(e.network))return"Invalid 'network' format";if(void 0!==e.from&&!Ft(e.from))return"Invalid 'from' address format";if(t=e.messages,!Array.isArray(t)||0===e.messages.length)return"'messages' is required";var t;for(let n=0;n<e.messages.length;n++){const t=Yt(e.messages[n],n);if(t)return t}return null}function Yt(e,t){if(!zt(e))return`Message at index ${t} must be an object`;if(Zt(e,["address","amount","stateInit","payload","extraCurrency"]))return`Message at index ${t} contains extra properties`;if(!Kt(e.address))return`'address' is required in message at index ${t}`;if(!At(e.address))return`Wrong 'address' format in message at index ${t}`;if(!Kt(e.amount))return`'amount' is required in message at index ${t}`;if(!/^[0-9]+$/.test(e.amount))return`Incorrect 'amount' in message at index ${t}`;if(!(void 0===e.stateInit||Kt(e.stateInit)&&Vt(e.stateInit)))return`Invalid 'stateInit' in message at index ${t}`;if(!(void 0===e.payload||Kt(e.payload)&&Vt(e.payload)))return`Invalid 'payload' in message at index ${t}`;if(void 0!==e.extraCurrency){if(!zt(e.extraCurrency))return`Invalid 'extraCurrency' in message at index ${t}`;for(const[n,r]of Object.entries(e.extraCurrency))if(!Bt.test(n)||"string"!=typeof r||!qt.test(r))return`Invalid 'extraCurrency' format in message at index ${t}`}return null}function Qt(e){if(!zt(e))return"Request must be an object";if(Zt(e,["tonProof"]))return"Request contains extra properties";if(void 0!==e.tonProof){if("string"!=typeof e.tonProof)return"Invalid 'tonProof'";const t=e.tonProof;if(0===t.length)return"Empty 'tonProof' payload";const n=function(){try{return"undefined"!=typeof window&&window.location?window.location.hostname:null}catch(e){return null}}();if(!n)return null;const r=(new TextEncoder).encode(n).length;if(r>128)return"Current domain exceeds 128 bytes limit";const o=(new TextEncoder).encode(t).length;if(o>128)return"'tonProof' payload exceeds 128 bytes limit";if(r+o>222)return"'tonProof' domain + payload exceeds 222 bytes limit"}return null}function Jt(e){if(!zt(e))return"Payload must be an object";if(!Kt(e.type))return"'type' is required";switch(e.type){case"text":return function(e){if(Zt(e,["type","text","network","from"]))return"Text payload contains extra properties";if(!Kt(e.text))return"'text' is required";if(void 0!==e.network&&!Ht(e.network))return"Invalid 'network' format";if(void 0!==e.from&&!Ft(e.from))return"Invalid 'from'";return null}(e);case"binary":return function(e){if(Zt(e,["type","bytes","network","from"]))return"Binary payload contains extra properties";if(!Kt(e.bytes))return"'bytes' is required";if(void 0!==e.network&&!Ht(e.network))return"Invalid 'network' format";if(void 0!==e.from&&!Ft(e.from))return"Invalid 'from'";return null}(e);case"cell":return function(e){if(Zt(e,["type","schema","cell","network","from"]))return"Cell payload contains extra properties";if(!Kt(e.schema))return"'schema' is required";if(!Kt(e.cell))return"'cell' is required";if(!Vt(e.cell))return"Invalid 'cell' format (must be valid base64)";if(void 0!==e.network&&!Ht(e.network))return"Invalid 'network' format";if(void 0!==e.from&&!Ft(e.from))return"Invalid 'from'";return null}(e);default:return"Invalid 'type' value"}}function Xt(e){if("string"!=typeof e)return;const t=e.length+(4-e.length%4)%4;return e.replace(/-/g,"+").replace(/_/g,"/").padEnd(t,"=")}class en{constructor(e={}){var t,n,r,o,i,a;this.events=[],this.timeoutId=null,this.isProcessing=!1,this.backoff=1,this.shouldSend=!0,this.batchTimeoutMs=null!==(t=e.batchTimeoutMs)&&void 0!==t?t:2e3,this.currentBatchTimeoutMs=this.batchTimeoutMs,this.maxBatchSize=null!==(n=e.maxBatchSize)&&void 0!==n?n:100,this.analyticsUrl=null!==(r=e.analyticsUrl)&&void 0!==r?r:"https://analytics.ton.org/events",this.mode=null!==(o=e.mode)&&void 0!==o?o:"telemetry",this.baseEvent=Object.assign({subsystem:"dapp-sdk",version:Ot,client_environment:null===(a=null===(i=e.environment)||void 0===i?void 0:i.getClientEnvironment)||void 0===a?void 0:a.call(i)},function(){const e={};try{const t=performance.getEntriesByType("navigation");if(t.length>0){const n=t[0];n.responseStart&&n.requestStart&&(e.conn_ttfb=Math.round(n.responseStart-n.requestStart))}}catch(t){}return e}()),this.addWindowFocusAndBlurSubscriptions()}scoped(e){return new Proxy(this,{get(t,n){const r=n.toString();if(r.startsWith("emit")){const n=r.replace("emit",""),o=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return function(n){const r=Object.fromEntries(Object.entries(null!=e?e:{}).map(([e,t])=>[e,"function"==typeof t?t():t]));return t.emit(Object.assign(Object.assign({event_name:o},r),n))}}return t[n]}})}emit(e){var t;if("off"===this.mode)return;const n=null!==(t=e.trace_id)&&void 0!==t?t:Pe(),r=function(){const e={};try{const t=navigator,n=t.connection||t.mozConnection||t.webkitConnection;n&&(void 0!==n.rtt&&(e.conn_rtt=n.rtt),n.effectiveType?e.conn_network_type=n.effectiveType:n.type&&(e.conn_network_type=n.type))}catch(t){}return e}(),o=Object.assign(Object.assign(Object.assign(Object.assign({},this.baseEvent),r),e),{event_id:Pe(),client_timestamp:Math.floor(Date.now()/1e3),trace_id:n}),i="telemetry"===this.mode?this.filterFullModeFields(o):o;nt()&&Re(i),this.events.push(i),this.events.length>=this.maxBatchSize?this.flush():this.startTimeout()}startTimeout(){this.timeoutId||this.isProcessing||(this.timeoutId=setTimeout(()=>{this.flush()},this.currentBatchTimeoutMs))}flush(){return V(this,0,void 0,function*(){if(this.isProcessing||0===this.events.length||!this.shouldSend)return;this.clearTimeout(),this.isProcessing=!0;const e=this.extractEventsToSend();try{yield this.processEventsBatch(e),Re("Analytics events sent successfully")}catch(t){this.restoreEvents(e),Te("Failed to send analytics events:",t)}finally{this.isProcessing=!1,this.scheduleNextFlushIfNeeded()}})}clearTimeout(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}extractEventsToSend(){const e=this.events.slice(0,this.maxBatchSize);return this.events=this.events.slice(this.maxBatchSize),e}processEventsBatch(e){return V(this,0,void 0,function*(){Re("Sending analytics events...",e.length);try{const t=yield this.sendEvents(e);this.handleResponse(t)}catch(t){this.handleUnknownError(t)}})}handleResponse(e){const{status:t,statusText:n}=e;this.isTooManyRequests(t)?this.handleTooManyRequests(t,n):this.isClientError(t)?this.handleClientError(t,n):this.isServerError(t)&&this.handleUnknownError({status:t,statusText:n})}restoreEvents(e){this.events.unshift(...e)}scheduleNextFlushIfNeeded(){this.events.length>0&&this.startTimeout()}sendEvents(e){return V(this,0,void 0,function*(){return yield fetch(this.analyticsUrl,{method:"POST",headers:{"Content-Type":"application/json","X-Client-Timestamp":Math.floor(Date.now()/1e3).toString()},body:JSON.stringify(e)})})}isClientError(e){return e>=en.HTTP_STATUS.CLIENT_ERROR_START&&e<en.HTTP_STATUS.SERVER_ERROR_START}isServerError(e){return e>=en.HTTP_STATUS.SERVER_ERROR_START}isTooManyRequests(e){return e===en.HTTP_STATUS.TOO_MANY_REQUESTS}handleClientError(e,t){Te("Failed to send analytics events:",new z(`Analytics API error: ${e} ${t}`))}handleUnknownError(e){if(this.backoff<en.MAX_BACKOFF_ATTEMPTS)throw this.backoff++,this.currentBatchTimeoutMs*=en.BACKOFF_MULTIPLIER,new z(`Unknown analytics API error: ${e}`);return this.currentBatchTimeoutMs=this.batchTimeoutMs,void(this.backoff=1)}handleTooManyRequests(e,t){throw new z(`Analytics API error: ${e} ${t}`)}addWindowFocusAndBlurSubscriptions(){const e=Ke();if(e)try{e.addEventListener("visibilitychange",()=>{e.hidden?(this.clearTimeout(),this.shouldSend=!1):(this.shouldSend=!0,this.scheduleNextFlushIfNeeded())})}catch(t){Te("Cannot subscribe to the document.visibilitychange: ",t)}}getMode(){return this.mode}getPendingEventsCount(){return this.events.length}filterFullModeFields(e){const t=Object.assign({},e);for(const r of en.FULL_MODE_FIELDS)delete t[r];const n="event_name"in e?String(e.event_name):"";return!("error_code"in e||"error_message"in e||n.includes("error")||"connection-error"===n||"transaction-signing-failed"===n||"sign-data-request-failed"===n)&&"wallet_address"in t&&delete t.wallet_address,t}setWalletListDownloadDuration(e){this.baseEvent=Object.assign(Object.assign({},this.baseEvent),{wallet_list_download_duration:e})}}en.HTTP_STATUS={TOO_MANY_REQUESTS:429,CLIENT_ERROR_START:400,SERVER_ERROR_START:500},en.MAX_BACKOFF_ATTEMPTS=5,en.BACKOFF_MULTIPLIER=2,en.FULL_MODE_FIELDS=["user_id","tg_id","locale","tma_is_premium"];class tn{constructor(){this.window=$e()}dispatchEvent(e,t){return V(this,0,void 0,function*(){var n;const r=new CustomEvent(e,{detail:t});null===(n=this.window)||void 0===n||n.dispatchEvent(r)})}addEventListener(e,t,n){return V(this,0,void 0,function*(){var r;return null===(r=this.window)||void 0===r||r.addEventListener(e,t,n),()=>{var n;return null===(n=this.window)||void 0===n?void 0:n.removeEventListener(e,t)}})}}function nn(e){return{"@tonconnect/sdk":e.ton_connect_sdk_lib||"","@tonconnect/ui":e.ton_connect_ui_lib||""}}function rn(e){var t,n,r,o,i,a,s,l;return{versions:nn(e.custom_data),network_id:null!==(t=e.custom_data.chain_id)&&void 0!==t?t:"",client_id:null!==(n=e.custom_data.client_id)&&void 0!==n?n:"",wallet_id:null!==(r=e.custom_data.wallet_id)&&void 0!==r?r:"",wallet_address:null!==(o=e.wallet_address)&&void 0!==o?o:"",wallet_app_name:null!==(i=e.wallet_type)&&void 0!==i?i:"",wallet_app_version:null!==(a=e.wallet_version)&&void 0!==a?a:"",wallet_state_init:null!==(s=e.wallet_state_init)&&void 0!==s?s:"",trace_id:null!==(l=e.trace_id)&&void 0!==l?l:void 0}}class on{getClientEnvironment(){return""}getBrowser(){return""}getLocale(){return""}getPlatform(){return""}getTelegramUser(){}}const an={};function sn(){return void 0!==an.UniversalConnectorCls&&void 0!==an.walletConnectOptions}const ln="0";class cn{constructor(e){this.connectionStorage=e,this.type="injected",this.listeners=[],this.connector=void 0;const{projectId:t,metadata:n}=function(){if(void 0===an.walletConnectOptions)throw new z("Wallet Connect is not initialized.");return an.walletConnectOptions}();this.config={networks:[{namespace:"ton",chains:[{id:-239,chainNamespace:"ton",caipNetworkId:"ton:-239",name:"TON",nativeCurrency:{name:"TON",symbol:"TON",decimals:9},rpcUrls:{default:{http:[]}}},{id:-3,chainNamespace:"ton",caipNetworkId:"ton:-3",name:"TON",nativeCurrency:{name:"TON",symbol:"TON",decimals:9},rpcUrls:{default:{http:[]}}}],methods:["ton_sendMessage","ton_signData"],events:[]}],projectId:t,metadata:n}}static fromStorage(e){return V(this,0,void 0,function*(){return new cn(e)})}initialize(){return V(this,0,void 0,function*(){return this.connector||(this.connector=yield function(){if(void 0===an.UniversalConnectorCls)throw new z("Wallet Connect is not initialized.");return an.UniversalConnectorCls}().init(this.config)),this.connector})}connect(e,t){var n,r;const o=null!==(n=null==t?void 0:t.traceId)&&void 0!==n?n:Pe(),i=_e(null==t?void 0:t.signal);null===(r=this.abortController)||void 0===r||r.abort(),this.abortController=i,this._connect(e,{traceId:o,signal:i.signal,abortController:i}).catch(e=>Re("WalletConnect connect unexpected error",e))}_connect(t,n){return V(this,0,void 0,function*(){var r,o;const i=yield this.initialize();if(null===(r=n.signal)||void 0===r?void 0:r.aborted)return Re("WalletConnect connect aborted before start"),void this.clearAbortController(n.abortController);const a=t.items.find(e=>"ton_proof"===e.name),s=a?[{domain:new URL(this.config.metadata.url).hostname,chains:["ton:-239"],nonce:"",uri:"ton_proof",ttl:0,statement:a.payload}]:void 0;Re("Connecting through this.connector.connect");try{yield i.connect({authentication:s})}catch(l){if(null===(o=n.signal)||void 0===o?void 0:o.aborted)return Re("WalletConnect connect aborted via signal"),void this.clearAbortController(n.abortController);Re("WalletConnect connect error",l);const t={id:0,event:"connect_error",traceId:n.traceId,payload:{code:e.CONNECT_EVENT_ERROR_CODES.USER_REJECTS_ERROR,message:"User declined the connection"}};return Re("WalletConnect connect response:",t),this.emit(t),void this.clearAbortController(n.abortController)}Re("Connected through this.connector.connect");try{yield this.onConnect(i,Object.assign(Object.assign({},n),{includeTonProof:!0}))}catch(l){Re("WalletConnect onConnect error",l),yield this.disconnect({traceId:n.traceId,signal:n.signal})}finally{this.clearAbortController(n.abortController)}})}restoreConnection(e){return V(this,0,void 0,function*(){var t,n;const r=null!==(t=null==e?void 0:e.traceId)&&void 0!==t?t:Pe(),o=_e(null==e?void 0:e.signal);if(null===(n=this.abortController)||void 0===n||n.abort(),this.abortController=o,!o.signal.aborted)try{Re("Restoring WalletConnect connection...");if(!(yield this.connectionStorage.getWalletConnectConnection())||o.signal.aborted)return;const e=yield this.initialize();if(o.signal.aborted)return;yield this.onConnect(e,{includeTonProof:!1,traceId:r,signal:o.signal}),Re("WalletConnect successfully restored.")}catch(i){Re("WalletConnect restore error",i),yield this.disconnect({traceId:r,signal:o.signal})}finally{this.clearAbortController(o)}})}closeConnection(){var e;null===(e=this.abortController)||void 0===e||e.abort(),this.abortController=void 0,this.disconnect()}disconnect(e){return V(this,0,void 0,function*(){var t,n;const r=_e(null==e?void 0:e.signal);if(null===(t=this.abortController)||void 0===t||t.abort(),this.abortController=r,!r.signal.aborted)try{if(yield this.connectionStorage.removeConnection(),r.signal.aborted)return;yield null===(n=this.connector)||void 0===n?void 0:n.disconnect()}catch(o){Re("WalletConnect disconnect error",o)}finally{this.clearAbortController(r)}})}sendRequest(e,t){return V(this,0,void 0,function*(){var n,r,o,i;if(!this.connector)throw new z("Wallet Connect not initialized");const a={};"function"==typeof t?a.onRequestSent=t:(a.onRequestSent=null==t?void 0:t.onRequestSent,a.signal=null==t?void 0:t.signal,a.attempts=null==t?void 0:t.attempts,a.traceId=null==t?void 0:t.traceId),null!==(n=a.traceId)&&void 0!==n||(a.traceId=Pe());try{if(null===(r=a.signal)||void 0===r?void 0:r.aborted)throw new z("WalletConnect request aborted");if(Re("Send wallet-connect request:",Object.assign(Object.assign({},e),{id:ln})),"sendTransaction"===e.method){const t=JSON.parse(e.params[0]),{network:n}=t,r=H(t,["network"]),i=this.connector.request({method:"ton_sendMessage",params:r},`ton:${n}`);null===(o=null==a?void 0:a.onRequestSent)||void 0===o||o.call(a);const s=yield i;return Re("Wallet message received:",{result:s,id:ln}),{result:s,id:ln,traceId:a.traceId}}if("signData"===e.method){const t=JSON.parse(e.params[0]),{network:n}=t,r=H(t,["network"]),o=this.connector.request({method:"ton_signData",params:r},`ton:${n}`);null===(i=null==a?void 0:a.onRequestSent)||void 0===i||i.call(a);const s=yield o;return Re("Wallet message received:",{result:s,id:ln}),{result:s,traceId:a.traceId,id:ln}}if("disconnect"===e.method)return{id:ln,traceId:a.traceId}}catch(s){Re("WalletConnect request error",s,s.stack);const e=yield this.handleWalletConnectError(s,{traceId:a.traceId});return Re("Wallet message received:",e),e}return{id:ln,error:{code:D.UNKNOWN_ERROR,message:"Not implemented."},traceId:a.traceId}})}handleWalletConnectError(t,n){return V(this,0,void 0,function*(){if("object"==typeof t&&null!==t){const r=String("message"in t?t.message:"msg"in t?t.msg:t);return r.toLowerCase().includes("reject")?{id:ln,traceId:n.traceId,error:{code:e.SEND_TRANSACTION_ERROR_CODES.USER_REJECTS_ERROR,message:r}}:r.toLowerCase().includes("tonvalidationerror")?{id:ln,traceId:n.traceId,error:{code:e.SEND_TRANSACTION_ERROR_CODES.BAD_REQUEST_ERROR,message:r}}:{id:ln,traceId:n.traceId,error:{code:e.SEND_TRANSACTION_ERROR_CODES.UNKNOWN_ERROR,message:r}}}return{id:ln,traceId:n.traceId,error:{code:e.SEND_TRANSACTION_ERROR_CODES.UNKNOWN_ERROR,message:String(t)}}})}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter(t=>t!==e)}buildTonProof(e){var t,n,r;const o=null===(t=e.provider.session.authentication)||void 0===t?void 0:t[0],i=null===(n=null==o?void 0:o.p)||void 0===n?void 0:n.iat,a=null===(r=null==o?void 0:o.p)||void 0===r?void 0:r.statement;if(!i||!a)return;const s=o.p.domain;return{name:"ton_proof",proof:{timestamp:Math.floor(new Date(i).getTime()/1e3),domain:{lengthBytes:s.length,value:s},payload:a,signature:o.s.s}}}onConnect(t,n){return V(this,0,void 0,function*(){var r,o,i,a;if(null===(r=n.signal)||void 0===r?void 0:r.aborted)return void Re("WalletConnect onConnect aborted");const s=t.provider.session,l=s.namespaces.ton;if(!(null===(o=null==l?void 0:l.accounts)||void 0===o?void 0:o[0]))return void(yield this.disconnectWithError({traceId:n.traceId,code:e.CONNECT_EVENT_ERROR_CODES.BAD_REQUEST_ERROR,message:"Connection error. No TON accounts connected."}));const c=l.accounts[0],[,d,u]=c.split(":",3),h=null===(i=s.sessionProperties)||void 0===i?void 0:i.ton_getPublicKey;if(!h)return void(yield this.disconnectWithError({traceId:n.traceId,code:e.CONNECT_EVENT_ERROR_CODES.BAD_REQUEST_ERROR,message:"Connection error. No sessionProperties.ton_getPublicKey provided."}));const p=null===(a=s.sessionProperties)||void 0===a?void 0:a.ton_getStateInit;if(!p)return void(yield this.disconnectWithError({traceId:n.traceId,code:e.CONNECT_EVENT_ERROR_CODES.BAD_REQUEST_ERROR,message:"Connection error. No sessionProperties.ton_getStateInit provided."}));t.provider.once("session_delete",()=>V(this,0,void 0,function*(){try{yield this.connectionStorage.removeConnection();const e={event:"disconnect",traceId:Pe(),payload:{}};Re("Wallet message received:",e),this.emit(e)}catch(e){Re("Error while deleting session",e)}}));const g=(null==n?void 0:n.includeTonProof)?this.buildTonProof(t):void 0,f={items:[{name:"ton_addr",address:At(u)?function({wc:e,hex:t}){return`${e}:${t}`}(Lt(u)):u,network:d,publicKey:h,walletStateInit:p},...g?[g]:[]],device:{appName:"wallet_connect",appVersion:"",maxProtocolVersion:2,features:this.buildFeatureList(l.methods),platform:"browser"}};Re("WalletConnect connect response:",{event:"connect",payload:f,id:0}),this.emit({event:"connect",payload:f,traceId:n.traceId}),yield this.storeConnection()})}buildFeatureList(e){const t=[];return e.includes("ton_sendMessage")&&t.push("SendTransaction",{name:"SendTransaction",maxMessages:4,extraCurrencySupported:!1}),e.includes("ton_signData")&&t.push({name:"SignData",types:["text","binary","cell"]}),t}disconnectWithError(e){return V(this,0,void 0,function*(){yield this.disconnect();const t={code:e.code,message:e.message};Re("WalletConnect connect response:",{event:"connect_error",id:0,payload:t}),this.emit({event:"connect_error",traceId:e.traceId,payload:t})})}clearAbortController(e){this.abortController===e&&(this.abortController=void 0)}emit(e,t){(null!=t?t:this.listeners).forEach(t=>t(e))}storeConnection(){return this.connectionStorage.storeConnection({type:"wallet-connect"})}}class dn{static getWallets(){return this.walletsList.getWallets()}get connected(){return null!==this._wallet}get account(){var e;return(null===(e=this._wallet)||void 0===e?void 0:e.account)||null}get wallet(){return this._wallet}set wallet(e){this._wallet=e,this.statusChangeSubscriptions.forEach(e=>e(this._wallet))}constructor(e){var t,n,r;this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[];const o=(null==e?void 0:e.manifestUrl)||function(){var e;const t=null===(e=$e())||void 0===e?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}();this.dappSettings={manifestUrl:o,storage:(null==e?void 0:e.storage)||new Ze},this.walletsRequiredFeatures=null==e?void 0:e.walletsRequiredFeatures,this.environment=null!==(t=null==e?void 0:e.environment)&&void 0!==t?t:new on,this.analytics=new en({environment:this.environment}),this.walletsList=new it({walletsListSource:null==e?void 0:e.walletsListSource,cacheTTLMs:null==e?void 0:e.walletsListCacheTTLMs,onDownloadDurationMeasured:e=>{var t;null===(t=this.analytics)||void 0===t||t.setWalletListDownloadDuration(e)}});const i=null!==(n=null==e?void 0:e.eventDispatcher)&&void 0!==n?n:new tn;if(this.tracker=new It({eventDispatcher:i,tonConnectSdkVersion:Ot}),this.environment=null!==(r=null==e?void 0:e.environment)&&void 0!==r?r:new on,this.initAnalytics(o,i,e),!this.dappSettings.manifestUrl)throw new Z("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new ze(this.dappSettings.storage,this.walletsList),(null==e?void 0:e.disableAutoPauseConnection)||this.addWindowFocusAndBlurSubscriptions()}getWallets(){return this.walletsList.getWallets()}onStatusChange(e,t){return this.statusChangeSubscriptions.push(e),t&&this.statusChangeErrorSubscriptions.push(t),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(t=>t!==e),t&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(e=>e!==t))}}connect(e,t,n){var r,o,i;const a=Object.assign({},n);if("object"==typeof t&&null!==t&&"tonProof"in t&&(a.request=t),"object"==typeof t&&null!==t&&("openingDeadlineMS"in t||"signal"in t||"request"in t||"traceId"in t)&&(a.request=null==t?void 0:t.request,a.openingDeadlineMS=null==t?void 0:t.openingDeadlineMS,a.signal=null==t?void 0:t.signal),a.request){const e=Qt(a.request);if(e){if(!nt())throw new z("ConnectAdditionalRequest validation failed: "+e);console.error("ConnectAdditionalRequest validation failed: "+e)}}if(this.connected)throw new Q;const s=_e(null==a?void 0:a.signal);if(null===(r=this.abortController)||void 0===r||r.abort(),this.abortController=s,s.signal.aborted)throw new z("Connection was aborted");null===(o=this.provider)||void 0===o||o.closeConnection(),this.provider=this.createProvider(e),s.signal.addEventListener("abort",()=>{var e;null===(e=this.provider)||void 0===e||e.closeConnection(),this.provider=null});const l=null!==(i=null==a?void 0:a.traceId)&&void 0!==i?i:Pe();return this.tracker.trackConnectionStarted(l),this.provider.connect(this.createConnectRequest(null==a?void 0:a.request),{openingDeadlineMS:null==a?void 0:a.openingDeadlineMS,signal:s.signal,traceId:l})}restoreConnection(e){return V(this,0,void 0,function*(){var t,n,r;const o=null!==(t=null==e?void 0:e.traceId)&&void 0!==t?t:Pe();this.tracker.trackConnectionRestoringStarted(o);const i=_e(null==e?void 0:e.signal);if(null===(n=this.abortController)||void 0===n||n.abort(),this.abortController=i,i.signal.aborted)return void this.tracker.trackConnectionRestoringError("Connection restoring was aborted",o);const[a,s]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(i.signal.aborted)return void this.tracker.trackConnectionRestoringError("Connection restoring was aborted",o);let l=null;try{switch(a){case"http":l=yield De.fromStorage(this.bridgeConnectionStorage,this.analytics);break;case"injected":l=yield Ve.fromStorage(this.bridgeConnectionStorage,this.analytics);break;case"wallet-connect":l=yield cn.fromStorage(this.bridgeConnectionStorage);break;default:if(!s)return;l=this.createProvider(s)}}catch(h){return Re("Provider is not restored",h),this.tracker.trackConnectionRestoringError("Provider is not restored",o),yield this.bridgeConnectionStorage.removeConnection(),null==l||l.closeConnection(),void(l=null)}if(i.signal.aborted)return null==l||l.closeConnection(),void this.tracker.trackConnectionRestoringError("Connection restoring was aborted",o);if(!l)return Te("Provider is not restored"),void this.tracker.trackConnectionRestoringError("Provider is not restored",o);null===(r=this.provider)||void 0===r||r.closeConnection(),this.provider=l,l.listen(this.walletEventsListener.bind(this));const c=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted",o),null==l||l.closeConnection(),l=null};i.signal.addEventListener("abort",c);const d=Ee(t=>V(this,0,void 0,function*(){if(yield null==l?void 0:l.restoreConnection({openingDeadlineMS:null==e?void 0:e.openingDeadlineMS,signal:t.signal,traceId:o}),i.signal.removeEventListener("abort",c),this.connected){const e=this.getSessionInfo();this.tracker.trackConnectionRestoringCompleted(this.wallet,e,o)}else this.tracker.trackConnectionRestoringError("Connection restoring failed",o)}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:2e3,signal:null==e?void 0:e.signal}),u=new Promise(e=>setTimeout(()=>e(),12e3));return Promise.race([d,u])})}sendTransaction(e,t){return V(this,0,void 0,function*(){var n,r,o,i;const a={};"function"==typeof t?a.onRequestSent=t:(a.onRequestSent=null==t?void 0:t.onRequestSent,a.signal=null==t?void 0:t.signal,a.traceId=null==t?void 0:t.traceId);const s=Gt(e);if(s){if(!nt())throw new z("SendTransactionRequest validation failed: "+s);console.error("SendTransactionRequest validation failed: "+s)}const l=_e(null==a?void 0:a.signal);if(l.signal.aborted)throw new z("Transaction sending was aborted");this.checkConnection();const c=e.messages.length,d=e.messages.some(e=>e.extraCurrency&&Object.keys(e.extraCurrency).length>0);at(this.wallet.device.features,{requiredMessagesNumber:c,requireExtraCurrencies:d});const u=this.getSessionInfo(),h=null!==(n=null==a?void 0:a.traceId)&&void 0!==n?n:Pe();this.tracker.trackTransactionSentForSignature(this.wallet,e,u,h);const{validUntil:p,messages:g}=e,f=H(e,["validUntil","messages"]),m=e.from||this.account.address,w=e.network||this.account.chain;if((null===(r=this.wallet)||void 0===r?void 0:r.account.chain)&&w!==this.wallet.account.chain){if(!nt())throw new ne("Wallet connected to a wrong network",{cause:{expectedChainId:null===(o=this.wallet)||void 0===o?void 0:o.account.chain,actualChainId:w}});console.error("Wallet connected to a wrong network",{expectedChainId:null===(i=this.wallet)||void 0===i?void 0:i.account.chain,actualChainId:w})}const v=yield this.provider.sendRequest(fe.convertToRpcRequest(Object.assign(Object.assign({},f),{from:m,network:w,valid_until:p,messages:g.map(e=>{var{extraCurrency:t,payload:n,stateInit:r}=e,o=H(e,["extraCurrency","payload","stateInit"]);return Object.assign(Object.assign({},o),{payload:Xt(n),stateInit:Xt(r),extra_currency:t})})})),{onRequestSent:a.onRequestSent,signal:l.signal,traceId:h});if(fe.isError(v))return this.tracker.trackTransactionSigningFailed(this.wallet,e,v.error.message,v.error.code,u,h),fe.parseAndThrowError(v);const y=fe.convertFromRpcResponse(v);return this.tracker.trackTransactionSigned(this.wallet,e,y,u,h),Object.assign(Object.assign({},y),{traceId:v.traceId})})}signData(e,t){return V(this,0,void 0,function*(){var n,r,o,i;const a=_e(null==t?void 0:t.signal);if(a.signal.aborted)throw new z("data sending was aborted");const s=Jt(e);if(s){if(!nt())throw new z("SignDataPayload validation failed: "+s);console.error("SignDataPayload validation failed: "+s)}this.checkConnection(),function(e,t){const n=e.find(e=>e&&"object"==typeof e&&"SignData"===e.name);if(!n)throw new ee("Wallet doesn't support SignData feature.",{cause:{requiredFeature:{featureName:"SignData",value:{types:t.requiredTypes}}}});const r=t.requiredTypes.filter(e=>!n.types.includes(e));if(r.length)throw new ee(`Wallet doesn't support required SignData types: ${r.join(", ")}.`,{cause:{requiredFeature:{featureName:"SignData",value:{types:r}}}})}(this.wallet.device.features,{requiredTypes:[e.type]});const l=this.getSessionInfo(),c=null!==(n=null==t?void 0:t.traceId)&&void 0!==n?n:Pe();this.tracker.trackDataSentForSignature(this.wallet,e,l,c);const d=e.from||this.account.address,u=e.network||this.account.chain;if((null===(r=this.wallet)||void 0===r?void 0:r.account.chain)&&u!==this.wallet.account.chain){if(!nt())throw new ne("Wallet connected to a wrong network",{cause:{expectedChainId:null===(o=this.wallet)||void 0===o?void 0:o.account.chain,actualChainId:u}});console.error("Wallet connected to a wrong network",{expectedChainId:null===(i=this.wallet)||void 0===i?void 0:i.account.chain,actualChainId:u})}const h=yield this.provider.sendRequest(we.convertToRpcRequest(Object.assign(Object.assign(Object.assign({},e),"cell"===e.type?{cell:Xt(e.cell)}:{}),{from:d,network:u})),{onRequestSent:null==t?void 0:t.onRequestSent,signal:a.signal,traceId:c});if(we.isError(h))return this.tracker.trackDataSigningFailed(this.wallet,e,h.error.message,h.error.code,l,c),we.parseAndThrowError(h);const p=we.convertFromRpcResponse(h);return this.tracker.trackDataSigned(this.wallet,e,p,l,c),Object.assign(Object.assign({},p),{traceId:c})})}setConnectionNetwork(e){if(this.connected)throw new z("Cannot change network while wallet is connected");this.desiredChainId=e}disconnect(e){return V(this,0,void 0,function*(){var t,n;if(!this.connected)throw new J;const r=_e(null==e?void 0:e.signal),o=this.abortController;if(this.abortController=r,r.signal.aborted)throw new z("Disconnect was aborted");const i=null!==(t=null==e?void 0:e.traceId)&&void 0!==t?t:Pe();this.onWalletDisconnected("dapp",{traceId:i}),yield null===(n=this.provider)||void 0===n?void 0:n.disconnect({signal:r.signal,traceId:i}),null==o||o.abort()})}getSessionId(){return V(this,0,void 0,function*(){if(!this.provider)return null;try{const e=yield this.bridgeConnectionStorage.getConnection();return e&&"http"===e.type?"sessionCrypto"in e?e.sessionCrypto.sessionId:e.session.sessionCrypto.sessionId:null}catch(e){return null}})}getSessionInfo(){var e;if("http"!==(null===(e=this.provider)||void 0===e?void 0:e.type))return null;if(!("session"in this.provider))return null;try{const e=this.provider.session;if(!e)return null;const t=e.sessionCrypto.sessionId;let n=null;return"walletPublicKey"in e&&(n=e.walletPublicKey),{clientId:t,walletId:n}}catch(t){return null}}pauseConnection(){var e;"http"===(null===(e=this.provider)||void 0===e?void 0:e.type)&&this.provider.pause()}unPauseConnection(){var e;return"http"!==(null===(e=this.provider)||void 0===e?void 0:e.type)?Promise.resolve():this.provider.unPause()}addWindowFocusAndBlurSubscriptions(){const e=Ke();if(e)try{e.addEventListener("visibilitychange",()=>{e.hidden?this.pauseConnection():this.unPauseConnection().catch(()=>{})})}catch(t){Te("Cannot subscribe to the document.visibilitychange: ",t)}}initAnalytics(e,t,n){var r;const o=null==n?void 0:n.analytics,i=null!==(r=null==o?void 0:o.mode)&&void 0!==r?r:"telemetry";if("off"===i)return;const a=new en({environment:this.environment,mode:i});this.analytics=a;const s=this.environment.getTelegramUser(),l={browser:this.environment.getBrowser(),platform:this.environment.getPlatform(),manifest_json_url:e,origin_url:Fe,locale:this.environment.getLocale()};s&&(l.tg_id=s.id,l.tma_is_premium=s.isPremium),function(e,t){e.addEventListener("ton-connect-ui-wallet-modal-opened",e=>{var n;const{detail:r}=e;t.emitConnectionStarted({client_id:r.client_id||"",versions:nn(r.custom_data),main_screen:r.visible_wallets,trace_id:null!==(n=r.trace_id)&&void 0!==n?n:void 0})}),e.addEventListener("ton-connect-ui-selected-wallet",e=>{var n,r;const{detail:o}=e;t.emitConnectionSelectedWallet({client_id:o.client_id||"",versions:nn(o.custom_data),main_screen:o.visible_wallets,wallets_menu:o.wallets_menu,trace_id:null!==(n=o.trace_id)&&void 0!==n?n:void 0,wallet_app_name:null!==(r=o.wallet_type)&&void 0!==r?r:"",wallet_redirect_method:o.wallet_redirect_method,wallet_redirect_link:o.wallet_redirect_link})}),e.addEventListener("ton-connect-connection-completed",e=>{const{detail:n}=e;t.emitConnectionCompleted(rn(n))}),e.addEventListener("ton-connect-connection-error",e=>{var n,r;const{detail:o}=e;t.emitConnectionError({client_id:o.custom_data.client_id||"",wallet_id:o.custom_data.wallet_id||"",error_code:null!==(n=o.error_code)&&void 0!==n?n:0,error_message:o.error_message,trace_id:null!==(r=o.trace_id)&&void 0!==r?r:void 0})}),e.addEventListener("ton-connect-disconnection",e=>{const{detail:n}=e;t.emitDisconnection(rn(n))}),e.addEventListener("ton-connect-transaction-sent-for-signature",e=>{const{detail:n}=e;t.emitTransactionSent(rn(n))}),e.addEventListener("ton-connect-transaction-signed",e=>{const{detail:n}=e;t.emitTransactionSigned(Object.assign(Object.assign({},rn(n)),{signed_boc:e.detail.signed_transaction}))}),e.addEventListener("ton-connect-transaction-signing-failed",e=>{var n;const{detail:r}=e;t.emitTransactionSigningFailed(Object.assign(Object.assign({},rn(r)),{valid_until:Number(r.valid_until),messages:r.messages.map(e=>{var t,n,r,o;return{address:null!==(t=e.address)&&void 0!==t?t:"",amount:null!==(n=e.amount)&&void 0!==n?n:"",payload:null!==(r=e.payload)&&void 0!==r?r:"",state_init:null!==(o=e.state_init)&&void 0!==o?o:""}}),error_message:r.error_message,error_code:null!==(n=r.error_code)&&void 0!==n?n:0}))}),e.addEventListener("ton-connect-sign-data-request-initiated",e=>{const{detail:n}=e;null==t||t.emitSignDataRequestInitiated(rn(n))}),e.addEventListener("ton-connect-sign-data-request-completed",e=>{const{detail:n}=e;null==t||t.emitSignDataRequestCompleted(rn(n))}),e.addEventListener("ton-connect-sign-data-request-failed",e=>{var n;const{detail:r}=e;let o,i="";"text"===r.data.type&&(i=r.data.text),"cell"===r.data.type&&(i=r.data.cell,o=r.data.schema),"binary"===r.data.type&&(i=r.data.bytes),null==t||t.emitSignDataRequestFailed(Object.assign(Object.assign({},rn(r)),{sign_data_type:r.data.type,sign_data_value:i,sign_data_schema:o,error_code:null!==(n=r.error_code)&&void 0!==n?n:0,error_message:r.error_message}))})}(t,a.scoped(l))}createProvider(e){let t;return t=!Array.isArray(e)&&"jsBridgeKey"in e?new Ve(this.bridgeConnectionStorage,e.jsBridgeKey,this.analytics):!Array.isArray(e)&&function(e){return"type"in e&&"wallet-connect"===e.type}(e)?new cn(this.bridgeConnectionStorage):new De(this.bridgeConnectionStorage,e,this.analytics),t.listen(this.walletEventsListener.bind(this)),t}walletEventsListener(e){switch(e.event){case"connect":this.onWalletConnected(e.payload,{traceId:e.traceId});break;case"connect_error":this.tracker.trackConnectionError(e.payload.message,e.payload.code,this.getSessionInfo(),e.traceId);const t=he.parseError(e.payload);this.onWalletConnectError(t);break;case"disconnect":this.onWalletDisconnected("wallet",{traceId:e.traceId})}}onWalletConnected(t,n){var r,o;const i=t.items.find(e=>"ton_addr"===e.name),a=t.items.find(e=>"ton_proof"===e.name);if(!i)throw new z("ton_addr connection item was not found");if(!st(t.device.features,this.walletsRequiredFeatures))return null===(r=this.provider)||void 0===r||r.disconnect(),void this.onWalletConnectError(new te("Wallet does not support required features",{cause:{connectEvent:t}}));const s={device:t.device,provider:this.provider.type,account:{address:i.address,chain:i.network,walletStateInit:i.walletStateInit,publicKey:i.publicKey}};if(this.desiredChainId&&s.account.chain!==this.desiredChainId){const e=this.desiredChainId,t=s.account.chain;return null===(o=this.provider)||void 0===o||o.disconnect(),void this.onWalletConnectError(new ne("Wallet connected to a wrong network",{cause:{expectedChainId:e,actualChainId:t}}))}if(a){const t=function(e){if(!zt(e))return"ton_proof item must be an object";if(Zt(e,["error","proof","name"]))return"ton_proof item contains extra properties";const t=Object.prototype.hasOwnProperty.call(e,"proof"),n=Object.prototype.hasOwnProperty.call(e,"error");if(!t&&!n)return"'ton_proof' item must contain either 'proof' or 'error'";if(t&&n)return"'ton_proof' item must contain either 'proof' or 'error', not both";if(t){const t=e.proof;if(!zt(t))return"Invalid 'proof' object";if(!$t(t.timestamp))return"Invalid 'proof.timestamp'";const n=t.domain;if(!zt(n))return"Invalid 'proof.domain'";if(!$t(n.lengthBytes))return"Invalid 'proof.domain.lengthBytes'";if(!Kt(n.value))return"Invalid 'proof.domain.value'";try{if(("undefined"!=typeof TextEncoder?(new TextEncoder).encode(n.value).length:n.value.length)!==n.lengthBytes)return"'proof.domain.lengthBytes' does not match 'proof.domain.value'"}catch(r){}if(!Kt(t.payload))return"Invalid 'proof.payload'";if(!Kt(t.signature)||!Dt.test(t.signature))return"Invalid 'proof.signature' format"}if(n){const t=e.error;if(!zt(t))return"Invalid 'error' object";if(Zt(t,["code","message"]))return"ton_proof error contains extra properties";if(!$t(t.code))return"Invalid 'error.code'";if(!Kt(t.message))return"Invalid 'error.message'"}return null}(a);let n;if(t)nt()&&console.error("TonProofItem validation failed: "+t),n={name:"ton_proof",error:{code:e.CONNECT_ITEM_ERROR_CODES.UNKNOWN_ERROR,message:t}};else try{if("proof"in a)n={name:"ton_proof",proof:{timestamp:a.proof.timestamp,domain:{lengthBytes:a.proof.domain.lengthBytes,value:a.proof.domain.value},payload:a.proof.payload,signature:a.proof.signature}};else{if(!("error"in a))throw new z("Invalid data format");n={name:"ton_proof",error:{code:a.error.code,message:a.error.message}}}}catch(c){n={name:"ton_proof",error:{code:e.CONNECT_ITEM_ERROR_CODES.UNKNOWN_ERROR,message:"Invalid data format"}}}s.connectItems={tonProof:n}}this.wallet=s;const l=this.getSessionInfo();this.tracker.trackConnectionCompleted(s,l,null==n?void 0:n.traceId)}onWalletConnectError(e){if(this.statusChangeErrorSubscriptions.forEach(t=>t(e)),Re(e),e instanceof Y||e instanceof G)throw Te(e),e}onWalletDisconnected(e,t){const n=this.getSessionInfo();this.tracker.trackDisconnection(this.wallet,e,n,null==t?void 0:t.traceId),this.wallet=null}checkConnection(){if(!this.connected)throw new J}createConnectRequest(e){const t=[Object.assign({name:"ton_addr"},this.desiredChainId?{network:this.desiredChainId}:{})];return(null==e?void 0:e.tonProof)&&t.push({name:"ton_proof",payload:e.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:t}}}dn.walletsList=new it,dn.isWalletInjected=e=>Ve.isWalletInjected(e),dn.isInsideWalletBrowser=e=>Ve.isInsideWalletBrowser(e);const un=Symbol("solid-proxy"),hn="function"==typeof Proxy,pn=Symbol("solid-track"),gn={equals:(e,t)=>e===t};let fn=er;const mn=1,wn=2,vn={owned:null,cleanups:null,context:null,owner:null},yn={};var bn=null;let Cn=null,xn=null,Sn=null,kn=null,_n=0;function En(e,t){const n=xn,r=bn,o=0===e.length,i=void 0===t?r:t,a=o?vn:{owned:null,cleanups:null,context:i?i.context:null,owner:i},s=o?e:()=>e(()=>Nn(()=>or(a)));bn=a,xn=null;try{return Xn(s,!0)}finally{xn=n,bn=r}}function Rn(e,t){const n={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},gn,t):gn).equals||void 0};return[Zn.bind(n),e=>("function"==typeof e&&(e=e(n.value)),Gn(n,e))]}function Tn(e,t,n){Yn(Qn(e,t,!0,mn))}function In(e,t,n){Yn(Qn(e,t,!1,mn))}function On(e,t,n){fn=tr;const r=Qn(e,t,!1,mn);n&&n.render||(r.user=!0),kn?kn.push(r):Yn(r)}function Mn(e,t,n){n=n?Object.assign({},gn,n):gn;const r=Qn(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Yn(r),Zn.bind(r)}function An(e,t,n){let r,o,i;r=!0,o=e,i={};let a=null,s=yn,l=!1,c="initialValue"in i,d=!1;const u=new Set,[h,p]=(i.storage||Rn)(i.initialValue),[g,f]=Rn(void 0),[m,w]=Rn(void 0,{equals:!1}),[v,y]=Rn(c?"ready":"unresolved");function b(e,t,n,r){return a===e&&(a=null,void 0!==r&&(c=!0),e!==s&&t!==s||!i.onHydrated||queueMicrotask(()=>i.onHydrated(r,{value:t})),s=yn,function(e,t){Xn(()=>{void 0===t&&p(()=>e),y(void 0!==t?"errored":c?"ready":"unresolved"),f(t);for(const e of u.keys())e.decrement();u.clear()},!1)}(t,n)),t}function C(){const e=h(),t=g();if(void 0!==t&&!a)throw t;return xn&&xn.user,e}function x(e=!0){if(!1!==e&&l)return;l=!1;const t=d?d():r;if(null==t||!1===t)return void b(a,Nn(h));let n;const i=s!==yn?s:Nn(()=>{try{return o(t,{value:h(),refetching:e})}catch(r){n=r}});var u;if(void 0===n)return(u=i)&&"object"==typeof u&&"then"in u?(a=i,"v"in i?(1===i.s?b(a,i.v,void 0,t):b(a,void 0,ir(i.v),t),i):(l=!0,queueMicrotask(()=>l=!1),Xn(()=>{y(c?"refreshing":"pending"),w()},!1),i.then(e=>b(i,e,void 0,t),e=>b(i,void 0,ir(e),t)))):(b(a,i,void 0,t),i);b(a,void 0,ir(n),t)}Object.defineProperties(C,{state:{get:()=>v()},error:{get:()=>g()},loading:{get(){const e=v();return"pending"===e||"refreshing"===e}},latest:{get(){if(!c)return C();const e=g();if(e&&!a)throw e;return h()}}});let S=bn;return d?Tn(()=>(S=bn,x(!1))):x(!1),[C,{refetch:e=>Bn(S,()=>x(e)),mutate:p}]}function Ln(e){return Xn(e,!1)}function Nn(e){if(null===xn)return e();const t=xn;xn=null;try{return e()}finally{xn=t}}function Wn(e,t,n){const r=Array.isArray(e);let o;return n=>{let i;if(r){i=Array(e.length);for(let t=0;t<e.length;t++)i[t]=e[t]()}else i=e();const a=Nn(()=>t(i,o,n));return o=i,a}}function Pn(e){On(()=>Nn(e))}function Un(e){return null===bn||(null===bn.cleanups?bn.cleanups=[e]:bn.cleanups.push(e)),e}function Dn(){return xn}function jn(){return bn}function Bn(e,t){const n=bn,r=xn;bn=e,xn=null;try{return Xn(t,!0)}catch(o){ar(o)}finally{bn=n,xn=r}}function qn(e){const t=xn,n=bn;return Promise.resolve().then(()=>{xn=t,bn=n,Xn(e,!1),xn=bn=null})}const[$n,Kn]=Rn(!1);function Fn(){return[$n,qn]}function Hn(e,t){const n=Symbol("context");return{id:n,Provider:lr(n),defaultValue:e}}function Vn(e){let t;return bn&&bn.context&&void 0!==(t=bn.context[e.id])?t:e.defaultValue}function zn(e){const t=Mn(e),n=Mn(()=>sr(t()));return n.toArray=()=>{const e=n();return Array.isArray(e)?e:null!=e?[e]:[]},n}function Zn(){if(this.sources&&this.state)if(this.state===mn)Yn(this);else{const e=Sn;Sn=null,Xn(()=>nr(this),!1),Sn=e}if(xn){const e=this.observers?this.observers.length:0;xn.sources?(xn.sources.push(this),xn.sourceSlots.push(e)):(xn.sources=[this],xn.sourceSlots=[e]),this.observers?(this.observers.push(xn),this.observerSlots.push(xn.sources.length-1)):(this.observers=[xn],this.observerSlots=[xn.sources.length-1])}return this.value}function Gn(e,t,n){let r=e.value;return e.comparator&&e.comparator(r,t)||(e.value=t,e.observers&&e.observers.length&&Xn(()=>{for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t],r=Cn&&Cn.running;r&&Cn.disposed.has(n),(r?n.tState:n.state)||(n.pure?Sn.push(n):kn.push(n),n.observers&&rr(n)),r||(n.state=mn)}if(Sn.length>1e6)throw Sn=[],new Error},!1)),t}function Yn(e){if(!e.fn)return;or(e);const t=_n;!function(e,t,n){let r;const o=bn,i=xn;xn=bn=e;try{r=e.fn(t)}catch(a){return e.pure&&(e.state=mn,e.owned&&e.owned.forEach(or),e.owned=null),e.updatedAt=n+1,ar(a)}finally{xn=i,bn=o}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?Gn(e,r):e.value=r,e.updatedAt=n)}(e,e.value,t)}function Qn(e,t,n,r=mn,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:bn,context:bn?bn.context:null,pure:n};return null===bn||bn!==vn&&(bn.owned?bn.owned.push(i):bn.owned=[i]),i}function Jn(e){if(0===e.state)return;if(e.state===wn)return nr(e);if(e.suspense&&Nn(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<_n);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if((e=t[n]).state===mn)Yn(e);else if(e.state===wn){const n=Sn;Sn=null,Xn(()=>nr(e,t[0]),!1),Sn=n}}function Xn(e,t){if(Sn)return e();let n=!1;t||(Sn=[]),kn?n=!0:kn=[],_n++;try{const t=e();return function(e){Sn&&(er(Sn),Sn=null);if(e)return;const t=kn;kn=null,t.length&&Xn(()=>fn(t),!1)}(n),t}catch(r){n||(kn=null),Sn=null,ar(r)}}function er(e){for(let t=0;t<e.length;t++)Jn(e[t])}function tr(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Jn(r)}for(t=0;t<n;t++)Jn(e[t])}function nr(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const e=r.state;e===mn?r!==t&&(!r.updatedAt||r.updatedAt<_n)&&Jn(r):e===wn&&nr(r,t)}}}function rr(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=wn,n.pure?Sn.push(n):kn.push(n),n.observers&&rr(n))}}function or(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){const e=r.pop(),o=t.observerSlots.pop();n<r.length&&(e.sourceSlots[o]=n,r[n]=e,t.observerSlots[n]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)or(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)or(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function ir(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function ar(e,t=bn){throw ir(e)}function sr(e){if("function"==typeof e&&!e.length)return sr(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=sr(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function lr(e,t){return function(t){let n;return In(()=>n=Nn(()=>(bn.context=w(m({},bn.context),{[e]:t.value}),zn(()=>t.children))),void 0),n}}const cr=Symbol("fallback");function dr(e){for(let t=0;t<e.length;t++)e[t]()}function ur(e,t){return Nn(()=>e(t||{}))}function hr(){return!0}const pr={get:(e,t,n)=>t===un?n:e.get(t),has:(e,t)=>t===un||e.has(t),set:hr,deleteProperty:hr,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:hr,deleteProperty:hr}),ownKeys:e=>e.keys()};function gr(e){return(e="function"==typeof e?e():e)?e:{}}function fr(){for(let e=0,t=this.length;e<t;++e){const t=this[e]();if(void 0!==t)return t}}function mr(...e){let t=!1;for(let a=0;a<e.length;a++){const n=e[a];t=t||!!n&&un in n,e[a]="function"==typeof n?(t=!0,Mn(n)):n}if(hn&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){const r=gr(e[n])[t];if(void 0!==r)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in gr(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(gr(e[n])));return[...new Set(t)]}},pr);const n={},r=Object.create(null);for(let a=e.length-1;a>=0;a--){const t=e[a];if(!t)continue;const o=Object.getOwnPropertyNames(t);for(let e=o.length-1;e>=0;e--){const i=o[e];if("__proto__"===i||"constructor"===i)continue;const a=Object.getOwnPropertyDescriptor(t,i);if(r[i]){const e=n[i];e&&(a.get?e.push(a.get.bind(t)):void 0!==a.value&&e.push(()=>a.value))}else r[i]=a.get?{enumerable:!0,configurable:!0,get:fr.bind(n[i]=[a.get.bind(t)])}:void 0!==a.value?a:void 0}}const o={},i=Object.keys(r);for(let a=i.length-1;a>=0;a--){const e=i[a],t=r[e];t&&t.get?Object.defineProperty(o,e,t):o[e]=t?t.value:void 0}return o}function wr(e,...t){if(hn&&un in e){const n=new Set(t.length>1?t.flat():t[0]),r=t.map(t=>new Proxy({get:n=>t.includes(n)?e[n]:void 0,has:n=>t.includes(n)&&n in e,keys:()=>t.filter(t=>t in e)},pr));return r.push(new Proxy({get:t=>n.has(t)?void 0:e[t],has:t=>!n.has(t)&&t in e,keys:()=>Object.keys(e).filter(e=>!n.has(e))},pr)),r}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),a=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let s=!1,l=0;for(const e of t)e.includes(o)&&(s=!0,a?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;s||(a?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}const vr=e=>`Stale read from <${e}>.`;function yr(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Mn(function(e,t,n={}){let r=[],o=[],i=[],a=0,s=t.length>1?[]:null;return Un(()=>dr(i)),()=>{let l,c,d=e()||[],u=d.length;return d[pn],Nn(()=>{let e,t,p,g,f,m,w,v,y;if(0===u)0!==a&&(dr(i),i=[],r=[],o=[],a=0,s&&(s=[])),n.fallback&&(r=[cr],o[0]=En(e=>(i[0]=e,n.fallback())),a=1);else if(0===a){for(o=new Array(u),c=0;c<u;c++)r[c]=d[c],o[c]=En(h);a=u}else{for(p=new Array(u),g=new Array(u),s&&(f=new Array(u)),m=0,w=Math.min(a,u);m<w&&r[m]===d[m];m++);for(w=a-1,v=u-1;w>=m&&v>=m&&r[w]===d[v];w--,v--)p[v]=o[w],g[v]=i[w],s&&(f[v]=s[w]);for(e=new Map,t=new Array(v+1),c=v;c>=m;c--)y=d[c],l=e.get(y),t[c]=void 0===l?-1:l,e.set(y,c);for(l=m;l<=w;l++)y=r[l],c=e.get(y),void 0!==c&&-1!==c?(p[c]=o[l],g[c]=i[l],s&&(f[c]=s[l]),c=t[c],e.set(y,c)):i[l]();for(c=m;c<u;c++)c in p?(o[c]=p[c],i[c]=g[c],s&&(s[c]=f[c],s[c](c))):o[c]=En(h);o=o.slice(0,a=u),r=d.slice(0)}return o});function h(e){if(i[c]=e,s){const[e,n]=Rn(c);return s[c]=n,t(d[c],e)}return t(d[c])}}}(()=>e.each,e.children,t||void 0))}function br(e){const t=e.keyed,n=Mn(()=>e.when,void 0,void 0),r=t?n:Mn(n,void 0,{equals:(e,t)=>!e==!t});return Mn(()=>{const o=r();if(o){const i=e.children;return"function"==typeof i&&i.length>0?Nn(()=>i(t?o:()=>{if(!Nn(r))throw vr("Show");return n()})):i}return e.fallback},void 0,void 0)}function Cr(e){const t=zn(()=>e.children),n=Mn(()=>{const e=t(),n=Array.isArray(e)?e:[e];let r=()=>{};for(let t=0;t<n.length;t++){const e=t,o=n[t],i=r,a=Mn(()=>i()?void 0:o.when,void 0,void 0),s=o.keyed?a:Mn(a,void 0,{equals:(e,t)=>!e==!t});r=()=>i()||(s()?[e,a,o]:void 0)}return r});return Mn(()=>{const t=n()();if(!t)return e.fallback;const[r,o,i]=t,a=i.children;return"function"==typeof a&&a.length>0?Nn(()=>a(i.keyed?o():()=>{var e;if((null==(e=Nn(n)())?void 0:e[0])!==r)throw vr("Match");return o()})):a},void 0,void 0)}function xr(e){return e}const Sr=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"]),kr=new Set(["innerHTML","textContent","innerText","children"]),_r=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Er=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});const Rr=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Tr=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Ir={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Or=e=>Mn(()=>e());const Mr="_$DX_DELEGATE";function Ar(e,t,n,r){let o;const i=()=>{const t=r?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},a=t?()=>Nn(()=>document.importNode(o||(o=i()),!0)):()=>(o||(o=i())).cloneNode(!0);return a.cloneNode=a,a}function Lr(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function Nr(e,t){null==t?e.removeAttribute("class"):e.className=t}function Wr(e,t={},n,r){const o={};return In(()=>o.children=qr(e,t.children,o.children)),In(()=>"function"==typeof t.ref&&Pr(t.ref,e)),In(()=>function(e,t,n,r,o={},i=!1){t||(t={});for(const a in o)if(!(a in t)){if("children"===a)continue;o[a]=jr(e,a,null,o[a],n,i,t)}for(const a in t){if("children"===a)continue;const r=t[a];o[a]=jr(e,a,r,o[a],n,i,t)}}(e,t,n,0,o,!0)),o}function Pr(e,t,n){return Nn(()=>e(t,n))}function Ur(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return qr(e,t,r,n);In(r=>qr(e,t(),r,n),r)}function Dr(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function jr(e,t,n,r,o,i,a){let s,l,c,d,u;if("style"===t)return function(e,t,n){if(!t)return n?Lr(e,"style"):t;const r=e.style;if("string"==typeof t)return r.cssText=t;let o,i;for(i in"string"==typeof n&&(r.cssText=n=void 0),n||(n={}),t||(t={}),n)null==t[i]&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}(e,n,r);if("classList"===t)return function(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,a;for(i=0,a=o.length;i<a;i++){const r=o[i];r&&"undefined"!==r&&!t[r]&&(Dr(e,r,!1),delete n[r])}for(i=0,a=r.length;i<a;i++){const o=r[i],a=!!t[o];o&&"undefined"!==o&&n[o]!==a&&a&&(Dr(e,o,!0),n[o]=a)}return n}(e,n,r);if(n===r)return r;if("ref"===t)i||n(e);else if("on:"===t.slice(0,3)){const o=t.slice(3);r&&e.removeEventListener(o,r,"function"!=typeof r&&r),n&&e.addEventListener(o,n,"function"!=typeof n&&n)}else if("oncapture:"===t.slice(0,10)){const o=t.slice(10);r&&e.removeEventListener(o,r,!0),n&&e.addEventListener(o,n,!0)}else if("on"===t.slice(0,2)){const o=t.slice(2).toLowerCase(),i=Rr.has(o);if(!i&&r){const t=Array.isArray(r)?r[0]:r;e.removeEventListener(o,t)}(i||n)&&(function(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,"function"!=typeof n&&n)}(e,o,n,i),i&&function(e,t=window.document){const n=t[Mr]||(t[Mr]=new Set);for(let r=0,o=e.length;r<o;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,Br))}}([o]))}else if("attr:"===t.slice(0,5))Lr(e,t.slice(5),n);else if("bool:"===t.slice(0,5))!function(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}(e,t.slice(5),n);else if((u="prop:"===t.slice(0,5))||(c=kr.has(t))||!o&&((d=function(e,t){const n=Er[e];return"object"==typeof n?n[t]?n.$:void 0:n}(t,e.tagName))||(l=Sr.has(t)))||(s=e.nodeName.includes("-")||"is"in a))u&&(t=t.slice(5),l=!0),"class"===t||"className"===t?Nr(e,n):!s||l||c?e[d||t]=n:e[(h=t,h.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase()))]=n;else{const r=o&&t.indexOf(":")>-1&&Ir[t.split(":")[0]];r?function(e,t,n,r){null==r?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}(e,r,t,n):Lr(e,_r[t]||t,n)}var h;return n}function Br(e){let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),a=()=>{const r=t[n];if(r&&!t.disabled){const o=t[`${n}Data`];if(void 0!==o?r.call(t,o,e):r.call(t,e),e.cancelBubble)return}return t.host&&"string"!=typeof t.host&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},s=()=>{for(;a()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>t||document}),e.composedPath){const n=e.composedPath();i(n[0]);for(let e=0;e<n.length-2&&(t=n[e],a());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===o)break}}else s();i(r)}function qr(e,t,n,r,o){for(;"function"==typeof n;)n=n();if(t===n)return n;const i=typeof t,a=void 0!==r;if(e=a&&n[0]&&n[0].parentNode||e,"string"===i||"number"===i){if("number"===i&&(t=t.toString())===n)return n;if(a){let o=n[0];o&&3===o.nodeType?o.data!==t&&(o.data=t):o=document.createTextNode(t),n=Fr(e,n,r,o)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t}else if(null==t||"boolean"===i)n=Fr(e,n,r);else{if("function"===i)return In(()=>{let o=t();for(;"function"==typeof o;)o=o();n=qr(e,o,n,r)}),()=>n;if(Array.isArray(t)){const i=[],s=n&&Array.isArray(n);if($r(i,t,n,o))return In(()=>n=qr(e,i,n,r,!0)),()=>n;if(0===i.length){if(n=Fr(e,n,r),a)return n}else s?0===n.length?Kr(e,i,r):function(e,t,n){let r=n.length,o=t.length,i=r,a=0,s=0,l=t[o-1].nextSibling,c=null;for(;a<o||s<i;)if(t[a]!==n[s]){for(;t[o-1]===n[i-1];)o--,i--;if(o===a){const t=i<r?s?n[s-1].nextSibling:n[i-s]:l;for(;s<i;)e.insertBefore(n[s++],t)}else if(i===s)for(;a<o;)c&&c.has(t[a])||t[a].remove(),a++;else if(t[a]===n[i-1]&&n[s]===t[o-1]){const r=t[--o].nextSibling;e.insertBefore(n[s++],t[a++].nextSibling),e.insertBefore(n[--i],r),t[o]=n[i]}else{if(!c){c=new Map;let e=s;for(;e<i;)c.set(n[e],e++)}const r=c.get(t[a]);if(null!=r)if(s<r&&r<i){let l,d=a,u=1;for(;++d<o&&d<i&&null!=(l=c.get(t[d]))&&l===r+u;)u++;if(u>r-s){const o=t[a];for(;s<r;)e.insertBefore(n[s++],o)}else e.replaceChild(n[s++],t[a++])}else a++;else t[a++].remove()}}else a++,s++}(e,n,i):(n&&Fr(e),Kr(e,i));n=i}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=Fr(e,n,r,t);Fr(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}}return n}function $r(e,t,n,r){let o=!1;for(let i=0,a=t.length;i<a;i++){let a,s=t[i],l=n&&n[e.length];if(null==s||!0===s||!1===s);else if("object"==(a=typeof s)&&s.nodeType)e.push(s);else if(Array.isArray(s))o=$r(e,s,l)||o;else if("function"===a)if(r){for(;"function"==typeof s;)s=s();o=$r(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||o}else e.push(s),o=!0;else{const t=String(s);l&&3===l.nodeType&&l.data===t?e.push(l):e.push(document.createTextNode(t))}}return o}function Kr(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function Fr(e,t,n,r){if(void 0===n)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let r=!1;for(let i=t.length-1;i>=0;i--){const a=t[i];if(o!==a){const t=a.parentNode===e;r||i?t&&a.remove():t?e.replaceChild(o,a):e.insertBefore(o,n)}else r=!0}}else e.insertBefore(o,n);return[o]}function Hr(e,t=!1){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}function Vr(e){const{useShadow:t}=e,n=document.createTextNode(""),r=jn();let o;return On(()=>{o||(o=Bn(r,()=>Mn(()=>e.children)));const i=e.mount||document.body;if(i instanceof HTMLHeadElement){const[e,t]=Rn(!1),n=()=>t(!0);En(t=>Ur(i,()=>e()?t():o(),null)),Un(n)}else{const r=Hr(e.isSVG?"g":"div",e.isSVG),a=t&&r.attachShadow?r.attachShadow({mode:"open"}):r;Object.defineProperty(r,"_$host",{get:()=>n.parentNode,configurable:!0}),Ur(a,o),i.appendChild(r),e.ref&&e.ref(r),Un(()=>i.removeChild(r))}},void 0,{render:!0}),n}function zr(e){const[,t]=wr(e,["component"]);return function(e,t){const n=Mn(e);return Mn(()=>{const e=n();switch(typeof e){case"function":return Nn(()=>e(t));case"string":const n=Tr.has(e),r=Hr(e,n);return Wr(r,t,n),r}})}(()=>e.component,t)}var Zr=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))(Zr||{});let Gr={data:""},Yr=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Qr=/\/\*[^]*?\*\/| +/g,Jr=/\n+/g,Xr=(e,t)=>{let n="",r="",o="";for(let i in e){let a=e[i];"@"==i[0]?"i"==i[1]?n=i+" "+a+";":r+="f"==i[1]?Xr(a,i):i+"{"+Xr(a,"k"==i[1]?"":t)+"}":"object"==typeof a?r+=Xr(a,t?t.replace(/([^,])+/g,e=>i.replace(/(^:.*)|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):i):null!=a&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Xr.p?Xr.p(i,a):i+":"+a+";")}return n+(t&&o?t+"{"+o+"}":o)+r},eo={},to=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+to(e[n]);return t}return e};function no(e){let t=this||{},n=e.call?e(t.p):e;return((e,t,n,r,o)=>{let i=to(e),a=eo[i]||(eo[i]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(i));if(!eo[a]){let t=i!==e?e:(e=>{let t,n,r=[{}];for(;t=Yr.exec(e.replace(Qr,""));)t[4]?r.shift():t[3]?(n=t[3].replace(Jr," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(Jr," ").trim();return r[0]})(e);eo[a]=Xr(o?{["@keyframes "+a]:t}:t,n?"":"."+a)}let s=n&&eo.g?eo.g:null;return n&&(eo.g=eo[a]),l=eo[a],c=t,d=r,(u=s)?c.data=c.data.replace(u,l):-1===c.data.indexOf(l)&&(c.data=d?l+c.data:c.data+l),a;var l,c,d,u})(n.unshift?n.raw?((e,t,n)=>e.reduce((e,r,o)=>{let i=t[o];if(i&&i.call){let e=i(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;i=t?"."+t:e&&"object"==typeof e?e.props?"":Xr(e,""):!1===e?"":e}return e+r+(null==i?"":i)},""))(n,[].slice.call(arguments,1),t.p):n.reduce((e,n)=>Object.assign(e,n&&n.call?n(t.p):n),{}):n,(r=t.target,"object"==typeof window?((r?r.querySelector("#_goober"):window._goober)||Object.assign((r||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:r||Gr),t.g,t.o,t.k);var r}no.bind({g:1});let ro=no.bind({k:1});const oo=Hn();function io(e){return ur(oo.Provider,{value:e.theme,get children(){return e.children}})}function ao(){return Vn(oo)}function so(e){let t=this||{};return(...n)=>{const r=r=>{const o=mr(r,{theme:Vn(oo)}),i=mr(o,{get class(){const e=o.class,r="class"in o&&/^go[0-9]+/.test(e);return[e,no.apply({target:t.target,o:r,p:o,g:t.g},n)].filter(Boolean).join(" ")}}),[a,s]=wr(i,["as","theme"]),l=s,c=a.as||e;let d;return"function"==typeof c?d=c(l):1==t.g?(d=document.createElement(c),Wr(d,l)):d=zr(mr({component:c},l)),d};return r.class=e=>Nn(()=>no.apply({target:t.target,p:e,g:t.g},n)),r}}const lo=new Proxy(so,{get:(e,t)=>e(t)});function co(){const e=so.call({g:1},"div").apply(null,arguments);return function(t){return e(t),null}}const uo="tc-root",ho="tc-disable-scroll",po="tc-using-mouse",go=()=>{document.body.addEventListener("mousedown",()=>document.body.classList.add(po)),document.body.addEventListener("keydown",e=>{"Tab"===e.key&&document.body.classList.remove(po)});return ur(co`
|
|
2
2
|
${uo} * {
|
|
3
3
|
margin: 0;
|
|
4
4
|
padding: 0;
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
body.${po} ${uo} *:focus {
|
|
38
38
|
outline: none;
|
|
39
39
|
}
|
|
40
|
-
`,{})};function fo(e,t){return"#"===e[0]&&(e=function(e){"#"===e[0]&&(e=e.slice(1));const t=parseInt(e,16);return[t>>16&255,t>>8&255,255&t].join(",")}(e)),`rgba(${e}, ${t})`}function mo(e){return e.toString()+"px"}var wo,vo={exports:{}},yo=vo.exports;var bo=(wo||(wo=1,function(e,t){!function(n,r){var o="function",i="undefined",a="object",s="string",l="major",c="model",d="name",u="type",h="vendor",p="version",g="architecture",f="console",m="mobile",w="tablet",v="smarttv",y="wearable",b="embedded",C="Amazon",x="Apple",S="ASUS",k="BlackBerry",_="Browser",E="Chrome",R="Firefox",T="Google",I="Huawei",O="LG",M="Microsoft",A="Motorola",L="Opera",N="Samsung",W="Sharp",P="Sony",U="Xiaomi",D="Zebra",j="Facebook",B="Chromium OS",$="Mac OS",q=" Browser",K=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},F=function(e,t){return typeof e===s&&-1!==H(t).indexOf(H(e))},H=function(e){return e.toLowerCase()},V=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===i?e:e.substring(0,500)},z=function(e,t){for(var n,i,s,l,c,d,u=0;u<t.length&&!c;){var h=t[u],p=t[u+1];for(n=i=0;n<h.length&&!c&&h[n];)if(c=h[n++].exec(e))for(s=0;s<p.length;s++)d=c[++i],typeof(l=p[s])===a&&l.length>0?2===l.length?typeof l[1]==o?this[l[0]]=l[1].call(this,d):this[l[0]]=l[1]:3===l.length?typeof l[1]!==o||l[1].exec&&l[1].test?this[l[0]]=d?d.replace(l[1],l[2]):r:this[l[0]]=d?l[1].call(this,d,l[2]):r:4===l.length&&(this[l[0]]=d?l[3].call(this,d.replace(l[1],l[2])):r):this[l]=d||r;u+=2}},Z=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var o=0;o<t[n].length;o++)if(F(t[n][o],e))return"?"===n?r:n}else if(F(t[n],e))return"?"===n?r:n;return t.hasOwnProperty("*")?t["*"]:e},G={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Y={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[d,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[d,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[d,p],[/opios[\/ ]+([\w\.]+)/i],[p,[d,L+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[p,[d,L+" GX"]],[/\bopr\/([\w\.]+)/i],[p,[d,L]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[p,[d,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[p,[d,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[d,p],[/quark(?:pc)?\/([-\w\.]+)/i],[p,[d,"Quark"]],[/\bddg\/([\w\.]+)/i],[p,[d,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[d,"UC"+_]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[p,[d,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[d,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[d,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[d,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[p,[d,"Smart Lenovo "+_]],[/(avast|avg)\/([\w\.]+)/i],[[d,/(.+)/,"$1 Secure "+_],p],[/\bfocus\/([\w\.]+)/i],[p,[d,R+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[d,L+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[d,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[d,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[d,L+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[d,"MIUI"+q]],[/fxios\/([\w\.-]+)/i],[p,[d,R]],[/\bqihoobrowser\/?([\w\.]*)/i],[p,[d,"360"]],[/\b(qq)\/([\w\.]+)/i],[[d,/(.+)/,"$1Browser"],p],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[d,/(.+)/,"$1"+q],p],[/samsungbrowser\/([\w\.]+)/i],[p,[d,N+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[p,[d,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[d,"Sogou Mobile"],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[d,p],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[d],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[p,d],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[d,j],p],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[d,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[d,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[d,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[d,E+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[d,E+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[d,"Android "+_]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[d,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[d,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,d],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[d,[p,Z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[d,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[d,"Netscape"],p],[/(wolvic|librewolf)\/([\w\.]+)/i],[d,p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[d,R+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[d,[p,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[d,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,H]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",H]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,H]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[h,N],[u,w]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[c,[h,N],[u,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[h,x],[u,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[h,x],[u,w]],[/(macintosh);/i],[c,[h,x]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[h,W],[u,m]],[/(?:honor)([-\w ]+)[;\)]/i],[c,[h,"Honor"],[u,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[h,I],[u,w]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[h,I],[u,m]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[c,/_/g," "],[h,U],[u,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[h,U],[u,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[h,"OPPO"],[u,m]],[/\b(opd2\d{3}a?) bui/i],[c,[h,"OPPO"],[u,w]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[h,"Vivo"],[u,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[c,[h,"Realme"],[u,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[h,A],[u,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[h,A],[u,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[h,O],[u,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[h,O],[u,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[h,"Lenovo"],[u,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[h,"Nokia"],[u,m]],[/(pixel c)\b/i],[c,[h,T],[u,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[h,T],[u,m]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[c,[h,P],[u,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[h,P],[u,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[h,"OnePlus"],[u,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[h,C],[u,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[h,C],[u,m]],[/(playbook);[-\w\),; ]+(rim)/i],[c,h,[u,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[h,k],[u,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[h,S],[u,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[h,S],[u,m]],[/(nexus 9)/i],[c,[h,"HTC"],[u,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[c,/_/g," "],[u,m]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[c,[h,"TCL"],[u,w]],[/(itel) ((\w+))/i],[[h,H],c,[u,Z,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[h,"Acer"],[u,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[h,"Meizu"],[u,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[c,[h,"Ulefone"],[u,m]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[c,[h,"Energizer"],[u,m]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[c,[h,"Cat"],[u,m]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[c,[h,"Smartfren"],[u,m]],[/droid.+; (a(?:015|06[35]|142p?))/i],[c,[h,"Nothing"],[u,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,c,[u,m]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,c,[u,w]],[/(surface duo)/i],[c,[h,M],[u,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[h,"Fairphone"],[u,m]],[/(u304aa)/i],[c,[h,"AT&T"],[u,m]],[/\bsie-(\w*)/i],[c,[h,"Siemens"],[u,m]],[/\b(rct\w+) b/i],[c,[h,"RCA"],[u,w]],[/\b(venue[\d ]{2,7}) b/i],[c,[h,"Dell"],[u,w]],[/\b(q(?:mv|ta)\w+) b/i],[c,[h,"Verizon"],[u,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[h,"Barnes & Noble"],[u,w]],[/\b(tm\d{3}\w+) b/i],[c,[h,"NuVision"],[u,w]],[/\b(k88) b/i],[c,[h,"ZTE"],[u,w]],[/\b(nx\d{3}j) b/i],[c,[h,"ZTE"],[u,m]],[/\b(gen\d{3}) b.+49h/i],[c,[h,"Swiss"],[u,m]],[/\b(zur\d{3}) b/i],[c,[h,"Swiss"],[u,w]],[/\b((zeki)?tb.*\b) b/i],[c,[h,"Zeki"],[u,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],c,[u,w]],[/\b(ns-?\w{0,9}) b/i],[c,[h,"Insignia"],[u,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[h,"NextBook"],[u,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],c,[u,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],c,[u,m]],[/\b(ph-1) /i],[c,[h,"Essential"],[u,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[h,"Envizen"],[u,w]],[/\b(trio[-\w\. ]+) b/i],[c,[h,"MachSpeed"],[u,w]],[/\btu_(1491) b/i],[c,[h,"Rotor"],[u,w]],[/(shield[\w ]+) b/i],[c,[h,"Nvidia"],[u,w]],[/(sprint) (\w+)/i],[h,c,[u,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[h,M],[u,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[h,D],[u,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[h,D],[u,m]],[/smart-tv.+(samsung)/i],[h,[u,v]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[h,N],[u,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,O],[u,v]],[/(apple) ?tv/i],[h,[c,x+" TV"],[u,v]],[/crkey/i],[[c,E+"cast"],[h,T],[u,v]],[/droid.+aft(\w+)( bui|\))/i],[c,[h,C],[u,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[h,W],[u,v]],[/(bravia[\w ]+)( bui|\))/i],[c,[h,P],[u,v]],[/(mitv-\w{5}) bui/i],[c,[h,U],[u,v]],[/Hbbtv.*(technisat) (.*);/i],[h,c,[u,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,V],[c,V],[u,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,c,[u,f]],[/droid.+; (shield) bui/i],[c,[h,"Nvidia"],[u,f]],[/(playstation [345portablevi]+)/i],[c,[h,P],[u,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[h,M],[u,f]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[c,[h,N],[u,y]],[/((pebble))app/i],[h,c,[u,y]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[h,x],[u,y]],[/droid.+; (glass) \d/i],[c,[h,T],[u,y]],[/droid.+; (wt63?0{2,3})\)/i],[c,[h,D],[u,y]],[/droid.+; (glass) \d/i],[c,[h,T],[u,y]],[/(pico) (4|neo3(?: link|pro)?)/i],[h,c,[u,y]],[/; (quest( \d| pro)?)/i],[c,[h,j],[u,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[u,b]],[/(aeobc)\b/i],[c,[h,C],[u,b]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[c,[u,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[u,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[u,m]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[d,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[d,p],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[d,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[d,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,d]],os:[[/microsoft (windows) (vista|xp)/i],[d,p],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[d,[p,Z,G]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,Z,G],[d,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[d,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[d,$],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,d],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[d,p],[/\(bb(10);/i],[p,[d,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[d,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[d,R+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[d,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[d,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[d,E+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[d,B],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[d,p],[/(sunos) ?([\w\.\d]*)/i],[[d,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[d,p]]},Q=function(e,t){if(typeof e===a&&(t=e,e=r),!(this instanceof Q))return new Q(e,t).getResult();var f=typeof n!==i&&n.navigator?n.navigator:r,v=e||(f&&f.userAgent?f.userAgent:""),y=f&&f.userAgentData?f.userAgentData:r,b=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(Y,t):Y,C=f&&f.userAgent==v;return this.getBrowser=function(){var e,t={};return t[d]=r,t[p]=r,z.call(t,v,b.browser),t[l]=typeof(e=t[p])===s?e.replace(/[^\d\.]/g,"").split(".")[0]:r,C&&f&&f.brave&&typeof f.brave.isBrave==o&&(t[d]="Brave"),t},this.getCPU=function(){var e={};return e[g]=r,z.call(e,v,b.cpu),e},this.getDevice=function(){var e={};return e[h]=r,e[c]=r,e[u]=r,z.call(e,v,b.device),C&&!e[u]&&y&&y.mobile&&(e[u]=m),C&&"Macintosh"==e[c]&&f&&typeof f.standalone!==i&&f.maxTouchPoints&&f.maxTouchPoints>2&&(e[c]="iPad",e[u]=w),e},this.getEngine=function(){var e={};return e[d]=r,e[p]=r,z.call(e,v,b.engine),e},this.getOS=function(){var e={};return e[d]=r,e[p]=r,z.call(e,v,b.os),C&&!e[d]&&y&&y.platform&&"Unknown"!=y.platform&&(e[d]=y.platform.replace(/chrome os/i,B).replace(/macos/i,$)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?V(e,500):e,this},this.setUA(v),this};Q.VERSION="1.0.40",Q.BROWSER=K([d,p,l]),Q.CPU=K([g]),Q.DEVICE=K([c,h,u,f,m,v,w,y,b]),Q.ENGINE=Q.OS=K([d,p]),e.exports&&(t=e.exports=Q),t.UAParser=Q;var J=typeof n!==i&&(n.jQuery||n.Zepto);if(J&&!J.ua){var X=new Q;J.ua=X.getResult(),J.ua.get=function(){return X.getUA()},J.ua.set=function(e){X.setUA(e);var t=X.getResult();for(var n in t)J.ua[n]=t[n]}}}("object"==typeof window?window:yo)}(vo,vo.exports)),vo.exports);const Co=b(bo);class xo{constructor(){this.storage={}}static getInstance(){return xo.instance||(xo.instance=new xo),xo.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return null!=(t=this.storage[e])?t:null}key(e){var t;const n=Object.keys(this.storage);return e<0||e>=n.length?null:null!=(t=n[e])?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}}class So extends z{constructor(...e){super(...e),Object.setPrototypeOf(this,So.prototype)}}function ko(...e){try{console.debug("[TON_CONNECT_UI]",...e)}catch(t){}}function _o(...e){try{console.error("[TON_CONNECT_UI]",...e)}catch(t){}}function Eo(e,t="_self"){ni({link:e}),ko("openLink",e,t),window.open(e,t,"noopener noreferrer")}function Ro(e){Eo(e,"_blank")}function To(e,t){const n=setTimeout(()=>{Wo("safari")||No("android")&&Wo("firefox")||t()},200);window.addEventListener("blur",()=>clearTimeout(n),{once:!0}),Eo(e,"_self")}function Io(e){return y(this,null,function*(){yield new Promise(e=>requestAnimationFrame(e)),e()})}function Oo(e){"complete"!==document.readyState?window.addEventListener("load",()=>Io(()=>Oo(e)),{once:!0}):e.forEach(e=>{(new window.Image).src=e})}function Mo(){if("undefined"!=typeof window)return window}function Ao(){if(function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}())return localStorage;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)throw new So("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return xo.getInstance()}function Lo(){var e,t,n;const r=(new Co).getResult(),o=null==(e=r.os.name)?void 0:e.toLowerCase();let i;switch(!0){case"ipad"===(null==(t=r.device.model)?void 0:t.toLowerCase()):i="ipad";break;case"ios"===o:i="ios";break;case"android"===o:i="android";break;case"mac os"===o:i="macos";break;case"linux"===o:i="linux";break;case null==o?void 0:o.includes("windows"):i="windows"}const a=null==(n=r.browser.name)?void 0:n.toLowerCase();let s;switch(!0){case"chrome"===a:s="chrome";break;case"firefox"===a:s="firefox";break;case null==a?void 0:a.includes("safari"):s="safari";break;case null==a?void 0:a.includes("opera"):s="opera"}return{os:i,browser:s}}function No(...e){return e.includes(Lo().os)}function Wo(...e){return e.includes(Lo().browser)}function Po(e,t){return t+new URL(e).search}class Uo{constructor(){this.storageKey="ton-connect-ui_wallet-info",this.localStorage=Ao()}setWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getWalletInfo(){const e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeWalletInfo(){this.localStorage.removeItem(this.storageKey)}}class Do{constructor(){this.storageKey="ton-connect-ui_preferred-wallet",this.localStorage=Ao()}setPreferredWalletAppName(e){this.localStorage.setItem(this.storageKey,e)}getPreferredWalletAppName(){return this.localStorage.getItem(this.storageKey)||void 0}}class jo{constructor(){this.storageKey="ton-connect-ui_last-selected-wallet-info",this.localStorage=Ao()}setLastSelectedWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getLastSelectedWalletInfo(){const e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeLastSelectedWalletInfo(){this.localStorage.removeItem(this.storageKey)}}const[Bo,$o]=Rn({status:"closed",closeReason:null}),qo=Mn(()=>"opened"===Bo().status),[Ko,Fo]=Rn({status:"closed",closeReason:null}),Ho=Mn(()=>"opened"===Ko().status),Vo=Mn(()=>{const e=Ko();return"opened"===e.status?e.walletInfo:null});let zo="undefined"!=typeof window?new jo:void 0;const[Zo,Go]=Rn((null==zo?void 0:zo.getLastSelectedWalletInfo())||null),Yo=e=>{zo||(zo=new jo),e?zo.setLastSelectedWalletInfo(e):zo.removeLastSelectedWalletInfo(),Go(e)},[Qo,Jo]=Rn(null),[Xo,ei]=Rn({walletsMenu:"explicit_wallet",wallets:[]}),[ti,ni]=Rn({link:""}),ri={common:{close:"Закрыть",openWallet:"Открыть кошелёк",copyLink:"Скопировать",linkCopied:"Ссылка скопирована",copied:"Скопировано",yourWallet:"Ваш кошелёк",retry:"Повторить",get:"Скачать",mobile:"Мобильный",browserExtension:"Расширение",desktop:"Десктоп"},button:{connectWallet:"Подключить кошелёк",dropdown:{copy:"Скопировать адрес",copied:"Адрес скопирован!",disconnect:"Отключить кошелёк"}},notifications:{confirm:{header:"Откройте {{ name }}, чтобы подтвердить транзакцию."},transactionSent:{header:"Транзакция отправлена",text:"Ваша транзакция будет обработана через несколько секунд."},transactionCanceled:{header:"Транзакция отменена",text:"Состояние вашего счёта не изменится."},dataSigned:{header:"Данные подписаны"},signDataCanceled:{header:"Подпись данных отменена"}},walletItem:{walletOn:"Wallet в",recent:"Недавний",installed:"Установлен",popular:"Популярен"},walletModal:{loading:"Кошельки загружаются",wallets:"Кошельки",mobileUniversalModal:{connectYourWallet:"Подключите TON кошелёк",openWalletOnTelegramOrSelect:"Подключите Wallet в Telegram или выберете другое приложение",openWalletOnTelegram:"Открыть Wallet в Telegram",chooseOtherApplication:"Выберите другое приложение",openLink:"Открыть",scan:"Отсканируйте камерой вашего телефона"},desktopUniversalModal:{connectYourWallet:"Подключите TON кошелёк",scan:"Отсканируйте QR-код камерой вашего телефона",availableWallets:"Доступные кошельки"},mobileConnectionModal:{showQR:"Показать QR-код",scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",missingFeatures:"Обновите {{ name }}, ваша версия не поддерживает необходимые функции для этого dApp",wrongNetwork:"Подключённый кошелёк находится в другой сети. Пожалуйста, переключите сеть в {{ name }} и попробуйте снова",notSupportedWallet:"{{ name }} не поддерживает запрошенное действие. Пожалуйста, подключите другой кошелёк, который поддерживает это",continueIn:"Продолжите в {{ name }}…",updateWallet:"Обновить {{ name }}",chooseAnotherWallet:"Выбрать другой кошелёк",connectionDeclined:"Подключение отклонено"},desktopConnectionModal:{scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueInExtension:"Откройте браузерное расширение {{ name }}",dontHaveExtension:"Похоже, у вас не установлено браузерное расширение {{ name }}",missingFeatures:"Обновите {{ name }}, ваша версия не поддерживает необходимые функции для этого dApp",wrongNetwork:"Подключённый кошелёк находится в другой сети. Пожалуйста, переключите сеть в {{ name }} и попробуйте снова",notSupportedWallet:"{{ name }} не поддерживает запрошенное действие. Пожалуйста, подключите другой кошелёк, который поддерживает это",getWallet:"Скачать {{ name }}",updateWallet:"Обновить {{ name }}",chooseAnotherWallet:"Выбрать другой кошелёк",continueOnDesktop:"Откройте {{ name }} на компьютере…",openWalletOnTelegram:"Открыть Wallet в Telegram",connectionDeclined:"Подключение отклонено"},infoModal:{whatIsAWallet:"Что такое кошелёк?",secureDigitalAssets:"Надежное хранилище цифровых активов",walletProtects:"Кошелёк защищает ваши цифровые активы, включая TON, токены и предметы коллекционирования, и управляет ими.",controlIdentity:"Контроль своей личности Web3",manageIdentity:"Управляйте своей цифровой идентификацией и с легкостью получайте доступ к децентрализованным приложениям. Сохраняйте контроль над своими данными и безопасно участвуйте в экосистеме блокчейна.",effortlessCryptoTransactions:"Простые криптотранзакции",easilySend:"Легко отправляйте, получайте и отслеживайте свои криптовалюты. Оптимизируйте свои операции с помощью децентрализованных приложений.",getAWallet:"Скачать кошелёк"},restoreModal:{title:"Восстановление",step1:{title:"Найдите вашу текущую фразу восстановления",text:"Откройте настройки кошелька и найдите фразу восстановления"},step2:{title:"Скопируйте вашу фразу восстановления",text:"Запишите её или сохраните в безопасном месте"},step3:{title:"Восстановите в поддерживаемом кошельке",text:"Введите фразу восстановления для доступа к вашему кошельку"}},allWallets:{walletsBelowNotSupported:"Кошельки ниже не поддерживают все функции подключённого сервиса. Вы можете использовать свою фразу восстановления в одном из поддерживаемых выше кошельков.",walletNotSupportService:"{{ name }} не поддерживает подключённый сервис"},featureNotSupported:{wallet:{title:"{{ name }} не поддерживает запрошенное действие",description:"Установите поддерживаемый кошелёк из списка ниже, восстановите его с помощью фразы восстановления, затем подключитесь и попробуйте снова.",info:"Узнать, как восстановить кошелёк"},version:{description:"Текущая версия {{ name }} или тип контракта кошелька не поддерживает необходимые функции. Обновите кошелёк, чтобы продолжить.",updateButton:"Обновить {{ name }}",aboutW5:"Про W5"},disconnect:{title:"Подтвердите отключение",description:"Вы будете отключены от текущего кошелька и перенаправлены на подключение {{ name }}.",button:"Отключиться"}}},actionModal:{confirmTransaction:{header:"Подтвердите действие в {{ name }}",text:"Это займет пару секунд."},signData:{header:"Подпишите данные в {{ name }}",text:"Это займет пару секунд."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled",dataSigned:"$notifications.dataSigned",signDataCanceled:"$notifications.signDataCanceled"}},oi={en:ii({common:{close:"Close",openWallet:"Open wallet",copyLink:"Copy Link",linkCopied:"Link Copied",copied:"Copied",yourWallet:"Your Wallet",retry:"Retry",get:"GET",mobile:"Mobile",browserExtension:"Browser Extension",desktop:"Desktop"},button:{connectWallet:"Connect Wallet",dropdown:{copy:"Copy address",copied:"Address copied!",disconnect:"Disconnect"}},notifications:{confirm:{header:"Open {{ name }} to confirm the transaction."},transactionSent:{header:"Transaction sent",text:"Your transaction will be processed in a few seconds."},transactionCanceled:{header:"Transaction canceled",text:"There will be no changes to your account."},dataSigned:{header:"Data signed"},signDataCanceled:{header:"Sign data canceled"}},walletItem:{walletOn:"Wallet in",recent:"Recent",installed:"Installed",popular:"Popular"},walletModal:{loading:"Loading wallets",wallets:"Wallets",mobileUniversalModal:{connectYourWallet:"Connect your TON wallet",openWalletOnTelegramOrSelect:"Use Wallet in Telegram or choose other application",openWalletOnTelegram:"Connect Wallet in Telegram",chooseOtherApplication:"Choose other application",openLink:"Open Link",scan:"Scan with your mobile wallet"},desktopUniversalModal:{connectYourWallet:"Connect your TON wallet",scan:"Scan with your mobile wallet",availableWallets:"Available wallets"},mobileConnectionModal:{showQR:"Show QR Code",scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",missingFeatures:"Please update {{ name }}, your version does not support required features for this dApp",wrongNetwork:"Connected wallet is on a different network. Please switch network in {{ name }} and try again",notSupportedWallet:"{{ name }} doesn’t support the requested action. Please connect another wallet that supports it",continueIn:"Continue in {{ name }}…",updateWallet:"Update {{ name }}",chooseAnotherWallet:"Choose Another Wallet",connectionDeclined:"Connection declined"},desktopConnectionModal:{scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",continueInExtension:"Continue in {{ name }} browser extension…",dontHaveExtension:"Seems you don't have installed {{ name }} browser extension",missingFeatures:"Please update {{ name }}, your version does not support required features for this dApp",wrongNetwork:"Connected wallet is on a different network. Please switch network in {{ name }} and try again",notSupportedWallet:"{{ name }} doesn’t support the requested action. Please connect another wallet that supports it",getWallet:"Get {{ name }}",updateWallet:"Update {{ name }}",chooseAnotherWallet:"Choose Another Wallet",continueOnDesktop:"Continue in {{ name }} on desktop…",openWalletOnTelegram:"Connect Wallet in Telegram on desktop",connectionDeclined:"Connection declined"},infoModal:{whatIsAWallet:"What is a wallet",secureDigitalAssets:"Secure digital assets storage",walletProtects:"A wallet protects and manages your digital assets including TON, tokens and collectables.",controlIdentity:"Control your Web3 identity",manageIdentity:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem.",effortlessCryptoTransactions:"Effortless crypto transactions",easilySend:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications.",getAWallet:"Get a Wallet"},restoreModal:{title:"Restore",step1:{title:"Find your current recovery phrase",text:"Open your wallet settings and locate the recovery phrase"},step2:{title:"Copy your recovery phrase",text:"Write it down or copy it to a safe place"},step3:{title:"Restore in a supported wallet",text:"Enter the recovery phrase to access your wallet"}},allWallets:{walletsBelowNotSupported:"The wallets below don’t support all features of the connected service. You can use your recovery phrase in one of the supported wallets above.",walletNotSupportService:"{{ name }} doesn’t support connected service"},featureNotSupported:{wallet:{title:"{{ name }} doesn’t support the requested action",description:"Install a supported wallet from the list below, restore it with your recovery phrase, then connect it and try again.",info:"Learn how to restore your wallet"},version:{description:"Your current version of {{ name }} or wallet contract type doesn't support the required features. Please update it to continue.",updateButton:"Update {{ name }}",aboutW5:"About W5"},disconnect:{title:"Confirm Disconnect",description:"You will be disconnected from your current wallet and redirected to connect {{ name }}.",button:"Disconnect"}}},actionModal:{confirmTransaction:{header:"Confirm the transaction in {{ name }}",text:"It will only take a moment."},signData:{header:"Sign the data in {{ name }}",text:"It will only take a moment."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled",dataSigned:"$notifications.dataSigned",signDataCanceled:"$notifications.signDataCanceled"}}),ru:ii(ri)};function ii(e){const t=n=>{Object.entries(n).forEach(([r,o])=>{if("object"==typeof o&&o)return t(o);if("string"==typeof o){if("$"===o[0]){const t=o.slice(1).split(".");let i=e;t.forEach(e=>{if(!(e in i))throw new Error(`Cannot parse translations: there is no property ${e} in translation`);i=i[e]}),n[r]=i}"\\$"===o.slice(0,2)&&(n[r]=o.slice(1))}})};return t(e),e}const ai=Hn(),si=Symbol("store-raw"),li=Symbol("store-node"),ci=Symbol("store-has"),di=Symbol("store-self");function ui(e){let t=e[un];if(!t&&(Object.defineProperty(e,un,{value:t=new Proxy(e,wi)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const i=n[o];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(t)})}}return t}function hi(e){let t;return null!=e&&"object"==typeof e&&(e[un]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function pi(e,t=new Set){let n,r,o,i;if(n=null!=e&&e[si])return n;if(!hi(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,i=e.length;n<i;n++)o=e[n],(r=pi(o,t))!==o&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const n=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let s=0,l=n.length;s<l;s++)i=n[s],a[i].get||(o=e[i],(r=pi(o,t))!==o&&(e[i]=r))}return e}function gi(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function fi(e,t,n){if(e[t])return e[t];const[r,o]=Rn(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function mi(e){Dn()&&fi(gi(e,li),di)()}const wi={get(e,t,n){if(t===si)return e;if(t===un)return n;if(t===pn)return mi(e),n;const r=gi(e,li),o=r[t];let i=o?o():e[t];if(t===li||t===ci||"__proto__"===t)return i;if(!o){const n=Object.getOwnPropertyDescriptor(e,t);!Dn()||"function"==typeof i&&!e.hasOwnProperty(t)||n&&n.get||(i=fi(r,t,i)())}return hi(i)?ui(i):i},has:(e,t)=>t===si||t===un||t===pn||t===li||t===ci||"__proto__"===t||(Dn()&&fi(gi(e,ci),t)(),t in e),set:()=>!0,deleteProperty:()=>!0,ownKeys:function(e){return mi(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return n&&!n.get&&n.configurable&&t!==un&&t!==li?(delete n.value,delete n.writable,n.get=()=>e[un][t],n):n}};function vi(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;void 0===n?(delete e[t],e[ci]&&e[ci][t]&&void 0!==o&&e[ci][t].$()):(e[t]=n,e[ci]&&e[ci][t]&&void 0===o&&e[ci][t].$());let a,s=gi(e,li);if((a=fi(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let t=e.length;t<i;t++)(a=s[t])&&a.$();(a=fi(s,"length",i))&&a.$(e.length)}(a=s[di])&&a.$()}function yi(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];vi(e,o,t[o])}}function bi(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const i=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let o=0;o<r.length;o++)bi(e,[r[o]].concat(t),n);return}if(a&&"function"===i){for(let o=0;o<e.length;o++)r(e[o],o)&&bi(e,[o].concat(t),n);return}if(a&&"object"===i){const{from:o=0,to:i=e.length-1,by:a=1}=r;for(let r=o;r<=i;r+=a)bi(e,[r].concat(t),n);return}if(t.length>1)return void bi(e[r],t,[r].concat(n));o=e[r],n=[r].concat(n)}let i=t[0];"function"==typeof i&&(i=i(o,n),i===o)||void 0===r&&null==i||(i=pi(i),void 0===r||hi(o)&&hi(i)&&!Array.isArray(i)?yi(o,i):vi(e,r,i))}function Ci(...[e,t]){const n=pi(e||{}),r=Array.isArray(n);return[ui(n),function(...e){Ln(()=>{r&&1===e.length?function(e,t){if("function"==typeof t&&(t=t(e)),t=pi(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const r=t[n];e[n]!==r&&vi(e,n,r)}vi(e,"length",r)}else yi(e,t)}(n,e[0]):bi(n,e)})}]}const xi={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"}};var Si,ki;const _i=b(function(){if(ki)return Si;ki=1;var e=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var n=Object.prototype.toString.call(e);return"[object RegExp]"===n||"[object Date]"===n||function(e){return e.$$typeof===t}(e)}(e)},t="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function r(e,t,r){return e.concat(t).map(function(e){return n(e,r)})}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function i(e,t){try{return t in e}catch(n){return!1}}function a(e,t,r){var a={};return r.isMergeableObject(e)&&o(e).forEach(function(t){a[t]=n(e[t],r)}),o(t).forEach(function(o){(function(e,t){return i(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(i(e,o)&&r.isMergeableObject(t[o])?a[o]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(o,r)(e[o],t[o],r):a[o]=n(t[o],r))}),a}function s(t,o,i){(i=i||{}).arrayMerge=i.arrayMerge||r,i.isMergeableObject=i.isMergeableObject||e,i.cloneUnlessOtherwiseSpecified=n;var s=Array.isArray(o);return s===Array.isArray(t)?s?i.arrayMerge(t,o,i):a(t,o,i):n(o,i)}return s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return s(e,n,t)},{})},Si=s}());function Ei(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ri(e){var t,n;return!1!==Ei(e)&&(void 0===(t=e.constructor)||!1!==Ei(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}function Ti(e,t){if(!e)return t;return _i(t,e,{arrayMerge:(e,t,n)=>t,isMergeableObject:Ri})}const[Ii,Oi]=Ci({theme:Zr.LIGHT,colors:xi,borderRadius:"m"}),Mi={[Zr.LIGHT]:xi,[Zr.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:"#FFFFFF"},text:{primary:"#E5E5EA",secondary:"#7D7D85"}}},Ai={[Zr.LIGHT]:void 0,[Zr.DARK]:void 0};function Li(e,t){t&&(Ai[Zr.DARK]=Ti(t[Zr.DARK],Ai[Zr.DARK]),Ai[Zr.LIGHT]=Ti(t[Zr.LIGHT],Ai[Zr.LIGHT])),Oi({theme:e,colors:Ti(Ai[e],Mi[e])})}const Ni=lo.div`
|
|
40
|
+
`,{})};function fo(e,t){return"#"===e[0]&&(e=function(e){"#"===e[0]&&(e=e.slice(1));const t=parseInt(e,16);return[t>>16&255,t>>8&255,255&t].join(",")}(e)),`rgba(${e}, ${t})`}function mo(e){return e.toString()+"px"}var wo,vo={exports:{}},yo=vo.exports;var bo=(wo||(wo=1,function(e,t){!function(n,r){var o="function",i="undefined",a="object",s="string",l="major",c="model",d="name",u="type",h="vendor",p="version",g="architecture",f="console",m="mobile",w="tablet",v="smarttv",y="wearable",b="embedded",C="Amazon",x="Apple",S="ASUS",k="BlackBerry",_="Browser",E="Chrome",R="Firefox",T="Google",I="Huawei",O="LG",M="Microsoft",A="Motorola",L="Opera",N="Samsung",W="Sharp",P="Sony",U="Xiaomi",D="Zebra",j="Facebook",B="Chromium OS",q="Mac OS",$=" Browser",K=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},F=function(e,t){return typeof e===s&&-1!==H(t).indexOf(H(e))},H=function(e){return e.toLowerCase()},V=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===i?e:e.substring(0,500)},z=function(e,t){for(var n,i,s,l,c,d,u=0;u<t.length&&!c;){var h=t[u],p=t[u+1];for(n=i=0;n<h.length&&!c&&h[n];)if(c=h[n++].exec(e))for(s=0;s<p.length;s++)d=c[++i],typeof(l=p[s])===a&&l.length>0?2===l.length?typeof l[1]==o?this[l[0]]=l[1].call(this,d):this[l[0]]=l[1]:3===l.length?typeof l[1]!==o||l[1].exec&&l[1].test?this[l[0]]=d?d.replace(l[1],l[2]):r:this[l[0]]=d?l[1].call(this,d,l[2]):r:4===l.length&&(this[l[0]]=d?l[3].call(this,d.replace(l[1],l[2])):r):this[l]=d||r;u+=2}},Z=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var o=0;o<t[n].length;o++)if(F(t[n][o],e))return"?"===n?r:n}else if(F(t[n],e))return"?"===n?r:n;return t.hasOwnProperty("*")?t["*"]:e},G={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Y={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[d,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[d,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[d,p],[/opios[\/ ]+([\w\.]+)/i],[p,[d,L+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[p,[d,L+" GX"]],[/\bopr\/([\w\.]+)/i],[p,[d,L]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[p,[d,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[p,[d,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[d,p],[/quark(?:pc)?\/([-\w\.]+)/i],[p,[d,"Quark"]],[/\bddg\/([\w\.]+)/i],[p,[d,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[d,"UC"+_]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[p,[d,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[d,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[d,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[d,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[p,[d,"Smart Lenovo "+_]],[/(avast|avg)\/([\w\.]+)/i],[[d,/(.+)/,"$1 Secure "+_],p],[/\bfocus\/([\w\.]+)/i],[p,[d,R+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[d,L+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[d,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[d,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[d,L+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[d,"MIUI"+$]],[/fxios\/([\w\.-]+)/i],[p,[d,R]],[/\bqihoobrowser\/?([\w\.]*)/i],[p,[d,"360"]],[/\b(qq)\/([\w\.]+)/i],[[d,/(.+)/,"$1Browser"],p],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[d,/(.+)/,"$1"+$],p],[/samsungbrowser\/([\w\.]+)/i],[p,[d,N+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[p,[d,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[d,"Sogou Mobile"],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[d,p],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[d],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[p,d],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[d,j],p],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[d,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[d,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[d,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[d,E+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[d,E+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[d,"Android "+_]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[d,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[d,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,d],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[d,[p,Z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[d,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[d,"Netscape"],p],[/(wolvic|librewolf)\/([\w\.]+)/i],[d,p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[d,R+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[d,[p,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[d,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,H]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",H]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,H]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[h,N],[u,w]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[c,[h,N],[u,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[h,x],[u,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[h,x],[u,w]],[/(macintosh);/i],[c,[h,x]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[h,W],[u,m]],[/(?:honor)([-\w ]+)[;\)]/i],[c,[h,"Honor"],[u,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[h,I],[u,w]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[h,I],[u,m]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[c,/_/g," "],[h,U],[u,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[h,U],[u,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[h,"OPPO"],[u,m]],[/\b(opd2\d{3}a?) bui/i],[c,[h,"OPPO"],[u,w]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[h,"Vivo"],[u,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[c,[h,"Realme"],[u,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[h,A],[u,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[h,A],[u,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[h,O],[u,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[h,O],[u,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[h,"Lenovo"],[u,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[h,"Nokia"],[u,m]],[/(pixel c)\b/i],[c,[h,T],[u,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[h,T],[u,m]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[c,[h,P],[u,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[h,P],[u,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[h,"OnePlus"],[u,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[h,C],[u,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[h,C],[u,m]],[/(playbook);[-\w\),; ]+(rim)/i],[c,h,[u,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[h,k],[u,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[h,S],[u,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[h,S],[u,m]],[/(nexus 9)/i],[c,[h,"HTC"],[u,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[c,/_/g," "],[u,m]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[c,[h,"TCL"],[u,w]],[/(itel) ((\w+))/i],[[h,H],c,[u,Z,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[h,"Acer"],[u,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[h,"Meizu"],[u,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[c,[h,"Ulefone"],[u,m]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[c,[h,"Energizer"],[u,m]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[c,[h,"Cat"],[u,m]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[c,[h,"Smartfren"],[u,m]],[/droid.+; (a(?:015|06[35]|142p?))/i],[c,[h,"Nothing"],[u,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,c,[u,m]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,c,[u,w]],[/(surface duo)/i],[c,[h,M],[u,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[h,"Fairphone"],[u,m]],[/(u304aa)/i],[c,[h,"AT&T"],[u,m]],[/\bsie-(\w*)/i],[c,[h,"Siemens"],[u,m]],[/\b(rct\w+) b/i],[c,[h,"RCA"],[u,w]],[/\b(venue[\d ]{2,7}) b/i],[c,[h,"Dell"],[u,w]],[/\b(q(?:mv|ta)\w+) b/i],[c,[h,"Verizon"],[u,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[h,"Barnes & Noble"],[u,w]],[/\b(tm\d{3}\w+) b/i],[c,[h,"NuVision"],[u,w]],[/\b(k88) b/i],[c,[h,"ZTE"],[u,w]],[/\b(nx\d{3}j) b/i],[c,[h,"ZTE"],[u,m]],[/\b(gen\d{3}) b.+49h/i],[c,[h,"Swiss"],[u,m]],[/\b(zur\d{3}) b/i],[c,[h,"Swiss"],[u,w]],[/\b((zeki)?tb.*\b) b/i],[c,[h,"Zeki"],[u,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],c,[u,w]],[/\b(ns-?\w{0,9}) b/i],[c,[h,"Insignia"],[u,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[h,"NextBook"],[u,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],c,[u,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],c,[u,m]],[/\b(ph-1) /i],[c,[h,"Essential"],[u,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[h,"Envizen"],[u,w]],[/\b(trio[-\w\. ]+) b/i],[c,[h,"MachSpeed"],[u,w]],[/\btu_(1491) b/i],[c,[h,"Rotor"],[u,w]],[/(shield[\w ]+) b/i],[c,[h,"Nvidia"],[u,w]],[/(sprint) (\w+)/i],[h,c,[u,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[h,M],[u,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[h,D],[u,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[h,D],[u,m]],[/smart-tv.+(samsung)/i],[h,[u,v]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[h,N],[u,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,O],[u,v]],[/(apple) ?tv/i],[h,[c,x+" TV"],[u,v]],[/crkey/i],[[c,E+"cast"],[h,T],[u,v]],[/droid.+aft(\w+)( bui|\))/i],[c,[h,C],[u,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[h,W],[u,v]],[/(bravia[\w ]+)( bui|\))/i],[c,[h,P],[u,v]],[/(mitv-\w{5}) bui/i],[c,[h,U],[u,v]],[/Hbbtv.*(technisat) (.*);/i],[h,c,[u,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,V],[c,V],[u,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,c,[u,f]],[/droid.+; (shield) bui/i],[c,[h,"Nvidia"],[u,f]],[/(playstation [345portablevi]+)/i],[c,[h,P],[u,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[h,M],[u,f]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[c,[h,N],[u,y]],[/((pebble))app/i],[h,c,[u,y]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[h,x],[u,y]],[/droid.+; (glass) \d/i],[c,[h,T],[u,y]],[/droid.+; (wt63?0{2,3})\)/i],[c,[h,D],[u,y]],[/droid.+; (glass) \d/i],[c,[h,T],[u,y]],[/(pico) (4|neo3(?: link|pro)?)/i],[h,c,[u,y]],[/; (quest( \d| pro)?)/i],[c,[h,j],[u,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[u,b]],[/(aeobc)\b/i],[c,[h,C],[u,b]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[c,[u,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[u,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[u,m]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[d,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[d,p],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[d,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[d,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,d]],os:[[/microsoft (windows) (vista|xp)/i],[d,p],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[d,[p,Z,G]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,Z,G],[d,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[d,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[d,q],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,d],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[d,p],[/\(bb(10);/i],[p,[d,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[d,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[d,R+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[d,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[d,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[d,E+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[d,B],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[d,p],[/(sunos) ?([\w\.\d]*)/i],[[d,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[d,p]]},Q=function(e,t){if(typeof e===a&&(t=e,e=r),!(this instanceof Q))return new Q(e,t).getResult();var f=typeof n!==i&&n.navigator?n.navigator:r,v=e||(f&&f.userAgent?f.userAgent:""),y=f&&f.userAgentData?f.userAgentData:r,b=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(Y,t):Y,C=f&&f.userAgent==v;return this.getBrowser=function(){var e,t={};return t[d]=r,t[p]=r,z.call(t,v,b.browser),t[l]=typeof(e=t[p])===s?e.replace(/[^\d\.]/g,"").split(".")[0]:r,C&&f&&f.brave&&typeof f.brave.isBrave==o&&(t[d]="Brave"),t},this.getCPU=function(){var e={};return e[g]=r,z.call(e,v,b.cpu),e},this.getDevice=function(){var e={};return e[h]=r,e[c]=r,e[u]=r,z.call(e,v,b.device),C&&!e[u]&&y&&y.mobile&&(e[u]=m),C&&"Macintosh"==e[c]&&f&&typeof f.standalone!==i&&f.maxTouchPoints&&f.maxTouchPoints>2&&(e[c]="iPad",e[u]=w),e},this.getEngine=function(){var e={};return e[d]=r,e[p]=r,z.call(e,v,b.engine),e},this.getOS=function(){var e={};return e[d]=r,e[p]=r,z.call(e,v,b.os),C&&!e[d]&&y&&y.platform&&"Unknown"!=y.platform&&(e[d]=y.platform.replace(/chrome os/i,B).replace(/macos/i,q)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?V(e,500):e,this},this.setUA(v),this};Q.VERSION="1.0.40",Q.BROWSER=K([d,p,l]),Q.CPU=K([g]),Q.DEVICE=K([c,h,u,f,m,v,w,y,b]),Q.ENGINE=Q.OS=K([d,p]),e.exports&&(t=e.exports=Q),t.UAParser=Q;var J=typeof n!==i&&(n.jQuery||n.Zepto);if(J&&!J.ua){var X=new Q;J.ua=X.getResult(),J.ua.get=function(){return X.getUA()},J.ua.set=function(e){X.setUA(e);var t=X.getResult();for(var n in t)J.ua[n]=t[n]}}}("object"==typeof window?window:yo)}(vo,vo.exports)),vo.exports);const Co=b(bo);class xo{constructor(){this.storage={}}static getInstance(){return xo.instance||(xo.instance=new xo),xo.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return null!=(t=this.storage[e])?t:null}key(e){var t;const n=Object.keys(this.storage);return e<0||e>=n.length?null:null!=(t=n[e])?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}}class So extends z{constructor(...e){super(...e),Object.setPrototypeOf(this,So.prototype)}}function ko(...e){try{console.debug("[TON_CONNECT_UI]",...e)}catch(t){}}function _o(...e){try{console.error("[TON_CONNECT_UI]",...e)}catch(t){}}function Eo(e,t="_self"){ni({link:e}),ko("openLink",e,t),window.open(e,t,"noopener noreferrer")}function Ro(e){Eo(e,"_blank")}function To(e,t){const n=setTimeout(()=>{Wo("safari")||No("android")&&Wo("firefox")||No("windows")||t()},200);window.addEventListener("blur",()=>clearTimeout(n),{once:!0}),Eo(e,"_self")}function Io(e){return y(this,null,function*(){yield new Promise(e=>requestAnimationFrame(e)),e()})}function Oo(e){"complete"!==document.readyState?window.addEventListener("load",()=>Io(()=>Oo(e)),{once:!0}):e.forEach(e=>{(new window.Image).src=e})}function Mo(){if("undefined"!=typeof window)return window}function Ao(){if(function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}())return localStorage;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)throw new So("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return xo.getInstance()}function Lo(){var e,t,n;const r=(new Co).getResult(),o=null==(e=r.os.name)?void 0:e.toLowerCase();let i;switch(!0){case"ipad"===(null==(t=r.device.model)?void 0:t.toLowerCase()):i="ipad";break;case"ios"===o:i="ios";break;case"android"===o:i="android";break;case"mac os"===o:i="macos";break;case"linux"===o:i="linux";break;case null==o?void 0:o.includes("windows"):i="windows"}const a=null==(n=r.browser.name)?void 0:n.toLowerCase();let s;switch(!0){case"chrome"===a:s="chrome";break;case"firefox"===a:s="firefox";break;case null==a?void 0:a.includes("safari"):s="safari";break;case null==a?void 0:a.includes("opera"):s="opera"}return{os:i,browser:s}}function No(...e){return e.includes(Lo().os)}function Wo(...e){return e.includes(Lo().browser)}function Po(e,t){return t+new URL(e).search}class Uo{constructor(){this.storageKey="ton-connect-ui_wallet-info",this.localStorage=Ao()}setWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getWalletInfo(){const e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeWalletInfo(){this.localStorage.removeItem(this.storageKey)}}class Do{constructor(){this.storageKey="ton-connect-ui_preferred-wallet",this.localStorage=Ao()}setPreferredWalletAppName(e){this.localStorage.setItem(this.storageKey,e)}getPreferredWalletAppName(){return this.localStorage.getItem(this.storageKey)||void 0}}class jo{constructor(){this.storageKey="ton-connect-ui_last-selected-wallet-info",this.localStorage=Ao()}setLastSelectedWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getLastSelectedWalletInfo(){const e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeLastSelectedWalletInfo(){this.localStorage.removeItem(this.storageKey)}}const[Bo,qo]=Rn({status:"closed",closeReason:null}),$o=Mn(()=>"opened"===Bo().status),[Ko,Fo]=Rn({status:"closed",closeReason:null}),Ho=Mn(()=>"opened"===Ko().status),Vo=Mn(()=>{const e=Ko();return"opened"===e.status?e.walletInfo:null});let zo="undefined"!=typeof window?new jo:void 0;const[Zo,Go]=Rn((null==zo?void 0:zo.getLastSelectedWalletInfo())||null),Yo=e=>{zo||(zo=new jo),e?zo.setLastSelectedWalletInfo(e):zo.removeLastSelectedWalletInfo(),Go(e)},[Qo,Jo]=Rn(null),[Xo,ei]=Rn({walletsMenu:"explicit_wallet",wallets:[]}),[ti,ni]=Rn({link:""}),ri={common:{close:"Закрыть",openWallet:"Открыть кошелёк",copyLink:"Скопировать",linkCopied:"Ссылка скопирована",copied:"Скопировано",yourWallet:"Ваш кошелёк",retry:"Повторить",get:"Скачать",mobile:"Мобильный",browserExtension:"Расширение",desktop:"Десктоп"},button:{connectWallet:"Подключить кошелёк",dropdown:{copy:"Скопировать адрес",copied:"Адрес скопирован!",disconnect:"Отключить кошелёк"}},notifications:{confirm:{header:"Откройте {{ name }}, чтобы подтвердить транзакцию."},transactionSent:{header:"Транзакция отправлена",text:"Ваша транзакция будет обработана через несколько секунд."},transactionCanceled:{header:"Транзакция отменена",text:"Состояние вашего счёта не изменится."},dataSigned:{header:"Данные подписаны"},signDataCanceled:{header:"Подпись данных отменена"}},walletItem:{walletOn:"Wallet в",recent:"Недавний",installed:"Установлен",popular:"Популярен"},walletModal:{loading:"Кошельки загружаются",wallets:"Кошельки",mobileUniversalModal:{connectYourWallet:"Подключите TON кошелёк",openWalletOnTelegramOrSelect:"Подключите Wallet в Telegram или выберете другое приложение",openWalletOnTelegram:"Открыть Wallet в Telegram",chooseOtherApplication:"Выберите другое приложение",openLink:"Открыть",scan:"Отсканируйте камерой вашего телефона"},desktopUniversalModal:{connectYourWallet:"Подключите TON кошелёк",scan:"Отсканируйте QR-код камерой вашего телефона",availableWallets:"Доступные кошельки"},mobileConnectionModal:{showQR:"Показать QR-код",scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",missingFeatures:"Обновите {{ name }}, ваша версия не поддерживает необходимые функции для этого dApp",wrongNetwork:"Подключённый кошелёк находится в другой сети. Пожалуйста, переключите сеть в {{ name }} и попробуйте снова",notSupportedWallet:"{{ name }} не поддерживает запрошенное действие. Пожалуйста, подключите другой кошелёк, который поддерживает это",continueIn:"Продолжите в {{ name }}…",updateWallet:"Обновить {{ name }}",chooseAnotherWallet:"Выбрать другой кошелёк",connectionDeclined:"Подключение отклонено"},desktopConnectionModal:{scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueInExtension:"Откройте браузерное расширение {{ name }}",dontHaveExtension:"Похоже, у вас не установлено браузерное расширение {{ name }}",missingFeatures:"Обновите {{ name }}, ваша версия не поддерживает необходимые функции для этого dApp",wrongNetwork:"Подключённый кошелёк находится в другой сети. Пожалуйста, переключите сеть в {{ name }} и попробуйте снова",notSupportedWallet:"{{ name }} не поддерживает запрошенное действие. Пожалуйста, подключите другой кошелёк, который поддерживает это",getWallet:"Скачать {{ name }}",updateWallet:"Обновить {{ name }}",chooseAnotherWallet:"Выбрать другой кошелёк",continueOnDesktop:"Откройте {{ name }} на компьютере…",openWalletOnTelegram:"Открыть Wallet в Telegram",connectionDeclined:"Подключение отклонено"},infoModal:{whatIsAWallet:"Что такое кошелёк?",secureDigitalAssets:"Надежное хранилище цифровых активов",walletProtects:"Кошелёк защищает ваши цифровые активы, включая TON, токены и предметы коллекционирования, и управляет ими.",controlIdentity:"Контроль своей личности Web3",manageIdentity:"Управляйте своей цифровой идентификацией и с легкостью получайте доступ к децентрализованным приложениям. Сохраняйте контроль над своими данными и безопасно участвуйте в экосистеме блокчейна.",effortlessCryptoTransactions:"Простые криптотранзакции",easilySend:"Легко отправляйте, получайте и отслеживайте свои криптовалюты. Оптимизируйте свои операции с помощью децентрализованных приложений.",getAWallet:"Скачать кошелёк"},restoreModal:{title:"Восстановление",step1:{title:"Найдите вашу текущую фразу восстановления",text:"Откройте настройки кошелька и найдите фразу восстановления"},step2:{title:"Скопируйте вашу фразу восстановления",text:"Запишите её или сохраните в безопасном месте"},step3:{title:"Восстановите в поддерживаемом кошельке",text:"Введите фразу восстановления для доступа к вашему кошельку"}},allWallets:{walletsBelowNotSupported:"Кошельки ниже не поддерживают все функции подключённого сервиса. Вы можете использовать свою фразу восстановления в одном из поддерживаемых выше кошельков.",walletNotSupportService:"{{ name }} не поддерживает подключённый сервис"},featureNotSupported:{wallet:{title:"{{ name }} не поддерживает запрошенное действие",description:"Установите поддерживаемый кошелёк из списка ниже, восстановите его с помощью фразы восстановления, затем подключитесь и попробуйте снова.",info:"Узнать, как восстановить кошелёк"},version:{description:"Текущая версия {{ name }} или тип контракта кошелька не поддерживает необходимые функции. Обновите кошелёк, чтобы продолжить.",updateButton:"Обновить {{ name }}",aboutW5:"Про W5"},disconnect:{title:"Подтвердите отключение",description:"Вы будете отключены от текущего кошелька и перенаправлены на подключение {{ name }}.",button:"Отключиться"}}},actionModal:{confirmTransaction:{header:"Подтвердите действие в {{ name }}",text:"Это займет пару секунд."},signData:{header:"Подпишите данные в {{ name }}",text:"Это займет пару секунд."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled",dataSigned:"$notifications.dataSigned",signDataCanceled:"$notifications.signDataCanceled"}},oi={en:ii({common:{close:"Close",openWallet:"Open wallet",copyLink:"Copy Link",linkCopied:"Link Copied",copied:"Copied",yourWallet:"Your Wallet",retry:"Retry",get:"GET",mobile:"Mobile",browserExtension:"Browser Extension",desktop:"Desktop"},button:{connectWallet:"Connect Wallet",dropdown:{copy:"Copy address",copied:"Address copied!",disconnect:"Disconnect"}},notifications:{confirm:{header:"Open {{ name }} to confirm the transaction."},transactionSent:{header:"Transaction sent",text:"Your transaction will be processed in a few seconds."},transactionCanceled:{header:"Transaction canceled",text:"There will be no changes to your account."},dataSigned:{header:"Data signed"},signDataCanceled:{header:"Sign data canceled"}},walletItem:{walletOn:"Wallet in",recent:"Recent",installed:"Installed",popular:"Popular"},walletModal:{loading:"Loading wallets",wallets:"Wallets",mobileUniversalModal:{connectYourWallet:"Connect your TON wallet",openWalletOnTelegramOrSelect:"Use Wallet in Telegram or choose other application",openWalletOnTelegram:"Connect Wallet in Telegram",chooseOtherApplication:"Choose other application",openLink:"Open Link",scan:"Scan with your mobile wallet"},desktopUniversalModal:{connectYourWallet:"Connect your TON wallet",scan:"Scan with your mobile wallet",availableWallets:"Available wallets"},mobileConnectionModal:{showQR:"Show QR Code",scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",missingFeatures:"Please update {{ name }}, your version does not support required features for this dApp",wrongNetwork:"Connected wallet is on a different network. Please switch network in {{ name }} and try again",notSupportedWallet:"{{ name }} doesn’t support the requested action. Please connect another wallet that supports it",continueIn:"Continue in {{ name }}…",updateWallet:"Update {{ name }}",chooseAnotherWallet:"Choose Another Wallet",connectionDeclined:"Connection declined"},desktopConnectionModal:{scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",continueInExtension:"Continue in {{ name }} browser extension…",dontHaveExtension:"Seems you don't have installed {{ name }} browser extension",missingFeatures:"Please update {{ name }}, your version does not support required features for this dApp",wrongNetwork:"Connected wallet is on a different network. Please switch network in {{ name }} and try again",notSupportedWallet:"{{ name }} doesn’t support the requested action. Please connect another wallet that supports it",getWallet:"Get {{ name }}",updateWallet:"Update {{ name }}",chooseAnotherWallet:"Choose Another Wallet",continueOnDesktop:"Continue in {{ name }} on desktop…",openWalletOnTelegram:"Connect Wallet in Telegram on desktop",connectionDeclined:"Connection declined"},infoModal:{whatIsAWallet:"What is a wallet",secureDigitalAssets:"Secure digital assets storage",walletProtects:"A wallet protects and manages your digital assets including TON, tokens and collectables.",controlIdentity:"Control your Web3 identity",manageIdentity:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem.",effortlessCryptoTransactions:"Effortless crypto transactions",easilySend:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications.",getAWallet:"Get a Wallet"},restoreModal:{title:"Restore",step1:{title:"Find your current recovery phrase",text:"Open your wallet settings and locate the recovery phrase"},step2:{title:"Copy your recovery phrase",text:"Write it down or copy it to a safe place"},step3:{title:"Restore in a supported wallet",text:"Enter the recovery phrase to access your wallet"}},allWallets:{walletsBelowNotSupported:"The wallets below don’t support all features of the connected service. You can use your recovery phrase in one of the supported wallets above.",walletNotSupportService:"{{ name }} doesn’t support connected service"},featureNotSupported:{wallet:{title:"{{ name }} doesn’t support the requested action",description:"Install a supported wallet from the list below, restore it with your recovery phrase, then connect it and try again.",info:"Learn how to restore your wallet"},version:{description:"Your current version of {{ name }} or wallet contract type doesn't support the required features. Please update it to continue.",updateButton:"Update {{ name }}",aboutW5:"About W5"},disconnect:{title:"Confirm Disconnect",description:"You will be disconnected from your current wallet and redirected to connect {{ name }}.",button:"Disconnect"}}},actionModal:{confirmTransaction:{header:"Confirm the transaction in {{ name }}",text:"It will only take a moment."},signData:{header:"Sign the data in {{ name }}",text:"It will only take a moment."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled",dataSigned:"$notifications.dataSigned",signDataCanceled:"$notifications.signDataCanceled"}}),ru:ii(ri)};function ii(e){const t=n=>{Object.entries(n).forEach(([r,o])=>{if("object"==typeof o&&o)return t(o);if("string"==typeof o){if("$"===o[0]){const t=o.slice(1).split(".");let i=e;t.forEach(e=>{if(!(e in i))throw new Error(`Cannot parse translations: there is no property ${e} in translation`);i=i[e]}),n[r]=i}"\\$"===o.slice(0,2)&&(n[r]=o.slice(1))}})};return t(e),e}const ai=Hn(),si=Symbol("store-raw"),li=Symbol("store-node"),ci=Symbol("store-has"),di=Symbol("store-self");function ui(e){let t=e[un];if(!t&&(Object.defineProperty(e,un,{value:t=new Proxy(e,wi)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const i=n[o];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(t)})}}return t}function hi(e){let t;return null!=e&&"object"==typeof e&&(e[un]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function pi(e,t=new Set){let n,r,o,i;if(n=null!=e&&e[si])return n;if(!hi(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,i=e.length;n<i;n++)o=e[n],(r=pi(o,t))!==o&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const n=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let s=0,l=n.length;s<l;s++)i=n[s],a[i].get||(o=e[i],(r=pi(o,t))!==o&&(e[i]=r))}return e}function gi(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function fi(e,t,n){if(e[t])return e[t];const[r,o]=Rn(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function mi(e){Dn()&&fi(gi(e,li),di)()}const wi={get(e,t,n){if(t===si)return e;if(t===un)return n;if(t===pn)return mi(e),n;const r=gi(e,li),o=r[t];let i=o?o():e[t];if(t===li||t===ci||"__proto__"===t)return i;if(!o){const n=Object.getOwnPropertyDescriptor(e,t);!Dn()||"function"==typeof i&&!e.hasOwnProperty(t)||n&&n.get||(i=fi(r,t,i)())}return hi(i)?ui(i):i},has:(e,t)=>t===si||t===un||t===pn||t===li||t===ci||"__proto__"===t||(Dn()&&fi(gi(e,ci),t)(),t in e),set:()=>!0,deleteProperty:()=>!0,ownKeys:function(e){return mi(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return n&&!n.get&&n.configurable&&t!==un&&t!==li?(delete n.value,delete n.writable,n.get=()=>e[un][t],n):n}};function vi(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;void 0===n?(delete e[t],e[ci]&&e[ci][t]&&void 0!==o&&e[ci][t].$()):(e[t]=n,e[ci]&&e[ci][t]&&void 0===o&&e[ci][t].$());let a,s=gi(e,li);if((a=fi(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let t=e.length;t<i;t++)(a=s[t])&&a.$();(a=fi(s,"length",i))&&a.$(e.length)}(a=s[di])&&a.$()}function yi(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];vi(e,o,t[o])}}function bi(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const i=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let o=0;o<r.length;o++)bi(e,[r[o]].concat(t),n);return}if(a&&"function"===i){for(let o=0;o<e.length;o++)r(e[o],o)&&bi(e,[o].concat(t),n);return}if(a&&"object"===i){const{from:o=0,to:i=e.length-1,by:a=1}=r;for(let r=o;r<=i;r+=a)bi(e,[r].concat(t),n);return}if(t.length>1)return void bi(e[r],t,[r].concat(n));o=e[r],n=[r].concat(n)}let i=t[0];"function"==typeof i&&(i=i(o,n),i===o)||void 0===r&&null==i||(i=pi(i),void 0===r||hi(o)&&hi(i)&&!Array.isArray(i)?yi(o,i):vi(e,r,i))}function Ci(...[e,t]){const n=pi(e||{}),r=Array.isArray(n);return[ui(n),function(...e){Ln(()=>{r&&1===e.length?function(e,t){if("function"==typeof t&&(t=t(e)),t=pi(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const r=t[n];e[n]!==r&&vi(e,n,r)}vi(e,"length",r)}else yi(e,t)}(n,e[0]):bi(n,e)})}]}const xi={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"}};var Si,ki;const _i=b(function(){if(ki)return Si;ki=1;var e=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var n=Object.prototype.toString.call(e);return"[object RegExp]"===n||"[object Date]"===n||function(e){return e.$$typeof===t}(e)}(e)},t="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function r(e,t,r){return e.concat(t).map(function(e){return n(e,r)})}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function i(e,t){try{return t in e}catch(n){return!1}}function a(e,t,r){var a={};return r.isMergeableObject(e)&&o(e).forEach(function(t){a[t]=n(e[t],r)}),o(t).forEach(function(o){(function(e,t){return i(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(i(e,o)&&r.isMergeableObject(t[o])?a[o]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(o,r)(e[o],t[o],r):a[o]=n(t[o],r))}),a}function s(t,o,i){(i=i||{}).arrayMerge=i.arrayMerge||r,i.isMergeableObject=i.isMergeableObject||e,i.cloneUnlessOtherwiseSpecified=n;var s=Array.isArray(o);return s===Array.isArray(t)?s?i.arrayMerge(t,o,i):a(t,o,i):n(o,i)}return s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return s(e,n,t)},{})},Si=s}());function Ei(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ri(e){var t,n;return!1!==Ei(e)&&(void 0===(t=e.constructor)||!1!==Ei(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}function Ti(e,t){if(!e)return t;return _i(t,e,{arrayMerge:(e,t,n)=>t,isMergeableObject:Ri})}const[Ii,Oi]=Ci({theme:Zr.LIGHT,colors:xi,borderRadius:"m"}),Mi={[Zr.LIGHT]:xi,[Zr.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:"#FFFFFF"},text:{primary:"#E5E5EA",secondary:"#7D7D85"}}},Ai={[Zr.LIGHT]:void 0,[Zr.DARK]:void 0};function Li(e,t){t&&(Ai[Zr.DARK]=Ti(t[Zr.DARK],Ai[Zr.DARK]),Ai[Zr.LIGHT]=Ti(t[Zr.LIGHT],Ai[Zr.LIGHT])),Oi({theme:e,colors:Ti(Ai[e],Mi[e])})}const Ni=lo.div`
|
|
41
41
|
background-color: ${e=>e.theme.colors.background.secondary};
|
|
42
|
-
`,Wi=e=>{let t;const[n,r]=Rn(null);return On(()=>{const t=new window.Image;return t.src=e.src,t.alt=e.alt||"",t.setAttribute("draggable","false"),e.class&&t.classList.add(e.class),t.complete?r(t):(t.addEventListener("load",()=>r(t)),()=>t.removeEventListener("load",()=>r(t)))}),[ur(br,{get when(){return n()},get children(){return n()}}),ur(br,{get when(){return!n()},get children(){return ur(Ni,{get class(){return e.class},ref(e){"function"==typeof t?t(e):t=e}})}})]};let Pi={};try{Pi=function(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=Zi(e),t;let n=e.indexOf("?");if(n>=0){let r=e.substr(0,n);t._path=Zi(r),e=e.substr(n+1)}let r=Gi(e);for(let o in r)t[o]=r[o];return t}(location.hash.toString())}catch(Vp){}let Ui="unknown";if((null==Pi?void 0:Pi.tgWebAppPlatform)&&(Ui=null!=(t=Pi.tgWebAppPlatform)?t:"unknown"),"unknown"===Ui){const e=Mo();Ui=null!=(o=null==(r=null==(n=null==e?void 0:e.Telegram)?void 0:n.WebApp)?void 0:r.platform)?o:"unknown"}let Di="6.0";if((null==Pi?void 0:Pi.tgWebAppVersion)&&(Di=Pi.tgWebAppVersion),!Di){const e=Mo();Di=null!=(s=null==(a=null==(i=null==e?void 0:e.Telegram)?void 0:i.WebApp)?void 0:a.version)?s:"6.0"}const ji=null==Pi?void 0:Pi.tgWebAppData;let Bi;try{if(ji){let e=Gi(ji).user;if(e){let t=JSON.parse(e);"number"==typeof t.id&&"boolean"==typeof t.is_premium&&(Bi={id:t.id,isPremium:t.is_premium})}}}catch(Vp){}function
|
|
42
|
+
`,Wi=e=>{let t;const[n,r]=Rn(null);return On(()=>{const t=new window.Image;return t.src=e.src,t.alt=e.alt||"",t.setAttribute("draggable","false"),e.class&&t.classList.add(e.class),t.complete?r(t):(t.addEventListener("load",()=>r(t)),()=>t.removeEventListener("load",()=>r(t)))}),[ur(br,{get when(){return n()},get children(){return n()}}),ur(br,{get when(){return!n()},get children(){return ur(Ni,{get class(){return e.class},ref(e){"function"==typeof t?t(e):t=e}})}})]};let Pi={};try{Pi=function(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=Zi(e),t;let n=e.indexOf("?");if(n>=0){let r=e.substr(0,n);t._path=Zi(r),e=e.substr(n+1)}let r=Gi(e);for(let o in r)t[o]=r[o];return t}(location.hash.toString())}catch(Vp){}try{const e="ton-connect-session_storage_launchParams";if(Object.entries(Pi).length>0)sessionStorage.setItem(e,JSON.stringify(Pi));else{const t=sessionStorage.getItem(e);t&&(Pi=JSON.parse(t))}}catch(Vp){}let Ui="unknown";if((null==Pi?void 0:Pi.tgWebAppPlatform)&&(Ui=null!=(t=Pi.tgWebAppPlatform)?t:"unknown"),"unknown"===Ui){const e=Mo();Ui=null!=(o=null==(r=null==(n=null==e?void 0:e.Telegram)?void 0:n.WebApp)?void 0:r.platform)?o:"unknown"}let Di="6.0";if((null==Pi?void 0:Pi.tgWebAppVersion)&&(Di=Pi.tgWebAppVersion),!Di){const e=Mo();Di=null!=(s=null==(a=null==(i=null==e?void 0:e.Telegram)?void 0:i.WebApp)?void 0:a.version)?s:"6.0"}const ji=null==Pi?void 0:Pi.tgWebAppData;let Bi;try{if(ji){let e=Gi(ji).user;if(e){let t=JSON.parse(e);"number"==typeof t.id&&"boolean"==typeof t.is_premium&&(Bi={id:t.id,isPremium:t.is_premium})}}}catch(Vp){}function qi(...e){return e.includes(Ui)}function $i(){var e;return"unknown"!==Ui||!!(null==(e=Mo())?void 0:e.TelegramWebviewProxy)}function Ki(){var e;const t=!!(null==(e=Mo())?void 0:e.TelegramWebview);return($i()||t)&&"unknown"===Ui}function Fi(){zi("web_app_expand",{})}function Hi(e,t){const n=new URL(e);if("http:"!==n.protocol&&"https:"!==n.protocol){if(t)return t();throw new So(`Url protocol is not supported: ${n}`)}if("t.me"!==n.hostname){if(t)return t();throw new So(`Url host is not supported: ${n}`)}const r=n.pathname+n.search;Vi()||function(e,t){"string"!=typeof e&&(e="");let n,r,o,i,a=e.replace(/^\s+|\s+$/g,"").split("."),s=t.replace(/^\s+|\s+$/g,"").split(".");for(n=Math.max(a.length,s.length),r=0;r<n;r++)if(o=parseInt(a[r])||0,i=parseInt(s[r])||0,o!==i)return o>i?1:-1;return 0}(Di,"6.1")>=0?(ni({link:r,type:"tg_link"}),zi("web_app_open_tg_link",{path_full:r})):Ro("https://t.me"+r)}function Vi(){try{const e=Mo();return!!e&&(null!=e.parent&&e!==e.parent)}catch(Vp){return!1}}function zi(e,t){try{const n=Mo();if(!n)throw new So("Can't post event to parent window: window is not defined");if(void 0!==n.TelegramWebviewProxy)ko("postEvent",e,t),n.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(n.external&&"notify"in n.external)ko("postEvent",e,t),n.external.notify(JSON.stringify({eventType:e,eventData:t}));else{if(!Vi())throw new So("Can't post event to TMA");{const r="*",o=JSON.stringify({eventType:e,eventData:t});ko("postEvent",e,t),n.parent.postMessage(o,r)}}}catch(Vp){_o(`Can't post event to parent window: ${Vp}`)}}function Zi(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch(Vp){return e}}function Gi(e){let t={};if(!e.length)return t;let n,r,o,i,a=e.split("&");for(n=0;n<a.length;n++)r=a[n].split("="),o=Zi(r[0]),i=null==r[1]?null:Zi(r[1]),t[o]=i;return t}const Yi=440,Qi=1020;function Ji(e){const t=Mo();if(!t)return"desktop"===e;if(qi("weba"))return!0;const n=t.innerWidth;switch(e){case"desktop":return n>Qi;case"tablet":return n>Yi;default:return n<=Yi||No("ios","android","ipad")}}function Xi(e){switch(e){case"mobile":return`@media (max-width: ${Yi}px)`;case"tablet":return`@media (max-width: ${Qi}px) (min-width: ${Yi}px)`;default:return`@media (min-width: ${Qi}px)`}}const ea="@media (hover: none)",ta="@media not all and (hover: none)",na={m:"100vh",s:"8px",none:"0"},ra={s:.02,m:.04},oa=lo.button`
|
|
43
43
|
display: ${e=>e.leftIcon||e.rightIcon?"flex":"inline-block"};
|
|
44
44
|
gap: ${e=>e.leftIcon||e.rightIcon?"6px":"unset"};
|
|
45
45
|
align-items: ${e=>e.leftIcon||e.rightIcon?"center":"unset"};
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
${e=>Na[e.theme.borderRadius]};
|
|
162
162
|
`,Ba=lo(La)`
|
|
163
163
|
background-color: ${e=>fo(e.theme.colors.icon.secondary,.12)};
|
|
164
|
-
`;class
|
|
164
|
+
`;class qa{constructor(){this.currentTime=0}}const $a=class e{constructor(){this.currentTime=0,this.playbackRate=1,this.startTime=null,this.timeline=new qa,this.finished=Promise.resolve(this),this.effect=null,this.id="",this.pending=!1,this.playState="finished",this.replaceState="active",this.ready=Promise.resolve(this),this.oncancel=null,this.onfinish=null,this.onremove=null}static create(){return e._instance||(!function(...e){try{console.warn("[TON_CONNECT_UI]",...e)}catch(Vp){}}("Animation is not supported in this environment: please consider using the `web-animations-js` polyfill to provide a fallback implementation of the Web Animations API."),e._instance=new e),e._instance}cancel(){}finish(){}pause(){}play(){}reverse(){}addEventListener(e,t,n){}dispatchEvent(e){return!1}removeEventListener(e,t,n){}updatePlaybackRate(e){}commitStyles(){}persist(){}};$a._instance=null;let Ka=$a;function Fa(e,t,n){return"animate"in e?e.animate(t,n):Ka.create()}var Ha=Ar("<div>");const Va=function(e,t){const n=n=>{var r;return!e.contains(n.target)&&(null==(r=t())?void 0:r())};document.body.addEventListener("click",n),Un(()=>document.body.removeEventListener("click",n))},za=function(e,t){const n=e=>{var n,r;"Escape"===e.key&&(null==(n=document.activeElement)||n.blur(),null==(r=t())||r())};document.body.addEventListener("keydown",n),Un(()=>document.body.removeEventListener("keydown",n))},Za=function(e,t){const{isEnabled:n,onClose:r}=t();if(!n)return;if(!("android"===Lo().os))return;window.history.pushState(Ea,"");const o=e=>{e.preventDefault(),r()};window.addEventListener("popstate",o,{once:!0}),Un(()=>{window.removeEventListener("popstate",o),Io(()=>{var e;!0===(null==(e=window.history.state)?void 0:e[_a])&&window.history.back()})})},Ga=e=>{const t=ao(),n=ia(e);return On(()=>{e.opened?document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=mo(-document.documentElement.scrollTop),document.body.classList.add(ho)):document.body.classList.contains(ho)&&(document.body.classList.remove(ho),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto")}),ur(Sa,{onBeforeEnter:e=>{const t=Ji("mobile")?200:100;Fa(e,[{opacity:0},{opacity:1}],{duration:t}),Ji("mobile")&&Fa(e.firstElementChild,[{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:t})},onExit:(e,t)=>{const n=Ji("mobile")?200:100,r=Fa(e,[{opacity:1},{opacity:0}],{duration:n});if(Ji("mobile")){const o=Fa(e.firstElementChild,[{transform:"translateY(0)"},{transform:"translateY(390px)"}],{duration:n});Promise.all([r.finished,o.finished]).then(t)}else r.finished.then(t)},get children(){return ur(br,{get when(){return e.opened},get children(){return ur(Wa,mr({"data-tc-modal":"true"},n,{get children(){var n=Ha();return Pr(Za,n,()=>({isEnabled:e.enableAndroidBackHandler,onClose:()=>e.onClose()})),Pr(za,n,()=>()=>e.onClose()),Pr(Va,n,()=>()=>e.onClose()),Ur(n,ur(Ua,{get class(){return e.class},get children(){return[ur(Da,{icon:"close",onClick:()=>e.onClose()}),Or(()=>e.children)]}}),null),Ur(n,ur(br,{get when(){return e.onClickQuestion&&e.showFooter},get children(){return ur(ja,{get children(){return[ur(rl,{}),ur(Ba,{get onClick(){return e.onClickQuestion},icon:"question"})]}})}}),null),In(()=>Nr(n,da(Pa,no`
|
|
165
165
|
border-radius: ${Na[t.borderRadius]};
|
|
166
166
|
background-color: ${t.colors.background.tint};
|
|
167
167
|
|
|
@@ -463,7 +463,7 @@
|
|
|
463
463
|
margin-bottom: 0;
|
|
464
464
|
|
|
465
465
|
cursor: default;
|
|
466
|
-
|
|
466
|
+
`,qs=e=>{const[t]=bs();return ur(Bs,{"data-tc-h3":"true",get class(){return e.class},get children(){var n;return Or(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString()):e.children}})};var $s=Ar('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path fill-rule=evenodd clip-rule=evenodd d="M14.1839 17.7069C13.6405 18.6507 13.3688 19.1226 13.0591 19.348C12.4278 19.8074 11.5723 19.8074 10.941 19.348C10.6312 19.1226 10.3595 18.6507 9.81613 17.7069L5.52066 10.2464C4.76864 8.94024 4.39263 8.28717 4.33762 7.75894C4.2255 6.68236 4.81894 5.65591 5.80788 5.21589C6.29309 5 7.04667 5 8.55383 5H15.4462C16.9534 5 17.7069 5 18.1922 5.21589C19.1811 5.65591 19.7745 6.68236 19.6624 7.75894C19.6074 8.28717 19.2314 8.94024 18.4794 10.2464L14.1839 17.7069ZM11.1 16.3412L6.56139 8.48002C6.31995 8.06185 6.19924 7.85276 6.18146 7.68365C6.14523 7.33896 6.33507 7.01015 6.65169 6.86919C6.80703 6.80002 7.04847 6.80002 7.53133 6.80002H7.53134L11.1 6.80002V16.3412ZM12.9 16.3412L17.4387 8.48002C17.6801 8.06185 17.8008 7.85276 17.8186 7.68365C17.8548 7.33896 17.665 7.01015 17.3484 6.86919C17.193 6.80002 16.9516 6.80002 16.4687 6.80002L12.9 6.80002V16.3412Z">');const Ks=e=>{const t=ao();return n=$s(),r=n.firstChild,In(()=>Lr(r,"fill",e.fill||t.colors.icon.primary)),n;var n,r};var Fs=Ar('<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 viewBox="0 0 16 16"fill=none><g clip-path=url(#clip0_3783_2045)><circle cx=8 cy=8.00098 r=8></circle><path d="M4.75 8.50098L7 10.751L11.75 6.00098"stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path></g><defs><clipPath id=clip0_3783_2045><rect width=16 height=16 fill=white transform="translate(0 0.000976562)">'),Hs=Ar('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><circle cx=12 cy=12 r=11></circle><path d="M17.1364 9.6364C17.4879 9.28493 17.4879 8.71508 17.1364 8.36361C16.7849 8.01214 16.2151 8.01214 15.8636 8.36361L10 14.2272L8.1364 12.3636C7.78493 12.0121 7.21508 12.0121 6.86361 12.3636C6.51214 12.7151 6.51214 13.2849 6.86361 13.6364L9.36361 16.1364C9.71508 16.4879 10.2849 16.4879 10.6364 16.1364L17.1364 9.6364Z">'),Vs=Ar('<svg width=72 height=72 viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><circle cx=36 cy=36 r=33></circle><path d="M50.9142 28.4142C51.6953 27.6332 51.6953 26.3668 50.9142 25.5858C50.1332 24.8047 48.8668 24.8047 48.0858 25.5858L30 43.6716L23.9142 37.5858C23.1332 36.8047 21.8668 36.8047 21.0858 37.5858C20.3047 38.3668 20.3047 39.6332 21.0858 40.4142L28.5858 47.9142C29.3668 48.6953 30.6332 48.6953 31.4142 47.9142L50.9142 28.4142Z">');const zs=e=>{const t=ao(),n=()=>e.size||"s",r=()=>e.fill||t.colors.icon.success;return Or(()=>{return Or(()=>"xs"===n())()?(d=Fs(),u=d.firstChild.firstChild,h=u.nextSibling,In(n=>{var o=e.class,i=r(),a=t.colors.constant.white;return o!==n.e&&Lr(d,"class",n.e=o),i!==n.t&&Lr(u,"fill",n.t=i),a!==n.a&&Lr(h,"stroke",n.a=a),n},{e:void 0,t:void 0,a:void 0}),d):Or(()=>"s"===n())()?(s=Hs(),l=s.firstChild,c=l.nextSibling,In(n=>{var o=e.class,i=r(),a=t.colors.constant.white;return o!==n.e&&Lr(s,"class",n.e=o),i!==n.t&&Lr(l,"fill",n.t=i),a!==n.a&&Lr(c,"fill",n.a=a),n},{e:void 0,t:void 0,a:void 0}),s):(o=Vs(),i=o.firstChild,a=i.nextSibling,In(n=>{var s=e.class,l=r(),c=t.colors.constant.white;return s!==n.e&&Lr(o,"class",n.e=s),l!==n.t&&Lr(i,"fill",n.t=l),c!==n.a&&Lr(a,"fill",n.a=c),n},{e:void 0,t:void 0,a:void 0}),o);var o,i,a,s,l,c,d,u,h})};var Zs=Ar('<svg width=72 height=72 viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><circle cx=36 cy=36 r=33></circle><path d="M24.0858 26.9142C23.3047 26.1332 23.3047 24.8668 24.0858 24.0858C24.8668 23.3047 26.1332 23.3047 26.9142 24.0858L36 33.1716L45.0858 24.0858C45.8668 23.3047 47.1332 23.3047 47.9142 24.0858C48.6953 24.8668 48.6953 26.1332 47.9142 26.9142L38.8284 36L47.9142 45.0858C48.6953 45.8668 48.6953 47.1332 47.9142 47.9142C47.1332 48.6953 45.8668 48.6953 45.0858 47.9142L36 38.8284L26.9142 47.9142C26.1332 48.6953 24.8668 48.6953 24.0858 47.9142C23.3047 47.1332 23.3047 45.8668 24.0858 45.0858L33.1716 36L24.0858 26.9142Z">'),Gs=Ar('<svg xmlns=http://www.w3.org/2000/svg width=48 height=48 viewBox="0 0 48 48"fill=none><circle cx=24 cy=24.001 r=22></circle><path d="M24 24.001L31.5 16.501M24 24.001L16.5 16.501M24 24.001L16.5 31.501M24 24.001L31.5 31.501"stroke-width=3 stroke-linecap=round stroke-linejoin=round>'),Ys=Ar('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><circle cx=12 cy=12 r=11></circle><path d="M7.86361 9.1364C7.51214 8.78493 7.51214 8.21508 7.86361 7.86361C8.21508 7.51214 8.78493 7.51214 9.1364 7.86361L12 10.7272L14.8636 7.86361C15.2151 7.51214 15.7849 7.51214 16.1364 7.86361C16.4879 8.21508 16.4879 8.78493 16.1364 9.1364L13.2728 12L16.1364 14.8636C16.4879 15.2151 16.4879 15.7849 16.1364 16.1364C15.7849 16.4879 15.2151 16.4879 14.8636 16.1364L12 13.2728L9.1364 16.1364C8.78493 16.4879 8.21508 16.4879 7.86361 16.1364C7.51214 15.7849 7.51214 15.2151 7.86361 14.8636L10.7272 12L7.86361 9.1364Z">');const Qs=e=>{const t=ao(),n=()=>e.size||"m",r=()=>e.fill||t.colors.icon.error;return Or(()=>{return Or(()=>"m"===n())()?(d=Zs(),u=d.firstChild,h=u.nextSibling,In(n=>{var o=e.class,i=r(),a=t.colors.constant.white;return o!==n.e&&Lr(d,"class",n.e=o),i!==n.t&&Lr(u,"fill",n.t=i),a!==n.a&&Lr(h,"fill",n.a=a),n},{e:void 0,t:void 0,a:void 0}),d):Or(()=>"s"===n())()?(s=Gs(),l=s.firstChild,c=l.nextSibling,In(n=>{var o=e.class,i=r(),a=t.colors.constant.white;return o!==n.e&&Lr(s,"class",n.e=o),i!==n.t&&Lr(l,"fill",n.t=i),a!==n.a&&Lr(c,"stroke",n.a=a),n},{e:void 0,t:void 0,a:void 0}),s):(o=Ys(),i=o.firstChild,a=i.nextSibling,In(n=>{var s=e.class,l=r(),c=t.colors.constant.white;return s!==n.e&&Lr(o,"class",n.e=s),l!==n.t&&Lr(i,"fill",n.t=l),c!==n.a&&Lr(a,"fill",n.a=c),n},{e:void 0,t:void 0,a:void 0}),o);var o,i,a,s,l,c,d,u,h})};var Js=Ar('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15.55 5.85123C18.9459 7.81184 20.1094 12.1541 18.1488 15.55C16.1882 18.9459 11.8459 20.1094 8.44998 18.1488C8.01952 17.9003 7.46909 18.0478 7.22056 18.4782C6.97203 18.9087 7.11952 19.4591 7.54998 19.7076C11.8068 22.1653 17.2499 20.7068 19.7076 16.45C22.1653 12.1932 20.7068 6.75005 16.45 4.29239C12.1932 1.83472 6.75003 3.29321 4.29236 7.55001C4.04383 7.98047 4.19132 8.53091 4.62178 8.77943C5.05224 9.02796 5.60268 8.88048 5.8512 8.45001C7.81181 5.05413 12.1541 3.89062 15.55 5.85123Z">'),Xs=Ar('<svg xmlns=http://www.w3.org/2000/svg width=44 height=44 viewBox="0 0 44 44"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M22 2.99951C11.5066 2.99951 3 11.5061 3 21.9995C3 32.4929 11.5066 40.9995 22 40.9995C22.8284 40.9995 23.5 41.6711 23.5 42.4995C23.5 43.3279 22.8284 43.9995 22 43.9995C9.84974 43.9995 0 34.1498 0 21.9995C0 9.84925 9.84974 -0.000488281 22 -0.000488281C34.1503 -0.000488281 44 9.84925 44 21.9995C44 22.8279 43.3284 23.4995 42.5 23.4995C41.6716 23.4995 41 22.8279 41 21.9995C41 11.5061 32.4934 2.99951 22 2.99951Z">'),el=Ar('<svg width=72 height=72 viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><path d="M24 56.7846C35.479 63.412 50.1572 59.479 56.7846 47.9999C63.412 36.5209 59.479 21.8427 48 15.2153C36.521 8.58791 21.8428 12.5209 15.2154 23.9999"stroke-width=4 stroke-linecap=round stroke-linejoin=round>');const tl=e=>{const t=ao(),n=()=>e.size||"xs",r=()=>e.fill||t.colors.icon.tertiary,o=no`
|
|
467
467
|
animation: ${ro`
|
|
468
468
|
0% {
|
|
469
469
|
transform: rotate(0deg);
|
|
@@ -503,7 +503,7 @@
|
|
|
503
503
|
&&::-webkit-scrollbar-thumb {
|
|
504
504
|
display: none;
|
|
505
505
|
}
|
|
506
|
-
|
|
506
|
+
`,ql=lo.div`
|
|
507
507
|
height: 1px;
|
|
508
508
|
margin: 0 -24px;
|
|
509
509
|
width: calc(100% + 48px);
|
|
@@ -515,7 +515,7 @@
|
|
|
515
515
|
width: 100%;
|
|
516
516
|
margin: 0;
|
|
517
517
|
}
|
|
518
|
-
`,[
|
|
518
|
+
`,[$l,Kl]=Rn((null==(l=Mo())?void 0:l.innerHeight)||0);Mo()&&window.addEventListener("resize",()=>Kl(window.innerHeight));const[Fl,Hl]=Rn(Ji("mobile")),Vl=()=>Hl(Ji("mobile"));Mo()&&(window.addEventListener("resize",()=>Vl()),window.addEventListener("load",()=>Vl(),{once:!0}));const zl=e=>{const[t,n]=Rn(!1),r=()=>void 0!==e.maxHeight?`${e.maxHeight}px`:$l()-(Fl()?150:200)+"px";return[ur(ql,{get isShown(){return t()}}),ur(Bl,{get maxHeight(){return r()},onScroll:e=>{n(e.target.scrollTop>0)},get class(){return e.class},get children(){return e.children}})]},Zl=lo.a`
|
|
519
519
|
display: block;
|
|
520
520
|
text-decoration: unset;
|
|
521
521
|
`,Gl=e=>ur(Zl,mr({get href(){return e.href},get target(){return e.blank?"_blank":"_self"},get class(){return e.class}},()=>e.blank?{rel:"noreferrer noopener"}:{},{get children(){return e.children}})),Yl=Hn();var Ql=Ar('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path fill-rule=evenodd clip-rule=evenodd d="M7.76228 2.09998H10.2378C11.0458 2.09997 11.7067 2.09996 12.2438 2.14384C12.7997 2.18926 13.3017 2.28614 13.7706 2.52505C14.5045 2.89896 15.1011 3.49558 15.475 4.22941C15.7139 4.6983 15.8108 5.20038 15.8562 5.75629C15.9001 6.29337 15.9001 6.95422 15.9001 7.76227V8.1H16.2377C17.0457 8.09999 17.7066 8.09998 18.2437 8.14386C18.7996 8.18928 19.3017 8.28616 19.7705 8.52507C20.5044 8.89898 21.101 9.4956 21.4749 10.2294C21.7138 10.6983 21.8107 11.2004 21.8561 11.7563C21.9 12.2934 21.9 12.9542 21.9 13.7623V16.2377C21.9 17.0458 21.9 17.7066 21.8561 18.2437C21.8107 18.7996 21.7138 19.3017 21.4749 19.7706C21.101 20.5044 20.5044 21.101 19.7705 21.4749C19.3017 21.7138 18.7996 21.8107 18.2437 21.8561C17.7066 21.9 17.0458 21.9 16.2378 21.9H13.7623C12.9543 21.9 12.2934 21.9 11.7563 21.8561C11.2004 21.8107 10.6983 21.7138 10.2294 21.4749C9.49561 21.101 8.89898 20.5044 8.52508 19.7706C8.28616 19.3017 8.18928 18.7996 8.14386 18.2437C8.09998 17.7066 8.09999 17.0458 8.1 16.2377V15.9H7.76227C6.95426 15.9 6.29335 15.9 5.75629 15.8561C5.20038 15.8107 4.6983 15.7138 4.22941 15.4749C3.49558 15.101 2.89896 14.5044 2.52505 13.7705C2.28614 13.3017 2.18926 12.7996 2.14384 12.2437C2.09996 11.7066 2.09997 11.0458 2.09998 10.2377V7.76228C2.09997 6.95424 2.09996 6.29336 2.14384 5.75629C2.18926 5.20038 2.28614 4.6983 2.52505 4.22941C2.89896 3.49558 3.49558 2.89896 4.22941 2.52505C4.6983 2.28614 5.20038 2.18926 5.75629 2.14384C6.29336 2.09996 6.95425 2.09997 7.76228 2.09998ZM8.1 14.1V13.7623C8.09999 12.9542 8.09998 12.2934 8.14386 11.7563C8.18928 11.2004 8.28616 10.6983 8.52508 10.2294C8.89898 9.4956 9.49561 8.89898 10.2294 8.52507C10.6983 8.28616 11.2004 8.18928 11.7563 8.14386C12.2934 8.09998 12.9542 8.09999 13.7623 8.1H14.1001V7.79998C14.1001 6.94505 14.0994 6.35798 14.0622 5.90287C14.0259 5.45827 13.9593 5.21944 13.8712 5.0466C13.6699 4.65146 13.3486 4.3302 12.9535 4.12886C12.7806 4.04079 12.5418 3.97419 12.0972 3.93786C11.6421 3.90068 11.055 3.89998 10.2001 3.89998H7.79998C6.94505 3.89998 6.35798 3.90068 5.90287 3.93786C5.45827 3.97419 5.21944 4.04079 5.0466 4.12886C4.65146 4.3302 4.3302 4.65146 4.12886 5.0466C4.04079 5.21944 3.97419 5.45827 3.93786 5.90287C3.90068 6.35798 3.89998 6.94505 3.89998 7.79998V10.2C3.89998 11.0549 3.90068 11.642 3.93786 12.0971C3.97419 12.5417 4.04079 12.7805 4.12886 12.9534C4.3302 13.3485 4.65146 13.6698 5.0466 13.8711C5.21944 13.9592 5.45827 14.0258 5.90287 14.0621C6.35798 14.0993 6.94505 14.1 7.79998 14.1H8.1ZM11.0466 10.1289C11.2195 10.0408 11.4583 9.97421 11.9029 9.93788C12.358 9.9007 12.9451 9.9 13.8 9.9H16.2C17.0549 9.9 17.642 9.9007 18.0971 9.93788C18.5417 9.97421 18.7805 10.0408 18.9534 10.1289C19.3485 10.3302 19.6698 10.6515 19.8711 11.0466C19.9592 11.2195 20.0258 11.4583 20.0621 11.9029C20.0993 12.358 20.1 12.9451 20.1 13.8V16.2C20.1 17.0549 20.0993 17.642 20.0621 18.0971C20.0258 18.5417 19.9592 18.7805 19.8711 18.9534C19.6698 19.3485 19.3485 19.6698 18.9534 19.8711C18.7805 19.9592 18.5417 20.0258 18.0971 20.0621C17.642 20.0993 17.0549 20.1 16.2 20.1H13.8C12.9451 20.1 12.358 20.0993 11.9029 20.0621C11.4583 20.0258 11.2195 19.9592 11.0466 19.8711C10.6515 19.6698 10.3302 19.3485 10.1289 18.9534C10.0408 18.7805 9.97421 18.5417 9.93788 18.0971C9.9007 17.642 9.9 17.0549 9.9 16.2V13.8C9.9 12.9451 9.9007 12.358 9.93788 11.9029C9.97421 11.4583 10.0408 11.2195 10.1289 11.0466C10.3302 10.6515 10.6515 10.3302 11.0466 10.1289Z">');const Jl=e=>{const t=ao();return n=Ql(),r=n.firstChild,In(o=>{var i=e.class,a=e.fill||t.colors.icon.primary;return i!==o.e&&Lr(n,"class",o.e=i),a!==o.t&&Lr(r,"fill",o.t=a),o},{e:void 0,t:void 0}),n;var n,r};var Xl=Ar('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8.7624 3.10001C7.95435 3.1 7.29349 3.09999 6.75642 3.14387C6.2005 3.18929 5.69842 3.28617 5.22954 3.52508C4.4957 3.89899 3.89908 4.49561 3.52517 5.22944C3.28626 5.69833 3.18938 6.20041 3.14396 6.75632C3.10008 7.2934 3.10009 7.95424 3.1001 8.76229V15.2377C3.10009 16.0458 3.10008 16.7066 3.14396 17.2437C3.18938 17.7996 3.28626 18.3017 3.52517 18.7706C3.89908 19.5044 4.4957 20.101 5.22954 20.4749C5.69842 20.7138 6.2005 20.8107 6.75642 20.8561C7.29349 20.9 7.95434 20.9 8.76239 20.9H12.0001C12.4972 20.9 12.9001 20.4971 12.9001 20C12.9001 19.503 12.4972 19.1 12.0001 19.1H8.8001C7.94517 19.1 7.3581 19.0993 6.90299 19.0621C6.45839 19.0258 6.21956 18.9592 6.04672 18.8711C5.65158 18.6698 5.33032 18.3485 5.12898 17.9534C5.04092 17.7805 4.97431 17.5417 4.93798 17.0971C4.9008 16.642 4.9001 16.0549 4.9001 15.2V8.80001C4.9001 7.94508 4.9008 7.35801 4.93798 6.9029C4.97431 6.4583 5.04092 6.21947 5.12898 6.04663C5.33032 5.65149 5.65158 5.33023 6.04672 5.12889C6.21956 5.04082 6.45839 4.97422 6.90299 4.93789C7.3581 4.90071 7.94517 4.90001 8.8001 4.90001H12.0001C12.4972 4.90001 12.9001 4.49706 12.9001 4.00001C12.9001 3.50295 12.4972 3.10001 12.0001 3.10001H8.7624Z"></path><path d="M17.6364 7.3636C17.2849 7.01212 16.7151 7.01212 16.3636 7.3636C16.0121 7.71507 16.0121 8.28492 16.3636 8.63639L18.8272 11.1H9.00001C8.50295 11.1 8.10001 11.5029 8.10001 12C8.10001 12.497 8.50295 12.9 9.00001 12.9H18.8272L16.3636 15.3636C16.0121 15.7151 16.0121 16.2849 16.3636 16.6364C16.7151 16.9879 17.2849 16.9879 17.6364 16.6364L21.6364 12.6364C21.9879 12.2849 21.9879 11.7151 21.6364 11.3636L17.6364 7.3636Z">');const ec=e=>{const t=ao(),n=()=>e.fill||t.colors.icon.primary;return r=Xl(),o=r.firstChild,i=o.nextSibling,In(e=>{var t=n(),r=n();return t!==e.e&&Lr(o,"fill",e.e=t),r!==e.t&&Lr(i,"fill",e.t=r),e},{e:void 0,t:void 0}),r;var r,o,i},tc={m:"8px",s:"4px",none:"0"},nc={m:"16px",s:"8px",none:"0"},rc=lo.div`
|
|
@@ -571,7 +571,7 @@
|
|
|
571
571
|
`,uc=lo(xs)`
|
|
572
572
|
margin-top: 4px;
|
|
573
573
|
color: ${e=>e.theme.colors.text.secondary};
|
|
574
|
-
`,hc=e=>{const t=ia(e);return ur(cc,mr({get class(){return e.class},"data-tc-notification":"true"},t,{get children(){return[ur(dc,{get children(){return[ur(
|
|
574
|
+
`,hc=e=>{const t=ia(e);return ur(cc,mr({get class(){return e.class},"data-tc-notification":"true"},t,{get children(){return[ur(dc,{get children(){return[ur(qs,{get translationKey(){return e.header.translationKey},get translationValues(){return e.header.translationValues},get children(){return e.children}}),ur(br,{get when(){return e.text},get children(){return ur(uc,{get translationKey(){return e.text.translationKey},get translationValues(){return e.text.translationValues}})}})]}}),Or(()=>e.icon)]}}))},pc=lo(tl)`
|
|
575
575
|
align-self: center;
|
|
576
576
|
`,gc=e=>{const t=Vn(Yl),[n]=bs();return ur(hc,{get header(){return{translationKey:"notifications.confirm.header",translationValues:{name:t.wallet&&"name"in t.wallet?t.wallet.name:n("common.yourWallet",{},"Your wallet")}}},get class(){return e.class},get icon(){return ur(pc,{})},"data-tc-notification-confirm":"true",children:"Confirm operation in your wallet"})},fc=lo(Qs)`
|
|
577
577
|
margin-top: 2px;
|
|
@@ -624,7 +624,7 @@
|
|
|
624
624
|
> div:first-child {
|
|
625
625
|
margin-top: 20px;
|
|
626
626
|
}
|
|
627
|
-
`,Nc=Math.min,Wc=Math.max,Pc=Math.round,Uc=Math.floor,Dc=e=>({x:e,y:e}),jc={left:"right",right:"left",bottom:"top",top:"bottom"},Bc={start:"end",end:"start"};function $c(e,t,n){return Wc(e,Nc(t,n))}function qc(e,t){return"function"==typeof e?e(t):e}function Kc(e){return e.split("-")[0]}function Fc(e){return e.split("-")[1]}function Hc(e){return"x"===e?"y":"x"}function Vc(e){return"y"===e?"height":"width"}const zc=new Set(["top","bottom"]);function Zc(e){return zc.has(Kc(e))?"y":"x"}function Gc(e){return Hc(Zc(e))}function Yc(e){return e.replace(/start|end/g,e=>Bc[e])}const Qc=["left","right"],Jc=["right","left"],Xc=["top","bottom"],ed=["bottom","top"];function td(e,t,n,r){const o=Fc(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Jc:Qc:t?Qc:Jc;case"left":case"right":return t?Xc:ed;default:return[]}}(Kc(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(Yc)))),i}function nd(e){return e.replace(/left|right|bottom|top/g,e=>jc[e])}function rd(e){return"number"!=typeof e?function(e){return m({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}function od(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function id(e,t,n){let{reference:r,floating:o}=e;const i=Zc(t),a=Gc(t),s=Vc(a),l=Kc(t),c="y"===i,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,h=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(Fc(t)){case"start":p[a]-=h*(n&&c?-1:1);break;case"end":p[a]+=h*(n&&c?-1:1)}return p}function ad(e,t){return y(this,null,function*(){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=qc(t,e),g=rd(p),f=s[h?"floating"===u?"reference":"floating":u],m=od(yield i.getClippingRect({element:null==(n=yield null==i.isElement?void 0:i.isElement(f))||n?f:f.contextElement||(yield null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),w="floating"===u?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,v=yield null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating),y=(yield null==i.isElement?void 0:i.isElement(v))&&(yield null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},b=od(i.convertOffsetParentRelativeRectToViewportRelativeRect?yield i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:v,strategy:l}):w);return{top:(m.top-b.top+g.top)/y.y,bottom:(b.bottom-m.bottom+g.bottom)/y.y,left:(m.left-b.left+g.left)/y.x,right:(b.right-m.right+g.right)/y.x}})}function sd(){return"undefined"!=typeof window}function ld(e){return ud(e)?(e.nodeName||"").toLowerCase():"#document"}function cd(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function dd(e){var t;return null==(t=(ud(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ud(e){return!!sd()&&(e instanceof Node||e instanceof cd(e).Node)}function hd(e){return!!sd()&&(e instanceof Element||e instanceof cd(e).Element)}function pd(e){return!!sd()&&(e instanceof HTMLElement||e instanceof cd(e).HTMLElement)}function gd(e){return!(!sd()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof cd(e).ShadowRoot)}const fd=new Set(["inline","contents"]);function md(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Td(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!fd.has(o)}const wd=new Set(["table","td","th"]);function vd(e){return wd.has(ld(e))}const yd=[":popover-open",":modal"];function bd(e){return yd.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const Cd=["transform","translate","scale","rotate","perspective"],xd=["transform","translate","scale","rotate","perspective","filter"],Sd=["paint","layout","strict","content"];function kd(e){const t=_d(),n=hd(e)?Td(e):e;return Cd.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||xd.some(e=>(n.willChange||"").includes(e))||Sd.some(e=>(n.contain||"").includes(e))}function _d(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Ed=new Set(["html","body","#document"]);function Rd(e){return Ed.has(ld(e))}function Td(e){return cd(e).getComputedStyle(e)}function Id(e){return hd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Od(e){if("html"===ld(e))return e;const t=e.assignedSlot||e.parentNode||gd(e)&&e.host||dd(e);return gd(t)?t.host:t}function Md(e){const t=Od(e);return Rd(t)?e.ownerDocument?e.ownerDocument.body:e.body:pd(t)&&md(t)?t:Md(t)}function Ad(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Md(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=cd(o);if(i){const e=Ld(a);return t.concat(a,a.visualViewport||[],md(o)?o:[],e&&n?Ad(e):[])}return t.concat(o,Ad(o,[],n))}function Ld(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nd(e){const t=Td(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=pd(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Pc(n)!==i||Pc(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Wd(e){return hd(e)?e:e.contextElement}function Pd(e){const t=Wd(e);if(!pd(t))return Dc(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Nd(t);let a=(i?Pc(n.width):n.width)/r,s=(i?Pc(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Ud=Dc(0);function Dd(e){const t=cd(e);return _d()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ud}function jd(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Wd(e);let a=Dc(1);t&&(r?hd(r)&&(a=Pd(r)):a=Pd(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==cd(e))&&t}(i,n,r)?Dd(i):Dc(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,d=o.width/a.x,u=o.height/a.y;if(i){const e=cd(i),t=r&&hd(r)?cd(r):r;let n=e,o=Ld(n);for(;o&&r&&t!==n;){const e=Pd(o),t=o.getBoundingClientRect(),r=Td(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=i,c+=a,n=cd(o),o=Ld(n)}}return od({width:d,height:u,x:l,y:c})}function Bd(e,t){const n=Id(e).scrollLeft;return t?t.left+n:jd(dd(e)).left+n}function $d(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Bd(e,r)),y:r.top+t.scrollTop}}const qd=new Set(["absolute","fixed"]);function Kd(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=cd(e),r=dd(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=_d();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=dd(e),n=Id(e),r=e.ownerDocument.body,o=Wc(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Wc(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Bd(e);const s=-n.scrollTop;return"rtl"===Td(r).direction&&(a+=Wc(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(dd(e));else if(hd(t))r=function(e,t){const n=jd(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=pd(e)?Pd(e):Dc(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Dd(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return od(r)}function Fd(e,t){const n=Od(e);return!(n===t||!hd(n)||Rd(n))&&("fixed"===Td(n).position||Fd(n,t))}function Hd(e,t,n){const r=pd(t),o=dd(t),i="fixed"===n,a=jd(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Dc(0);function c(){l.x=Bd(o)}if(r||!r&&!i)if(("body"!==ld(t)||md(o))&&(s=Id(t)),r){const e=jd(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const d=!o||r||i?Dc(0):$d(o,s);return{x:a.left+s.scrollLeft-l.x-d.x,y:a.top+s.scrollTop-l.y-d.y,width:a.width,height:a.height}}function Vd(e){return"static"===Td(e).position}function zd(e,t){if(!pd(e)||"fixed"===Td(e).position)return null;if(t)return t(e);let n=e.offsetParent;return dd(e)===n&&(n=n.ownerDocument.body),n}function Zd(e,t){const n=cd(e);if(bd(e))return n;if(!pd(e)){let t=Od(e);for(;t&&!Rd(t);){if(hd(t)&&!Vd(t))return t;t=Od(t)}return n}let r=zd(e,t);for(;r&&vd(r)&&Vd(r);)r=zd(r,t);return r&&Rd(r)&&Vd(r)&&!kd(r)?n:r||function(e){let t=Od(e);for(;pd(t)&&!Rd(t);){if(kd(t))return t;if(bd(t))return null;t=Od(t)}return null}(e)||n}const Gd={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=dd(r),s=!!t&&bd(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Dc(1);const d=Dc(0),u=pd(r);if((u||!u&&!i)&&(("body"!==ld(r)||md(a))&&(l=Id(r)),pd(r))){const e=jd(r);c=Pd(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const h=!a||u||i?Dc(0):$d(a,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}},getDocumentElement:dd,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?bd(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Ad(e,[],!1).filter(e=>hd(e)&&"body"!==ld(e)),o=null;const i="fixed"===Td(e).position;let a=i?Od(e):e;for(;hd(a)&&!Rd(a);){const t=Td(a),n=kd(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&qd.has(o.position)||md(a)&&!n&&Fd(e,a))?r=r.filter(e=>e!==a):o=t,a=Od(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce((e,n)=>{const r=Kd(t,n,o);return e.top=Wc(r.top,e.top),e.right=Nc(r.right,e.right),e.bottom=Nc(r.bottom,e.bottom),e.left=Wc(r.left,e.left),e},Kd(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Zd,getElementRects:function(e){return y(this,null,function*(){const t=this.getOffsetParent||Zd,n=this.getDimensions,r=yield n(e.floating);return{reference:Hd(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Nd(e);return{width:t,height:n}},getScale:Pd,isElement:hd,isRTL:function(e){return"rtl"===Td(e).direction}};function Yd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Qd(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Wd(e),d=o||i?[...c?Ad(c):[],...Ad(t)]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const u=c&&s?function(e,t){let n,r=null;const o=dd(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:u,width:h,height:p}=c;if(s||t(),!h||!p)return;const g={rootMargin:-Uc(u)+"px "+-Uc(o.clientWidth-(d+h))+"px "+-Uc(o.clientHeight-(u+p))+"px "+-Uc(d)+"px",threshold:Wc(0,Nc(1,l))||1};let f=!0;function v(t){const r=t[0].intersectionRatio;if(r!==l){if(!f)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||Yd(c,e.getBoundingClientRect())||a(),f=!1}try{r=new IntersectionObserver(v,w(m({},g),{root:o.ownerDocument}))}catch(y){r=new IntersectionObserver(v,g)}r.observe(e)}(!0),i}(c,n):null;let h,p=-1,g=null;a&&(g=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=g)||e.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let f=l?jd(e):null;return l&&function t(){const r=jd(e);f&&!Yd(f,r)&&n();f=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=g)||e.disconnect(),g=null,l&&cancelAnimationFrame(h)}}const Jd=function(e){return void 0===e&&(e={}),{name:"shift",options:e,fn(t){return y(this,null,function*(){const{x:n,y:r,placement:o}=t,i=qc(e,t),{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}}}=i,c=v(i,["mainAxis","crossAxis","limiter"]),d={x:n,y:r},u=yield ad(t,c),h=Zc(Kc(o)),p=Hc(h);let g=d[p],f=d[h];if(a){const e="y"===p?"bottom":"right";g=$c(g+u["y"===p?"top":"left"],g,g-u[e])}if(s){const e="y"===h?"bottom":"right";f=$c(f+u["y"===h?"top":"left"],f,f-u[e])}const y=l.fn(w(m({},t),{[p]:g,[h]:f}));return w(m({},y),{data:{x:y.x-n,y:y.y-r,enabled:{[p]:a,[h]:s}}})})}}},Xd=function(e){return void 0===e&&(e={}),{name:"flip",options:e,fn(t){return y(this,null,function*(){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,d=qc(e,t),{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0}=d,w=v(d,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=Kc(o),b=Zc(s),C=Kc(s)===s,x=yield null==l.isRTL?void 0:l.isRTL(c.floating),S=p||(C||!m?[nd(s)]:function(e){const t=nd(e);return[Yc(e),t,Yc(t)]}(s)),k="none"!==f;!p&&k&&S.push(...td(s,m,f,x));const _=[s,...S],E=yield ad(t,w),R=[];let T=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&R.push(E[y]),h){const e=function(e,t,n){void 0===n&&(n=!1);const r=Fc(e),o=Gc(e),i=Vc(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=nd(a)),[a,nd(a)]}(o,a,x);R.push(E[e[0]],E[e[1]])}if(T=[...T,{placement:o,overflows:R}],!R.every(e=>e<=0)){var I,O;const e=((null==(I=i.flip)?void 0:I.index)||0)+1,t=_[e];if(t){if(!("alignment"===h&&b!==Zc(t))||T.every(e=>Zc(e.placement)!==b||e.overflows[0]>0))return{data:{index:e,overflows:T},reset:{placement:t}}}let n=null==(O=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:O.placement;if(!n)switch(g){case"bestFit":{var M;const e=null==(M=T.filter(e=>{if(k){const t=Zc(e.placement);return t===b||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:M[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}})}}},eu=(e,t,n)=>{const r=new Map,o=m({platform:Gd},n),i=w(m({},o.platform),{_c:r});return((e,t,n)=>y(null,null,function*(){const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=yield null==a.isRTL?void 0:a.isRTL(t);let c=yield a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=id(c,r,l),h=r,p={},g=0;for(let n=0;n<s.length;n++){const{name:i,fn:f}=s[n],{x:v,y:y,data:b,reset:C}=yield f({x:d,y:u,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});d=null!=v?v:d,u=null!=y?y:u,p=w(m({},p),{[i]:m(m({},p[i]),b)}),C&&g<=50&&(g++,"object"==typeof C&&(C.placement&&(h=C.placement),C.rects&&(c=!0===C.rects?yield a.getElementRects({reference:e,floating:t,strategy:o}):C.rects),({x:d,y:u}=id(c,h,l))),n=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:p}}))(e,t,w(m({},o),{platform:i}))};var tu=Ar("<tc-root data-tc-dropdown-container=true>",!0,!1,!1);const nu=()=>{const t=ao(),n=Vn(ai),r=Vn(Yl),[o,i]=Rn(!1),[a,s]=Rn(n.account),[l,c]=Rn(!n.account);let d;const[u,h]=Rn(),[p,g]=Rn(),f=function(e,t,n){let r=()=>{var e;return null!=(e=null==n?void 0:n.placement)?e:"bottom"},o=()=>{var e;return null!=(e=null==n?void 0:n.strategy)?e:"absolute"},[i,a]=Rn({x:null,y:null,placement:r(),strategy:o(),middlewareData:{}}),[s,l]=Rn();On(()=>{let e=s();if(e)throw e.value});let c=Mn(()=>(e(),t(),{}));function d(){let i=e(),s=t();if(i&&s){let e=c();eu(i,s,{middleware:null==n?void 0:n.middleware,placement:r(),strategy:o()}).then(t=>{e===c()&&a(t)},e=>{l(e)})}}return On(()=>{let i=e(),a=t();if(r(),o(),i&&a)if(null!=n&&n.whileElementsMounted){let e=n.whileElementsMounted(i,a,d);e&&Un(e)}else d()}),{get x(){return i().x},get y(){return i().y},get placement(){return i().placement},get strategy(){return i().strategy},get middlewareData(){return i().middlewareData},update:d}}(p,u,{whileElementsMounted:Qd,placement:"bottom-end",middleware:[Xd(),Jd()]});r.connectionRestored.then(()=>c(!1));const m=n.onStatusChange(e=>{if(!e)return i(!1),s(null),void c(!1);s(e.account),c(!1)}),w=e=>{if(!a()||!o())return;const t=p().contains(e.target),n=d.contains(e.target);t||n||i(!1)};return Pn(()=>{document.body.addEventListener("click",w)}),Un(()=>{document.body.removeEventListener("click",w),m()}),ur(zr,{component:uo,get children(){return[ur(br,{get when(){return l()},get children(){return ur(Ic,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return ur(Oc,{})}})}}),ur(br,{get when(){return!l()},get children(){return[ur(br,{get when(){return!a()},get children(){return ur(Rc,{onClick:()=>r.openModal(),"data-tc-connect-button":"true",scale:"s",get children(){return[ur(Ks,{get fill(){return t.colors.connectButton.foreground}}),ur(xs,{translationKey:"button.connectWallet",fontSize:"15px",lineHeight:"18px",fontWeight:"590",get color(){return t.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),ur(br,{get when(){return a()},get children(){return ur(Mc,{get children(){return[ur(Tc,{onClick:()=>i(e=>!e),ref:g,"data-tc-dropdown-button":"true",scale:"s",get children(){return[ur(xs,{fontSize:"15px",fontWeight:"590",lineHeight:"18px",get children(){return(()=>{const t=a();if(t){const n=Mt(t.address,t.chain===e.CHAIN.TESTNET);return n.slice(0,4)+"…"+n.slice(-4)}return""})()}}),ur(Ia,{direction:"bottom"})]}}),ur(Vr,{get children(){var e=tu();return Pr(h,e),e.style.setProperty("z-index","999"),e._$owner=jn(),Ur(e,ur(Sa,{onBeforeEnter:e=>{Fa(e,[{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(e,t)=>{Fa(e,[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(t)},get children(){return ur(br,{get when(){return o()},get children(){return ur(Ac,{get hidden(){return!o()},onClose:()=>i(!1),ref(e){"function"==typeof d?d(e):d=e}})}})}}),null),Ur(e,ur(Lc,{}),null),In(t=>{var n,r,o=f.strategy,i=`${null!=(n=f.y)?n:0}px`,a=`${null!=(r=f.x)?r:0}px`;return o!==t.e&&(null!=(t.e=o)?e.style.setProperty("position",o):e.style.removeProperty("position")),i!==t.t&&(null!=(t.t=i)?e.style.setProperty("top",i):e.style.removeProperty("top")),a!==t.a&&(null!=(t.a=a)?e.style.setProperty("left",a):e.style.removeProperty("left")),t},{e:void 0,t:void 0,a:void 0}),e}})]}})}})]}})]}})},ru=lo(Ga)`
|
|
627
|
+
`,Nc=Math.min,Wc=Math.max,Pc=Math.round,Uc=Math.floor,Dc=e=>({x:e,y:e}),jc={left:"right",right:"left",bottom:"top",top:"bottom"},Bc={start:"end",end:"start"};function qc(e,t,n){return Wc(e,Nc(t,n))}function $c(e,t){return"function"==typeof e?e(t):e}function Kc(e){return e.split("-")[0]}function Fc(e){return e.split("-")[1]}function Hc(e){return"x"===e?"y":"x"}function Vc(e){return"y"===e?"height":"width"}const zc=new Set(["top","bottom"]);function Zc(e){return zc.has(Kc(e))?"y":"x"}function Gc(e){return Hc(Zc(e))}function Yc(e){return e.replace(/start|end/g,e=>Bc[e])}const Qc=["left","right"],Jc=["right","left"],Xc=["top","bottom"],ed=["bottom","top"];function td(e,t,n,r){const o=Fc(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Jc:Qc:t?Qc:Jc;case"left":case"right":return t?Xc:ed;default:return[]}}(Kc(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(Yc)))),i}function nd(e){return e.replace(/left|right|bottom|top/g,e=>jc[e])}function rd(e){return"number"!=typeof e?function(e){return m({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}function od(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function id(e,t,n){let{reference:r,floating:o}=e;const i=Zc(t),a=Gc(t),s=Vc(a),l=Kc(t),c="y"===i,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,h=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(Fc(t)){case"start":p[a]-=h*(n&&c?-1:1);break;case"end":p[a]+=h*(n&&c?-1:1)}return p}function ad(e,t){return y(this,null,function*(){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=$c(t,e),g=rd(p),f=s[h?"floating"===u?"reference":"floating":u],m=od(yield i.getClippingRect({element:null==(n=yield null==i.isElement?void 0:i.isElement(f))||n?f:f.contextElement||(yield null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),w="floating"===u?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,v=yield null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating),y=(yield null==i.isElement?void 0:i.isElement(v))&&(yield null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},b=od(i.convertOffsetParentRelativeRectToViewportRelativeRect?yield i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:v,strategy:l}):w);return{top:(m.top-b.top+g.top)/y.y,bottom:(b.bottom-m.bottom+g.bottom)/y.y,left:(m.left-b.left+g.left)/y.x,right:(b.right-m.right+g.right)/y.x}})}function sd(){return"undefined"!=typeof window}function ld(e){return ud(e)?(e.nodeName||"").toLowerCase():"#document"}function cd(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function dd(e){var t;return null==(t=(ud(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ud(e){return!!sd()&&(e instanceof Node||e instanceof cd(e).Node)}function hd(e){return!!sd()&&(e instanceof Element||e instanceof cd(e).Element)}function pd(e){return!!sd()&&(e instanceof HTMLElement||e instanceof cd(e).HTMLElement)}function gd(e){return!(!sd()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof cd(e).ShadowRoot)}const fd=new Set(["inline","contents"]);function md(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Td(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!fd.has(o)}const wd=new Set(["table","td","th"]);function vd(e){return wd.has(ld(e))}const yd=[":popover-open",":modal"];function bd(e){return yd.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const Cd=["transform","translate","scale","rotate","perspective"],xd=["transform","translate","scale","rotate","perspective","filter"],Sd=["paint","layout","strict","content"];function kd(e){const t=_d(),n=hd(e)?Td(e):e;return Cd.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||xd.some(e=>(n.willChange||"").includes(e))||Sd.some(e=>(n.contain||"").includes(e))}function _d(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Ed=new Set(["html","body","#document"]);function Rd(e){return Ed.has(ld(e))}function Td(e){return cd(e).getComputedStyle(e)}function Id(e){return hd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Od(e){if("html"===ld(e))return e;const t=e.assignedSlot||e.parentNode||gd(e)&&e.host||dd(e);return gd(t)?t.host:t}function Md(e){const t=Od(e);return Rd(t)?e.ownerDocument?e.ownerDocument.body:e.body:pd(t)&&md(t)?t:Md(t)}function Ad(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Md(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=cd(o);if(i){const e=Ld(a);return t.concat(a,a.visualViewport||[],md(o)?o:[],e&&n?Ad(e):[])}return t.concat(o,Ad(o,[],n))}function Ld(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nd(e){const t=Td(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=pd(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Pc(n)!==i||Pc(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Wd(e){return hd(e)?e:e.contextElement}function Pd(e){const t=Wd(e);if(!pd(t))return Dc(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Nd(t);let a=(i?Pc(n.width):n.width)/r,s=(i?Pc(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Ud=Dc(0);function Dd(e){const t=cd(e);return _d()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ud}function jd(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Wd(e);let a=Dc(1);t&&(r?hd(r)&&(a=Pd(r)):a=Pd(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==cd(e))&&t}(i,n,r)?Dd(i):Dc(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,d=o.width/a.x,u=o.height/a.y;if(i){const e=cd(i),t=r&&hd(r)?cd(r):r;let n=e,o=Ld(n);for(;o&&r&&t!==n;){const e=Pd(o),t=o.getBoundingClientRect(),r=Td(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=i,c+=a,n=cd(o),o=Ld(n)}}return od({width:d,height:u,x:l,y:c})}function Bd(e,t){const n=Id(e).scrollLeft;return t?t.left+n:jd(dd(e)).left+n}function qd(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Bd(e,r)),y:r.top+t.scrollTop}}const $d=new Set(["absolute","fixed"]);function Kd(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=cd(e),r=dd(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=_d();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=dd(e),n=Id(e),r=e.ownerDocument.body,o=Wc(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Wc(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Bd(e);const s=-n.scrollTop;return"rtl"===Td(r).direction&&(a+=Wc(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(dd(e));else if(hd(t))r=function(e,t){const n=jd(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=pd(e)?Pd(e):Dc(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Dd(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return od(r)}function Fd(e,t){const n=Od(e);return!(n===t||!hd(n)||Rd(n))&&("fixed"===Td(n).position||Fd(n,t))}function Hd(e,t,n){const r=pd(t),o=dd(t),i="fixed"===n,a=jd(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Dc(0);function c(){l.x=Bd(o)}if(r||!r&&!i)if(("body"!==ld(t)||md(o))&&(s=Id(t)),r){const e=jd(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const d=!o||r||i?Dc(0):qd(o,s);return{x:a.left+s.scrollLeft-l.x-d.x,y:a.top+s.scrollTop-l.y-d.y,width:a.width,height:a.height}}function Vd(e){return"static"===Td(e).position}function zd(e,t){if(!pd(e)||"fixed"===Td(e).position)return null;if(t)return t(e);let n=e.offsetParent;return dd(e)===n&&(n=n.ownerDocument.body),n}function Zd(e,t){const n=cd(e);if(bd(e))return n;if(!pd(e)){let t=Od(e);for(;t&&!Rd(t);){if(hd(t)&&!Vd(t))return t;t=Od(t)}return n}let r=zd(e,t);for(;r&&vd(r)&&Vd(r);)r=zd(r,t);return r&&Rd(r)&&Vd(r)&&!kd(r)?n:r||function(e){let t=Od(e);for(;pd(t)&&!Rd(t);){if(kd(t))return t;if(bd(t))return null;t=Od(t)}return null}(e)||n}const Gd={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=dd(r),s=!!t&&bd(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Dc(1);const d=Dc(0),u=pd(r);if((u||!u&&!i)&&(("body"!==ld(r)||md(a))&&(l=Id(r)),pd(r))){const e=jd(r);c=Pd(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const h=!a||u||i?Dc(0):qd(a,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}},getDocumentElement:dd,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?bd(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Ad(e,[],!1).filter(e=>hd(e)&&"body"!==ld(e)),o=null;const i="fixed"===Td(e).position;let a=i?Od(e):e;for(;hd(a)&&!Rd(a);){const t=Td(a),n=kd(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&$d.has(o.position)||md(a)&&!n&&Fd(e,a))?r=r.filter(e=>e!==a):o=t,a=Od(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce((e,n)=>{const r=Kd(t,n,o);return e.top=Wc(r.top,e.top),e.right=Nc(r.right,e.right),e.bottom=Nc(r.bottom,e.bottom),e.left=Wc(r.left,e.left),e},Kd(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Zd,getElementRects:function(e){return y(this,null,function*(){const t=this.getOffsetParent||Zd,n=this.getDimensions,r=yield n(e.floating);return{reference:Hd(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Nd(e);return{width:t,height:n}},getScale:Pd,isElement:hd,isRTL:function(e){return"rtl"===Td(e).direction}};function Yd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Qd(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Wd(e),d=o||i?[...c?Ad(c):[],...Ad(t)]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const u=c&&s?function(e,t){let n,r=null;const o=dd(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:u,width:h,height:p}=c;if(s||t(),!h||!p)return;const g={rootMargin:-Uc(u)+"px "+-Uc(o.clientWidth-(d+h))+"px "+-Uc(o.clientHeight-(u+p))+"px "+-Uc(d)+"px",threshold:Wc(0,Nc(1,l))||1};let f=!0;function v(t){const r=t[0].intersectionRatio;if(r!==l){if(!f)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||Yd(c,e.getBoundingClientRect())||a(),f=!1}try{r=new IntersectionObserver(v,w(m({},g),{root:o.ownerDocument}))}catch(y){r=new IntersectionObserver(v,g)}r.observe(e)}(!0),i}(c,n):null;let h,p=-1,g=null;a&&(g=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=g)||e.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let f=l?jd(e):null;return l&&function t(){const r=jd(e);f&&!Yd(f,r)&&n();f=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=g)||e.disconnect(),g=null,l&&cancelAnimationFrame(h)}}const Jd=function(e){return void 0===e&&(e={}),{name:"shift",options:e,fn(t){return y(this,null,function*(){const{x:n,y:r,placement:o}=t,i=$c(e,t),{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}}}=i,c=v(i,["mainAxis","crossAxis","limiter"]),d={x:n,y:r},u=yield ad(t,c),h=Zc(Kc(o)),p=Hc(h);let g=d[p],f=d[h];if(a){const e="y"===p?"bottom":"right";g=qc(g+u["y"===p?"top":"left"],g,g-u[e])}if(s){const e="y"===h?"bottom":"right";f=qc(f+u["y"===h?"top":"left"],f,f-u[e])}const y=l.fn(w(m({},t),{[p]:g,[h]:f}));return w(m({},y),{data:{x:y.x-n,y:y.y-r,enabled:{[p]:a,[h]:s}}})})}}},Xd=function(e){return void 0===e&&(e={}),{name:"flip",options:e,fn(t){return y(this,null,function*(){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,d=$c(e,t),{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0}=d,w=v(d,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=Kc(o),b=Zc(s),C=Kc(s)===s,x=yield null==l.isRTL?void 0:l.isRTL(c.floating),S=p||(C||!m?[nd(s)]:function(e){const t=nd(e);return[Yc(e),t,Yc(t)]}(s)),k="none"!==f;!p&&k&&S.push(...td(s,m,f,x));const _=[s,...S],E=yield ad(t,w),R=[];let T=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&R.push(E[y]),h){const e=function(e,t,n){void 0===n&&(n=!1);const r=Fc(e),o=Gc(e),i=Vc(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=nd(a)),[a,nd(a)]}(o,a,x);R.push(E[e[0]],E[e[1]])}if(T=[...T,{placement:o,overflows:R}],!R.every(e=>e<=0)){var I,O;const e=((null==(I=i.flip)?void 0:I.index)||0)+1,t=_[e];if(t){if(!("alignment"===h&&b!==Zc(t))||T.every(e=>Zc(e.placement)!==b||e.overflows[0]>0))return{data:{index:e,overflows:T},reset:{placement:t}}}let n=null==(O=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:O.placement;if(!n)switch(g){case"bestFit":{var M;const e=null==(M=T.filter(e=>{if(k){const t=Zc(e.placement);return t===b||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:M[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}})}}},eu=(e,t,n)=>{const r=new Map,o=m({platform:Gd},n),i=w(m({},o.platform),{_c:r});return((e,t,n)=>y(null,null,function*(){const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=yield null==a.isRTL?void 0:a.isRTL(t);let c=yield a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=id(c,r,l),h=r,p={},g=0;for(let n=0;n<s.length;n++){const{name:i,fn:f}=s[n],{x:v,y:y,data:b,reset:C}=yield f({x:d,y:u,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});d=null!=v?v:d,u=null!=y?y:u,p=w(m({},p),{[i]:m(m({},p[i]),b)}),C&&g<=50&&(g++,"object"==typeof C&&(C.placement&&(h=C.placement),C.rects&&(c=!0===C.rects?yield a.getElementRects({reference:e,floating:t,strategy:o}):C.rects),({x:d,y:u}=id(c,h,l))),n=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:p}}))(e,t,w(m({},o),{platform:i}))};var tu=Ar("<tc-root data-tc-dropdown-container=true>",!0,!1,!1);const nu=()=>{const t=ao(),n=Vn(ai),r=Vn(Yl),[o,i]=Rn(!1),[a,s]=Rn(n.account),[l,c]=Rn(!n.account);let d;const[u,h]=Rn(),[p,g]=Rn(),f=function(e,t,n){let r=()=>{var e;return null!=(e=null==n?void 0:n.placement)?e:"bottom"},o=()=>{var e;return null!=(e=null==n?void 0:n.strategy)?e:"absolute"},[i,a]=Rn({x:null,y:null,placement:r(),strategy:o(),middlewareData:{}}),[s,l]=Rn();On(()=>{let e=s();if(e)throw e.value});let c=Mn(()=>(e(),t(),{}));function d(){let i=e(),s=t();if(i&&s){let e=c();eu(i,s,{middleware:null==n?void 0:n.middleware,placement:r(),strategy:o()}).then(t=>{e===c()&&a(t)},e=>{l(e)})}}return On(()=>{let i=e(),a=t();if(r(),o(),i&&a)if(null!=n&&n.whileElementsMounted){let e=n.whileElementsMounted(i,a,d);e&&Un(e)}else d()}),{get x(){return i().x},get y(){return i().y},get placement(){return i().placement},get strategy(){return i().strategy},get middlewareData(){return i().middlewareData},update:d}}(p,u,{whileElementsMounted:Qd,placement:"bottom-end",middleware:[Xd(),Jd()]});r.connectionRestored.then(()=>c(!1));const m=n.onStatusChange(e=>{if(!e)return i(!1),s(null),void c(!1);s(e.account),c(!1)}),w=e=>{if(!a()||!o())return;const t=p().contains(e.target),n=d.contains(e.target);t||n||i(!1)};return Pn(()=>{document.body.addEventListener("click",w)}),Un(()=>{document.body.removeEventListener("click",w),m()}),ur(zr,{component:uo,get children(){return[ur(br,{get when(){return l()},get children(){return ur(Ic,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return ur(Oc,{})}})}}),ur(br,{get when(){return!l()},get children(){return[ur(br,{get when(){return!a()},get children(){return ur(Rc,{onClick:()=>r.openModal(),"data-tc-connect-button":"true",scale:"s",get children(){return[ur(Ks,{get fill(){return t.colors.connectButton.foreground}}),ur(xs,{translationKey:"button.connectWallet",fontSize:"15px",lineHeight:"18px",fontWeight:"590",get color(){return t.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),ur(br,{get when(){return a()},get children(){return ur(Mc,{get children(){return[ur(Tc,{onClick:()=>i(e=>!e),ref:g,"data-tc-dropdown-button":"true",scale:"s",get children(){return[ur(xs,{fontSize:"15px",fontWeight:"590",lineHeight:"18px",get children(){return(()=>{const t=a();if(t){const n=Mt(t.address,t.chain===e.CHAIN.TESTNET);return n.slice(0,4)+"…"+n.slice(-4)}return""})()}}),ur(Ia,{direction:"bottom"})]}}),ur(Vr,{get children(){var e=tu();return Pr(h,e),e.style.setProperty("z-index","999"),e._$owner=jn(),Ur(e,ur(Sa,{onBeforeEnter:e=>{Fa(e,[{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(e,t)=>{Fa(e,[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(t)},get children(){return ur(br,{get when(){return o()},get children(){return ur(Ac,{get hidden(){return!o()},onClose:()=>i(!1),ref(e){"function"==typeof d?d(e):d=e}})}})}}),null),Ur(e,ur(Lc,{}),null),In(t=>{var n,r,o=f.strategy,i=`${null!=(n=f.y)?n:0}px`,a=`${null!=(r=f.x)?r:0}px`;return o!==t.e&&(null!=(t.e=o)?e.style.setProperty("position",o):e.style.removeProperty("position")),i!==t.t&&(null!=(t.t=i)?e.style.setProperty("top",i):e.style.removeProperty("top")),a!==t.a&&(null!=(t.a=a)?e.style.setProperty("left",a):e.style.removeProperty("left")),t},{e:void 0,t:void 0,a:void 0}),e}})]}})}})]}})]}})},ru=lo(Ga)`
|
|
628
628
|
padding-left: 24px;
|
|
629
629
|
padding-right: 24px;
|
|
630
630
|
padding-top: 18px;
|
|
@@ -751,7 +751,7 @@
|
|
|
751
751
|
|
|
752
752
|
filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08));
|
|
753
753
|
background-color: ${e=>e.theme.colors.background.segment};
|
|
754
|
-
`;var xu=Ar('<svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><g clip-path=url(#clip0_5122_10355)><circle cx=8 cy=8 r=8></circle><circle cx=8 cy=11 r=1></circle><path d="M7.04994 4.99875C7.02277 4.45542 7.45598 4 8 4C8.54402 4 8.97723 4.45541 8.95006 4.99875L8.78745 8.25094C8.76647 8.67055 8.42014 9 8 9C7.57986 9 7.23353 8.67055 7.21255 8.25094L7.04994 4.99875Z"></path></g><defs><clipPath id=clip0_5122_10355><rect width=16 height=16>'),Su=Ar('<svg xmlns=http://www.w3.org/2000/svg width=28 height=28 viewBox="0 0 28 28"fill=none><circle cx=14 cy=14 r=12></circle><circle cx=14 cy=18.9 r=1.4></circle><path d="M12.6658 8.89845C12.63 8.13698 13.2377 7.5 14 7.5C14.7623 7.5 15.37 8.13698 15.3342 8.89845L15.047 15.0013C15.0207 15.5604 14.5597 16.0002 14 16.0002C13.4403 16.0002 12.9793 15.5604 12.953 15.0013L12.6658 8.89845Z">');const ku=e=>{const t=ao(),n=()=>e.size,r=()=>e.fill||t.colors.icon.error;return Or(()=>{return Or(()=>"16"===n())()?(l=xu(),c=l.firstChild,d=c.firstChild,u=d.nextSibling,h=u.nextSibling,p=c.nextSibling.firstChild.firstChild,In(e=>{var n=r(),o=t.colors.constant.white,i=t.colors.constant.white,a=t.colors.constant.white;return n!==e.e&&Lr(d,"fill",e.e=n),o!==e.t&&Lr(u,"fill",e.t=o),i!==e.a&&Lr(h,"fill",e.a=i),a!==e.o&&Lr(p,"fill",e.o=a),e},{e:void 0,t:void 0,a:void 0,o:void 0}),l):Or(()=>"28"===n())()?(o=Su(),i=o.firstChild,a=i.nextSibling,s=a.nextSibling,In(n=>{var l=e.class,c=r(),d=t.colors.constant.white,u=t.colors.constant.white;return l!==n.e&&Lr(o,"class",n.e=l),c!==n.t&&Lr(i,"fill",n.t=c),d!==n.a&&Lr(a,"fill",n.a=d),u!==n.o&&Lr(s,"fill",n.o=u),n},{e:void 0,t:void 0,a:void 0,o:void 0}),o):null;var o,i,a,s,l,c,d,u,h,p})},_u="wallet_connect",Eu="WalletConnect";var Ru=Ar("<li>");const Tu=e=>{const t=au.connector,n=au.connectRequestParameters,r=()=>{t.connect({type:"wallet-connect"},"ready"===(null==n?void 0:n.state)?n.value:void 0)},[o,i]=Rn(null);let a=null;const s=t=>{t.isSupportRequiredFeatures||"strict"!==e.featureCheckMode?e.onSelect(t):(e=>{i(e),null!=a&&clearTimeout(a),a=setTimeout(()=>i(null),1500)})(t)},l=()=>Fl()?e.walletsList.filter(uu):e.walletsList,c=()=>l().filter(e=>e.isSupportRequiredFeatures);ei({walletsMenu:"other_wallets",wallets:c()});const d=()=>l().filter(e=>!e.isSupportRequiredFeatures);return ur(gu,{"data-tc-wallets-modal-list":"true",get children(){return[ur(wu,{icon:"arrow",onClick:()=>e.onBack()}),ur(fu,{translationKey:"walletModal.wallets",children:"Wallets"}),ur(zl,{get maxHeight(){return Fl()?void 0:510},get children(){return[ur(mu,{get children(){return[ur(yr,{get each(){return c()},children:t=>{return Ur(n=Ru(),ur(vu,{wallet:t,onClick:()=>e.onSelect(t)})),n;var n}}),ur(br,{get when(){return Or(()
|
|
754
|
+
`;var xu=Ar('<svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><g clip-path=url(#clip0_5122_10355)><circle cx=8 cy=8 r=8></circle><circle cx=8 cy=11 r=1></circle><path d="M7.04994 4.99875C7.02277 4.45542 7.45598 4 8 4C8.54402 4 8.97723 4.45541 8.95006 4.99875L8.78745 8.25094C8.76647 8.67055 8.42014 9 8 9C7.57986 9 7.23353 8.67055 7.21255 8.25094L7.04994 4.99875Z"></path></g><defs><clipPath id=clip0_5122_10355><rect width=16 height=16>'),Su=Ar('<svg xmlns=http://www.w3.org/2000/svg width=28 height=28 viewBox="0 0 28 28"fill=none><circle cx=14 cy=14 r=12></circle><circle cx=14 cy=18.9 r=1.4></circle><path d="M12.6658 8.89845C12.63 8.13698 13.2377 7.5 14 7.5C14.7623 7.5 15.37 8.13698 15.3342 8.89845L15.047 15.0013C15.0207 15.5604 14.5597 16.0002 14 16.0002C13.4403 16.0002 12.9793 15.5604 12.953 15.0013L12.6658 8.89845Z">');const ku=e=>{const t=ao(),n=()=>e.size,r=()=>e.fill||t.colors.icon.error;return Or(()=>{return Or(()=>"16"===n())()?(l=xu(),c=l.firstChild,d=c.firstChild,u=d.nextSibling,h=u.nextSibling,p=c.nextSibling.firstChild.firstChild,In(e=>{var n=r(),o=t.colors.constant.white,i=t.colors.constant.white,a=t.colors.constant.white;return n!==e.e&&Lr(d,"fill",e.e=n),o!==e.t&&Lr(u,"fill",e.t=o),i!==e.a&&Lr(h,"fill",e.a=i),a!==e.o&&Lr(p,"fill",e.o=a),e},{e:void 0,t:void 0,a:void 0,o:void 0}),l):Or(()=>"28"===n())()?(o=Su(),i=o.firstChild,a=i.nextSibling,s=a.nextSibling,In(n=>{var l=e.class,c=r(),d=t.colors.constant.white,u=t.colors.constant.white;return l!==n.e&&Lr(o,"class",n.e=l),c!==n.t&&Lr(i,"fill",n.t=c),d!==n.a&&Lr(a,"fill",n.a=d),u!==n.o&&Lr(s,"fill",n.o=u),n},{e:void 0,t:void 0,a:void 0,o:void 0}),o):null;var o,i,a,s,l,c,d,u,h,p})},_u="wallet_connect",Eu="WalletConnect";var Ru=Ar("<li>");const Tu=e=>{const t=au.connector,n=au.connectRequestParameters,r=()=>{t.connect({type:"wallet-connect"},"ready"===(null==n?void 0:n.state)?n.value:void 0)},[o,i]=Rn(null);let a=null;const s=t=>{t.isSupportRequiredFeatures||"strict"!==e.featureCheckMode?e.onSelect(t):(e=>{i(e),null!=a&&clearTimeout(a),a=setTimeout(()=>i(null),1500)})(t)},l=()=>Fl()?e.walletsList.filter(uu):e.walletsList,c=()=>l().filter(e=>e.isSupportRequiredFeatures);ei({walletsMenu:"other_wallets",wallets:c()});const d=()=>l().filter(e=>!e.isSupportRequiredFeatures);return ur(gu,{"data-tc-wallets-modal-list":"true",get children(){return[ur(wu,{icon:"arrow",onClick:()=>e.onBack()}),ur(fu,{translationKey:"walletModal.wallets",children:"Wallets"}),ur(zl,{get maxHeight(){return Fl()?void 0:510},get children(){return[ur(mu,{get children(){return[ur(yr,{get each(){return c()},children:t=>{return Ur(n=Ru(),ur(vu,{wallet:t,onClick:()=>e.onSelect(t)})),n;var n}}),ur(br,{get when(){return Or(()=>!$i())()&&sn()},get children(){return ur(vu,{get wallet(){return{type:"wallet-connect",name:Eu,appName:_u,imageUrl:Dl}},onClick:r})}})]}}),ur(br,{get when(){return d().length>0&&"hide"!==e.featureCheckMode},get children(){return[ur(yu,{get children(){return[ur(bu,{translationKey:"walletModal.allWallets.walletsBelowNotSupported",children:"The wallets below don’t support all features of the connected service. You can use your recovery phrase in one of the supported wallets above."}),ur(ku,{size:"28"})]}}),ur(mu,{get children(){return ur(yr,{get each(){return d()},children:t=>{return Ur(n=Ru(),ur(vu,{wallet:t,onClick:()=>s(t),get withOpacity(){return"strict"===e.featureCheckMode}})),n;var n}})}}),ur(Sa,{onBeforeEnter:e=>{Fa(e,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(e,t)=>{Fa(e,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then(()=>{t()})},get children(){return ur(br,{get when(){return o()},get children(){return ur(Cu,{get children(){return[ur(Qs,{size:"xs"}),ur(xs,{translationKey:"walletModal.allWallets.walletNotSupportService",get translationValues(){return{name:o().name}},get children(){return[Or(()=>o().name)," doesn’t support connected service"]}})]}})}})}})]}})]}})]}})},Iu={m:"16px",s:"12px",none:"0"},Ou={m:"6px",s:"6px",none:"0"},Mu=lo.div`
|
|
755
755
|
display: flex;
|
|
756
756
|
flex-direction: column;
|
|
757
757
|
`,Au=lo.div`
|
|
@@ -787,9 +787,9 @@
|
|
|
787
787
|
`,Bu=lo(tl)`
|
|
788
788
|
margin-bottom: 18px;
|
|
789
789
|
margin-top: 2px;
|
|
790
|
-
|
|
790
|
+
`,qu=lo(Qs)`
|
|
791
791
|
margin-bottom: 16px;
|
|
792
|
-
|
|
792
|
+
`,$u=lo(js)`
|
|
793
793
|
color: ${e=>e.theme.colors.text.secondary};
|
|
794
794
|
text-align: center;
|
|
795
795
|
margin-bottom: 20px;
|
|
@@ -805,7 +805,7 @@
|
|
|
805
805
|
width: 32px;
|
|
806
806
|
height: 32px;
|
|
807
807
|
border-radius: ${e=>Ou[e.theme.borderRadius]};
|
|
808
|
-
`,Hu=e=>{const[t]=bs();return Or(()=>{var n;return t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString())})};function Vu(e,t){let n;n="string"==typeof t?t:qi()?t.twaReturnUrl||t.returnStrategy:"none";const r=function(e,t,n){const r=new URL(e);return r.searchParams.append(t,n),r.toString()}(e,"ret",n);if(!be(e))return r;const o=r.slice(r.lastIndexOf("&")+1);return r.slice(0,r.lastIndexOf("&"))+"-"+xe(o)}function zu(e,t){t=m({},t);const n=Yu(e),r=new URL(n);if(r.searchParams.has("startapp")||r.searchParams.append("startapp","tonconnect"),Ki()){t.returnStrategy="back";Ro(Vu(r.toString(),t.returnStrategy))}else if(qi())if($i("ios","android","macos","tdesktop","web")){t.returnStrategy="back";Hi(Vu(r.toString(),t.returnStrategy))}else $i("weba")?Hi(Vu(r.toString(),t)):Ro(Vu(r.toString(),t));else if(No("ios")){"back"===t.returnStrategy&&(Wo("safari")?t.returnStrategy="back":Wo("chrome")?t.returnStrategy="googlechrome://":Wo("firefox")?t.returnStrategy="firefox://":Wo("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const e=Wo("chrome"),n=Wo("firefox");if((e||n)&&!t.forceRedirect){const e=Vu(r.toString(),t.returnStrategy);To(Ju(e),()=>Ro(e))}else{Ro(Vu(r.toString(),t.returnStrategy))}}else if(No("android")){t.returnStrategy="back";const e=Wo("chrome"),n=Wo("firefox");if((e||n)&&!t.forceRedirect){const e=Vu(r.toString(),t.returnStrategy);To(Ju(e),()=>Ro(e))}else{Ro(Vu(r.toString(),t.returnStrategy))}}else if(No("ipad")){"back"===t.returnStrategy&&(Wo("safari")?t.returnStrategy="back":Wo("chrome")?t.returnStrategy="googlechrome://":Wo("firefox")?t.returnStrategy="firefox://":Wo("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const e=Wo("chrome"),n=Wo("firefox"),o=(e||n)&&!t.forceRedirect,i=Vu(r.toString(),t.returnStrategy);if(o){To(Ju(i),()=>Ro(i))}else Ro(i)}else if(No("macos","windows","linux")){t.returnStrategy="back",t.twaReturnUrl=void 0;const e=Vu(r.toString(),t.returnStrategy);if(t.forceRedirect)Ro(e);else{To(Ju(e),()=>Ro(e))}}else Ro(Vu(r.toString(),t))}function Zu(e,t,n,r){if(n=m({},n),Ki())if(No("ios","android"))"back"===n.returnStrategy&&(n.returnStrategy="tg://resolve"),r("universal-link"),Eo(Vu(e,n.returnStrategy),"_self");else{r("universal-link");Ro(Vu(e,n.returnStrategy))}else if(qi())if($i("ios","android")){"back"===n.returnStrategy&&(n.returnStrategy="tg://resolve"),r("universal-link");const t=Vu(e,n.returnStrategy);Hi(t,()=>{r("universal-link"),Ro(t)})}else if($i("macos","tdesktop")){"back"===n.returnStrategy&&(n.returnStrategy="tg://resolve");const o=Vu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),To(Po(o,t),()=>{r("universal-link"),Ro(o)})):(r("universal-link"),Ro(o))}else if($i("weba")){"back"===n.returnStrategy&&(Wo("safari")?n.returnStrategy=location.href:Wo("chrome")?n.returnStrategy="googlechrome://":Wo("firefox")?n.returnStrategy="firefox://":Wo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href);const o=Vu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),To(Po(o,t),()=>{r("universal-link"),Ro(o)})):(r("universal-link"),Ro(o))}else if($i("web")){"back"===n.returnStrategy&&(Wo("safari")?n.returnStrategy=location.href:Wo("chrome")?n.returnStrategy="googlechrome://":Wo("firefox")?n.returnStrategy="firefox://":Wo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href);const o=Vu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),To(Po(o,t),()=>{r("universal-link"),Ro(o)})):(r("universal-link"),Ro(o))}else{r("universal-link");Ro(Vu(e,n.returnStrategy))}else if(No("ios"))"back"===n.returnStrategy&&(Wo("safari")?n.returnStrategy="none":Wo("chrome")?n.returnStrategy="googlechrome://":Wo("firefox")?n.returnStrategy="firefox://":Wo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),Wo("chrome")?(r("universal-link"),Eo(Vu(e,n.returnStrategy),"_self")):(r("universal-link"),Ro(Vu(e,n.returnStrategy)));else if(No("android"))"back"===n.returnStrategy&&(Wo("chrome")?n.returnStrategy="googlechrome://":Wo("firefox")?n.returnStrategy="firefox://":Wo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),r("universal-link"),Ro(Vu(e,n.returnStrategy));else if(No("ipad"))"back"===n.returnStrategy&&(Wo("safari")?n.returnStrategy="none":Wo("chrome")?n.returnStrategy="googlechrome://":Wo("firefox")?n.returnStrategy="firefox://":Wo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),Wo("chrome")?(r("universal-link"),Eo(Vu(e,n.returnStrategy),"_self")):(r("universal-link"),Ro(Vu(e,n.returnStrategy)));else if(No("macos","windows","linux")){"back"===n.returnStrategy&&(Wo("safari")?n.returnStrategy="none":Wo("chrome")?n.returnStrategy="googlechrome://":Wo("firefox")?n.returnStrategy="firefox://":Wo("opera")?n.returnStrategy="opera-http://":n.returnStrategy="none");const o=Vu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),To(Po(o,t),()=>{r("universal-link"),Ro(o)})):(r("universal-link"),Ro(o))}else r("universal-link"),Ro(Vu(e,n.returnStrategy))}function Gu(e,t){var n,r;if(!be(e))return function(e,t){const n=new URL(e);for(const[r,o]of Object.entries(t))null!=o&&n.searchParams.set(r,o);return n.toString()}(e,{id:t.sessionId,trace_id:t.traceId});const o=Yu(e),i=new URL(o);let a=Qu(Se(null!=(n=i.searchParams.get("startapp"))?n:""));const s=null!=(r=t.sessionId)?r:a.get("id"),l=t.traceId,c=["tonconnect","v","id","trace_id"],d=a.entries().filter(([e])=>!c.includes(e)),u=function(e){const t=Qu();for(const[n,r]of Object.entries(e))null!=r&&t.append(n,r);return t.toString()}(w(m({tonconnect:"",v:"2",id:s},Object.fromEntries(d)),{trace_id:l})).replace("=&","&");return i.searchParams.set("startapp",xe(u)),i.toString()}function Yu(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}function Qu(e=""){const t=new URL("https://example.com");return t.search=e,t.searchParams}function Ju(e){const t=new URL(e),[,n,r]=t.pathname.split("/");return`tg://resolve?domain=${n}&appname=${r}&startapp=${t.searchParams.get("startapp")}`}const Xu=e=>{const[t,n]=Rn("mobile"),[r,o]=Rn(null);On(()=>{var t;o(null!=(t=e.defaultError)?t:null)});const[i,a]=Rn(),[s,l]=Rn(!0),c=Vn(ai);Un(c.onStatusChange(()=>{},t=>{t instanceof te?o("missing-features"):t instanceof ne?o("wrong-network"):e.wallet.appName!==Wl&&o("connection-declined")}));const d=()=>{var t;try{const n=c.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest,{traceId:null==(t=e.walletsModalState)?void 0:t.traceId});a(n)}catch(Vp){}};On(()=>{"extension"!==Nn(t)&&(uu(e.wallet)||du(e.wallet))&&d()});const u=()=>{o(null),"extension"===t()&&d(),n("mobile"),Yo(w(m({},e.wallet),{openMethod:"qrcode"}))},h=()=>{if(o(null),"extension"===t()&&d(),n("desktop"),be(i()))p();else{const t=!s();l(!1),Zu(i(),e.wallet.deepLink,{returnStrategy:au.returnStrategy,forceRedirect:t},t=>{Yo(w(m({},e.wallet),{openMethod:t}))})}},p=()=>{const t=!s();l(!1),Yo(w(m({},e.wallet),{openMethod:"universal-link"})),zu(i(),{returnStrategy:au.returnStrategy,twaReturnUrl:au.twaReturnUrl,forceRedirect:t})},g=()=>{var t;o(null),n("extension"),Ge(e.wallet)&&(Yo(e.wallet),c.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest,{traceId:null==(t=e.walletsModalState)?void 0:t.traceId}))};return uu(e.wallet)?u():hu(e.wallet)?g():h(),ur(Mu,{"data-tc-wallets-modal-connection-desktop":"true",get children(){return[ur(br,{get when(){return!e.backDisabled},get children(){return ur(Pu,{icon:"arrow",onClick:()=>e.onBackClick()})}}),ur(Nu,{get children(){return e.wallet.name}}),ur(br,{get when(){return Or(()=>"mobile"===t())()&&!r()},get children(){return ur(Wu,{translationKey:"walletModal.desktopConnectionModal.scanQR",get translationValues(){return{name:e.wallet.name}},get children(){return["Scan the QR code below with your phone’s or ",Or(()=>e.wallet.name),"’s camera"]}})}}),ur(Au,{get qr(){return"mobile"===t()},get children(){return ur(Cr,{get children(){return[ur(xr,{get when(){return r()},get children(){return[ur($u,{size:"s"}),ur(Cr,{get children(){return[ur(xr,{get when(){return"missing-features"===r()},get children(){return ur(qu,{translationKey:"walletModal.desktopConnectionModal.missingFeatures",get translationValues(){return{name:e.wallet.name}},children:"Please update Wallet, your version does not support required features for this dApp"})}}),ur(xr,{get when(){return"connection-declined"===r()},get children(){return ur(qu,{translationKey:"walletModal.desktopConnectionModal.connectionDeclined",children:"Connection declined"})}}),ur(xr,{get when(){return"not-supported"===r()},get children(){return ur(qu,{translationKey:"walletModal.desktopConnectionModal.notSupportedWallet",get translationValues(){return{name:e.wallet.name}},get children(){return[Or(()=>e.wallet.name)," doesn’t support the requested action. Please connect another wallet that supports it."]}})}}),ur(xr,{get when(){return"wrong-network"===r()},get children(){return ur(qu,{translationKey:"walletModal.desktopConnectionModal.wrongNetwork",get translationValues(){return{name:e.wallet.name}},get children(){return["Connected wallet is on a different network. Please switch network in ",Or(()=>e.wallet.name)," and try again."]}})}})]}}),ur(Uu,{get children(){return[ur(br,{get when(){return"not-supported"!==r()},get children(){return ur(aa,{get leftIcon(){return ur(pl,{})},get onClick(){return"extension"===t()?g:h},get children(){return ur(Hu,{translationKey:"common.retry",children:"Retry"})}})}}),ur(br,{get when(){return"missing-features"===r()},get children(){return ur(Gl,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return ur(aa,{get leftIcon(){return ur(fl,{})},get children(){return ur(Hu,{translationKey:"walletModal.desktopConnectionModal.updateWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Update ",Or(()=>e.wallet.name)]}})}})}})}}),ur(br,{get when(){return"not-supported"===r()},get children(){return ur(aa,{onClick:()=>e.onBackClick(),get children(){return ur(Hu,{translationKey:"walletModal.desktopConnectionModal.chooseAnotherWallet",children:"Choose Another Wallet"})}})}})]}})]}}),ur(xr,{get when(){return"mobile"===t()},get children(){return ur(Lu,{disableCopy:!1,get sourceUrl(){return Vu(i(),"none")},get imageUrl(){return e.wallet.imageUrl}})}}),ur(xr,{get when(){return"extension"===t()},get children(){return[ur(br,{get when(){return Ge(e.wallet)},get children(){return[ur(Bu,{size:"s"}),ur(qu,{translationKey:"walletModal.desktopConnectionModal.continueInExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Or(()=>e.wallet.name)," browser extension…"]}}),ur(Uu,{get children(){return ur(aa,{get leftIcon(){return ur(pl,{})},onClick:g,get children(){return ur(Hu,{translationKey:"common.retry",children:"Retry"})}})}})]}}),ur(br,{get when(){return!Ge(e.wallet)},get children(){return[ur(qu,{translationKey:"walletModal.desktopConnectionModal.dontHaveExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Seems you don't have installed ",Or(()=>e.wallet.name)," browser extension"]}}),ur(Uu,{get children(){return ur(Gl,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return ur(aa,{get rightIcon(){return ur(fl,{})},onClick:g,get children(){return ur(Hu,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",Or(()=>e.wallet.name)]}})}})}})}})]}})]}}),ur(xr,{get when(){return"desktop"===t()},get children(){return[ur(tl,{size:"m"}),ur(qu,{translationKey:"walletModal.desktopConnectionModal.continueOnDesktop",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Or(()=>e.wallet.name)," on desktop…"]}}),ur(Uu,{get children(){return[ur(aa,{get leftIcon(){return ur(pl,{})},onClick:h,get children(){return ur(Hu,{translationKey:"common.retry",children:"Retry"})}}),ur(Gl,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return ur(aa,{get rightIcon(){return ur(fl,{})},get children(){return ur(Hu,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",Or(()=>e.wallet.name)]}})}})}})]}})]}})]}})}}),ur(br,{get when(){return e.wallet.appName===Wl},get children(){return ur(Ku,{get rightIcon(){return ur(Fu,{get src(){return Ul}})},scale:"s",onClick:p,get children(){return ur(Hu,{translationKey:"walletModal.desktopConnectionModal.openWalletOnTelegram",children:"Open Wallet in Telegram on desktop"})}})}}),ur(br,{get when(){return e.wallet.appName!==Wl},get children(){return ur(Du,{get children(){return[ur(br,{get when(){return Or(()=>"mobile"!==t())()&&uu(e.wallet)},get children(){return ur(ju,{appearance:"secondary",get leftIcon(){return ur(cl,{})},onClick:u,get children(){return ur(Hu,{translationKey:"common.mobile",children:"Mobile"})}})}}),ur(br,{get when(){return Or(()=>"extension"!==t())()&&hu(e.wallet)},get children(){return ur(ju,{appearance:"secondary",get leftIcon(){return ur(sl,{})},onClick:g,get children(){return ur(Hu,{translationKey:"common.browserExtension",children:"Browser Extension"})}})}}),ur(br,{get when(){return Or(()=>"desktop"!==t())()&&du(e.wallet)},get children(){return ur(ju,{appearance:"secondary",get leftIcon(){return ur(ul,{})},onClick:h,get children(){return ur(Hu,{translationKey:"common.desktop",children:"Desktop"})}})}})]}})}})]}})},eh=lo.div``,th=lo(La)`
|
|
808
|
+
`,Hu=e=>{const[t]=bs();return Or(()=>{var n;return t(e.translationKey,e.translationValues,null==(n=e.children)?void 0:n.toString())})};function Vu(e,t){let n;n="string"==typeof t?t:$i()?t.twaReturnUrl||t.returnStrategy:"none";const r=function(e,t,n){const r=new URL(e);return r.searchParams.append(t,n),r.toString()}(e,"ret",n);if(!be(e))return r;const o=r.slice(r.lastIndexOf("&")+1);return r.slice(0,r.lastIndexOf("&"))+"-"+xe(o)}function zu(e,t){t=m({},t);const n=Yu(e),r=new URL(n);if(r.searchParams.has("startapp")||r.searchParams.append("startapp","tonconnect"),Ki()){t.returnStrategy="back";Ro(Vu(r.toString(),t.returnStrategy))}else if($i())if(qi("ios","android","macos","tdesktop","web")){t.returnStrategy="back";Hi(Vu(r.toString(),t.returnStrategy))}else qi("weba")?Hi(Vu(r.toString(),t)):Ro(Vu(r.toString(),t));else if(No("ios")){"back"===t.returnStrategy&&(Wo("safari")?t.returnStrategy="back":Wo("chrome")?t.returnStrategy="googlechrome://":Wo("firefox")?t.returnStrategy="firefox://":Wo("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const e=Wo("chrome"),n=Wo("firefox");if((e||n)&&!t.forceRedirect){const e=Vu(r.toString(),t.returnStrategy);To(Ju(e),()=>Ro(e))}else{Ro(Vu(r.toString(),t.returnStrategy))}}else if(No("android")){t.returnStrategy="back";const e=Wo("chrome"),n=Wo("firefox");if((e||n)&&!t.forceRedirect){const e=Vu(r.toString(),t.returnStrategy);To(Ju(e),()=>Ro(e))}else{Ro(Vu(r.toString(),t.returnStrategy))}}else if(No("ipad")){"back"===t.returnStrategy&&(Wo("safari")?t.returnStrategy="back":Wo("chrome")?t.returnStrategy="googlechrome://":Wo("firefox")?t.returnStrategy="firefox://":Wo("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const e=Wo("chrome"),n=Wo("firefox"),o=(e||n)&&!t.forceRedirect,i=Vu(r.toString(),t.returnStrategy);if(o){To(Ju(i),()=>Ro(i))}else Ro(i)}else if(No("macos","windows","linux")){t.returnStrategy="back",t.twaReturnUrl=void 0;const e=Vu(r.toString(),t.returnStrategy);if(t.forceRedirect)Ro(e);else{To(Ju(e),()=>Ro(e))}}else Ro(Vu(r.toString(),t))}function Zu(e,t,n,r){if(n=m({},n),Ki())if(No("ios","android"))"back"===n.returnStrategy&&(n.returnStrategy="tg://resolve"),r("universal-link"),Eo(Vu(e,n.returnStrategy),"_self");else{r("universal-link");Ro(Vu(e,n.returnStrategy))}else if($i())if(qi("ios","android")){"back"===n.returnStrategy&&(n.returnStrategy="tg://resolve"),r("universal-link");const t=Vu(e,n.returnStrategy);Hi(t,()=>{r("universal-link"),Ro(t)})}else if(qi("macos","tdesktop")){"back"===n.returnStrategy&&(n.returnStrategy="tg://resolve");const o=Vu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),To(Po(o,t),()=>{r("universal-link"),Ro(o)})):(r("universal-link"),Ro(o))}else if(qi("weba")){"back"===n.returnStrategy&&(Wo("safari")?n.returnStrategy=location.href:Wo("chrome")?n.returnStrategy="googlechrome://":Wo("firefox")?n.returnStrategy="firefox://":Wo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href);const o=Vu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),To(Po(o,t),()=>{r("universal-link"),Ro(o)})):(r("universal-link"),Ro(o))}else if(qi("web")){"back"===n.returnStrategy&&(Wo("safari")?n.returnStrategy=location.href:Wo("chrome")?n.returnStrategy="googlechrome://":Wo("firefox")?n.returnStrategy="firefox://":Wo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href);const o=Vu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),To(Po(o,t),()=>{r("universal-link"),Ro(o)})):(r("universal-link"),Ro(o))}else{r("universal-link");Ro(Vu(e,n.returnStrategy))}else if(No("ios"))"back"===n.returnStrategy&&(Wo("safari")?n.returnStrategy="none":Wo("chrome")?n.returnStrategy="googlechrome://":Wo("firefox")?n.returnStrategy="firefox://":Wo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),Wo("chrome")?(r("universal-link"),Eo(Vu(e,n.returnStrategy),"_self")):(r("universal-link"),Ro(Vu(e,n.returnStrategy)));else if(No("android"))"back"===n.returnStrategy&&(Wo("chrome")?n.returnStrategy="googlechrome://":Wo("firefox")?n.returnStrategy="firefox://":Wo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),r("universal-link"),Ro(Vu(e,n.returnStrategy));else if(No("ipad"))"back"===n.returnStrategy&&(Wo("safari")?n.returnStrategy="none":Wo("chrome")?n.returnStrategy="googlechrome://":Wo("firefox")?n.returnStrategy="firefox://":Wo("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),Wo("chrome")?(r("universal-link"),Eo(Vu(e,n.returnStrategy),"_self")):(r("universal-link"),Ro(Vu(e,n.returnStrategy)));else if(No("macos","windows","linux")){"back"===n.returnStrategy&&(Wo("safari")?n.returnStrategy="none":Wo("chrome")?n.returnStrategy="googlechrome://":Wo("firefox")?n.returnStrategy="firefox://":Wo("opera")?n.returnStrategy="opera-http://":n.returnStrategy="none");const o=Vu(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),To(Po(o,t),()=>{r("universal-link"),Ro(o)})):(r("universal-link"),Ro(o))}else r("universal-link"),Ro(Vu(e,n.returnStrategy))}function Gu(e,t){var n,r;if(!be(e))return function(e,t){const n=new URL(e);for(const[r,o]of Object.entries(t))null!=o&&n.searchParams.set(r,o);return n.toString()}(e,{id:t.sessionId,trace_id:t.traceId});const o=Yu(e),i=new URL(o);let a=Qu(Se(null!=(n=i.searchParams.get("startapp"))?n:""));const s=null!=(r=t.sessionId)?r:a.get("id"),l=t.traceId,c=["tonconnect","v","id","trace_id"],d=a.entries().filter(([e])=>!c.includes(e)),u=function(e){const t=Qu();for(const[n,r]of Object.entries(e))null!=r&&t.append(n,r);return t.toString()}(w(m({tonconnect:"",v:"2",id:s},Object.fromEntries(d)),{trace_id:l})).replace("=&","&");return i.searchParams.set("startapp",xe(u)),i.toString()}function Yu(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}function Qu(e=""){const t=new URL("https://example.com");return t.search=e,t.searchParams}function Ju(e){const t=new URL(e),[,n,r]=t.pathname.split("/");return`tg://resolve?domain=${n}&appname=${r}&startapp=${t.searchParams.get("startapp")}`}const Xu=e=>{const[t,n]=Rn("mobile"),[r,o]=Rn(null);On(()=>{var t;o(null!=(t=e.defaultError)?t:null)});const[i,a]=Rn(),[s,l]=Rn(!0),c=Vn(ai);Un(c.onStatusChange(()=>{},t=>{t instanceof te?o("missing-features"):t instanceof ne?o("wrong-network"):e.wallet.appName!==Wl&&o("connection-declined")}));const d=()=>{var t;try{const n=c.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest,{traceId:null==(t=e.walletsModalState)?void 0:t.traceId});a(n)}catch(Vp){}};On(()=>{"extension"!==Nn(t)&&(uu(e.wallet)||du(e.wallet))&&d()});const u=()=>{o(null),"extension"===t()&&d(),n("mobile"),Yo(w(m({},e.wallet),{openMethod:"qrcode"}))},h=()=>{if(o(null),"extension"===t()&&d(),n("desktop"),be(i()))p();else{const t=!s();l(!1),Zu(i(),e.wallet.deepLink,{returnStrategy:au.returnStrategy,forceRedirect:t},t=>{Yo(w(m({},e.wallet),{openMethod:t}))})}},p=()=>{const t=!s();l(!1),Yo(w(m({},e.wallet),{openMethod:"universal-link"})),zu(i(),{returnStrategy:au.returnStrategy,twaReturnUrl:au.twaReturnUrl,forceRedirect:t})},g=()=>{var t;o(null),n("extension"),Ge(e.wallet)&&(Yo(e.wallet),c.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest,{traceId:null==(t=e.walletsModalState)?void 0:t.traceId}))};return uu(e.wallet)?u():hu(e.wallet)?g():h(),ur(Mu,{"data-tc-wallets-modal-connection-desktop":"true",get children(){return[ur(br,{get when(){return!e.backDisabled},get children(){return ur(Pu,{icon:"arrow",onClick:()=>e.onBackClick()})}}),ur(Nu,{get children(){return e.wallet.name}}),ur(br,{get when(){return Or(()=>"mobile"===t())()&&!r()},get children(){return ur(Wu,{translationKey:"walletModal.desktopConnectionModal.scanQR",get translationValues(){return{name:e.wallet.name}},get children(){return["Scan the QR code below with your phone’s or ",Or(()=>e.wallet.name),"’s camera"]}})}}),ur(Au,{get qr(){return"mobile"===t()},get children(){return ur(Cr,{get children(){return[ur(xr,{get when(){return r()},get children(){return[ur(qu,{size:"s"}),ur(Cr,{get children(){return[ur(xr,{get when(){return"missing-features"===r()},get children(){return ur($u,{translationKey:"walletModal.desktopConnectionModal.missingFeatures",get translationValues(){return{name:e.wallet.name}},children:"Please update Wallet, your version does not support required features for this dApp"})}}),ur(xr,{get when(){return"connection-declined"===r()},get children(){return ur($u,{translationKey:"walletModal.desktopConnectionModal.connectionDeclined",children:"Connection declined"})}}),ur(xr,{get when(){return"not-supported"===r()},get children(){return ur($u,{translationKey:"walletModal.desktopConnectionModal.notSupportedWallet",get translationValues(){return{name:e.wallet.name}},get children(){return[Or(()=>e.wallet.name)," doesn’t support the requested action. Please connect another wallet that supports it."]}})}}),ur(xr,{get when(){return"wrong-network"===r()},get children(){return ur($u,{translationKey:"walletModal.desktopConnectionModal.wrongNetwork",get translationValues(){return{name:e.wallet.name}},get children(){return["Connected wallet is on a different network. Please switch network in ",Or(()=>e.wallet.name)," and try again."]}})}})]}}),ur(Uu,{get children(){return[ur(br,{get when(){return"not-supported"!==r()},get children(){return ur(aa,{get leftIcon(){return ur(pl,{})},get onClick(){return"extension"===t()?g:h},get children(){return ur(Hu,{translationKey:"common.retry",children:"Retry"})}})}}),ur(br,{get when(){return"missing-features"===r()},get children(){return ur(Gl,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return ur(aa,{get leftIcon(){return ur(fl,{})},get children(){return ur(Hu,{translationKey:"walletModal.desktopConnectionModal.updateWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Update ",Or(()=>e.wallet.name)]}})}})}})}}),ur(br,{get when(){return"not-supported"===r()},get children(){return ur(aa,{onClick:()=>e.onBackClick(),get children(){return ur(Hu,{translationKey:"walletModal.desktopConnectionModal.chooseAnotherWallet",children:"Choose Another Wallet"})}})}})]}})]}}),ur(xr,{get when(){return"mobile"===t()},get children(){return ur(Lu,{disableCopy:!1,get sourceUrl(){return Vu(i(),"none")},get imageUrl(){return e.wallet.imageUrl}})}}),ur(xr,{get when(){return"extension"===t()},get children(){return[ur(br,{get when(){return Ge(e.wallet)},get children(){return[ur(Bu,{size:"s"}),ur($u,{translationKey:"walletModal.desktopConnectionModal.continueInExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Or(()=>e.wallet.name)," browser extension…"]}}),ur(Uu,{get children(){return ur(aa,{get leftIcon(){return ur(pl,{})},onClick:g,get children(){return ur(Hu,{translationKey:"common.retry",children:"Retry"})}})}})]}}),ur(br,{get when(){return!Ge(e.wallet)},get children(){return[ur($u,{translationKey:"walletModal.desktopConnectionModal.dontHaveExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Seems you don't have installed ",Or(()=>e.wallet.name)," browser extension"]}}),ur(Uu,{get children(){return ur(Gl,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return ur(aa,{get rightIcon(){return ur(fl,{})},onClick:g,get children(){return ur(Hu,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",Or(()=>e.wallet.name)]}})}})}})}})]}})]}}),ur(xr,{get when(){return"desktop"===t()},get children(){return[ur(tl,{size:"m"}),ur($u,{translationKey:"walletModal.desktopConnectionModal.continueOnDesktop",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Or(()=>e.wallet.name)," on desktop…"]}}),ur(Uu,{get children(){return[ur(aa,{get leftIcon(){return ur(pl,{})},onClick:h,get children(){return ur(Hu,{translationKey:"common.retry",children:"Retry"})}}),ur(Gl,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return ur(aa,{get rightIcon(){return ur(fl,{})},get children(){return ur(Hu,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",Or(()=>e.wallet.name)]}})}})}})]}})]}})]}})}}),ur(br,{get when(){return e.wallet.appName===Wl},get children(){return ur(Ku,{get rightIcon(){return ur(Fu,{get src(){return Ul}})},scale:"s",onClick:p,get children(){return ur(Hu,{translationKey:"walletModal.desktopConnectionModal.openWalletOnTelegram",children:"Open Wallet in Telegram on desktop"})}})}}),ur(br,{get when(){return e.wallet.appName!==Wl},get children(){return ur(Du,{get children(){return[ur(br,{get when(){return Or(()=>"mobile"!==t())()&&uu(e.wallet)},get children(){return ur(ju,{appearance:"secondary",get leftIcon(){return ur(cl,{})},onClick:u,get children(){return ur(Hu,{translationKey:"common.mobile",children:"Mobile"})}})}}),ur(br,{get when(){return Or(()=>"extension"!==t())()&&hu(e.wallet)},get children(){return ur(ju,{appearance:"secondary",get leftIcon(){return ur(sl,{})},onClick:g,get children(){return ur(Hu,{translationKey:"common.browserExtension",children:"Browser Extension"})}})}}),ur(br,{get when(){return Or(()=>"desktop"!==t())()&&du(e.wallet)},get children(){return ur(ju,{appearance:"secondary",get leftIcon(){return ur(ul,{})},onClick:h,get children(){return ur(Hu,{translationKey:"common.desktop",children:"Desktop"})}})}})]}})}})]}})},eh=lo.div``,th=lo(La)`
|
|
809
809
|
position: absolute;
|
|
810
810
|
top: 16px;
|
|
811
811
|
left: 16px;
|
|
@@ -818,7 +818,7 @@
|
|
|
818
818
|
align-items: center;
|
|
819
819
|
`,oh=no`
|
|
820
820
|
margin-bottom: 12px;
|
|
821
|
-
`,ih=lo(
|
|
821
|
+
`,ih=lo(qs)`
|
|
822
822
|
text-align: center;
|
|
823
823
|
margin-bottom: 4px;
|
|
824
824
|
`,ah=lo(xs)`
|
|
@@ -896,7 +896,7 @@
|
|
|
896
896
|
line-height: 20px;
|
|
897
897
|
font-weight: 500;
|
|
898
898
|
padding: 17px 20px 19px 20px;
|
|
899
|
-
`,Rh=e=>[ur(xh,{get children(){return e.walletInfo.name}}),ur(Sh,{translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){return{name:e.walletInfo.name}},get children(){return["Scan the QR code below with your phone’s or ",Or(()=>e.walletInfo.name),"’s camera"]}}),ur(kh,{get children(){return ur(ms,{get imageUrl(){return e.walletInfo.imageUrl},get sourceUrl(){return Vu(e.universalLink,"none")},disableCopy:!0})}}),ur(_h,{get children(){return[ur(Eh,{appearance:"secondary",onClick:()=>{var t;return null==(t=e.onOpenLink)?void 0:t.call(e)},get children(){return ur(Hu,{translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})}}),ur(Eh,{appearance:"secondary",onClick:()=>{var t;return null==(t=e.onCopy)?void 0:t.call(e)},get children(){return ur(Hu,{get translationKey(){return void 0!==e.isCopiedShown?"common.copied":"common.copyLink"},get children(){return void 0!==e.isCopiedShown?"Copied":"Copy Link"}})}})]}})],Th=e=>{const t=ao(),[n,r]=Rn(!0),[o,i]=Rn(!1),[a,s]=Rn(null);On(()=>{var t;s(null!=(t=e.defaultError)?t:null)});const l=Vn(ai),c=l.onStatusChange(()=>{},e=>{s(e instanceof te?"missing-features":e instanceof ne?"wrong-network":null)}),d=Mn(()=>{var t;return l.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest,{traceId:null==(t=e.walletModalState)?void 0:t.traceId})}),u=()=>{if(be(d()))return Yo(w(m({},e.wallet),{openMethod:"universal-link"})),void zu(d(),{returnStrategy:au.returnStrategy,twaReturnUrl:au.twaReturnUrl,forceRedirect:!0});s(null);const t=!n();r(!1),Zu(d(),e.wallet.deepLink,{returnStrategy:au.returnStrategy,forceRedirect:t},t=>{Yo(w(m({},e.wallet),{openMethod:t}))})},[h,p]=Rn(void 0),g=()=>y(null,null,function*(){void 0!==h()&&clearTimeout(h()),yield gs(d());const e=setTimeout(()=>p(void 0),1500);p(e)}),f=()=>{s(null),i(!0),Yo(w(m({},e.wallet),{openMethod:"qrcode"}))},v=()=>{o()?(i(!1),Yo(w(m({},e.wallet),{openMethod:"universal-link"}))):e.onBackClick()};return Un(c),u(),ur(dh,{"data-tc-wallets-modal-connection-mobile":"true",get children(){return[ur(br,{get when(){return!e.backDisabled||o()},get children(){return ur(ph,{icon:"arrow",onClick:v})}}),ur(br,{get when(){return o()},get children(){return ur(Rh,{get universalLink(){return d()},get walletInfo(){return e.wallet},onOpenLink:u,onCopy:g,get isCopiedShown(){return h()}})}}),ur(br,{get when(){return!o()},get children(){return[ur(hh,{get children(){return e.wallet.name}}),ur(uh,{get children(){return[ur(br,{get when(){return a()},get children(){return[ur(vh,{size:"s"}),ur(Cr,{get children(){return[ur(xr,{get when(){return"missing-features"===a()},get children(){return ur(yh,{translationKey:"walletModal.mobileConnectionModal.missingFeatures",get translationValues(){return{name:e.wallet.name}},children:"Please update Wallet, your version does not support required features for this dApp"})}}),ur(xr,{get when(){return"connection-declined"===a()},get children(){return ur(yh,{translationKey:"walletModal.mobileConnectionModal.connectionDeclined",children:"Connection declined"})}}),ur(xr,{get when(){return"wrong-network"===a()},get children(){return ur(yh,{translationKey:"walletModal.mobileConnectionModal.wrongNetwork",get translationValues(){return{name:e.wallet.name}},get children(){return["Connected wallet is on a different network. Please switch network in ",Or(()=>e.wallet.name)," and try again."]}})}}),ur(xr,{get when(){return"not-supported"===a()},get children(){return ur(yh,{translationKey:"walletModal.mobileConnectionModal.notSupportedWallet",get translationValues(){return{name:e.wallet.name}},get children(){return[Or(()=>e.wallet.name)," doesn't support the requested action. Please connect another wallet that supports it."]}})}})]}}),ur(bh,{get children(){return ur(Cr,{get children(){return[ur(xr,{get when(){return"missing-features"===a()},get children(){return[ur(aa,{get leftIcon(){return ur(pl,{})},onClick:u,get children(){return ur(Hu,{translationKey:"common.retry",children:"Retry"})}}),ur(Gl,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return ur(aa,{get leftIcon(){return ur(fl,{})},get children(){return ur(Hu,{translationKey:"walletModal.mobileConnectionModal.updateWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Update ",Or(()=>e.wallet.name)]}})}})}})]}}),ur(xr,{get when(){return"not-supported"===a()},get children(){return ur(aa,{onClick:()=>e.onBackClick(),get children(){return ur(Hu,{translationKey:"walletModal.mobileConnectionModal.chooseAnotherWallet",children:"Choose Another Wallet"})}})}}),ur(xr,{get when(){return"wrong-network"===a()},get children(){return ur(aa,{get leftIcon(){return ur(pl,{})},onClick:u,get children(){return ur(Hu,{translationKey:"common.retry",children:"Retry"})}})}}),ur(xr,{get when(){return"connection-declined"===a()},get children(){return[ur(aa,{get leftIcon(){return ur(pl,{})},onClick:u,get children(){return ur(Hu,{translationKey:"common.retry",children:"Retry"})}}),ur(aa,{get leftIcon(){return ur(Il,{get fill(){return t.colors.accent}})},onClick:f,get children(){return ur(Hu,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})}})]}}),ur(br,{get when(){return!a()},get children(){return[ur(wh,{size:"s"}),ur(yh,{translationKey:"walletModal.mobileConnectionModal.continueIn",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Or(()=>e.wallet.name),"…"]}}),ur(bh,{get children(){return[ur(aa,{get leftIcon(){return ur(pl,{})},onClick:u,get children(){return ur(Hu,{translationKey:"common.retry",children:"Retry"})}}),ur(aa,{get leftIcon(){return ur(Il,{get fill(){return t.colors.accent}})},onClick:f,get children(){return ur(Hu,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})]}}),ur(gh,{get children(){return[ur(fh,{get src(){return e.wallet.imageUrl}}),ur(
|
|
899
|
+
`,Rh=e=>[ur(xh,{get children(){return e.walletInfo.name}}),ur(Sh,{translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){return{name:e.walletInfo.name}},get children(){return["Scan the QR code below with your phone’s or ",Or(()=>e.walletInfo.name),"’s camera"]}}),ur(kh,{get children(){return ur(ms,{get imageUrl(){return e.walletInfo.imageUrl},get sourceUrl(){return Vu(e.universalLink,"none")},disableCopy:!0})}}),ur(_h,{get children(){return[ur(Eh,{appearance:"secondary",onClick:()=>{var t;return null==(t=e.onOpenLink)?void 0:t.call(e)},get children(){return ur(Hu,{translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})}}),ur(Eh,{appearance:"secondary",onClick:()=>{var t;return null==(t=e.onCopy)?void 0:t.call(e)},get children(){return ur(Hu,{get translationKey(){return void 0!==e.isCopiedShown?"common.copied":"common.copyLink"},get children(){return void 0!==e.isCopiedShown?"Copied":"Copy Link"}})}})]}})],Th=e=>{const t=ao(),[n,r]=Rn(!0),[o,i]=Rn(!1),[a,s]=Rn(null);On(()=>{var t;s(null!=(t=e.defaultError)?t:null)});const l=Vn(ai),c=l.onStatusChange(()=>{},e=>{s(e instanceof te?"missing-features":e instanceof ne?"wrong-network":null)}),d=Mn(()=>{var t;return l.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest,{traceId:null==(t=e.walletModalState)?void 0:t.traceId})}),u=()=>{if(be(d()))return Yo(w(m({},e.wallet),{openMethod:"universal-link"})),void zu(d(),{returnStrategy:au.returnStrategy,twaReturnUrl:au.twaReturnUrl,forceRedirect:!0});s(null);const t=!n();r(!1),Zu(d(),e.wallet.deepLink,{returnStrategy:au.returnStrategy,forceRedirect:t},t=>{Yo(w(m({},e.wallet),{openMethod:t}))})},[h,p]=Rn(void 0),g=()=>y(null,null,function*(){void 0!==h()&&clearTimeout(h()),yield gs(d());const e=setTimeout(()=>p(void 0),1500);p(e)}),f=()=>{s(null),i(!0),Yo(w(m({},e.wallet),{openMethod:"qrcode"}))},v=()=>{o()?(i(!1),Yo(w(m({},e.wallet),{openMethod:"universal-link"}))):e.onBackClick()};return Un(c),u(),ur(dh,{"data-tc-wallets-modal-connection-mobile":"true",get children(){return[ur(br,{get when(){return!e.backDisabled||o()},get children(){return ur(ph,{icon:"arrow",onClick:v})}}),ur(br,{get when(){return o()},get children(){return ur(Rh,{get universalLink(){return d()},get walletInfo(){return e.wallet},onOpenLink:u,onCopy:g,get isCopiedShown(){return h()}})}}),ur(br,{get when(){return!o()},get children(){return[ur(hh,{get children(){return e.wallet.name}}),ur(uh,{get children(){return[ur(br,{get when(){return a()},get children(){return[ur(vh,{size:"s"}),ur(Cr,{get children(){return[ur(xr,{get when(){return"missing-features"===a()},get children(){return ur(yh,{translationKey:"walletModal.mobileConnectionModal.missingFeatures",get translationValues(){return{name:e.wallet.name}},children:"Please update Wallet, your version does not support required features for this dApp"})}}),ur(xr,{get when(){return"connection-declined"===a()},get children(){return ur(yh,{translationKey:"walletModal.mobileConnectionModal.connectionDeclined",children:"Connection declined"})}}),ur(xr,{get when(){return"wrong-network"===a()},get children(){return ur(yh,{translationKey:"walletModal.mobileConnectionModal.wrongNetwork",get translationValues(){return{name:e.wallet.name}},get children(){return["Connected wallet is on a different network. Please switch network in ",Or(()=>e.wallet.name)," and try again."]}})}}),ur(xr,{get when(){return"not-supported"===a()},get children(){return ur(yh,{translationKey:"walletModal.mobileConnectionModal.notSupportedWallet",get translationValues(){return{name:e.wallet.name}},get children(){return[Or(()=>e.wallet.name)," doesn't support the requested action. Please connect another wallet that supports it."]}})}})]}}),ur(bh,{get children(){return ur(Cr,{get children(){return[ur(xr,{get when(){return"missing-features"===a()},get children(){return[ur(aa,{get leftIcon(){return ur(pl,{})},onClick:u,get children(){return ur(Hu,{translationKey:"common.retry",children:"Retry"})}}),ur(Gl,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return ur(aa,{get leftIcon(){return ur(fl,{})},get children(){return ur(Hu,{translationKey:"walletModal.mobileConnectionModal.updateWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Update ",Or(()=>e.wallet.name)]}})}})}})]}}),ur(xr,{get when(){return"not-supported"===a()},get children(){return ur(aa,{onClick:()=>e.onBackClick(),get children(){return ur(Hu,{translationKey:"walletModal.mobileConnectionModal.chooseAnotherWallet",children:"Choose Another Wallet"})}})}}),ur(xr,{get when(){return"wrong-network"===a()},get children(){return ur(aa,{get leftIcon(){return ur(pl,{})},onClick:u,get children(){return ur(Hu,{translationKey:"common.retry",children:"Retry"})}})}}),ur(xr,{get when(){return"connection-declined"===a()},get children(){return[ur(aa,{get leftIcon(){return ur(pl,{})},onClick:u,get children(){return ur(Hu,{translationKey:"common.retry",children:"Retry"})}}),ur(aa,{get leftIcon(){return ur(Il,{get fill(){return t.colors.accent}})},onClick:f,get children(){return ur(Hu,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})}})]}}),ur(br,{get when(){return!a()},get children(){return[ur(wh,{size:"s"}),ur(yh,{translationKey:"walletModal.mobileConnectionModal.continueIn",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",Or(()=>e.wallet.name),"…"]}}),ur(bh,{get children(){return[ur(aa,{get leftIcon(){return ur(pl,{})},onClick:u,get children(){return ur(Hu,{translationKey:"common.retry",children:"Retry"})}}),ur(aa,{get leftIcon(){return ur(Il,{get fill(){return t.colors.accent}})},onClick:f,get children(){return ur(Hu,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})]}}),ur(gh,{get children(){return[ur(fh,{get src(){return e.wallet.imageUrl}}),ur(qs,{get children(){return e.wallet.name}}),ur(mh,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return ur(aa,{get children(){return ur(Hu,{translationKey:"common.get",children:"GET"})}})}})]}})]}})]}})},Ih={m:"16px",s:"12px",none:"0"},Oh={m:"6px",s:"6px",none:"0"};lo.li`
|
|
900
900
|
width: 82px;
|
|
901
901
|
min-width: 82px;
|
|
902
902
|
height: 124px;
|
|
@@ -978,7 +978,7 @@
|
|
|
978
978
|
gap: 16px;
|
|
979
979
|
padding: 0 24px 24px;
|
|
980
980
|
margin-top: 0;
|
|
981
|
-
|
|
981
|
+
`,qh=lo(aa)`
|
|
982
982
|
width: 100%;
|
|
983
983
|
height: 56px;
|
|
984
984
|
border-radius: ${e=>Ph[e.theme.borderRadius]};
|
|
@@ -988,7 +988,7 @@
|
|
|
988
988
|
line-height: 20px;
|
|
989
989
|
font-weight: 500;
|
|
990
990
|
padding: 17px 20px 19px 20px;
|
|
991
|
-
|
|
991
|
+
`,$h=e=>[ur(Uh,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your TON wallet"}),ur(Dh,{translationKey:"walletModal.mobileUniversalModal.scan",children:"Scan with your mobile wallet"}),ur(jh,{get children(){return ur(ms,{get imageUrl(){return Pl},get sourceUrl(){return Vu(e.universalLink,"none")},disableCopy:!0})}}),ur(Bh,{get children(){return[ur(qh,{appearance:"secondary",onClick:()=>e.onOpenLink(),get children(){return ur(Hu,{translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})}}),ur(qh,{appearance:"secondary",onClick:()=>e.onCopy(),get children(){return ur(Hu,{get translationKey(){return void 0!==e.isCopiedShown?"common.copied":"common.copyLink"},get children(){return void 0!==e.isCopiedShown?"Copied":"Copy Link"}})}})]}})];function Kh(e){const t=new Set(e.filter(Je).map(e=>e.bridgeUrl));return Array.from(t).map(e=>({bridgeUrl:e}))}function Fh(e,t){const n=new Set(null==e?void 0:e.map(e=>e.bridgeUrl)),r=new Set(null==t?void 0:t.map(e=>e.bridgeUrl));return n.size===r.size&&[...n].every(e=>r.has(e))}var Hh=Ar("<li>"),Vh=Ar("<div data-tc-wallets-modal-universal-mobile=true>");const zh=e=>{const[t,n]=Rn(!1),[r,o]=Rn(!0),[i,a]=Rn(null),s=au.connector,l=()=>e.walletsList.filter(e=>uu(e)&&e.appName!==Wl),c=()=>l().length>7,d=Mn(()=>Kh(e.walletsList),null,{equals:Fh}),u=Mn(()=>{var t,n;return null!=(n=null==(t=e.walletsList.find(e=>e.appName===Wl))?void 0:t.isSupportRequiredFeatures)&&n},null),h=()=>(i()||a(s.connect(d(),e.additionalRequest,{traceId:e.walletModalState.traceId})),i());Yo({openMethod:"universal-link"});const[p,g]=Rn(void 0),f=()=>y(null,null,function*(){void 0!==p()&&clearTimeout(p()),yield gs(h());const e=setTimeout(()=>g(void 0),1500);g(e)}),m=()=>{const e=!r();o(!1),Zu(h(),void 0,{returnStrategy:au.returnStrategy,forceRedirect:e},e=>{Yo({openMethod:e})})},w=()=>{a(null);const t=e.walletsList.find(e=>e.appName===Wl);if(!t||!Je(t))throw new So("@wallet bot not found in the wallets list");const n=s.connect({bridgeUrl:t.bridgeUrl,universalLink:t.universalLink},e.additionalRequest,{traceId:e.walletModalState.traceId}),i=!r();o(!1),zu(n,{returnStrategy:au.returnStrategy,twaReturnUrl:au.twaReturnUrl,forceRedirect:i})},v=()=>{n(!0),Yo({openMethod:"qrcode"})},b=()=>{n(!1),Yo({openMethod:"universal-link"})},C=Mn(()=>l().filter(e=>e.isSupportRequiredFeatures),null),x=Mn(()=>C().slice(0,3),null);ei({walletsMenu:"main_screen",wallets:u()?[e.walletsList.find(e=>e.appName===Wl),...x()]:x()});const S=Mn(()=>l().filter(e=>!x().find(t=>t.appName===e.appName)).slice(0,4),null);return Ur(k=Vh(),ur(br,{get when(){return t()},get children(){return[ur(Wh,{icon:"arrow",onClick:b}),ur($h,{get universalLink(){return h()},get isCopiedShown(){return p()},onOpenLink:m,onCopy:f})]}}),null),Ur(k,ur(br,{get when(){return!t()},get children(){return[ur(Wh,{get icon(){return ur(Il,{})},onClick:v}),ur(Mh,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your TON wallet"}),ur(br,{get when(){return u()},get children(){return[ur(Ah,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegramOrSelect",maxWidth:320,children:"Use Wallet in Telegram or choose other application"}),ur(Lh,{get leftIcon(){return ur(_l,{})},get rightIcon(){return ur(Nh,{get src(){return Ul}})},onClick:w,scale:"s",get children(){return ur(Hu,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegram",children:"Connect Wallet in Telegram"})}})]}}),ur(Ah,{translationKey:"walletModal.mobileUniversalModal.chooseOtherApplication",maxWidth:342,padding:"0 24px 8px 24px",margin:"0",children:"Choose other application"}),ur(Ts,{get children(){return[ur(yr,{get each(){return Or(()=>!!c())()?x():C()},children:t=>{return Ur(n=Hh(),ur(Ws,{get icon(){return t.imageUrl},get name(){return t.name},onClick:()=>e.onSelect(t)})),n;var n}}),ur(br,{get when(){return c()},get children(){var t=Hh();return Ur(t,ur(Nl,{labelLine1:"View all",labelLine2:"wallets",get images(){return S().map(e=>e.imageUrl)},onClick:()=>e.onSelectAllWallets()})),t}})]}})]}}),null),k;var k},Zh={m:"16px",s:"8px",none:"0"},Gh={m:"8px",s:"4px",none:"0"},Yh=lo.div`
|
|
992
992
|
display: flex;
|
|
993
993
|
flex-direction: column;
|
|
994
994
|
align-items: center;
|
|
@@ -1145,7 +1145,7 @@
|
|
|
1145
1145
|
align-items: center;
|
|
1146
1146
|
`;lo.div`
|
|
1147
1147
|
margin-bottom: 12px;
|
|
1148
|
-
`;const vp=lo(
|
|
1148
|
+
`;const vp=lo(qs)`
|
|
1149
1149
|
text-align: center;
|
|
1150
1150
|
margin-bottom: 4px;
|
|
1151
1151
|
`,yp=lo(xs)`
|
|
@@ -1164,7 +1164,7 @@
|
|
|
1164
1164
|
font-weight: 700;
|
|
1165
1165
|
font-size: 22px;
|
|
1166
1166
|
color: ${e=>{var t;return null==(t=e.theme)?void 0:t.colors.text.primary}};
|
|
1167
|
-
`,Cp=e=>ur(gp,{"data-tc-wallets-modal-restore":"true",get children(){return[ur(fp,{icon:"arrow",get onClick(){return e.onBackClick}}),ur(mp,{translationKey:"walletModal.restoreInfoModal.title",children:"Restore"}),ur(zl,{get children(){return[ur(wp,{get children(){return[ur(bp,{children:"1"}),ur(vp,{translationKey:"walletModal.restoreModal.step1.title",children:"Find your current recovery phrase"}),ur(yp,{translationKey:"walletModal.restoreModal.step1.text",children:"Open your wallet settings and locate the recovery phrase"})]}}),ur(wp,{get children(){return[ur(bp,{children:"2"}),ur(vp,{translationKey:"walletModal.restoreModal.step2.title",children:"Copy your recovery phrase"}),ur(yp,{translationKey:"walletModal.restoreModal.step2.text",children:"Write it down or copy it to a safe place"})]}}),ur(wp,{get children(){return[ur(bp,{children:"3"}),ur(vp,{translationKey:"walletModal.restoreModal.step3.title",children:"Restore in a supported wallet from the list below"}),ur(yp,{translationKey:"walletModal.restoreModal.step3.text",children:"Enter the recovery phrase to access your wallet"})]}})]}})]}}),xp=e=>{const[t,n]=Rn(null),[r,o]=Rn(!1),i=Mn(()=>e.walletsList.find(t=>t.appName===e.currentWallet.device.appName||t.name===e.currentWallet.device.appName)),a=Mn(()=>{var t,n,r,o;return(null!=(n=null==(t=i())?void 0:t.appName)?n:e.currentWallet.device.appName)===Wl?"Wallet in Telegram":null!=(o=null==(r=i())?void 0:r.name)?o:e.currentWallet.device.appName}),s=Mn(()=>{const t=i();if(!(null==t?void 0:t.features))return!1;const n=e.walletsModalState.requiredFeature,r=n?{[n.featureName]:n.value}:{},o=st(t.features,r),a=st(e.currentWallet.device.features,r);return o&&!a});return ur(ip,{get children(){return ur(Cr,{get children(){return[ur(xr,{get when(){return r()},get children(){return ur(Cp,{onBackClick:()=>o(!1)})}}),ur(xr,{get when(){return t()},get children(){return[ur(cp,{}),ur(ip,{get children(){return[ur(ap,{icon:"arrow",onClick:()=>n(null)}),ur(sp,{translationKey:"walletModal.featureNotSupported.disconnect.title",children:"Confirm Disconnect"}),ur(lp,{translationKey:"walletModal.featureNotSupported.disconnect.description",get translationValues(){return{name:t().name}},get children(){return["You will be disconnected from your current wallet and redirected to connect ",Or(()=>{var e;return null==(e=t())?void 0:e.name}),"."]}}),ur(up,{onClick:()=>y(null,null,function*(){yield e.onDisconnect(),e.onSelect(t())}),get children(){return ur(Hu,{translationKey:"walletModal.featureNotSupported.disconnect.button",children:"Disconnect"})}})]}})]}}),ur(xr,{get when(){return s()},get children(){return[ur(op,{get children(){return a()}}),ur(dp,{size:"s"}),ur(hp,{translationKey:"walletModal.featureNotSupported.version.description",get translationValues(){return{name:a()}},get children(){return["Your current version of ",Or(()=>a())," or wallet contract type doesn't support the required features. Please update it to continue."]}}),ur(pp,{get children(){return[ur(Gl,{get href(){return i().aboutUrl},blank:!0,get children(){return ur(aa,{get leftIcon(){return ur(fl,{})},get children(){return ur(Hu,{translationKey:"walletModal.featureNotSupported.version.updateButton",get translationValues(){return{name:a()}},get children(){return["Update ",Or(()=>a())]}})}})}}),ur(Gl,{href:"https://tonkeeper.helpscoutdocs.com/article/102-w5",blank:!0,get children(){return ur(aa,{get leftIcon(){return ur(fl,{})},get children(){return ur(Hu,{translationKey:"walletModal.featureNotSupported.version.aboutW5",children:"About W5"})}})}})]}})]}}),ur(xr,{when:!0,get children(){return[ur(cp,{}),ur(dp,{size:"s"}),ur(sp,{translationKey:"walletModal.featureNotSupported.wallet.title",get translationValues(){return{name:a()}},get children(){return[Or(()=>a())," doesn’t support the requested action"]}}),ur(cp,{})]}})]}})}})},Sp=()=>{const{locale:e}=bs()[1];On(()=>e(au.language)),On(()=>{
|
|
1167
|
+
`,Cp=e=>ur(gp,{"data-tc-wallets-modal-restore":"true",get children(){return[ur(fp,{icon:"arrow",get onClick(){return e.onBackClick}}),ur(mp,{translationKey:"walletModal.restoreInfoModal.title",children:"Restore"}),ur(zl,{get children(){return[ur(wp,{get children(){return[ur(bp,{children:"1"}),ur(vp,{translationKey:"walletModal.restoreModal.step1.title",children:"Find your current recovery phrase"}),ur(yp,{translationKey:"walletModal.restoreModal.step1.text",children:"Open your wallet settings and locate the recovery phrase"})]}}),ur(wp,{get children(){return[ur(bp,{children:"2"}),ur(vp,{translationKey:"walletModal.restoreModal.step2.title",children:"Copy your recovery phrase"}),ur(yp,{translationKey:"walletModal.restoreModal.step2.text",children:"Write it down or copy it to a safe place"})]}}),ur(wp,{get children(){return[ur(bp,{children:"3"}),ur(vp,{translationKey:"walletModal.restoreModal.step3.title",children:"Restore in a supported wallet from the list below"}),ur(yp,{translationKey:"walletModal.restoreModal.step3.text",children:"Enter the recovery phrase to access your wallet"})]}})]}})]}}),xp=e=>{const[t,n]=Rn(null),[r,o]=Rn(!1),i=Mn(()=>e.walletsList.find(t=>t.appName===e.currentWallet.device.appName||t.name===e.currentWallet.device.appName)),a=Mn(()=>{var t,n,r,o;return(null!=(n=null==(t=i())?void 0:t.appName)?n:e.currentWallet.device.appName)===Wl?"Wallet in Telegram":null!=(o=null==(r=i())?void 0:r.name)?o:e.currentWallet.device.appName}),s=Mn(()=>{const t=i();if(!(null==t?void 0:t.features))return!1;const n=e.walletsModalState.requiredFeature,r=n?{[n.featureName]:n.value}:{},o=st(t.features,r),a=st(e.currentWallet.device.features,r);return o&&!a});return ur(ip,{get children(){return ur(Cr,{get children(){return[ur(xr,{get when(){return r()},get children(){return ur(Cp,{onBackClick:()=>o(!1)})}}),ur(xr,{get when(){return t()},get children(){return[ur(cp,{}),ur(ip,{get children(){return[ur(ap,{icon:"arrow",onClick:()=>n(null)}),ur(sp,{translationKey:"walletModal.featureNotSupported.disconnect.title",children:"Confirm Disconnect"}),ur(lp,{translationKey:"walletModal.featureNotSupported.disconnect.description",get translationValues(){return{name:t().name}},get children(){return["You will be disconnected from your current wallet and redirected to connect ",Or(()=>{var e;return null==(e=t())?void 0:e.name}),"."]}}),ur(up,{onClick:()=>y(null,null,function*(){yield e.onDisconnect(),e.onSelect(t())}),get children(){return ur(Hu,{translationKey:"walletModal.featureNotSupported.disconnect.button",children:"Disconnect"})}})]}})]}}),ur(xr,{get when(){return s()},get children(){return[ur(op,{get children(){return a()}}),ur(dp,{size:"s"}),ur(hp,{translationKey:"walletModal.featureNotSupported.version.description",get translationValues(){return{name:a()}},get children(){return["Your current version of ",Or(()=>a())," or wallet contract type doesn't support the required features. Please update it to continue."]}}),ur(pp,{get children(){return[ur(Gl,{get href(){return i().aboutUrl},blank:!0,get children(){return ur(aa,{get leftIcon(){return ur(fl,{})},get children(){return ur(Hu,{translationKey:"walletModal.featureNotSupported.version.updateButton",get translationValues(){return{name:a()}},get children(){return["Update ",Or(()=>a())]}})}})}}),ur(Gl,{href:"https://tonkeeper.helpscoutdocs.com/article/102-w5",blank:!0,get children(){return ur(aa,{get leftIcon(){return ur(fl,{})},get children(){return ur(Hu,{translationKey:"walletModal.featureNotSupported.version.aboutW5",children:"About W5"})}})}})]}})]}}),ur(xr,{when:!0,get children(){return[ur(cp,{}),ur(dp,{size:"s"}),ur(sp,{translationKey:"walletModal.featureNotSupported.wallet.title",get translationValues(){return{name:a()}},get children(){return[Or(()=>a())," doesn’t support the requested action"]}}),ur(cp,{})]}})]}})}})},Sp=()=>{const{locale:e}=bs()[1];On(()=>e(au.language)),On(()=>{$o()?(Vl(),o()):(a(null),d("universal"),h(!1))});const t=Vn(ai),n=Vn(Yl),[r,{refetch:o}]=An(()=>n.getWallets()),[i,a]=Rn(null),[s,l]=Rn(null),[c,d]=Rn("universal"),[u,h]=Rn(!1),p=Mn(()=>{const e=Bo();return"type"in e&&"wallet-not-support-feature"===e.type}),g=Mn(()=>{var e;if("ready"!==r.state)return null;let t=cu(r(),au.walletsListConfiguration);const o=t.filter(Ge),i=t.filter(e=>!Ge(e));t=(o||[]).concat(i);const a=au.preferredWalletAppName,s=t.find(e=>pu(e,a)),l=t.filter(e=>pu(e,a)).length>=2;a&&s&&!l&&(t=[w(m({},s),{isPreferred:!0})].concat(t.filter(e=>!pu(e,a))));const c=t.find(e=>pu(e,Wl));c&&(t=[c].concat(t.filter(e=>!pu(e,Wl))));const d=null!=(e=null==n?void 0:n.walletsRequiredFeatures)?e:null==n?void 0:n.walletsPreferredFeatures;return t.map(e=>{var t;return w(m({},e),{isSupportRequiredFeatures:!d||st(null!=(t=e.features)?t:[],d)})})}),f=()=>{var e;return"loading"===(null==(e=au.connectRequestParameters)?void 0:e.state)},v=Mn(()=>{var e;if(!f())return null==(e=au.connectRequestParameters)?void 0:e.value}),y=e=>{n.closeModal(e)},b=t.onStatusChange(e=>{e&&y("wallet-selected")},e=>{var t;if(e instanceof te){const n=e.cause.connectEvent.device.appName.toLowerCase(),r=null==(t=g())?void 0:t.find(e=>e.appName.toLowerCase()===n);if(!r)throw new z("Wallet not found");const o=r.isSupportRequiredFeatures?"missing-features":"not-supported";l(o),a(r)}}),C=()=>{d("all-wallets")},x=()=>{d("universal")},S=e=>{a(e),Bp.openWalletsModal()},k=()=>{a(null),l(null)};return Un(()=>{a(null),l(null),h(!1)}),Un(b),ur(ru,{get opened(){return $o()},get enableAndroidBackHandler(){return au.enableAndroidBackHandler},onClose:()=>y("action-cancelled"),onClickQuestion:()=>h(e=>!e),get showFooter(){return!p()},"data-tc-wallets-modal-container":"true",get children(){return[ur(br,{get when(){return u()},get children(){return ur(ch,{onBackClick:()=>h(!1)})}}),ur(br,{get when(){return!u()},get children(){return[ur(br,{get when(){return f()||!g()},get children(){return[ur(ou,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),ur(iu,{get children(){return ur(tl,{size:"m"})}})]}}),ur(br,{get when(){return Or(()=>!f())()&&g()},get children(){return ur(Cr,{get children(){return[ur(xr,{get when(){return p()},get children(){return ur(xp,{get walletsList(){return g()},get currentWallet(){return null==n?void 0:n.wallet},onSelect:S,onSelectAllWallets:C,onDisconnect:()=>t.disconnect(),get walletsModalState(){return Bo()},onClose:()=>y("action-cancelled")})}}),ur(xr,{get when(){return i()},get children(){return ur(zr,{get component(){return Fl()?Th:Xu},get walletsModalState(){return Bo()},get wallet(){return i()},get additionalRequest(){return v()},onBackClick:k,get defaultError(){return s()}})}}),ur(xr,{get when(){return"universal"===c()},get children(){return ur(zr,{get component(){return Fl()?zh:np},onSelect:a,get walletModalState(){return Bo()},get walletsList(){return g()},get additionalRequest(){return v()},onSelectAllWallets:C})}}),ur(xr,{get when(){return"all-wallets"===c()},get children(){return ur(Tu,{get walletsList(){return g()},get featureCheckMode(){return(null==n?void 0:n.walletsRequiredFeatures)?"strict":"soft"},onBack:x,onSelect:a})}})]}})}})]}})]}})},kp=lo.div`
|
|
1168
1168
|
display: flex;
|
|
1169
1169
|
flex-direction: column;
|
|
1170
1170
|
align-items: center;
|
|
@@ -1187,5 +1187,5 @@
|
|
|
1187
1187
|
width: 16px;
|
|
1188
1188
|
`,Ip=lo(aa)`
|
|
1189
1189
|
margin-top: 32px;
|
|
1190
|
-
`,Op=e=>{const t=ia(e),n=Vn(Yl),[r,o]=Rn(!0),[i,a]=Rn(!1),[s,l]=Rn(!1),[c,d]=Rn(!1);let u,h;On(()=>{const e=Qo();a(!!e&&("sent"in e&&e.sent||"transaction-sent"===e.name)),l(!!e&&("signed"in e&&e.signed||"data-signed"===e.name)),d(!!e&&("transaction-canceled"===e.name||"sign-data-canceled"===e.name))}),(null==n?void 0:n.wallet)&&"universalLink"in n.wallet&&("universal-link"===n.wallet.openMethod||be(n.wallet.universalLink)&&qi())&&(u=n.wallet.universalLink),(null==n?void 0:n.wallet)&&"deepLink"in n.wallet&&("custom-deeplink"===n.wallet.openMethod||be(n.wallet.deepLink)&&qi())&&(h=n.wallet.deepLink);const p=()=>{const e=Qo(),t="returnStrategy"in e?e.returnStrategy:au.returnStrategy,n=!r();o(!1);const i=Gu(u,{sessionId:e.sessionId,traceId:e.traceId});be(u)?zu(i,{returnStrategy:t,twaReturnUrl:"twaReturnUrl"in e?e.twaReturnUrl:au.twaReturnUrl,forceRedirect:n}):Zu(i,h,{returnStrategy:t,forceRedirect:n},()=>{})};return ur(kp,mr(t,{get children(){return[Or(()=>e.icon),ur(_p,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),ur(Ep,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),ur(br,{get when(){return!i()&&!s()&&!c()&&("open-wallet"===e.showButton&&u||"open-wallet"!==e.showButton)},get children(){return ur(Rp,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return ur(Tp,{})}})}}),ur(br,{get when(){return i()||s()},get children(){return[ur(br,{get when(){return"open-wallet"!==e.showButton},get children(){return ur(Ip,{onClick:()=>e.onClose(),get children(){return ur(Hu,{translationKey:"common.close",children:"Close"})}})}}),ur(br,{get when(){return"open-wallet"===e.showButton&&u},get children(){return ur(Ip,{onClick:p,get children(){return ur(Hu,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},Mp=e=>{const t=Vn(Yl),[n]=bs();return ur(Op,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:t.wallet&&"name"in t.wallet?t.wallet.name:n("common.yourWallet",{},"Your wallet")}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return ur(tl,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},Ap=e=>ur(Op,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return ur(Qs,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),Lp=e=>ur(Op,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return ur(zs,{size:"m"})},showButton:"open-wallet",onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),Np=e=>{const t=Vn(Yl),[n]=bs();return ur(Op,{headerTranslationKey:"actionModal.signData.header",get headerTranslationValues(){return{name:t.wallet&&"name"in t.wallet?t.wallet.name:n("common.yourWallet",{},"Your wallet")}},textTranslationKey:"actionModal.signData.text",get icon(){return ur(tl,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-sign-data-confirm-modal":"true"})},Wp=e=>ur(Op,{headerTranslationKey:"actionModal.signDataCanceled.header",get icon(){return ur(Qs,{size:"m"})},onClose:()=>e.onClose(),"data-tc-sign-data-canceled-modal":"true"}),Pp=e=>ur(Op,{headerTranslationKey:"actionModal.dataSigned.header",get icon(){return ur(zs,{size:"m"})},onClose:()=>e.onClose(),"data-tc-data-signed-modal":"true"}),Up=()=>ur(Ga,{get opened(){var e;return Or(()=>null!==Qo())()&&!0===(null==(e=Qo())?void 0:e.openModal)},get enableAndroidBackHandler(){return au.enableAndroidBackHandler},onClose:()=>Jo(null),showFooter:!1,"data-tc-actions-modal-container":"true",get children(){return ur(Cr,{get children(){return[ur(xr,{get when(){return"transaction-sent"===Qo().name},get children(){return ur(Lp,{onClose:()=>Jo(null)})}}),ur(xr,{get when(){return"transaction-canceled"===Qo().name},get children(){return ur(Ap,{onClose:()=>Jo(null)})}}),ur(xr,{get when(){return"confirm-transaction"===Qo().name},get children(){return ur(Mp,{onClose:()=>Jo(null)})}}),ur(xr,{get when(){return"data-signed"===Qo().name},get children(){return ur(Pp,{onClose:()=>Jo(null)})}}),ur(xr,{get when(){return"sign-data-canceled"===Qo().name},get children(){return ur(Wp,{onClose:()=>Jo(null)})}}),ur(xr,{get when(){return"confirm-sign-data"===Qo().name},get children(){return ur(Np,{onClose:()=>Jo(null)})}})]}})}}),Dp=()=>{const{locale:e}=bs()[1];On(()=>e(au.language)),On(()=>{Ho()&&Vl()});const t=Vn(ai),n=Vn(Yl),[r,o]=Rn(!1),i=()=>{var e;return"loading"===(null==(e=au.connectRequestParameters)?void 0:e.state)},a=Mn(()=>{var e;if(!i())return null==(e=au.connectRequestParameters)?void 0:e.value}),s=e=>{n.closeSingleWalletModal(e)};return Un(t.onStatusChange(e=>{e&&s("wallet-selected")})),Un(()=>{o(!1)}),ur(ru,{get opened(){return Ho()},get enableAndroidBackHandler(){return au.enableAndroidBackHandler},onClose:()=>s("action-cancelled"),onClickQuestion:()=>o(e=>!e),showFooter:!0,"data-tc-wallets-modal-container":"true",get children(){return[ur(br,{get when(){return r()},get children(){return ur(ch,{onBackClick:()=>o(!1)})}}),ur(br,{get when(){return!r()},get children(){return[ur(br,{get when(){return i()},get children(){return[ur(ou,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),ur(iu,{get children(){return ur(tl,{size:"m"})}})]}}),ur(br,{get when(){return!i()},get children(){return ur(zr,{get component(){return Fl()?Th:Xu},get wallet(){return Vo()},get additionalRequest(){return a()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},jp=e=>{const t=vs(oi,au.language);return customElements.get("tc-root")||customElements.define(uo,class extends HTMLElement{}),document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart",""),ur(ys.Provider,{value:t,get children(){return ur(Yl.Provider,{get value(){return e.tonConnectUI},get children(){return ur(ai.Provider,{get value(){return au.connector},get children(){return[ur(go,{}),ur(io,{theme:Ii,get children(){return[ur(br,{get when(){return au.buttonRootId},get children(){return ur(Vr,{get mount(){return document.getElementById(au.buttonRootId)},get children(){return ur(nu,{})}})}}),ur(zr,{component:uo,get children(){return[ur(Sp,{}),ur(Dp,{}),ur(Up,{})]}})]}})]}})}})}})},Bp={openWalletsModal:e=>{setTimeout(()=>$o(t=>{var n;return{status:"opened",traceId:null!=(n=null==e?void 0:e.traceId)?n:null==t?void 0:t.traceId,closeReason:null}}))},closeWalletsModal:e=>{setTimeout(()=>$o({status:"closed",closeReason:e}))},openSingleWalletModal:e=>{setTimeout(()=>Fo({status:"opened",closeReason:null,walletInfo:e}))},closeSingleWalletModal:e=>{setTimeout(()=>Fo({status:"closed",closeReason:e}))},openWalletNotSupportFeatureModal:(e,t)=>{setTimeout(()=>$o({status:"opened",traceId:t.traceId,closeReason:null,type:"wallet-not-support-feature",requiredFeature:e.requiredFeature}))},setAction:e=>{setTimeout(()=>Jo(e))},clearAction:()=>{setTimeout(()=>Jo(null))},getSelectedWalletInfo:()=>Zo(),getLastVisibleWallets:()=>Xo(),removeSelectedWalletInfo:()=>Yo(null),renderApp:(e,t)=>function(e,t,n,r={}){let o;return En(r=>{o=r,t===document?e():Ur(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}(()=>ur(jp,{tonConnectUI:t}),document.getElementById(e))};class $p{constructor(e){this.consumers=[],this.state=Bo(),this.connector=e.connector,this.tracker=e.tracker,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,On(()=>{const e=Bo();this.state=e,this.consumers.forEach(t=>t(e))}),On(Wn(Zo,(e,t)=>y(this,null,function*(){try{const{wallets:n,walletsMenu:r}=Bp.getLastVisibleWallets();if(e&&"appName"in e){if(t&&"appName"in t&&t.appName===e.appName)return;const o=yield this.connector.getSessionId();this.tracker.trackSelectedWallet(n.map(e=>e.name),e,r,"",void 0,o,this.state.traceId)}}catch(n){_o(n)}}))),On(Wn(ti,e=>y(this,null,function*(){try{const{wallets:t,walletsMenu:n}=Bp.getLastVisibleWallets();if(Ce(e.link)){const r=Zo(),o=yield this.connector.getSessionId();this.tracker.trackSelectedWallet(t.map(e=>e.name),r&&"appName"in r?r:null,n,e.link,e.type,o,this.state.traceId)}}catch(t){_o(t)}})))}open(e){return y(this,null,function*(){var t;const n=null!=(t=null==e?void 0:e.traceId)?t:Ue();this.tracker.trackConnectionStarted();const r=(yield this.connector.getWallets()).find(Ye);return r?this.connectEmbeddedWallet(r,{traceId:n}):this.openWalletsModal({traceId:n})})}close(e="action-cancelled"){"action-cancelled"===e&&this.tracker.trackConnectionError("Connection was cancelled"),Bp.closeWalletsModal(e)}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter(t=>t!==e)}}connectEmbeddedWallet(e,t){const n=n=>{Yo(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},n,{traceId:t.traceId})},r=au.connectRequestParameters;"loading"===(null==r?void 0:r.state)?this.setConnectRequestParametersCallback(n):n(null==r?void 0:r.value)}openWalletsModal(e){return y(this,null,function*(){return qi()&&Fi(),Bp.openWalletsModal({traceId:e.traceId}),new Promise(e=>{const t=this.onStateChange(n=>{const{status:r}=n;"opened"===r&&(t(),e())})})})}}class qp{constructor(e){this.consumers=[],this.connector=e.connector,On(()=>{const e=Qo();this.consumers.forEach(t=>t(e))})}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter(t=>t!==e)}}}class Kp{constructor(e){this.consumers=[],this.state=Ko(),this.connector=e.connector,this.tracker=e.tracker,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,On(()=>{const e=Ko();this.state=e,this.consumers.forEach(t=>t(e))})}open(e){return y(this,null,function*(){this.tracker.trackConnectionStarted();const t=cu(yield this.connector.getWallets(),au.walletsListConfiguration),n=t.find(Ye);if(!!n)return this.connectEmbeddedWallet(n);const r=t.filter(Je).find(t=>pu(t,e));if(!!r)return this.openSingleWalletModal(r);const o=`Trying to open modal window with unknown wallet "${e}".`;throw this.tracker.trackConnectionError(o),new So(o)})}close(e="action-cancelled"){"action-cancelled"===e&&this.tracker.trackConnectionError("Connection was cancelled"),Bp.closeSingleWalletModal("action-cancelled")}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter(t=>t!==e)}}connectEmbeddedWallet(e){const t=t=>{Yo(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},n=au.connectRequestParameters;"loading"===(null==n?void 0:n.state)?this.setConnectRequestParametersCallback(t):t(null==n?void 0:n.value)}openSingleWalletModal(e){return y(this,null,function*(){return qi()&&Fi(),Bp.openSingleWalletModal(e),new Promise(e=>{const t=this.onStateChange(n=>{const{status:r}=n;"opened"===r&&(t(),e())})})})}}class Fp{constructor(e){this.eventPrefix="ton-connect-ui-",this.tonConnectSdkVersion=null,this.eventDispatcher=null==e?void 0:e.eventDispatcher,this.tonConnectUiVersion=e.tonConnectUiVersion,this.init().catch()}get version(){return ut({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return y(this,null,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch(Vp){}})}setRequestVersionHandler(){return y(this,null,function*(){yield this.eventDispatcher.addEventListener("ton-connect-ui-request-version",()=>y(this,null,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-ui-response-version",dt(this.tonConnectUiVersion))}))})}requestTonConnectSdkVersion(){return y(this,null,function*(){return new Promise((e,t)=>y(this,null,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-response-version",t=>{e(t.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-request-version",{type:"request-version"})}catch(Vp){t(Vp)}}))})}dispatchUserActionEvent(e){var t;try{null==(t=this.eventDispatcher)||t.dispatchEvent(`${this.eventPrefix}${e.type}`,e).catch()}catch(Vp){}}trackWalletModalOpened(...e){try{const t=Rt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackSelectedWallet(...e){try{const t=Tt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){_o(Vp)}}trackConnectionStarted(...e){try{const t=pt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackConnectionCompleted(...e){try{const t=gt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackConnectionError(...e){try{const t=ft(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackConnectionRestoringStarted(...e){try{const t=mt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackConnectionRestoringCompleted(...e){try{const t=wt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackConnectionRestoringError(...e){try{const t=vt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackDisconnection(...e){try{const t=Et(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackTransactionSentForSignature(...e){try{const t=bt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackTransactionSigned(...e){try{const t=Ct(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackTransactionSigningFailed(...e){try{const t=xt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackDataSentForSignature(...e){try{const t=St(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackDataSigned(...e){try{const t=kt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackDataSigningFailed(...e){try{const t=_t(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}}class Hp{constructor(){this.userAgent=Lo()}getLocale(){var e;return(null==(e=navigator.languages)?void 0:e[0])||navigator.language||""}getBrowser(){var e;return null!=(e=this.userAgent.browser)?e:""}getPlatform(){var e;return null!=(e=this.userAgent.os)?e:""}getTelegramUser(){return Bi}getClientEnvironment(){return qi()?"miniapp":"web"}}e.BadRequestError=oe,e.BrowserEventDispatcher=tn,e.FetchWalletsError=se,e.LocalstorageNotFoundError=ae,e.ParseHexError=ce,e.SessionCrypto=F,e.THEME=Zr,e.TonConnect=dn,e.TonConnectError=z,e.TonConnectUI=class{constructor(e){var t;this.walletInfoStorage=new Uo,this.preferredWalletStorage=new Do,this.walletInfo=null,this.systemThemeChangeUnsubscribe=null,this.connectionRestored=Promise.resolve(!1);let n=null!=(t=null==e?void 0:e.eventDispatcher)?t:new tn;if(e&&"connector"in e&&e.connector)this.connector=e.connector;else{if(!(e&&"manifestUrl"in e&&e.manifestUrl))throw new So("You have to specify a `manifestUrl` or a `connector` in the options.");this.connector=new dn({manifestUrl:e.manifestUrl,eventDispatcher:n,walletsRequiredFeatures:e.walletsRequiredFeatures,environment:new Hp})}this.tracker=new Fp({eventDispatcher:n,tonConnectUiVersion:"2.4.0-beta.2"}),this.modal=new $p({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.singleWalletModal=new Kp({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.transactionModal=new qp({connector:this.connector}),this._walletsRequiredFeatures=e.walletsRequiredFeatures,this._walletsPreferredFeatures=e.walletsPreferredFeatures,this.walletsList=this.getWallets(),this.walletsList.then(e=>{return Oo((t=e.map(e=>e.imageUrl),[...new Set(t)]));var t});const r=this.normalizeWidgetRoot(null==e?void 0:e.widgetRootId);this.subscribeToWalletChange(),!1!==(null==e?void 0:e.restoreConnection)&&(this.connectionRestored=function(e){return y(this,null,function*(){return yield new Promise(e=>requestAnimationFrame(e)),e()})}(()=>y(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=Ti(e,{uiPreferences:{theme:"SYSTEM"}});const o=this.preferredWalletStorage.getPreferredWalletAppName();su({connector:this.connector,preferredWalletAppName:o}),Bp.renderApp(r,this)}static getWallets(){return dn.getWallets()}get walletsRequiredFeatures(){return this._walletsRequiredFeatures}get walletsPreferredFeatures(){return this._walletsPreferredFeatures}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?m(m({},this.connector.wallet),this.walletInfo):null}set uiOptions(e){var t,n,r,o,i,a,s;this.checkButtonRootExist(e.buttonRootId),this.actionsConfiguration=e.actionsConfiguration,"walletsRequiredFeatures"in e&&(this._walletsRequiredFeatures=e.walletsRequiredFeatures),"walletsPreferredFeatures"in e&&(this._walletsPreferredFeatures=e.walletsPreferredFeatures),(null==(t=e.uiPreferences)?void 0:t.theme)?"SYSTEM"!==(null==(n=e.uiPreferences)?void 0:n.theme)?(null==(r=this.systemThemeChangeUnsubscribe)||r.call(this),Li(e.uiPreferences.theme,e.uiPreferences.colorsSet)):(Li(window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?Zr.LIGHT:Zr.DARK,e.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=function(e){const t=t=>e(t.matches?Zr.DARK:Zr.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}(Li))):(null==(o=e.uiPreferences)?void 0:o.colorsSet)&&(a=e.uiPreferences.colorsSet,Ai[Zr.DARK]=Ti(a[Zr.DARK],Ai[Zr.DARK]),Ai[Zr.LIGHT]=Ti(a[Zr.LIGHT],Ai[Zr.LIGHT]),Oi(e=>({colors:Ti(Ai[e.theme],Mi[e.theme])}))),(null==(i=e.uiPreferences)?void 0:i.borderRadius)&&(s=e.uiPreferences.borderRadius,Oi({borderRadius:s})),su(t=>{var n,r;const o=Ti(m(m(m(m({},e.language&&{language:e.language}),!!(null==(n=e.actionsConfiguration)?void 0:n.returnStrategy)&&{returnStrategy:e.actionsConfiguration.returnStrategy}),!!(null==(r=e.actionsConfiguration)?void 0:r.twaReturnUrl)&&{twaReturnUrl:e.actionsConfiguration.twaReturnUrl}),!!e.walletsListConfiguration&&{walletsListConfiguration:e.walletsListConfiguration}),pi(t));return void 0!==e.buttonRootId&&(o.buttonRootId=e.buttonRootId),void 0!==e.enableAndroidBackHandler&&(o.enableAndroidBackHandler=e.enableAndroidBackHandler),o})}setConnectRequestParameters(e){var t;su({connectRequestParameters:e}),"ready"!==(null==e?void 0:e.state)&&e||null==(t=this.connectRequestParametersCallback)||t.call(this,null==e?void 0:e.value)}setConnectionNetwork(e){this.connector.setConnectionNetwork(e)}getWallets(){return y(this,null,function*(){return this.connector.getWallets()})}onStatusChange(e,t){return this.connector.onStatusChange(t=>y(this,null,function*(){if(t){const n=yield this.getSelectedWalletInfo(t);e(m(m({},t),n||this.walletInfoStorage.getWalletInfo()))}else e(t)}),t)}openModal(e){return y(this,null,function*(){var t;const n=null!=(t=null==e?void 0:e.traceId)?t:Ue();yield this.modal.open({traceId:n});const r=yield this.getSessionId(),o=Bp.getLastVisibleWallets();this.tracker.trackWalletModalOpened(o.wallets.map(e=>e.name),r,null==e?void 0:e.traceId)})}closeModal(e){this.modal.close(e)}onModalStateChange(e){return this.modal.onStateChange(e)}get modalState(){return this.modal.state}openSingleWalletModal(e){return y(this,null,function*(){return this.singleWalletModal.open(e)})}closeSingleWalletModal(e){this.singleWalletModal.close(e)}onSingleWalletModalStateChange(e){return this.singleWalletModal.onStateChange(e)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(e){return y(this,null,function*(){var t;const n=null!=(t=null==e?void 0:e.traceId)?t:Ue(),r=(yield this.getWallets()).find(Ye);return r?yield this.connectEmbeddedWallet(r,{traceId:n}):yield this.connectExternalWallet({traceId:n})})}disconnect(e){var t;const n=null!=(t=null==e?void 0:e.traceId)?t:Ue();return this.tracker.trackDisconnection(this.wallet,"dapp"),Bp.clearAction(),Bp.removeSelectedWalletInfo(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect({traceId:n})}sendTransaction(e,t){return y(this,null,function*(){var n;const r=null!=(n=null==t?void 0:t.traceId)?n:Ue();if(this.tracker.trackTransactionSentForSignature(this.wallet,e),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,e,"Wallet was not connected"),new So("Connect wallet to send a transaction.");qi()&&Fi();const{notifications:o,modals:i,returnStrategy:a,twaReturnUrl:s}=this.getModalsAndNotificationsConfiguration(t),l=yield this.getSessionId();Bp.setAction({name:"confirm-transaction",showNotification:o.includes("before"),openModal:i.includes("before"),sent:!1,sessionId:l||void 0,traceId:r});const c=new AbortController,d=()=>{var e;if(c.signal.aborted)return;Bp.setAction({name:"confirm-transaction",showNotification:o.includes("before"),openModal:i.includes("before"),sent:!0,sessionId:l||void 0,traceId:r}),this.redirectAfterRequestSent({returnStrategy:a,twaReturnUrl:s,sessionId:l||void 0,traceId:r});let n=!0;null==(e=null==t?void 0:t.onRequestSent)||e.call(t,()=>y(this,null,function*(){if(c.signal.aborted)return;const e=!n;n=!1,yield this.redirectAfterRequestSent({returnStrategy:a,twaReturnUrl:s,forceRedirect:e,sessionId:l||void 0,traceId:r})}))},u=this.onTransactionModalStateChange(e=>{(null==e?void 0:e.openModal)||(u(),e||c.abort())});try{const t=yield this.waitForSendTransaction({transaction:e,signal:c.signal,traceId:r},d);return this.tracker.trackTransactionSigned(this.wallet,e,t),Bp.setAction({name:"transaction-sent",showNotification:o.includes("success"),openModal:i.includes("success"),traceId:r}),t}catch(Vp){if(Vp instanceof ee)throw Bp.clearAction(),Bp.openWalletNotSupportFeatureModal(Vp.cause,{traceId:r}),Vp;throw Bp.setAction({name:"transaction-canceled",showNotification:o.includes("error"),openModal:i.includes("error"),traceId:r}),Vp instanceof z?Vp:(console.error(Vp),new So("Unhandled error:"+Vp))}finally{u()}})}signData(e,t){return y(this,null,function*(){var n;const r=null!=(n=null==t?void 0:t.traceId)?n:Ue();if(this.tracker.trackDataSentForSignature(this.wallet,e),!this.connected)throw this.tracker.trackDataSigningFailed(this.wallet,e,"Wallet was not connected"),new So("Connect wallet to send a transaction.");qi()&&Fi();const{notifications:o,modals:i,returnStrategy:a,twaReturnUrl:s}=this.getModalsAndNotificationsConfiguration(),l=yield this.getSessionId();Bp.setAction({name:"confirm-sign-data",showNotification:o.includes("before"),openModal:i.includes("before"),signed:!1,sessionId:l||void 0,traceId:r});const c=new AbortController,d=()=>{var e;if(c.signal.aborted)return;Bp.setAction({name:"confirm-sign-data",showNotification:o.includes("before"),openModal:i.includes("before"),signed:!0,sessionId:l||void 0,traceId:r}),this.redirectAfterRequestSent({returnStrategy:a,twaReturnUrl:s,sessionId:l||void 0,traceId:r});let n=!0;null==(e=null==t?void 0:t.onRequestSent)||e.call(t,()=>{if(c.signal.aborted)return;const e=!n;n=!1,this.redirectAfterRequestSent({returnStrategy:a,twaReturnUrl:s,forceRedirect:e,sessionId:l||void 0,traceId:r})})},u=this.onTransactionModalStateChange(e=>{(null==e?void 0:e.openModal)||(u(),e||c.abort())});try{const t=yield this.waitForSignData({data:e,signal:(new AbortController).signal,traceId:r},d);return this.tracker.trackDataSigned(this.wallet,e,t),Bp.setAction({name:"data-signed",showNotification:o.includes("success"),openModal:i.includes("success"),traceId:r}),t}catch(Vp){if(Vp instanceof ee)throw Bp.clearAction(),Bp.openWalletNotSupportFeatureModal(Vp.cause,{traceId:r}),Vp;throw Bp.setAction({name:"sign-data-canceled",showNotification:o.includes("error"),openModal:i.includes("error"),traceId:r}),Vp instanceof z?Vp:(console.error(Vp),new So("Unhandled error:"+Vp))}finally{u()}})}getSessionId(){return y(this,null,function*(){var e,t;try{const n=null==(e=this.connector.dappSettings)?void 0:e.storage;if(n){const e=yield n.getItem("ton-connect-storage_bridge-connection");if(e){const n=JSON.parse(e);if("http"===n.type&&n.sessionCrypto){const e=new F(n.sessionCrypto);return e.sessionId}if("http"===n.type&&(null==(t=n.session)?void 0:t.sessionKeyPair)){const e=new F(n.session.sessionKeyPair);return e.sessionId}}}}catch(Vp){}return null})}redirectAfterRequestSent({returnStrategy:e,twaReturnUrl:t,forceRedirect:n,sessionId:r,traceId:o}){if(this.walletInfo&&"universalLink"in this.walletInfo&&("universal-link"===this.walletInfo.openMethod||"custom-deeplink"===this.walletInfo.openMethod)){const i=Gu(this.walletInfo.universalLink,{sessionId:r,traceId:o});be(this.walletInfo.universalLink)?zu(i,{returnStrategy:e,twaReturnUrl:t||au.twaReturnUrl,forceRedirect:n||!1}):Zu(i,this.walletInfo.deepLink,{returnStrategy:e,forceRedirect:n||!1},()=>{})}}connectEmbeddedWallet(e,t){return y(this,null,function*(){const n=n=>{Yo(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},n,{traceId:t.traceId})},r=au.connectRequestParameters;return"loading"===(null==r?void 0:r.state)?this.connectRequestParametersCallback=n:n(null==r?void 0:r.value),yield this.waitForWalletConnection({ignoreErrors:!1,traceId:t.traceId})})}connectExternalWallet(e){return y(this,null,function*(){const t=new AbortController;Bp.openWalletsModal({traceId:e.traceId});const n=this.onModalStateChange(e=>{const{status:r,closeReason:o}=e;"opened"!==r&&(n(),"action-cancelled"===o&&t.abort())});return yield this.waitForWalletConnection({ignoreErrors:!0,signal:t.signal,traceId:e.traceId})})}waitForWalletConnection(e){return y(this,null,function*(){return new Promise((t,n)=>{this.tracker.trackConnectionStarted();const{ignoreErrors:r=!1,signal:o=null}=e;if(o&&o.aborted)return this.tracker.trackConnectionError("Connection was cancelled"),n(new So("Wallet was not connected"));const i=e=>y(this,null,function*(){if(e)this.tracker.trackConnectionCompleted(e),s(),t(e);else{if(this.tracker.trackConnectionError("Connection was cancelled"),r)return;s(),n(new So("Wallet was not connected"))}}),a=e=>{this.tracker.trackConnectionError(e.message),r||(s(),n(e))},s=this.onStatusChange(e=>i(e),e=>a(e));o&&o.addEventListener("abort",()=>{s(),n(new So("Wallet was not connected"))},{once:!0})})})}waitForSendTransaction(e,t){return y(this,null,function*(){return new Promise((n,r)=>{const{transaction:o,signal:i}=e;if(i.aborted)return this.tracker.trackTransactionSigningFailed(this.wallet,o,"Transaction was cancelled"),r(new So("Transaction was not sent"));const a=e=>y(this,null,function*(){n(e)}),s=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,o,"Transaction was cancelled"),r(new So("Transaction was not sent"))};i.addEventListener("abort",s,{once:!0}),this.connector.sendTransaction(o,{onRequestSent:t,signal:i,traceId:e.traceId}).then(e=>(i.removeEventListener("abort",s),a(e))).catch(e=>(i.removeEventListener("abort",s),(e=>{r(e)})(e)))})})}waitForSignData(e,t){return y(this,null,function*(){return new Promise((n,r)=>{const{data:o,signal:i}=e;if(i.aborted)return this.tracker.trackDataSigningFailed(this.wallet,o,"SignData was cancelled"),r(new So("SignData was not sent"));const a=e=>y(this,null,function*(){n(e)});i.addEventListener("abort",()=>{this.tracker.trackDataSigningFailed(this.wallet,o,"SignData was cancelled"),r(new So("SignData was not sent"))},{once:!0}),this.connector.signData(o,{onRequestSent:t,signal:i}).then(e=>a(e)).catch(e=>(e=>{r(e)})(e))})})}onTransactionModalStateChange(e){return this.transactionModal.onStateChange(e)}subscribeToWalletChange(){this.connector.onStatusChange(e=>y(this,null,function*(){var t;e?(yield this.updateWalletInfo(e),this.setPreferredWalletAppName((null==(t=this.walletInfo)?void 0:t.appName)||e.device.appName)):this.walletInfoStorage.removeWalletInfo()}))}setPreferredWalletAppName(e){this.preferredWalletStorage.setPreferredWalletAppName(e),su({preferredWalletAppName:e})}getSelectedWalletInfo(e){return y(this,null,function*(){let t=Bp.getSelectedWalletInfo();if(!t)return null;if(!("name"in t)){if(e.device.appName===_u)return{type:"wallet-connect",name:Eu,appName:_u,imageUrl:Dl,aboutUrl:"https://reown.com/",features:e.device.features,platforms:[]};const n=cu(yield this.walletsList,au.walletsListConfiguration).find(t=>pu(t,e.device.appName));if(!n)throw new So(`Cannot find WalletInfo for the '${e.device.appName}' wallet`);return m(m({},n),t)}return t})}updateWalletInfo(e){return y(this,null,function*(){const t=yield this.getSelectedWalletInfo(e);if(t)return this.walletInfo=t,void this.walletInfoStorage.setWalletInfo(t);const n=this.walletInfoStorage.getWalletInfo();this.walletInfo=n||((yield this.walletsList).find(t=>pu(t,e.device.appName))||null)})}normalizeWidgetRoot(e){if(!e||!document.getElementById(e)){e="tc-widget-root";const t=document.createElement("div");t.id=e,document.body.appendChild(t)}return e}checkButtonRootExist(e){if(null!=e&&!document.getElementById(e))throw new So(`${e} element not found in the document.`)}getModalsAndNotificationsConfiguration(e){var t,n,r,o,i,a;const s=["before","success","error"];let l=s;(null==(t=this.actionsConfiguration)?void 0:t.notifications)&&"all"!==(null==(n=this.actionsConfiguration)?void 0:n.notifications)&&(l=this.actionsConfiguration.notifications),(null==e?void 0:e.notifications)&&(l="all"===e.notifications?s:e.notifications);let c=["before"];(null==(r=this.actionsConfiguration)?void 0:r.modals)&&(c="all"===this.actionsConfiguration.modals?s:this.actionsConfiguration.modals),(null==e?void 0:e.modals)&&(c="all"===e.modals?s:e.modals);const d=(null==e?void 0:e.returnStrategy)||(null==(o=this.actionsConfiguration)?void 0:o.returnStrategy)||"back",u=(null==e?void 0:e.twaReturnUrl)||(null==(i=this.actionsConfiguration)?void 0:i.twaReturnUrl);let h=(null==e?void 0:e.skipRedirectToWallet)||(null==(a=this.actionsConfiguration)?void 0:a.skipRedirectToWallet)||"ios";return qi()&&(h="never"),{notifications:l,modals:c,returnStrategy:d,twaReturnUrl:u,skipRedirectToWallet:h}}},e.TonConnectUIError=So,e.UUIDv7=Ue,e.UnknownAppError=ie,e.UnknownError=de,e.UserRejectsError=re,e.WalletAlreadyConnectedError=Q,e.WalletMissingRequiredFeaturesError=te,e.WalletNotConnectedError=J,e.WalletNotInjectedError=X,e.WalletNotSupportFeatureError=ee,e.WalletWrongNetworkError=ne,e.WalletsListManager=it,e.WrongAddressError=le,e.checkRequiredWalletFeatures=st,e.createConnectionCompletedEvent=gt,e.createConnectionErrorEvent=ft,e.createConnectionRestoringCompletedEvent=wt,e.createConnectionRestoringErrorEvent=vt,e.createConnectionRestoringStartedEvent=mt,e.createConnectionStartedEvent=pt,e.createDataSentForSignatureEvent=St,e.createDataSignedEvent=kt,e.createDataSigningFailedEvent=_t,e.createDisconnectionEvent=Et,e.createRequestVersionEvent=ct,e.createResponseVersionEvent=dt,e.createSelectedWalletEvent=Tt,e.createTransactionSentForSignatureEvent=bt,e.createTransactionSignedEvent=Ct,e.createTransactionSigningFailedEvent=xt,e.createVersionInfo=ut,e.createWalletModalOpenedEvent=Rt,e.decodeTelegramUrlParameters=Se,e.enableQaMode=function(){et=!0,console.warn("🚨 QA Mode enabled - validation is disabled. This is unsafe for production!"),rt(),function(){if("undefined"==typeof window||tt)return;tt=new MutationObserver(e=>{e.forEach(e=>{"childList"===e.type&&e.removedNodes.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){const t=e;"ton-connect-qa-banner"===t.id&&et?(console.warn("QA Mode banner was removed, restoring..."),setTimeout(()=>rt(),100)):"ton-connect-qa-mode-styles"===t.id&&et&&(console.warn("QA Mode styles were removed, restoring..."),setTimeout(()=>ot(),100))}})})}),tt.observe(document.body,{childList:!0,subtree:!1}),tt.observe(document.head,{childList:!0,subtree:!1})}(),ot()},e.encodeTelegramUrlParameters=xe,e.initializeWalletConnect=function(e,t){if(void 0!==(null==an?void 0:an.walletConnectOptions)||void 0!==(null==an?void 0:an.UniversalConnectorCls))throw new z("Wallet Connect already initialized.");if("function"!=typeof e||!("init"in e))throw new z("Initialize UniversalConnectorCls must be set");an.UniversalConnectorCls=e,an.walletConnectOptions=t},e.isConnectUrl=Ce,e.isQaModeEnabled=nt,e.isTelegramUrl=be,e.isWalletConnectInitialized=sn,e.isWalletInfoCurrentlyEmbedded=Ye,e.isWalletInfoCurrentlyInjected=Ge,e.isWalletInfoInjectable=Qe,e.isWalletInfoInjected=function(e){return"jsBridgeKey"in e},e.isWalletInfoRemote=Je,e.toUserFriendlyAddress=Mt,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
1190
|
+
`,Op=e=>{const t=ia(e),n=Vn(Yl),[r,o]=Rn(!0),[i,a]=Rn(!1),[s,l]=Rn(!1),[c,d]=Rn(!1);let u,h;On(()=>{const e=Qo();a(!!e&&("sent"in e&&e.sent||"transaction-sent"===e.name)),l(!!e&&("signed"in e&&e.signed||"data-signed"===e.name)),d(!!e&&("transaction-canceled"===e.name||"sign-data-canceled"===e.name))}),(null==n?void 0:n.wallet)&&"universalLink"in n.wallet&&("universal-link"===n.wallet.openMethod||be(n.wallet.universalLink)&&$i())&&(u=n.wallet.universalLink),(null==n?void 0:n.wallet)&&"deepLink"in n.wallet&&("custom-deeplink"===n.wallet.openMethod||be(n.wallet.deepLink)&&$i())&&(h=n.wallet.deepLink);const p=()=>{const e=Qo(),t="returnStrategy"in e?e.returnStrategy:au.returnStrategy,n=!r();o(!1);const i=Gu(u,{sessionId:e.sessionId,traceId:e.traceId});be(u)?zu(i,{returnStrategy:t,twaReturnUrl:"twaReturnUrl"in e?e.twaReturnUrl:au.twaReturnUrl,forceRedirect:n}):Zu(i,h,{returnStrategy:t,forceRedirect:n},()=>{})};return ur(kp,mr(t,{get children(){return[Or(()=>e.icon),ur(_p,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),ur(Ep,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),ur(br,{get when(){return!i()&&!s()&&!c()&&("open-wallet"===e.showButton&&u||"open-wallet"!==e.showButton)},get children(){return ur(Rp,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return ur(Tp,{})}})}}),ur(br,{get when(){return i()||s()},get children(){return[ur(br,{get when(){return"open-wallet"!==e.showButton},get children(){return ur(Ip,{onClick:()=>e.onClose(),get children(){return ur(Hu,{translationKey:"common.close",children:"Close"})}})}}),ur(br,{get when(){return"open-wallet"===e.showButton&&u},get children(){return ur(Ip,{onClick:p,get children(){return ur(Hu,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},Mp=e=>{const t=Vn(Yl),[n]=bs();return ur(Op,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:t.wallet&&"name"in t.wallet?t.wallet.name:n("common.yourWallet",{},"Your wallet")}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return ur(tl,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},Ap=e=>ur(Op,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return ur(Qs,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),Lp=e=>ur(Op,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return ur(zs,{size:"m"})},showButton:"open-wallet",onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),Np=e=>{const t=Vn(Yl),[n]=bs();return ur(Op,{headerTranslationKey:"actionModal.signData.header",get headerTranslationValues(){return{name:t.wallet&&"name"in t.wallet?t.wallet.name:n("common.yourWallet",{},"Your wallet")}},textTranslationKey:"actionModal.signData.text",get icon(){return ur(tl,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-sign-data-confirm-modal":"true"})},Wp=e=>ur(Op,{headerTranslationKey:"actionModal.signDataCanceled.header",get icon(){return ur(Qs,{size:"m"})},onClose:()=>e.onClose(),"data-tc-sign-data-canceled-modal":"true"}),Pp=e=>ur(Op,{headerTranslationKey:"actionModal.dataSigned.header",get icon(){return ur(zs,{size:"m"})},onClose:()=>e.onClose(),"data-tc-data-signed-modal":"true"}),Up=()=>ur(Ga,{get opened(){var e;return Or(()=>null!==Qo())()&&!0===(null==(e=Qo())?void 0:e.openModal)},get enableAndroidBackHandler(){return au.enableAndroidBackHandler},onClose:()=>Jo(null),showFooter:!1,"data-tc-actions-modal-container":"true",get children(){return ur(Cr,{get children(){return[ur(xr,{get when(){return"transaction-sent"===Qo().name},get children(){return ur(Lp,{onClose:()=>Jo(null)})}}),ur(xr,{get when(){return"transaction-canceled"===Qo().name},get children(){return ur(Ap,{onClose:()=>Jo(null)})}}),ur(xr,{get when(){return"confirm-transaction"===Qo().name},get children(){return ur(Mp,{onClose:()=>Jo(null)})}}),ur(xr,{get when(){return"data-signed"===Qo().name},get children(){return ur(Pp,{onClose:()=>Jo(null)})}}),ur(xr,{get when(){return"sign-data-canceled"===Qo().name},get children(){return ur(Wp,{onClose:()=>Jo(null)})}}),ur(xr,{get when(){return"confirm-sign-data"===Qo().name},get children(){return ur(Np,{onClose:()=>Jo(null)})}})]}})}}),Dp=()=>{const{locale:e}=bs()[1];On(()=>e(au.language)),On(()=>{Ho()&&Vl()});const t=Vn(ai),n=Vn(Yl),[r,o]=Rn(!1),i=()=>{var e;return"loading"===(null==(e=au.connectRequestParameters)?void 0:e.state)},a=Mn(()=>{var e;if(!i())return null==(e=au.connectRequestParameters)?void 0:e.value}),s=e=>{n.closeSingleWalletModal(e)};return Un(t.onStatusChange(e=>{e&&s("wallet-selected")})),Un(()=>{o(!1)}),ur(ru,{get opened(){return Ho()},get enableAndroidBackHandler(){return au.enableAndroidBackHandler},onClose:()=>s("action-cancelled"),onClickQuestion:()=>o(e=>!e),showFooter:!0,"data-tc-wallets-modal-container":"true",get children(){return[ur(br,{get when(){return r()},get children(){return ur(ch,{onBackClick:()=>o(!1)})}}),ur(br,{get when(){return!r()},get children(){return[ur(br,{get when(){return i()},get children(){return[ur(ou,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),ur(iu,{get children(){return ur(tl,{size:"m"})}})]}}),ur(br,{get when(){return!i()},get children(){return ur(zr,{get component(){return Fl()?Th:Xu},get wallet(){return Vo()},get additionalRequest(){return a()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},jp=e=>{const t=vs(oi,au.language);return customElements.get("tc-root")||customElements.define(uo,class extends HTMLElement{}),document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart",""),ur(ys.Provider,{value:t,get children(){return ur(Yl.Provider,{get value(){return e.tonConnectUI},get children(){return ur(ai.Provider,{get value(){return au.connector},get children(){return[ur(go,{}),ur(io,{theme:Ii,get children(){return[ur(br,{get when(){return au.buttonRootId},get children(){return ur(Vr,{get mount(){return document.getElementById(au.buttonRootId)},get children(){return ur(nu,{})}})}}),ur(zr,{component:uo,get children(){return[ur(Sp,{}),ur(Dp,{}),ur(Up,{})]}})]}})]}})}})}})},Bp={openWalletsModal:e=>{setTimeout(()=>qo(t=>{var n;return{status:"opened",traceId:null!=(n=null==e?void 0:e.traceId)?n:null==t?void 0:t.traceId,closeReason:null}}))},closeWalletsModal:e=>{setTimeout(()=>qo({status:"closed",closeReason:e}))},openSingleWalletModal:e=>{setTimeout(()=>Fo({status:"opened",closeReason:null,walletInfo:e}))},closeSingleWalletModal:e=>{setTimeout(()=>Fo({status:"closed",closeReason:e}))},openWalletNotSupportFeatureModal:(e,t)=>{setTimeout(()=>qo({status:"opened",traceId:t.traceId,closeReason:null,type:"wallet-not-support-feature",requiredFeature:e.requiredFeature}))},setAction:e=>{setTimeout(()=>Jo(e))},clearAction:()=>{setTimeout(()=>Jo(null))},getSelectedWalletInfo:()=>Zo(),getLastVisibleWallets:()=>Xo(),removeSelectedWalletInfo:()=>Yo(null),renderApp:(e,t)=>function(e,t,n,r={}){let o;return En(r=>{o=r,t===document?e():Ur(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}(()=>ur(jp,{tonConnectUI:t}),document.getElementById(e))};class qp{constructor(e){this.consumers=[],this.state=Bo(),this.connector=e.connector,this.tracker=e.tracker,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,On(()=>{const e=Bo();this.state=e,this.consumers.forEach(t=>t(e))}),On(Wn(Zo,(e,t)=>y(this,null,function*(){try{const{wallets:n,walletsMenu:r}=Bp.getLastVisibleWallets();if(e&&"appName"in e){if(t&&"appName"in t&&t.appName===e.appName)return;const o=yield this.connector.getSessionId();this.tracker.trackSelectedWallet(n.map(e=>e.name),e,r,"",void 0,o,this.state.traceId)}}catch(n){_o(n)}}))),On(Wn(ti,e=>y(this,null,function*(){try{const{wallets:t,walletsMenu:n}=Bp.getLastVisibleWallets();if(Ce(e.link)){const r=Zo(),o=yield this.connector.getSessionId();this.tracker.trackSelectedWallet(t.map(e=>e.name),r&&"appName"in r?r:null,n,e.link,e.type,o,this.state.traceId)}}catch(t){_o(t)}})))}open(e){return y(this,null,function*(){var t;const n=null!=(t=null==e?void 0:e.traceId)?t:Pe();this.tracker.trackConnectionStarted();const r=(yield this.connector.getWallets()).find(Ye);return r?this.connectEmbeddedWallet(r,{traceId:n}):this.openWalletsModal({traceId:n})})}close(e="action-cancelled"){"action-cancelled"===e&&this.tracker.trackConnectionError("Connection was cancelled"),Bp.closeWalletsModal(e)}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter(t=>t!==e)}}connectEmbeddedWallet(e,t){const n=n=>{Yo(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},n,{traceId:t.traceId})},r=au.connectRequestParameters;"loading"===(null==r?void 0:r.state)?this.setConnectRequestParametersCallback(n):n(null==r?void 0:r.value)}openWalletsModal(e){return y(this,null,function*(){return $i()&&Fi(),Bp.openWalletsModal({traceId:e.traceId}),new Promise(e=>{const t=this.onStateChange(n=>{const{status:r}=n;"opened"===r&&(t(),e())})})})}}class $p{constructor(e){this.consumers=[],this.connector=e.connector,On(()=>{const e=Qo();this.consumers.forEach(t=>t(e))})}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter(t=>t!==e)}}}class Kp{constructor(e){this.consumers=[],this.state=Ko(),this.connector=e.connector,this.tracker=e.tracker,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,On(()=>{const e=Ko();this.state=e,this.consumers.forEach(t=>t(e))})}open(e){return y(this,null,function*(){this.tracker.trackConnectionStarted();const t=cu(yield this.connector.getWallets(),au.walletsListConfiguration),n=t.find(Ye);if(!!n)return this.connectEmbeddedWallet(n);const r=t.filter(Je).find(t=>pu(t,e));if(!!r)return this.openSingleWalletModal(r);const o=`Trying to open modal window with unknown wallet "${e}".`;throw this.tracker.trackConnectionError(o),new So(o)})}close(e="action-cancelled"){"action-cancelled"===e&&this.tracker.trackConnectionError("Connection was cancelled"),Bp.closeSingleWalletModal("action-cancelled")}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter(t=>t!==e)}}connectEmbeddedWallet(e){const t=t=>{Yo(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},t)},n=au.connectRequestParameters;"loading"===(null==n?void 0:n.state)?this.setConnectRequestParametersCallback(t):t(null==n?void 0:n.value)}openSingleWalletModal(e){return y(this,null,function*(){return $i()&&Fi(),Bp.openSingleWalletModal(e),new Promise(e=>{const t=this.onStateChange(n=>{const{status:r}=n;"opened"===r&&(t(),e())})})})}}class Fp{constructor(e){this.eventPrefix="ton-connect-ui-",this.tonConnectSdkVersion=null,this.eventDispatcher=null==e?void 0:e.eventDispatcher,this.tonConnectUiVersion=e.tonConnectUiVersion,this.init().catch()}get version(){return ut({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return y(this,null,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch(Vp){}})}setRequestVersionHandler(){return y(this,null,function*(){yield this.eventDispatcher.addEventListener("ton-connect-ui-request-version",()=>y(this,null,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-ui-response-version",dt(this.tonConnectUiVersion))}))})}requestTonConnectSdkVersion(){return y(this,null,function*(){return new Promise((e,t)=>y(this,null,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-response-version",t=>{e(t.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-request-version",{type:"request-version"})}catch(Vp){t(Vp)}}))})}dispatchUserActionEvent(e){var t;try{null==(t=this.eventDispatcher)||t.dispatchEvent(`${this.eventPrefix}${e.type}`,e).catch()}catch(Vp){}}trackWalletModalOpened(...e){try{const t=Rt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackSelectedWallet(...e){try{const t=Tt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){_o(Vp)}}trackConnectionStarted(...e){try{const t=pt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackConnectionCompleted(...e){try{const t=gt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackConnectionError(...e){try{const t=ft(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackConnectionRestoringStarted(...e){try{const t=mt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackConnectionRestoringCompleted(...e){try{const t=wt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackConnectionRestoringError(...e){try{const t=vt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackDisconnection(...e){try{const t=Et(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackTransactionSentForSignature(...e){try{const t=bt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackTransactionSigned(...e){try{const t=Ct(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackTransactionSigningFailed(...e){try{const t=xt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackDataSentForSignature(...e){try{const t=St(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackDataSigned(...e){try{const t=kt(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}trackDataSigningFailed(...e){try{const t=_t(this.version,...e);this.dispatchUserActionEvent(t)}catch(Vp){}}}class Hp{constructor(){this.userAgent=Lo()}getLocale(){var e;return(null==(e=navigator.languages)?void 0:e[0])||navigator.language||""}getBrowser(){var e;return null!=(e=this.userAgent.browser)?e:""}getPlatform(){var e;return null!=(e=this.userAgent.os)?e:""}getTelegramUser(){return Bi}getClientEnvironment(){return $i()?"miniapp":"web"}}e.BadRequestError=oe,e.BrowserEventDispatcher=tn,e.FetchWalletsError=se,e.LocalstorageNotFoundError=ae,e.ParseHexError=ce,e.SessionCrypto=F,e.THEME=Zr,e.TonConnect=dn,e.TonConnectError=z,e.TonConnectUI=class{constructor(e){var t;this.walletInfoStorage=new Uo,this.preferredWalletStorage=new Do,this.walletInfo=null,this.systemThemeChangeUnsubscribe=null,this.connectionRestored=Promise.resolve(!1);let n=null!=(t=null==e?void 0:e.eventDispatcher)?t:new tn;if(e&&"connector"in e&&e.connector)this.connector=e.connector;else{if(!(e&&"manifestUrl"in e&&e.manifestUrl))throw new So("You have to specify a `manifestUrl` or a `connector` in the options.");this.connector=new dn({manifestUrl:e.manifestUrl,eventDispatcher:n,walletsRequiredFeatures:e.walletsRequiredFeatures,environment:new Hp,analytics:e.analytics})}this.tracker=new Fp({eventDispatcher:n,tonConnectUiVersion:"2.4.0-beta.6"}),this.modal=new qp({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.singleWalletModal=new Kp({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.transactionModal=new $p({connector:this.connector}),this._walletsRequiredFeatures=e.walletsRequiredFeatures,this._walletsPreferredFeatures=e.walletsPreferredFeatures,this.walletsList=this.getWallets(),this.walletsList.then(e=>{return Oo((t=e.map(e=>e.imageUrl),[...new Set(t)]));var t});const r=this.normalizeWidgetRoot(null==e?void 0:e.widgetRootId);this.subscribeToWalletChange(),!1!==(null==e?void 0:e.restoreConnection)&&(this.connectionRestored=function(e){return y(this,null,function*(){return yield new Promise(e=>requestAnimationFrame(e)),e()})}(()=>y(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=Ti(e,{uiPreferences:{theme:"SYSTEM"}});const o=this.preferredWalletStorage.getPreferredWalletAppName();su({connector:this.connector,preferredWalletAppName:o}),Bp.renderApp(r,this)}static getWallets(){return dn.getWallets()}get walletsRequiredFeatures(){return this._walletsRequiredFeatures}get walletsPreferredFeatures(){return this._walletsPreferredFeatures}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?m(m({},this.connector.wallet),this.walletInfo):null}set uiOptions(e){var t,n,r,o,i,a,s;this.checkButtonRootExist(e.buttonRootId),this.actionsConfiguration=e.actionsConfiguration,"walletsRequiredFeatures"in e&&(this._walletsRequiredFeatures=e.walletsRequiredFeatures),"walletsPreferredFeatures"in e&&(this._walletsPreferredFeatures=e.walletsPreferredFeatures),(null==(t=e.uiPreferences)?void 0:t.theme)?"SYSTEM"!==(null==(n=e.uiPreferences)?void 0:n.theme)?(null==(r=this.systemThemeChangeUnsubscribe)||r.call(this),Li(e.uiPreferences.theme,e.uiPreferences.colorsSet)):(Li(window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?Zr.LIGHT:Zr.DARK,e.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=function(e){const t=t=>e(t.matches?Zr.DARK:Zr.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}(Li))):(null==(o=e.uiPreferences)?void 0:o.colorsSet)&&(a=e.uiPreferences.colorsSet,Ai[Zr.DARK]=Ti(a[Zr.DARK],Ai[Zr.DARK]),Ai[Zr.LIGHT]=Ti(a[Zr.LIGHT],Ai[Zr.LIGHT]),Oi(e=>({colors:Ti(Ai[e.theme],Mi[e.theme])}))),(null==(i=e.uiPreferences)?void 0:i.borderRadius)&&(s=e.uiPreferences.borderRadius,Oi({borderRadius:s})),su(t=>{var n,r;const o=Ti(m(m(m(m({},e.language&&{language:e.language}),!!(null==(n=e.actionsConfiguration)?void 0:n.returnStrategy)&&{returnStrategy:e.actionsConfiguration.returnStrategy}),!!(null==(r=e.actionsConfiguration)?void 0:r.twaReturnUrl)&&{twaReturnUrl:e.actionsConfiguration.twaReturnUrl}),!!e.walletsListConfiguration&&{walletsListConfiguration:e.walletsListConfiguration}),pi(t));return void 0!==e.buttonRootId&&(o.buttonRootId=e.buttonRootId),void 0!==e.enableAndroidBackHandler&&(o.enableAndroidBackHandler=e.enableAndroidBackHandler),o})}setConnectRequestParameters(e){var t;su({connectRequestParameters:e}),"ready"!==(null==e?void 0:e.state)&&e||null==(t=this.connectRequestParametersCallback)||t.call(this,null==e?void 0:e.value)}setConnectionNetwork(e){this.connector.setConnectionNetwork(e)}getWallets(){return y(this,null,function*(){return this.connector.getWallets()})}onStatusChange(e,t){return this.connector.onStatusChange(t=>y(this,null,function*(){if(t){const n=yield this.getSelectedWalletInfo(t);e(m(m({},t),n||this.walletInfoStorage.getWalletInfo()))}else e(t)}),t)}openModal(e){return y(this,null,function*(){var t;const n=null!=(t=null==e?void 0:e.traceId)?t:Pe();yield this.modal.open({traceId:n});const r=yield this.getSessionId(),o=Bp.getLastVisibleWallets();this.tracker.trackWalletModalOpened(o.wallets.map(e=>e.name),r,null==e?void 0:e.traceId)})}closeModal(e){this.modal.close(e)}onModalStateChange(e){return this.modal.onStateChange(e)}get modalState(){return this.modal.state}openSingleWalletModal(e){return y(this,null,function*(){return this.singleWalletModal.open(e)})}closeSingleWalletModal(e){this.singleWalletModal.close(e)}onSingleWalletModalStateChange(e){return this.singleWalletModal.onStateChange(e)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(e){return y(this,null,function*(){var t;const n=null!=(t=null==e?void 0:e.traceId)?t:Pe(),r=(yield this.getWallets()).find(Ye);return r?yield this.connectEmbeddedWallet(r,{traceId:n}):yield this.connectExternalWallet({traceId:n})})}disconnect(e){var t;const n=null!=(t=null==e?void 0:e.traceId)?t:Pe();return this.tracker.trackDisconnection(this.wallet,"dapp"),Bp.clearAction(),Bp.removeSelectedWalletInfo(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect({traceId:n})}sendTransaction(e,t){return y(this,null,function*(){var n;const r=null!=(n=null==t?void 0:t.traceId)?n:Pe();if(this.tracker.trackTransactionSentForSignature(this.wallet,e),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,e,"Wallet was not connected"),new So("Connect wallet to send a transaction.");$i()&&Fi();const{notifications:o,modals:i,returnStrategy:a,twaReturnUrl:s}=this.getModalsAndNotificationsConfiguration(t),l=yield this.getSessionId();Bp.setAction({name:"confirm-transaction",showNotification:o.includes("before"),openModal:i.includes("before"),sent:!1,sessionId:l||void 0,traceId:r});const c=new AbortController,d=()=>{var e;if(c.signal.aborted)return;Bp.setAction({name:"confirm-transaction",showNotification:o.includes("before"),openModal:i.includes("before"),sent:!0,sessionId:l||void 0,traceId:r}),this.redirectAfterRequestSent({returnStrategy:a,twaReturnUrl:s,sessionId:l||void 0,traceId:r});let n=!0;null==(e=null==t?void 0:t.onRequestSent)||e.call(t,()=>y(this,null,function*(){if(c.signal.aborted)return;const e=!n;n=!1,yield this.redirectAfterRequestSent({returnStrategy:a,twaReturnUrl:s,forceRedirect:e,sessionId:l||void 0,traceId:r})}))},u=this.onTransactionModalStateChange(e=>{(null==e?void 0:e.openModal)||(u(),e||c.abort())});try{const t=yield this.waitForSendTransaction({transaction:e,signal:c.signal,traceId:r},d);return this.tracker.trackTransactionSigned(this.wallet,e,t),Bp.setAction({name:"transaction-sent",showNotification:o.includes("success"),openModal:i.includes("success"),traceId:r}),t}catch(Vp){if(Vp instanceof ee)throw Bp.clearAction(),Bp.openWalletNotSupportFeatureModal(Vp.cause,{traceId:r}),Vp;throw Bp.setAction({name:"transaction-canceled",showNotification:o.includes("error"),openModal:i.includes("error"),traceId:r}),Vp instanceof z?Vp:(console.error(Vp),new So("Unhandled error:"+Vp))}finally{u()}})}signData(e,t){return y(this,null,function*(){var n;const r=null!=(n=null==t?void 0:t.traceId)?n:Pe();if(this.tracker.trackDataSentForSignature(this.wallet,e),!this.connected)throw this.tracker.trackDataSigningFailed(this.wallet,e,"Wallet was not connected"),new So("Connect wallet to send a transaction.");$i()&&Fi();const{notifications:o,modals:i,returnStrategy:a,twaReturnUrl:s}=this.getModalsAndNotificationsConfiguration(),l=yield this.getSessionId();Bp.setAction({name:"confirm-sign-data",showNotification:o.includes("before"),openModal:i.includes("before"),signed:!1,sessionId:l||void 0,traceId:r});const c=new AbortController,d=()=>{var e;if(c.signal.aborted)return;Bp.setAction({name:"confirm-sign-data",showNotification:o.includes("before"),openModal:i.includes("before"),signed:!0,sessionId:l||void 0,traceId:r}),this.redirectAfterRequestSent({returnStrategy:a,twaReturnUrl:s,sessionId:l||void 0,traceId:r});let n=!0;null==(e=null==t?void 0:t.onRequestSent)||e.call(t,()=>{if(c.signal.aborted)return;const e=!n;n=!1,this.redirectAfterRequestSent({returnStrategy:a,twaReturnUrl:s,forceRedirect:e,sessionId:l||void 0,traceId:r})})},u=this.onTransactionModalStateChange(e=>{(null==e?void 0:e.openModal)||(u(),e||c.abort())});try{const t=yield this.waitForSignData({data:e,signal:(new AbortController).signal,traceId:r},d);return this.tracker.trackDataSigned(this.wallet,e,t),Bp.setAction({name:"data-signed",showNotification:o.includes("success"),openModal:i.includes("success"),traceId:r}),t}catch(Vp){if(Vp instanceof ee)throw Bp.clearAction(),Bp.openWalletNotSupportFeatureModal(Vp.cause,{traceId:r}),Vp;throw Bp.setAction({name:"sign-data-canceled",showNotification:o.includes("error"),openModal:i.includes("error"),traceId:r}),Vp instanceof z?Vp:(console.error(Vp),new So("Unhandled error:"+Vp))}finally{u()}})}getSessionId(){return y(this,null,function*(){var e,t;try{const n=null==(e=this.connector.dappSettings)?void 0:e.storage;if(n){const e=yield n.getItem("ton-connect-storage_bridge-connection");if(e){const n=JSON.parse(e);if("http"===n.type&&n.sessionCrypto){const e=new F(n.sessionCrypto);return e.sessionId}if("http"===n.type&&(null==(t=n.session)?void 0:t.sessionKeyPair)){const e=new F(n.session.sessionKeyPair);return e.sessionId}}}}catch(Vp){}return null})}redirectAfterRequestSent({returnStrategy:e,twaReturnUrl:t,forceRedirect:n,sessionId:r,traceId:o}){if(this.walletInfo&&"universalLink"in this.walletInfo&&("universal-link"===this.walletInfo.openMethod||"custom-deeplink"===this.walletInfo.openMethod)){const i=Gu(this.walletInfo.universalLink,{sessionId:r,traceId:o});be(this.walletInfo.universalLink)?zu(i,{returnStrategy:e,twaReturnUrl:t||au.twaReturnUrl,forceRedirect:n||!1}):Zu(i,this.walletInfo.deepLink,{returnStrategy:e,forceRedirect:n||!1},()=>{})}}connectEmbeddedWallet(e,t){return y(this,null,function*(){const n=n=>{Yo(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},n,{traceId:t.traceId})},r=au.connectRequestParameters;return"loading"===(null==r?void 0:r.state)?this.connectRequestParametersCallback=n:n(null==r?void 0:r.value),yield this.waitForWalletConnection({ignoreErrors:!1,traceId:t.traceId})})}connectExternalWallet(e){return y(this,null,function*(){const t=new AbortController;Bp.openWalletsModal({traceId:e.traceId});const n=this.onModalStateChange(e=>{const{status:r,closeReason:o}=e;"opened"!==r&&(n(),"action-cancelled"===o&&t.abort())});return yield this.waitForWalletConnection({ignoreErrors:!0,signal:t.signal,traceId:e.traceId})})}waitForWalletConnection(e){return y(this,null,function*(){return new Promise((t,n)=>{this.tracker.trackConnectionStarted();const{ignoreErrors:r=!1,signal:o=null}=e;if(o&&o.aborted)return this.tracker.trackConnectionError("Connection was cancelled"),n(new So("Wallet was not connected"));const i=e=>y(this,null,function*(){if(e)this.tracker.trackConnectionCompleted(e),s(),t(e);else{if(this.tracker.trackConnectionError("Connection was cancelled"),r)return;s(),n(new So("Wallet was not connected"))}}),a=e=>{this.tracker.trackConnectionError(e.message),r||(s(),n(e))},s=this.onStatusChange(e=>i(e),e=>a(e));o&&o.addEventListener("abort",()=>{s(),n(new So("Wallet was not connected"))},{once:!0})})})}waitForSendTransaction(e,t){return y(this,null,function*(){return new Promise((n,r)=>{const{transaction:o,signal:i}=e;if(i.aborted)return this.tracker.trackTransactionSigningFailed(this.wallet,o,"Transaction was cancelled"),r(new So("Transaction was not sent"));const a=e=>y(this,null,function*(){n(e)}),s=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,o,"Transaction was cancelled"),r(new So("Transaction was not sent"))};i.addEventListener("abort",s,{once:!0}),this.connector.sendTransaction(o,{onRequestSent:t,signal:i,traceId:e.traceId}).then(e=>(i.removeEventListener("abort",s),a(e))).catch(e=>(i.removeEventListener("abort",s),(e=>{r(e)})(e)))})})}waitForSignData(e,t){return y(this,null,function*(){return new Promise((n,r)=>{const{data:o,signal:i}=e;if(i.aborted)return this.tracker.trackDataSigningFailed(this.wallet,o,"SignData was cancelled"),r(new So("SignData was not sent"));const a=e=>y(this,null,function*(){n(e)});i.addEventListener("abort",()=>{this.tracker.trackDataSigningFailed(this.wallet,o,"SignData was cancelled"),r(new So("SignData was not sent"))},{once:!0}),this.connector.signData(o,{onRequestSent:t,signal:i}).then(e=>a(e)).catch(e=>(e=>{r(e)})(e))})})}onTransactionModalStateChange(e){return this.transactionModal.onStateChange(e)}subscribeToWalletChange(){this.connector.onStatusChange(e=>y(this,null,function*(){var t;e?(yield this.updateWalletInfo(e),this.setPreferredWalletAppName((null==(t=this.walletInfo)?void 0:t.appName)||e.device.appName)):this.walletInfoStorage.removeWalletInfo()}))}setPreferredWalletAppName(e){this.preferredWalletStorage.setPreferredWalletAppName(e),su({preferredWalletAppName:e})}getSelectedWalletInfo(e){return y(this,null,function*(){let t=Bp.getSelectedWalletInfo();if(!t)return null;if(!("name"in t)){if(e.device.appName===_u)return{type:"wallet-connect",name:Eu,appName:_u,imageUrl:Dl,aboutUrl:"https://reown.com/",features:e.device.features,platforms:[]};const n=cu(yield this.walletsList,au.walletsListConfiguration).find(t=>pu(t,e.device.appName));if(!n)throw new So(`Cannot find WalletInfo for the '${e.device.appName}' wallet`);return m(m({},n),t)}return t})}updateWalletInfo(e){return y(this,null,function*(){const t=yield this.getSelectedWalletInfo(e);if(t)return this.walletInfo=t,void this.walletInfoStorage.setWalletInfo(t);const n=this.walletInfoStorage.getWalletInfo();this.walletInfo=n||((yield this.walletsList).find(t=>pu(t,e.device.appName))||null)})}normalizeWidgetRoot(e){if(!e||!document.getElementById(e)){e="tc-widget-root";const t=document.createElement("div");t.id=e,document.body.appendChild(t)}return e}checkButtonRootExist(e){if(null!=e&&!document.getElementById(e))throw new So(`${e} element not found in the document.`)}getModalsAndNotificationsConfiguration(e){var t,n,r,o,i,a;const s=["before","success","error"];let l=s;(null==(t=this.actionsConfiguration)?void 0:t.notifications)&&"all"!==(null==(n=this.actionsConfiguration)?void 0:n.notifications)&&(l=this.actionsConfiguration.notifications),(null==e?void 0:e.notifications)&&(l="all"===e.notifications?s:e.notifications);let c=["before"];(null==(r=this.actionsConfiguration)?void 0:r.modals)&&(c="all"===this.actionsConfiguration.modals?s:this.actionsConfiguration.modals),(null==e?void 0:e.modals)&&(c="all"===e.modals?s:e.modals);const d=(null==e?void 0:e.returnStrategy)||(null==(o=this.actionsConfiguration)?void 0:o.returnStrategy)||"back",u=(null==e?void 0:e.twaReturnUrl)||(null==(i=this.actionsConfiguration)?void 0:i.twaReturnUrl);let h=(null==e?void 0:e.skipRedirectToWallet)||(null==(a=this.actionsConfiguration)?void 0:a.skipRedirectToWallet)||"ios";return $i()&&(h="never"),{notifications:l,modals:c,returnStrategy:d,twaReturnUrl:u,skipRedirectToWallet:h}}},e.TonConnectUIError=So,e.UUIDv7=Pe,e.UnknownAppError=ie,e.UnknownError=de,e.UserRejectsError=re,e.WalletAlreadyConnectedError=Q,e.WalletMissingRequiredFeaturesError=te,e.WalletNotConnectedError=J,e.WalletNotInjectedError=X,e.WalletNotSupportFeatureError=ee,e.WalletWrongNetworkError=ne,e.WalletsListManager=it,e.WrongAddressError=le,e.checkRequiredWalletFeatures=st,e.createConnectionCompletedEvent=gt,e.createConnectionErrorEvent=ft,e.createConnectionRestoringCompletedEvent=wt,e.createConnectionRestoringErrorEvent=vt,e.createConnectionRestoringStartedEvent=mt,e.createConnectionStartedEvent=pt,e.createDataSentForSignatureEvent=St,e.createDataSignedEvent=kt,e.createDataSigningFailedEvent=_t,e.createDisconnectionEvent=Et,e.createRequestVersionEvent=ct,e.createResponseVersionEvent=dt,e.createSelectedWalletEvent=Tt,e.createTransactionSentForSignatureEvent=bt,e.createTransactionSignedEvent=Ct,e.createTransactionSigningFailedEvent=xt,e.createVersionInfo=ut,e.createWalletModalOpenedEvent=Rt,e.decodeTelegramUrlParameters=Se,e.enableQaMode=function(){et=!0,console.warn("🚨 QA Mode enabled - validation is disabled. This is unsafe for production!"),rt(),function(){if("undefined"==typeof window||tt)return;tt=new MutationObserver(e=>{e.forEach(e=>{"childList"===e.type&&e.removedNodes.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){const t=e;"ton-connect-qa-banner"===t.id&&et?(console.warn("QA Mode banner was removed, restoring..."),setTimeout(()=>rt(),100)):"ton-connect-qa-mode-styles"===t.id&&et&&(console.warn("QA Mode styles were removed, restoring..."),setTimeout(()=>ot(),100))}})})}),tt.observe(document.body,{childList:!0,subtree:!1}),tt.observe(document.head,{childList:!0,subtree:!1})}(),ot()},e.encodeTelegramUrlParameters=xe,e.initializeWalletConnect=function(e,t){if(void 0!==(null==an?void 0:an.walletConnectOptions)||void 0!==(null==an?void 0:an.UniversalConnectorCls))throw new z("Wallet Connect already initialized.");if("function"!=typeof e||!("init"in e))throw new z("Initialize UniversalConnectorCls must be set");an.UniversalConnectorCls=e,an.walletConnectOptions=t},e.isConnectUrl=Ce,e.isQaModeEnabled=nt,e.isTelegramUrl=be,e.isWalletConnectInitialized=sn,e.isWalletInfoCurrentlyEmbedded=Ye,e.isWalletInfoCurrentlyInjected=Ge,e.isWalletInfoInjectable=Qe,e.isWalletInfoInjected=function(e){return"jsBridgeKey"in e},e.isWalletInfoRemote=Je,e.toUserFriendlyAddress=Mt,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
1191
1191
|
//# sourceMappingURL=tonconnect-ui.min.js.map
|