diff --git a/docs/assets/index-B3_cuzQP.css b/docs/assets/index-B3_cuzQP.css deleted file mode 100644 index 14f132a..0000000 --- a/docs/assets/index-B3_cuzQP.css +++ /dev/null @@ -1 +0,0 @@ -.footer{padding:20px;display:flex;gap:20px;justify-content:flex-end;align-items:center;flex-wrap:wrap}.footer>div>label{color:#fff;margin-right:5px}.footer-checkbox-container{display:flex;flex-direction:column}.footer-checkbox-container>span{color:#fff;font-weight:700;margin-bottom:4px}.footer-checkbox-container input{margin-left:3px}header{align-items:right}header>span{font-size:30px;line-height:34px;color:#66aaeee8;font-weight:700;margin:16px}header #wallet-connect-button-wrapper{display:flex;justify-content:right;margin-bottom:32px}#root{max-width:1280px;margin:0 auto;padding:2rem;text-align:center;min-height:90vh}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s;border-radius:50%}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}.card{padding:2em}.read-the-docs{color:#888}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}} diff --git a/docs/assets/index-CvwEH28t.js b/docs/assets/index-Da8V65LC.js similarity index 83% rename from docs/assets/index-CvwEH28t.js rename to docs/assets/index-Da8V65LC.js index 96ad1a2..508fe5d 100644 --- a/docs/assets/index-CvwEH28t.js +++ b/docs/assets/index-Da8V65LC.js @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var is=Symbol.for("react.element"),ov=Symbol.for("react.portal"),iv=Symbol.for("react.fragment"),lv=Symbol.for("react.strict_mode"),sv=Symbol.for("react.profiler"),av=Symbol.for("react.provider"),cv=Symbol.for("react.context"),uv=Symbol.for("react.forward_ref"),fv=Symbol.for("react.suspense"),dv=Symbol.for("react.memo"),hv=Symbol.for("react.lazy"),Gd=Symbol.iterator;function pv(e){return e===null||typeof e!="object"?null:(e=Gd&&e[Gd]||e["@@iterator"],typeof e=="function"?e:null)}var dh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},hh=Object.assign,ph={};function zi(e,t,n){this.props=e,this.context=t,this.refs=ph,this.updater=n||dh}zi.prototype.isReactComponent={};zi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};zi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function gh(){}gh.prototype=zi.prototype;function Af(e,t,n){this.props=e,this.context=t,this.refs=ph,this.updater=n||dh}var Lf=Af.prototype=new gh;Lf.constructor=Af;hh(Lf,zi.prototype);Lf.isPureReactComponent=!0;var Jd=Array.isArray,vh=Object.prototype.hasOwnProperty,Pf={current:null},mh={key:!0,ref:!0,__self:!0,__source:!0};function yh(e,t,n){var r,o={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)vh.call(t,r)&&!mh.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1>>1,Ze=J[et];if(0>>1;eto(We,ye))uto(Tn,We)?(J[et]=Tn,J[ut]=ye,et=ut):(J[et]=We,J[yt]=ye,et=yt);else if(uto(Tn,ye))J[et]=Tn,J[ut]=ye,et=ut;else break e}}return ae}function o(J,ae){var ye=J.sortIndex-ae.sortIndex;return ye!==0?ye:J.id-ae.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var c=[],f=[],d=1,w=null,h=3,S=!1,C=!1,_=!1,O=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(J){for(var ae=n(f);ae!==null;){if(ae.callback===null)r(f);else if(ae.startTime<=J)r(f),ae.sortIndex=ae.expirationTime,t(c,ae);else break;ae=n(f)}}function E(J){if(_=!1,y(J),!C)if(n(c)!==null)C=!0,Ce(T);else{var ae=n(f);ae!==null&&Re(E,ae.startTime-J)}}function T(J,ae){C=!1,_&&(_=!1,b(L),L=-1),S=!0;var ye=h;try{for(y(ae),w=n(c);w!==null&&(!(w.expirationTime>ae)||J&&!$());){var et=w.callback;if(typeof et=="function"){w.callback=null,h=w.priorityLevel;var Ze=et(w.expirationTime<=ae);ae=e.unstable_now(),typeof Ze=="function"?w.callback=Ze:w===n(c)&&r(c),y(ae)}else r(c);w=n(c)}if(w!==null)var ct=!0;else{var yt=n(f);yt!==null&&Re(E,yt.startTime-ae),ct=!1}return ct}finally{w=null,h=ye,S=!1}}var W=!1,I=null,L=-1,P=5,U=-1;function $(){return!(e.unstable_now()-UJ||125et?(J.sortIndex=ye,t(f,J),n(c)===null&&J===n(f)&&(_?(b(L),L=-1):_=!0,Re(E,ye-et))):(J.sortIndex=Ze,t(c,J),C||S||(C=!0,Ce(T))),J},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(J){var ae=h;return function(){var ye=h;h=ae;try{return J.apply(this,arguments)}finally{h=ye}}}})(_h);Sh.exports=_h;var kv=Sh.exports;/** + */(function(e){function t(J,ae){var ye=J.length;J.push(ae);e:for(;0>>1,Ze=J[et];if(0>>1;eto(Ne,ye))uto(Tn,Ne)?(J[et]=Tn,J[ut]=ye,et=ut):(J[et]=Ne,J[yt]=ye,et=yt);else if(uto(Tn,ye))J[et]=Tn,J[ut]=ye,et=ut;else break e}}return ae}function o(J,ae){var ye=J.sortIndex-ae.sortIndex;return ye!==0?ye:J.id-ae.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var c=[],f=[],d=1,w=null,h=3,S=!1,C=!1,_=!1,O=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(J){for(var ae=n(f);ae!==null;){if(ae.callback===null)r(f);else if(ae.startTime<=J)r(f),ae.sortIndex=ae.expirationTime,t(c,ae);else break;ae=n(f)}}function E(J){if(_=!1,y(J),!C)if(n(c)!==null)C=!0,Ce(T);else{var ae=n(f);ae!==null&&Re(E,ae.startTime-J)}}function T(J,ae){C=!1,_&&(_=!1,b(L),L=-1),S=!0;var ye=h;try{for(y(ae),w=n(c);w!==null&&(!(w.expirationTime>ae)||J&&!$());){var et=w.callback;if(typeof et=="function"){w.callback=null,h=w.priorityLevel;var Ze=et(w.expirationTime<=ae);ae=e.unstable_now(),typeof Ze=="function"?w.callback=Ze:w===n(c)&&r(c),y(ae)}else r(c);w=n(c)}if(w!==null)var ct=!0;else{var yt=n(f);yt!==null&&Re(E,yt.startTime-ae),ct=!1}return ct}finally{w=null,h=ye,S=!1}}var N=!1,I=null,L=-1,P=5,U=-1;function $(){return!(e.unstable_now()-UJ||125et?(J.sortIndex=ye,t(f,J),n(c)===null&&J===n(f)&&(_?(b(L),L=-1):_=!0,Re(E,ye-et))):(J.sortIndex=Ze,t(c,J),C||S||(C=!0,Ce(T))),J},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(J){var ae=h;return function(){var ye=h;h=ae;try{return J.apply(this,arguments)}finally{h=ye}}}})(_h);Sh.exports=_h;var kv=Sh.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ev=Vr,Zn=kv;function le(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wu=Object.prototype.hasOwnProperty,Tv=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,e1={},t1={};function Av(e){return wu.call(t1,e)?!0:wu.call(e1,e)?!1:Tv.test(e)?t1[e]=!0:(e1[e]=!0,!1)}function Lv(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Pv(e,t,n,r){if(t===null||typeof t>"u"||Lv(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Wn(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var mn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){mn[e]=new Wn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];mn[t]=new Wn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){mn[e]=new Wn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){mn[e]=new Wn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){mn[e]=new Wn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){mn[e]=new Wn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){mn[e]=new Wn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){mn[e]=new Wn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){mn[e]=new Wn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Rf=/[\-:]([a-z])/g;function If(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Rf,If);mn[t]=new Wn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Rf,If);mn[t]=new Wn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Rf,If);mn[t]=new Wn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){mn[e]=new Wn(e,1,!1,e.toLowerCase(),null,!1,!1)});mn.xlinkHref=new Wn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){mn[e]=new Wn(e,1,!1,e.toLowerCase(),null,!0,!0)});function $f(e,t,n,r){var o=mn.hasOwnProperty(t)?mn[t]:null;(o!==null?o.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wu=Object.prototype.hasOwnProperty,Tv=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,e1={},t1={};function Av(e){return wu.call(t1,e)?!0:wu.call(e1,e)?!1:Tv.test(e)?t1[e]=!0:(e1[e]=!0,!1)}function Lv(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Pv(e,t,n,r){if(t===null||typeof t>"u"||Lv(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Nn(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var mn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){mn[e]=new Nn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];mn[t]=new Nn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){mn[e]=new Nn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){mn[e]=new Nn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){mn[e]=new Nn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){mn[e]=new Nn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){mn[e]=new Nn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){mn[e]=new Nn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){mn[e]=new Nn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Rf=/[\-:]([a-z])/g;function If(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Rf,If);mn[t]=new Nn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Rf,If);mn[t]=new Nn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Rf,If);mn[t]=new Nn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){mn[e]=new Nn(e,1,!1,e.toLowerCase(),null,!1,!1)});mn.xlinkHref=new Nn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){mn[e]=new Nn(e,1,!1,e.toLowerCase(),null,!0,!0)});function $f(e,t,n,r){var o=mn.hasOwnProperty(t)?mn[t]:null;(o!==null?o.type!==0:r||!(2s||o[l]!==i[s]){var c=` -`+o[l].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=l&&0<=s);break}}}finally{Ic=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ll(e):""}function Mv(e){switch(e.tag){case 5:return ll(e.type);case 16:return ll("Lazy");case 13:return ll("Suspense");case 19:return ll("SuspenseList");case 0:case 2:case 15:return e=$c(e.type,!1),e;case 11:return e=$c(e.type.render,!1),e;case 1:return e=$c(e.type,!0),e;default:return""}}function Su(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ci:return"Fragment";case ai:return"Portal";case xu:return"Profiler";case Wf:return"StrictMode";case Cu:return"Suspense";case bu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Th:return(e.displayName||"Context")+".Consumer";case Eh:return(e._context.displayName||"Context")+".Provider";case Nf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Uf:return t=e.displayName||null,t!==null?t:Su(e.type)||"Memo";case oo:t=e._payload,e=e._init;try{return Su(e(t))}catch{}}return null}function Rv(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Su(t);case 8:return t===Wf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function So(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Lh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Iv(e){var t=Lh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ss(e){e._valueTracker||(e._valueTracker=Iv(e))}function Ph(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Lh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function aa(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function _u(e,t){var n=t.checked;return Bt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function r1(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=So(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mh(e,t){t=t.checked,t!=null&&$f(e,"checked",t,!1)}function ku(e,t){Mh(e,t);var n=So(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Eu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Eu(e,t.type,So(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function o1(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Eu(e,t,n){(t!=="number"||aa(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var sl=Array.isArray;function ki(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=_s.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function $l(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var vl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$v=["Webkit","ms","Moz","O"];Object.keys(vl).forEach(function(e){$v.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),vl[t]=vl[e]})});function Wh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||vl.hasOwnProperty(e)&&vl[e]?(""+t).trim():t+"px"}function Nh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Wh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Wv=Bt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Lu(e,t){if(t){if(Wv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(le(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(le(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(le(61))}if(t.style!=null&&typeof t.style!="object")throw Error(le(62))}}function Pu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Mu=null;function Of(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ru=null,Ei=null,Ti=null;function s1(e){if(e=as(e)){if(typeof Ru!="function")throw Error(le(280));var t=e.stateNode;t&&(t=oc(t),Ru(e.stateNode,e.type,t))}}function Uh(e){Ei?Ti?Ti.push(e):Ti=[e]:Ei=e}function Oh(){if(Ei){var e=Ei,t=Ti;if(Ti=Ei=null,s1(e),t)for(e=0;e>>=0,e===0?32:31-(Kv(e)/qv|0)|0}var ks=64,Es=4194304;function al(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function da(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~o;s!==0?r=al(s):(i&=l,i!==0&&(r=al(i)))}else l=n&~o,l!==0?r=al(l):i!==0&&(r=al(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ls(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gr(t),e[t]=n}function Gv(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=yl),v1=" ",m1=!1;function o2(e,t){switch(e){case"keyup":return k5.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function i2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ui=!1;function T5(e,t){switch(e){case"compositionend":return i2(t);case"keypress":return t.which!==32?null:(m1=!0,v1);case"textInput":return e=t.data,e===v1&&m1?null:e;default:return null}}function A5(e,t){if(ui)return e==="compositionend"||!Kf&&o2(e,t)?(e=n2(),Zs=Ff=uo=null,ui=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=C1(n)}}function c2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?c2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function u2(){for(var e=window,t=aa();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=aa(e.document)}return t}function qf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function U5(e){var t=u2(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&c2(n.ownerDocument.documentElement,n)){if(r!==null&&qf(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=b1(n,i);var l=b1(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,fi=null,Ou=null,xl=null,Bu=!1;function S1(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Bu||fi==null||fi!==aa(r)||(r=fi,"selectionStart"in r&&qf(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),xl&&jl(xl,r)||(xl=r,r=ga(Ou,"onSelect"),0pi||(e.current=Vu[pi],Vu[pi]=null,pi--)}function At(e,t){pi++,Vu[pi]=e.current,e.current=t}var _o={},En=Po(_o),Dn=Po(!1),Qo=_o;function Ii(e,t){var n=e.type.contextTypes;if(!n)return _o;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Hn(e){return e=e.childContextTypes,e!=null}function ma(){Mt(Dn),Mt(En)}function P1(e,t,n){if(En.current!==_o)throw Error(le(168));At(En,t),At(Dn,n)}function w2(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(le(108,Rv(e)||"Unknown",o));return Bt({},n,r)}function ya(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||_o,Qo=En.current,At(En,e),At(Dn,Dn.current),!0}function M1(e,t,n){var r=e.stateNode;if(!r)throw Error(le(169));n?(e=w2(e,t,Qo),r.__reactInternalMemoizedMergedChildContext=e,Mt(Dn),Mt(En),At(En,e)):Mt(Dn),At(Dn,n)}var Nr=null,ic=!1,Qc=!1;function x2(e){Nr===null?Nr=[e]:Nr.push(e)}function Y5(e){ic=!0,x2(e)}function Mo(){if(!Qc&&Nr!==null){Qc=!0;var e=0,t=kt;try{var n=Nr;for(kt=1;e>=l,o-=l,Br=1<<32-gr(t)+o|n<L?(P=I,I=null):P=I.sibling;var U=h(b,I,y[L],E);if(U===null){I===null&&(I=P);break}e&&I&&U.alternate===null&&t(b,I),p=i(U,p,L),W===null?T=U:W.sibling=U,W=U,I=P}if(L===y.length)return n(b,I),It&&Wo(b,L),T;if(I===null){for(;LL?(P=I,I=null):P=I.sibling;var $=h(b,I,U.value,E);if($===null){I===null&&(I=P);break}e&&I&&$.alternate===null&&t(b,I),p=i($,p,L),W===null?T=$:W.sibling=$,W=$,I=P}if(U.done)return n(b,I),It&&Wo(b,L),T;if(I===null){for(;!U.done;L++,U=y.next())U=w(b,U.value,E),U!==null&&(p=i(U,p,L),W===null?T=U:W.sibling=U,W=U);return It&&Wo(b,L),T}for(I=r(b,I);!U.done;L++,U=y.next())U=S(I,b,L,U.value,E),U!==null&&(e&&U.alternate!==null&&I.delete(U.key===null?L:U.key),p=i(U,p,L),W===null?T=U:W.sibling=U,W=U);return e&&I.forEach(function(M){return t(b,M)}),It&&Wo(b,L),T}function O(b,p,y,E){if(typeof y=="object"&&y!==null&&y.type===ci&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case bs:e:{for(var T=y.key,W=p;W!==null;){if(W.key===T){if(T=y.type,T===ci){if(W.tag===7){n(b,W.sibling),p=o(W,y.props.children),p.return=b,b=p;break e}}else if(W.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===oo&&$1(T)===W.type){n(b,W.sibling),p=o(W,y.props),p.ref=nl(b,W,y),p.return=b,b=p;break e}n(b,W);break}else t(b,W);W=W.sibling}y.type===ci?(p=Fo(y.props.children,b.mode,E,y.key),p.return=b,b=p):(E=oa(y.type,y.key,y.props,null,b.mode,E),E.ref=nl(b,p,y),E.return=b,b=E)}return l(b);case ai:e:{for(W=y.key;p!==null;){if(p.key===W)if(p.tag===4&&p.stateNode.containerInfo===y.containerInfo&&p.stateNode.implementation===y.implementation){n(b,p.sibling),p=o(p,y.children||[]),p.return=b,b=p;break e}else{n(b,p);break}else t(b,p);p=p.sibling}p=nu(y,b.mode,E),p.return=b,b=p}return l(b);case oo:return W=y._init,O(b,p,W(y._payload),E)}if(sl(y))return C(b,p,y,E);if(Gi(y))return _(b,p,y,E);Is(b,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,p!==null&&p.tag===6?(n(b,p.sibling),p=o(p,y),p.return=b,b=p):(n(b,p),p=tu(y,b.mode,E),p.return=b,b=p),l(b)):n(b,p)}return O}var Wi=_2(!0),k2=_2(!1),Ca=Po(null),ba=null,mi=null,Gf=null;function Jf(){Gf=mi=ba=null}function Xf(e){var t=Ca.current;Mt(Ca),e._currentValue=t}function Qu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Li(e,t){ba=e,Gf=mi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(jn=!0),e.firstContext=null)}function sr(e){var t=e._currentValue;if(Gf!==e)if(e={context:e,memoizedValue:t,next:null},mi===null){if(ba===null)throw Error(le(308));mi=e,ba.dependencies={lanes:0,firstContext:e}}else mi=mi.next=e;return t}var Bo=null;function ed(e){Bo===null?Bo=[e]:Bo.push(e)}function E2(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,ed(t)):(n.next=o.next,o.next=n),t.interleaved=n,Qr(e,r)}function Qr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var io=!1;function td(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function T2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Hr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,mt&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Qr(e,n)}return o=r.interleaved,o===null?(t.next=t,ed(r)):(t.next=o.next,o.next=t),r.interleaved=t,Qr(e,n)}function Js(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jf(e,n)}}function W1(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=l:i=i.next=l,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Sa(e,t,n,r){var o=e.updateQueue;io=!1;var i=o.firstBaseUpdate,l=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var c=s,f=c.next;c.next=null,l===null?i=f:l.next=f,l=c;var d=e.alternate;d!==null&&(d=d.updateQueue,s=d.lastBaseUpdate,s!==l&&(s===null?d.firstBaseUpdate=f:s.next=f,d.lastBaseUpdate=c))}if(i!==null){var w=o.baseState;l=0,d=f=c=null,s=i;do{var h=s.lane,S=s.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:S,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var C=e,_=s;switch(h=t,S=n,_.tag){case 1:if(C=_.payload,typeof C=="function"){w=C.call(S,w,h);break e}w=C;break e;case 3:C.flags=C.flags&-65537|128;case 0:if(C=_.payload,h=typeof C=="function"?C.call(S,w,h):C,h==null)break e;w=Bt({},w,h);break e;case 2:io=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[s]:h.push(s))}else S={eventTime:S,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},d===null?(f=d=S,c=w):d=d.next=S,l|=h;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;h=s,s=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(!0);if(d===null&&(c=w),o.baseState=c,o.firstBaseUpdate=f,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Go|=l,e.lanes=l,e.memoizedState=w}}function N1(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Zc.transition;Zc.transition={};try{e(!1),t()}finally{kt=n,Zc.transition=r}}function z2(){return ar().memoizedState}function X5(e,t,n){var r=xo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},V2(e))K2(t,n);else if(n=E2(e,t,n,r),n!==null){var o=Mn();vr(n,e,r,o),q2(n,t,r)}}function e3(e,t,n){var r=xo(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(V2(e))K2(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,s=i(l,n);if(o.hasEagerState=!0,o.eagerState=s,mr(s,l)){var c=t.interleaved;c===null?(o.next=o,ed(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=E2(e,t,o,r),n!==null&&(o=Mn(),vr(n,e,r,o),q2(n,t,r))}}function V2(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function K2(e,t){Cl=ka=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function q2(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jf(e,n)}}var Ea={readContext:sr,useCallback:Cn,useContext:Cn,useEffect:Cn,useImperativeHandle:Cn,useInsertionEffect:Cn,useLayoutEffect:Cn,useMemo:Cn,useReducer:Cn,useRef:Cn,useState:Cn,useDebugValue:Cn,useDeferredValue:Cn,useTransition:Cn,useMutableSource:Cn,useSyncExternalStore:Cn,useId:Cn,unstable_isNewReconciler:!1},t3={readContext:sr,useCallback:function(e,t){return xr().memoizedState=[e,t===void 0?null:t],e},useContext:sr,useEffect:O1,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ea(4194308,4,B2.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ea(4194308,4,e,t)},useInsertionEffect:function(e,t){return ea(4,2,e,t)},useMemo:function(e,t){var n=xr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=xr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=X5.bind(null,Ot,e),[r.memoizedState,e]},useRef:function(e){var t=xr();return e={current:e},t.memoizedState=e},useState:U1,useDebugValue:cd,useDeferredValue:function(e){return xr().memoizedState=e},useTransition:function(){var e=U1(!1),t=e[0];return e=J5.bind(null,e[1]),xr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ot,o=xr();if(It){if(n===void 0)throw Error(le(407));n=n()}else{if(n=t(),an===null)throw Error(le(349));Zo&30||M2(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,O1(I2.bind(null,r,i,e),[e]),r.flags|=2048,Ql(9,R2.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=xr(),t=an.identifierPrefix;if(It){var n=jr,r=Br;n=(r&~(1<<32-gr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Kl++,0")&&(c=c.replace("",e.displayName)),c}while(1<=l&&0<=s);break}}}finally{Ic=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ll(e):""}function Mv(e){switch(e.tag){case 5:return ll(e.type);case 16:return ll("Lazy");case 13:return ll("Suspense");case 19:return ll("SuspenseList");case 0:case 2:case 15:return e=$c(e.type,!1),e;case 11:return e=$c(e.type.render,!1),e;case 1:return e=$c(e.type,!0),e;default:return""}}function Su(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ci:return"Fragment";case ai:return"Portal";case xu:return"Profiler";case Nf:return"StrictMode";case Cu:return"Suspense";case bu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Th:return(e.displayName||"Context")+".Consumer";case Eh:return(e._context.displayName||"Context")+".Provider";case Wf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Uf:return t=e.displayName||null,t!==null?t:Su(e.type)||"Memo";case oo:t=e._payload,e=e._init;try{return Su(e(t))}catch{}}return null}function Rv(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Su(t);case 8:return t===Nf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function So(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Lh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Iv(e){var t=Lh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ss(e){e._valueTracker||(e._valueTracker=Iv(e))}function Ph(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Lh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function aa(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function _u(e,t){var n=t.checked;return Bt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function r1(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=So(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mh(e,t){t=t.checked,t!=null&&$f(e,"checked",t,!1)}function ku(e,t){Mh(e,t);var n=So(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Eu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Eu(e,t.type,So(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function o1(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Eu(e,t,n){(t!=="number"||aa(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var sl=Array.isArray;function ki(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=_s.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function $l(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var vl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$v=["Webkit","ms","Moz","O"];Object.keys(vl).forEach(function(e){$v.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),vl[t]=vl[e]})});function Nh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||vl.hasOwnProperty(e)&&vl[e]?(""+t).trim():t+"px"}function Wh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Nh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Nv=Bt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Lu(e,t){if(t){if(Nv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(le(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(le(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(le(61))}if(t.style!=null&&typeof t.style!="object")throw Error(le(62))}}function Pu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Mu=null;function Of(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ru=null,Ei=null,Ti=null;function s1(e){if(e=as(e)){if(typeof Ru!="function")throw Error(le(280));var t=e.stateNode;t&&(t=oc(t),Ru(e.stateNode,e.type,t))}}function Uh(e){Ei?Ti?Ti.push(e):Ti=[e]:Ei=e}function Oh(){if(Ei){var e=Ei,t=Ti;if(Ti=Ei=null,s1(e),t)for(e=0;e>>=0,e===0?32:31-(Kv(e)/qv|0)|0}var ks=64,Es=4194304;function al(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function da(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~o;s!==0?r=al(s):(i&=l,i!==0&&(r=al(i)))}else l=n&~o,l!==0?r=al(l):i!==0&&(r=al(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ls(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gr(t),e[t]=n}function Gv(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=yl),v1=" ",m1=!1;function o2(e,t){switch(e){case"keyup":return k5.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function i2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ui=!1;function T5(e,t){switch(e){case"compositionend":return i2(t);case"keypress":return t.which!==32?null:(m1=!0,v1);case"textInput":return e=t.data,e===v1&&m1?null:e;default:return null}}function A5(e,t){if(ui)return e==="compositionend"||!Kf&&o2(e,t)?(e=n2(),Zs=Ff=uo=null,ui=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=C1(n)}}function c2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?c2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function u2(){for(var e=window,t=aa();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=aa(e.document)}return t}function qf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function U5(e){var t=u2(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&c2(n.ownerDocument.documentElement,n)){if(r!==null&&qf(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=b1(n,i);var l=b1(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,fi=null,Ou=null,xl=null,Bu=!1;function S1(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Bu||fi==null||fi!==aa(r)||(r=fi,"selectionStart"in r&&qf(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),xl&&jl(xl,r)||(xl=r,r=ga(Ou,"onSelect"),0pi||(e.current=Vu[pi],Vu[pi]=null,pi--)}function At(e,t){pi++,Vu[pi]=e.current,e.current=t}var _o={},En=Po(_o),Dn=Po(!1),Qo=_o;function Ii(e,t){var n=e.type.contextTypes;if(!n)return _o;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Hn(e){return e=e.childContextTypes,e!=null}function ma(){Mt(Dn),Mt(En)}function P1(e,t,n){if(En.current!==_o)throw Error(le(168));At(En,t),At(Dn,n)}function w2(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(le(108,Rv(e)||"Unknown",o));return Bt({},n,r)}function ya(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||_o,Qo=En.current,At(En,e),At(Dn,Dn.current),!0}function M1(e,t,n){var r=e.stateNode;if(!r)throw Error(le(169));n?(e=w2(e,t,Qo),r.__reactInternalMemoizedMergedChildContext=e,Mt(Dn),Mt(En),At(En,e)):Mt(Dn),At(Dn,n)}var Ur=null,ic=!1,Qc=!1;function x2(e){Ur===null?Ur=[e]:Ur.push(e)}function Y5(e){ic=!0,x2(e)}function Mo(){if(!Qc&&Ur!==null){Qc=!0;var e=0,t=kt;try{var n=Ur;for(kt=1;e>=l,o-=l,jr=1<<32-gr(t)+o|n<L?(P=I,I=null):P=I.sibling;var U=h(b,I,y[L],E);if(U===null){I===null&&(I=P);break}e&&I&&U.alternate===null&&t(b,I),p=i(U,p,L),N===null?T=U:N.sibling=U,N=U,I=P}if(L===y.length)return n(b,I),It&&No(b,L),T;if(I===null){for(;LL?(P=I,I=null):P=I.sibling;var $=h(b,I,U.value,E);if($===null){I===null&&(I=P);break}e&&I&&$.alternate===null&&t(b,I),p=i($,p,L),N===null?T=$:N.sibling=$,N=$,I=P}if(U.done)return n(b,I),It&&No(b,L),T;if(I===null){for(;!U.done;L++,U=y.next())U=w(b,U.value,E),U!==null&&(p=i(U,p,L),N===null?T=U:N.sibling=U,N=U);return It&&No(b,L),T}for(I=r(b,I);!U.done;L++,U=y.next())U=S(I,b,L,U.value,E),U!==null&&(e&&U.alternate!==null&&I.delete(U.key===null?L:U.key),p=i(U,p,L),N===null?T=U:N.sibling=U,N=U);return e&&I.forEach(function(M){return t(b,M)}),It&&No(b,L),T}function O(b,p,y,E){if(typeof y=="object"&&y!==null&&y.type===ci&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case bs:e:{for(var T=y.key,N=p;N!==null;){if(N.key===T){if(T=y.type,T===ci){if(N.tag===7){n(b,N.sibling),p=o(N,y.props.children),p.return=b,b=p;break e}}else if(N.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===oo&&$1(T)===N.type){n(b,N.sibling),p=o(N,y.props),p.ref=nl(b,N,y),p.return=b,b=p;break e}n(b,N);break}else t(b,N);N=N.sibling}y.type===ci?(p=Fo(y.props.children,b.mode,E,y.key),p.return=b,b=p):(E=oa(y.type,y.key,y.props,null,b.mode,E),E.ref=nl(b,p,y),E.return=b,b=E)}return l(b);case ai:e:{for(N=y.key;p!==null;){if(p.key===N)if(p.tag===4&&p.stateNode.containerInfo===y.containerInfo&&p.stateNode.implementation===y.implementation){n(b,p.sibling),p=o(p,y.children||[]),p.return=b,b=p;break e}else{n(b,p);break}else t(b,p);p=p.sibling}p=nu(y,b.mode,E),p.return=b,b=p}return l(b);case oo:return N=y._init,O(b,p,N(y._payload),E)}if(sl(y))return C(b,p,y,E);if(Gi(y))return _(b,p,y,E);Is(b,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,p!==null&&p.tag===6?(n(b,p.sibling),p=o(p,y),p.return=b,b=p):(n(b,p),p=tu(y,b.mode,E),p.return=b,b=p),l(b)):n(b,p)}return O}var Ni=_2(!0),k2=_2(!1),Ca=Po(null),ba=null,mi=null,Gf=null;function Jf(){Gf=mi=ba=null}function Xf(e){var t=Ca.current;Mt(Ca),e._currentValue=t}function Qu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Li(e,t){ba=e,Gf=mi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(jn=!0),e.firstContext=null)}function sr(e){var t=e._currentValue;if(Gf!==e)if(e={context:e,memoizedValue:t,next:null},mi===null){if(ba===null)throw Error(le(308));mi=e,ba.dependencies={lanes:0,firstContext:e}}else mi=mi.next=e;return t}var Bo=null;function ed(e){Bo===null?Bo=[e]:Bo.push(e)}function E2(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,ed(t)):(n.next=o.next,o.next=n),t.interleaved=n,Qr(e,r)}function Qr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var io=!1;function td(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function T2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Fr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,mt&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Qr(e,n)}return o=r.interleaved,o===null?(t.next=t,ed(r)):(t.next=o.next,o.next=t),r.interleaved=t,Qr(e,n)}function Js(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jf(e,n)}}function N1(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=l:i=i.next=l,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Sa(e,t,n,r){var o=e.updateQueue;io=!1;var i=o.firstBaseUpdate,l=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var c=s,f=c.next;c.next=null,l===null?i=f:l.next=f,l=c;var d=e.alternate;d!==null&&(d=d.updateQueue,s=d.lastBaseUpdate,s!==l&&(s===null?d.firstBaseUpdate=f:s.next=f,d.lastBaseUpdate=c))}if(i!==null){var w=o.baseState;l=0,d=f=c=null,s=i;do{var h=s.lane,S=s.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:S,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var C=e,_=s;switch(h=t,S=n,_.tag){case 1:if(C=_.payload,typeof C=="function"){w=C.call(S,w,h);break e}w=C;break e;case 3:C.flags=C.flags&-65537|128;case 0:if(C=_.payload,h=typeof C=="function"?C.call(S,w,h):C,h==null)break e;w=Bt({},w,h);break e;case 2:io=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[s]:h.push(s))}else S={eventTime:S,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},d===null?(f=d=S,c=w):d=d.next=S,l|=h;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;h=s,s=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(!0);if(d===null&&(c=w),o.baseState=c,o.firstBaseUpdate=f,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Go|=l,e.lanes=l,e.memoizedState=w}}function W1(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Zc.transition;Zc.transition={};try{e(!1),t()}finally{kt=n,Zc.transition=r}}function z2(){return ar().memoizedState}function X5(e,t,n){var r=xo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},V2(e))K2(t,n);else if(n=E2(e,t,n,r),n!==null){var o=Mn();vr(n,e,r,o),q2(n,t,r)}}function e3(e,t,n){var r=xo(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(V2(e))K2(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,s=i(l,n);if(o.hasEagerState=!0,o.eagerState=s,yr(s,l)){var c=t.interleaved;c===null?(o.next=o,ed(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=E2(e,t,o,r),n!==null&&(o=Mn(),vr(n,e,r,o),q2(n,t,r))}}function V2(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function K2(e,t){Cl=ka=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function q2(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jf(e,n)}}var Ea={readContext:sr,useCallback:Cn,useContext:Cn,useEffect:Cn,useImperativeHandle:Cn,useInsertionEffect:Cn,useLayoutEffect:Cn,useMemo:Cn,useReducer:Cn,useRef:Cn,useState:Cn,useDebugValue:Cn,useDeferredValue:Cn,useTransition:Cn,useMutableSource:Cn,useSyncExternalStore:Cn,useId:Cn,unstable_isNewReconciler:!1},t3={readContext:sr,useCallback:function(e,t){return Cr().memoizedState=[e,t===void 0?null:t],e},useContext:sr,useEffect:O1,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ea(4194308,4,B2.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ea(4194308,4,e,t)},useInsertionEffect:function(e,t){return ea(4,2,e,t)},useMemo:function(e,t){var n=Cr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Cr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=X5.bind(null,Ot,e),[r.memoizedState,e]},useRef:function(e){var t=Cr();return e={current:e},t.memoizedState=e},useState:U1,useDebugValue:cd,useDeferredValue:function(e){return Cr().memoizedState=e},useTransition:function(){var e=U1(!1),t=e[0];return e=J5.bind(null,e[1]),Cr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ot,o=Cr();if(It){if(n===void 0)throw Error(le(407));n=n()}else{if(n=t(),cn===null)throw Error(le(349));Zo&30||M2(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,O1(I2.bind(null,r,i,e),[e]),r.flags|=2048,Ql(9,R2.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Cr(),t=cn.identifierPrefix;if(It){var n=Dr,r=jr;n=(r&~(1<<32-gr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Kl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[Cr]=t,e[Fl]=r,rp(e,t,!1,!1),t.stateNode=e;e:{switch(l=Pu(n,r),n){case"dialog":Lt("cancel",e),Lt("close",e),o=r;break;case"iframe":case"object":case"embed":Lt("load",e),o=r;break;case"video":case"audio":for(o=0;oOi&&(t.flags|=128,r=!0,rl(i,!1),t.lanes=4194304)}else{if(!r)if(e=_a(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),rl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!It)return bn(t),null}else 2*Qt()-i.renderingStartTime>Oi&&n!==1073741824&&(t.flags|=128,r=!0,rl(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Qt(),t.sibling=null,n=Ut.current,At(Ut,r?n&1|2:n&1),t):(bn(t),null);case 22:case 23:return gd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Kn&1073741824&&(bn(t),t.subtreeFlags&6&&(t.flags|=8192)):bn(t),null;case 24:return null;case 25:return null}throw Error(le(156,t.tag))}function c3(e,t){switch(Yf(t),t.tag){case 1:return Hn(t.type)&&ma(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ni(),Mt(Dn),Mt(En),od(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return rd(t),null;case 13:if(Mt(Ut),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(le(340));$i()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Mt(Ut),null;case 4:return Ni(),null;case 10:return Xf(t.type._context),null;case 22:case 23:return gd(),null;case 24:return null;default:return null}}var Ws=!1,Sn=!1,u3=typeof WeakSet=="function"?WeakSet:Set,ve=null;function yi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Vt(e,t,r)}else n.current=null}function rf(e,t,n){try{n()}catch(r){Vt(e,t,r)}}var Y1=!1;function f3(e,t){if(ju=ha,e=u2(),qf(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,s=-1,c=-1,f=0,d=0,w=e,h=null;t:for(;;){for(var S;w!==n||o!==0&&w.nodeType!==3||(s=l+o),w!==i||r!==0&&w.nodeType!==3||(c=l+r),w.nodeType===3&&(l+=w.nodeValue.length),(S=w.firstChild)!==null;)h=w,w=S;for(;;){if(w===e)break t;if(h===n&&++f===o&&(s=l),h===i&&++d===r&&(c=l),(S=w.nextSibling)!==null)break;w=h,h=w.parentNode}w=S}n=s===-1||c===-1?null:{start:s,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Du={focusedElem:e,selectionRange:n},ha=!1,ve=t;ve!==null;)if(t=ve,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ve=e;else for(;ve!==null;){t=ve;try{var C=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var _=C.memoizedProps,O=C.memoizedState,b=t.stateNode,p=b.getSnapshotBeforeUpdate(t.elementType===t.type?_:fr(t.type,_),O);b.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(le(163))}}catch(E){Vt(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,ve=e;break}ve=t.return}return C=Y1,Y1=!1,C}function bl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&rf(t,n,i)}o=o.next}while(o!==r)}}function ac(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function of(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function lp(e){var t=e.alternate;t!==null&&(e.alternate=null,lp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Cr],delete t[Fl],delete t[zu],delete t[q5],delete t[Q5])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function sp(e){return e.tag===5||e.tag===3||e.tag===4}function Z1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function lf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=va));else if(r!==4&&(e=e.child,e!==null))for(lf(e,t,n),e=e.sibling;e!==null;)lf(e,t,n),e=e.sibling}function sf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(sf(e,t,n),e=e.sibling;e!==null;)sf(e,t,n),e=e.sibling}var dn=null,dr=!1;function ro(e,t,n){for(n=n.child;n!==null;)ap(e,t,n),n=n.sibling}function ap(e,t,n){if(kr&&typeof kr.onCommitFiberUnmount=="function")try{kr.onCommitFiberUnmount(ec,n)}catch{}switch(n.tag){case 5:Sn||yi(n,t);case 6:var r=dn,o=dr;dn=null,ro(e,t,n),dn=r,dr=o,dn!==null&&(dr?(e=dn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):dn.removeChild(n.stateNode));break;case 18:dn!==null&&(dr?(e=dn,n=n.stateNode,e.nodeType===8?qc(e.parentNode,n):e.nodeType===1&&qc(e,n),Ol(e)):qc(dn,n.stateNode));break;case 4:r=dn,o=dr,dn=n.stateNode.containerInfo,dr=!0,ro(e,t,n),dn=r,dr=o;break;case 0:case 11:case 14:case 15:if(!Sn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&rf(n,t,l),o=o.next}while(o!==r)}ro(e,t,n);break;case 1:if(!Sn&&(yi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Vt(n,t,s)}ro(e,t,n);break;case 21:ro(e,t,n);break;case 22:n.mode&1?(Sn=(r=Sn)||n.memoizedState!==null,ro(e,t,n),Sn=r):ro(e,t,n);break;default:ro(e,t,n)}}function G1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new u3),t.forEach(function(r){var o=x3.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ur(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~i}if(r=o,r=Qt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*h3(r/1960))-r,10e?16:e,fo===null)var r=!1;else{if(e=fo,fo=null,La=0,mt&6)throw Error(le(331));var o=mt;for(mt|=4,ve=e.current;ve!==null;){var i=ve,l=i.child;if(ve.flags&16){var s=i.deletions;if(s!==null){for(var c=0;cQt()-hd?Ho(e,0):dd|=n),Fn(e,t)}function vp(e,t){t===0&&(e.mode&1?(t=Es,Es<<=1,!(Es&130023424)&&(Es=4194304)):t=1);var n=Mn();e=Qr(e,t),e!==null&&(ls(e,t,n),Fn(e,n))}function w3(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),vp(e,n)}function x3(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(le(314))}r!==null&&r.delete(t),vp(e,n)}var mp;mp=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dn.current)jn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return jn=!1,s3(e,t,n);jn=!!(e.flags&131072)}else jn=!1,It&&t.flags&1048576&&C2(t,xa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ta(e,t),e=t.pendingProps;var o=Ii(t,En.current);Li(t,n),o=ld(null,t,r,e,o,n);var i=sd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Hn(r)?(i=!0,ya(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,td(t),o.updater=sc,t.stateNode=o,o._reactInternals=t,Zu(t,r,e,n),t=Xu(null,t,r,!0,i,n)):(t.tag=0,It&&i&&Qf(t),Pn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ta(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=b3(r),e=fr(r,e),o){case 0:t=Ju(null,t,r,e,n);break e;case 1:t=K1(null,t,r,e,n);break e;case 11:t=z1(null,t,r,e,n);break e;case 14:t=V1(null,t,r,fr(r.type,e),n);break e}throw Error(le(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fr(r,o),Ju(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fr(r,o),K1(e,t,r,o,n);case 3:e:{if(ep(t),e===null)throw Error(le(387));r=t.pendingProps,i=t.memoizedState,o=i.element,T2(e,t),Sa(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Ui(Error(le(423)),t),t=q1(e,t,r,n,o);break e}else if(r!==o){o=Ui(Error(le(424)),t),t=q1(e,t,r,n,o);break e}else for(qn=mo(t.stateNode.containerInfo.firstChild),Yn=t,It=!0,hr=null,n=k2(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($i(),r===o){t=Yr(e,t,n);break e}Pn(e,t,r,n)}t=t.child}return t;case 5:return A2(t),e===null&&qu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,Hu(r,o)?l=null:i!==null&&Hu(r,i)&&(t.flags|=32),X2(e,t),Pn(e,t,l,n),t.child;case 6:return e===null&&qu(t),null;case 13:return tp(e,t,n);case 4:return nd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Wi(t,null,r,n):Pn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fr(r,o),z1(e,t,r,o,n);case 7:return Pn(e,t,t.pendingProps,n),t.child;case 8:return Pn(e,t,t.pendingProps.children,n),t.child;case 12:return Pn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,l=o.value,At(Ca,r._currentValue),r._currentValue=l,i!==null)if(mr(i.value,l)){if(i.children===o.children&&!Dn.current){t=Yr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){l=i.child;for(var c=s.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Hr(-1,n&-n),c.tag=2;var f=i.updateQueue;if(f!==null){f=f.shared;var d=f.pending;d===null?c.next=c:(c.next=d.next,d.next=c),f.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Qu(i.return,n,t),s.lanes|=n;break}c=c.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(le(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),Qu(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}Pn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Li(t,n),o=sr(o),r=r(o),t.flags|=1,Pn(e,t,r,n),t.child;case 14:return r=t.type,o=fr(r,t.pendingProps),o=fr(r.type,o),V1(e,t,r,o,n);case 15:return G2(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fr(r,o),ta(e,t),t.tag=1,Hn(r)?(e=!0,ya(t)):e=!1,Li(t,n),Q2(t,r,o),Zu(t,r,o,n),Xu(null,t,r,!0,e,n);case 19:return np(e,t,n);case 22:return J2(e,t,n)}throw Error(le(156,t.tag))};function yp(e,t){return Vh(e,t)}function C3(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function or(e,t,n,r){return new C3(e,t,n,r)}function md(e){return e=e.prototype,!(!e||!e.isReactComponent)}function b3(e){if(typeof e=="function")return md(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Nf)return 11;if(e===Uf)return 14}return 2}function Co(e,t){var n=e.alternate;return n===null?(n=or(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function oa(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")md(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case ci:return Fo(n.children,o,i,t);case Wf:l=8,o|=8;break;case xu:return e=or(12,n,t,o|2),e.elementType=xu,e.lanes=i,e;case Cu:return e=or(13,n,t,o),e.elementType=Cu,e.lanes=i,e;case bu:return e=or(19,n,t,o),e.elementType=bu,e.lanes=i,e;case Ah:return uc(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Eh:l=10;break e;case Th:l=9;break e;case Nf:l=11;break e;case Uf:l=14;break e;case oo:l=16,r=null;break e}throw Error(le(130,e==null?e:typeof e,""))}return t=or(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Fo(e,t,n,r){return e=or(7,e,r,t),e.lanes=n,e}function uc(e,t,n,r){return e=or(22,e,r,t),e.elementType=Ah,e.lanes=n,e.stateNode={isHidden:!1},e}function tu(e,t,n){return e=or(6,e,null,t),e.lanes=n,e}function nu(e,t,n){return t=or(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function S3(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Nc(0),this.expirationTimes=Nc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nc(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function yd(e,t,n,r,o,i,l,s,c){return e=new S3(e,t,n,s,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=or(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},td(i),e}function _3(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(bp)}catch(e){console.error(e)}}bp(),bh.exports=Jn;var L3=bh.exports,i0=L3;yu.createRoot=i0.createRoot,yu.hydrateRoot=i0.hydrateRoot;var Sp={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():(t.nacl||(t.nacl={}),t.nacl.util=n())})(ch,function(){var t={};function n(r){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(r))throw new TypeError("invalid encoding")}return t.decodeUTF8=function(r){if(typeof r!="string")throw new TypeError("expected string");var o,i=unescape(encodeURIComponent(r)),l=new Uint8Array(i.length);for(o=0;o"u"?typeof Buffer.from<"u"?(t.encodeBase64=function(r){return Buffer.from(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(Buffer.from(r,"base64"),0))}):(t.encodeBase64=function(r){return new Buffer(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0))}):(t.encodeBase64=function(r){var o,i=[],l=r.length;for(o=0;o>24&255,u[g+1]=v>>16&255,u[g+2]=v>>8&255,u[g+3]=v&255,u[g+4]=a>>24&255,u[g+5]=a>>16&255,u[g+6]=a>>8&255,u[g+7]=a&255}function _(u,g,v,a,x){var N,B=0;for(N=0;N>>8)-1}function O(u,g,v,a){return _(u,g,v,a,16)}function b(u,g,v,a){return _(u,g,v,a,32)}function p(u,g,v,a){for(var x=a[0]&255|(a[1]&255)<<8|(a[2]&255)<<16|(a[3]&255)<<24,N=v[0]&255|(v[1]&255)<<8|(v[2]&255)<<16|(v[3]&255)<<24,B=v[4]&255|(v[5]&255)<<8|(v[6]&255)<<16|(v[7]&255)<<24,Q=v[8]&255|(v[9]&255)<<8|(v[10]&255)<<16|(v[11]&255)<<24,se=v[12]&255|(v[13]&255)<<8|(v[14]&255)<<16|(v[15]&255)<<24,be=a[4]&255|(a[5]&255)<<8|(a[6]&255)<<16|(a[7]&255)<<24,ue=g[0]&255|(g[1]&255)<<8|(g[2]&255)<<16|(g[3]&255)<<24,pt=g[4]&255|(g[5]&255)<<8|(g[6]&255)<<16|(g[7]&255)<<24,pe=g[8]&255|(g[9]&255)<<8|(g[10]&255)<<16|(g[11]&255)<<24,Be=g[12]&255|(g[13]&255)<<8|(g[14]&255)<<16|(g[15]&255)<<24,De=a[8]&255|(a[9]&255)<<8|(a[10]&255)<<16|(a[11]&255)<<24,qe=v[16]&255|(v[17]&255)<<8|(v[18]&255)<<16|(v[19]&255)<<24,Ke=v[20]&255|(v[21]&255)<<8|(v[22]&255)<<16|(v[23]&255)<<24,He=v[24]&255|(v[25]&255)<<8|(v[26]&255)<<16|(v[27]&255)<<24,ze=v[28]&255|(v[29]&255)<<8|(v[30]&255)<<16|(v[31]&255)<<24,Fe=a[12]&255|(a[13]&255)<<8|(a[14]&255)<<16|(a[15]&255)<<24,me=x,ke=N,fe=B,we=Q,xe=se,ce=be,H=ue,F=pt,te=pe,q=Be,Y=De,ie=qe,$e=Ke,Qe=He,Je=ze,Ye=Fe,k,rt=0;rt<20;rt+=2)k=me+$e|0,xe^=k<<7|k>>>25,k=xe+me|0,te^=k<<9|k>>>23,k=te+xe|0,$e^=k<<13|k>>>19,k=$e+te|0,me^=k<<18|k>>>14,k=ce+ke|0,q^=k<<7|k>>>25,k=q+ce|0,Qe^=k<<9|k>>>23,k=Qe+q|0,ke^=k<<13|k>>>19,k=ke+Qe|0,ce^=k<<18|k>>>14,k=Y+H|0,Je^=k<<7|k>>>25,k=Je+Y|0,fe^=k<<9|k>>>23,k=fe+Je|0,H^=k<<13|k>>>19,k=H+fe|0,Y^=k<<18|k>>>14,k=Ye+ie|0,we^=k<<7|k>>>25,k=we+Ye|0,F^=k<<9|k>>>23,k=F+we|0,ie^=k<<13|k>>>19,k=ie+F|0,Ye^=k<<18|k>>>14,k=me+we|0,ke^=k<<7|k>>>25,k=ke+me|0,fe^=k<<9|k>>>23,k=fe+ke|0,we^=k<<13|k>>>19,k=we+fe|0,me^=k<<18|k>>>14,k=ce+xe|0,H^=k<<7|k>>>25,k=H+ce|0,F^=k<<9|k>>>23,k=F+H|0,xe^=k<<13|k>>>19,k=xe+F|0,ce^=k<<18|k>>>14,k=Y+q|0,ie^=k<<7|k>>>25,k=ie+Y|0,te^=k<<9|k>>>23,k=te+ie|0,q^=k<<13|k>>>19,k=q+te|0,Y^=k<<18|k>>>14,k=Ye+Je|0,$e^=k<<7|k>>>25,k=$e+Ye|0,Qe^=k<<9|k>>>23,k=Qe+$e|0,Je^=k<<13|k>>>19,k=Je+Qe|0,Ye^=k<<18|k>>>14;me=me+x|0,ke=ke+N|0,fe=fe+B|0,we=we+Q|0,xe=xe+se|0,ce=ce+be|0,H=H+ue|0,F=F+pt|0,te=te+pe|0,q=q+Be|0,Y=Y+De|0,ie=ie+qe|0,$e=$e+Ke|0,Qe=Qe+He|0,Je=Je+ze|0,Ye=Ye+Fe|0,u[0]=me>>>0&255,u[1]=me>>>8&255,u[2]=me>>>16&255,u[3]=me>>>24&255,u[4]=ke>>>0&255,u[5]=ke>>>8&255,u[6]=ke>>>16&255,u[7]=ke>>>24&255,u[8]=fe>>>0&255,u[9]=fe>>>8&255,u[10]=fe>>>16&255,u[11]=fe>>>24&255,u[12]=we>>>0&255,u[13]=we>>>8&255,u[14]=we>>>16&255,u[15]=we>>>24&255,u[16]=xe>>>0&255,u[17]=xe>>>8&255,u[18]=xe>>>16&255,u[19]=xe>>>24&255,u[20]=ce>>>0&255,u[21]=ce>>>8&255,u[22]=ce>>>16&255,u[23]=ce>>>24&255,u[24]=H>>>0&255,u[25]=H>>>8&255,u[26]=H>>>16&255,u[27]=H>>>24&255,u[28]=F>>>0&255,u[29]=F>>>8&255,u[30]=F>>>16&255,u[31]=F>>>24&255,u[32]=te>>>0&255,u[33]=te>>>8&255,u[34]=te>>>16&255,u[35]=te>>>24&255,u[36]=q>>>0&255,u[37]=q>>>8&255,u[38]=q>>>16&255,u[39]=q>>>24&255,u[40]=Y>>>0&255,u[41]=Y>>>8&255,u[42]=Y>>>16&255,u[43]=Y>>>24&255,u[44]=ie>>>0&255,u[45]=ie>>>8&255,u[46]=ie>>>16&255,u[47]=ie>>>24&255,u[48]=$e>>>0&255,u[49]=$e>>>8&255,u[50]=$e>>>16&255,u[51]=$e>>>24&255,u[52]=Qe>>>0&255,u[53]=Qe>>>8&255,u[54]=Qe>>>16&255,u[55]=Qe>>>24&255,u[56]=Je>>>0&255,u[57]=Je>>>8&255,u[58]=Je>>>16&255,u[59]=Je>>>24&255,u[60]=Ye>>>0&255,u[61]=Ye>>>8&255,u[62]=Ye>>>16&255,u[63]=Ye>>>24&255}function y(u,g,v,a){for(var x=a[0]&255|(a[1]&255)<<8|(a[2]&255)<<16|(a[3]&255)<<24,N=v[0]&255|(v[1]&255)<<8|(v[2]&255)<<16|(v[3]&255)<<24,B=v[4]&255|(v[5]&255)<<8|(v[6]&255)<<16|(v[7]&255)<<24,Q=v[8]&255|(v[9]&255)<<8|(v[10]&255)<<16|(v[11]&255)<<24,se=v[12]&255|(v[13]&255)<<8|(v[14]&255)<<16|(v[15]&255)<<24,be=a[4]&255|(a[5]&255)<<8|(a[6]&255)<<16|(a[7]&255)<<24,ue=g[0]&255|(g[1]&255)<<8|(g[2]&255)<<16|(g[3]&255)<<24,pt=g[4]&255|(g[5]&255)<<8|(g[6]&255)<<16|(g[7]&255)<<24,pe=g[8]&255|(g[9]&255)<<8|(g[10]&255)<<16|(g[11]&255)<<24,Be=g[12]&255|(g[13]&255)<<8|(g[14]&255)<<16|(g[15]&255)<<24,De=a[8]&255|(a[9]&255)<<8|(a[10]&255)<<16|(a[11]&255)<<24,qe=v[16]&255|(v[17]&255)<<8|(v[18]&255)<<16|(v[19]&255)<<24,Ke=v[20]&255|(v[21]&255)<<8|(v[22]&255)<<16|(v[23]&255)<<24,He=v[24]&255|(v[25]&255)<<8|(v[26]&255)<<16|(v[27]&255)<<24,ze=v[28]&255|(v[29]&255)<<8|(v[30]&255)<<16|(v[31]&255)<<24,Fe=a[12]&255|(a[13]&255)<<8|(a[14]&255)<<16|(a[15]&255)<<24,me=x,ke=N,fe=B,we=Q,xe=se,ce=be,H=ue,F=pt,te=pe,q=Be,Y=De,ie=qe,$e=Ke,Qe=He,Je=ze,Ye=Fe,k,rt=0;rt<20;rt+=2)k=me+$e|0,xe^=k<<7|k>>>25,k=xe+me|0,te^=k<<9|k>>>23,k=te+xe|0,$e^=k<<13|k>>>19,k=$e+te|0,me^=k<<18|k>>>14,k=ce+ke|0,q^=k<<7|k>>>25,k=q+ce|0,Qe^=k<<9|k>>>23,k=Qe+q|0,ke^=k<<13|k>>>19,k=ke+Qe|0,ce^=k<<18|k>>>14,k=Y+H|0,Je^=k<<7|k>>>25,k=Je+Y|0,fe^=k<<9|k>>>23,k=fe+Je|0,H^=k<<13|k>>>19,k=H+fe|0,Y^=k<<18|k>>>14,k=Ye+ie|0,we^=k<<7|k>>>25,k=we+Ye|0,F^=k<<9|k>>>23,k=F+we|0,ie^=k<<13|k>>>19,k=ie+F|0,Ye^=k<<18|k>>>14,k=me+we|0,ke^=k<<7|k>>>25,k=ke+me|0,fe^=k<<9|k>>>23,k=fe+ke|0,we^=k<<13|k>>>19,k=we+fe|0,me^=k<<18|k>>>14,k=ce+xe|0,H^=k<<7|k>>>25,k=H+ce|0,F^=k<<9|k>>>23,k=F+H|0,xe^=k<<13|k>>>19,k=xe+F|0,ce^=k<<18|k>>>14,k=Y+q|0,ie^=k<<7|k>>>25,k=ie+Y|0,te^=k<<9|k>>>23,k=te+ie|0,q^=k<<13|k>>>19,k=q+te|0,Y^=k<<18|k>>>14,k=Ye+Je|0,$e^=k<<7|k>>>25,k=$e+Ye|0,Qe^=k<<9|k>>>23,k=Qe+$e|0,Je^=k<<13|k>>>19,k=Je+Qe|0,Ye^=k<<18|k>>>14;u[0]=me>>>0&255,u[1]=me>>>8&255,u[2]=me>>>16&255,u[3]=me>>>24&255,u[4]=ce>>>0&255,u[5]=ce>>>8&255,u[6]=ce>>>16&255,u[7]=ce>>>24&255,u[8]=Y>>>0&255,u[9]=Y>>>8&255,u[10]=Y>>>16&255,u[11]=Y>>>24&255,u[12]=Ye>>>0&255,u[13]=Ye>>>8&255,u[14]=Ye>>>16&255,u[15]=Ye>>>24&255,u[16]=H>>>0&255,u[17]=H>>>8&255,u[18]=H>>>16&255,u[19]=H>>>24&255,u[20]=F>>>0&255,u[21]=F>>>8&255,u[22]=F>>>16&255,u[23]=F>>>24&255,u[24]=te>>>0&255,u[25]=te>>>8&255,u[26]=te>>>16&255,u[27]=te>>>24&255,u[28]=q>>>0&255,u[29]=q>>>8&255,u[30]=q>>>16&255,u[31]=q>>>24&255}function E(u,g,v,a){p(u,g,v,a)}function T(u,g,v,a){y(u,g,v,a)}var W=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function I(u,g,v,a,x,N,B){var Q=new Uint8Array(16),se=new Uint8Array(64),be,ue;for(ue=0;ue<16;ue++)Q[ue]=0;for(ue=0;ue<8;ue++)Q[ue]=N[ue];for(;x>=64;){for(E(se,Q,B,W),ue=0;ue<64;ue++)u[g+ue]=v[a+ue]^se[ue];for(be=1,ue=8;ue<16;ue++)be=be+(Q[ue]&255)|0,Q[ue]=be&255,be>>>=8;x-=64,g+=64,a+=64}if(x>0)for(E(se,Q,B,W),ue=0;ue=64;){for(E(B,N,x,W),se=0;se<64;se++)u[g+se]=B[se];for(Q=1,se=8;se<16;se++)Q=Q+(N[se]&255)|0,N[se]=Q&255,Q>>>=8;v-=64,g+=64}if(v>0)for(E(B,N,x,W),se=0;se>>13|v<<3)&8191,a=u[4]&255|(u[5]&255)<<8,this.r[2]=(v>>>10|a<<6)&7939,x=u[6]&255|(u[7]&255)<<8,this.r[3]=(a>>>7|x<<9)&8191,N=u[8]&255|(u[9]&255)<<8,this.r[4]=(x>>>4|N<<12)&255,this.r[5]=N>>>1&8190,B=u[10]&255|(u[11]&255)<<8,this.r[6]=(N>>>14|B<<2)&8191,Q=u[12]&255|(u[13]&255)<<8,this.r[7]=(B>>>11|Q<<5)&8065,se=u[14]&255|(u[15]&255)<<8,this.r[8]=(Q>>>8|se<<8)&8191,this.r[9]=se>>>5&127,this.pad[0]=u[16]&255|(u[17]&255)<<8,this.pad[1]=u[18]&255|(u[19]&255)<<8,this.pad[2]=u[20]&255|(u[21]&255)<<8,this.pad[3]=u[22]&255|(u[23]&255)<<8,this.pad[4]=u[24]&255|(u[25]&255)<<8,this.pad[5]=u[26]&255|(u[27]&255)<<8,this.pad[6]=u[28]&255|(u[29]&255)<<8,this.pad[7]=u[30]&255|(u[31]&255)<<8};$.prototype.blocks=function(u,g,v){for(var a=this.fin?0:2048,x,N,B,Q,se,be,ue,pt,pe,Be,De,qe,Ke,He,ze,Fe,me,ke,fe,we=this.h[0],xe=this.h[1],ce=this.h[2],H=this.h[3],F=this.h[4],te=this.h[5],q=this.h[6],Y=this.h[7],ie=this.h[8],$e=this.h[9],Qe=this.r[0],Je=this.r[1],Ye=this.r[2],k=this.r[3],rt=this.r[4],gt=this.r[5],vt=this.r[6],tt=this.r[7],ft=this.r[8],dt=this.r[9];v>=16;)x=u[g+0]&255|(u[g+1]&255)<<8,we+=x&8191,N=u[g+2]&255|(u[g+3]&255)<<8,xe+=(x>>>13|N<<3)&8191,B=u[g+4]&255|(u[g+5]&255)<<8,ce+=(N>>>10|B<<6)&8191,Q=u[g+6]&255|(u[g+7]&255)<<8,H+=(B>>>7|Q<<9)&8191,se=u[g+8]&255|(u[g+9]&255)<<8,F+=(Q>>>4|se<<12)&8191,te+=se>>>1&8191,be=u[g+10]&255|(u[g+11]&255)<<8,q+=(se>>>14|be<<2)&8191,ue=u[g+12]&255|(u[g+13]&255)<<8,Y+=(be>>>11|ue<<5)&8191,pt=u[g+14]&255|(u[g+15]&255)<<8,ie+=(ue>>>8|pt<<8)&8191,$e+=pt>>>5|a,pe=0,Be=pe,Be+=we*Qe,Be+=xe*(5*dt),Be+=ce*(5*ft),Be+=H*(5*tt),Be+=F*(5*vt),pe=Be>>>13,Be&=8191,Be+=te*(5*gt),Be+=q*(5*rt),Be+=Y*(5*k),Be+=ie*(5*Ye),Be+=$e*(5*Je),pe+=Be>>>13,Be&=8191,De=pe,De+=we*Je,De+=xe*Qe,De+=ce*(5*dt),De+=H*(5*ft),De+=F*(5*tt),pe=De>>>13,De&=8191,De+=te*(5*vt),De+=q*(5*gt),De+=Y*(5*rt),De+=ie*(5*k),De+=$e*(5*Ye),pe+=De>>>13,De&=8191,qe=pe,qe+=we*Ye,qe+=xe*Je,qe+=ce*Qe,qe+=H*(5*dt),qe+=F*(5*ft),pe=qe>>>13,qe&=8191,qe+=te*(5*tt),qe+=q*(5*vt),qe+=Y*(5*gt),qe+=ie*(5*rt),qe+=$e*(5*k),pe+=qe>>>13,qe&=8191,Ke=pe,Ke+=we*k,Ke+=xe*Ye,Ke+=ce*Je,Ke+=H*Qe,Ke+=F*(5*dt),pe=Ke>>>13,Ke&=8191,Ke+=te*(5*ft),Ke+=q*(5*tt),Ke+=Y*(5*vt),Ke+=ie*(5*gt),Ke+=$e*(5*rt),pe+=Ke>>>13,Ke&=8191,He=pe,He+=we*rt,He+=xe*k,He+=ce*Ye,He+=H*Je,He+=F*Qe,pe=He>>>13,He&=8191,He+=te*(5*dt),He+=q*(5*ft),He+=Y*(5*tt),He+=ie*(5*vt),He+=$e*(5*gt),pe+=He>>>13,He&=8191,ze=pe,ze+=we*gt,ze+=xe*rt,ze+=ce*k,ze+=H*Ye,ze+=F*Je,pe=ze>>>13,ze&=8191,ze+=te*Qe,ze+=q*(5*dt),ze+=Y*(5*ft),ze+=ie*(5*tt),ze+=$e*(5*vt),pe+=ze>>>13,ze&=8191,Fe=pe,Fe+=we*vt,Fe+=xe*gt,Fe+=ce*rt,Fe+=H*k,Fe+=F*Ye,pe=Fe>>>13,Fe&=8191,Fe+=te*Je,Fe+=q*Qe,Fe+=Y*(5*dt),Fe+=ie*(5*ft),Fe+=$e*(5*tt),pe+=Fe>>>13,Fe&=8191,me=pe,me+=we*tt,me+=xe*vt,me+=ce*gt,me+=H*rt,me+=F*k,pe=me>>>13,me&=8191,me+=te*Ye,me+=q*Je,me+=Y*Qe,me+=ie*(5*dt),me+=$e*(5*ft),pe+=me>>>13,me&=8191,ke=pe,ke+=we*ft,ke+=xe*tt,ke+=ce*vt,ke+=H*gt,ke+=F*rt,pe=ke>>>13,ke&=8191,ke+=te*k,ke+=q*Ye,ke+=Y*Je,ke+=ie*Qe,ke+=$e*(5*dt),pe+=ke>>>13,ke&=8191,fe=pe,fe+=we*dt,fe+=xe*ft,fe+=ce*tt,fe+=H*vt,fe+=F*gt,pe=fe>>>13,fe&=8191,fe+=te*rt,fe+=q*k,fe+=Y*Ye,fe+=ie*Je,fe+=$e*Qe,pe+=fe>>>13,fe&=8191,pe=(pe<<2)+pe|0,pe=pe+Be|0,Be=pe&8191,pe=pe>>>13,De+=pe,we=Be,xe=De,ce=qe,H=Ke,F=He,te=ze,q=Fe,Y=me,ie=ke,$e=fe,g+=16,v-=16;this.h[0]=we,this.h[1]=xe,this.h[2]=ce,this.h[3]=H,this.h[4]=F,this.h[5]=te,this.h[6]=q,this.h[7]=Y,this.h[8]=ie,this.h[9]=$e},$.prototype.finish=function(u,g){var v=new Uint16Array(10),a,x,N,B;if(this.leftover){for(B=this.leftover,this.buffer[B++]=1;B<16;B++)this.buffer[B]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(a=this.h[1]>>>13,this.h[1]&=8191,B=2;B<10;B++)this.h[B]+=a,a=this.h[B]>>>13,this.h[B]&=8191;for(this.h[0]+=a*5,a=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=a,a=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=a,v[0]=this.h[0]+5,a=v[0]>>>13,v[0]&=8191,B=1;B<10;B++)v[B]=this.h[B]+a,a=v[B]>>>13,v[B]&=8191;for(v[9]-=8192,x=(a^1)-1,B=0;B<10;B++)v[B]&=x;for(x=~x,B=0;B<10;B++)this.h[B]=this.h[B]&x|v[B];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,N=this.h[0]+this.pad[0],this.h[0]=N&65535,B=1;B<8;B++)N=(this.h[B]+this.pad[B]|0)+(N>>>16)|0,this.h[B]=N&65535;u[g+0]=this.h[0]>>>0&255,u[g+1]=this.h[0]>>>8&255,u[g+2]=this.h[1]>>>0&255,u[g+3]=this.h[1]>>>8&255,u[g+4]=this.h[2]>>>0&255,u[g+5]=this.h[2]>>>8&255,u[g+6]=this.h[3]>>>0&255,u[g+7]=this.h[3]>>>8&255,u[g+8]=this.h[4]>>>0&255,u[g+9]=this.h[4]>>>8&255,u[g+10]=this.h[5]>>>0&255,u[g+11]=this.h[5]>>>8&255,u[g+12]=this.h[6]>>>0&255,u[g+13]=this.h[6]>>>8&255,u[g+14]=this.h[7]>>>0&255,u[g+15]=this.h[7]>>>8&255},$.prototype.update=function(u,g,v){var a,x;if(this.leftover){for(x=16-this.leftover,x>v&&(x=v),a=0;a=16&&(x=v-v%16,this.blocks(u,g,x),g+=x,v-=x),v){for(a=0;a>16&1),N[v-1]&=65535;N[15]=B[15]-32767-(N[14]>>16&1),x=N[15]>>16&1,N[14]&=65535,J(B,N,1-x)}for(v=0;v<16;v++)u[2*v]=B[v]&255,u[2*v+1]=B[v]>>8}function ye(u,g){var v=new Uint8Array(32),a=new Uint8Array(32);return ae(v,u),ae(a,g),b(v,0,a,0)}function et(u){var g=new Uint8Array(32);return ae(g,u),g[0]&1}function Ze(u,g){var v;for(v=0;v<16;v++)u[v]=g[2*v]+(g[2*v+1]<<8);u[15]&=32767}function ct(u,g,v){for(var a=0;a<16;a++)u[a]=g[a]+v[a]}function yt(u,g,v){for(var a=0;a<16;a++)u[a]=g[a]-v[a]}function We(u,g,v){var a,x,N=0,B=0,Q=0,se=0,be=0,ue=0,pt=0,pe=0,Be=0,De=0,qe=0,Ke=0,He=0,ze=0,Fe=0,me=0,ke=0,fe=0,we=0,xe=0,ce=0,H=0,F=0,te=0,q=0,Y=0,ie=0,$e=0,Qe=0,Je=0,Ye=0,k=v[0],rt=v[1],gt=v[2],vt=v[3],tt=v[4],ft=v[5],dt=v[6],Kt=v[7],_t=v[8],Ht=v[9],Ft=v[10],zt=v[11],Xt=v[12],yn=v[13],wn=v[14],xn=v[15];a=g[0],N+=a*k,B+=a*rt,Q+=a*gt,se+=a*vt,be+=a*tt,ue+=a*ft,pt+=a*dt,pe+=a*Kt,Be+=a*_t,De+=a*Ht,qe+=a*Ft,Ke+=a*zt,He+=a*Xt,ze+=a*yn,Fe+=a*wn,me+=a*xn,a=g[1],B+=a*k,Q+=a*rt,se+=a*gt,be+=a*vt,ue+=a*tt,pt+=a*ft,pe+=a*dt,Be+=a*Kt,De+=a*_t,qe+=a*Ht,Ke+=a*Ft,He+=a*zt,ze+=a*Xt,Fe+=a*yn,me+=a*wn,ke+=a*xn,a=g[2],Q+=a*k,se+=a*rt,be+=a*gt,ue+=a*vt,pt+=a*tt,pe+=a*ft,Be+=a*dt,De+=a*Kt,qe+=a*_t,Ke+=a*Ht,He+=a*Ft,ze+=a*zt,Fe+=a*Xt,me+=a*yn,ke+=a*wn,fe+=a*xn,a=g[3],se+=a*k,be+=a*rt,ue+=a*gt,pt+=a*vt,pe+=a*tt,Be+=a*ft,De+=a*dt,qe+=a*Kt,Ke+=a*_t,He+=a*Ht,ze+=a*Ft,Fe+=a*zt,me+=a*Xt,ke+=a*yn,fe+=a*wn,we+=a*xn,a=g[4],be+=a*k,ue+=a*rt,pt+=a*gt,pe+=a*vt,Be+=a*tt,De+=a*ft,qe+=a*dt,Ke+=a*Kt,He+=a*_t,ze+=a*Ht,Fe+=a*Ft,me+=a*zt,ke+=a*Xt,fe+=a*yn,we+=a*wn,xe+=a*xn,a=g[5],ue+=a*k,pt+=a*rt,pe+=a*gt,Be+=a*vt,De+=a*tt,qe+=a*ft,Ke+=a*dt,He+=a*Kt,ze+=a*_t,Fe+=a*Ht,me+=a*Ft,ke+=a*zt,fe+=a*Xt,we+=a*yn,xe+=a*wn,ce+=a*xn,a=g[6],pt+=a*k,pe+=a*rt,Be+=a*gt,De+=a*vt,qe+=a*tt,Ke+=a*ft,He+=a*dt,ze+=a*Kt,Fe+=a*_t,me+=a*Ht,ke+=a*Ft,fe+=a*zt,we+=a*Xt,xe+=a*yn,ce+=a*wn,H+=a*xn,a=g[7],pe+=a*k,Be+=a*rt,De+=a*gt,qe+=a*vt,Ke+=a*tt,He+=a*ft,ze+=a*dt,Fe+=a*Kt,me+=a*_t,ke+=a*Ht,fe+=a*Ft,we+=a*zt,xe+=a*Xt,ce+=a*yn,H+=a*wn,F+=a*xn,a=g[8],Be+=a*k,De+=a*rt,qe+=a*gt,Ke+=a*vt,He+=a*tt,ze+=a*ft,Fe+=a*dt,me+=a*Kt,ke+=a*_t,fe+=a*Ht,we+=a*Ft,xe+=a*zt,ce+=a*Xt,H+=a*yn,F+=a*wn,te+=a*xn,a=g[9],De+=a*k,qe+=a*rt,Ke+=a*gt,He+=a*vt,ze+=a*tt,Fe+=a*ft,me+=a*dt,ke+=a*Kt,fe+=a*_t,we+=a*Ht,xe+=a*Ft,ce+=a*zt,H+=a*Xt,F+=a*yn,te+=a*wn,q+=a*xn,a=g[10],qe+=a*k,Ke+=a*rt,He+=a*gt,ze+=a*vt,Fe+=a*tt,me+=a*ft,ke+=a*dt,fe+=a*Kt,we+=a*_t,xe+=a*Ht,ce+=a*Ft,H+=a*zt,F+=a*Xt,te+=a*yn,q+=a*wn,Y+=a*xn,a=g[11],Ke+=a*k,He+=a*rt,ze+=a*gt,Fe+=a*vt,me+=a*tt,ke+=a*ft,fe+=a*dt,we+=a*Kt,xe+=a*_t,ce+=a*Ht,H+=a*Ft,F+=a*zt,te+=a*Xt,q+=a*yn,Y+=a*wn,ie+=a*xn,a=g[12],He+=a*k,ze+=a*rt,Fe+=a*gt,me+=a*vt,ke+=a*tt,fe+=a*ft,we+=a*dt,xe+=a*Kt,ce+=a*_t,H+=a*Ht,F+=a*Ft,te+=a*zt,q+=a*Xt,Y+=a*yn,ie+=a*wn,$e+=a*xn,a=g[13],ze+=a*k,Fe+=a*rt,me+=a*gt,ke+=a*vt,fe+=a*tt,we+=a*ft,xe+=a*dt,ce+=a*Kt,H+=a*_t,F+=a*Ht,te+=a*Ft,q+=a*zt,Y+=a*Xt,ie+=a*yn,$e+=a*wn,Qe+=a*xn,a=g[14],Fe+=a*k,me+=a*rt,ke+=a*gt,fe+=a*vt,we+=a*tt,xe+=a*ft,ce+=a*dt,H+=a*Kt,F+=a*_t,te+=a*Ht,q+=a*Ft,Y+=a*zt,ie+=a*Xt,$e+=a*yn,Qe+=a*wn,Je+=a*xn,a=g[15],me+=a*k,ke+=a*rt,fe+=a*gt,we+=a*vt,xe+=a*tt,ce+=a*ft,H+=a*dt,F+=a*Kt,te+=a*_t,q+=a*Ht,Y+=a*Ft,ie+=a*zt,$e+=a*Xt,Qe+=a*yn,Je+=a*wn,Ye+=a*xn,N+=38*ke,B+=38*fe,Q+=38*we,se+=38*xe,be+=38*ce,ue+=38*H,pt+=38*F,pe+=38*te,Be+=38*q,De+=38*Y,qe+=38*ie,Ke+=38*$e,He+=38*Qe,ze+=38*Je,Fe+=38*Ye,x=1,a=N+x+65535,x=Math.floor(a/65536),N=a-x*65536,a=B+x+65535,x=Math.floor(a/65536),B=a-x*65536,a=Q+x+65535,x=Math.floor(a/65536),Q=a-x*65536,a=se+x+65535,x=Math.floor(a/65536),se=a-x*65536,a=be+x+65535,x=Math.floor(a/65536),be=a-x*65536,a=ue+x+65535,x=Math.floor(a/65536),ue=a-x*65536,a=pt+x+65535,x=Math.floor(a/65536),pt=a-x*65536,a=pe+x+65535,x=Math.floor(a/65536),pe=a-x*65536,a=Be+x+65535,x=Math.floor(a/65536),Be=a-x*65536,a=De+x+65535,x=Math.floor(a/65536),De=a-x*65536,a=qe+x+65535,x=Math.floor(a/65536),qe=a-x*65536,a=Ke+x+65535,x=Math.floor(a/65536),Ke=a-x*65536,a=He+x+65535,x=Math.floor(a/65536),He=a-x*65536,a=ze+x+65535,x=Math.floor(a/65536),ze=a-x*65536,a=Fe+x+65535,x=Math.floor(a/65536),Fe=a-x*65536,a=me+x+65535,x=Math.floor(a/65536),me=a-x*65536,N+=x-1+37*(x-1),x=1,a=N+x+65535,x=Math.floor(a/65536),N=a-x*65536,a=B+x+65535,x=Math.floor(a/65536),B=a-x*65536,a=Q+x+65535,x=Math.floor(a/65536),Q=a-x*65536,a=se+x+65535,x=Math.floor(a/65536),se=a-x*65536,a=be+x+65535,x=Math.floor(a/65536),be=a-x*65536,a=ue+x+65535,x=Math.floor(a/65536),ue=a-x*65536,a=pt+x+65535,x=Math.floor(a/65536),pt=a-x*65536,a=pe+x+65535,x=Math.floor(a/65536),pe=a-x*65536,a=Be+x+65535,x=Math.floor(a/65536),Be=a-x*65536,a=De+x+65535,x=Math.floor(a/65536),De=a-x*65536,a=qe+x+65535,x=Math.floor(a/65536),qe=a-x*65536,a=Ke+x+65535,x=Math.floor(a/65536),Ke=a-x*65536,a=He+x+65535,x=Math.floor(a/65536),He=a-x*65536,a=ze+x+65535,x=Math.floor(a/65536),ze=a-x*65536,a=Fe+x+65535,x=Math.floor(a/65536),Fe=a-x*65536,a=me+x+65535,x=Math.floor(a/65536),me=a-x*65536,N+=x-1+37*(x-1),u[0]=N,u[1]=B,u[2]=Q,u[3]=se,u[4]=be,u[5]=ue,u[6]=pt,u[7]=pe,u[8]=Be,u[9]=De,u[10]=qe,u[11]=Ke,u[12]=He,u[13]=ze,u[14]=Fe,u[15]=me}function ut(u,g){We(u,g,g)}function Tn(u,g){var v=n(),a;for(a=0;a<16;a++)v[a]=g[a];for(a=253;a>=0;a--)ut(v,v),a!==2&&a!==4&&We(v,v,g);for(a=0;a<16;a++)u[a]=v[a]}function V(u,g){var v=n(),a;for(a=0;a<16;a++)v[a]=g[a];for(a=250;a>=0;a--)ut(v,v),a!==1&&We(v,v,g);for(a=0;a<16;a++)u[a]=v[a]}function K(u,g,v){var a=new Uint8Array(32),x=new Float64Array(80),N,B,Q=n(),se=n(),be=n(),ue=n(),pt=n(),pe=n();for(B=0;B<31;B++)a[B]=g[B];for(a[31]=g[31]&127|64,a[0]&=248,Ze(x,v),B=0;B<16;B++)se[B]=x[B],ue[B]=Q[B]=be[B]=0;for(Q[0]=ue[0]=1,B=254;B>=0;--B)N=a[B>>>3]>>>(B&7)&1,J(Q,se,N),J(be,ue,N),ct(pt,Q,be),yt(Q,Q,be),ct(be,se,ue),yt(se,se,ue),ut(ue,pt),ut(pe,Q),We(Q,be,Q),We(be,se,pt),ct(pt,Q,be),yt(Q,Q,be),ut(se,Q),yt(be,ue,pe),We(Q,be,c),ct(Q,Q,ue),We(be,be,Q),We(Q,ue,pe),We(ue,se,x),ut(se,pt),J(Q,se,N),J(be,ue,N);for(B=0;B<16;B++)x[B+16]=Q[B],x[B+32]=be[B],x[B+48]=se[B],x[B+64]=ue[B];var Be=x.subarray(32),De=x.subarray(16);return Tn(Be,Be),We(De,De,Be),ae(u,De),0}function D(u,g){return K(u,g,i)}function Z(u,g){return r(g,32),D(u,g)}function G(u,g,v){var a=new Uint8Array(32);return K(a,v,g),T(u,o,a,W)}var re=ee,Se=ne;function _e(u,g,v,a,x,N){var B=new Uint8Array(32);return G(B,x,N),re(u,g,v,a,B)}function Ve(u,g,v,a,x,N){var B=new Uint8Array(32);return G(B,x,N),Se(u,g,v,a,B)}var bt=[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 Pe(u,g,v,a){for(var x=new Int32Array(16),N=new Int32Array(16),B,Q,se,be,ue,pt,pe,Be,De,qe,Ke,He,ze,Fe,me,ke,fe,we,xe,ce,H,F,te,q,Y,ie,$e=u[0],Qe=u[1],Je=u[2],Ye=u[3],k=u[4],rt=u[5],gt=u[6],vt=u[7],tt=g[0],ft=g[1],dt=g[2],Kt=g[3],_t=g[4],Ht=g[5],Ft=g[6],zt=g[7],Xt=0;a>=128;){for(xe=0;xe<16;xe++)ce=8*xe+Xt,x[xe]=v[ce+0]<<24|v[ce+1]<<16|v[ce+2]<<8|v[ce+3],N[xe]=v[ce+4]<<24|v[ce+5]<<16|v[ce+6]<<8|v[ce+7];for(xe=0;xe<80;xe++)if(B=$e,Q=Qe,se=Je,be=Ye,ue=k,pt=rt,pe=gt,Be=vt,De=tt,qe=ft,Ke=dt,He=Kt,ze=_t,Fe=Ht,me=Ft,ke=zt,H=vt,F=zt,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=(k>>>14|_t<<18)^(k>>>18|_t<<14)^(_t>>>9|k<<23),F=(_t>>>14|k<<18)^(_t>>>18|k<<14)^(k>>>9|_t<<23),te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,H=k&rt^~k>,F=_t&Ht^~_t&Ft,te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,H=bt[xe*2],F=bt[xe*2+1],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,H=x[xe%16],F=N[xe%16],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,fe=Y&65535|ie<<16,we=te&65535|q<<16,H=fe,F=we,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=($e>>>28|tt<<4)^(tt>>>2|$e<<30)^(tt>>>7|$e<<25),F=(tt>>>28|$e<<4)^($e>>>2|tt<<30)^($e>>>7|tt<<25),te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,H=$e&Qe^$e&Je^Qe&Je,F=tt&ft^tt&dt^ft&dt,te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,Be=Y&65535|ie<<16,ke=te&65535|q<<16,H=be,F=He,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=fe,F=we,te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,be=Y&65535|ie<<16,He=te&65535|q<<16,Qe=B,Je=Q,Ye=se,k=be,rt=ue,gt=pt,vt=pe,$e=Be,ft=De,dt=qe,Kt=Ke,_t=He,Ht=ze,Ft=Fe,zt=me,tt=ke,xe%16===15)for(ce=0;ce<16;ce++)H=x[ce],F=N[ce],te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=x[(ce+9)%16],F=N[(ce+9)%16],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,fe=x[(ce+1)%16],we=N[(ce+1)%16],H=(fe>>>1|we<<31)^(fe>>>8|we<<24)^fe>>>7,F=(we>>>1|fe<<31)^(we>>>8|fe<<24)^(we>>>7|fe<<25),te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,fe=x[(ce+14)%16],we=N[(ce+14)%16],H=(fe>>>19|we<<13)^(we>>>29|fe<<3)^fe>>>6,F=(we>>>19|fe<<13)^(fe>>>29|we<<3)^(we>>>6|fe<<26),te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,x[ce]=Y&65535|ie<<16,N[ce]=te&65535|q<<16;H=$e,F=tt,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[0],F=g[0],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[0]=$e=Y&65535|ie<<16,g[0]=tt=te&65535|q<<16,H=Qe,F=ft,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[1],F=g[1],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[1]=Qe=Y&65535|ie<<16,g[1]=ft=te&65535|q<<16,H=Je,F=dt,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[2],F=g[2],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[2]=Je=Y&65535|ie<<16,g[2]=dt=te&65535|q<<16,H=Ye,F=Kt,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[3],F=g[3],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[3]=Ye=Y&65535|ie<<16,g[3]=Kt=te&65535|q<<16,H=k,F=_t,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[4],F=g[4],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[4]=k=Y&65535|ie<<16,g[4]=_t=te&65535|q<<16,H=rt,F=Ht,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[5],F=g[5],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[5]=rt=Y&65535|ie<<16,g[5]=Ht=te&65535|q<<16,H=gt,F=Ft,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[6],F=g[6],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[6]=gt=Y&65535|ie<<16,g[6]=Ft=te&65535|q<<16,H=vt,F=zt,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[7],F=g[7],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[7]=vt=Y&65535|ie<<16,g[7]=zt=te&65535|q<<16,Xt+=128,a-=128}return a}function Rt(u,g,v){var a=new Int32Array(8),x=new Int32Array(8),N=new Uint8Array(256),B,Q=v;for(a[0]=1779033703,a[1]=3144134277,a[2]=1013904242,a[3]=2773480762,a[4]=1359893119,a[5]=2600822924,a[6]=528734635,a[7]=1541459225,x[0]=4089235720,x[1]=2227873595,x[2]=4271175723,x[3]=1595750129,x[4]=2917565137,x[5]=725511199,x[6]=4215389547,x[7]=327033209,Pe(a,x,g,v),v%=128,B=0;B=0;--x)a=v[x/8|0]>>(x&7)&1,Nn(u,g,a),jt(g,u),jt(u,u),Nn(u,g,a)}function An(u,g){var v=[n(),n(),n(),n()];Ce(v[0],w),Ce(v[1],h),Ce(v[2],s),We(v[3],w,h),Jt(u,v,g)}function Ie(u,g,v){var a=new Uint8Array(64),x=[n(),n(),n(),n()],N;for(v||r(g,32),Rt(a,g,32),a[0]&=248,a[31]&=127,a[31]|=64,An(x,a),Zt(u,x),N=0;N<32;N++)g[N+32]=u[N];return 0}var st=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 Ue(u,g){var v,a,x,N;for(a=63;a>=32;--a){for(v=0,x=a-32,N=a-12;x>4)*st[x],v=g[x]>>8,g[x]&=255;for(x=0;x<32;x++)g[x]-=v*st[x];for(a=0;a<32;a++)g[a+1]+=g[a]>>8,u[a]=g[a]&255}function wt(u){var g=new Float64Array(64),v;for(v=0;v<64;v++)g[v]=u[v];for(v=0;v<64;v++)u[v]=0;Ue(u,g)}function on(u,g,v,a){var x=new Uint8Array(64),N=new Uint8Array(64),B=new Uint8Array(64),Q,se,be=new Float64Array(64),ue=[n(),n(),n(),n()];Rt(x,a,32),x[0]&=248,x[31]&=127,x[31]|=64;var pt=v+64;for(Q=0;Q>7&&yt(u[0],l,u[0]),We(u[3],u[0],u[1]),0)}function at(u,g,v,a){var x,N=new Uint8Array(32),B=new Uint8Array(64),Q=[n(),n(),n(),n()],se=[n(),n(),n(),n()];if(v<64||Un(se,a))return-1;for(x=0;x=0},t.sign.keyPair=function(){var u=new Uint8Array(Oe),g=new Uint8Array(Tt);return Ie(u,g),{publicKey:u,secretKey:g}},t.sign.keyPair.fromSecretKey=function(u){if(Ln(u),u.length!==Tt)throw new Error("bad secret key size");for(var g=new Uint8Array(Oe),v=0;v=e.length)throw new Error("Index is out of buffer");const n=e.slice(0,t),r=e.slice(t);return[n,r]}function ru(e){let t="";return e.forEach(n=>{t+=("0"+(n&255).toString(16)).slice(-2)}),t}function Ia(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<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[br]=t,e[Fl]=r,rp(e,t,!1,!1),t.stateNode=e;e:{switch(l=Pu(n,r),n){case"dialog":Lt("cancel",e),Lt("close",e),o=r;break;case"iframe":case"object":case"embed":Lt("load",e),o=r;break;case"video":case"audio":for(o=0;oOi&&(t.flags|=128,r=!0,rl(i,!1),t.lanes=4194304)}else{if(!r)if(e=_a(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),rl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!It)return bn(t),null}else 2*Qt()-i.renderingStartTime>Oi&&n!==1073741824&&(t.flags|=128,r=!0,rl(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Qt(),t.sibling=null,n=Ut.current,At(Ut,r?n&1|2:n&1),t):(bn(t),null);case 22:case 23:return gd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Kn&1073741824&&(bn(t),t.subtreeFlags&6&&(t.flags|=8192)):bn(t),null;case 24:return null;case 25:return null}throw Error(le(156,t.tag))}function c3(e,t){switch(Yf(t),t.tag){case 1:return Hn(t.type)&&ma(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wi(),Mt(Dn),Mt(En),od(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return rd(t),null;case 13:if(Mt(Ut),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(le(340));$i()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Mt(Ut),null;case 4:return Wi(),null;case 10:return Xf(t.type._context),null;case 22:case 23:return gd(),null;case 24:return null;default:return null}}var Ns=!1,Sn=!1,u3=typeof WeakSet=="function"?WeakSet:Set,ve=null;function yi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Vt(e,t,r)}else n.current=null}function rf(e,t,n){try{n()}catch(r){Vt(e,t,r)}}var Y1=!1;function f3(e,t){if(ju=ha,e=u2(),qf(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,s=-1,c=-1,f=0,d=0,w=e,h=null;t:for(;;){for(var S;w!==n||o!==0&&w.nodeType!==3||(s=l+o),w!==i||r!==0&&w.nodeType!==3||(c=l+r),w.nodeType===3&&(l+=w.nodeValue.length),(S=w.firstChild)!==null;)h=w,w=S;for(;;){if(w===e)break t;if(h===n&&++f===o&&(s=l),h===i&&++d===r&&(c=l),(S=w.nextSibling)!==null)break;w=h,h=w.parentNode}w=S}n=s===-1||c===-1?null:{start:s,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Du={focusedElem:e,selectionRange:n},ha=!1,ve=t;ve!==null;)if(t=ve,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ve=e;else for(;ve!==null;){t=ve;try{var C=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var _=C.memoizedProps,O=C.memoizedState,b=t.stateNode,p=b.getSnapshotBeforeUpdate(t.elementType===t.type?_:fr(t.type,_),O);b.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(le(163))}}catch(E){Vt(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,ve=e;break}ve=t.return}return C=Y1,Y1=!1,C}function bl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&rf(t,n,i)}o=o.next}while(o!==r)}}function ac(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function of(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function lp(e){var t=e.alternate;t!==null&&(e.alternate=null,lp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[br],delete t[Fl],delete t[zu],delete t[q5],delete t[Q5])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function sp(e){return e.tag===5||e.tag===3||e.tag===4}function Z1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function lf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=va));else if(r!==4&&(e=e.child,e!==null))for(lf(e,t,n),e=e.sibling;e!==null;)lf(e,t,n),e=e.sibling}function sf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(sf(e,t,n),e=e.sibling;e!==null;)sf(e,t,n),e=e.sibling}var hn=null,dr=!1;function ro(e,t,n){for(n=n.child;n!==null;)ap(e,t,n),n=n.sibling}function ap(e,t,n){if(Er&&typeof Er.onCommitFiberUnmount=="function")try{Er.onCommitFiberUnmount(ec,n)}catch{}switch(n.tag){case 5:Sn||yi(n,t);case 6:var r=hn,o=dr;hn=null,ro(e,t,n),hn=r,dr=o,hn!==null&&(dr?(e=hn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):hn.removeChild(n.stateNode));break;case 18:hn!==null&&(dr?(e=hn,n=n.stateNode,e.nodeType===8?qc(e.parentNode,n):e.nodeType===1&&qc(e,n),Ol(e)):qc(hn,n.stateNode));break;case 4:r=hn,o=dr,hn=n.stateNode.containerInfo,dr=!0,ro(e,t,n),hn=r,dr=o;break;case 0:case 11:case 14:case 15:if(!Sn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&rf(n,t,l),o=o.next}while(o!==r)}ro(e,t,n);break;case 1:if(!Sn&&(yi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Vt(n,t,s)}ro(e,t,n);break;case 21:ro(e,t,n);break;case 22:n.mode&1?(Sn=(r=Sn)||n.memoizedState!==null,ro(e,t,n),Sn=r):ro(e,t,n);break;default:ro(e,t,n)}}function G1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new u3),t.forEach(function(r){var o=x3.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ur(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~i}if(r=o,r=Qt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*h3(r/1960))-r,10e?16:e,fo===null)var r=!1;else{if(e=fo,fo=null,La=0,mt&6)throw Error(le(331));var o=mt;for(mt|=4,ve=e.current;ve!==null;){var i=ve,l=i.child;if(ve.flags&16){var s=i.deletions;if(s!==null){for(var c=0;cQt()-hd?Ho(e,0):dd|=n),Fn(e,t)}function vp(e,t){t===0&&(e.mode&1?(t=Es,Es<<=1,!(Es&130023424)&&(Es=4194304)):t=1);var n=Mn();e=Qr(e,t),e!==null&&(ls(e,t,n),Fn(e,n))}function w3(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),vp(e,n)}function x3(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(le(314))}r!==null&&r.delete(t),vp(e,n)}var mp;mp=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dn.current)jn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return jn=!1,s3(e,t,n);jn=!!(e.flags&131072)}else jn=!1,It&&t.flags&1048576&&C2(t,xa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ta(e,t),e=t.pendingProps;var o=Ii(t,En.current);Li(t,n),o=ld(null,t,r,e,o,n);var i=sd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Hn(r)?(i=!0,ya(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,td(t),o.updater=sc,t.stateNode=o,o._reactInternals=t,Zu(t,r,e,n),t=Xu(null,t,r,!0,i,n)):(t.tag=0,It&&i&&Qf(t),Pn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ta(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=b3(r),e=fr(r,e),o){case 0:t=Ju(null,t,r,e,n);break e;case 1:t=K1(null,t,r,e,n);break e;case 11:t=z1(null,t,r,e,n);break e;case 14:t=V1(null,t,r,fr(r.type,e),n);break e}throw Error(le(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fr(r,o),Ju(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fr(r,o),K1(e,t,r,o,n);case 3:e:{if(ep(t),e===null)throw Error(le(387));r=t.pendingProps,i=t.memoizedState,o=i.element,T2(e,t),Sa(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Ui(Error(le(423)),t),t=q1(e,t,r,n,o);break e}else if(r!==o){o=Ui(Error(le(424)),t),t=q1(e,t,r,n,o);break e}else for(qn=mo(t.stateNode.containerInfo.firstChild),Yn=t,It=!0,hr=null,n=k2(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($i(),r===o){t=Yr(e,t,n);break e}Pn(e,t,r,n)}t=t.child}return t;case 5:return A2(t),e===null&&qu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,Hu(r,o)?l=null:i!==null&&Hu(r,i)&&(t.flags|=32),X2(e,t),Pn(e,t,l,n),t.child;case 6:return e===null&&qu(t),null;case 13:return tp(e,t,n);case 4:return nd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ni(t,null,r,n):Pn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fr(r,o),z1(e,t,r,o,n);case 7:return Pn(e,t,t.pendingProps,n),t.child;case 8:return Pn(e,t,t.pendingProps.children,n),t.child;case 12:return Pn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,l=o.value,At(Ca,r._currentValue),r._currentValue=l,i!==null)if(yr(i.value,l)){if(i.children===o.children&&!Dn.current){t=Yr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){l=i.child;for(var c=s.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Fr(-1,n&-n),c.tag=2;var f=i.updateQueue;if(f!==null){f=f.shared;var d=f.pending;d===null?c.next=c:(c.next=d.next,d.next=c),f.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Qu(i.return,n,t),s.lanes|=n;break}c=c.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(le(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),Qu(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}Pn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Li(t,n),o=sr(o),r=r(o),t.flags|=1,Pn(e,t,r,n),t.child;case 14:return r=t.type,o=fr(r,t.pendingProps),o=fr(r.type,o),V1(e,t,r,o,n);case 15:return G2(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fr(r,o),ta(e,t),t.tag=1,Hn(r)?(e=!0,ya(t)):e=!1,Li(t,n),Q2(t,r,o),Zu(t,r,o,n),Xu(null,t,r,!0,e,n);case 19:return np(e,t,n);case 22:return J2(e,t,n)}throw Error(le(156,t.tag))};function yp(e,t){return Vh(e,t)}function C3(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function or(e,t,n,r){return new C3(e,t,n,r)}function md(e){return e=e.prototype,!(!e||!e.isReactComponent)}function b3(e){if(typeof e=="function")return md(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Wf)return 11;if(e===Uf)return 14}return 2}function Co(e,t){var n=e.alternate;return n===null?(n=or(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function oa(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")md(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case ci:return Fo(n.children,o,i,t);case Nf:l=8,o|=8;break;case xu:return e=or(12,n,t,o|2),e.elementType=xu,e.lanes=i,e;case Cu:return e=or(13,n,t,o),e.elementType=Cu,e.lanes=i,e;case bu:return e=or(19,n,t,o),e.elementType=bu,e.lanes=i,e;case Ah:return uc(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Eh:l=10;break e;case Th:l=9;break e;case Wf:l=11;break e;case Uf:l=14;break e;case oo:l=16,r=null;break e}throw Error(le(130,e==null?e:typeof e,""))}return t=or(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Fo(e,t,n,r){return e=or(7,e,r,t),e.lanes=n,e}function uc(e,t,n,r){return e=or(22,e,r,t),e.elementType=Ah,e.lanes=n,e.stateNode={isHidden:!1},e}function tu(e,t,n){return e=or(6,e,null,t),e.lanes=n,e}function nu(e,t,n){return t=or(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function S3(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Wc(0),this.expirationTimes=Wc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wc(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function yd(e,t,n,r,o,i,l,s,c){return e=new S3(e,t,n,s,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=or(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},td(i),e}function _3(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(bp)}catch(e){console.error(e)}}bp(),bh.exports=Jn;var L3=bh.exports,i0=L3;yu.createRoot=i0.createRoot,yu.hydrateRoot=i0.hydrateRoot;var Sp={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():(t.nacl||(t.nacl={}),t.nacl.util=n())})(ch,function(){var t={};function n(r){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(r))throw new TypeError("invalid encoding")}return t.decodeUTF8=function(r){if(typeof r!="string")throw new TypeError("expected string");var o,i=unescape(encodeURIComponent(r)),l=new Uint8Array(i.length);for(o=0;o"u"?typeof Buffer.from<"u"?(t.encodeBase64=function(r){return Buffer.from(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(Buffer.from(r,"base64"),0))}):(t.encodeBase64=function(r){return new Buffer(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0))}):(t.encodeBase64=function(r){var o,i=[],l=r.length;for(o=0;o>24&255,u[g+1]=v>>16&255,u[g+2]=v>>8&255,u[g+3]=v&255,u[g+4]=a>>24&255,u[g+5]=a>>16&255,u[g+6]=a>>8&255,u[g+7]=a&255}function _(u,g,v,a,x){var W,B=0;for(W=0;W>>8)-1}function O(u,g,v,a){return _(u,g,v,a,16)}function b(u,g,v,a){return _(u,g,v,a,32)}function p(u,g,v,a){for(var x=a[0]&255|(a[1]&255)<<8|(a[2]&255)<<16|(a[3]&255)<<24,W=v[0]&255|(v[1]&255)<<8|(v[2]&255)<<16|(v[3]&255)<<24,B=v[4]&255|(v[5]&255)<<8|(v[6]&255)<<16|(v[7]&255)<<24,Q=v[8]&255|(v[9]&255)<<8|(v[10]&255)<<16|(v[11]&255)<<24,se=v[12]&255|(v[13]&255)<<8|(v[14]&255)<<16|(v[15]&255)<<24,be=a[4]&255|(a[5]&255)<<8|(a[6]&255)<<16|(a[7]&255)<<24,ue=g[0]&255|(g[1]&255)<<8|(g[2]&255)<<16|(g[3]&255)<<24,pt=g[4]&255|(g[5]&255)<<8|(g[6]&255)<<16|(g[7]&255)<<24,pe=g[8]&255|(g[9]&255)<<8|(g[10]&255)<<16|(g[11]&255)<<24,Be=g[12]&255|(g[13]&255)<<8|(g[14]&255)<<16|(g[15]&255)<<24,De=a[8]&255|(a[9]&255)<<8|(a[10]&255)<<16|(a[11]&255)<<24,qe=v[16]&255|(v[17]&255)<<8|(v[18]&255)<<16|(v[19]&255)<<24,Ke=v[20]&255|(v[21]&255)<<8|(v[22]&255)<<16|(v[23]&255)<<24,He=v[24]&255|(v[25]&255)<<8|(v[26]&255)<<16|(v[27]&255)<<24,ze=v[28]&255|(v[29]&255)<<8|(v[30]&255)<<16|(v[31]&255)<<24,Fe=a[12]&255|(a[13]&255)<<8|(a[14]&255)<<16|(a[15]&255)<<24,me=x,ke=W,fe=B,we=Q,xe=se,ce=be,H=ue,F=pt,te=pe,q=Be,Y=De,ie=qe,$e=Ke,Qe=He,Je=ze,Ye=Fe,k,rt=0;rt<20;rt+=2)k=me+$e|0,xe^=k<<7|k>>>25,k=xe+me|0,te^=k<<9|k>>>23,k=te+xe|0,$e^=k<<13|k>>>19,k=$e+te|0,me^=k<<18|k>>>14,k=ce+ke|0,q^=k<<7|k>>>25,k=q+ce|0,Qe^=k<<9|k>>>23,k=Qe+q|0,ke^=k<<13|k>>>19,k=ke+Qe|0,ce^=k<<18|k>>>14,k=Y+H|0,Je^=k<<7|k>>>25,k=Je+Y|0,fe^=k<<9|k>>>23,k=fe+Je|0,H^=k<<13|k>>>19,k=H+fe|0,Y^=k<<18|k>>>14,k=Ye+ie|0,we^=k<<7|k>>>25,k=we+Ye|0,F^=k<<9|k>>>23,k=F+we|0,ie^=k<<13|k>>>19,k=ie+F|0,Ye^=k<<18|k>>>14,k=me+we|0,ke^=k<<7|k>>>25,k=ke+me|0,fe^=k<<9|k>>>23,k=fe+ke|0,we^=k<<13|k>>>19,k=we+fe|0,me^=k<<18|k>>>14,k=ce+xe|0,H^=k<<7|k>>>25,k=H+ce|0,F^=k<<9|k>>>23,k=F+H|0,xe^=k<<13|k>>>19,k=xe+F|0,ce^=k<<18|k>>>14,k=Y+q|0,ie^=k<<7|k>>>25,k=ie+Y|0,te^=k<<9|k>>>23,k=te+ie|0,q^=k<<13|k>>>19,k=q+te|0,Y^=k<<18|k>>>14,k=Ye+Je|0,$e^=k<<7|k>>>25,k=$e+Ye|0,Qe^=k<<9|k>>>23,k=Qe+$e|0,Je^=k<<13|k>>>19,k=Je+Qe|0,Ye^=k<<18|k>>>14;me=me+x|0,ke=ke+W|0,fe=fe+B|0,we=we+Q|0,xe=xe+se|0,ce=ce+be|0,H=H+ue|0,F=F+pt|0,te=te+pe|0,q=q+Be|0,Y=Y+De|0,ie=ie+qe|0,$e=$e+Ke|0,Qe=Qe+He|0,Je=Je+ze|0,Ye=Ye+Fe|0,u[0]=me>>>0&255,u[1]=me>>>8&255,u[2]=me>>>16&255,u[3]=me>>>24&255,u[4]=ke>>>0&255,u[5]=ke>>>8&255,u[6]=ke>>>16&255,u[7]=ke>>>24&255,u[8]=fe>>>0&255,u[9]=fe>>>8&255,u[10]=fe>>>16&255,u[11]=fe>>>24&255,u[12]=we>>>0&255,u[13]=we>>>8&255,u[14]=we>>>16&255,u[15]=we>>>24&255,u[16]=xe>>>0&255,u[17]=xe>>>8&255,u[18]=xe>>>16&255,u[19]=xe>>>24&255,u[20]=ce>>>0&255,u[21]=ce>>>8&255,u[22]=ce>>>16&255,u[23]=ce>>>24&255,u[24]=H>>>0&255,u[25]=H>>>8&255,u[26]=H>>>16&255,u[27]=H>>>24&255,u[28]=F>>>0&255,u[29]=F>>>8&255,u[30]=F>>>16&255,u[31]=F>>>24&255,u[32]=te>>>0&255,u[33]=te>>>8&255,u[34]=te>>>16&255,u[35]=te>>>24&255,u[36]=q>>>0&255,u[37]=q>>>8&255,u[38]=q>>>16&255,u[39]=q>>>24&255,u[40]=Y>>>0&255,u[41]=Y>>>8&255,u[42]=Y>>>16&255,u[43]=Y>>>24&255,u[44]=ie>>>0&255,u[45]=ie>>>8&255,u[46]=ie>>>16&255,u[47]=ie>>>24&255,u[48]=$e>>>0&255,u[49]=$e>>>8&255,u[50]=$e>>>16&255,u[51]=$e>>>24&255,u[52]=Qe>>>0&255,u[53]=Qe>>>8&255,u[54]=Qe>>>16&255,u[55]=Qe>>>24&255,u[56]=Je>>>0&255,u[57]=Je>>>8&255,u[58]=Je>>>16&255,u[59]=Je>>>24&255,u[60]=Ye>>>0&255,u[61]=Ye>>>8&255,u[62]=Ye>>>16&255,u[63]=Ye>>>24&255}function y(u,g,v,a){for(var x=a[0]&255|(a[1]&255)<<8|(a[2]&255)<<16|(a[3]&255)<<24,W=v[0]&255|(v[1]&255)<<8|(v[2]&255)<<16|(v[3]&255)<<24,B=v[4]&255|(v[5]&255)<<8|(v[6]&255)<<16|(v[7]&255)<<24,Q=v[8]&255|(v[9]&255)<<8|(v[10]&255)<<16|(v[11]&255)<<24,se=v[12]&255|(v[13]&255)<<8|(v[14]&255)<<16|(v[15]&255)<<24,be=a[4]&255|(a[5]&255)<<8|(a[6]&255)<<16|(a[7]&255)<<24,ue=g[0]&255|(g[1]&255)<<8|(g[2]&255)<<16|(g[3]&255)<<24,pt=g[4]&255|(g[5]&255)<<8|(g[6]&255)<<16|(g[7]&255)<<24,pe=g[8]&255|(g[9]&255)<<8|(g[10]&255)<<16|(g[11]&255)<<24,Be=g[12]&255|(g[13]&255)<<8|(g[14]&255)<<16|(g[15]&255)<<24,De=a[8]&255|(a[9]&255)<<8|(a[10]&255)<<16|(a[11]&255)<<24,qe=v[16]&255|(v[17]&255)<<8|(v[18]&255)<<16|(v[19]&255)<<24,Ke=v[20]&255|(v[21]&255)<<8|(v[22]&255)<<16|(v[23]&255)<<24,He=v[24]&255|(v[25]&255)<<8|(v[26]&255)<<16|(v[27]&255)<<24,ze=v[28]&255|(v[29]&255)<<8|(v[30]&255)<<16|(v[31]&255)<<24,Fe=a[12]&255|(a[13]&255)<<8|(a[14]&255)<<16|(a[15]&255)<<24,me=x,ke=W,fe=B,we=Q,xe=se,ce=be,H=ue,F=pt,te=pe,q=Be,Y=De,ie=qe,$e=Ke,Qe=He,Je=ze,Ye=Fe,k,rt=0;rt<20;rt+=2)k=me+$e|0,xe^=k<<7|k>>>25,k=xe+me|0,te^=k<<9|k>>>23,k=te+xe|0,$e^=k<<13|k>>>19,k=$e+te|0,me^=k<<18|k>>>14,k=ce+ke|0,q^=k<<7|k>>>25,k=q+ce|0,Qe^=k<<9|k>>>23,k=Qe+q|0,ke^=k<<13|k>>>19,k=ke+Qe|0,ce^=k<<18|k>>>14,k=Y+H|0,Je^=k<<7|k>>>25,k=Je+Y|0,fe^=k<<9|k>>>23,k=fe+Je|0,H^=k<<13|k>>>19,k=H+fe|0,Y^=k<<18|k>>>14,k=Ye+ie|0,we^=k<<7|k>>>25,k=we+Ye|0,F^=k<<9|k>>>23,k=F+we|0,ie^=k<<13|k>>>19,k=ie+F|0,Ye^=k<<18|k>>>14,k=me+we|0,ke^=k<<7|k>>>25,k=ke+me|0,fe^=k<<9|k>>>23,k=fe+ke|0,we^=k<<13|k>>>19,k=we+fe|0,me^=k<<18|k>>>14,k=ce+xe|0,H^=k<<7|k>>>25,k=H+ce|0,F^=k<<9|k>>>23,k=F+H|0,xe^=k<<13|k>>>19,k=xe+F|0,ce^=k<<18|k>>>14,k=Y+q|0,ie^=k<<7|k>>>25,k=ie+Y|0,te^=k<<9|k>>>23,k=te+ie|0,q^=k<<13|k>>>19,k=q+te|0,Y^=k<<18|k>>>14,k=Ye+Je|0,$e^=k<<7|k>>>25,k=$e+Ye|0,Qe^=k<<9|k>>>23,k=Qe+$e|0,Je^=k<<13|k>>>19,k=Je+Qe|0,Ye^=k<<18|k>>>14;u[0]=me>>>0&255,u[1]=me>>>8&255,u[2]=me>>>16&255,u[3]=me>>>24&255,u[4]=ce>>>0&255,u[5]=ce>>>8&255,u[6]=ce>>>16&255,u[7]=ce>>>24&255,u[8]=Y>>>0&255,u[9]=Y>>>8&255,u[10]=Y>>>16&255,u[11]=Y>>>24&255,u[12]=Ye>>>0&255,u[13]=Ye>>>8&255,u[14]=Ye>>>16&255,u[15]=Ye>>>24&255,u[16]=H>>>0&255,u[17]=H>>>8&255,u[18]=H>>>16&255,u[19]=H>>>24&255,u[20]=F>>>0&255,u[21]=F>>>8&255,u[22]=F>>>16&255,u[23]=F>>>24&255,u[24]=te>>>0&255,u[25]=te>>>8&255,u[26]=te>>>16&255,u[27]=te>>>24&255,u[28]=q>>>0&255,u[29]=q>>>8&255,u[30]=q>>>16&255,u[31]=q>>>24&255}function E(u,g,v,a){p(u,g,v,a)}function T(u,g,v,a){y(u,g,v,a)}var N=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function I(u,g,v,a,x,W,B){var Q=new Uint8Array(16),se=new Uint8Array(64),be,ue;for(ue=0;ue<16;ue++)Q[ue]=0;for(ue=0;ue<8;ue++)Q[ue]=W[ue];for(;x>=64;){for(E(se,Q,B,N),ue=0;ue<64;ue++)u[g+ue]=v[a+ue]^se[ue];for(be=1,ue=8;ue<16;ue++)be=be+(Q[ue]&255)|0,Q[ue]=be&255,be>>>=8;x-=64,g+=64,a+=64}if(x>0)for(E(se,Q,B,N),ue=0;ue=64;){for(E(B,W,x,N),se=0;se<64;se++)u[g+se]=B[se];for(Q=1,se=8;se<16;se++)Q=Q+(W[se]&255)|0,W[se]=Q&255,Q>>>=8;v-=64,g+=64}if(v>0)for(E(B,W,x,N),se=0;se>>13|v<<3)&8191,a=u[4]&255|(u[5]&255)<<8,this.r[2]=(v>>>10|a<<6)&7939,x=u[6]&255|(u[7]&255)<<8,this.r[3]=(a>>>7|x<<9)&8191,W=u[8]&255|(u[9]&255)<<8,this.r[4]=(x>>>4|W<<12)&255,this.r[5]=W>>>1&8190,B=u[10]&255|(u[11]&255)<<8,this.r[6]=(W>>>14|B<<2)&8191,Q=u[12]&255|(u[13]&255)<<8,this.r[7]=(B>>>11|Q<<5)&8065,se=u[14]&255|(u[15]&255)<<8,this.r[8]=(Q>>>8|se<<8)&8191,this.r[9]=se>>>5&127,this.pad[0]=u[16]&255|(u[17]&255)<<8,this.pad[1]=u[18]&255|(u[19]&255)<<8,this.pad[2]=u[20]&255|(u[21]&255)<<8,this.pad[3]=u[22]&255|(u[23]&255)<<8,this.pad[4]=u[24]&255|(u[25]&255)<<8,this.pad[5]=u[26]&255|(u[27]&255)<<8,this.pad[6]=u[28]&255|(u[29]&255)<<8,this.pad[7]=u[30]&255|(u[31]&255)<<8};$.prototype.blocks=function(u,g,v){for(var a=this.fin?0:2048,x,W,B,Q,se,be,ue,pt,pe,Be,De,qe,Ke,He,ze,Fe,me,ke,fe,we=this.h[0],xe=this.h[1],ce=this.h[2],H=this.h[3],F=this.h[4],te=this.h[5],q=this.h[6],Y=this.h[7],ie=this.h[8],$e=this.h[9],Qe=this.r[0],Je=this.r[1],Ye=this.r[2],k=this.r[3],rt=this.r[4],gt=this.r[5],vt=this.r[6],tt=this.r[7],ft=this.r[8],dt=this.r[9];v>=16;)x=u[g+0]&255|(u[g+1]&255)<<8,we+=x&8191,W=u[g+2]&255|(u[g+3]&255)<<8,xe+=(x>>>13|W<<3)&8191,B=u[g+4]&255|(u[g+5]&255)<<8,ce+=(W>>>10|B<<6)&8191,Q=u[g+6]&255|(u[g+7]&255)<<8,H+=(B>>>7|Q<<9)&8191,se=u[g+8]&255|(u[g+9]&255)<<8,F+=(Q>>>4|se<<12)&8191,te+=se>>>1&8191,be=u[g+10]&255|(u[g+11]&255)<<8,q+=(se>>>14|be<<2)&8191,ue=u[g+12]&255|(u[g+13]&255)<<8,Y+=(be>>>11|ue<<5)&8191,pt=u[g+14]&255|(u[g+15]&255)<<8,ie+=(ue>>>8|pt<<8)&8191,$e+=pt>>>5|a,pe=0,Be=pe,Be+=we*Qe,Be+=xe*(5*dt),Be+=ce*(5*ft),Be+=H*(5*tt),Be+=F*(5*vt),pe=Be>>>13,Be&=8191,Be+=te*(5*gt),Be+=q*(5*rt),Be+=Y*(5*k),Be+=ie*(5*Ye),Be+=$e*(5*Je),pe+=Be>>>13,Be&=8191,De=pe,De+=we*Je,De+=xe*Qe,De+=ce*(5*dt),De+=H*(5*ft),De+=F*(5*tt),pe=De>>>13,De&=8191,De+=te*(5*vt),De+=q*(5*gt),De+=Y*(5*rt),De+=ie*(5*k),De+=$e*(5*Ye),pe+=De>>>13,De&=8191,qe=pe,qe+=we*Ye,qe+=xe*Je,qe+=ce*Qe,qe+=H*(5*dt),qe+=F*(5*ft),pe=qe>>>13,qe&=8191,qe+=te*(5*tt),qe+=q*(5*vt),qe+=Y*(5*gt),qe+=ie*(5*rt),qe+=$e*(5*k),pe+=qe>>>13,qe&=8191,Ke=pe,Ke+=we*k,Ke+=xe*Ye,Ke+=ce*Je,Ke+=H*Qe,Ke+=F*(5*dt),pe=Ke>>>13,Ke&=8191,Ke+=te*(5*ft),Ke+=q*(5*tt),Ke+=Y*(5*vt),Ke+=ie*(5*gt),Ke+=$e*(5*rt),pe+=Ke>>>13,Ke&=8191,He=pe,He+=we*rt,He+=xe*k,He+=ce*Ye,He+=H*Je,He+=F*Qe,pe=He>>>13,He&=8191,He+=te*(5*dt),He+=q*(5*ft),He+=Y*(5*tt),He+=ie*(5*vt),He+=$e*(5*gt),pe+=He>>>13,He&=8191,ze=pe,ze+=we*gt,ze+=xe*rt,ze+=ce*k,ze+=H*Ye,ze+=F*Je,pe=ze>>>13,ze&=8191,ze+=te*Qe,ze+=q*(5*dt),ze+=Y*(5*ft),ze+=ie*(5*tt),ze+=$e*(5*vt),pe+=ze>>>13,ze&=8191,Fe=pe,Fe+=we*vt,Fe+=xe*gt,Fe+=ce*rt,Fe+=H*k,Fe+=F*Ye,pe=Fe>>>13,Fe&=8191,Fe+=te*Je,Fe+=q*Qe,Fe+=Y*(5*dt),Fe+=ie*(5*ft),Fe+=$e*(5*tt),pe+=Fe>>>13,Fe&=8191,me=pe,me+=we*tt,me+=xe*vt,me+=ce*gt,me+=H*rt,me+=F*k,pe=me>>>13,me&=8191,me+=te*Ye,me+=q*Je,me+=Y*Qe,me+=ie*(5*dt),me+=$e*(5*ft),pe+=me>>>13,me&=8191,ke=pe,ke+=we*ft,ke+=xe*tt,ke+=ce*vt,ke+=H*gt,ke+=F*rt,pe=ke>>>13,ke&=8191,ke+=te*k,ke+=q*Ye,ke+=Y*Je,ke+=ie*Qe,ke+=$e*(5*dt),pe+=ke>>>13,ke&=8191,fe=pe,fe+=we*dt,fe+=xe*ft,fe+=ce*tt,fe+=H*vt,fe+=F*gt,pe=fe>>>13,fe&=8191,fe+=te*rt,fe+=q*k,fe+=Y*Ye,fe+=ie*Je,fe+=$e*Qe,pe+=fe>>>13,fe&=8191,pe=(pe<<2)+pe|0,pe=pe+Be|0,Be=pe&8191,pe=pe>>>13,De+=pe,we=Be,xe=De,ce=qe,H=Ke,F=He,te=ze,q=Fe,Y=me,ie=ke,$e=fe,g+=16,v-=16;this.h[0]=we,this.h[1]=xe,this.h[2]=ce,this.h[3]=H,this.h[4]=F,this.h[5]=te,this.h[6]=q,this.h[7]=Y,this.h[8]=ie,this.h[9]=$e},$.prototype.finish=function(u,g){var v=new Uint16Array(10),a,x,W,B;if(this.leftover){for(B=this.leftover,this.buffer[B++]=1;B<16;B++)this.buffer[B]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(a=this.h[1]>>>13,this.h[1]&=8191,B=2;B<10;B++)this.h[B]+=a,a=this.h[B]>>>13,this.h[B]&=8191;for(this.h[0]+=a*5,a=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=a,a=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=a,v[0]=this.h[0]+5,a=v[0]>>>13,v[0]&=8191,B=1;B<10;B++)v[B]=this.h[B]+a,a=v[B]>>>13,v[B]&=8191;for(v[9]-=8192,x=(a^1)-1,B=0;B<10;B++)v[B]&=x;for(x=~x,B=0;B<10;B++)this.h[B]=this.h[B]&x|v[B];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,W=this.h[0]+this.pad[0],this.h[0]=W&65535,B=1;B<8;B++)W=(this.h[B]+this.pad[B]|0)+(W>>>16)|0,this.h[B]=W&65535;u[g+0]=this.h[0]>>>0&255,u[g+1]=this.h[0]>>>8&255,u[g+2]=this.h[1]>>>0&255,u[g+3]=this.h[1]>>>8&255,u[g+4]=this.h[2]>>>0&255,u[g+5]=this.h[2]>>>8&255,u[g+6]=this.h[3]>>>0&255,u[g+7]=this.h[3]>>>8&255,u[g+8]=this.h[4]>>>0&255,u[g+9]=this.h[4]>>>8&255,u[g+10]=this.h[5]>>>0&255,u[g+11]=this.h[5]>>>8&255,u[g+12]=this.h[6]>>>0&255,u[g+13]=this.h[6]>>>8&255,u[g+14]=this.h[7]>>>0&255,u[g+15]=this.h[7]>>>8&255},$.prototype.update=function(u,g,v){var a,x;if(this.leftover){for(x=16-this.leftover,x>v&&(x=v),a=0;a=16&&(x=v-v%16,this.blocks(u,g,x),g+=x,v-=x),v){for(a=0;a>16&1),W[v-1]&=65535;W[15]=B[15]-32767-(W[14]>>16&1),x=W[15]>>16&1,W[14]&=65535,J(B,W,1-x)}for(v=0;v<16;v++)u[2*v]=B[v]&255,u[2*v+1]=B[v]>>8}function ye(u,g){var v=new Uint8Array(32),a=new Uint8Array(32);return ae(v,u),ae(a,g),b(v,0,a,0)}function et(u){var g=new Uint8Array(32);return ae(g,u),g[0]&1}function Ze(u,g){var v;for(v=0;v<16;v++)u[v]=g[2*v]+(g[2*v+1]<<8);u[15]&=32767}function ct(u,g,v){for(var a=0;a<16;a++)u[a]=g[a]+v[a]}function yt(u,g,v){for(var a=0;a<16;a++)u[a]=g[a]-v[a]}function Ne(u,g,v){var a,x,W=0,B=0,Q=0,se=0,be=0,ue=0,pt=0,pe=0,Be=0,De=0,qe=0,Ke=0,He=0,ze=0,Fe=0,me=0,ke=0,fe=0,we=0,xe=0,ce=0,H=0,F=0,te=0,q=0,Y=0,ie=0,$e=0,Qe=0,Je=0,Ye=0,k=v[0],rt=v[1],gt=v[2],vt=v[3],tt=v[4],ft=v[5],dt=v[6],Kt=v[7],_t=v[8],Ht=v[9],Ft=v[10],zt=v[11],Xt=v[12],yn=v[13],wn=v[14],xn=v[15];a=g[0],W+=a*k,B+=a*rt,Q+=a*gt,se+=a*vt,be+=a*tt,ue+=a*ft,pt+=a*dt,pe+=a*Kt,Be+=a*_t,De+=a*Ht,qe+=a*Ft,Ke+=a*zt,He+=a*Xt,ze+=a*yn,Fe+=a*wn,me+=a*xn,a=g[1],B+=a*k,Q+=a*rt,se+=a*gt,be+=a*vt,ue+=a*tt,pt+=a*ft,pe+=a*dt,Be+=a*Kt,De+=a*_t,qe+=a*Ht,Ke+=a*Ft,He+=a*zt,ze+=a*Xt,Fe+=a*yn,me+=a*wn,ke+=a*xn,a=g[2],Q+=a*k,se+=a*rt,be+=a*gt,ue+=a*vt,pt+=a*tt,pe+=a*ft,Be+=a*dt,De+=a*Kt,qe+=a*_t,Ke+=a*Ht,He+=a*Ft,ze+=a*zt,Fe+=a*Xt,me+=a*yn,ke+=a*wn,fe+=a*xn,a=g[3],se+=a*k,be+=a*rt,ue+=a*gt,pt+=a*vt,pe+=a*tt,Be+=a*ft,De+=a*dt,qe+=a*Kt,Ke+=a*_t,He+=a*Ht,ze+=a*Ft,Fe+=a*zt,me+=a*Xt,ke+=a*yn,fe+=a*wn,we+=a*xn,a=g[4],be+=a*k,ue+=a*rt,pt+=a*gt,pe+=a*vt,Be+=a*tt,De+=a*ft,qe+=a*dt,Ke+=a*Kt,He+=a*_t,ze+=a*Ht,Fe+=a*Ft,me+=a*zt,ke+=a*Xt,fe+=a*yn,we+=a*wn,xe+=a*xn,a=g[5],ue+=a*k,pt+=a*rt,pe+=a*gt,Be+=a*vt,De+=a*tt,qe+=a*ft,Ke+=a*dt,He+=a*Kt,ze+=a*_t,Fe+=a*Ht,me+=a*Ft,ke+=a*zt,fe+=a*Xt,we+=a*yn,xe+=a*wn,ce+=a*xn,a=g[6],pt+=a*k,pe+=a*rt,Be+=a*gt,De+=a*vt,qe+=a*tt,Ke+=a*ft,He+=a*dt,ze+=a*Kt,Fe+=a*_t,me+=a*Ht,ke+=a*Ft,fe+=a*zt,we+=a*Xt,xe+=a*yn,ce+=a*wn,H+=a*xn,a=g[7],pe+=a*k,Be+=a*rt,De+=a*gt,qe+=a*vt,Ke+=a*tt,He+=a*ft,ze+=a*dt,Fe+=a*Kt,me+=a*_t,ke+=a*Ht,fe+=a*Ft,we+=a*zt,xe+=a*Xt,ce+=a*yn,H+=a*wn,F+=a*xn,a=g[8],Be+=a*k,De+=a*rt,qe+=a*gt,Ke+=a*vt,He+=a*tt,ze+=a*ft,Fe+=a*dt,me+=a*Kt,ke+=a*_t,fe+=a*Ht,we+=a*Ft,xe+=a*zt,ce+=a*Xt,H+=a*yn,F+=a*wn,te+=a*xn,a=g[9],De+=a*k,qe+=a*rt,Ke+=a*gt,He+=a*vt,ze+=a*tt,Fe+=a*ft,me+=a*dt,ke+=a*Kt,fe+=a*_t,we+=a*Ht,xe+=a*Ft,ce+=a*zt,H+=a*Xt,F+=a*yn,te+=a*wn,q+=a*xn,a=g[10],qe+=a*k,Ke+=a*rt,He+=a*gt,ze+=a*vt,Fe+=a*tt,me+=a*ft,ke+=a*dt,fe+=a*Kt,we+=a*_t,xe+=a*Ht,ce+=a*Ft,H+=a*zt,F+=a*Xt,te+=a*yn,q+=a*wn,Y+=a*xn,a=g[11],Ke+=a*k,He+=a*rt,ze+=a*gt,Fe+=a*vt,me+=a*tt,ke+=a*ft,fe+=a*dt,we+=a*Kt,xe+=a*_t,ce+=a*Ht,H+=a*Ft,F+=a*zt,te+=a*Xt,q+=a*yn,Y+=a*wn,ie+=a*xn,a=g[12],He+=a*k,ze+=a*rt,Fe+=a*gt,me+=a*vt,ke+=a*tt,fe+=a*ft,we+=a*dt,xe+=a*Kt,ce+=a*_t,H+=a*Ht,F+=a*Ft,te+=a*zt,q+=a*Xt,Y+=a*yn,ie+=a*wn,$e+=a*xn,a=g[13],ze+=a*k,Fe+=a*rt,me+=a*gt,ke+=a*vt,fe+=a*tt,we+=a*ft,xe+=a*dt,ce+=a*Kt,H+=a*_t,F+=a*Ht,te+=a*Ft,q+=a*zt,Y+=a*Xt,ie+=a*yn,$e+=a*wn,Qe+=a*xn,a=g[14],Fe+=a*k,me+=a*rt,ke+=a*gt,fe+=a*vt,we+=a*tt,xe+=a*ft,ce+=a*dt,H+=a*Kt,F+=a*_t,te+=a*Ht,q+=a*Ft,Y+=a*zt,ie+=a*Xt,$e+=a*yn,Qe+=a*wn,Je+=a*xn,a=g[15],me+=a*k,ke+=a*rt,fe+=a*gt,we+=a*vt,xe+=a*tt,ce+=a*ft,H+=a*dt,F+=a*Kt,te+=a*_t,q+=a*Ht,Y+=a*Ft,ie+=a*zt,$e+=a*Xt,Qe+=a*yn,Je+=a*wn,Ye+=a*xn,W+=38*ke,B+=38*fe,Q+=38*we,se+=38*xe,be+=38*ce,ue+=38*H,pt+=38*F,pe+=38*te,Be+=38*q,De+=38*Y,qe+=38*ie,Ke+=38*$e,He+=38*Qe,ze+=38*Je,Fe+=38*Ye,x=1,a=W+x+65535,x=Math.floor(a/65536),W=a-x*65536,a=B+x+65535,x=Math.floor(a/65536),B=a-x*65536,a=Q+x+65535,x=Math.floor(a/65536),Q=a-x*65536,a=se+x+65535,x=Math.floor(a/65536),se=a-x*65536,a=be+x+65535,x=Math.floor(a/65536),be=a-x*65536,a=ue+x+65535,x=Math.floor(a/65536),ue=a-x*65536,a=pt+x+65535,x=Math.floor(a/65536),pt=a-x*65536,a=pe+x+65535,x=Math.floor(a/65536),pe=a-x*65536,a=Be+x+65535,x=Math.floor(a/65536),Be=a-x*65536,a=De+x+65535,x=Math.floor(a/65536),De=a-x*65536,a=qe+x+65535,x=Math.floor(a/65536),qe=a-x*65536,a=Ke+x+65535,x=Math.floor(a/65536),Ke=a-x*65536,a=He+x+65535,x=Math.floor(a/65536),He=a-x*65536,a=ze+x+65535,x=Math.floor(a/65536),ze=a-x*65536,a=Fe+x+65535,x=Math.floor(a/65536),Fe=a-x*65536,a=me+x+65535,x=Math.floor(a/65536),me=a-x*65536,W+=x-1+37*(x-1),x=1,a=W+x+65535,x=Math.floor(a/65536),W=a-x*65536,a=B+x+65535,x=Math.floor(a/65536),B=a-x*65536,a=Q+x+65535,x=Math.floor(a/65536),Q=a-x*65536,a=se+x+65535,x=Math.floor(a/65536),se=a-x*65536,a=be+x+65535,x=Math.floor(a/65536),be=a-x*65536,a=ue+x+65535,x=Math.floor(a/65536),ue=a-x*65536,a=pt+x+65535,x=Math.floor(a/65536),pt=a-x*65536,a=pe+x+65535,x=Math.floor(a/65536),pe=a-x*65536,a=Be+x+65535,x=Math.floor(a/65536),Be=a-x*65536,a=De+x+65535,x=Math.floor(a/65536),De=a-x*65536,a=qe+x+65535,x=Math.floor(a/65536),qe=a-x*65536,a=Ke+x+65535,x=Math.floor(a/65536),Ke=a-x*65536,a=He+x+65535,x=Math.floor(a/65536),He=a-x*65536,a=ze+x+65535,x=Math.floor(a/65536),ze=a-x*65536,a=Fe+x+65535,x=Math.floor(a/65536),Fe=a-x*65536,a=me+x+65535,x=Math.floor(a/65536),me=a-x*65536,W+=x-1+37*(x-1),u[0]=W,u[1]=B,u[2]=Q,u[3]=se,u[4]=be,u[5]=ue,u[6]=pt,u[7]=pe,u[8]=Be,u[9]=De,u[10]=qe,u[11]=Ke,u[12]=He,u[13]=ze,u[14]=Fe,u[15]=me}function ut(u,g){Ne(u,g,g)}function Tn(u,g){var v=n(),a;for(a=0;a<16;a++)v[a]=g[a];for(a=253;a>=0;a--)ut(v,v),a!==2&&a!==4&&Ne(v,v,g);for(a=0;a<16;a++)u[a]=v[a]}function V(u,g){var v=n(),a;for(a=0;a<16;a++)v[a]=g[a];for(a=250;a>=0;a--)ut(v,v),a!==1&&Ne(v,v,g);for(a=0;a<16;a++)u[a]=v[a]}function K(u,g,v){var a=new Uint8Array(32),x=new Float64Array(80),W,B,Q=n(),se=n(),be=n(),ue=n(),pt=n(),pe=n();for(B=0;B<31;B++)a[B]=g[B];for(a[31]=g[31]&127|64,a[0]&=248,Ze(x,v),B=0;B<16;B++)se[B]=x[B],ue[B]=Q[B]=be[B]=0;for(Q[0]=ue[0]=1,B=254;B>=0;--B)W=a[B>>>3]>>>(B&7)&1,J(Q,se,W),J(be,ue,W),ct(pt,Q,be),yt(Q,Q,be),ct(be,se,ue),yt(se,se,ue),ut(ue,pt),ut(pe,Q),Ne(Q,be,Q),Ne(be,se,pt),ct(pt,Q,be),yt(Q,Q,be),ut(se,Q),yt(be,ue,pe),Ne(Q,be,c),ct(Q,Q,ue),Ne(be,be,Q),Ne(Q,ue,pe),Ne(ue,se,x),ut(se,pt),J(Q,se,W),J(be,ue,W);for(B=0;B<16;B++)x[B+16]=Q[B],x[B+32]=be[B],x[B+48]=se[B],x[B+64]=ue[B];var Be=x.subarray(32),De=x.subarray(16);return Tn(Be,Be),Ne(De,De,Be),ae(u,De),0}function D(u,g){return K(u,g,i)}function Z(u,g){return r(g,32),D(u,g)}function G(u,g,v){var a=new Uint8Array(32);return K(a,v,g),T(u,o,a,N)}var re=ee,Se=ne;function _e(u,g,v,a,x,W){var B=new Uint8Array(32);return G(B,x,W),re(u,g,v,a,B)}function Ve(u,g,v,a,x,W){var B=new Uint8Array(32);return G(B,x,W),Se(u,g,v,a,B)}var bt=[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 Pe(u,g,v,a){for(var x=new Int32Array(16),W=new Int32Array(16),B,Q,se,be,ue,pt,pe,Be,De,qe,Ke,He,ze,Fe,me,ke,fe,we,xe,ce,H,F,te,q,Y,ie,$e=u[0],Qe=u[1],Je=u[2],Ye=u[3],k=u[4],rt=u[5],gt=u[6],vt=u[7],tt=g[0],ft=g[1],dt=g[2],Kt=g[3],_t=g[4],Ht=g[5],Ft=g[6],zt=g[7],Xt=0;a>=128;){for(xe=0;xe<16;xe++)ce=8*xe+Xt,x[xe]=v[ce+0]<<24|v[ce+1]<<16|v[ce+2]<<8|v[ce+3],W[xe]=v[ce+4]<<24|v[ce+5]<<16|v[ce+6]<<8|v[ce+7];for(xe=0;xe<80;xe++)if(B=$e,Q=Qe,se=Je,be=Ye,ue=k,pt=rt,pe=gt,Be=vt,De=tt,qe=ft,Ke=dt,He=Kt,ze=_t,Fe=Ht,me=Ft,ke=zt,H=vt,F=zt,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=(k>>>14|_t<<18)^(k>>>18|_t<<14)^(_t>>>9|k<<23),F=(_t>>>14|k<<18)^(_t>>>18|k<<14)^(k>>>9|_t<<23),te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,H=k&rt^~k>,F=_t&Ht^~_t&Ft,te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,H=bt[xe*2],F=bt[xe*2+1],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,H=x[xe%16],F=W[xe%16],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,fe=Y&65535|ie<<16,we=te&65535|q<<16,H=fe,F=we,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=($e>>>28|tt<<4)^(tt>>>2|$e<<30)^(tt>>>7|$e<<25),F=(tt>>>28|$e<<4)^($e>>>2|tt<<30)^($e>>>7|tt<<25),te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,H=$e&Qe^$e&Je^Qe&Je,F=tt&ft^tt&dt^ft&dt,te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,Be=Y&65535|ie<<16,ke=te&65535|q<<16,H=be,F=He,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=fe,F=we,te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,be=Y&65535|ie<<16,He=te&65535|q<<16,Qe=B,Je=Q,Ye=se,k=be,rt=ue,gt=pt,vt=pe,$e=Be,ft=De,dt=qe,Kt=Ke,_t=He,Ht=ze,Ft=Fe,zt=me,tt=ke,xe%16===15)for(ce=0;ce<16;ce++)H=x[ce],F=W[ce],te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=x[(ce+9)%16],F=W[(ce+9)%16],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,fe=x[(ce+1)%16],we=W[(ce+1)%16],H=(fe>>>1|we<<31)^(fe>>>8|we<<24)^fe>>>7,F=(we>>>1|fe<<31)^(we>>>8|fe<<24)^(we>>>7|fe<<25),te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,fe=x[(ce+14)%16],we=W[(ce+14)%16],H=(fe>>>19|we<<13)^(we>>>29|fe<<3)^fe>>>6,F=(we>>>19|fe<<13)^(fe>>>29|we<<3)^(we>>>6|fe<<26),te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,x[ce]=Y&65535|ie<<16,W[ce]=te&65535|q<<16;H=$e,F=tt,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[0],F=g[0],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[0]=$e=Y&65535|ie<<16,g[0]=tt=te&65535|q<<16,H=Qe,F=ft,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[1],F=g[1],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[1]=Qe=Y&65535|ie<<16,g[1]=ft=te&65535|q<<16,H=Je,F=dt,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[2],F=g[2],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[2]=Je=Y&65535|ie<<16,g[2]=dt=te&65535|q<<16,H=Ye,F=Kt,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[3],F=g[3],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[3]=Ye=Y&65535|ie<<16,g[3]=Kt=te&65535|q<<16,H=k,F=_t,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[4],F=g[4],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[4]=k=Y&65535|ie<<16,g[4]=_t=te&65535|q<<16,H=rt,F=Ht,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[5],F=g[5],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[5]=rt=Y&65535|ie<<16,g[5]=Ht=te&65535|q<<16,H=gt,F=Ft,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[6],F=g[6],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[6]=gt=Y&65535|ie<<16,g[6]=Ft=te&65535|q<<16,H=vt,F=zt,te=F&65535,q=F>>>16,Y=H&65535,ie=H>>>16,H=u[7],F=g[7],te+=F&65535,q+=F>>>16,Y+=H&65535,ie+=H>>>16,q+=te>>>16,Y+=q>>>16,ie+=Y>>>16,u[7]=vt=Y&65535|ie<<16,g[7]=zt=te&65535|q<<16,Xt+=128,a-=128}return a}function Rt(u,g,v){var a=new Int32Array(8),x=new Int32Array(8),W=new Uint8Array(256),B,Q=v;for(a[0]=1779033703,a[1]=3144134277,a[2]=1013904242,a[3]=2773480762,a[4]=1359893119,a[5]=2600822924,a[6]=528734635,a[7]=1541459225,x[0]=4089235720,x[1]=2227873595,x[2]=4271175723,x[3]=1595750129,x[4]=2917565137,x[5]=725511199,x[6]=4215389547,x[7]=327033209,Pe(a,x,g,v),v%=128,B=0;B=0;--x)a=v[x/8|0]>>(x&7)&1,Wn(u,g,a),jt(g,u),jt(u,u),Wn(u,g,a)}function An(u,g){var v=[n(),n(),n(),n()];Ce(v[0],w),Ce(v[1],h),Ce(v[2],s),Ne(v[3],w,h),Jt(u,v,g)}function Ie(u,g,v){var a=new Uint8Array(64),x=[n(),n(),n(),n()],W;for(v||r(g,32),Rt(a,g,32),a[0]&=248,a[31]&=127,a[31]|=64,An(x,a),Zt(u,x),W=0;W<32;W++)g[W+32]=u[W];return 0}var st=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 Ue(u,g){var v,a,x,W;for(a=63;a>=32;--a){for(v=0,x=a-32,W=a-12;x>4)*st[x],v=g[x]>>8,g[x]&=255;for(x=0;x<32;x++)g[x]-=v*st[x];for(a=0;a<32;a++)g[a+1]+=g[a]>>8,u[a]=g[a]&255}function wt(u){var g=new Float64Array(64),v;for(v=0;v<64;v++)g[v]=u[v];for(v=0;v<64;v++)u[v]=0;Ue(u,g)}function ln(u,g,v,a){var x=new Uint8Array(64),W=new Uint8Array(64),B=new Uint8Array(64),Q,se,be=new Float64Array(64),ue=[n(),n(),n(),n()];Rt(x,a,32),x[0]&=248,x[31]&=127,x[31]|=64;var pt=v+64;for(Q=0;Q>7&&yt(u[0],l,u[0]),Ne(u[3],u[0],u[1]),0)}function at(u,g,v,a){var x,W=new Uint8Array(32),B=new Uint8Array(64),Q=[n(),n(),n(),n()],se=[n(),n(),n(),n()];if(v<64||Un(se,a))return-1;for(x=0;x=0},t.sign.keyPair=function(){var u=new Uint8Array(Oe),g=new Uint8Array(Tt);return Ie(u,g),{publicKey:u,secretKey:g}},t.sign.keyPair.fromSecretKey=function(u){if(Ln(u),u.length!==Tt)throw new Error("bad secret key size");for(var g=new Uint8Array(Oe),v=0;v=e.length)throw new Error("Index is out of buffer");const n=e.slice(0,t),r=e.slice(t);return[n,r]}function ru(e){let t="";return e.forEach(n=>{t+=("0"+(n&255).toString(16)).slice(-2)}),t}function Ia(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{var o,i;if(!((o=void 0)===null||o===void 0)&&o.aborted){r(new Le("Delay aborted"));return}const l=setTimeout(()=>n(),e);(i=void 0)===null||i===void 0||i.addEventListener("abort",()=>{clearTimeout(l),r(new Le("Delay aborted"))})})})}function pr(e){const t=new AbortController;return e!=null&&e.aborted?t.abort():e==null||e.addEventListener("abort",()=>t.abort(),{once:!0}),t}function kl(e,t){var n,r;return ge(this,void 0,void 0,function*(){const o=(n=t==null?void 0:t.attempts)!==null&&n!==void 0?n:10,i=(r=t==null?void 0:t.delayMs)!==null&&r!==void 0?r:200,l=pr(t==null?void 0:t.signal);if(typeof e!="function")throw new Le(`Expected a function, got ${typeof e}`);let s=0,c;for(;sge(this,void 0,void 0,function*(){if(i=w??null,l==null||l.abort(),l=pr(w),l.signal.aborted)throw new Le("Resource creation was aborted");r=h??null;const S=e(l.signal,...h);o=S;const C=yield S;if(o!==S&&C!==n)throw yield t(C),new Le("Resource creation was aborted by a new resource creation");return n=C,n});return{create:s,current:()=>n??null,dispose:()=>ge(this,void 0,void 0,function*(){try{const w=n;n=null;const h=o;o=null;try{l==null||l.abort()}catch{}yield Promise.allSettled([w?t(w):Promise.resolve(),h?t(yield h):Promise.resolve()])}catch{}}),recreate:w=>ge(this,void 0,void 0,function*(){const h=n,S=o,C=r,_=i;if(yield Tp(w),h===n&&S===o&&C===r&&_===i)return yield s(i,...C??[]);throw new Le("Resource recreation was aborted by a new resource creation")})}}function J3(e,t){const n=t==null?void 0:t.timeout,r=t==null?void 0:t.signal,o=pr(r);return new Promise((i,l)=>{if(o.signal.aborted){l(new Le("Operation aborted"));return}let s;typeof n<"u"&&(s=setTimeout(()=>{o.abort(),l(new Le(`Timeout after ${n}ms`))},n)),o.signal.addEventListener("abort",()=>{clearTimeout(s),l(new Le("Operation aborted"))},{once:!0});const c={timeout:n,abort:o.signal};e(i,l,c).finally(()=>clearTimeout(s))})}class ou{constructor(t,n,r,o,i){this.bridgeUrl=n,this.sessionId=r,this.listener=o,this.errorsListener=i,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.defaultReconnectDelay=5e3,this.eventSource=G3((l,s)=>ge(this,void 0,void 0,function*(){const c={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:l,openingDeadlineMS:s};return yield X3(c)}),l=>ge(this,void 0,void 0,function*(){l.close()})),this.bridgeGatewayStorage=new Q3(t,n)}get isReady(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)===EventSource.OPEN}get isClosed(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)!==EventSource.OPEN}get isConnecting(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)===EventSource.CONNECTING}registerSession(t){return ge(this,void 0,void 0,function*(){yield this.eventSource.create(t==null?void 0:t.signal,t==null?void 0:t.openingDeadlineMS)})}send(t,n,r,o){var i;return ge(this,void 0,void 0,function*(){const l={};typeof o=="number"?l.ttl=o:(l.ttl=o==null?void 0:o.ttl,l.signal=o==null?void 0:o.signal,l.attempts=o==null?void 0:o.attempts);const s=new URL(kp(this.bridgeUrl,this.postPath));s.searchParams.append("client_id",this.sessionId),s.searchParams.append("to",n),s.searchParams.append("ttl",((l==null?void 0:l.ttl)||this.defaultTtl).toString()),s.searchParams.append("topic",r);const c=bd.encode(t);yield kl(f=>ge(this,void 0,void 0,function*(){const d=yield this.post(s,c,f.signal);if(!d.ok)throw new Le(`Bridge send failed, status ${d.status}`)}),{attempts:(i=l==null?void 0:l.attempts)!==null&&i!==void 0?i:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:l==null?void 0:l.signal})})}pause(){this.eventSource.dispose().catch(t=>Tr(`Bridge pause failed, ${t}`))}unPause(){return ge(this,void 0,void 0,function*(){yield this.eventSource.recreate(0)})}close(){return ge(this,void 0,void 0,function*(){yield this.eventSource.dispose().catch(t=>Tr(`Bridge close failed, ${t}`))})}setListener(t){this.listener=t}setErrorsListener(t){this.errorsListener=t}post(t,n,r){return ge(this,void 0,void 0,function*(){const o=yield fetch(t,{method:"post",body:n,signal:r});if(!o.ok)throw new Le(`Bridge send failed, status ${o.status}`);return o})}errorsHandler(t,n){return ge(this,void 0,void 0,function*(){if(this.isConnecting){Tr("Bridge error",JSON.stringify(n));return}if(this.isReady){try{this.errorsListener(n)}catch{}return}if(this.isClosed)return t.close(),en(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new Le("Bridge error, unknown state")})}messagesHandler(t){return ge(this,void 0,void 0,function*(){if(t.data===this.heartbeatMessage||(yield this.bridgeGatewayStorage.storeLastEventId(t.lastEventId),this.isClosed))return;let n;try{n=JSON.parse(t.data)}catch(r){throw new Le(`Bridge message parse failed, message ${r.data}`)}this.listener(n)})}}function X3(e){return ge(this,void 0,void 0,function*(){return yield J3((t,n,r)=>ge(this,void 0,void 0,function*(){var o;const l=pr(r.signal).signal;if(l.aborted){n(new Le("Bridge connection aborted"));return}const s=new URL(kp(e.bridgeUrl,e.ssePath));s.searchParams.append("client_id",e.sessionId);const c=yield e.bridgeGatewayStorage.getLastEventId();if(c&&s.searchParams.append("last_event_id",c),l.aborted){n(new Le("Bridge connection aborted"));return}const f=new EventSource(s.toString());f.onerror=d=>ge(this,void 0,void 0,function*(){if(l.aborted){f.close(),n(new Le("Bridge connection aborted"));return}try{const w=yield e.errorHandler(f,d);w!==f&&f.close(),w&&w!==f&&t(w)}catch(w){f.close(),n(w)}}),f.onopen=()=>{if(l.aborted){f.close(),n(new Le("Bridge connection aborted"));return}t(f)},f.onmessage=d=>{if(l.aborted){f.close(),n(new Le("Bridge connection aborted"));return}e.messageHandler(d)},(o=e.signal)===null||o===void 0||o.addEventListener("abort",()=>{f.close(),n(new Le("Bridge connection aborted"))})}),{timeout:e.openingDeadlineMS,signal:e.signal})})}function El(e){return!("connectEvent"in e)}class Gl{constructor(t){this.storage=t,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(t){return ge(this,void 0,void 0,function*(){if(t.type==="injected")return this.storage.setItem(this.storeKey,JSON.stringify(t));if(!El(t)){const r={sessionKeyPair:t.session.sessionCrypto.stringifyKeypair(),walletPublicKey:t.session.walletPublicKey,bridgeUrl:t.session.bridgeUrl},o={type:"http",connectEvent:t.connectEvent,session:r,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(o))}const n={type:"http",connectionSource:t.connectionSource,sessionCrypto:t.sessionCrypto.stringifyKeypair()};return this.storage.setItem(this.storeKey,JSON.stringify(n))})}removeConnection(){return ge(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return ge(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);if(!t)return null;const n=JSON.parse(t);if(n.type==="injected")return n;if("connectEvent"in n){const r=new df(n.session.sessionKeyPair);return{type:"http",connectEvent:n.connectEvent,lastWalletEventId:n.lastWalletEventId,nextRpcRequestId:n.nextRpcRequestId,session:{sessionCrypto:r,bridgeUrl:n.session.bridgeUrl,walletPublicKey:n.session.walletPublicKey}}}return{type:"http",sessionCrypto:new df(n.sessionCrypto),connectionSource:n.connectionSource}})}getHttpConnection(){return ge(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new Le("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new Le("Trying to read HTTP connection source while injected connection is stored");return t})}getHttpPendingConnection(){return ge(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new Le("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new Le("Trying to read HTTP connection source while injected connection is stored");if(!El(t))throw new Le("Trying to read HTTP-pending connection while http connection is stored");return t})}getInjectedConnection(){return ge(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new Le("Trying to read Injected bridge connection source while nothing is stored");if((t==null?void 0:t.type)==="http")throw new Le("Trying to read Injected bridge connection source while HTTP connection is stored");return t})}storedConnectionType(){return ge(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);return t?JSON.parse(t).type:null})}storeLastWalletEventId(t){return ge(this,void 0,void 0,function*(){const n=yield this.getConnection();if(n&&n.type==="http"&&!El(n))return n.lastWalletEventId=t,this.storeConnection(n)})}getLastWalletEventId(){return ge(this,void 0,void 0,function*(){const t=yield this.getConnection();if(t&&"lastWalletEventId"in t)return t.lastWalletEventId})}increaseNextRpcRequestId(){return ge(this,void 0,void 0,function*(){const t=yield this.getConnection();if(t&&"nextRpcRequestId"in t){const n=t.nextRpcRequestId||0;return t.nextRpcRequestId=n+1,this.storeConnection(t)}})}getNextRpcRequestId(){return ge(this,void 0,void 0,function*(){const t=yield this.getConnection();return t&&"nextRpcRequestId"in t&&t.nextRpcRequestId||0})}}const Ap=2;class Jl{constructor(t,n){this.storage=t,this.walletConnectionSource=n,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=5e3,this.connectionStorage=new Gl(t)}static fromStorage(t){return ge(this,void 0,void 0,function*(){const r=yield new Gl(t).getHttpConnection();return El(r)?new Jl(t,r.connectionSource):new Jl(t,{bridgeUrl:r.session.bridgeUrl})})}connect(t,n){var r;const o=pr(n==null?void 0:n.signal);(r=this.abortController)===null||r===void 0||r.abort(),this.abortController=o,this.closeGateways();const i=new df;this.session={sessionCrypto:i,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:i}).then(()=>ge(this,void 0,void 0,function*(){o.signal.aborted||(yield kl(s=>this.openGateways(i,{openingDeadlineMS:n==null?void 0:n.openingDeadlineMS,signal:s==null?void 0:s.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:o.signal}))}));const l="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(l,t)}restoreConnection(t){var n,r;return ge(this,void 0,void 0,function*(){const o=pr(t==null?void 0:t.signal);if((n=this.abortController)===null||n===void 0||n.abort(),this.abortController=o,o.signal.aborted)return;this.closeGateways();const i=yield this.connectionStorage.getHttpConnection();if(!i||o.signal.aborted)return;const l=(r=t==null?void 0:t.openingDeadlineMS)!==null&&r!==void 0?r:this.defaultOpeningDeadlineMS;if(El(i))return this.session={sessionCrypto:i.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways(i.sessionCrypto,{openingDeadlineMS:l,signal:o==null?void 0:o.signal});if(Array.isArray(this.walletConnectionSource))throw new Le("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=i.session,this.gateway&&(en("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new ou(this.storage,this.walletConnectionSource.bridgeUrl,i.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),!o.signal.aborted){this.listeners.forEach(s=>s(i.connectEvent));try{yield kl(s=>this.gateway.registerSession({openingDeadlineMS:l,signal:s.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:o.signal})}catch{yield this.disconnect({signal:o.signal});return}}})}sendRequest(t,n){const r={};return typeof n=="function"?r.onRequestSent=n:(r.onRequestSent=n==null?void 0:n.onRequestSent,r.signal=n==null?void 0:n.signal,r.attempts=n==null?void 0:n.attempts),new Promise((o,i)=>ge(this,void 0,void 0,function*(){var l;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new Le("Trying to send bridge request without session");const s=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),en("Send http-bridge request:",Object.assign(Object.assign({},t),{id:s}));const c=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{id:s})),Ia(this.session.walletPublicKey));try{yield this.gateway.send(c,this.session.walletPublicKey,t.method,{attempts:r==null?void 0:r.attempts,signal:r==null?void 0:r.signal}),(l=r==null?void 0:r.onRequestSent)===null||l===void 0||l.call(r),this.pendingRequests.set(s.toString(),o)}catch(f){i(f)}}))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(t){return ge(this,void 0,void 0,function*(){return new Promise(n=>ge(this,void 0,void 0,function*(){let r=!1,o=null;const i=()=>{r||(r=!0,this.removeBridgeAndSession().then(n))};try{this.closeGateways();const l=pr(t==null?void 0:t.signal);o=setTimeout(()=>{l.abort()},this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:i,signal:l.signal,attempts:1})}catch(l){en("Disconnect error:",l),r||this.removeBridgeAndSession().then(n)}finally{o&&clearTimeout(o),i()}}))})}listen(t){return this.listeners.push(t),()=>this.listeners=this.listeners.filter(n=>n!==t)}pause(){var t;(t=this.gateway)===null||t===void 0||t.pause(),this.pendingGateways.forEach(n=>n.pause())}unPause(){return ge(this,void 0,void 0,function*(){const t=this.pendingGateways.map(n=>n.unPause());this.gateway&&t.push(this.gateway.unPause()),yield Promise.all(t)})}pendingGatewaysListener(t,n,r){return ge(this,void 0,void 0,function*(){if(!this.pendingGateways.includes(t)){yield t.close();return}return this.closeGateways({except:t}),this.gateway&&(en("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=n,this.gateway=t,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(r)})}gatewayListener(t){return ge(this,void 0,void 0,function*(){const n=JSON.parse(this.session.sessionCrypto.decrypt(bd.decode(t.message).toUint8Array(),Ia(t.from)));if(en("Wallet message received:",n),!("event"in n)){const o=n.id.toString(),i=this.pendingRequests.get(o);if(!i){en(`Response id ${o} doesn't match any request's id`);return}i(n),this.pendingRequests.delete(o);return}if(n.id!==void 0){const o=yield this.connectionStorage.getLastWalletEventId();if(o!==void 0&&n.id<=o){Tr(`Received event id (=${n.id}) must be greater than stored last wallet event id (=${o}) `);return}n.event!=="connect"&&(yield this.connectionStorage.storeLastWalletEventId(n.id))}const r=this.listeners;n.event==="connect"&&(yield this.updateSession(n,t.from)),n.event==="disconnect"&&(en("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),r.forEach(o=>o(n))})}gatewayErrorsListener(t){return ge(this,void 0,void 0,function*(){throw new Le(`Bridge error ${JSON.stringify(t)}`)})}updateSession(t,n){return ge(this,void 0,void 0,function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:n});const r=t.payload.items.find(i=>i.name==="ton_addr"),o=Object.assign(Object.assign({},t),{payload:Object.assign(Object.assign({},t.payload),{items:[r]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:t.id,connectEvent:o,nextRpcRequestId:0})})}removeBridgeAndSession(){return ge(this,void 0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}generateUniversalLink(t,n){return zo(t)?this.generateTGUniversalLink(t,n):this.generateRegularUniversalLink(t,n)}generateRegularUniversalLink(t,n){const r=new URL(t);return r.searchParams.append("v",Ap.toString()),r.searchParams.append("id",this.session.sessionCrypto.sessionId),r.searchParams.append("r",JSON.stringify(n)),r.toString()}generateTGUniversalLink(t,n){const o=this.generateRegularUniversalLink("about:blank",n).split("?")[1],i="tonconnect-"+Ep(o),l=this.convertToDirectLink(t),s=new URL(l);return s.searchParams.append("startapp",i),s.toString()}convertToDirectLink(t){const n=new URL(t);return n.searchParams.has("attach")&&(n.searchParams.delete("attach"),n.pathname+="/start"),n.toString()}openGateways(t,n){return ge(this,void 0,void 0,function*(){if(Array.isArray(this.walletConnectionSource)){this.pendingGateways.map(r=>r.close().catch()),this.pendingGateways=this.walletConnectionSource.map(r=>{const o=new ou(this.storage,r.bridgeUrl,t.sessionId,()=>{},()=>{});return o.setListener(i=>this.pendingGatewaysListener(o,r.bridgeUrl,i)),o}),yield Promise.allSettled(this.pendingGateways.map(r=>kl(o=>this.pendingGateways.some(i=>i===r)?r.registerSession({openingDeadlineMS:n==null?void 0:n.openingDeadlineMS,signal:o.signal}):r.close(),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:n==null?void 0:n.signal})));return}else return this.gateway&&(en("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new ou(this.storage,this.walletConnectionSource.bridgeUrl,t.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession({openingDeadlineMS:n==null?void 0:n.openingDeadlineMS,signal:n==null?void 0:n.signal})})}closeGateways(t){var n;(n=this.gateway)===null||n===void 0||n.close(),this.pendingGateways.filter(r=>r!==(t==null?void 0:t.except)).forEach(r=>r.close()),this.pendingGateways=[]}}function f0(e,t){return Lp(e,[t])}function Lp(e,t){return!e||typeof e!="object"?!1:t.every(n=>n in e)}function em(e){try{return!f0(e,"tonconnect")||!f0(e.tonconnect,"walletInfo")?!1:Lp(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch{return!1}}let tm=class ul{constructor(){this.storage={}}static getInstance(){return ul.instance||(ul.instance=new ul),ul.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(t){var n;return(n=this.storage[t])!==null&&n!==void 0?n:null}key(t){var n;const r=Object.keys(this.storage);return t<0||t>=r.length?null:(n=r[t])!==null&&n!==void 0?n:null}removeItem(t){delete this.storage[t]}setItem(t,n){this.storage[t]=n}};function xc(){if(!(typeof window>"u"))return window}function nm(){const e=xc();if(!e)return[];try{return Object.keys(e)}catch{return[]}}function rm(){if(!(typeof document>"u"))return document}function om(){var e;const t=(e=xc())===null||e===void 0?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}function im(){if(lm())return localStorage;if(sm())throw new Le("`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 tm.getInstance()}function lm(){try{return typeof localStorage<"u"}catch{return!1}}function sm(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null}class Bn{constructor(t,n){this.injectedWalletKey=n,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const r=Bn.window;if(!Bn.isWindowContainsWallet(r,n))throw new kd;this.connectionStorage=new Gl(t),this.injectedWallet=r[n].tonconnect}static fromStorage(t){return ge(this,void 0,void 0,function*(){const r=yield new Gl(t).getInjectedConnection();return new Bn(t,r.jsBridgeKey)})}static isWalletInjected(t){return Bn.isWindowContainsWallet(this.window,t)}static isInsideWalletBrowser(t){return Bn.isWindowContainsWallet(this.window,t)?this.window[t].tonconnect.isWalletBrowser:!1}static getCurrentlyInjectedWallets(){return this.window?nm().filter(([r,o])=>em(o)).map(([r,o])=>({name:o.tonconnect.walletInfo.name,appName:o.tonconnect.walletInfo.app_name,aboutUrl:o.tonconnect.walletInfo.about_url,imageUrl:o.tonconnect.walletInfo.image,tondns:o.tonconnect.walletInfo.tondns,jsBridgeKey:r,injected:!0,embedded:o.tonconnect.isWalletBrowser,platforms:o.tonconnect.walletInfo.platforms})):[]}static isWindowContainsWallet(t,n){return!!t&&n in t&&typeof t[n]=="object"&&"tonconnect"in t[n]}connect(t){this._connect(Ap,t)}restoreConnection(){return ge(this,void 0,void 0,function*(){try{en("Injected Provider restoring connection...");const t=yield this.injectedWallet.restoreConnection();en("Injected Provider restoring connection response",t),t.event==="connect"?(this.makeSubscriptions(),this.listeners.forEach(n=>n(t))):yield this.connectionStorage.removeConnection()}catch(t){yield this.connectionStorage.removeConnection(),console.error(t)}})}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return ge(this,void 0,void 0,function*(){return new Promise(t=>{const n=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(t)};try{this.injectedWallet.disconnect(),n()}catch(r){en(r),this.sendRequest({method:"disconnect",params:[]},n)}})})}closeAllListeners(){var t;this.listenSubscriptions=!1,this.listeners=[],(t=this.unsubscribeCallback)===null||t===void 0||t.call(this)}listen(t){return this.listeners.push(t),()=>this.listeners=this.listeners.filter(n=>n!==t)}sendRequest(t,n){var r;return ge(this,void 0,void 0,function*(){const o={};typeof n=="function"?o.onRequestSent=n:(o.onRequestSent=n==null?void 0:n.onRequestSent,o.signal=n==null?void 0:n.signal);const i=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),en("Send injected-bridge request:",Object.assign(Object.assign({},t),{id:i}));const l=this.injectedWallet.send(Object.assign(Object.assign({},t),{id:i}));return l.then(s=>en("Wallet message received:",s)),(r=o==null?void 0:o.onRequestSent)===null||r===void 0||r.call(o),l})}_connect(t,n){return ge(this,void 0,void 0,function*(){try{en(`Injected Provider connect request: protocolVersion: ${t}, message:`,n);const r=yield this.injectedWallet.connect(t,n);en("Injected Provider connect response:",r),r.event==="connect"&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach(o=>o(r))}catch(r){en("Injected Provider connect error:",r);const o={event:"connect_error",payload:{code:0,message:r==null?void 0:r.toString()}};this.listeners.forEach(i=>i(o))}})}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen(t=>{en("Wallet message received:",t),this.listenSubscriptions&&this.listeners.forEach(n=>n(t)),t.event==="disconnect"&&this.disconnect()})}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}Bn.window=xc();class am{constructor(){this.localStorage=im()}getItem(t){return ge(this,void 0,void 0,function*(){return this.localStorage.getItem(t)})}removeItem(t){return ge(this,void 0,void 0,function*(){this.localStorage.removeItem(t)})}setItem(t,n){return ge(this,void 0,void 0,function*(){this.localStorage.setItem(t,n)})}}function Vo(e){return cm(e)&&e.injected}function Cc(e){return Vo(e)&&e.embedded}function cm(e){return"jsBridgeKey"in e}function Td(e){return"bridgeUrl"in e}const um=[{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://bridge.tonapi.io/bridge"}],platforms:["ios","android","macos","windows","linux"]},{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"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"]},{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"]},{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"]},{app_name:"dewallet",name:"DeWallet",image:"https://app.delabwallet.com/logo_black.png",about_url:"https://delabwallet.com",bridge:[{type:"js",key:"dewallet"}],platforms:["chrome"]},{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"]},{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"]}];class hf{constructor(t){this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource="https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",t!=null&&t.walletsListSource&&(this.walletsListSource=t.walletsListSource),t!=null&&t.cacheTTLMs&&(this.cacheTTLMs=t.cacheTTLMs)}getWallets(){return ge(this,void 0,void 0,function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then(()=>{this.walletsListCacheCreationTimestamp=Date.now()}).catch(()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null})),this.walletsListCache})}getEmbeddedWallet(){return ge(this,void 0,void 0,function*(){const n=(yield this.getWallets()).filter(Cc);return n.length!==1?null:n[0]})}fetchWalletsList(){return ge(this,void 0,void 0,function*(){let t=[];try{if(t=yield(yield fetch(this.walletsListSource)).json(),!Array.isArray(t))throw new Ed("Wrong wallets list format, wallets list must be an array.");const o=t.filter(i=>!this.isCorrectWalletConfigDTO(i));o.length&&(Tr(`Wallet(s) ${o.map(i=>i.name).join(", ")} config format is wrong. They were removed from the wallets list.`),t=t.filter(i=>this.isCorrectWalletConfigDTO(i)))}catch(r){Tr(r),t=um}let n=[];try{n=Bn.getCurrentlyInjectedWallets()}catch(r){Tr(r)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(t),n)})}walletConfigDTOListToWalletConfigList(t){return t.map(n=>{const o={name:n.name,appName:n.app_name,imageUrl:n.image,aboutUrl:n.about_url,tondns:n.tondns,platforms:n.platforms};return n.bridge.forEach(i=>{if(i.type==="sse"&&(o.bridgeUrl=i.url,o.universalLink=n.universal_url,o.deepLink=n.deepLink),i.type==="js"){const l=i.key;o.jsBridgeKey=l,o.injected=Bn.isWalletInjected(l),o.embedded=Bn.isInsideWalletBrowser(l)}}),o})}mergeWalletsLists(t,n){return[...new Set(t.concat(n).map(o=>o.name)).values()].map(o=>{const i=t.find(s=>s.name===o),l=n.find(s=>s.name===o);return Object.assign(Object.assign({},i&&Object.assign({},i)),l&&Object.assign({},l))})}isCorrectWalletConfigDTO(t){if(!t||typeof t!="object")return!1;const n="name"in t,r="app_name"in t,o="image"in t,i="about_url"in t,l="platforms"in t;if(!n||!o||!i||!l||!r||!t.platforms||!Array.isArray(t.platforms)||!t.platforms.length||!("bridge"in t)||!Array.isArray(t.bridge)||!t.bridge.length)return!1;const s=t.bridge;if(s.some(d=>!d||typeof d!="object"||!("type"in d)))return!1;const c=s.find(d=>d.type==="sse");if(c&&(!("url"in c)||!c.url||!t.universal_url))return!1;const f=s.find(d=>d.type==="js");return!(f&&(!("key"in f)||!f.key))}}class Na extends Le{get info(){return"Wallet doesn't support requested feature method."}constructor(...t){super(...t),Object.setPrototypeOf(this,Na.prototype)}}function fm(e,t){const n=e.includes("SendTransaction"),r=e.find(o=>o&&typeof o=="object"&&o.name==="SendTransaction");if(!n&&!r)throw new Na("Wallet doesn't support SendTransaction feature.");if(r&&r.maxMessages!==void 0){if(r.maxMessages{var s,c;return{address:(s=l.address)!==null&&s!==void 0?s:null,amount:(c=l.amount)!==null&&c!==void 0?c:null}})}}function Op(e,t,n){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},qi(e,t)),Ad(t,n))}function Bp(e,t,n,r){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:r.boc},qi(e,t)),Ad(t,n))}function jp(e,t,n,r,o){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:r,error_code:o??null},qi(e,t)),Ad(t,n))}function Dp(e,t,n){return Object.assign({type:"disconnection",scope:n},qi(e,t))}class Hp{constructor(){this.window=xc()}dispatchEvent(t,n){var r;return ge(this,void 0,void 0,function*(){const o=new CustomEvent(t,{detail:n});(r=this.window)===null||r===void 0||r.dispatchEvent(o)})}addEventListener(t,n,r){var o;return ge(this,void 0,void 0,function*(){return(o=this.window)===null||o===void 0||o.addEventListener(t,n,r),()=>{var i;return(i=this.window)===null||i===void 0?void 0:i.removeEventListener(t,n)}})}}class dm{constructor(t){var n;this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=(n=t==null?void 0:t.eventDispatcher)!==null&&n!==void 0?n:new Hp,this.tonConnectSdkVersion=t.tonConnectSdkVersion,this.init().catch()}get version(){return ni({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return ge(this,void 0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch{}})}setRequestVersionHandler(){return ge(this,void 0,void 0,function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",()=>ge(this,void 0,void 0,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",Mp(this.tonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return ge(this,void 0,void 0,function*(){return new Promise((t,n)=>ge(this,void 0,void 0,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",r=>{t(r.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",Pp())}catch(r){n(r)}}))})}dispatchUserActionEvent(t){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${t.type}`,t).catch()}catch{}}trackConnectionStarted(...t){try{const n=Rp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionCompleted(...t){try{const n=Ip(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionError(...t){try{const n=$p(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringStarted(...t){try{const n=Wp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringCompleted(...t){try{const n=Np(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringError(...t){try{const n=Up(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackDisconnection(...t){try{const n=Dp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSentForSignature(...t){try{const n=Op(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigned(...t){try{const n=Bp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigningFailed(...t){try{const n=jp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}}const hm="3.0.3";class Xo{constructor(t){if(this.walletsList=new hf,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(t==null?void 0:t.manifestUrl)||om(),storage:(t==null?void 0:t.storage)||new am},this.walletsList=new hf({walletsListSource:t==null?void 0:t.walletsListSource,cacheTTLMs:t==null?void 0:t.walletsListCacheTTLMs}),this.tracker=new dm({eventDispatcher:t==null?void 0:t.eventDispatcher,tonConnectSdkVersion:hm}),!this.dappSettings.manifestUrl)throw new Sd("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 Gl(this.dappSettings.storage),t!=null&&t.disableAutoPauseConnection||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return this._wallet!==null}get account(){var t;return((t=this._wallet)===null||t===void 0?void 0:t.account)||null}get wallet(){return this._wallet}set wallet(t){this._wallet=t,this.statusChangeSubscriptions.forEach(n=>n(this._wallet))}getWallets(){return this.walletsList.getWallets()}onStatusChange(t,n){return this.statusChangeSubscriptions.push(t),n&&this.statusChangeErrorSubscriptions.push(n),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(r=>r!==t),n&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(r=>r!==n))}}connect(t,n){var r,o;const i={};if(typeof n=="object"&&"tonProof"in n&&(i.request=n),typeof n=="object"&&("openingDeadlineMS"in n||"signal"in n||"request"in n)&&(i.request=n==null?void 0:n.request,i.openingDeadlineMS=n==null?void 0:n.openingDeadlineMS,i.signal=n==null?void 0:n.signal),this.connected)throw new _d;const l=pr(i==null?void 0:i.signal);if((r=this.abortController)===null||r===void 0||r.abort(),this.abortController=l,l.signal.aborted)throw new Le("Connection was aborted");return(o=this.provider)===null||o===void 0||o.closeConnection(),this.provider=this.createProvider(t),l.signal.addEventListener("abort",()=>{var s;(s=this.provider)===null||s===void 0||s.closeConnection(),this.provider=null}),this.tracker.trackConnectionStarted(),this.provider.connect(this.createConnectRequest(i==null?void 0:i.request),{openingDeadlineMS:i==null?void 0:i.openingDeadlineMS,signal:l.signal})}restoreConnection(t){var n,r;return ge(this,void 0,void 0,function*(){this.tracker.trackConnectionRestoringStarted();const o=pr(t==null?void 0:t.signal);if((n=this.abortController)===null||n===void 0||n.abort(),this.abortController=o,o.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}const[i,l]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(o.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}let s=null;try{switch(i){case"http":s=yield Jl.fromStorage(this.dappSettings.storage);break;case"injected":s=yield Bn.fromStorage(this.dappSettings.storage);break;default:if(l)s=this.createProvider(l);else return}}catch{this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),s==null||s.closeConnection(),s=null;return}if(o.signal.aborted){s==null||s.closeConnection(),this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}if(!s){Tr("Provider is not restored"),this.tracker.trackConnectionRestoringError("Provider is not restored");return}(r=this.provider)===null||r===void 0||r.closeConnection(),this.provider=s,s.listen(this.walletEventsListener.bind(this));const c=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted"),s==null||s.closeConnection(),s=null};return o.signal.addEventListener("abort",c),yield kl(f=>ge(this,void 0,void 0,function*(){yield s==null?void 0:s.restoreConnection({openingDeadlineMS:t==null?void 0:t.openingDeadlineMS,signal:f.signal}),o.signal.removeEventListener("abort",c),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:t==null?void 0:t.signal})})}sendTransaction(t,n){return ge(this,void 0,void 0,function*(){const r={};typeof n=="function"?r.onRequestSent=n:(r.onRequestSent=n==null?void 0:n.onRequestSent,r.signal=n==null?void 0:n.signal);const o=pr(r==null?void 0:r.signal);if(o.signal.aborted)throw new Le("Transaction sending was aborted");this.checkConnection(),fm(this.wallet.device.features,{requiredMessagesNumber:t.messages.length}),this.tracker.trackTransactionSentForSignature(this.wallet,t);const{validUntil:i}=t,l=H3(t,["validUntil"]),s=t.from||this.account.address,c=t.network||this.account.chain,f=yield this.provider.sendRequest(Bs.convertToRpcRequest(Object.assign(Object.assign({},l),{valid_until:i,from:s,network:c})),{onRequestSent:r.onRequestSent,signal:o.signal});if(Bs.isError(f))return this.tracker.trackTransactionSigningFailed(this.wallet,t,f.error.message,f.error.code),Bs.parseAndThrowError(f);const d=Bs.convertFromRpcResponse(f);return this.tracker.trackTransactionSigned(this.wallet,t,d),d})}disconnect(t){var n;return ge(this,void 0,void 0,function*(){if(!this.connected)throw new $a;const r=pr(t==null?void 0:t.signal),o=this.abortController;if(this.abortController=r,r.signal.aborted)throw new Le("Disconnect was aborted");this.onWalletDisconnected("dapp"),yield(n=this.provider)===null||n===void 0?void 0:n.disconnect({signal:r.signal}),o==null||o.abort()})}pauseConnection(){var t;((t=this.provider)===null||t===void 0?void 0:t.type)==="http"&&this.provider.pause()}unPauseConnection(){var t;return((t=this.provider)===null||t===void 0?void 0:t.type)!=="http"?Promise.resolve():this.provider.unPause()}addWindowFocusAndBlurSubscriptions(){const t=rm();if(t)try{t.addEventListener("visibilitychange",()=>{t.hidden?this.pauseConnection():this.unPauseConnection().catch()})}catch(n){Tr("Cannot subscribe to the document.visibilitychange: ",n)}}createProvider(t){let n;return!Array.isArray(t)&&F3(t)?n=new Bn(this.dappSettings.storage,t.jsBridgeKey):n=new Jl(this.dappSettings.storage,t),n.listen(this.walletEventsListener.bind(this)),n}walletEventsListener(t){switch(t.event){case"connect":this.onWalletConnected(t.payload);break;case"connect_error":this.onWalletConnectError(t.payload);break;case"disconnect":this.onWalletDisconnected("wallet")}}onWalletConnected(t){const n=t.items.find(i=>i.name==="ton_addr"),r=t.items.find(i=>i.name==="ton_proof");if(!n)throw new Le("ton_addr connection item was not found");const o={device:t.device,provider:this.provider.type,account:{address:n.address,chain:n.network,walletStateInit:n.walletStateInit,publicKey:n.publicKey}};r&&(o.connectItems={tonProof:r}),this.wallet=o,this.tracker.trackConnectionCompleted(o)}onWalletConnectError(t){const n=V3.parseError(t);if(this.statusChangeErrorSubscriptions.forEach(r=>r(n)),en(n),this.tracker.trackConnectionError(t.message,t.code),n instanceof vc||n instanceof gc)throw Tr(n),n}onWalletDisconnected(t){this.tracker.trackDisconnection(this.wallet,t),this.wallet=null}checkConnection(){if(!this.connected)throw new $a}createConnectRequest(t){const n=[{name:"ton_addr"}];return t!=null&&t.tonProof&&n.push({name:"ton_proof",payload:t.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:n}}}Xo.walletsList=new hf;Xo.isWalletInjected=e=>Bn.isWalletInjected(e);Xo.isInsideWalletBrowser=e=>Bn.isInsideWalletBrowser(e);const pm=81,gm=128;function Fp(e,t=!1){const{wc:n,hex:r}=vm(e);let o=pm;t&&(o|=gm);const i=new Int8Array(34);i[0]=o,i[1]=n,i.set(r,2);const l=new Uint8Array(36);return l.set(i),l.set(mm(i),34),bd.encode(l).replace(/\+/g,"-").replace(/\//g,"_")}function vm(e){if(!e.includes(":"))throw new Ci(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(t.length!==2)throw new Ci(`Wrong address ${e}. Address must include ":" only once.`);const n=parseInt(t[0]);if(n!==0&&n!==-1)throw new Ci(`Wrong address ${e}. WC must be eq 0 or -1, but ${n} received.`);const r=t[1];if((r==null?void 0:r.length)!==64)throw new Ci(`Wrong address ${e}. Hex part must be 64bytes length, but ${r==null?void 0:r.length} received.`);return{wc:n,hex:ym(r)}}function mm(e){let n=0;const r=new Uint8Array(e.length+2);r.set(e);for(let o of r){let i=128;for(;i>0;)n<<=1,o&i&&(n+=1),i>>=1,n>65535&&(n&=65535,n^=4129)}return new Uint8Array([Math.floor(n/256),n%256])}const pf={};for(let e=0;e<=255;e++){let t=e.toString(16);t.length<2&&(t="0"+t),pf[t]=e}function ym(e){e=e.toLowerCase();const t=e.length;if(t%2!==0)throw new Wa("Hex string must have length a multiple of 2: "+e);const n=t/2,r=new Uint8Array(n);for(let o=0;o0?at.length===2?typeof at[1]==s?this[at[0]]=at[1].call(this,fn):this[at[0]]=at[1]:at.length===3?typeof at[1]===s&&!(at[1].exec&&at[1].test)?this[at[0]]=fn?at[1].call(this,fn,at[2]):r:this[at[0]]=fn?fn.replace(at[1],at[2]):r:at.length===4&&(this[at[0]]=fn?at[3].call(this,fn.replace(at[1],at[2])):r):this[at]=fn||r;Ue+=2}},Pe=function(Ie,st){for(var Ue in st)if(typeof st[Ue]===f&&st[Ue].length>0){for(var wt=0;wt2&&(Te[h]="iPad",Te[C]=E),Te},this.getEngine=function(){var Te={};return Te[S]=r,Te[O]=r,bt.call(Te,wt,Un.engine),Te},this.getOS=function(){var Te={};return Te[S]=r,Te[O]=r,bt.call(Te,wt,Un.os),at&&!Te[S]&&on&&on.platform&&on.platform!="Unknown"&&(Te[S]=on.platform.replace(/chrome os/i,K).replace(/macos/i,D)),Te},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 wt},this.setUA=function(Te){return wt=typeof Te===d&&Te.length>L?Ve(Te,L):Te,this},this.setUA(wt),this};Zt.VERSION=o,Zt.BROWSER=G([S,O,w]),Zt.CPU=G([b]),Zt.DEVICE=G([h,_,C,p,y,T,E,W,I]),Zt.ENGINE=Zt.OS=G([S,O]),e.exports&&(t=e.exports=Zt),t.UAParser=Zt;var Jt=typeof n!==c&&(n.jQuery||n.Zepto);if(Jt&&!Jt.ua){var An=new Zt;Jt.ua=An.getResult(),Jt.ua.get=function(){return An.getUA()},Jt.ua.set=function(Ie){An.setUA(Ie);var st=An.getResult();for(var Ue in st)Jt.ua[Ue]=st[Ue]}}})(typeof window=="object"?window:ch)})(gf,gf.exports);var wm=gf.exports;const xm=Fi(wm);var Cm=function(t){return bm(t)&&!Sm(t)};function bm(e){return!!e&&typeof e=="object"}function Sm(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Em(e)}var _m=typeof Symbol=="function"&&Symbol.for,km=_m?Symbol.for("react.element"):60103;function Em(e){return e.$$typeof===km}function Tm(e){return Array.isArray(e)?[]:{}}function Xl(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Bi(Tm(e),e,t):e}function Am(e,t,n){return e.concat(t).map(function(r){return Xl(r,n)})}function Lm(e,t){if(!t.customMerge)return Bi;var n=t.customMerge(e);return typeof n=="function"?n:Bi}function Pm(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function d0(e){return Object.keys(e).concat(Pm(e))}function zp(e,t){try{return t in e}catch{return!1}}function Mm(e,t){return zp(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function Rm(e,t,n){var r={};return n.isMergeableObject(e)&&d0(e).forEach(function(o){r[o]=Xl(e[o],n)}),d0(t).forEach(function(o){Mm(e,o)||(zp(e,o)&&n.isMergeableObject(t[o])?r[o]=Lm(o,n)(e[o],t[o],n):r[o]=Xl(t[o],n))}),r}function Bi(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Am,n.isMergeableObject=n.isMergeableObject||Cm,n.cloneUnlessOtherwiseSpecified=Xl;var r=Array.isArray(t),o=Array.isArray(e),i=r===o;return i?r?n.arrayMerge(e,t,n):Rm(e,t,n):Xl(t,n)}Bi.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return Bi(r,o,n)},{})};var Im=Bi,$m=Im;const Wm=Fi($m);var Vp={exports:{}};/*! +`+t:""}`,Object.setPrototypeOf(this,Le.prototype)}get info(){return""}}Le.prefix="[TON_CONNECT_SDK_ERROR]";class Sd extends Le{get info(){return"Passed DappMetadata is in incorrect format."}constructor(...t){super(...t),Object.setPrototypeOf(this,Sd.prototype)}}class gc extends Le{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(...t){super(...t),Object.setPrototypeOf(this,gc.prototype)}}class vc extends Le{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(...t){super(...t),Object.setPrototypeOf(this,vc.prototype)}}class _d extends Le{get info(){return"Wallet connection called but wallet already connected. To avoid the error, disconnect the wallet before doing a new connection."}constructor(...t){super(...t),Object.setPrototypeOf(this,_d.prototype)}}class $a extends Le{get info(){return"Send transaction or other protocol methods called while wallet is not connected."}constructor(...t){super(...t),Object.setPrototypeOf(this,$a.prototype)}}function F3(e){return"jsBridgeKey"in e}class mc extends Le{get info(){return"User rejects the action in the wallet."}constructor(...t){super(...t),Object.setPrototypeOf(this,mc.prototype)}}class yc extends Le{get info(){return"Request to the wallet contains errors."}constructor(...t){super(...t),Object.setPrototypeOf(this,yc.prototype)}}class wc extends Le{get info(){return"App tries to send rpc request to the injected wallet while not connected."}constructor(...t){super(...t),Object.setPrototypeOf(this,wc.prototype)}}class kd extends Le{get info(){return"There is an attempt to connect to the injected wallet while it is not exists in the webpage."}constructor(...t){super(...t),Object.setPrototypeOf(this,kd.prototype)}}class Ed extends Le{get info(){return"An error occurred while fetching the wallets list."}constructor(...t){super(...t),Object.setPrototypeOf(this,Ed.prototype)}}class Ci extends Le{get info(){return"Passed address is in incorrect format."}constructor(...t){super(...t),Object.setPrototypeOf(this,Ci.prototype)}}class Na extends Le{get info(){return"Passed hex is in incorrect format."}constructor(...t){super(...t),Object.setPrototypeOf(this,Na.prototype)}}class ko extends Le{constructor(...t){super(...t),Object.setPrototypeOf(this,ko.prototype)}}const c0={[lo.UNKNOWN_ERROR]:ko,[lo.USER_REJECTS_ERROR]:mc,[lo.BAD_REQUEST_ERROR]:yc,[lo.UNKNOWN_APP_ERROR]:wc,[lo.MANIFEST_NOT_FOUND_ERROR]:vc,[lo.MANIFEST_CONTENT_ERROR]:gc};class z3{parseError(t){let n=ko;return t.code in c0&&(n=c0[t.code]||ko),new n(t.message)}}const V3=new z3;class K3{isError(t){return"error"in t}}const u0={[xi.UNKNOWN_ERROR]:ko,[xi.USER_REJECTS_ERROR]:mc,[xi.BAD_REQUEST_ERROR]:yc,[xi.UNKNOWN_APP_ERROR]:wc};class q3 extends K3{convertToRpcRequest(t){return{method:"sendTransaction",params:[JSON.stringify(t)]}}parseAndThrowError(t){let n=ko;throw t.error.code in u0&&(n=u0[t.error.code]||ko),new n(t.error.message)}convertFromRpcResponse(t){return{boc:t.result}}}const Bs=new q3;class Q3{constructor(t,n){this.storage=t,this.storeKey="ton-connect-storage_http-bridge-gateway::"+n}storeLastEventId(t){return ge(this,void 0,void 0,function*(){return this.storage.setItem(this.storeKey,t)})}removeLastEventId(){return ge(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getLastEventId(){return ge(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);return t||null})}}function Y3(e){return e.slice(-1)==="/"?e.slice(0,-1):e}function kp(e,t){return Y3(e)+"/"+t}function zo(e){if(!e)return!1;const t=new URL(e);return t.protocol==="tg:"||t.hostname==="t.me"}function Ep(e){return e.replaceAll(".","%2E").replaceAll("-","%2D").replaceAll("_","%5F").replaceAll("&","-").replaceAll("=","__").replaceAll("%","--")}function Tp(e,t){return ge(this,void 0,void 0,function*(){return new Promise((n,r)=>{var o,i;if(!((o=void 0)===null||o===void 0)&&o.aborted){r(new Le("Delay aborted"));return}const l=setTimeout(()=>n(),e);(i=void 0)===null||i===void 0||i.addEventListener("abort",()=>{clearTimeout(l),r(new Le("Delay aborted"))})})})}function pr(e){const t=new AbortController;return e!=null&&e.aborted?t.abort():e==null||e.addEventListener("abort",()=>t.abort(),{once:!0}),t}function kl(e,t){var n,r;return ge(this,void 0,void 0,function*(){const o=(n=t==null?void 0:t.attempts)!==null&&n!==void 0?n:10,i=(r=t==null?void 0:t.delayMs)!==null&&r!==void 0?r:200,l=pr(t==null?void 0:t.signal);if(typeof e!="function")throw new Le(`Expected a function, got ${typeof e}`);let s=0,c;for(;sge(this,void 0,void 0,function*(){if(i=w??null,l==null||l.abort(),l=pr(w),l.signal.aborted)throw new Le("Resource creation was aborted");r=h??null;const S=e(l.signal,...h);o=S;const C=yield S;if(o!==S&&C!==n)throw yield t(C),new Le("Resource creation was aborted by a new resource creation");return n=C,n});return{create:s,current:()=>n??null,dispose:()=>ge(this,void 0,void 0,function*(){try{const w=n;n=null;const h=o;o=null;try{l==null||l.abort()}catch{}yield Promise.allSettled([w?t(w):Promise.resolve(),h?t(yield h):Promise.resolve()])}catch{}}),recreate:w=>ge(this,void 0,void 0,function*(){const h=n,S=o,C=r,_=i;if(yield Tp(w),h===n&&S===o&&C===r&&_===i)return yield s(i,...C??[]);throw new Le("Resource recreation was aborted by a new resource creation")})}}function J3(e,t){const n=t==null?void 0:t.timeout,r=t==null?void 0:t.signal,o=pr(r);return new Promise((i,l)=>{if(o.signal.aborted){l(new Le("Operation aborted"));return}let s;typeof n<"u"&&(s=setTimeout(()=>{o.abort(),l(new Le(`Timeout after ${n}ms`))},n)),o.signal.addEventListener("abort",()=>{clearTimeout(s),l(new Le("Operation aborted"))},{once:!0});const c={timeout:n,abort:o.signal};e(i,l,c).finally(()=>clearTimeout(s))})}class ou{constructor(t,n,r,o,i){this.bridgeUrl=n,this.sessionId=r,this.listener=o,this.errorsListener=i,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.defaultReconnectDelay=5e3,this.eventSource=G3((l,s)=>ge(this,void 0,void 0,function*(){const c={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:l,openingDeadlineMS:s};return yield X3(c)}),l=>ge(this,void 0,void 0,function*(){l.close()})),this.bridgeGatewayStorage=new Q3(t,n)}get isReady(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)===EventSource.OPEN}get isClosed(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)!==EventSource.OPEN}get isConnecting(){const t=this.eventSource.current();return(t==null?void 0:t.readyState)===EventSource.CONNECTING}registerSession(t){return ge(this,void 0,void 0,function*(){yield this.eventSource.create(t==null?void 0:t.signal,t==null?void 0:t.openingDeadlineMS)})}send(t,n,r,o){var i;return ge(this,void 0,void 0,function*(){const l={};typeof o=="number"?l.ttl=o:(l.ttl=o==null?void 0:o.ttl,l.signal=o==null?void 0:o.signal,l.attempts=o==null?void 0:o.attempts);const s=new URL(kp(this.bridgeUrl,this.postPath));s.searchParams.append("client_id",this.sessionId),s.searchParams.append("to",n),s.searchParams.append("ttl",((l==null?void 0:l.ttl)||this.defaultTtl).toString()),s.searchParams.append("topic",r);const c=bd.encode(t);yield kl(f=>ge(this,void 0,void 0,function*(){const d=yield this.post(s,c,f.signal);if(!d.ok)throw new Le(`Bridge send failed, status ${d.status}`)}),{attempts:(i=l==null?void 0:l.attempts)!==null&&i!==void 0?i:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:l==null?void 0:l.signal})})}pause(){this.eventSource.dispose().catch(t=>Ar(`Bridge pause failed, ${t}`))}unPause(){return ge(this,void 0,void 0,function*(){yield this.eventSource.recreate(0)})}close(){return ge(this,void 0,void 0,function*(){yield this.eventSource.dispose().catch(t=>Ar(`Bridge close failed, ${t}`))})}setListener(t){this.listener=t}setErrorsListener(t){this.errorsListener=t}post(t,n,r){return ge(this,void 0,void 0,function*(){const o=yield fetch(t,{method:"post",body:n,signal:r});if(!o.ok)throw new Le(`Bridge send failed, status ${o.status}`);return o})}errorsHandler(t,n){return ge(this,void 0,void 0,function*(){if(this.isConnecting){Ar("Bridge error",JSON.stringify(n));return}if(this.isReady){try{this.errorsListener(n)}catch{}return}if(this.isClosed)return t.close(),tn(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new Le("Bridge error, unknown state")})}messagesHandler(t){return ge(this,void 0,void 0,function*(){if(t.data===this.heartbeatMessage||(yield this.bridgeGatewayStorage.storeLastEventId(t.lastEventId),this.isClosed))return;let n;try{n=JSON.parse(t.data)}catch(r){throw new Le(`Bridge message parse failed, message ${r.data}`)}this.listener(n)})}}function X3(e){return ge(this,void 0,void 0,function*(){return yield J3((t,n,r)=>ge(this,void 0,void 0,function*(){var o;const l=pr(r.signal).signal;if(l.aborted){n(new Le("Bridge connection aborted"));return}const s=new URL(kp(e.bridgeUrl,e.ssePath));s.searchParams.append("client_id",e.sessionId);const c=yield e.bridgeGatewayStorage.getLastEventId();if(c&&s.searchParams.append("last_event_id",c),l.aborted){n(new Le("Bridge connection aborted"));return}const f=new EventSource(s.toString());f.onerror=d=>ge(this,void 0,void 0,function*(){if(l.aborted){f.close(),n(new Le("Bridge connection aborted"));return}try{const w=yield e.errorHandler(f,d);w!==f&&f.close(),w&&w!==f&&t(w)}catch(w){f.close(),n(w)}}),f.onopen=()=>{if(l.aborted){f.close(),n(new Le("Bridge connection aborted"));return}t(f)},f.onmessage=d=>{if(l.aborted){f.close(),n(new Le("Bridge connection aborted"));return}e.messageHandler(d)},(o=e.signal)===null||o===void 0||o.addEventListener("abort",()=>{f.close(),n(new Le("Bridge connection aborted"))})}),{timeout:e.openingDeadlineMS,signal:e.signal})})}function El(e){return!("connectEvent"in e)}class Gl{constructor(t){this.storage=t,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(t){return ge(this,void 0,void 0,function*(){if(t.type==="injected")return this.storage.setItem(this.storeKey,JSON.stringify(t));if(!El(t)){const r={sessionKeyPair:t.session.sessionCrypto.stringifyKeypair(),walletPublicKey:t.session.walletPublicKey,bridgeUrl:t.session.bridgeUrl},o={type:"http",connectEvent:t.connectEvent,session:r,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(o))}const n={type:"http",connectionSource:t.connectionSource,sessionCrypto:t.sessionCrypto.stringifyKeypair()};return this.storage.setItem(this.storeKey,JSON.stringify(n))})}removeConnection(){return ge(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return ge(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);if(!t)return null;const n=JSON.parse(t);if(n.type==="injected")return n;if("connectEvent"in n){const r=new df(n.session.sessionKeyPair);return{type:"http",connectEvent:n.connectEvent,lastWalletEventId:n.lastWalletEventId,nextRpcRequestId:n.nextRpcRequestId,session:{sessionCrypto:r,bridgeUrl:n.session.bridgeUrl,walletPublicKey:n.session.walletPublicKey}}}return{type:"http",sessionCrypto:new df(n.sessionCrypto),connectionSource:n.connectionSource}})}getHttpConnection(){return ge(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new Le("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new Le("Trying to read HTTP connection source while injected connection is stored");return t})}getHttpPendingConnection(){return ge(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new Le("Trying to read HTTP connection source while nothing is stored");if(t.type==="injected")throw new Le("Trying to read HTTP connection source while injected connection is stored");if(!El(t))throw new Le("Trying to read HTTP-pending connection while http connection is stored");return t})}getInjectedConnection(){return ge(this,void 0,void 0,function*(){const t=yield this.getConnection();if(!t)throw new Le("Trying to read Injected bridge connection source while nothing is stored");if((t==null?void 0:t.type)==="http")throw new Le("Trying to read Injected bridge connection source while HTTP connection is stored");return t})}storedConnectionType(){return ge(this,void 0,void 0,function*(){const t=yield this.storage.getItem(this.storeKey);return t?JSON.parse(t).type:null})}storeLastWalletEventId(t){return ge(this,void 0,void 0,function*(){const n=yield this.getConnection();if(n&&n.type==="http"&&!El(n))return n.lastWalletEventId=t,this.storeConnection(n)})}getLastWalletEventId(){return ge(this,void 0,void 0,function*(){const t=yield this.getConnection();if(t&&"lastWalletEventId"in t)return t.lastWalletEventId})}increaseNextRpcRequestId(){return ge(this,void 0,void 0,function*(){const t=yield this.getConnection();if(t&&"nextRpcRequestId"in t){const n=t.nextRpcRequestId||0;return t.nextRpcRequestId=n+1,this.storeConnection(t)}})}getNextRpcRequestId(){return ge(this,void 0,void 0,function*(){const t=yield this.getConnection();return t&&"nextRpcRequestId"in t&&t.nextRpcRequestId||0})}}const Ap=2;class Jl{constructor(t,n){this.storage=t,this.walletConnectionSource=n,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=5e3,this.connectionStorage=new Gl(t)}static fromStorage(t){return ge(this,void 0,void 0,function*(){const r=yield new Gl(t).getHttpConnection();return El(r)?new Jl(t,r.connectionSource):new Jl(t,{bridgeUrl:r.session.bridgeUrl})})}connect(t,n){var r;const o=pr(n==null?void 0:n.signal);(r=this.abortController)===null||r===void 0||r.abort(),this.abortController=o,this.closeGateways();const i=new df;this.session={sessionCrypto:i,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:i}).then(()=>ge(this,void 0,void 0,function*(){o.signal.aborted||(yield kl(s=>this.openGateways(i,{openingDeadlineMS:n==null?void 0:n.openingDeadlineMS,signal:s==null?void 0:s.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:o.signal}))}));const l="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(l,t)}restoreConnection(t){var n,r;return ge(this,void 0,void 0,function*(){const o=pr(t==null?void 0:t.signal);if((n=this.abortController)===null||n===void 0||n.abort(),this.abortController=o,o.signal.aborted)return;this.closeGateways();const i=yield this.connectionStorage.getHttpConnection();if(!i||o.signal.aborted)return;const l=(r=t==null?void 0:t.openingDeadlineMS)!==null&&r!==void 0?r:this.defaultOpeningDeadlineMS;if(El(i))return this.session={sessionCrypto:i.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways(i.sessionCrypto,{openingDeadlineMS:l,signal:o==null?void 0:o.signal});if(Array.isArray(this.walletConnectionSource))throw new Le("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=i.session,this.gateway&&(tn("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new ou(this.storage,this.walletConnectionSource.bridgeUrl,i.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),!o.signal.aborted){this.listeners.forEach(s=>s(i.connectEvent));try{yield kl(s=>this.gateway.registerSession({openingDeadlineMS:l,signal:s.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:o.signal})}catch{yield this.disconnect({signal:o.signal});return}}})}sendRequest(t,n){const r={};return typeof n=="function"?r.onRequestSent=n:(r.onRequestSent=n==null?void 0:n.onRequestSent,r.signal=n==null?void 0:n.signal,r.attempts=n==null?void 0:n.attempts),new Promise((o,i)=>ge(this,void 0,void 0,function*(){var l;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new Le("Trying to send bridge request without session");const s=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),tn("Send http-bridge request:",Object.assign(Object.assign({},t),{id:s}));const c=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{id:s})),Ia(this.session.walletPublicKey));try{yield this.gateway.send(c,this.session.walletPublicKey,t.method,{attempts:r==null?void 0:r.attempts,signal:r==null?void 0:r.signal}),(l=r==null?void 0:r.onRequestSent)===null||l===void 0||l.call(r),this.pendingRequests.set(s.toString(),o)}catch(f){i(f)}}))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(t){return ge(this,void 0,void 0,function*(){return new Promise(n=>ge(this,void 0,void 0,function*(){let r=!1,o=null;const i=()=>{r||(r=!0,this.removeBridgeAndSession().then(n))};try{this.closeGateways();const l=pr(t==null?void 0:t.signal);o=setTimeout(()=>{l.abort()},this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:i,signal:l.signal,attempts:1})}catch(l){tn("Disconnect error:",l),r||this.removeBridgeAndSession().then(n)}finally{o&&clearTimeout(o),i()}}))})}listen(t){return this.listeners.push(t),()=>this.listeners=this.listeners.filter(n=>n!==t)}pause(){var t;(t=this.gateway)===null||t===void 0||t.pause(),this.pendingGateways.forEach(n=>n.pause())}unPause(){return ge(this,void 0,void 0,function*(){const t=this.pendingGateways.map(n=>n.unPause());this.gateway&&t.push(this.gateway.unPause()),yield Promise.all(t)})}pendingGatewaysListener(t,n,r){return ge(this,void 0,void 0,function*(){if(!this.pendingGateways.includes(t)){yield t.close();return}return this.closeGateways({except:t}),this.gateway&&(tn("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=n,this.gateway=t,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(r)})}gatewayListener(t){return ge(this,void 0,void 0,function*(){const n=JSON.parse(this.session.sessionCrypto.decrypt(bd.decode(t.message).toUint8Array(),Ia(t.from)));if(tn("Wallet message received:",n),!("event"in n)){const o=n.id.toString(),i=this.pendingRequests.get(o);if(!i){tn(`Response id ${o} doesn't match any request's id`);return}i(n),this.pendingRequests.delete(o);return}if(n.id!==void 0){const o=yield this.connectionStorage.getLastWalletEventId();if(o!==void 0&&n.id<=o){Ar(`Received event id (=${n.id}) must be greater than stored last wallet event id (=${o}) `);return}n.event!=="connect"&&(yield this.connectionStorage.storeLastWalletEventId(n.id))}const r=this.listeners;n.event==="connect"&&(yield this.updateSession(n,t.from)),n.event==="disconnect"&&(tn("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),r.forEach(o=>o(n))})}gatewayErrorsListener(t){return ge(this,void 0,void 0,function*(){throw new Le(`Bridge error ${JSON.stringify(t)}`)})}updateSession(t,n){return ge(this,void 0,void 0,function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:n});const r=t.payload.items.find(i=>i.name==="ton_addr"),o=Object.assign(Object.assign({},t),{payload:Object.assign(Object.assign({},t.payload),{items:[r]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:t.id,connectEvent:o,nextRpcRequestId:0})})}removeBridgeAndSession(){return ge(this,void 0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}generateUniversalLink(t,n){return zo(t)?this.generateTGUniversalLink(t,n):this.generateRegularUniversalLink(t,n)}generateRegularUniversalLink(t,n){const r=new URL(t);return r.searchParams.append("v",Ap.toString()),r.searchParams.append("id",this.session.sessionCrypto.sessionId),r.searchParams.append("r",JSON.stringify(n)),r.toString()}generateTGUniversalLink(t,n){const o=this.generateRegularUniversalLink("about:blank",n).split("?")[1],i="tonconnect-"+Ep(o),l=this.convertToDirectLink(t),s=new URL(l);return s.searchParams.append("startapp",i),s.toString()}convertToDirectLink(t){const n=new URL(t);return n.searchParams.has("attach")&&(n.searchParams.delete("attach"),n.pathname+="/start"),n.toString()}openGateways(t,n){return ge(this,void 0,void 0,function*(){if(Array.isArray(this.walletConnectionSource)){this.pendingGateways.map(r=>r.close().catch()),this.pendingGateways=this.walletConnectionSource.map(r=>{const o=new ou(this.storage,r.bridgeUrl,t.sessionId,()=>{},()=>{});return o.setListener(i=>this.pendingGatewaysListener(o,r.bridgeUrl,i)),o}),yield Promise.allSettled(this.pendingGateways.map(r=>kl(o=>this.pendingGateways.some(i=>i===r)?r.registerSession({openingDeadlineMS:n==null?void 0:n.openingDeadlineMS,signal:o.signal}):r.close(),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:n==null?void 0:n.signal})));return}else return this.gateway&&(tn("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new ou(this.storage,this.walletConnectionSource.bridgeUrl,t.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession({openingDeadlineMS:n==null?void 0:n.openingDeadlineMS,signal:n==null?void 0:n.signal})})}closeGateways(t){var n;(n=this.gateway)===null||n===void 0||n.close(),this.pendingGateways.filter(r=>r!==(t==null?void 0:t.except)).forEach(r=>r.close()),this.pendingGateways=[]}}function f0(e,t){return Lp(e,[t])}function Lp(e,t){return!e||typeof e!="object"?!1:t.every(n=>n in e)}function em(e){try{return!f0(e,"tonconnect")||!f0(e.tonconnect,"walletInfo")?!1:Lp(e.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch{return!1}}let tm=class ul{constructor(){this.storage={}}static getInstance(){return ul.instance||(ul.instance=new ul),ul.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(t){var n;return(n=this.storage[t])!==null&&n!==void 0?n:null}key(t){var n;const r=Object.keys(this.storage);return t<0||t>=r.length?null:(n=r[t])!==null&&n!==void 0?n:null}removeItem(t){delete this.storage[t]}setItem(t,n){this.storage[t]=n}};function xc(){if(!(typeof window>"u"))return window}function nm(){const e=xc();if(!e)return[];try{return Object.keys(e)}catch{return[]}}function rm(){if(!(typeof document>"u"))return document}function om(){var e;const t=(e=xc())===null||e===void 0?void 0:e.location.origin;return t?t+"/tonconnect-manifest.json":""}function im(){if(lm())return localStorage;if(sm())throw new Le("`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 tm.getInstance()}function lm(){try{return typeof localStorage<"u"}catch{return!1}}function sm(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null}class Bn{constructor(t,n){this.injectedWalletKey=n,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const r=Bn.window;if(!Bn.isWindowContainsWallet(r,n))throw new kd;this.connectionStorage=new Gl(t),this.injectedWallet=r[n].tonconnect}static fromStorage(t){return ge(this,void 0,void 0,function*(){const r=yield new Gl(t).getInjectedConnection();return new Bn(t,r.jsBridgeKey)})}static isWalletInjected(t){return Bn.isWindowContainsWallet(this.window,t)}static isInsideWalletBrowser(t){return Bn.isWindowContainsWallet(this.window,t)?this.window[t].tonconnect.isWalletBrowser:!1}static getCurrentlyInjectedWallets(){return this.window?nm().filter(([r,o])=>em(o)).map(([r,o])=>({name:o.tonconnect.walletInfo.name,appName:o.tonconnect.walletInfo.app_name,aboutUrl:o.tonconnect.walletInfo.about_url,imageUrl:o.tonconnect.walletInfo.image,tondns:o.tonconnect.walletInfo.tondns,jsBridgeKey:r,injected:!0,embedded:o.tonconnect.isWalletBrowser,platforms:o.tonconnect.walletInfo.platforms})):[]}static isWindowContainsWallet(t,n){return!!t&&n in t&&typeof t[n]=="object"&&"tonconnect"in t[n]}connect(t){this._connect(Ap,t)}restoreConnection(){return ge(this,void 0,void 0,function*(){try{tn("Injected Provider restoring connection...");const t=yield this.injectedWallet.restoreConnection();tn("Injected Provider restoring connection response",t),t.event==="connect"?(this.makeSubscriptions(),this.listeners.forEach(n=>n(t))):yield this.connectionStorage.removeConnection()}catch(t){yield this.connectionStorage.removeConnection(),console.error(t)}})}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return ge(this,void 0,void 0,function*(){return new Promise(t=>{const n=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(t)};try{this.injectedWallet.disconnect(),n()}catch(r){tn(r),this.sendRequest({method:"disconnect",params:[]},n)}})})}closeAllListeners(){var t;this.listenSubscriptions=!1,this.listeners=[],(t=this.unsubscribeCallback)===null||t===void 0||t.call(this)}listen(t){return this.listeners.push(t),()=>this.listeners=this.listeners.filter(n=>n!==t)}sendRequest(t,n){var r;return ge(this,void 0,void 0,function*(){const o={};typeof n=="function"?o.onRequestSent=n:(o.onRequestSent=n==null?void 0:n.onRequestSent,o.signal=n==null?void 0:n.signal);const i=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),tn("Send injected-bridge request:",Object.assign(Object.assign({},t),{id:i}));const l=this.injectedWallet.send(Object.assign(Object.assign({},t),{id:i}));return l.then(s=>tn("Wallet message received:",s)),(r=o==null?void 0:o.onRequestSent)===null||r===void 0||r.call(o),l})}_connect(t,n){return ge(this,void 0,void 0,function*(){try{tn(`Injected Provider connect request: protocolVersion: ${t}, message:`,n);const r=yield this.injectedWallet.connect(t,n);tn("Injected Provider connect response:",r),r.event==="connect"&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach(o=>o(r))}catch(r){tn("Injected Provider connect error:",r);const o={event:"connect_error",payload:{code:0,message:r==null?void 0:r.toString()}};this.listeners.forEach(i=>i(o))}})}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen(t=>{tn("Wallet message received:",t),this.listenSubscriptions&&this.listeners.forEach(n=>n(t)),t.event==="disconnect"&&this.disconnect()})}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}Bn.window=xc();class am{constructor(){this.localStorage=im()}getItem(t){return ge(this,void 0,void 0,function*(){return this.localStorage.getItem(t)})}removeItem(t){return ge(this,void 0,void 0,function*(){this.localStorage.removeItem(t)})}setItem(t,n){return ge(this,void 0,void 0,function*(){this.localStorage.setItem(t,n)})}}function Vo(e){return cm(e)&&e.injected}function Cc(e){return Vo(e)&&e.embedded}function cm(e){return"jsBridgeKey"in e}function Td(e){return"bridgeUrl"in e}const um=[{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://bridge.tonapi.io/bridge"}],platforms:["ios","android","macos","windows","linux"]},{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"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"]},{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"]},{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"]},{app_name:"dewallet",name:"DeWallet",image:"https://app.delabwallet.com/logo_black.png",about_url:"https://delabwallet.com",bridge:[{type:"js",key:"dewallet"}],platforms:["chrome"]},{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"]},{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"]}];class hf{constructor(t){this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource="https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",t!=null&&t.walletsListSource&&(this.walletsListSource=t.walletsListSource),t!=null&&t.cacheTTLMs&&(this.cacheTTLMs=t.cacheTTLMs)}getWallets(){return ge(this,void 0,void 0,function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then(()=>{this.walletsListCacheCreationTimestamp=Date.now()}).catch(()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null})),this.walletsListCache})}getEmbeddedWallet(){return ge(this,void 0,void 0,function*(){const n=(yield this.getWallets()).filter(Cc);return n.length!==1?null:n[0]})}fetchWalletsList(){return ge(this,void 0,void 0,function*(){let t=[];try{if(t=yield(yield fetch(this.walletsListSource)).json(),!Array.isArray(t))throw new Ed("Wrong wallets list format, wallets list must be an array.");const o=t.filter(i=>!this.isCorrectWalletConfigDTO(i));o.length&&(Ar(`Wallet(s) ${o.map(i=>i.name).join(", ")} config format is wrong. They were removed from the wallets list.`),t=t.filter(i=>this.isCorrectWalletConfigDTO(i)))}catch(r){Ar(r),t=um}let n=[];try{n=Bn.getCurrentlyInjectedWallets()}catch(r){Ar(r)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(t),n)})}walletConfigDTOListToWalletConfigList(t){return t.map(n=>{const o={name:n.name,appName:n.app_name,imageUrl:n.image,aboutUrl:n.about_url,tondns:n.tondns,platforms:n.platforms};return n.bridge.forEach(i=>{if(i.type==="sse"&&(o.bridgeUrl=i.url,o.universalLink=n.universal_url,o.deepLink=n.deepLink),i.type==="js"){const l=i.key;o.jsBridgeKey=l,o.injected=Bn.isWalletInjected(l),o.embedded=Bn.isInsideWalletBrowser(l)}}),o})}mergeWalletsLists(t,n){return[...new Set(t.concat(n).map(o=>o.name)).values()].map(o=>{const i=t.find(s=>s.name===o),l=n.find(s=>s.name===o);return Object.assign(Object.assign({},i&&Object.assign({},i)),l&&Object.assign({},l))})}isCorrectWalletConfigDTO(t){if(!t||typeof t!="object")return!1;const n="name"in t,r="app_name"in t,o="image"in t,i="about_url"in t,l="platforms"in t;if(!n||!o||!i||!l||!r||!t.platforms||!Array.isArray(t.platforms)||!t.platforms.length||!("bridge"in t)||!Array.isArray(t.bridge)||!t.bridge.length)return!1;const s=t.bridge;if(s.some(d=>!d||typeof d!="object"||!("type"in d)))return!1;const c=s.find(d=>d.type==="sse");if(c&&(!("url"in c)||!c.url||!t.universal_url))return!1;const f=s.find(d=>d.type==="js");return!(f&&(!("key"in f)||!f.key))}}class Wa extends Le{get info(){return"Wallet doesn't support requested feature method."}constructor(...t){super(...t),Object.setPrototypeOf(this,Wa.prototype)}}function fm(e,t){const n=e.includes("SendTransaction"),r=e.find(o=>o&&typeof o=="object"&&o.name==="SendTransaction");if(!n&&!r)throw new Wa("Wallet doesn't support SendTransaction feature.");if(r&&r.maxMessages!==void 0){if(r.maxMessages{var s,c;return{address:(s=l.address)!==null&&s!==void 0?s:null,amount:(c=l.amount)!==null&&c!==void 0?c:null}})}}function Op(e,t,n){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},qi(e,t)),Ad(t,n))}function Bp(e,t,n,r){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:r.boc},qi(e,t)),Ad(t,n))}function jp(e,t,n,r,o){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:r,error_code:o??null},qi(e,t)),Ad(t,n))}function Dp(e,t,n){return Object.assign({type:"disconnection",scope:n},qi(e,t))}class Hp{constructor(){this.window=xc()}dispatchEvent(t,n){var r;return ge(this,void 0,void 0,function*(){const o=new CustomEvent(t,{detail:n});(r=this.window)===null||r===void 0||r.dispatchEvent(o)})}addEventListener(t,n,r){var o;return ge(this,void 0,void 0,function*(){return(o=this.window)===null||o===void 0||o.addEventListener(t,n,r),()=>{var i;return(i=this.window)===null||i===void 0?void 0:i.removeEventListener(t,n)}})}}class dm{constructor(t){var n;this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=(n=t==null?void 0:t.eventDispatcher)!==null&&n!==void 0?n:new Hp,this.tonConnectSdkVersion=t.tonConnectSdkVersion,this.init().catch()}get version(){return ni({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return ge(this,void 0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch{}})}setRequestVersionHandler(){return ge(this,void 0,void 0,function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",()=>ge(this,void 0,void 0,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",Mp(this.tonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return ge(this,void 0,void 0,function*(){return new Promise((t,n)=>ge(this,void 0,void 0,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",r=>{t(r.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",Pp())}catch(r){n(r)}}))})}dispatchUserActionEvent(t){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${t.type}`,t).catch()}catch{}}trackConnectionStarted(...t){try{const n=Rp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionCompleted(...t){try{const n=Ip(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionError(...t){try{const n=$p(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringStarted(...t){try{const n=Np(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringCompleted(...t){try{const n=Wp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringError(...t){try{const n=Up(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackDisconnection(...t){try{const n=Dp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSentForSignature(...t){try{const n=Op(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigned(...t){try{const n=Bp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigningFailed(...t){try{const n=jp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}}const hm="3.0.3";class Xo{constructor(t){if(this.walletsList=new hf,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(t==null?void 0:t.manifestUrl)||om(),storage:(t==null?void 0:t.storage)||new am},this.walletsList=new hf({walletsListSource:t==null?void 0:t.walletsListSource,cacheTTLMs:t==null?void 0:t.walletsListCacheTTLMs}),this.tracker=new dm({eventDispatcher:t==null?void 0:t.eventDispatcher,tonConnectSdkVersion:hm}),!this.dappSettings.manifestUrl)throw new Sd("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 Gl(this.dappSettings.storage),t!=null&&t.disableAutoPauseConnection||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return this._wallet!==null}get account(){var t;return((t=this._wallet)===null||t===void 0?void 0:t.account)||null}get wallet(){return this._wallet}set wallet(t){this._wallet=t,this.statusChangeSubscriptions.forEach(n=>n(this._wallet))}getWallets(){return this.walletsList.getWallets()}onStatusChange(t,n){return this.statusChangeSubscriptions.push(t),n&&this.statusChangeErrorSubscriptions.push(n),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(r=>r!==t),n&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(r=>r!==n))}}connect(t,n){var r,o;const i={};if(typeof n=="object"&&"tonProof"in n&&(i.request=n),typeof n=="object"&&("openingDeadlineMS"in n||"signal"in n||"request"in n)&&(i.request=n==null?void 0:n.request,i.openingDeadlineMS=n==null?void 0:n.openingDeadlineMS,i.signal=n==null?void 0:n.signal),this.connected)throw new _d;const l=pr(i==null?void 0:i.signal);if((r=this.abortController)===null||r===void 0||r.abort(),this.abortController=l,l.signal.aborted)throw new Le("Connection was aborted");return(o=this.provider)===null||o===void 0||o.closeConnection(),this.provider=this.createProvider(t),l.signal.addEventListener("abort",()=>{var s;(s=this.provider)===null||s===void 0||s.closeConnection(),this.provider=null}),this.tracker.trackConnectionStarted(),this.provider.connect(this.createConnectRequest(i==null?void 0:i.request),{openingDeadlineMS:i==null?void 0:i.openingDeadlineMS,signal:l.signal})}restoreConnection(t){var n,r;return ge(this,void 0,void 0,function*(){this.tracker.trackConnectionRestoringStarted();const o=pr(t==null?void 0:t.signal);if((n=this.abortController)===null||n===void 0||n.abort(),this.abortController=o,o.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}const[i,l]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(o.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}let s=null;try{switch(i){case"http":s=yield Jl.fromStorage(this.dappSettings.storage);break;case"injected":s=yield Bn.fromStorage(this.dappSettings.storage);break;default:if(l)s=this.createProvider(l);else return}}catch{this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),s==null||s.closeConnection(),s=null;return}if(o.signal.aborted){s==null||s.closeConnection(),this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}if(!s){Ar("Provider is not restored"),this.tracker.trackConnectionRestoringError("Provider is not restored");return}(r=this.provider)===null||r===void 0||r.closeConnection(),this.provider=s,s.listen(this.walletEventsListener.bind(this));const c=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted"),s==null||s.closeConnection(),s=null};return o.signal.addEventListener("abort",c),yield kl(f=>ge(this,void 0,void 0,function*(){yield s==null?void 0:s.restoreConnection({openingDeadlineMS:t==null?void 0:t.openingDeadlineMS,signal:f.signal}),o.signal.removeEventListener("abort",c),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:5e3,signal:t==null?void 0:t.signal})})}sendTransaction(t,n){return ge(this,void 0,void 0,function*(){const r={};typeof n=="function"?r.onRequestSent=n:(r.onRequestSent=n==null?void 0:n.onRequestSent,r.signal=n==null?void 0:n.signal);const o=pr(r==null?void 0:r.signal);if(o.signal.aborted)throw new Le("Transaction sending was aborted");this.checkConnection(),fm(this.wallet.device.features,{requiredMessagesNumber:t.messages.length}),this.tracker.trackTransactionSentForSignature(this.wallet,t);const{validUntil:i}=t,l=H3(t,["validUntil"]),s=t.from||this.account.address,c=t.network||this.account.chain,f=yield this.provider.sendRequest(Bs.convertToRpcRequest(Object.assign(Object.assign({},l),{valid_until:i,from:s,network:c})),{onRequestSent:r.onRequestSent,signal:o.signal});if(Bs.isError(f))return this.tracker.trackTransactionSigningFailed(this.wallet,t,f.error.message,f.error.code),Bs.parseAndThrowError(f);const d=Bs.convertFromRpcResponse(f);return this.tracker.trackTransactionSigned(this.wallet,t,d),d})}disconnect(t){var n;return ge(this,void 0,void 0,function*(){if(!this.connected)throw new $a;const r=pr(t==null?void 0:t.signal),o=this.abortController;if(this.abortController=r,r.signal.aborted)throw new Le("Disconnect was aborted");this.onWalletDisconnected("dapp"),yield(n=this.provider)===null||n===void 0?void 0:n.disconnect({signal:r.signal}),o==null||o.abort()})}pauseConnection(){var t;((t=this.provider)===null||t===void 0?void 0:t.type)==="http"&&this.provider.pause()}unPauseConnection(){var t;return((t=this.provider)===null||t===void 0?void 0:t.type)!=="http"?Promise.resolve():this.provider.unPause()}addWindowFocusAndBlurSubscriptions(){const t=rm();if(t)try{t.addEventListener("visibilitychange",()=>{t.hidden?this.pauseConnection():this.unPauseConnection().catch()})}catch(n){Ar("Cannot subscribe to the document.visibilitychange: ",n)}}createProvider(t){let n;return!Array.isArray(t)&&F3(t)?n=new Bn(this.dappSettings.storage,t.jsBridgeKey):n=new Jl(this.dappSettings.storage,t),n.listen(this.walletEventsListener.bind(this)),n}walletEventsListener(t){switch(t.event){case"connect":this.onWalletConnected(t.payload);break;case"connect_error":this.onWalletConnectError(t.payload);break;case"disconnect":this.onWalletDisconnected("wallet")}}onWalletConnected(t){const n=t.items.find(i=>i.name==="ton_addr"),r=t.items.find(i=>i.name==="ton_proof");if(!n)throw new Le("ton_addr connection item was not found");const o={device:t.device,provider:this.provider.type,account:{address:n.address,chain:n.network,walletStateInit:n.walletStateInit,publicKey:n.publicKey}};r&&(o.connectItems={tonProof:r}),this.wallet=o,this.tracker.trackConnectionCompleted(o)}onWalletConnectError(t){const n=V3.parseError(t);if(this.statusChangeErrorSubscriptions.forEach(r=>r(n)),tn(n),this.tracker.trackConnectionError(t.message,t.code),n instanceof vc||n instanceof gc)throw Ar(n),n}onWalletDisconnected(t){this.tracker.trackDisconnection(this.wallet,t),this.wallet=null}checkConnection(){if(!this.connected)throw new $a}createConnectRequest(t){const n=[{name:"ton_addr"}];return t!=null&&t.tonProof&&n.push({name:"ton_proof",payload:t.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:n}}}Xo.walletsList=new hf;Xo.isWalletInjected=e=>Bn.isWalletInjected(e);Xo.isInsideWalletBrowser=e=>Bn.isInsideWalletBrowser(e);const pm=81,gm=128;function Fp(e,t=!1){const{wc:n,hex:r}=vm(e);let o=pm;t&&(o|=gm);const i=new Int8Array(34);i[0]=o,i[1]=n,i.set(r,2);const l=new Uint8Array(36);return l.set(i),l.set(mm(i),34),bd.encode(l).replace(/\+/g,"-").replace(/\//g,"_")}function vm(e){if(!e.includes(":"))throw new Ci(`Wrong address ${e}. Address must include ":".`);const t=e.split(":");if(t.length!==2)throw new Ci(`Wrong address ${e}. Address must include ":" only once.`);const n=parseInt(t[0]);if(n!==0&&n!==-1)throw new Ci(`Wrong address ${e}. WC must be eq 0 or -1, but ${n} received.`);const r=t[1];if((r==null?void 0:r.length)!==64)throw new Ci(`Wrong address ${e}. Hex part must be 64bytes length, but ${r==null?void 0:r.length} received.`);return{wc:n,hex:ym(r)}}function mm(e){let n=0;const r=new Uint8Array(e.length+2);r.set(e);for(let o of r){let i=128;for(;i>0;)n<<=1,o&i&&(n+=1),i>>=1,n>65535&&(n&=65535,n^=4129)}return new Uint8Array([Math.floor(n/256),n%256])}const pf={};for(let e=0;e<=255;e++){let t=e.toString(16);t.length<2&&(t="0"+t),pf[t]=e}function ym(e){e=e.toLowerCase();const t=e.length;if(t%2!==0)throw new Na("Hex string must have length a multiple of 2: "+e);const n=t/2,r=new Uint8Array(n);for(let o=0;o0?at.length===2?typeof at[1]==s?this[at[0]]=at[1].call(this,dn):this[at[0]]=at[1]:at.length===3?typeof at[1]===s&&!(at[1].exec&&at[1].test)?this[at[0]]=dn?at[1].call(this,dn,at[2]):r:this[at[0]]=dn?dn.replace(at[1],at[2]):r:at.length===4&&(this[at[0]]=dn?at[3].call(this,dn.replace(at[1],at[2])):r):this[at]=dn||r;Ue+=2}},Pe=function(Ie,st){for(var Ue in st)if(typeof st[Ue]===f&&st[Ue].length>0){for(var wt=0;wt2&&(Te[h]="iPad",Te[C]=E),Te},this.getEngine=function(){var Te={};return Te[S]=r,Te[O]=r,bt.call(Te,wt,Un.engine),Te},this.getOS=function(){var Te={};return Te[S]=r,Te[O]=r,bt.call(Te,wt,Un.os),at&&!Te[S]&&ln&&ln.platform&&ln.platform!="Unknown"&&(Te[S]=ln.platform.replace(/chrome os/i,K).replace(/macos/i,D)),Te},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 wt},this.setUA=function(Te){return wt=typeof Te===d&&Te.length>L?Ve(Te,L):Te,this},this.setUA(wt),this};Zt.VERSION=o,Zt.BROWSER=G([S,O,w]),Zt.CPU=G([b]),Zt.DEVICE=G([h,_,C,p,y,T,E,N,I]),Zt.ENGINE=Zt.OS=G([S,O]),e.exports&&(t=e.exports=Zt),t.UAParser=Zt;var Jt=typeof n!==c&&(n.jQuery||n.Zepto);if(Jt&&!Jt.ua){var An=new Zt;Jt.ua=An.getResult(),Jt.ua.get=function(){return An.getUA()},Jt.ua.set=function(Ie){An.setUA(Ie);var st=An.getResult();for(var Ue in st)Jt.ua[Ue]=st[Ue]}}})(typeof window=="object"?window:ch)})(gf,gf.exports);var wm=gf.exports;const xm=Fi(wm);var Cm=function(t){return bm(t)&&!Sm(t)};function bm(e){return!!e&&typeof e=="object"}function Sm(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Em(e)}var _m=typeof Symbol=="function"&&Symbol.for,km=_m?Symbol.for("react.element"):60103;function Em(e){return e.$$typeof===km}function Tm(e){return Array.isArray(e)?[]:{}}function Xl(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Bi(Tm(e),e,t):e}function Am(e,t,n){return e.concat(t).map(function(r){return Xl(r,n)})}function Lm(e,t){if(!t.customMerge)return Bi;var n=t.customMerge(e);return typeof n=="function"?n:Bi}function Pm(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function d0(e){return Object.keys(e).concat(Pm(e))}function zp(e,t){try{return t in e}catch{return!1}}function Mm(e,t){return zp(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function Rm(e,t,n){var r={};return n.isMergeableObject(e)&&d0(e).forEach(function(o){r[o]=Xl(e[o],n)}),d0(t).forEach(function(o){Mm(e,o)||(zp(e,o)&&n.isMergeableObject(t[o])?r[o]=Lm(o,n)(e[o],t[o],n):r[o]=Xl(t[o],n))}),r}function Bi(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Am,n.isMergeableObject=n.isMergeableObject||Cm,n.cloneUnlessOtherwiseSpecified=Xl;var r=Array.isArray(t),o=Array.isArray(e),i=r===o;return i?r?n.arrayMerge(e,t,n):Rm(e,t,n):Xl(t,n)}Bi.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return Bi(r,o,n)},{})};var Im=Bi,$m=Im;const Nm=Fi($m);var Vp={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",l=0;lt in e?Um(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ct=(e,t)=>{for(var n in t||(t={}))jm.call(t,n)&&vf(e,n,t[n]);if(h0)for(var n of h0(t))Dm.call(t,n)&&vf(e,n,t[n]);return e},Qn=(e,t)=>Om(e,Bm(t)),Me=(e,t,n)=>(vf(e,typeof t!="symbol"?t+"":t,n),n),xt=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{s(n.next(c))}catch(f){o(f)}},l=c=>{try{s(n.throw(c))}catch(f){o(f)}},s=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,l);s((n=n.apply(e,t)).next())}),p0,g0,v0,m0,y0,w0,x0,C0;const Wt={};function Hm(e){Wt.context=e}const Fm=(e,t)=>e===t,yr=Symbol("solid-proxy"),mf=Symbol("solid-track"),Ua={equals:Fm};let Kp=Jp;const Xr=1,Oa=2,qp={owned:null,cleanups:null,context:null,owner:null},iu={};var nn=null;let Ko=null,Nt=null,kn=null,Fr=null,Ld=0;function Tl(e,t){const n=Nt,r=nn,o=e.length===0,i=o?qp:{owned:null,cleanups:null,context:null,owner:t===void 0?r:t},l=o?e:()=>e(()=>un(()=>kc(i)));nn=i,Nt=null;try{return Eo(l,!0)}finally{Nt=n,nn=r}}function Ne(e,t){t=t?Object.assign({},Ua,t):Ua;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Gp(n,o));return[Zp.bind(n),r]}function Ba(e,t,n){const r=_c(e,t,!0,Xr);Qi(r)}function nt(e,t,n){const r=_c(e,t,!1,Xr);Qi(r)}function cn(e,t,n){Kp=Gm;const r=_c(e,t,!1,Xr);r.user=!0,Fr?Fr.push(r):Qi(r)}function de(e,t,n){n=n?Object.assign({},Ua,n):Ua;const r=_c(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Qi(r),Zp.bind(r)}function zm(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i={}):(r=e,o=t,i={});let l=null,s=iu,c=null,f=!1,d="initialValue"in i,w=typeof r=="function"&&de(r);const h=new Set,[S,C]=(i.storage||Ne)(i.initialValue),[_,O]=Ne(void 0),[b,p]=Ne(void 0,{equals:!1}),[y,E]=Ne(d?"ready":"unresolved");if(Wt.context){c=`${Wt.context.id}${Wt.context.count++}`;let P;i.ssrLoadFrom==="initial"?s=i.initialValue:Wt.load&&(P=Wt.load(c))&&(s=P[0])}function T(P,U,$,M){return l===P&&(l=null,d=!0,(P===s||U===s)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(M,{value:U})),s=iu,W(U,$)),U}function W(P,U){Eo(()=>{U===void 0&&C(()=>P),E(U!==void 0?"errored":"ready"),O(U);for(const $ of h.keys())$.decrement();h.clear()},!1)}function I(){const P=Qm,U=S(),$=_();if($!==void 0&&!l)throw $;return Nt&&!Nt.user&&P&&Ba(()=>{b(),l&&(P.resolved||h.has(P)||(P.increment(),h.add(P)))}),U}function L(P=!0){if(P!==!1&&f)return;f=!1;const U=w?w():r;if(U==null||U===!1){T(l,un(S));return}const $=s!==iu?s:un(()=>o(U,{value:S(),refetching:P}));return typeof $!="object"||!($&&"then"in $)?(T(l,$,void 0,U),$):(l=$,f=!0,queueMicrotask(()=>f=!1),Eo(()=>{E(d?"refreshing":"pending"),p()},!1),$.then(M=>T($,M,void 0,U),M=>T($,void 0,eg(M),U)))}return Object.defineProperties(I,{state:{get:()=>y()},error:{get:()=>_()},loading:{get(){const P=y();return P==="pending"||P==="refreshing"}},latest:{get(){if(!d)return I();const P=_();if(P&&!l)throw P;return S()}}}),w?Ba(()=>L(!1)):L(!1),[I,{refetch:L,mutate:C}]}function Qp(e){return Eo(e,!1)}function un(e){if(Nt===null)return e();const t=Nt;Nt=null;try{return e()}finally{Nt=t}}function Vm(e,t,n){const r=Array.isArray(e);let o;return i=>{let l;if(r){l=Array(e.length);for(let c=0;ct(l,o,i));return o=l,s}}function Km(e){cn(()=>un(e))}function Rn(e){return nn===null||(nn.cleanups===null?nn.cleanups=[e]:nn.cleanups.push(e)),e}function Yp(){return Nt}function qm(){return nn}function bc(e,t){const n=Symbol("context");return{id:n,Provider:Jm(n),defaultValue:e}}function In(e){let t;return(t=ng(nn,e.id))!==void 0?t:e.defaultValue}function Sc(e){const t=de(e),n=de(()=>yf(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let Qm;function Zp(){const e=Ko;if(this.sources&&(this.state||e))if(this.state===Xr||e)Qi(this);else{const t=kn;kn=null,Eo(()=>Da(this),!1),kn=t}if(Nt){const t=this.observers?this.observers.length:0;Nt.sources?(Nt.sources.push(this),Nt.sourceSlots.push(t)):(Nt.sources=[this],Nt.sourceSlots=[t]),this.observers?(this.observers.push(Nt),this.observerSlots.push(Nt.sources.length-1)):(this.observers=[Nt],this.observerSlots=[Nt.sources.length-1])}return this.value}function Gp(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Eo(()=>{for(let o=0;o1e6)throw kn=[],new Error},!1)),t}function Qi(e){if(!e.fn)return;kc(e);const t=nn,n=Nt,r=Ld;Nt=nn=e,Ym(e,e.value,r),Nt=n,nn=t}function Ym(e,t,n){let r;try{r=e.fn(t)}catch(o){e.pure&&(e.state=Xr,e.owned&&e.owned.forEach(kc),e.owned=null),tg(o)}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Gp(e,r):e.value=r,e.updatedAt=n)}function _c(e,t,n,r=Xr,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:nn,context:null,pure:n};return nn===null||nn!==qp&&(nn.owned?nn.owned.push(i):nn.owned=[i]),i}function ja(e){const t=Ko;if(e.state===0||t)return;if(e.state===Oa||t)return Da(e);if(e.suspense&&un(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;r--)if(e=n[r],e.state===Xr||t)Qi(e);else if(e.state===Oa||t){const o=kn;kn=null,Eo(()=>Da(e,n[0]),!1),kn=o}}function Eo(e,t){if(kn)return e();let n=!1;t||(kn=[]),Fr?n=!0:Fr=[],Ld++;try{const r=e();return Zm(n),r}catch(r){n||(Fr=null),kn=null,tg(r)}}function Zm(e){if(kn&&(Jp(kn),kn=null),e)return;const t=Fr;Fr=null,t.length&&Eo(()=>Kp(t),!1)}function Jp(e){for(let t=0;to=un(()=>(nn.context={[e]:r.value},Sc(()=>r.children))),void 0),o}}const Xm=Symbol("fallback");function b0(e){for(let t=0;t1?[]:null;return Rn(()=>b0(i)),()=>{let c=e()||[],f,d;return c[mf],un(()=>{let h=c.length,S,C,_,O,b,p,y,E,T;if(h===0)l!==0&&(b0(i),i=[],r=[],o=[],l=0,s&&(s=[])),n.fallback&&(r=[Xm],o[0]=Tl(W=>(i[0]=W,n.fallback())),l=1);else if(l===0){for(o=new Array(h),d=0;d=p&&E>=p&&r[y]===c[E];y--,E--)_[E]=o[y],O[E]=i[y],s&&(b[E]=s[y]);for(S=new Map,C=new Array(E+1),d=E;d>=p;d--)T=c[d],f=S.get(T),C[d]=f===void 0?-1:f,S.set(T,d);for(f=p;f<=y;f++)T=r[f],d=S.get(T),d!==void 0&&d!==-1?(_[d]=o[f],O[d]=i[f],s&&(b[d]=s[f]),d=C[d],S.set(T,d)):i[f]();for(d=p;de(t||{}))}function js(){return!0}const wf={get(e,t,n){return t===yr?n:e.get(t)},has(e,t){return t===yr?!0:e.has(t)},set:js,deleteProperty:js,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:js,deleteProperty:js}},ownKeys(e){return e.keys()}};function lu(e){return(e=typeof e=="function"?e():e)?e:{}}function Ar(...e){let t=!1;for(let r=0;r=0;o--){const i=lu(e[o])[r];if(i!==void 0)return i}},has(r){for(let o=e.length-1;o>=0;o--)if(r in lu(e[o]))return!0;return!1},keys(){const r=[];for(let o=0;o=0;r--)if(e[r]){const o=Object.getOwnPropertyDescriptors(e[r]);for(const i in o)i in n||Object.defineProperty(n,i,{enumerable:!0,get(){for(let l=e.length-1;l>=0;l--){const s=(e[l]||{})[i];if(s!==void 0)return s}}})}return n}function Pd(e,...t){const n=new Set(t.flat());if(yr in e){const o=t.map(i=>new Proxy({get(l){return i.includes(l)?e[l]:void 0},has(l){return i.includes(l)&&l in e},keys(){return i.filter(l=>l in e)}},wf));return o.push(new Proxy({get(i){return n.has(i)?void 0:e[i]},has(i){return n.has(i)?!1:i in e},keys(){return Object.keys(e).filter(i=>!n.has(i))}},wf)),o}const r=Object.getOwnPropertyDescriptors(e);return t.push(Object.keys(r).filter(o=>!n.has(o))),t.map(o=>{const i={};for(let l=0;le.fallback};return de(e4(()=>e.each,e.children,t||void 0))}function je(e){let t=!1;const n=e.keyed,r=de(()=>e.when,void 0,{equals:(o,i)=>t?o===i:!o==!i});return de(()=>{const o=r();if(o){const i=e.children,l=typeof i=="function"&&i.length>0;return t=n||l,l?un(()=>i(o)):i}return e.fallback},void 0,void 0)}function fs(e){let t=!1,n=!1;const r=(l,s)=>l[0]===s[0]&&(t?l[1]===s[1]:!l[1]==!s[1])&&l[2]===s[2],o=Sc(()=>e.children),i=de(()=>{let l=o();Array.isArray(l)||(l=[l]);for(let s=0;s{const[l,s,c]=i();if(l<0)return e.fallback;const f=c.children,d=typeof f=="function"&&f.length>0;return t=n||d,d?un(()=>f(s)):f},void 0,void 0)}function pn(e){return e}const t4=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],n4=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...t4]),r4=new Set(["innerHTML","textContent","innerText","children"]),o4=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),S0=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),i4=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),l4=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","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"]),s4={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function a4(e,t,n){let r=n.length,o=t.length,i=r,l=0,s=0,c=t[o-1].nextSibling,f=null;for(;ld-s){const C=t[l];for(;s{o=i,t===document?e():_n(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function ot(e,t,n){if(typeof window>"u")return null;const r=document.createElement("template");r.innerHTML=e;let o=r.content.firstChild;return n&&(o=o.firstChild),o}function u4(e,t=window.document){const n=t[_0]||(t[_0]=new Set);for(let r=0,o=e.length;ro.call(e,n[1],i))}else e.addEventListener(t,n)}function h4(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,l;for(i=0,l=o.length;io.children=es(e,t.children,o.children)),nt(()=>t.ref&&t.ref(e)),nt(()=>g4(e,t,n,!0,o,!0)),o}function Al(e,t,n){return un(()=>e(t,n))}function _n(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return es(e,t,r,n);nt(o=>es(e,t(),o,n),r)}function g4(e,t,n,r,o={},i=!1){t||(t={});for(const l in o)if(!(l in t)){if(l==="children")continue;o[l]=E0(e,l,null,o[l],n,i)}for(const l in t){if(l==="children")continue;const s=t[l];o[l]=E0(e,l,s,o[l],n,i)}}function v4(e){let t,n;return!Wt.context||!(t=Wt.registry.get(n=w4()))?e.cloneNode(!0):(Wt.completed&&Wt.completed.add(t),Wt.registry.delete(n),t)}function m4(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function k0(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o-1&&s4[t.split(":")[0]];f?f4(e,f,t,n):Ee(e,o4[t]||t,n)}return n}function y4(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),Wt.registry&&!Wt.done&&(Wt.done=!0,document.querySelectorAll("[id^=pl-]").forEach(r=>{for(;r&&r.nodeType!==8&&r.nodeValue!=="pl-"+e;){let o=r.nextSibling;r.remove(),r=o}r&&r.remove()}));n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(o!==void 0?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function es(e,t,n,r,o){for(Wt.context&&!n&&(n=[...e.childNodes]);typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,l=r!==void 0;if(e=l&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(Wt.context)return n;if(i==="number"&&(t=t.toString()),l){let s=n[0];s&&s.nodeType===3?s.data=t:s=document.createTextNode(t),n=si(e,n,r,s)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(Wt.context)return n;n=si(e,n,r)}else{if(i==="function")return nt(()=>{let s=t();for(;typeof s=="function";)s=s();n=es(e,s,n,r)}),()=>n;if(Array.isArray(t)){const s=[],c=n&&Array.isArray(n);if(xf(s,t,n,o))return nt(()=>n=es(e,s,n,r,!0)),()=>n;if(Wt.context){if(!s.length)return n;for(let f=0;f=0;l--){const s=t[l];if(o!==s){const c=s.parentNode===e;!i&&!l?c?e.replaceChild(o,s):e.insertBefore(o,n):c&&s.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function w4(){const e=Wt.context;return`${e.id}${e.count++}`}const x4="http://www.w3.org/2000/svg";function og(e,t=!1){return t?document.createElementNS(x4,e):document.createElement(e)}function ig(e){const{useShadow:t}=e,n=document.createTextNode(""),r=e.mount||document.body;function o(){if(Wt.context){const[i,l]=Ne(!1);return queueMicrotask(()=>l(!0)),()=>i()&&e.children}else return()=>e.children}if(r instanceof HTMLHeadElement){const[i,l]=Ne(!1),s=()=>l(!0);Tl(c=>_n(r,()=>i()?c():o()(),null)),Rn(()=>{Wt.context?queueMicrotask(s):s()})}else{const i=og(e.isSVG?"g":"div",e.isSVG),l=t&&i.attachShadow?i.attachShadow({mode:"open"}):i;Object.defineProperty(i,"_$host",{get(){return n.parentNode},configurable:!0}),_n(l,o()),r.appendChild(i),e.ref&&e.ref(i),Rn(()=>r.removeChild(i))}return n}function ji(e){const[t,n]=Pd(e,["component"]),r=de(()=>t.component);return de(()=>{const o=r();switch(typeof o){case"function":return un(()=>o(n));case"string":const i=l4.has(o),l=Wt.context?v4():og(o,i);return rg(l,n,i),l}})}var $t=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))($t||{});let C4={data:""},b4=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||C4,S4=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,_4=/\/\*[^]*?\*\/| +/g,A0=/\n+/g,Uo=(e,t)=>{let n="",r="",o="";for(let i in e){let l=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+l+";":r+=i[1]=="f"?Uo(l,i):i+"{"+Uo(l,i[1]=="k"?"":t)+"}":typeof l=="object"?r+=Uo(l,t?t.replace(/([^,])+/g,s=>i.replace(/(^:.*)|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,s):s?s+" "+c:c)):i):l!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Uo.p?Uo.p(i,l):i+":"+l+";")}return n+(t&&o?t+"{"+o+"}":o)+r},$r={},lg=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+lg(e[n]);return t}return e},k4=(e,t,n,r,o)=>{let i=lg(e),l=$r[i]||($r[i]=(c=>{let f=0,d=11;for(;f>>0;return"go"+d})(i));if(!$r[l]){let c=i!==e?e:(f=>{let d,w,h=[{}];for(;d=S4.exec(f.replace(_4,""));)d[4]?h.shift():d[3]?(w=d[3].replace(A0," ").trim(),h.unshift(h[0][w]=h[0][w]||{})):h[0][d[1]]=d[2].replace(A0," ").trim();return h[0]})(e);$r[l]=Uo(o?{["@keyframes "+l]:c}:c,n?"":"."+l)}let s=n&&$r.g?$r.g:null;return n&&($r.g=$r[l]),((c,f,d,w)=>{w?f.data=f.data.replace(w,c):f.data.indexOf(c)===-1&&(f.data=d?c+f.data:f.data+c)})($r[l],t,r,s),l},E4=(e,t,n)=>e.reduce((r,o,i)=>{let l=t[i];if(l&&l.call){let s=l(n),c=s&&s.props&&s.props.className||/^go/.test(s)&&s;l=c?"."+c:s&&typeof s=="object"?s.props?"":Uo(s,""):s===!1?"":s}return r+o+(l??"")},"");function Zr(e){let t=this||{},n=e.call?e(t.p):e;return k4(n.unshift?n.raw?E4(n,[].slice.call(arguments,1),t.p):n.reduce((r,o)=>Object.assign(r,o&&o.call?o(t.p):o),{}):n,b4(t.target),t.g,t.o,t.k)}Zr.bind({g:1});let T4=Zr.bind({k:1});const Rd=bc();function A4(e){return m(Rd.Provider,{value:e.theme,get children(){return e.children}})}function Et(){return In(Rd)}function sg(e){let t=this||{};return(...n)=>{const r=o=>{const i=In(Rd),l=Ar(o,{theme:i}),s=Ar(l,{get class(){const S=l.class,C="class"in l&&/^go[0-9]+/.test(S);let _=Zr.apply({target:t.target,o:C,p:l,g:t.g},n);return[S,_].filter(Boolean).join(" ")}}),[c,f]=Pd(s,["as","theme"]),d=f,w=c.as||e;let h;return typeof w=="function"?h=w(d):t.g==1?(h=document.createElement(w),rg(h,d)):h=ji(Ar({component:w},d)),h};return r.class=o=>un(()=>Zr.apply({target:t.target,p:o,g:t.g},n)),r}}const z=new Proxy(sg,{get(e,t){return e(t)}});function L4(){const e=sg.call({g:1},"div").apply(null,arguments);return function(n){return e(n),null}}const Ur="tc-root",Id="tc-disable-scroll",su="tc-using-mouse",P4=()=>{document.body.addEventListener("mousedown",()=>document.body.classList.add(su)),document.body.addEventListener("keydown",t=>{t.key==="Tab"&&document.body.classList.remove(su)});const e=L4` - ${Ur} * { +*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",l=0;lt in e?Um(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ct=(e,t)=>{for(var n in t||(t={}))jm.call(t,n)&&vf(e,n,t[n]);if(h0)for(var n of h0(t))Dm.call(t,n)&&vf(e,n,t[n]);return e},Qn=(e,t)=>Om(e,Bm(t)),Me=(e,t,n)=>(vf(e,typeof t!="symbol"?t+"":t,n),n),xt=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{s(n.next(c))}catch(f){o(f)}},l=c=>{try{s(n.throw(c))}catch(f){o(f)}},s=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,l);s((n=n.apply(e,t)).next())}),p0,g0,v0,m0,y0,w0,x0,C0;const Nt={};function Hm(e){Nt.context=e}const Fm=(e,t)=>e===t,wr=Symbol("solid-proxy"),mf=Symbol("solid-track"),Ua={equals:Fm};let Kp=Jp;const Xr=1,Oa=2,qp={owned:null,cleanups:null,context:null,owner:null},iu={};var rn=null;let Ko=null,Wt=null,kn=null,zr=null,Ld=0;function Tl(e,t){const n=Wt,r=rn,o=e.length===0,i=o?qp:{owned:null,cleanups:null,context:null,owner:t===void 0?r:t},l=o?e:()=>e(()=>fn(()=>kc(i)));rn=i,Wt=null;try{return Eo(l,!0)}finally{Wt=n,rn=r}}function We(e,t){t=t?Object.assign({},Ua,t):Ua;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Gp(n,o));return[Zp.bind(n),r]}function Ba(e,t,n){const r=_c(e,t,!0,Xr);Qi(r)}function nt(e,t,n){const r=_c(e,t,!1,Xr);Qi(r)}function un(e,t,n){Kp=Gm;const r=_c(e,t,!1,Xr);r.user=!0,zr?zr.push(r):Qi(r)}function de(e,t,n){n=n?Object.assign({},Ua,n):Ua;const r=_c(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Qi(r),Zp.bind(r)}function zm(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i={}):(r=e,o=t,i={});let l=null,s=iu,c=null,f=!1,d="initialValue"in i,w=typeof r=="function"&&de(r);const h=new Set,[S,C]=(i.storage||We)(i.initialValue),[_,O]=We(void 0),[b,p]=We(void 0,{equals:!1}),[y,E]=We(d?"ready":"unresolved");if(Nt.context){c=`${Nt.context.id}${Nt.context.count++}`;let P;i.ssrLoadFrom==="initial"?s=i.initialValue:Nt.load&&(P=Nt.load(c))&&(s=P[0])}function T(P,U,$,M){return l===P&&(l=null,d=!0,(P===s||U===s)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(M,{value:U})),s=iu,N(U,$)),U}function N(P,U){Eo(()=>{U===void 0&&C(()=>P),E(U!==void 0?"errored":"ready"),O(U);for(const $ of h.keys())$.decrement();h.clear()},!1)}function I(){const P=Qm,U=S(),$=_();if($!==void 0&&!l)throw $;return Wt&&!Wt.user&&P&&Ba(()=>{b(),l&&(P.resolved||h.has(P)||(P.increment(),h.add(P)))}),U}function L(P=!0){if(P!==!1&&f)return;f=!1;const U=w?w():r;if(U==null||U===!1){T(l,fn(S));return}const $=s!==iu?s:fn(()=>o(U,{value:S(),refetching:P}));return typeof $!="object"||!($&&"then"in $)?(T(l,$,void 0,U),$):(l=$,f=!0,queueMicrotask(()=>f=!1),Eo(()=>{E(d?"refreshing":"pending"),p()},!1),$.then(M=>T($,M,void 0,U),M=>T($,void 0,eg(M),U)))}return Object.defineProperties(I,{state:{get:()=>y()},error:{get:()=>_()},loading:{get(){const P=y();return P==="pending"||P==="refreshing"}},latest:{get(){if(!d)return I();const P=_();if(P&&!l)throw P;return S()}}}),w?Ba(()=>L(!1)):L(!1),[I,{refetch:L,mutate:C}]}function Qp(e){return Eo(e,!1)}function fn(e){if(Wt===null)return e();const t=Wt;Wt=null;try{return e()}finally{Wt=t}}function Vm(e,t,n){const r=Array.isArray(e);let o;return i=>{let l;if(r){l=Array(e.length);for(let c=0;ct(l,o,i));return o=l,s}}function Km(e){un(()=>fn(e))}function Rn(e){return rn===null||(rn.cleanups===null?rn.cleanups=[e]:rn.cleanups.push(e)),e}function Yp(){return Wt}function qm(){return rn}function bc(e,t){const n=Symbol("context");return{id:n,Provider:Jm(n),defaultValue:e}}function In(e){let t;return(t=ng(rn,e.id))!==void 0?t:e.defaultValue}function Sc(e){const t=de(e),n=de(()=>yf(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let Qm;function Zp(){const e=Ko;if(this.sources&&(this.state||e))if(this.state===Xr||e)Qi(this);else{const t=kn;kn=null,Eo(()=>Da(this),!1),kn=t}if(Wt){const t=this.observers?this.observers.length:0;Wt.sources?(Wt.sources.push(this),Wt.sourceSlots.push(t)):(Wt.sources=[this],Wt.sourceSlots=[t]),this.observers?(this.observers.push(Wt),this.observerSlots.push(Wt.sources.length-1)):(this.observers=[Wt],this.observerSlots=[Wt.sources.length-1])}return this.value}function Gp(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Eo(()=>{for(let o=0;o1e6)throw kn=[],new Error},!1)),t}function Qi(e){if(!e.fn)return;kc(e);const t=rn,n=Wt,r=Ld;Wt=rn=e,Ym(e,e.value,r),Wt=n,rn=t}function Ym(e,t,n){let r;try{r=e.fn(t)}catch(o){e.pure&&(e.state=Xr,e.owned&&e.owned.forEach(kc),e.owned=null),tg(o)}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Gp(e,r):e.value=r,e.updatedAt=n)}function _c(e,t,n,r=Xr,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:rn,context:null,pure:n};return rn===null||rn!==qp&&(rn.owned?rn.owned.push(i):rn.owned=[i]),i}function ja(e){const t=Ko;if(e.state===0||t)return;if(e.state===Oa||t)return Da(e);if(e.suspense&&fn(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;r--)if(e=n[r],e.state===Xr||t)Qi(e);else if(e.state===Oa||t){const o=kn;kn=null,Eo(()=>Da(e,n[0]),!1),kn=o}}function Eo(e,t){if(kn)return e();let n=!1;t||(kn=[]),zr?n=!0:zr=[],Ld++;try{const r=e();return Zm(n),r}catch(r){n||(zr=null),kn=null,tg(r)}}function Zm(e){if(kn&&(Jp(kn),kn=null),e)return;const t=zr;zr=null,t.length&&Eo(()=>Kp(t),!1)}function Jp(e){for(let t=0;to=fn(()=>(rn.context={[e]:r.value},Sc(()=>r.children))),void 0),o}}const Xm=Symbol("fallback");function b0(e){for(let t=0;t1?[]:null;return Rn(()=>b0(i)),()=>{let c=e()||[],f,d;return c[mf],fn(()=>{let h=c.length,S,C,_,O,b,p,y,E,T;if(h===0)l!==0&&(b0(i),i=[],r=[],o=[],l=0,s&&(s=[])),n.fallback&&(r=[Xm],o[0]=Tl(N=>(i[0]=N,n.fallback())),l=1);else if(l===0){for(o=new Array(h),d=0;d=p&&E>=p&&r[y]===c[E];y--,E--)_[E]=o[y],O[E]=i[y],s&&(b[E]=s[y]);for(S=new Map,C=new Array(E+1),d=E;d>=p;d--)T=c[d],f=S.get(T),C[d]=f===void 0?-1:f,S.set(T,d);for(f=p;f<=y;f++)T=r[f],d=S.get(T),d!==void 0&&d!==-1?(_[d]=o[f],O[d]=i[f],s&&(b[d]=s[f]),d=C[d],S.set(T,d)):i[f]();for(d=p;de(t||{}))}function js(){return!0}const wf={get(e,t,n){return t===wr?n:e.get(t)},has(e,t){return t===wr?!0:e.has(t)},set:js,deleteProperty:js,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:js,deleteProperty:js}},ownKeys(e){return e.keys()}};function lu(e){return(e=typeof e=="function"?e():e)?e:{}}function Lr(...e){let t=!1;for(let r=0;r=0;o--){const i=lu(e[o])[r];if(i!==void 0)return i}},has(r){for(let o=e.length-1;o>=0;o--)if(r in lu(e[o]))return!0;return!1},keys(){const r=[];for(let o=0;o=0;r--)if(e[r]){const o=Object.getOwnPropertyDescriptors(e[r]);for(const i in o)i in n||Object.defineProperty(n,i,{enumerable:!0,get(){for(let l=e.length-1;l>=0;l--){const s=(e[l]||{})[i];if(s!==void 0)return s}}})}return n}function Pd(e,...t){const n=new Set(t.flat());if(wr in e){const o=t.map(i=>new Proxy({get(l){return i.includes(l)?e[l]:void 0},has(l){return i.includes(l)&&l in e},keys(){return i.filter(l=>l in e)}},wf));return o.push(new Proxy({get(i){return n.has(i)?void 0:e[i]},has(i){return n.has(i)?!1:i in e},keys(){return Object.keys(e).filter(i=>!n.has(i))}},wf)),o}const r=Object.getOwnPropertyDescriptors(e);return t.push(Object.keys(r).filter(o=>!n.has(o))),t.map(o=>{const i={};for(let l=0;le.fallback};return de(e4(()=>e.each,e.children,t||void 0))}function je(e){let t=!1;const n=e.keyed,r=de(()=>e.when,void 0,{equals:(o,i)=>t?o===i:!o==!i});return de(()=>{const o=r();if(o){const i=e.children,l=typeof i=="function"&&i.length>0;return t=n||l,l?fn(()=>i(o)):i}return e.fallback},void 0,void 0)}function fs(e){let t=!1,n=!1;const r=(l,s)=>l[0]===s[0]&&(t?l[1]===s[1]:!l[1]==!s[1])&&l[2]===s[2],o=Sc(()=>e.children),i=de(()=>{let l=o();Array.isArray(l)||(l=[l]);for(let s=0;s{const[l,s,c]=i();if(l<0)return e.fallback;const f=c.children,d=typeof f=="function"&&f.length>0;return t=n||d,d?fn(()=>f(s)):f},void 0,void 0)}function pn(e){return e}const t4=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],n4=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...t4]),r4=new Set(["innerHTML","textContent","innerText","children"]),o4=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),S0=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),i4=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),l4=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","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"]),s4={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function a4(e,t,n){let r=n.length,o=t.length,i=r,l=0,s=0,c=t[o-1].nextSibling,f=null;for(;ld-s){const C=t[l];for(;s{o=i,t===document?e():_n(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function ot(e,t,n){if(typeof window>"u")return null;const r=document.createElement("template");r.innerHTML=e;let o=r.content.firstChild;return n&&(o=o.firstChild),o}function u4(e,t=window.document){const n=t[_0]||(t[_0]=new Set);for(let r=0,o=e.length;ro.call(e,n[1],i))}else e.addEventListener(t,n)}function h4(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,l;for(i=0,l=o.length;io.children=es(e,t.children,o.children)),nt(()=>t.ref&&t.ref(e)),nt(()=>g4(e,t,n,!0,o,!0)),o}function Al(e,t,n){return fn(()=>e(t,n))}function _n(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return es(e,t,r,n);nt(o=>es(e,t(),o,n),r)}function g4(e,t,n,r,o={},i=!1){t||(t={});for(const l in o)if(!(l in t)){if(l==="children")continue;o[l]=E0(e,l,null,o[l],n,i)}for(const l in t){if(l==="children")continue;const s=t[l];o[l]=E0(e,l,s,o[l],n,i)}}function v4(e){let t,n;return!Nt.context||!(t=Nt.registry.get(n=w4()))?e.cloneNode(!0):(Nt.completed&&Nt.completed.add(t),Nt.registry.delete(n),t)}function m4(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function k0(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o-1&&s4[t.split(":")[0]];f?f4(e,f,t,n):Ee(e,o4[t]||t,n)}return n}function y4(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),Nt.registry&&!Nt.done&&(Nt.done=!0,document.querySelectorAll("[id^=pl-]").forEach(r=>{for(;r&&r.nodeType!==8&&r.nodeValue!=="pl-"+e;){let o=r.nextSibling;r.remove(),r=o}r&&r.remove()}));n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(o!==void 0?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function es(e,t,n,r,o){for(Nt.context&&!n&&(n=[...e.childNodes]);typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,l=r!==void 0;if(e=l&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(Nt.context)return n;if(i==="number"&&(t=t.toString()),l){let s=n[0];s&&s.nodeType===3?s.data=t:s=document.createTextNode(t),n=si(e,n,r,s)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(Nt.context)return n;n=si(e,n,r)}else{if(i==="function")return nt(()=>{let s=t();for(;typeof s=="function";)s=s();n=es(e,s,n,r)}),()=>n;if(Array.isArray(t)){const s=[],c=n&&Array.isArray(n);if(xf(s,t,n,o))return nt(()=>n=es(e,s,n,r,!0)),()=>n;if(Nt.context){if(!s.length)return n;for(let f=0;f=0;l--){const s=t[l];if(o!==s){const c=s.parentNode===e;!i&&!l?c?e.replaceChild(o,s):e.insertBefore(o,n):c&&s.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function w4(){const e=Nt.context;return`${e.id}${e.count++}`}const x4="http://www.w3.org/2000/svg";function og(e,t=!1){return t?document.createElementNS(x4,e):document.createElement(e)}function ig(e){const{useShadow:t}=e,n=document.createTextNode(""),r=e.mount||document.body;function o(){if(Nt.context){const[i,l]=We(!1);return queueMicrotask(()=>l(!0)),()=>i()&&e.children}else return()=>e.children}if(r instanceof HTMLHeadElement){const[i,l]=We(!1),s=()=>l(!0);Tl(c=>_n(r,()=>i()?c():o()(),null)),Rn(()=>{Nt.context?queueMicrotask(s):s()})}else{const i=og(e.isSVG?"g":"div",e.isSVG),l=t&&i.attachShadow?i.attachShadow({mode:"open"}):i;Object.defineProperty(i,"_$host",{get(){return n.parentNode},configurable:!0}),_n(l,o()),r.appendChild(i),e.ref&&e.ref(i),Rn(()=>r.removeChild(i))}return n}function ji(e){const[t,n]=Pd(e,["component"]),r=de(()=>t.component);return de(()=>{const o=r();switch(typeof o){case"function":return fn(()=>o(n));case"string":const i=l4.has(o),l=Nt.context?v4():og(o,i);return rg(l,n,i),l}})}var $t=(e=>(e.DARK="DARK",e.LIGHT="LIGHT",e))($t||{});let C4={data:""},b4=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||C4,S4=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,_4=/\/\*[^]*?\*\/| +/g,A0=/\n+/g,Uo=(e,t)=>{let n="",r="",o="";for(let i in e){let l=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+l+";":r+=i[1]=="f"?Uo(l,i):i+"{"+Uo(l,i[1]=="k"?"":t)+"}":typeof l=="object"?r+=Uo(l,t?t.replace(/([^,])+/g,s=>i.replace(/(^:.*)|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,s):s?s+" "+c:c)):i):l!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Uo.p?Uo.p(i,l):i+":"+l+";")}return n+(t&&o?t+"{"+o+"}":o)+r},Nr={},lg=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+lg(e[n]);return t}return e},k4=(e,t,n,r,o)=>{let i=lg(e),l=Nr[i]||(Nr[i]=(c=>{let f=0,d=11;for(;f>>0;return"go"+d})(i));if(!Nr[l]){let c=i!==e?e:(f=>{let d,w,h=[{}];for(;d=S4.exec(f.replace(_4,""));)d[4]?h.shift():d[3]?(w=d[3].replace(A0," ").trim(),h.unshift(h[0][w]=h[0][w]||{})):h[0][d[1]]=d[2].replace(A0," ").trim();return h[0]})(e);Nr[l]=Uo(o?{["@keyframes "+l]:c}:c,n?"":"."+l)}let s=n&&Nr.g?Nr.g:null;return n&&(Nr.g=Nr[l]),((c,f,d,w)=>{w?f.data=f.data.replace(w,c):f.data.indexOf(c)===-1&&(f.data=d?c+f.data:f.data+c)})(Nr[l],t,r,s),l},E4=(e,t,n)=>e.reduce((r,o,i)=>{let l=t[i];if(l&&l.call){let s=l(n),c=s&&s.props&&s.props.className||/^go/.test(s)&&s;l=c?"."+c:s&&typeof s=="object"?s.props?"":Uo(s,""):s===!1?"":s}return r+o+(l??"")},"");function Zr(e){let t=this||{},n=e.call?e(t.p):e;return k4(n.unshift?n.raw?E4(n,[].slice.call(arguments,1),t.p):n.reduce((r,o)=>Object.assign(r,o&&o.call?o(t.p):o),{}):n,b4(t.target),t.g,t.o,t.k)}Zr.bind({g:1});let T4=Zr.bind({k:1});const Rd=bc();function A4(e){return m(Rd.Provider,{value:e.theme,get children(){return e.children}})}function Et(){return In(Rd)}function sg(e){let t=this||{};return(...n)=>{const r=o=>{const i=In(Rd),l=Lr(o,{theme:i}),s=Lr(l,{get class(){const S=l.class,C="class"in l&&/^go[0-9]+/.test(S);let _=Zr.apply({target:t.target,o:C,p:l,g:t.g},n);return[S,_].filter(Boolean).join(" ")}}),[c,f]=Pd(s,["as","theme"]),d=f,w=c.as||e;let h;return typeof w=="function"?h=w(d):t.g==1?(h=document.createElement(w),rg(h,d)):h=ji(Lr({component:w},d)),h};return r.class=o=>fn(()=>Zr.apply({target:t.target,p:o,g:t.g},n)),r}}const z=new Proxy(sg,{get(e,t){return e(t)}});function L4(){const e=sg.call({g:1},"div").apply(null,arguments);return function(n){return e(n),null}}const Or="tc-root",Id="tc-disable-scroll",su="tc-using-mouse",P4=()=>{document.body.addEventListener("mousedown",()=>document.body.classList.add(su)),document.body.addEventListener("keydown",t=>{t.key==="Tab"&&document.body.classList.remove(su)});const e=L4` + ${Or} * { margin: 0; padding: 0; box-sizing: border-box; @@ -71,20 +71,20 @@ PERFORMANCE OF THIS SOFTWARE. -webkit-tap-highlight-color: transparent; } - ${Ur} img { + ${Or} img { -webkit-user-select: none; -webkit-touch-callout: none; } - ${Ur} *:focus { + ${Or} *:focus { outline: #08f auto 2px; } - ${Ur} li { + ${Or} li { list-style: none; } - ${Ur} button { + ${Or} button { outline: none; } @@ -95,17 +95,17 @@ PERFORMANCE OF THIS SOFTWARE. left: 0; } - body.${su} ${Ur} *:focus { + body.${su} ${Or} *:focus { outline: none; } -`;return m(e,{})};function M4(e){e[0]==="#"&&(e=e.slice(1));const t=parseInt(e,16),n=t>>16&255,r=t>>8&255,o=t&255;return[n,r,o].join(",")}function ds(e,t){return e[0]==="#"&&(e=M4(e)),`rgba(${e}, ${t})`}function Lr(e){return e.toString()+"px"}const fl=class{constructor(){Me(this,"storage",{})}static getInstance(){return fl.instance||(fl.instance=new fl),fl.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return(t=this.storage[e])!=null?t:null}key(e){var t;const n=Object.keys(this.storage);return e<0||e>=n.length?null:(t=n[e])!=null?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}};let ag=fl;Me(ag,"instance");class qt extends Le{constructor(...t){super(...t),Object.setPrototypeOf(this,qt.prototype)}}function la(...e){try{console.debug("[TON_CONNECT_UI]",...e)}catch{}}function R4(...e){try{console.error("[TON_CONNECT_UI]",...e)}catch{}}function I4(...e){try{console.warn("[TON_CONNECT_UI]",...e)}catch{}}function Ha(e,t="_self"){la("openLink",e,t),window.open(e,t,"noopener noreferrer")}function Pt(e){Ha(e,"_blank")}function ho(e,t){const n=()=>{Xe("safari")||Sr("android")&&Xe("firefox")||t()},r=setTimeout(()=>n(),200);window.addEventListener("blur",()=>clearTimeout(r),{once:!0}),Ha(e,"_self")}function $4(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?$t.LIGHT:$t.DARK}function W4(e){const t=n=>e(n.matches?$t.DARK:$t.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}function N4(){document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=Lr(-document.documentElement.scrollTop),document.body.classList.add(Id))}function U4(){document.body.classList.remove(Id),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto"}function O4(){document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart","")}function B4(){customElements.define(Ur,class extends HTMLElement{})}function cg(e){return xt(this,null,function*(){yield new Promise(t=>requestAnimationFrame(t)),e()})}function j4(e){return xt(this,null,function*(){return yield new Promise(t=>requestAnimationFrame(t)),e()})}function ug(e){document.readyState!=="complete"?window.addEventListener("load",()=>cg(()=>ug(e)),{once:!0}):e.forEach(t=>{const n=new window.Image;n.src=t})}function eo(){if(typeof window<"u")return window}function $d(){if(D4())return localStorage;if(H4())throw new qt("`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 ag.getInstance()}function D4(){try{return typeof localStorage<"u"}catch{return!1}}function H4(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null}function Wd(){var e,t,n;const r=new xm().getResult(),o=(e=r.os.name)==null?void 0:e.toLowerCase(),i=(t=r.device.model)==null?void 0:t.toLowerCase();let l;switch(!0){case i==="ipad":l="ipad";break;case o==="ios":l="ios";break;case o==="android":l="android";break;case o==="mac os":l="macos";break;case o==="linux":l="linux";break;case(o==null?void 0:o.includes("windows")):l="windows";break}const s=(n=r.browser.name)==null?void 0:n.toLowerCase();let c;switch(!0){case s==="chrome":c="chrome";break;case s==="firefox":c="firefox";break;case(s==null?void 0:s.includes("safari")):c="safari";break;case(s==null?void 0:s.includes("opera")):c="opera";break}return{os:l,browser:c}}function Sr(...e){return e.includes(Wd().os)}function Xe(...e){return e.includes(Wd().browser)}function Ds(e,t){const n=new URL(e);return t+n.search}class F4{constructor(){Me(this,"localStorage"),Me(this,"storageKey","ton-connect-ui_wallet-info"),this.localStorage=$d()}setWalletInfo(t){this.localStorage.setItem(this.storageKey,JSON.stringify(t))}getWalletInfo(){const t=this.localStorage.getItem(this.storageKey);return t?JSON.parse(t):null}removeWalletInfo(){this.localStorage.removeItem(this.storageKey)}}class z4{constructor(){Me(this,"localStorage"),Me(this,"storageKey","ton-connect-ui_preferred-wallet"),this.localStorage=$d()}setPreferredWalletAppName(t){this.localStorage.setItem(this.storageKey,t)}getPreferredWalletAppName(){return this.localStorage.getItem(this.storageKey)||void 0}}class fg{constructor(){Me(this,"localStorage"),Me(this,"storageKey","ton-connect-ui_last-selected-wallet-info"),this.localStorage=$d()}setLastSelectedWalletInfo(t){this.localStorage.setItem(this.storageKey,JSON.stringify(t))}getLastSelectedWalletInfo(){const t=this.localStorage.getItem(this.storageKey);return t?JSON.parse(t):null}removeLastSelectedWalletInfo(){this.localStorage.removeItem(this.storageKey)}}const[Cf,L0]=Ne({status:"closed",closeReason:null}),P0=de(()=>Cf().status==="opened"),[Fa,M0]=Ne({status:"closed",closeReason:null}),R0=de(()=>Fa().status==="opened"),V4=de(()=>{const e=Fa();return e.status==="opened"?e.walletInfo:null});let bi=typeof window<"u"?new fg:void 0;const[K4,q4]=Ne((bi==null?void 0:bi.getLastSelectedWalletInfo())||null),gn=e=>{bi||(bi=new fg),e?bi.setLastSelectedWalletInfo(e):bi.removeLastSelectedWalletInfo(),q4(e)},[Or,Si]=Ne(null),Q4={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"},Y4={connectWallet:"Connect Wallet",dropdown:{copy:"Copy address",copied:"Address copied!",disconnect:"Disconnect"}},Z4={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."}},G4={walletOn:"Wallet On",recent:"Recent",installed:"Installed",popular:"Popular"},J4={loading:"Loading wallets",wallets:"Wallets",mobileUniversalModal:{connectYourWallet:"Connect your wallet",openWalletOnTelegramOrSelect:"Open Wallet in Telegram or select your wallet to connect",openWalletOnTelegram:"Open Wallet in Telegram",openLink:"Open Link",scan:"Scan with your mobile wallet"},desktopUniversalModal:{connectYourWallet:"Connect your 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",continueIn:"Continue in {{ name }}…",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",getWallet:"Get {{ name }}",continueOnDesktop:"Continue in {{ name }} on desktop…",openWalletOnTelegram:"Open 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"}},X4={confirmTransaction:{header:"Confirm the transaction in {{ name }}",text:"It will only take a moment."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"},e6={common:Q4,button:Y4,notifications:Z4,walletItem:G4,walletModal:J4,actionModal:X4},t6={close:"Закрыть",openWallet:"Открыть кошелёк",copyLink:"Копировать ссылку",linkCopied:"Ссылка скопирована",copied:"Ссылка скопирована",yourWallet:"Ваш кошелёк",retry:"Повторить",get:"Скачать",mobile:"Мобильный",browserExtension:"Расширение",desktop:"Десктоп"},n6={connectWallet:"Подключить кошелёк",dropdown:{copy:"Скопировать адрес",copied:"Адрес скопирован!",disconnect:"Отключить кошелёк"}},r6={confirm:{header:"Откройте {{ name }}, чтобы подтвердить транзакцию."},transactionSent:{header:"Транзакция отправлена",text:"Ваша транзакция будет обработана через несколько секунд."},transactionCanceled:{header:"Транзакция отменена",text:"Состояние вашего счёта не изменится."}},o6={walletOn:"Wallet в",recent:"Недавний",installed:"Установлен",popular:"Популярен"},i6={loading:"Кошельки загружаются",wallets:"Кошельки",mobileUniversalModal:{connectYourWallet:"Подключите кошелёк",openWalletOnTelegramOrSelect:"Подключите Wallet в Telegram или выберете кошелёк для подключения",openWalletOnTelegram:"Открыть Wallet в Telegram",openLink:"Открыть ссылку",scan:"Отсканируйте камерой вашего телефона"},desktopUniversalModal:{connectYourWallet:"Подключите кошелёк",scan:"Отсканируйте QR-код камерой вашего телефона",availableWallets:"Доступные кошельки"},mobileConnectionModal:{showQR:"Показать QR-код",scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueIn:"Продолжите в {{ name }}…",connectionDeclined:"Подключение отклонено"},desktopConnectionModal:{scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueInExtension:"Откройте браузерное расширение {{ name }}",dontHaveExtension:"Похоже, у вас не установлено браузерное расширение {{ name }}",getWallet:"Скачать {{ name }}",continueOnDesktop:"Откройте {{ name }} на компьютере…",openWalletOnTelegram:"Открыть Wallet в Telegram",connectionDeclined:"Подключение отклонено"},infoModal:{whatIsAWallet:"Что такое кошелёк?",secureDigitalAssets:"Надежное хранилище цифровых активов",walletProtects:"Кошелёк защищает ваши цифровые активы, включая TON, токены и предметы коллекционирования, и управляет ими.",controlIdentity:"Контроль своей личности Web3",manageIdentity:"Управляйте своей цифровой идентификацией и с легкостью получайте доступ к децентрализованным приложениям. Сохраняйте контроль над своими данными и безопасно участвуйте в экосистеме блокчейна.",effortlessCryptoTransactions:"Простые криптотранзакции",easilySend:"Легко отправляйте, получайте и отслеживайте свои криптовалюты. Оптимизируйте свои операции с помощью децентрализованных приложений.",getAWallet:"Скачать кошелёк"}},l6={confirmTransaction:{header:"Подтвердите действие в {{ name }}",text:"Это займет пару секунд."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"},s6={common:t6,button:n6,notifications:r6,walletItem:o6,walletModal:i6,actionModal:l6},a6={en:I0(e6),ru:I0(s6)};function I0(e){const t="$",n=r=>{Object.entries(r).forEach(([o,i])=>{if(typeof i=="object"&&i)return n(i);if(typeof i=="string"){if(i[0]===t){const l=i.slice(1).split(".");let s=e;l.forEach(c=>{if(c in s)s=s[c];else throw new Error(`Cannot parse translations: there is no property ${c} in translation`)}),r[o]=s}i.slice(0,2)===`\\${t}`&&(r[o]=i.slice(1))}})};return n(e),e}const Yi=bc(),bf=Symbol("store-raw"),ts=Symbol("store-node"),c6=Symbol("store-name");function dg(e,t){let n=e[yr];if(!n&&(Object.defineProperty(e,yr,{value:n=new Proxy(e,d6)}),!Array.isArray(e))){const r=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let i=0,l=r.length;ie[yr][t]),n}function hg(e){if(Yp()){const t=Nd(e);(t._||(t._=pg()))()}}function f6(e){return hg(e),Reflect.ownKeys(e)}function pg(e){const[t,n]=Ne(e,{equals:!1,internal:!0});return t.$=n,t}const d6={get(e,t,n){if(t===bf)return e;if(t===yr)return n;if(t===mf)return hg(e),n;const r=Nd(e),o=r.hasOwnProperty(t);let i=o?r[t]():e[t];if(t===ts||t==="__proto__")return i;if(!o){const l=Object.getOwnPropertyDescriptor(e,t);Yp()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(l&&l.get)&&(i=Sf(r,t,i)())}return za(i)?dg(i):i},has(e,t){return t===bf||t===yr||t===mf||t===ts||t==="__proto__"?!0:(this.get(e,t,e),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:f6,getOwnPropertyDescriptor:u6};function Va(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?delete e[t]:e[t]=n;let l=Nd(e),s;(s=Sf(l,t,o))&&s.$(()=>n),Array.isArray(e)&&e.length!==i&&(s=Sf(l,"length",i))&&s.$(e.length),(s=l._)&&s.$()}function gg(e,t){const n=Object.keys(t);for(let r=0;r1){r=t.shift();const l=typeof r,s=Array.isArray(e);if(Array.isArray(r)){for(let c=0;c1){dl(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=Di(i),r===void 0||za(o)&&za(i)&&!Array.isArray(i)?gg(o,i):Va(e,r,i))}function Ud(...[e,t]){const n=Di(e||{}),r=Array.isArray(n),o=dg(n);function i(...l){Qp(()=>{r&&l.length===1?h6(n,l[0]):dl(n,l)})}return[o,i]}const vg={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"}},p6={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"}};/*! +`;return m(e,{})};function M4(e){e[0]==="#"&&(e=e.slice(1));const t=parseInt(e,16),n=t>>16&255,r=t>>8&255,o=t&255;return[n,r,o].join(",")}function ds(e,t){return e[0]==="#"&&(e=M4(e)),`rgba(${e}, ${t})`}function Pr(e){return e.toString()+"px"}const fl=class{constructor(){Me(this,"storage",{})}static getInstance(){return fl.instance||(fl.instance=new fl),fl.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){var t;return(t=this.storage[e])!=null?t:null}key(e){var t;const n=Object.keys(this.storage);return e<0||e>=n.length?null:(t=n[e])!=null?t:null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}};let ag=fl;Me(ag,"instance");class qt extends Le{constructor(...t){super(...t),Object.setPrototypeOf(this,qt.prototype)}}function la(...e){try{console.debug("[TON_CONNECT_UI]",...e)}catch{}}function R4(...e){try{console.error("[TON_CONNECT_UI]",...e)}catch{}}function I4(...e){try{console.warn("[TON_CONNECT_UI]",...e)}catch{}}function Ha(e,t="_self"){la("openLink",e,t),window.open(e,t,"noopener noreferrer")}function Pt(e){Ha(e,"_blank")}function ho(e,t){const n=()=>{Xe("safari")||_r("android")&&Xe("firefox")||t()},r=setTimeout(()=>n(),200);window.addEventListener("blur",()=>clearTimeout(r),{once:!0}),Ha(e,"_self")}function $4(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?$t.LIGHT:$t.DARK}function N4(e){const t=n=>e(n.matches?$t.DARK:$t.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}function W4(){document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=Pr(-document.documentElement.scrollTop),document.body.classList.add(Id))}function U4(){document.body.classList.remove(Id),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto"}function O4(){document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart","")}function B4(){customElements.define(Or,class extends HTMLElement{})}function cg(e){return xt(this,null,function*(){yield new Promise(t=>requestAnimationFrame(t)),e()})}function j4(e){return xt(this,null,function*(){return yield new Promise(t=>requestAnimationFrame(t)),e()})}function ug(e){document.readyState!=="complete"?window.addEventListener("load",()=>cg(()=>ug(e)),{once:!0}):e.forEach(t=>{const n=new window.Image;n.src=t})}function eo(){if(typeof window<"u")return window}function $d(){if(D4())return localStorage;if(H4())throw new qt("`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 ag.getInstance()}function D4(){try{return typeof localStorage<"u"}catch{return!1}}function H4(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null}function Nd(){var e,t,n;const r=new xm().getResult(),o=(e=r.os.name)==null?void 0:e.toLowerCase(),i=(t=r.device.model)==null?void 0:t.toLowerCase();let l;switch(!0){case i==="ipad":l="ipad";break;case o==="ios":l="ios";break;case o==="android":l="android";break;case o==="mac os":l="macos";break;case o==="linux":l="linux";break;case(o==null?void 0:o.includes("windows")):l="windows";break}const s=(n=r.browser.name)==null?void 0:n.toLowerCase();let c;switch(!0){case s==="chrome":c="chrome";break;case s==="firefox":c="firefox";break;case(s==null?void 0:s.includes("safari")):c="safari";break;case(s==null?void 0:s.includes("opera")):c="opera";break}return{os:l,browser:c}}function _r(...e){return e.includes(Nd().os)}function Xe(...e){return e.includes(Nd().browser)}function Ds(e,t){const n=new URL(e);return t+n.search}class F4{constructor(){Me(this,"localStorage"),Me(this,"storageKey","ton-connect-ui_wallet-info"),this.localStorage=$d()}setWalletInfo(t){this.localStorage.setItem(this.storageKey,JSON.stringify(t))}getWalletInfo(){const t=this.localStorage.getItem(this.storageKey);return t?JSON.parse(t):null}removeWalletInfo(){this.localStorage.removeItem(this.storageKey)}}class z4{constructor(){Me(this,"localStorage"),Me(this,"storageKey","ton-connect-ui_preferred-wallet"),this.localStorage=$d()}setPreferredWalletAppName(t){this.localStorage.setItem(this.storageKey,t)}getPreferredWalletAppName(){return this.localStorage.getItem(this.storageKey)||void 0}}class fg{constructor(){Me(this,"localStorage"),Me(this,"storageKey","ton-connect-ui_last-selected-wallet-info"),this.localStorage=$d()}setLastSelectedWalletInfo(t){this.localStorage.setItem(this.storageKey,JSON.stringify(t))}getLastSelectedWalletInfo(){const t=this.localStorage.getItem(this.storageKey);return t?JSON.parse(t):null}removeLastSelectedWalletInfo(){this.localStorage.removeItem(this.storageKey)}}const[Cf,L0]=We({status:"closed",closeReason:null}),P0=de(()=>Cf().status==="opened"),[Fa,M0]=We({status:"closed",closeReason:null}),R0=de(()=>Fa().status==="opened"),V4=de(()=>{const e=Fa();return e.status==="opened"?e.walletInfo:null});let bi=typeof window<"u"?new fg:void 0;const[K4,q4]=We((bi==null?void 0:bi.getLastSelectedWalletInfo())||null),gn=e=>{bi||(bi=new fg),e?bi.setLastSelectedWalletInfo(e):bi.removeLastSelectedWalletInfo(),q4(e)},[Br,Si]=We(null),Q4={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"},Y4={connectWallet:"Connect Wallet",dropdown:{copy:"Copy address",copied:"Address copied!",disconnect:"Disconnect"}},Z4={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."}},G4={walletOn:"Wallet On",recent:"Recent",installed:"Installed",popular:"Popular"},J4={loading:"Loading wallets",wallets:"Wallets",mobileUniversalModal:{connectYourWallet:"Connect your wallet",openWalletOnTelegramOrSelect:"Open Wallet in Telegram or select your wallet to connect",openWalletOnTelegram:"Open Wallet in Telegram",openLink:"Open Link",scan:"Scan with your mobile wallet"},desktopUniversalModal:{connectYourWallet:"Connect your 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",continueIn:"Continue in {{ name }}…",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",getWallet:"Get {{ name }}",continueOnDesktop:"Continue in {{ name }} on desktop…",openWalletOnTelegram:"Open 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"}},X4={confirmTransaction:{header:"Confirm the transaction in {{ name }}",text:"It will only take a moment."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"},e6={common:Q4,button:Y4,notifications:Z4,walletItem:G4,walletModal:J4,actionModal:X4},t6={close:"Закрыть",openWallet:"Открыть кошелёк",copyLink:"Копировать ссылку",linkCopied:"Ссылка скопирована",copied:"Ссылка скопирована",yourWallet:"Ваш кошелёк",retry:"Повторить",get:"Скачать",mobile:"Мобильный",browserExtension:"Расширение",desktop:"Десктоп"},n6={connectWallet:"Подключить кошелёк",dropdown:{copy:"Скопировать адрес",copied:"Адрес скопирован!",disconnect:"Отключить кошелёк"}},r6={confirm:{header:"Откройте {{ name }}, чтобы подтвердить транзакцию."},transactionSent:{header:"Транзакция отправлена",text:"Ваша транзакция будет обработана через несколько секунд."},transactionCanceled:{header:"Транзакция отменена",text:"Состояние вашего счёта не изменится."}},o6={walletOn:"Wallet в",recent:"Недавний",installed:"Установлен",popular:"Популярен"},i6={loading:"Кошельки загружаются",wallets:"Кошельки",mobileUniversalModal:{connectYourWallet:"Подключите кошелёк",openWalletOnTelegramOrSelect:"Подключите Wallet в Telegram или выберете кошелёк для подключения",openWalletOnTelegram:"Открыть Wallet в Telegram",openLink:"Открыть ссылку",scan:"Отсканируйте камерой вашего телефона"},desktopUniversalModal:{connectYourWallet:"Подключите кошелёк",scan:"Отсканируйте QR-код камерой вашего телефона",availableWallets:"Доступные кошельки"},mobileConnectionModal:{showQR:"Показать QR-код",scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueIn:"Продолжите в {{ name }}…",connectionDeclined:"Подключение отклонено"},desktopConnectionModal:{scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueInExtension:"Откройте браузерное расширение {{ name }}",dontHaveExtension:"Похоже, у вас не установлено браузерное расширение {{ name }}",getWallet:"Скачать {{ name }}",continueOnDesktop:"Откройте {{ name }} на компьютере…",openWalletOnTelegram:"Открыть Wallet в Telegram",connectionDeclined:"Подключение отклонено"},infoModal:{whatIsAWallet:"Что такое кошелёк?",secureDigitalAssets:"Надежное хранилище цифровых активов",walletProtects:"Кошелёк защищает ваши цифровые активы, включая TON, токены и предметы коллекционирования, и управляет ими.",controlIdentity:"Контроль своей личности Web3",manageIdentity:"Управляйте своей цифровой идентификацией и с легкостью получайте доступ к децентрализованным приложениям. Сохраняйте контроль над своими данными и безопасно участвуйте в экосистеме блокчейна.",effortlessCryptoTransactions:"Простые криптотранзакции",easilySend:"Легко отправляйте, получайте и отслеживайте свои криптовалюты. Оптимизируйте свои операции с помощью децентрализованных приложений.",getAWallet:"Скачать кошелёк"}},l6={confirmTransaction:{header:"Подтвердите действие в {{ name }}",text:"Это займет пару секунд."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"},s6={common:t6,button:n6,notifications:r6,walletItem:o6,walletModal:i6,actionModal:l6},a6={en:I0(e6),ru:I0(s6)};function I0(e){const t="$",n=r=>{Object.entries(r).forEach(([o,i])=>{if(typeof i=="object"&&i)return n(i);if(typeof i=="string"){if(i[0]===t){const l=i.slice(1).split(".");let s=e;l.forEach(c=>{if(c in s)s=s[c];else throw new Error(`Cannot parse translations: there is no property ${c} in translation`)}),r[o]=s}i.slice(0,2)===`\\${t}`&&(r[o]=i.slice(1))}})};return n(e),e}const Yi=bc(),bf=Symbol("store-raw"),ts=Symbol("store-node"),c6=Symbol("store-name");function dg(e,t){let n=e[wr];if(!n&&(Object.defineProperty(e,wr,{value:n=new Proxy(e,d6)}),!Array.isArray(e))){const r=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let i=0,l=r.length;ie[wr][t]),n}function hg(e){if(Yp()){const t=Wd(e);(t._||(t._=pg()))()}}function f6(e){return hg(e),Reflect.ownKeys(e)}function pg(e){const[t,n]=We(e,{equals:!1,internal:!0});return t.$=n,t}const d6={get(e,t,n){if(t===bf)return e;if(t===wr)return n;if(t===mf)return hg(e),n;const r=Wd(e),o=r.hasOwnProperty(t);let i=o?r[t]():e[t];if(t===ts||t==="__proto__")return i;if(!o){const l=Object.getOwnPropertyDescriptor(e,t);Yp()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(l&&l.get)&&(i=Sf(r,t,i)())}return za(i)?dg(i):i},has(e,t){return t===bf||t===wr||t===mf||t===ts||t==="__proto__"?!0:(this.get(e,t,e),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:f6,getOwnPropertyDescriptor:u6};function Va(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?delete e[t]:e[t]=n;let l=Wd(e),s;(s=Sf(l,t,o))&&s.$(()=>n),Array.isArray(e)&&e.length!==i&&(s=Sf(l,"length",i))&&s.$(e.length),(s=l._)&&s.$()}function gg(e,t){const n=Object.keys(t);for(let r=0;r1){r=t.shift();const l=typeof r,s=Array.isArray(e);if(Array.isArray(r)){for(let c=0;c1){dl(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=Di(i),r===void 0||za(o)&&za(i)&&!Array.isArray(i)?gg(o,i):Va(e,r,i))}function Ud(...[e,t]){const n=Di(e||{}),r=Array.isArray(n),o=dg(n);function i(...l){Qp(()=>{r&&l.length===1?h6(n,l[0]):dl(n,l)})}return[o,i]}const vg={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"}},p6={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"}};/*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */function $0(e){return Object.prototype.toString.call(e)==="[object Object]"}function g6(e){var t,n;return $0(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!($0(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}function bo(e,t){return e?Wm(t,e,{arrayMerge:(r,o,i)=>o,isMergeableObject:g6}):t}const[v6,Od]=Ud({theme:$t.LIGHT,colors:vg,borderRadius:"m"}),mg={[$t.LIGHT]:vg,[$t.DARK]:p6},br={[$t.LIGHT]:void 0,[$t.DARK]:void 0};function au(e,t){t&&(br[$t.DARK]=bo(t[$t.DARK],br[$t.DARK]),br[$t.LIGHT]=bo(t[$t.LIGHT],br[$t.LIGHT])),Od({theme:e,colors:bo(br[e],mg[e])})}function m6(e){Od({borderRadius:e})}function y6(e){br[$t.DARK]=bo(e[$t.DARK],br[$t.DARK]),br[$t.LIGHT]=bo(e[$t.LIGHT],br[$t.LIGHT]),Od(t=>({colors:bo(br[t.theme],mg[t.theme])}))}const w6=z.div` + */function $0(e){return Object.prototype.toString.call(e)==="[object Object]"}function g6(e){var t,n;return $0(e)===!1?!1:(t=e.constructor,t===void 0?!0:(n=t.prototype,!($0(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)))}function bo(e,t){return e?Nm(t,e,{arrayMerge:(r,o,i)=>o,isMergeableObject:g6}):t}const[v6,Od]=Ud({theme:$t.LIGHT,colors:vg,borderRadius:"m"}),mg={[$t.LIGHT]:vg,[$t.DARK]:p6},Sr={[$t.LIGHT]:void 0,[$t.DARK]:void 0};function au(e,t){t&&(Sr[$t.DARK]=bo(t[$t.DARK],Sr[$t.DARK]),Sr[$t.LIGHT]=bo(t[$t.LIGHT],Sr[$t.LIGHT])),Od({theme:e,colors:bo(Sr[e],mg[e])})}function m6(e){Od({borderRadius:e})}function y6(e){Sr[$t.DARK]=bo(e[$t.DARK],Sr[$t.DARK]),Sr[$t.LIGHT]=bo(e[$t.LIGHT],Sr[$t.LIGHT]),Od(t=>({colors:bo(Sr[t.theme],mg[t.theme])}))}const w6=z.div` background-color: ${e=>e.theme.colors.background.secondary}; -`,ri=e=>{let t;const[n,r]=Ne(null);return cn(()=>{const o=new window.Image;return o.src=e.src,o.alt=e.alt||"",o.setAttribute("draggable","false"),e.class&&o.classList.add(e.class),o.complete?r(o):(o.addEventListener("load",()=>r(o)),()=>o.removeEventListener("load",()=>r(o)))}),[m(je,{get when(){return n()},get children(){return n()}}),m(je,{get when(){return!n()},get children(){return m(w6,{get class(){return e.class},ref(o){const i=t;typeof i=="function"?i(o):t=o}})}})]};let qo={};try{let e=location.hash.toString();qo=x6(e)}catch{}let ns="unknown";qo!=null&&qo.tgWebAppPlatform&&(ns=(p0=qo.tgWebAppPlatform)!=null?p0:"unknown");if(ns==="unknown"){const e=eo();ns=(m0=(v0=(g0=e==null?void 0:e.Telegram)==null?void 0:g0.WebApp)==null?void 0:v0.platform)!=null?m0:"unknown"}let Ka="6.0";qo!=null&&qo.tgWebAppVersion&&(Ka=qo.tgWebAppVersion);if(!Ka){const e=eo();Ka=(x0=(w0=(y0=e==null?void 0:e.Telegram)==null?void 0:y0.WebApp)==null?void 0:w0.version)!=null?x0:"6.0"}function Dr(...e){return e.includes(ns)}function Gr(){var e;return ns!=="unknown"||!!((e=eo())!=null&&e.TelegramWebviewProxy)}function Bd(){wg("web_app_expand",{})}function hl(e,t){const n=new URL(e);if(n.protocol!=="http:"&&n.protocol!=="https:"){if(t)return t();throw new qt(`Url protocol is not supported: ${n}`)}if(n.hostname!=="t.me"){if(t)return t();throw new qt(`Url host is not supported: ${n}`)}const r=n.pathname+n.search;yg()||S6("6.1")?wg("web_app_open_tg_link",{path_full:r}):Pt("https://t.me"+r)}function yg(){try{const e=eo();return e?e.parent!=null&&e!==e.parent:!1}catch{return!1}}function wg(e,t){try{const n=eo();if(!n)throw new qt("Can't post event to parent window: window is not defined");if(n.TelegramWebviewProxy!==void 0)la("postEvent",e,t),n.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(n.external&&"notify"in n.external)la("postEvent",e,t),n.external.notify(JSON.stringify({eventType:e,eventData:t}));else if(yg()){const r="*",o=JSON.stringify({eventType:e,eventData:t});la("postEvent",e,t),n.parent.postMessage(o,r)}else throw new qt("Can't post event to TMA")}catch(n){R4(`Can't post event to parent window: ${n}`)}}function x6(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=qa(e),t;let n=e.indexOf("?");if(n>=0){let o=e.substr(0,n);t._path=qa(o),e=e.substr(n+1)}let r=C6(e);for(let o in r)t[o]=r[o];return t}function qa(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch{return e}}function C6(e){let t={};if(!e.length)return t;let n=e.split("&"),r,o,i,l;for(r=0;rs?1:-1;return 0}function S6(e){return b6(Ka,e)>=0}const Do={mobile:440,tablet:1020};function _i(e){const t=eo();if(!t)return e==="desktop";if(Dr("weba"))return!0;const n=t.innerWidth;switch(e){case"desktop":return n>Do.tablet;case"tablet":return n>Do.mobile;default:case"mobile":return n<=Do.mobile||Sr("ios","android","ipad")}}function er(e){switch(e){case"mobile":return`@media (max-width: ${Do.mobile}px)`;case"tablet":return`@media (max-width: ${Do.tablet}px) (min-width: ${Do.mobile}px)`;default:case"desktop":return`@media (min-width: ${Do.tablet}px)`}}const hs="@media (hover: none)",ps="@media not all and (hover: none)",_6={m:"100vh",s:"8px",none:"0"},cu={s:.02,m:.04},k6=z.button` +`,ri=e=>{let t;const[n,r]=We(null);return un(()=>{const o=new window.Image;return o.src=e.src,o.alt=e.alt||"",o.setAttribute("draggable","false"),e.class&&o.classList.add(e.class),o.complete?r(o):(o.addEventListener("load",()=>r(o)),()=>o.removeEventListener("load",()=>r(o)))}),[m(je,{get when(){return n()},get children(){return n()}}),m(je,{get when(){return!n()},get children(){return m(w6,{get class(){return e.class},ref(o){const i=t;typeof i=="function"?i(o):t=o}})}})]};let qo={};try{let e=location.hash.toString();qo=x6(e)}catch{}let ns="unknown";qo!=null&&qo.tgWebAppPlatform&&(ns=(p0=qo.tgWebAppPlatform)!=null?p0:"unknown");if(ns==="unknown"){const e=eo();ns=(m0=(v0=(g0=e==null?void 0:e.Telegram)==null?void 0:g0.WebApp)==null?void 0:v0.platform)!=null?m0:"unknown"}let Ka="6.0";qo!=null&&qo.tgWebAppVersion&&(Ka=qo.tgWebAppVersion);if(!Ka){const e=eo();Ka=(x0=(w0=(y0=e==null?void 0:e.Telegram)==null?void 0:y0.WebApp)==null?void 0:w0.version)!=null?x0:"6.0"}function Hr(...e){return e.includes(ns)}function Gr(){var e;return ns!=="unknown"||!!((e=eo())!=null&&e.TelegramWebviewProxy)}function Bd(){wg("web_app_expand",{})}function hl(e,t){const n=new URL(e);if(n.protocol!=="http:"&&n.protocol!=="https:"){if(t)return t();throw new qt(`Url protocol is not supported: ${n}`)}if(n.hostname!=="t.me"){if(t)return t();throw new qt(`Url host is not supported: ${n}`)}const r=n.pathname+n.search;yg()||S6("6.1")?wg("web_app_open_tg_link",{path_full:r}):Pt("https://t.me"+r)}function yg(){try{const e=eo();return e?e.parent!=null&&e!==e.parent:!1}catch{return!1}}function wg(e,t){try{const n=eo();if(!n)throw new qt("Can't post event to parent window: window is not defined");if(n.TelegramWebviewProxy!==void 0)la("postEvent",e,t),n.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(n.external&&"notify"in n.external)la("postEvent",e,t),n.external.notify(JSON.stringify({eventType:e,eventData:t}));else if(yg()){const r="*",o=JSON.stringify({eventType:e,eventData:t});la("postEvent",e,t),n.parent.postMessage(o,r)}else throw new qt("Can't post event to TMA")}catch(n){R4(`Can't post event to parent window: ${n}`)}}function x6(e){e=e.replace(/^#/,"");let t={};if(!e.length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=qa(e),t;let n=e.indexOf("?");if(n>=0){let o=e.substr(0,n);t._path=qa(o),e=e.substr(n+1)}let r=C6(e);for(let o in r)t[o]=r[o];return t}function qa(e){try{return e=e.replace(/\+/g,"%20"),decodeURIComponent(e)}catch{return e}}function C6(e){let t={};if(!e.length)return t;let n=e.split("&"),r,o,i,l;for(r=0;rs?1:-1;return 0}function S6(e){return b6(Ka,e)>=0}const Do={mobile:440,tablet:1020};function _i(e){const t=eo();if(!t)return e==="desktop";if(Hr("weba"))return!0;const n=t.innerWidth;switch(e){case"desktop":return n>Do.tablet;case"tablet":return n>Do.mobile;default:case"mobile":return n<=Do.mobile||_r("ios","android","ipad")}}function er(e){switch(e){case"mobile":return`@media (max-width: ${Do.mobile}px)`;case"tablet":return`@media (max-width: ${Do.tablet}px) (min-width: ${Do.mobile}px)`;default:case"desktop":return`@media (min-width: ${Do.tablet}px)`}}const hs="@media (hover: none)",ps="@media not all and (hover: none)",_6={m:"100vh",s:"8px",none:"0"},cu={s:.02,m:.04},k6=z.button` display: ${e=>e.leftIcon||e.rightIcon?"flex":"inline-block"}; gap: ${e=>e.leftIcon||e.rightIcon?"6px":"unset"}; align-items: ${e=>e.leftIcon||e.rightIcon?"center":"unset"}; @@ -141,10 +141,10 @@ PERFORMANCE OF THIS SOFTWARE. transform: ${e=>e.disabled?"unset":`scale(${1-cu[e.scale]*2})`}; } } -`;function gs(e){const t=un(()=>Object.keys(e).filter(r=>r.startsWith("data-"))),[n]=Pd(e,t);return n}const Yt=e=>{const t=gs(e);return m(k6,Ar({get appearance(){return e.appearance||"primary"},get class(){return e.class},onClick:n=>{var r;return(r=e.onClick)==null?void 0:r.call(e,n)},onMouseEnter:n=>{var r;return(r=e.onMouseEnter)==null?void 0:r.call(e,n)},onMouseLeave:n=>{var r;return(r=e.onMouseLeave)==null?void 0:r.call(e,n)},ref(n){const r=e.ref;typeof r=="function"?r(n):e.ref=n},get disabled(){return e.disabled},get scale(){return e.scale||"m"},get leftIcon(){return!!e.leftIcon},get rightIcon(){return!!e.rightIcon},"data-tc-button":"true"},t,{get children(){return[de(()=>e.leftIcon),de(()=>e.children),de(()=>e.rightIcon)]}}))};function Qa(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}const jd=e=>{let t,n=!0;const[r,o]=Ne(),[i,l]=Ne(),s=Sc(()=>e.children),{onBeforeEnter:c,onEnter:f,onAfterEnter:d,onBeforeExit:w,onExit:h,onAfterExit:S}=e,C=de(()=>{const b=e.name||"s";return{enterActiveClass:e.enterActiveClass||b+"-enter-active",enterClass:e.enterClass||b+"-enter",enterToClass:e.enterToClass||b+"-enter-to",exitActiveClass:e.exitActiveClass||b+"-exit-active",exitClass:e.exitClass||b+"-exit",exitToClass:e.exitToClass||b+"-exit-to"}});function _(b,p){if(!n||e.appear){let y=function(I){b&&(!I||I.target===b)&&(b.removeEventListener("transitionend",y),b.removeEventListener("animationend",y),b.classList.remove(...T),b.classList.remove(...W),Qp(()=>{r()!==b&&o(b),i()===b&&l(void 0)}),d&&d(b),e.mode==="inout"&&O(b,p))};const E=C().enterClass.split(" "),T=C().enterActiveClass.split(" "),W=C().enterToClass.split(" ");c&&c(b),b.classList.add(...E),b.classList.add(...T),Qa(()=>{b.classList.remove(...E),b.classList.add(...W),f&&f(b,()=>y()),(!f||f.length<2)&&(b.addEventListener("transitionend",y),b.addEventListener("animationend",y))})}p&&!e.mode?l(b):o(b)}function O(b,p){const y=C().exitClass.split(" "),E=C().exitActiveClass.split(" "),T=C().exitToClass.split(" ");if(!p.parentNode)return W();w&&w(p),p.classList.add(...y),p.classList.add(...E),Qa(()=>{p.classList.remove(...y),p.classList.add(...T)}),h&&h(p,()=>W()),(!h||h.length<2)&&(p.addEventListener("transitionend",W),p.addEventListener("animationend",W));function W(I){(!I||I.target===p)&&(p.removeEventListener("transitionend",W),p.removeEventListener("animationend",W),p.classList.remove(...E),p.classList.remove(...T),r()===p&&o(void 0),S&&S(p),e.mode==="outin"&&_(b,p))}}return Ba(b=>{for(t=s();typeof t=="function";)t=t();return un(()=>(t&&t!==b&&(e.mode!=="outin"?_(t,b):n&&o(t)),b&&b!==t&&e.mode!=="inout"&&O(t,b),n=!1,t))}),[r,i]};function Hs(e){const{top:t,bottom:n,left:r,right:o,width:i,height:l}=e.getBoundingClientRect(),s=e.parentNode.getBoundingClientRect();return{top:t-s.top,bottom:n,left:r-s.left,right:o,width:i,height:l}}const E6=e=>{const t=Sc(()=>e.children),n=de(()=>{const S=e.name||"s";return{enterActiveClass:e.enterActiveClass||S+"-enter-active",enterClass:e.enterClass||S+"-enter",enterToClass:e.enterToClass||S+"-enter-to",exitActiveClass:e.exitActiveClass||S+"-exit-active",exitClass:e.exitClass||S+"-exit",exitToClass:e.exitToClass||S+"-exit-to",moveClass:e.moveClass||S+"-move"}}),{onBeforeEnter:r,onEnter:o,onAfterEnter:i,onBeforeExit:l,onExit:s,onAfterExit:c}=e,[f,d]=Ne();let w=[],h=!0;return Ba(()=>{const S=t(),C=[...S],_=new Set(S),O=new Set(w),b=n().enterClass.split(" "),p=n().enterActiveClass.split(" "),y=n().enterToClass.split(" "),E=n().exitClass.split(" "),T=n().exitActiveClass.split(" "),W=n().exitToClass.split(" ");for(let I=0;I{L.classList.remove(...b),L.classList.add(...y),o&&o(L,()=>P()),(!o||o.length<2)&&(L.addEventListener("transitionend",P),L.addEventListener("animationend",P))})}}for(let I=0;I$!==L),d(w))};C.splice(I,0,L),l&&l(L),L.classList.add(...E),L.classList.add(...T),Qa(()=>{L.classList.remove(...E),L.classList.add(...W)}),s&&s(L,()=>P()),(!s||s.length<2)&&(L.addEventListener("transitionend",P),L.addEventListener("animationend",P))}}w=C,d(C)}),cn(S=>{const C=f();return C.forEach(_=>{let O;(O=S.get(_))?O.new&&(O.new=!1,O.newPos=Hs(_)):S.set(_,O={pos:Hs(_),new:!h}),O.new&&_.addEventListener("transitionend",()=>{O.new=!1,_.parentNode&&(O.newPos=Hs(_))},{once:!0}),O.newPos&&(O.pos=O.newPos),O.newPos=Hs(_)}),h?(h=!1,S):(C.forEach(_=>{const O=S.get(_),b=O.pos,p=O.newPos,y=b.left-p.left,E=b.top-p.top;if(y||E){O.moved=!0;const T=_.style;T.transform=`translate(${y}px,${E}px)`,T.transitionDuration="0s"}}),document.body.offsetHeight,C.forEach(_=>{const O=S.get(_);if(O.moved){let b=function(E){E&&E.target!==_||!_.parentNode||(!E||/transform$/.test(E.propertyName))&&(_.removeEventListener("transitionend",b),_.classList.remove(...y))};O.moved=!1;const p=_.style,y=n().moveClass.split(" ");_.classList.add(...y),p.transform=p.transitionDuration="",_.addEventListener("transitionend",b)}}),S)},new Map),f};function T6(e,t){const n=r=>{var o;return!e.contains(r.target)&&((o=t())==null?void 0:o())};document.body.addEventListener("click",n),Rn(()=>document.body.removeEventListener("click",n))}function A6(e,t){const n=r=>{var o,i;r.key==="Escape"&&((o=document.activeElement)==null||o.blur(),(i=t())==null||i())};document.body.addEventListener("keydown",n),Rn(()=>document.body.removeEventListener("keydown",n))}function L6(e,t){const{isEnabled:n,onClose:r}=t();if(!n||!(Wd().os==="android"))return;window.history.pushState(P6,"");const i=l=>{l.preventDefault(),r()};window.addEventListener("popstate",i,{once:!0}),Rn(()=>{window.removeEventListener("popstate",i),cg(()=>{var l;((l=window.history.state)==null?void 0:l[xg])===!0&&window.history.back()})})}const xg="androidBackHandler",P6={[xg]:!0},M6=ot('',4,!0),R6={left:0,top:90,right:180,bottom:270},Cg=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary,r=()=>e.direction||"left",o=z("svg")` +`;function gs(e){const t=fn(()=>Object.keys(e).filter(r=>r.startsWith("data-"))),[n]=Pd(e,t);return n}const Yt=e=>{const t=gs(e);return m(k6,Lr({get appearance(){return e.appearance||"primary"},get class(){return e.class},onClick:n=>{var r;return(r=e.onClick)==null?void 0:r.call(e,n)},onMouseEnter:n=>{var r;return(r=e.onMouseEnter)==null?void 0:r.call(e,n)},onMouseLeave:n=>{var r;return(r=e.onMouseLeave)==null?void 0:r.call(e,n)},ref(n){const r=e.ref;typeof r=="function"?r(n):e.ref=n},get disabled(){return e.disabled},get scale(){return e.scale||"m"},get leftIcon(){return!!e.leftIcon},get rightIcon(){return!!e.rightIcon},"data-tc-button":"true"},t,{get children(){return[de(()=>e.leftIcon),de(()=>e.children),de(()=>e.rightIcon)]}}))};function Qa(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}const jd=e=>{let t,n=!0;const[r,o]=We(),[i,l]=We(),s=Sc(()=>e.children),{onBeforeEnter:c,onEnter:f,onAfterEnter:d,onBeforeExit:w,onExit:h,onAfterExit:S}=e,C=de(()=>{const b=e.name||"s";return{enterActiveClass:e.enterActiveClass||b+"-enter-active",enterClass:e.enterClass||b+"-enter",enterToClass:e.enterToClass||b+"-enter-to",exitActiveClass:e.exitActiveClass||b+"-exit-active",exitClass:e.exitClass||b+"-exit",exitToClass:e.exitToClass||b+"-exit-to"}});function _(b,p){if(!n||e.appear){let y=function(I){b&&(!I||I.target===b)&&(b.removeEventListener("transitionend",y),b.removeEventListener("animationend",y),b.classList.remove(...T),b.classList.remove(...N),Qp(()=>{r()!==b&&o(b),i()===b&&l(void 0)}),d&&d(b),e.mode==="inout"&&O(b,p))};const E=C().enterClass.split(" "),T=C().enterActiveClass.split(" "),N=C().enterToClass.split(" ");c&&c(b),b.classList.add(...E),b.classList.add(...T),Qa(()=>{b.classList.remove(...E),b.classList.add(...N),f&&f(b,()=>y()),(!f||f.length<2)&&(b.addEventListener("transitionend",y),b.addEventListener("animationend",y))})}p&&!e.mode?l(b):o(b)}function O(b,p){const y=C().exitClass.split(" "),E=C().exitActiveClass.split(" "),T=C().exitToClass.split(" ");if(!p.parentNode)return N();w&&w(p),p.classList.add(...y),p.classList.add(...E),Qa(()=>{p.classList.remove(...y),p.classList.add(...T)}),h&&h(p,()=>N()),(!h||h.length<2)&&(p.addEventListener("transitionend",N),p.addEventListener("animationend",N));function N(I){(!I||I.target===p)&&(p.removeEventListener("transitionend",N),p.removeEventListener("animationend",N),p.classList.remove(...E),p.classList.remove(...T),r()===p&&o(void 0),S&&S(p),e.mode==="outin"&&_(b,p))}}return Ba(b=>{for(t=s();typeof t=="function";)t=t();return fn(()=>(t&&t!==b&&(e.mode!=="outin"?_(t,b):n&&o(t)),b&&b!==t&&e.mode!=="inout"&&O(t,b),n=!1,t))}),[r,i]};function Hs(e){const{top:t,bottom:n,left:r,right:o,width:i,height:l}=e.getBoundingClientRect(),s=e.parentNode.getBoundingClientRect();return{top:t-s.top,bottom:n,left:r-s.left,right:o,width:i,height:l}}const E6=e=>{const t=Sc(()=>e.children),n=de(()=>{const S=e.name||"s";return{enterActiveClass:e.enterActiveClass||S+"-enter-active",enterClass:e.enterClass||S+"-enter",enterToClass:e.enterToClass||S+"-enter-to",exitActiveClass:e.exitActiveClass||S+"-exit-active",exitClass:e.exitClass||S+"-exit",exitToClass:e.exitToClass||S+"-exit-to",moveClass:e.moveClass||S+"-move"}}),{onBeforeEnter:r,onEnter:o,onAfterEnter:i,onBeforeExit:l,onExit:s,onAfterExit:c}=e,[f,d]=We();let w=[],h=!0;return Ba(()=>{const S=t(),C=[...S],_=new Set(S),O=new Set(w),b=n().enterClass.split(" "),p=n().enterActiveClass.split(" "),y=n().enterToClass.split(" "),E=n().exitClass.split(" "),T=n().exitActiveClass.split(" "),N=n().exitToClass.split(" ");for(let I=0;I{L.classList.remove(...b),L.classList.add(...y),o&&o(L,()=>P()),(!o||o.length<2)&&(L.addEventListener("transitionend",P),L.addEventListener("animationend",P))})}}for(let I=0;I$!==L),d(w))};C.splice(I,0,L),l&&l(L),L.classList.add(...E),L.classList.add(...T),Qa(()=>{L.classList.remove(...E),L.classList.add(...N)}),s&&s(L,()=>P()),(!s||s.length<2)&&(L.addEventListener("transitionend",P),L.addEventListener("animationend",P))}}w=C,d(C)}),un(S=>{const C=f();return C.forEach(_=>{let O;(O=S.get(_))?O.new&&(O.new=!1,O.newPos=Hs(_)):S.set(_,O={pos:Hs(_),new:!h}),O.new&&_.addEventListener("transitionend",()=>{O.new=!1,_.parentNode&&(O.newPos=Hs(_))},{once:!0}),O.newPos&&(O.pos=O.newPos),O.newPos=Hs(_)}),h?(h=!1,S):(C.forEach(_=>{const O=S.get(_),b=O.pos,p=O.newPos,y=b.left-p.left,E=b.top-p.top;if(y||E){O.moved=!0;const T=_.style;T.transform=`translate(${y}px,${E}px)`,T.transitionDuration="0s"}}),document.body.offsetHeight,C.forEach(_=>{const O=S.get(_);if(O.moved){let b=function(E){E&&E.target!==_||!_.parentNode||(!E||/transform$/.test(E.propertyName))&&(_.removeEventListener("transitionend",b),_.classList.remove(...y))};O.moved=!1;const p=_.style,y=n().moveClass.split(" ");_.classList.add(...y),p.transform=p.transitionDuration="",_.addEventListener("transitionend",b)}}),S)},new Map),f};function T6(e,t){const n=r=>{var o;return!e.contains(r.target)&&((o=t())==null?void 0:o())};document.body.addEventListener("click",n),Rn(()=>document.body.removeEventListener("click",n))}function A6(e,t){const n=r=>{var o,i;r.key==="Escape"&&((o=document.activeElement)==null||o.blur(),(i=t())==null||i())};document.body.addEventListener("keydown",n),Rn(()=>document.body.removeEventListener("keydown",n))}function L6(e,t){const{isEnabled:n,onClose:r}=t();if(!n||!(Nd().os==="android"))return;window.history.pushState(P6,"");const i=l=>{l.preventDefault(),r()};window.addEventListener("popstate",i,{once:!0}),Rn(()=>{window.removeEventListener("popstate",i),cg(()=>{var l;((l=window.history.state)==null?void 0:l[xg])===!0&&window.history.back()})})}const xg="androidBackHandler",P6={[xg]:!0},M6=ot('',4,!0),R6={left:0,top:90,right:180,bottom:270},Cg=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary,r=()=>e.direction||"left",o=z("svg")` transform: rotate(${i=>R6[i.svgDirection]}deg); transition: transform 0.1s ease-in-out; - `;return m(o,{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",get svgDirection(){return r()},get children(){const i=M6.cloneNode(!0);return nt(()=>Ee(i,"fill",n())),i}})},I6=ot(''),$6=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=I6.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},W6=z.button` + `;return m(o,{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",get svgDirection(){return r()},get children(){const i=M6.cloneNode(!0);return nt(()=>Ee(i,"fill",n())),i}})},I6=ot(''),$6=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=I6.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},N6=z.button` padding: 0; display: flex; justify-content: center; @@ -173,7 +173,7 @@ PERFORMANCE OF THIS SOFTWARE. transform: scale(0.92); } } -`,oi=e=>{const t=gs(e),n=()=>e.icon||"close";return m(W6,Ar({get class(){return e.class},onClick:()=>e.onClick(),"data-tc-icon-button":"true"},t,{get children(){return[m(je,{get when(){return!!e.children},get children(){return e.children}}),m(je,{get when(){return!e.children},get children(){return m(fs,{get children(){return[m(pn,{get when(){return n()==="close"},get children(){return m($6,{get fill(){return e.fill}})}}),m(pn,{get when(){return n()==="arrow"},get children(){return m(Cg,{get fill(){return e.fill}})}}),m(pn,{get when(){return n()==="question"},get children(){return m(B8,{get fill(){return e.fill}})}}),m(pn,{get when(){return typeof n()!="string"},get children(){return n()}})]}})}})]}}))},Mi={m:"24px",s:"16px",none:"0"},N6=z.div` +`,oi=e=>{const t=gs(e),n=()=>e.icon||"close";return m(N6,Lr({get class(){return e.class},onClick:()=>e.onClick(),"data-tc-icon-button":"true"},t,{get children(){return[m(je,{get when(){return!!e.children},get children(){return e.children}}),m(je,{get when(){return!e.children},get children(){return m(fs,{get children(){return[m(pn,{get when(){return n()==="close"},get children(){return m($6,{get fill(){return e.fill}})}}),m(pn,{get when(){return n()==="arrow"},get children(){return m(Cg,{get fill(){return e.fill}})}}),m(pn,{get when(){return n()==="question"},get children(){return m(B8,{get fill(){return e.fill}})}}),m(pn,{get when(){return typeof n()!="string"},get children(){return n()}})]}})}})]}}))},Mi={m:"24px",s:"16px",none:"0"},W6=z.div` display: flex; position: fixed; z-index: 1000; @@ -225,7 +225,7 @@ PERFORMANCE OF THIS SOFTWARE. ${e=>Mi[e.theme.borderRadius]}; `,D6=z(oi)` background-color: ${e=>ds(e.theme.colors.icon.secondary,.12)}; -`;class H6{constructor(){Me(this,"currentTime",0)}}const pl=class{constructor(){Me(this,"currentTime",0),Me(this,"playbackRate",1),Me(this,"startTime",null),Me(this,"timeline",new H6),Me(this,"finished",Promise.resolve(this)),Me(this,"effect",null),Me(this,"id",""),Me(this,"pending",!1),Me(this,"playState","finished"),Me(this,"replaceState","active"),Me(this,"ready",Promise.resolve(this)),Me(this,"oncancel",null),Me(this,"onfinish",null),Me(this,"onremove",null)}static create(){return pl._instance||(I4("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."),pl._instance=new pl),pl._instance}cancel(){}finish(){}pause(){}play(){}reverse(){}addEventListener(e,t,n){}dispatchEvent(e){return!1}removeEventListener(e,t,n){}updatePlaybackRate(e){}commitStyles(){}persist(){}};let bg=pl;Me(bg,"_instance",null);function _r(e,t,n){return"animate"in e?e.animate(t,n):bg.create()}const F6=ot("
"),z6=T6,V6=A6,K6=L6,Sg=e=>{const t=Et(),n=gs(e);return cn(()=>{e.opened?N4():U4()}),m(jd,{onBeforeEnter:r=>{const o=_i("mobile")?200:100;_r(r,[{opacity:0},{opacity:1}],{duration:o}),_i("mobile")&&_r(r.firstElementChild,[{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:o})},onExit:(r,o)=>{const i=_i("mobile")?200:100,l=_r(r,[{opacity:1},{opacity:0}],{duration:i});if(_i("mobile")){const s=_r(r.firstElementChild,[{transform:"translateY(0)"},{transform:"translateY(390px)"}],{duration:i});Promise.all([l.finished,s.finished]).then(o)}else l.finished.then(o)},get children(){return m(je,{get when(){return e.opened},get children(){return m(N6,Ar({"data-tc-modal":"true"},n,{get children(){const r=F6.cloneNode(!0);return Al(K6,r,()=>({isEnabled:e.enableAndroidBackHandler,onClose:()=>e.onClose()})),Al(V6,r,()=>()=>e.onClose()),Al(z6,r,()=>()=>e.onClose()),_n(r,m(O6,{get class(){return e.class},get children(){return[m(B6,{icon:"close",onClick:()=>e.onClose()}),de(()=>e.children)]}}),null),_n(r,m(je,{get when(){return e.onClickQuestion},get children(){return m(j6,{get children(){return[m(U8,{}),m(D6,{get onClick(){return e.onClickQuestion},icon:"question"})]}})}}),null),nt(()=>Md(r,ia(U6,Zr` +`;class H6{constructor(){Me(this,"currentTime",0)}}const pl=class{constructor(){Me(this,"currentTime",0),Me(this,"playbackRate",1),Me(this,"startTime",null),Me(this,"timeline",new H6),Me(this,"finished",Promise.resolve(this)),Me(this,"effect",null),Me(this,"id",""),Me(this,"pending",!1),Me(this,"playState","finished"),Me(this,"replaceState","active"),Me(this,"ready",Promise.resolve(this)),Me(this,"oncancel",null),Me(this,"onfinish",null),Me(this,"onremove",null)}static create(){return pl._instance||(I4("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."),pl._instance=new pl),pl._instance}cancel(){}finish(){}pause(){}play(){}reverse(){}addEventListener(e,t,n){}dispatchEvent(e){return!1}removeEventListener(e,t,n){}updatePlaybackRate(e){}commitStyles(){}persist(){}};let bg=pl;Me(bg,"_instance",null);function kr(e,t,n){return"animate"in e?e.animate(t,n):bg.create()}const F6=ot("
"),z6=T6,V6=A6,K6=L6,Sg=e=>{const t=Et(),n=gs(e);return un(()=>{e.opened?W4():U4()}),m(jd,{onBeforeEnter:r=>{const o=_i("mobile")?200:100;kr(r,[{opacity:0},{opacity:1}],{duration:o}),_i("mobile")&&kr(r.firstElementChild,[{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:o})},onExit:(r,o)=>{const i=_i("mobile")?200:100,l=kr(r,[{opacity:1},{opacity:0}],{duration:i});if(_i("mobile")){const s=kr(r.firstElementChild,[{transform:"translateY(0)"},{transform:"translateY(390px)"}],{duration:i});Promise.all([l.finished,s.finished]).then(o)}else l.finished.then(o)},get children(){return m(je,{get when(){return e.opened},get children(){return m(W6,Lr({"data-tc-modal":"true"},n,{get children(){const r=F6.cloneNode(!0);return Al(K6,r,()=>({isEnabled:e.enableAndroidBackHandler,onClose:()=>e.onClose()})),Al(V6,r,()=>()=>e.onClose()),Al(z6,r,()=>()=>e.onClose()),_n(r,m(O6,{get class(){return e.class},get children(){return[m(B6,{icon:"close",onClick:()=>e.onClose()}),de(()=>e.children)]}}),null),_n(r,m(je,{get when(){return e.onClickQuestion},get children(){return m(j6,{get children(){return[m(U8,{}),m(D6,{get onClick(){return e.onClickQuestion},icon:"question"})]}})}}),null),nt(()=>Md(r,ia(U6,Zr` border-radius: ${Mi[t.borderRadius]}; background-color: ${t.colors.background.tint}; @@ -259,9 +259,9 @@ PERFORMANCE OF THIS SOFTWARE. transform: ${e=>e.right?"translateX(100%)":"translateX(0)"}; transition: transform 0.13s ease-in-out; -`,W0=z.input` +`,N0=z.input` display: none; -`,N0=z.label` +`,W0=z.label` padding: 9px 12px; z-index: 1; @@ -276,7 +276,7 @@ PERFORMANCE OF THIS SOFTWARE. > * { ${e=>e.isActive?"":`color: ${e.theme.colors.text.secondary};`} } -`,G6=e=>{const t="tabBar"+Math.floor(Math.random()*1e4);return m(Y6,{get class(){return e.class},"data-tc-tab-bar":"true",get children(){return[m(Z6,{get right(){return e.selectedTabIndex===1}}),m(N0,{get isActive(){return e.selectedTabIndex===0},get children(){return[m(W0,{type:"radio",name:t,get checked(){return e.selectedTabIndex===0},onInput:()=>{var n;return(n=e.onSelectedTabIndexChange)==null?void 0:n.call(e,0)}}),de(()=>e.tab1)]}}),m(N0,{get isActive(){return e.selectedTabIndex===1},get children(){return[m(W0,{type:"radio",get checked(){return e.selectedTabIndex===1},name:t,onInput:()=>{var n;return(n=e.onSelectedTabIndexChange)==null?void 0:n.call(e,1)}}),de(()=>e.tab2)]}})]}})},J6={m:"16px",s:"12px",none:"0"},X6={m:"12px",s:"8px",none:"0"},_g=256,_f=60,U0=48,O0=24,sa=z.div` +`,G6=e=>{const t="tabBar"+Math.floor(Math.random()*1e4);return m(Y6,{get class(){return e.class},"data-tc-tab-bar":"true",get children(){return[m(Z6,{get right(){return e.selectedTabIndex===1}}),m(W0,{get isActive(){return e.selectedTabIndex===0},get children(){return[m(N0,{type:"radio",name:t,get checked(){return e.selectedTabIndex===0},onInput:()=>{var n;return(n=e.onSelectedTabIndexChange)==null?void 0:n.call(e,0)}}),de(()=>e.tab1)]}}),m(W0,{get isActive(){return e.selectedTabIndex===1},get children(){return[m(N0,{type:"radio",get checked(){return e.selectedTabIndex===1},name:t,onInput:()=>{var n;return(n=e.onSelectedTabIndexChange)==null?void 0:n.call(e,1)}}),de(()=>e.tab2)]}})]}})},J6={m:"16px",s:"12px",none:"0"},X6={m:"12px",s:"8px",none:"0"},_g=256,_f=60,U0=48,O0=24,sa=z.div` width: 52px; height: 52px; background: transparent; @@ -294,8 +294,8 @@ PERFORMANCE OF THIS SOFTWARE. position: relative; background-color: ${e=>e.theme.colors.background.qr}; border-radius: ${e=>J6[e.theme.borderRadius]}; - padding: ${Lr(O0)} 0; - height: ${Lr(_g+O0*2)}; + padding: ${Pr(O0)} 0; + height: ${Pr(_g+O0*2)}; width: 100%; overflow: hidden; @@ -344,16 +344,16 @@ PERFORMANCE OF THIS SOFTWARE. } `,n8=z.div` position: absolute; - width: ${Lr(_f)}; - height: ${Lr(_f)}; + width: ${Pr(_f)}; + height: ${Pr(_f)}; background: ${e=>e.theme.colors.background.qr}; display: flex; align-items: center; justify-content: center; `,r8=z(ri)` - width: ${e=>Lr(e.size)}; - height: ${e=>Lr(e.size)}; + width: ${e=>Pr(e.size)}; + height: ${e=>Pr(e.size)}; border-radius: ${e=>X6[e.theme.borderRadius]}; background-color: ${e=>e.theme.colors.background.qr}; `,o8=z.div` @@ -371,16 +371,16 @@ PERFORMANCE OF THIS SOFTWARE. filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08)); background-color: ${e=>e.theme.colors.background.segment}; -`;var kg={exports:{}};(function(e,t){var n=function(){var r=function(T,W){var I=236,L=17,P=T,U=i[W],$=null,M=0,X=null,ee=[],ne={},Ce=function(V,K){M=P*4+17,$=function(D){for(var Z=new Array(D),G=0;G=7&&et(V),X==null&&(X=We(P,U,ee)),ct(X,K)},Re=function(V,K){for(var D=-1;D<=7;D+=1)if(!(V+D<=-1||M<=V+D))for(var Z=-1;Z<=7;Z+=1)K+Z<=-1||M<=K+Z||(0<=D&&D<=6&&(Z==0||Z==6)||0<=Z&&Z<=6&&(D==0||D==6)||2<=D&&D<=4&&2<=Z&&Z<=4?$[V+D][K+Z]=!0:$[V+D][K+Z]=!1)},J=function(){for(var V=0,K=0,D=0;D<8;D+=1){Ce(!0,D);var Z=s.getLostPoint(ne);(D==0||V>Z)&&(V=Z,K=D)}return K},ae=function(){for(var V=8;V>D&1)==1;$[Math.floor(D/3)][D%3+M-8-3]=Z}for(var D=0;D<18;D+=1){var Z=!V&&(K>>D&1)==1;$[D%3+M-8-3][Math.floor(D/3)]=Z}},Ze=function(V,K){for(var D=U<<3|K,Z=s.getBCHTypeInfo(D),G=0;G<15;G+=1){var re=!V&&(Z>>G&1)==1;G<6?$[G][8]=re:G<8?$[G+1][8]=re:$[M-15+G][8]=re}for(var G=0;G<15;G+=1){var re=!V&&(Z>>G&1)==1;G<8?$[8][M-G-1]=re:G<9?$[8][15-G-1+1]=re:$[8][15-G-1]=re}$[M-8][8]=!V},ct=function(V,K){for(var D=-1,Z=M-1,G=7,re=0,Se=s.getMaskFunction(K),_e=M-1;_e>0;_e-=2)for(_e==6&&(_e-=1);;){for(var Ve=0;Ve<2;Ve+=1)if($[Z][_e-Ve]==null){var bt=!1;re>>G&1)==1);var Pe=Se(Z,_e-Ve);Pe&&(bt=!bt),$[Z][_e-Ve]=bt,G-=1,G==-1&&(re+=1,G=7)}if(Z+=D,Z<0||M<=Z){Z-=D,D=-D;break}}},yt=function(V,K){for(var D=0,Z=0,G=0,re=new Array(K.length),Se=new Array(K.length),_e=0;_e=0?Nn.getAt(Zt):0}}for(var Jt=0,Pe=0;Pe_e*8)throw"code length overflow. ("+G.getLengthInBits()+">"+_e*8+")";for(G.getLengthInBits()+4<=_e*8&&G.put(0,4);G.getLengthInBits()%8!=0;)G.putBit(!1);for(;!(G.getLengthInBits()>=_e*8||(G.put(I,8),G.getLengthInBits()>=_e*8));)G.put(L,8);return yt(G,Z)};ne.addData=function(V,K){K=K||"Byte";var D=null;switch(K){case"Numeric":D=h(V);break;case"Alphanumeric":D=S(V);break;case"Byte":D=C(V);break;case"Kanji":D=_(V);break;default:throw"mode:"+K}ee.push(D),X=null},ne.isDark=function(V,K){if(V<0||M<=V||K<0||M<=K)throw V+","+K;return $[V][K]},ne.getModuleCount=function(){return M},ne.make=function(){if(P<1){for(var V=1;V<40;V++){for(var K=d.getRSBlocks(V,U),D=w(),Z=0;Z"u"?V*4:K;var D="";D+='";for(var G=0;G';D+=""}return D+="",D+="
",D},ne.createSvgTag=function(V,K,D,Z){var G={};typeof arguments[0]=="object"&&(G=arguments[0],V=G.cellSize,K=G.margin,D=G.alt,Z=G.title),V=V||2,K=typeof K>"u"?V*4:K,D=typeof D=="string"?{text:D}:D||{},D.text=D.text||null,D.id=D.text?D.id||"qrcode-description":null,Z=typeof Z=="string"?{text:Z}:Z||{},Z.text=Z.text||null,Z.id=Z.text?Z.id||"qrcode-title":null;var re=ne.getModuleCount()*V+K*2,Se,_e,Ve,bt,Pe="",Rt;for(Rt="l"+V+",0 0,"+V+" -"+V+",0 0,-"+V+"z ",Pe+=''+ut(Z.text)+"":"",Pe+=D.text?''+ut(D.text)+"":"",Pe+='',Pe+='"u"?V*4:K;var D=ne.getModuleCount()*V+K*2,Z=K,G=D-K;return E(D,D,function(re,Se){if(Z<=re&&re"u"?V*4:K;var Z=ne.getModuleCount()*V+K*2,G="";return G+="",G};var ut=function(V){for(var K="",D=0;D":K+=">";break;case"&":K+="&";break;case'"':K+=""";break;default:K+=Z;break}}return K},Tn=function(V){var K=1;V=typeof V>"u"?K*2:V;var D=ne.getModuleCount()*K+V*2,Z=V,G=D-V,re,Se,_e,Ve,bt,Pe={"██":"█","█ ":"▀"," █":"▄"," ":" "},Rt={"██":"▀","█ ":"▀"," █":" "," ":" "},jt="";for(re=0;re=G?Rt[bt]:Pe[bt];jt+=` +`;var kg={exports:{}};(function(e,t){var n=function(){var r=function(T,N){var I=236,L=17,P=T,U=i[N],$=null,M=0,X=null,ee=[],ne={},Ce=function(V,K){M=P*4+17,$=function(D){for(var Z=new Array(D),G=0;G=7&&et(V),X==null&&(X=Ne(P,U,ee)),ct(X,K)},Re=function(V,K){for(var D=-1;D<=7;D+=1)if(!(V+D<=-1||M<=V+D))for(var Z=-1;Z<=7;Z+=1)K+Z<=-1||M<=K+Z||(0<=D&&D<=6&&(Z==0||Z==6)||0<=Z&&Z<=6&&(D==0||D==6)||2<=D&&D<=4&&2<=Z&&Z<=4?$[V+D][K+Z]=!0:$[V+D][K+Z]=!1)},J=function(){for(var V=0,K=0,D=0;D<8;D+=1){Ce(!0,D);var Z=s.getLostPoint(ne);(D==0||V>Z)&&(V=Z,K=D)}return K},ae=function(){for(var V=8;V>D&1)==1;$[Math.floor(D/3)][D%3+M-8-3]=Z}for(var D=0;D<18;D+=1){var Z=!V&&(K>>D&1)==1;$[D%3+M-8-3][Math.floor(D/3)]=Z}},Ze=function(V,K){for(var D=U<<3|K,Z=s.getBCHTypeInfo(D),G=0;G<15;G+=1){var re=!V&&(Z>>G&1)==1;G<6?$[G][8]=re:G<8?$[G+1][8]=re:$[M-15+G][8]=re}for(var G=0;G<15;G+=1){var re=!V&&(Z>>G&1)==1;G<8?$[8][M-G-1]=re:G<9?$[8][15-G-1+1]=re:$[8][15-G-1]=re}$[M-8][8]=!V},ct=function(V,K){for(var D=-1,Z=M-1,G=7,re=0,Se=s.getMaskFunction(K),_e=M-1;_e>0;_e-=2)for(_e==6&&(_e-=1);;){for(var Ve=0;Ve<2;Ve+=1)if($[Z][_e-Ve]==null){var bt=!1;re>>G&1)==1);var Pe=Se(Z,_e-Ve);Pe&&(bt=!bt),$[Z][_e-Ve]=bt,G-=1,G==-1&&(re+=1,G=7)}if(Z+=D,Z<0||M<=Z){Z-=D,D=-D;break}}},yt=function(V,K){for(var D=0,Z=0,G=0,re=new Array(K.length),Se=new Array(K.length),_e=0;_e=0?Wn.getAt(Zt):0}}for(var Jt=0,Pe=0;Pe_e*8)throw"code length overflow. ("+G.getLengthInBits()+">"+_e*8+")";for(G.getLengthInBits()+4<=_e*8&&G.put(0,4);G.getLengthInBits()%8!=0;)G.putBit(!1);for(;!(G.getLengthInBits()>=_e*8||(G.put(I,8),G.getLengthInBits()>=_e*8));)G.put(L,8);return yt(G,Z)};ne.addData=function(V,K){K=K||"Byte";var D=null;switch(K){case"Numeric":D=h(V);break;case"Alphanumeric":D=S(V);break;case"Byte":D=C(V);break;case"Kanji":D=_(V);break;default:throw"mode:"+K}ee.push(D),X=null},ne.isDark=function(V,K){if(V<0||M<=V||K<0||M<=K)throw V+","+K;return $[V][K]},ne.getModuleCount=function(){return M},ne.make=function(){if(P<1){for(var V=1;V<40;V++){for(var K=d.getRSBlocks(V,U),D=w(),Z=0;Z"u"?V*4:K;var D="";D+='";for(var G=0;G';D+=""}return D+="",D+="
",D},ne.createSvgTag=function(V,K,D,Z){var G={};typeof arguments[0]=="object"&&(G=arguments[0],V=G.cellSize,K=G.margin,D=G.alt,Z=G.title),V=V||2,K=typeof K>"u"?V*4:K,D=typeof D=="string"?{text:D}:D||{},D.text=D.text||null,D.id=D.text?D.id||"qrcode-description":null,Z=typeof Z=="string"?{text:Z}:Z||{},Z.text=Z.text||null,Z.id=Z.text?Z.id||"qrcode-title":null;var re=ne.getModuleCount()*V+K*2,Se,_e,Ve,bt,Pe="",Rt;for(Rt="l"+V+",0 0,"+V+" -"+V+",0 0,-"+V+"z ",Pe+=''+ut(Z.text)+"":"",Pe+=D.text?''+ut(D.text)+"":"",Pe+='',Pe+='"u"?V*4:K;var D=ne.getModuleCount()*V+K*2,Z=K,G=D-K;return E(D,D,function(re,Se){if(Z<=re&&re"u"?V*4:K;var Z=ne.getModuleCount()*V+K*2,G="";return G+="",G};var ut=function(V){for(var K="",D=0;D":K+=">";break;case"&":K+="&";break;case'"':K+=""";break;default:K+=Z;break}}return K},Tn=function(V){var K=1;V=typeof V>"u"?K*2:V;var D=ne.getModuleCount()*K+V*2,Z=V,G=D-V,re,Se,_e,Ve,bt,Pe={"██":"█","█ ":"▀"," █":"▄"," ":" "},Rt={"██":"▀","█ ":"▀"," █":" "," ":" "},jt="";for(re=0;re=G?Rt[bt]:Pe[bt];jt+=` `}return D%2&&V>0?jt.substring(0,jt.length-D-1)+Array(D+1).join("▀"):jt.substring(0,jt.length-1)};return ne.createASCII=function(V,K){if(V=V||1,V<2)return Tn(K);V-=1,K=typeof K>"u"?V*2:K;var D=ne.getModuleCount()*V+K*2,Z=K,G=D-K,re,Se,_e,Ve,bt=Array(V+1).join("██"),Pe=Array(V+1).join(" "),Rt="",jt="";for(re=0;re>>8),U.push(X&255)):U.push(L)}}return U}};var o={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},i={L:1,M:0,Q:3,H:2},l={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s=function(){var T=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],W=1335,I=7973,L=21522,P={},U=function($){for(var M=0;$!=0;)M+=1,$>>>=1;return M};return P.getBCHTypeInfo=function($){for(var M=$<<10;U(M)-U(W)>=0;)M^=W<=0;)M^=I<5&&(X+=3+Ce-5)}for(var ee=0;ee=256;)P-=255;return T[P]},L}();function f(T,W){if(typeof T.length>"u")throw T.length+"/"+W;var I=function(){for(var P=0;P"u")throw"bad rs block @ typeNumber:"+P+"/errorCorrectionLevel:"+U;for(var M=$.length/3,X=[],ee=0;ee>>7-L%8&1)==1},I.put=function(L,P){for(var U=0;U>>P-U-1&1)==1)},I.getLengthInBits=function(){return W},I.putBit=function(L){var P=Math.floor(W/8);T.length<=P&&T.push(0),L&&(T[P]|=128>>>W%8),W+=1},I},h=function(T){var W=o.MODE_NUMBER,I=T,L={};L.getMode=function(){return W},L.getLength=function($){return I.length},L.write=function($){for(var M=I,X=0;X+2>>8&255)*192+(X&255),U.put(X,13),M+=2}if(M<$.length)throw"illegal char at "+(M+1)},P},O=function(){var T=[],W={};return W.writeByte=function(I){T.push(I&255)},W.writeShort=function(I){W.writeByte(I),W.writeByte(I>>>8)},W.writeBytes=function(I,L,P){L=L||0,P=P||I.length;for(var U=0;U0&&(I+=","),I+=T[L];return I+="]",I},W},b=function(){var T=0,W=0,I=0,L="",P={},U=function(M){L+=String.fromCharCode($(M&63))},$=function(M){if(!(M<0)){if(M<26)return 65+M;if(M<52)return 97+(M-26);if(M<62)return 48+(M-52);if(M==62)return 43;if(M==63)return 47}throw"n:"+M};return P.writeByte=function(M){for(T=T<<8|M&255,W+=8,I+=1;W>=6;)U(T>>>W-6),W-=6},P.flush=function(){if(W>0&&(U(T<<6-W),T=0,W=0),I%3!=0)for(var M=3-I%3,X=0;X=W.length){if(P==0)return-1;throw"unexpected end of file./"+P}var M=W.charAt(I);if(I+=1,M=="=")return P=0,-1;if(M.match(/^\s$/))continue;L=L<<6|$(M.charCodeAt(0)),P+=6}var X=L>>>P-8&255;return P-=8,X};var $=function(M){if(65<=M&&M<=90)return M-65;if(97<=M&&M<=122)return M-97+26;if(48<=M&&M<=57)return M-48+52;if(M==43)return 62;if(M==47)return 63;throw"c:"+M};return U},y=function(T,W){var I=T,L=W,P=new Array(T*W),U={};U.setPixel=function(ee,ne,Ce){P[ne*I+ee]=Ce},U.write=function(ee){ee.writeString("GIF87a"),ee.writeShort(I),ee.writeShort(L),ee.writeByte(128),ee.writeByte(0),ee.writeByte(0),ee.writeByte(0),ee.writeByte(0),ee.writeByte(0),ee.writeByte(255),ee.writeByte(255),ee.writeByte(255),ee.writeString(","),ee.writeShort(0),ee.writeShort(0),ee.writeShort(I),ee.writeShort(L),ee.writeByte(0);var ne=2,Ce=M(ne);ee.writeByte(ne);for(var Re=0;Ce.length-Re>255;)ee.writeByte(255),ee.writeBytes(Ce,Re,255),Re+=255;ee.writeByte(Ce.length-Re),ee.writeBytes(Ce,Re,Ce.length-Re),ee.writeByte(0),ee.writeString(";")};var $=function(ee){var ne=ee,Ce=0,Re=0,J={};return J.write=function(ae,ye){if(ae>>>ye)throw"length over";for(;Ce+ye>=8;)ne.writeByte(255&(ae<>>=8-Ce,Re=0,Ce=0;Re=ae<0&&ne.writeByte(Re)},J},M=function(ee){for(var ne=1<>6,128|c&63):c<55296||c>=57344?l.push(224|c>>12,128|c>>6&63,128|c&63):(s++,c=65536+((c&1023)<<10|i.charCodeAt(s)&1023),l.push(240|c>>18,128|c>>12&63,128|c>>6&63,128|c&63))}return l}return o(r)}})(),function(r){e.exports=r()}(function(){return n})})(kg);const i8=kg.exports;function Dd(e){return xt(this,null,function*(){try{if(!(navigator!=null&&navigator.clipboard))throw new qt("Clipboard API not available");return yield navigator.clipboard.writeText(e)}catch{}l8(e)})}function l8(e){const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}finally{document.body.removeChild(t)}}const s8=ot("
"),Ec=e=>{let t,n,r;const[o,i]=Ne(!1),[l,s]=Ne(U0);cn(()=>{const h=i8(0,"L");h.addData(e.sourceUrl),h.make(),t.innerHTML=h.createSvgTag(4,0);const S=t.firstElementChild.clientWidth,C=Math.round(_g/S*1e5)/1e5;if(r){const _=Math.ceil(_f/(C*4))*4,O=Lr(Math.ceil((S-_)/(2*4))*4);r.style.top=O,r.style.left=O,r.style.height=Lr(_),r.style.width=Lr(_),s(Math.round(U0/C))}n.style.transform=`scale(${C})`});let c=null;return m(e8,{get class(){return e.class},onClick:()=>{i(!0),Dd(e.sourceUrl),c!=null&&clearTimeout(c),c=setTimeout(()=>i(!1),1500)},get children(){return[m(t8,{ref(d){const w=n;typeof w=="function"?w(d):n=d},get children(){return[(()=>{const d=s8.cloneNode(!0),w=t;return typeof w=="function"?Al(w,d):t=d,d})(),m(je,{get when(){return e.imageUrl},get children(){return m(n8,{ref(d){const w=r;typeof w=="function"?w(d):r=d},get children(){return m(r8,{get src(){return e.imageUrl},alt:"",get size(){return l()}})}})}})]}}),m(jd,{onBeforeEnter:d=>{_r(d,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(d,w)=>{_r(d,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then(()=>{w()})},get children(){return m(je,{get when(){return o()&&!e.disableCopy},get children(){return m(o8,{get children(){return[m(Fd,{size:"xs"}),m(Gn,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),m(je,{get when(){return!e.disableCopy},get children(){return m(sa,{get children(){return m(Ag,{})}})}})]}})};var kf=(e,t,n)=>{const r=t.trim().split(".").reduce((o,i)=>o?o[i]:void 0,e);return r!==void 0?r:n},a8=(e,t,n=/{{(.*?)}}/g)=>e.replace(n,(r,o)=>kf(t,o,"")),c8=(e={},t=navigator.language in e?navigator.language:Object.keys(e)[0])=>{const[n,r]=Ne(t),[o,i]=Ud(e);return[(c,f,d)=>{const w=kf(o[n()],c,d||"");return typeof w=="function"?w(f):typeof w=="string"?a8(w,f||{}):w},{add(c,f){i(c,d=>Object.assign(d||{},f))},locale:c=>c?r(c):n(),dict:c=>kf(o,c)}]},Eg=bc({}),Rr=()=>In(Eg);const u8=z.div` +`}return Rt.substring(0,Rt.length-1)},ne.renderTo2dContext=function(V,K){K=K||2;for(var D=ne.getModuleCount(),Z=0;Z>>8),U.push(X&255)):U.push(L)}}return U}};var o={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},i={L:1,M:0,Q:3,H:2},l={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s=function(){var T=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],N=1335,I=7973,L=21522,P={},U=function($){for(var M=0;$!=0;)M+=1,$>>>=1;return M};return P.getBCHTypeInfo=function($){for(var M=$<<10;U(M)-U(N)>=0;)M^=N<=0;)M^=I<5&&(X+=3+Ce-5)}for(var ee=0;ee=256;)P-=255;return T[P]},L}();function f(T,N){if(typeof T.length>"u")throw T.length+"/"+N;var I=function(){for(var P=0;P"u")throw"bad rs block @ typeNumber:"+P+"/errorCorrectionLevel:"+U;for(var M=$.length/3,X=[],ee=0;ee>>7-L%8&1)==1},I.put=function(L,P){for(var U=0;U>>P-U-1&1)==1)},I.getLengthInBits=function(){return N},I.putBit=function(L){var P=Math.floor(N/8);T.length<=P&&T.push(0),L&&(T[P]|=128>>>N%8),N+=1},I},h=function(T){var N=o.MODE_NUMBER,I=T,L={};L.getMode=function(){return N},L.getLength=function($){return I.length},L.write=function($){for(var M=I,X=0;X+2>>8&255)*192+(X&255),U.put(X,13),M+=2}if(M<$.length)throw"illegal char at "+(M+1)},P},O=function(){var T=[],N={};return N.writeByte=function(I){T.push(I&255)},N.writeShort=function(I){N.writeByte(I),N.writeByte(I>>>8)},N.writeBytes=function(I,L,P){L=L||0,P=P||I.length;for(var U=0;U0&&(I+=","),I+=T[L];return I+="]",I},N},b=function(){var T=0,N=0,I=0,L="",P={},U=function(M){L+=String.fromCharCode($(M&63))},$=function(M){if(!(M<0)){if(M<26)return 65+M;if(M<52)return 97+(M-26);if(M<62)return 48+(M-52);if(M==62)return 43;if(M==63)return 47}throw"n:"+M};return P.writeByte=function(M){for(T=T<<8|M&255,N+=8,I+=1;N>=6;)U(T>>>N-6),N-=6},P.flush=function(){if(N>0&&(U(T<<6-N),T=0,N=0),I%3!=0)for(var M=3-I%3,X=0;X=N.length){if(P==0)return-1;throw"unexpected end of file./"+P}var M=N.charAt(I);if(I+=1,M=="=")return P=0,-1;if(M.match(/^\s$/))continue;L=L<<6|$(M.charCodeAt(0)),P+=6}var X=L>>>P-8&255;return P-=8,X};var $=function(M){if(65<=M&&M<=90)return M-65;if(97<=M&&M<=122)return M-97+26;if(48<=M&&M<=57)return M-48+52;if(M==43)return 62;if(M==47)return 63;throw"c:"+M};return U},y=function(T,N){var I=T,L=N,P=new Array(T*N),U={};U.setPixel=function(ee,ne,Ce){P[ne*I+ee]=Ce},U.write=function(ee){ee.writeString("GIF87a"),ee.writeShort(I),ee.writeShort(L),ee.writeByte(128),ee.writeByte(0),ee.writeByte(0),ee.writeByte(0),ee.writeByte(0),ee.writeByte(0),ee.writeByte(255),ee.writeByte(255),ee.writeByte(255),ee.writeString(","),ee.writeShort(0),ee.writeShort(0),ee.writeShort(I),ee.writeShort(L),ee.writeByte(0);var ne=2,Ce=M(ne);ee.writeByte(ne);for(var Re=0;Ce.length-Re>255;)ee.writeByte(255),ee.writeBytes(Ce,Re,255),Re+=255;ee.writeByte(Ce.length-Re),ee.writeBytes(Ce,Re,Ce.length-Re),ee.writeByte(0),ee.writeString(";")};var $=function(ee){var ne=ee,Ce=0,Re=0,J={};return J.write=function(ae,ye){if(ae>>>ye)throw"length over";for(;Ce+ye>=8;)ne.writeByte(255&(ae<>>=8-Ce,Re=0,Ce=0;Re=ae<0&&ne.writeByte(Re)},J},M=function(ee){for(var ne=1<>6,128|c&63):c<55296||c>=57344?l.push(224|c>>12,128|c>>6&63,128|c&63):(s++,c=65536+((c&1023)<<10|i.charCodeAt(s)&1023),l.push(240|c>>18,128|c>>12&63,128|c>>6&63,128|c&63))}return l}return o(r)}})(),function(r){e.exports=r()}(function(){return n})})(kg);const i8=kg.exports;function Dd(e){return xt(this,null,function*(){try{if(!(navigator!=null&&navigator.clipboard))throw new qt("Clipboard API not available");return yield navigator.clipboard.writeText(e)}catch{}l8(e)})}function l8(e){const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}finally{document.body.removeChild(t)}}const s8=ot("
"),Ec=e=>{let t,n,r;const[o,i]=We(!1),[l,s]=We(U0);un(()=>{const h=i8(0,"L");h.addData(e.sourceUrl),h.make(),t.innerHTML=h.createSvgTag(4,0);const S=t.firstElementChild.clientWidth,C=Math.round(_g/S*1e5)/1e5;if(r){const _=Math.ceil(_f/(C*4))*4,O=Pr(Math.ceil((S-_)/(2*4))*4);r.style.top=O,r.style.left=O,r.style.height=Pr(_),r.style.width=Pr(_),s(Math.round(U0/C))}n.style.transform=`scale(${C})`});let c=null;return m(e8,{get class(){return e.class},onClick:()=>{i(!0),Dd(e.sourceUrl),c!=null&&clearTimeout(c),c=setTimeout(()=>i(!1),1500)},get children(){return[m(t8,{ref(d){const w=n;typeof w=="function"?w(d):n=d},get children(){return[(()=>{const d=s8.cloneNode(!0),w=t;return typeof w=="function"?Al(w,d):t=d,d})(),m(je,{get when(){return e.imageUrl},get children(){return m(n8,{ref(d){const w=r;typeof w=="function"?w(d):r=d},get children(){return m(r8,{get src(){return e.imageUrl},alt:"",get size(){return l()}})}})}})]}}),m(jd,{onBeforeEnter:d=>{kr(d,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(d,w)=>{kr(d,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then(()=>{w()})},get children(){return m(je,{get when(){return o()&&!e.disableCopy},get children(){return m(o8,{get children(){return[m(Fd,{size:"xs"}),m(Gn,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),m(je,{get when(){return!e.disableCopy},get children(){return m(sa,{get children(){return m(Ag,{})}})}})]}})};var kf=(e,t,n)=>{const r=t.trim().split(".").reduce((o,i)=>o?o[i]:void 0,e);return r!==void 0?r:n},a8=(e,t,n=/{{(.*?)}}/g)=>e.replace(n,(r,o)=>kf(t,o,"")),c8=(e={},t=navigator.language in e?navigator.language:Object.keys(e)[0])=>{const[n,r]=We(t),[o,i]=Ud(e);return[(c,f,d)=>{const w=kf(o[n()],c,d||"");return typeof w=="function"?w(f):typeof w=="string"?a8(w,f||{}):w},{add(c,f){i(c,d=>Object.assign(d||{},f))},locale:c=>c?r(c):n(),dict:c=>kf(o,c)}]},Eg=bc({}),Ir=()=>In(Eg);const u8=z.div` font-style: normal; font-weight: ${e=>e.fontWeight}; font-size: ${e=>e.fontSize}; line-height: ${e=>e.lineHeight}; color: ${e=>e.color}; -`,Gn=e=>{const t=Et(),[n]=Rr();let r;const o=()=>e.color||t.colors.text.primary,i=Ar({fontSize:"14px",fontWeight:"510",lineHeight:"130%"},e);return cn(()=>{r&&i.cursor!=="unset"&&getComputedStyle(r).cursor!=="pointer"&&(r.style.cursor="default")}),m(u8,{get fontSize(){return i.fontSize},get fontWeight(){return i.fontWeight},get lineHeight(){return i.lineHeight},get color(){return o()},get class(){return i.class},ref(l){const s=r;typeof s=="function"?s(l):r=l},"data-tc-text":"true",get children(){var l;return de(()=>!!i.translationKey)()?n(i.translationKey,i.translationValues,(l=i.children)==null?void 0:l.toString()):i.children}})},f8=z.div` +`,Gn=e=>{const t=Et(),[n]=Ir();let r;const o=()=>e.color||t.colors.text.primary,i=Lr({fontSize:"14px",fontWeight:"510",lineHeight:"130%"},e);return un(()=>{r&&i.cursor!=="unset"&&getComputedStyle(r).cursor!=="pointer"&&(r.style.cursor="default")}),m(u8,{get fontSize(){return i.fontSize},get fontWeight(){return i.fontWeight},get lineHeight(){return i.lineHeight},get color(){return o()},get class(){return i.class},ref(l){const s=r;typeof s=="function"?s(l):r=l},"data-tc-text":"true",get children(){var l;return de(()=>!!i.translationKey)()?n(i.translationKey,i.translationValues,(l=i.children)==null?void 0:l.toString()):i.children}})},f8=z.div` position: relative; &::after { @@ -481,7 +481,7 @@ PERFORMANCE OF THIS SOFTWARE. margin-bottom: 0; cursor: default; -`,Ir=e=>{const[t]=Rr();return m(x8,{get class(){return e.class},"data-tc-h1":"true",get children(){var n;return de(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(n=e.children)==null?void 0:n.toString()):e.children}})},C8=z.h2` +`,$r=e=>{const[t]=Ir();return m(x8,{get class(){return e.class},"data-tc-h1":"true",get children(){var n;return de(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(n=e.children)==null?void 0:n.toString()):e.children}})},C8=z.h2` font-style: normal; font-weight: 510; font-size: 16px; @@ -495,7 +495,7 @@ PERFORMANCE OF THIS SOFTWARE. margin-bottom: 32px; cursor: default; -`,Ro=e=>{const[t]=Rr();return m(C8,{get class(){return e.class},"data-tc-h2":"true",get children(){var n;return de(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(n=e.children)==null?void 0:n.toString()):e.children}})},b8=z.h3` +`,Ro=e=>{const[t]=Ir();return m(C8,{get class(){return e.class},"data-tc-h2":"true",get children(){var n;return de(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(n=e.children)==null?void 0:n.toString()):e.children}})},b8=z.h3` font-style: normal; font-weight: 590; font-size: 16px; @@ -507,7 +507,7 @@ PERFORMANCE OF THIS SOFTWARE. margin-bottom: 0; cursor: default; -`,Hd=e=>{const[t]=Rr();return m(b8,{"data-tc-h3":"true",get class(){return e.class},get children(){var n;return de(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(n=e.children)==null?void 0:n.toString()):e.children}})},S8=ot(''),_8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=S8.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=n(),s=n();return l!==i._v$&&Ee(r,"fill",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},k8=ot(''),E8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.primary;return(()=>{const r=k8.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},T8=ot(''),A8=ot(''),L8=ot(''),Fd=e=>{const t=Et(),n=()=>e.size||"s",r=()=>e.fill||t.colors.icon.success;return de((()=>{const o=de(()=>n()==="xs");return()=>o()?(()=>{const i=T8.cloneNode(!0),l=i.firstChild,s=l.firstChild,c=s.nextSibling;return nt(f=>{const d=e.class,w=r(),h=t.colors.constant.white;return d!==f._v$&&Ee(i,"class",f._v$=d),w!==f._v$2&&Ee(s,"fill",f._v$2=w),h!==f._v$3&&Ee(c,"stroke",f._v$3=h),f},{_v$:void 0,_v$2:void 0,_v$3:void 0}),i})():(()=>{const i=de(()=>n()==="s");return()=>i()?(()=>{const l=A8.cloneNode(!0),s=l.firstChild,c=s.nextSibling;return nt(f=>{const d=e.class,w=r(),h=t.colors.constant.white;return d!==f._v$4&&Ee(l,"class",f._v$4=d),w!==f._v$5&&Ee(s,"fill",f._v$5=w),h!==f._v$6&&Ee(c,"fill",f._v$6=h),f},{_v$4:void 0,_v$5:void 0,_v$6:void 0}),l})():(()=>{const l=L8.cloneNode(!0),s=l.firstChild,c=s.nextSibling;return nt(f=>{const d=e.class,w=r(),h=t.colors.constant.white;return d!==f._v$7&&Ee(l,"class",f._v$7=d),w!==f._v$8&&Ee(s,"fill",f._v$8=w),h!==f._v$9&&Ee(c,"fill",f._v$9=h),f},{_v$7:void 0,_v$8:void 0,_v$9:void 0}),l})()})()})())},P8=ot(''),M8=ot(''),R8=ot(''),Tc=e=>{const t=Et(),n=()=>e.size||"m",r=()=>e.fill||t.colors.icon.error;return de((()=>{const o=de(()=>n()==="m");return()=>o()?(()=>{const i=P8.cloneNode(!0),l=i.firstChild,s=l.nextSibling;return nt(c=>{const f=e.class,d=r(),w=t.colors.constant.white;return f!==c._v$&&Ee(i,"class",c._v$=f),d!==c._v$2&&Ee(l,"fill",c._v$2=d),w!==c._v$3&&Ee(s,"fill",c._v$3=w),c},{_v$:void 0,_v$2:void 0,_v$3:void 0}),i})():(()=>{const i=de(()=>n()==="s");return()=>i()?(()=>{const l=M8.cloneNode(!0),s=l.firstChild,c=s.nextSibling;return nt(f=>{const d=e.class,w=r(),h=t.colors.constant.white;return d!==f._v$4&&Ee(l,"class",f._v$4=d),w!==f._v$5&&Ee(s,"fill",f._v$5=w),h!==f._v$6&&Ee(c,"stroke",f._v$6=h),f},{_v$4:void 0,_v$5:void 0,_v$6:void 0}),l})():(()=>{const l=R8.cloneNode(!0),s=l.firstChild,c=s.nextSibling;return nt(f=>{const d=e.class,w=r(),h=t.colors.constant.white;return d!==f._v$7&&Ee(l,"class",f._v$7=d),w!==f._v$8&&Ee(s,"fill",f._v$8=w),h!==f._v$9&&Ee(c,"fill",f._v$9=h),f},{_v$7:void 0,_v$8:void 0,_v$9:void 0}),l})()})()})())},I8=ot(''),$8=ot(''),W8=ot(''),to=e=>{const t=Et(),n=()=>e.size||"xs",r=()=>e.fill||t.colors.icon.tertiary,o=T4` +`,Hd=e=>{const[t]=Ir();return m(b8,{"data-tc-h3":"true",get class(){return e.class},get children(){var n;return de(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,(n=e.children)==null?void 0:n.toString()):e.children}})},S8=ot(''),_8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=S8.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=n(),s=n();return l!==i._v$&&Ee(r,"fill",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},k8=ot(''),E8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.primary;return(()=>{const r=k8.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},T8=ot(''),A8=ot(''),L8=ot(''),Fd=e=>{const t=Et(),n=()=>e.size||"s",r=()=>e.fill||t.colors.icon.success;return de((()=>{const o=de(()=>n()==="xs");return()=>o()?(()=>{const i=T8.cloneNode(!0),l=i.firstChild,s=l.firstChild,c=s.nextSibling;return nt(f=>{const d=e.class,w=r(),h=t.colors.constant.white;return d!==f._v$&&Ee(i,"class",f._v$=d),w!==f._v$2&&Ee(s,"fill",f._v$2=w),h!==f._v$3&&Ee(c,"stroke",f._v$3=h),f},{_v$:void 0,_v$2:void 0,_v$3:void 0}),i})():(()=>{const i=de(()=>n()==="s");return()=>i()?(()=>{const l=A8.cloneNode(!0),s=l.firstChild,c=s.nextSibling;return nt(f=>{const d=e.class,w=r(),h=t.colors.constant.white;return d!==f._v$4&&Ee(l,"class",f._v$4=d),w!==f._v$5&&Ee(s,"fill",f._v$5=w),h!==f._v$6&&Ee(c,"fill",f._v$6=h),f},{_v$4:void 0,_v$5:void 0,_v$6:void 0}),l})():(()=>{const l=L8.cloneNode(!0),s=l.firstChild,c=s.nextSibling;return nt(f=>{const d=e.class,w=r(),h=t.colors.constant.white;return d!==f._v$7&&Ee(l,"class",f._v$7=d),w!==f._v$8&&Ee(s,"fill",f._v$8=w),h!==f._v$9&&Ee(c,"fill",f._v$9=h),f},{_v$7:void 0,_v$8:void 0,_v$9:void 0}),l})()})()})())},P8=ot(''),M8=ot(''),R8=ot(''),Tc=e=>{const t=Et(),n=()=>e.size||"m",r=()=>e.fill||t.colors.icon.error;return de((()=>{const o=de(()=>n()==="m");return()=>o()?(()=>{const i=P8.cloneNode(!0),l=i.firstChild,s=l.nextSibling;return nt(c=>{const f=e.class,d=r(),w=t.colors.constant.white;return f!==c._v$&&Ee(i,"class",c._v$=f),d!==c._v$2&&Ee(l,"fill",c._v$2=d),w!==c._v$3&&Ee(s,"fill",c._v$3=w),c},{_v$:void 0,_v$2:void 0,_v$3:void 0}),i})():(()=>{const i=de(()=>n()==="s");return()=>i()?(()=>{const l=M8.cloneNode(!0),s=l.firstChild,c=s.nextSibling;return nt(f=>{const d=e.class,w=r(),h=t.colors.constant.white;return d!==f._v$4&&Ee(l,"class",f._v$4=d),w!==f._v$5&&Ee(s,"fill",f._v$5=w),h!==f._v$6&&Ee(c,"stroke",f._v$6=h),f},{_v$4:void 0,_v$5:void 0,_v$6:void 0}),l})():(()=>{const l=R8.cloneNode(!0),s=l.firstChild,c=s.nextSibling;return nt(f=>{const d=e.class,w=r(),h=t.colors.constant.white;return d!==f._v$7&&Ee(l,"class",f._v$7=d),w!==f._v$8&&Ee(s,"fill",f._v$8=w),h!==f._v$9&&Ee(c,"fill",f._v$9=h),f},{_v$7:void 0,_v$8:void 0,_v$9:void 0}),l})()})()})())},I8=ot(''),$8=ot(''),N8=ot(''),to=e=>{const t=Et(),n=()=>e.size||"xs",r=()=>e.fill||t.colors.icon.tertiary,o=T4` 0% { transform: rotate(0deg); } @@ -516,7 +516,7 @@ PERFORMANCE OF THIS SOFTWARE. } `,i=Zr` animation: ${o} 1s linear infinite; - `;return de((()=>{const l=de(()=>n()==="xs");return()=>l()?(()=>{const s=I8.cloneNode(!0),c=s.firstChild;return nt(f=>{const d=ia(i,e.class),w=r();return d!==f._v$&&Ee(s,"class",f._v$=d),w!==f._v$2&&Ee(c,"fill",f._v$2=w),f},{_v$:void 0,_v$2:void 0}),s})():(()=>{const s=de(()=>n()==="s");return()=>s()?(()=>{const c=$8.cloneNode(!0),f=c.firstChild;return nt(d=>{const w=ia(i,e.class),h=r();return w!==d._v$3&&Ee(c,"class",d._v$3=w),h!==d._v$4&&Ee(f,"fill",d._v$4=h),d},{_v$3:void 0,_v$4:void 0}),c})():(()=>{const c=W8.cloneNode(!0),f=c.firstChild;return nt(d=>{const w=ia(i,e.class),h=r();return w!==d._v$5&&Ee(c,"class",d._v$5=w),h!==d._v$6&&Ee(f,"stroke",d._v$6=h),d},{_v$5:void 0,_v$6:void 0}),c})()})()})())},N8=ot(''),U8=()=>{const e=Et(),t=()=>e.theme===$t.DARK?e.colors.constant.white:e.colors.constant.black;return(()=>{const n=N8.cloneNode(!0),r=n.firstChild,o=r.nextSibling,i=o.nextSibling;return nt(()=>Ee(i,"fill",t())),n})()},O8=ot(''),B8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=O8.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},j8=ot(''),D8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.primary;return(()=>{const r=j8.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},H8=ot(''),F8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.primary;return(()=>{const r=H8.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},z8=ot(''),V8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.primary;return(()=>{const r=z8.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},K8=ot(''),Ll=e=>{const t=Et(),n=()=>e.fill||t.colors.accent;return(()=>{const r=K8.cloneNode(!0),o=r.firstChild,i=o.firstChild;return nt(()=>Ee(i,"fill",n())),r})()},q8=ot(''),B0=e=>{const t=Et(),n=()=>e.fill||t.colors.accent;return(()=>{const r=q8.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},Q8=ot(''),Y8=e=>{const t=Et(),n=()=>e.fill||t.colors.accent;return(()=>{const r=Q8.cloneNode(!0),o=r.firstChild,i=o.firstChild;return nt(()=>Ee(i,"fill",n())),r})()},Z8=ot(''),G8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=Z8.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=e.class,s=n();return l!==i._v$&&Ee(r,"class",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},J8=ot(''),X8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=J8.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=e.class,s=n();return l!==i._v$&&Ee(r,"class",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},ey=ot(''),ty=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=ey.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=e.class,s=n();return l!==i._v$&&Ee(r,"class",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},ny=ot(''),ry=e=>{const t=Et(),n=()=>e.fill||t.colors.constant.white;return(()=>{const r=ny.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=e.class,s=n();return l!==i._v$&&Ee(r,"class",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},oy=ot(''),iy=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=oy.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=e.class,s=n();return l!==i._v$&&Ee(r,"class",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},ly=ot(''),Ag=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=ly.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=n(),s=n();return l!==i._v$&&Ee(r,"fill",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},sy=ot(''),Ef=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=sy.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},ay={m:"16px",s:"12px",none:"0"},cy={m:"6px",s:"6px",none:"0"},uy=z.div` + `;return de((()=>{const l=de(()=>n()==="xs");return()=>l()?(()=>{const s=I8.cloneNode(!0),c=s.firstChild;return nt(f=>{const d=ia(i,e.class),w=r();return d!==f._v$&&Ee(s,"class",f._v$=d),w!==f._v$2&&Ee(c,"fill",f._v$2=w),f},{_v$:void 0,_v$2:void 0}),s})():(()=>{const s=de(()=>n()==="s");return()=>s()?(()=>{const c=$8.cloneNode(!0),f=c.firstChild;return nt(d=>{const w=ia(i,e.class),h=r();return w!==d._v$3&&Ee(c,"class",d._v$3=w),h!==d._v$4&&Ee(f,"fill",d._v$4=h),d},{_v$3:void 0,_v$4:void 0}),c})():(()=>{const c=N8.cloneNode(!0),f=c.firstChild;return nt(d=>{const w=ia(i,e.class),h=r();return w!==d._v$5&&Ee(c,"class",d._v$5=w),h!==d._v$6&&Ee(f,"stroke",d._v$6=h),d},{_v$5:void 0,_v$6:void 0}),c})()})()})())},W8=ot(''),U8=()=>{const e=Et(),t=()=>e.theme===$t.DARK?e.colors.constant.white:e.colors.constant.black;return(()=>{const n=W8.cloneNode(!0),r=n.firstChild,o=r.nextSibling,i=o.nextSibling;return nt(()=>Ee(i,"fill",t())),n})()},O8=ot(''),B8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=O8.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},j8=ot(''),D8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.primary;return(()=>{const r=j8.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},H8=ot(''),F8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.primary;return(()=>{const r=H8.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},z8=ot(''),V8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.primary;return(()=>{const r=z8.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},K8=ot(''),Ll=e=>{const t=Et(),n=()=>e.fill||t.colors.accent;return(()=>{const r=K8.cloneNode(!0),o=r.firstChild,i=o.firstChild;return nt(()=>Ee(i,"fill",n())),r})()},q8=ot(''),B0=e=>{const t=Et(),n=()=>e.fill||t.colors.accent;return(()=>{const r=q8.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},Q8=ot(''),Y8=e=>{const t=Et(),n=()=>e.fill||t.colors.accent;return(()=>{const r=Q8.cloneNode(!0),o=r.firstChild,i=o.firstChild;return nt(()=>Ee(i,"fill",n())),r})()},Z8=ot(''),G8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=Z8.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=e.class,s=n();return l!==i._v$&&Ee(r,"class",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},J8=ot(''),X8=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=J8.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=e.class,s=n();return l!==i._v$&&Ee(r,"class",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},ey=ot(''),ty=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=ey.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=e.class,s=n();return l!==i._v$&&Ee(r,"class",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},ny=ot(''),ry=e=>{const t=Et(),n=()=>e.fill||t.colors.constant.white;return(()=>{const r=ny.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=e.class,s=n();return l!==i._v$&&Ee(r,"class",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},oy=ot(''),iy=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=oy.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=e.class,s=n();return l!==i._v$&&Ee(r,"class",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},ly=ot(''),Ag=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=ly.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=n(),s=n();return l!==i._v$&&Ee(r,"fill",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},sy=ot(''),Ef=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{const r=sy.cloneNode(!0),o=r.firstChild;return nt(()=>Ee(o,"fill",n())),r})()},ay={m:"16px",s:"12px",none:"0"},cy={m:"6px",s:"6px",none:"0"},uy=z.div` width: 60px; height: 60px; padding: 8px; @@ -530,7 +530,7 @@ PERFORMANCE OF THIS SOFTWARE. width: 20px; height: 20px; border-radius: ${e=>cy[e.theme.borderRadius]}; -`,Lg=e=>m(Ya,{get name(){return e.labelLine1},get secondLine(){return e.labelLine2},get icon(){return m(uy,{get children(){return m(us,{each:[0,1,2,3],children:t=>m(fy,{get src(){return e.images[t]}})})}})},onClick:()=>e.onClick()}),zr="telegram-wallet",vs={TON:"https://raw.githubusercontent.com/ton-connect/sdk/main/assets/ton-icon-48.png",TG:"https://raw.githubusercontent.com/ton-connect/sdk/main/assets/tg.png"},Pg=e=>{const[t]=Rr(),n=()=>{if(e.wallet.appName!==zr){if("isPreferred"in e.wallet&&e.wallet.isPreferred)return t("walletItem.recent",{},"Recent");if(Vo(e.wallet))return t("walletItem.installed",{},"Installed");if(e.wallet.name==="Tonkeeper")return t("walletItem.popular",{},"Popular")}};return de((()=>{const r=de(()=>e.wallet.appName===zr);return()=>r()?m(Ya,{get icon(){return e.wallet.imageUrl},get name(){return t("walletItem.walletOn",{},"Wallet On")},secondLine:"Telegram",get badgeUrl(){return vs.TG},onClick:()=>e.onClick()}):m(Ya,{get icon(){return e.wallet.imageUrl},get name(){return e.wallet.name},get secondLine(){return n()},secondLineColorPrimary:!1,onClick:()=>e.onClick()})})())},dy=z.div` +`,Lg=e=>m(Ya,{get name(){return e.labelLine1},get secondLine(){return e.labelLine2},get icon(){return m(uy,{get children(){return m(us,{each:[0,1,2,3],children:t=>m(fy,{get src(){return e.images[t]}})})}})},onClick:()=>e.onClick()}),Vr="telegram-wallet",vs={TON:"https://raw.githubusercontent.com/ton-connect/sdk/main/assets/ton-icon-48.png",TG:"https://raw.githubusercontent.com/ton-connect/sdk/main/assets/tg.png"},Pg=e=>{const[t]=Ir(),n=()=>{if(e.wallet.appName!==Vr){if("isPreferred"in e.wallet&&e.wallet.isPreferred)return t("walletItem.recent",{},"Recent");if(Vo(e.wallet))return t("walletItem.installed",{},"Installed");if(e.wallet.name==="Tonkeeper")return t("walletItem.popular",{},"Popular")}};return de((()=>{const r=de(()=>e.wallet.appName===Vr);return()=>r()?m(Ya,{get icon(){return e.wallet.imageUrl},get name(){return t("walletItem.walletOn",{},"Wallet On")},secondLine:"Telegram",get badgeUrl(){return vs.TG},onClick:()=>e.onClick()}):m(Ya,{get icon(){return e.wallet.imageUrl},get name(){return e.wallet.name},get secondLine(){return n()},secondLineColorPrimary:!1,onClick:()=>e.onClick()})})())},dy=z.div` width: 100%; overflow-y: auto; max-height: ${e=>e.maxHeight}; @@ -559,10 +559,10 @@ PERFORMANCE OF THIS SOFTWARE. width: 100%; margin: 0; } -`,[py,gy]=Ne(((C0=eo())==null?void 0:C0.innerHeight)||0);eo()&&window.addEventListener("resize",()=>gy(window.innerHeight));const[Hi,vy]=Ne(_i("mobile")),Za=()=>vy(_i("mobile"));eo()&&(window.addEventListener("resize",()=>Za()),window.addEventListener("load",()=>Za(),{once:!0}));const Mg=e=>{const[t,n]=Ne(!1),r=l=>{n(l.target.scrollTop>0)},o=()=>Hi()?150:200,i=()=>e.maxHeight!==void 0?`${e.maxHeight}px`:`${py()-o()}px`;return[m(hy,{get isShown(){return t()}}),m(dy,{get maxHeight(){return i()},onScroll:r,get class(){return e.class},get children(){return e.children}})]},my=z.a` +`,[py,gy]=We(((C0=eo())==null?void 0:C0.innerHeight)||0);eo()&&window.addEventListener("resize",()=>gy(window.innerHeight));const[Hi,vy]=We(_i("mobile")),Za=()=>vy(_i("mobile"));eo()&&(window.addEventListener("resize",()=>Za()),window.addEventListener("load",()=>Za(),{once:!0}));const Mg=e=>{const[t,n]=We(!1),r=l=>{n(l.target.scrollTop>0)},o=()=>Hi()?150:200,i=()=>e.maxHeight!==void 0?`${e.maxHeight}px`:`${py()-o()}px`;return[m(hy,{get isShown(){return t()}}),m(dy,{get maxHeight(){return i()},onScroll:r,get class(){return e.class},get children(){return e.children}})]},my=z.a` display: block; text-decoration: unset; -`,Ga=e=>m(my,Ar({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}})),Io=bc(),yy=ot(''),wy=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.primary;return(()=>{const r=yy.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=e.class,s=n();return l!==i._v$&&Ee(r,"class",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},xy=ot(''),Cy=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.primary;return(()=>{const r=xy.cloneNode(!0),o=r.firstChild,i=o.nextSibling;return nt(l=>{const s=n(),c=n();return s!==l._v$&&Ee(o,"fill",l._v$=s),c!==l._v$2&&Ee(i,"fill",l._v$2=c),l},{_v$:void 0,_v$2:void 0}),r})()},by={m:"8px",s:"4px",none:"0"},Sy={m:"16px",s:"8px",none:"0"},_y=z.div` +`,Ga=e=>m(my,Lr({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}})),Io=bc(),yy=ot(''),wy=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.primary;return(()=>{const r=yy.cloneNode(!0),o=r.firstChild;return nt(i=>{const l=e.class,s=n();return l!==i._v$&&Ee(r,"class",i._v$=l),s!==i._v$2&&Ee(o,"fill",i._v$2=s),i},{_v$:void 0,_v$2:void 0}),r})()},xy=ot(''),Cy=e=>{const t=Et(),n=()=>e.fill||t.colors.icon.primary;return(()=>{const r=xy.cloneNode(!0),o=r.firstChild,i=o.nextSibling;return nt(l=>{const s=n(),c=n();return s!==l._v$&&Ee(o,"fill",l._v$=s),c!==l._v$2&&Ee(i,"fill",l._v$2=c),l},{_v$:void 0,_v$2:void 0}),r})()},by={m:"8px",s:"4px",none:"0"},Sy={m:"16px",s:"8px",none:"0"},_y=z.div` width: 256px; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); border-radius: ${e=>Sy[e.theme.borderRadius]}; @@ -595,7 +595,7 @@ PERFORMANCE OF THIS SOFTWARE. &:active { transform: scale(0.96); } -`,D0=ot("
  • "),uu=e=>m(Gn,{get translationKey(){return e.translationKey},fontSize:"15px",fontWeight:"590",get children(){return e.children}}),Ey=e=>{const t=In(Io),[n,r]=Ne(!1),o=()=>xt(void 0,null,function*(){const l=Fp(t.account.address,t.account.chain===Ra.TESTNET);yield Dd(l),r(!0),setTimeout(()=>r(!1),1e3)}),i=()=>{t.disconnect(),e.onClose()};return m(_y,{ref(l){const s=e.ref;typeof s=="function"?s(l):e.ref=l},get class(){return e.class},"data-tc-dropdown":"true",get children(){return m(ky,{get children(){return[(()=>{const l=D0.cloneNode(!0);return _n(l,m(j0,{onClick:()=>o(),get children(){return[m(wy,{}),m(je,{get when(){return!n()},get children(){return m(uu,{translationKey:"button.dropdown.copy",children:"Copy address"})}}),m(je,{get when(){return n()},get children(){return m(uu,{translationKey:"button.dropdown.copied",children:"Address copied!"})}})]}})),l})(),(()=>{const l=D0.cloneNode(!0);return _n(l,m(j0,{onClick:()=>i(),get children(){return[m(Cy,{}),m(uu,{translationKey:"button.dropdown.disconnect",children:"Disconnect"})]}})),l})()]}})}})},Ty={m:"16px",s:"8px",none:"0"},Ay=z.div` +`,D0=ot("
  • "),uu=e=>m(Gn,{get translationKey(){return e.translationKey},fontSize:"15px",fontWeight:"590",get children(){return e.children}}),Ey=e=>{const t=In(Io),[n,r]=We(!1),o=()=>xt(void 0,null,function*(){const l=Fp(t.account.address,t.account.chain===Ra.TESTNET);yield Dd(l),r(!0),setTimeout(()=>r(!1),1e3)}),i=()=>{t.disconnect(),e.onClose()};return m(_y,{ref(l){const s=e.ref;typeof s=="function"?s(l):e.ref=l},get class(){return e.class},"data-tc-dropdown":"true",get children(){return m(ky,{get children(){return[(()=>{const l=D0.cloneNode(!0);return _n(l,m(j0,{onClick:()=>o(),get children(){return[m(wy,{}),m(je,{get when(){return!n()},get children(){return m(uu,{translationKey:"button.dropdown.copy",children:"Copy address"})}}),m(je,{get when(){return n()},get children(){return m(uu,{translationKey:"button.dropdown.copied",children:"Address copied!"})}})]}})),l})(),(()=>{const l=D0.cloneNode(!0);return _n(l,m(j0,{onClick:()=>i(),get children(){return[m(Cy,{}),m(uu,{translationKey:"button.dropdown.disconnect",children:"Disconnect"})]}})),l})()]}})}})},Ty={m:"16px",s:"8px",none:"0"},Ay=z.div` width: 256px; padding: 12px 16px; display: flex; @@ -613,16 +613,16 @@ PERFORMANCE OF THIS SOFTWARE. `,Py=z(Gn)` margin-top: 4px; color: ${e=>e.theme.colors.text.secondary}; -`,zd=e=>{const t=gs(e);return m(Ay,Ar({get class(){return e.class},"data-tc-notification":"true"},t,{get children(){return[m(Ly,{get children(){return[m(Hd,{get translationKey(){return e.header.translationKey},get translationValues(){return e.header.translationValues},get children(){return e.children}}),m(je,{get when(){return e.text},get children(){return m(Py,{get translationKey(){return e.text.translationKey},get translationValues(){return e.text.translationValues}})}})]}}),de(()=>e.icon)]}}))},My=z(to)` +`,zd=e=>{const t=gs(e);return m(Ay,Lr({get class(){return e.class},"data-tc-notification":"true"},t,{get children(){return[m(Ly,{get children(){return[m(Hd,{get translationKey(){return e.header.translationKey},get translationValues(){return e.header.translationValues},get children(){return e.children}}),m(je,{get when(){return e.text},get children(){return m(Py,{get translationKey(){return e.text.translationKey},get translationValues(){return e.text.translationValues}})}})]}}),de(()=>e.icon)]}}))},My=z(to)` align-self: center; -`,Ry=e=>{const t=In(Io),[n]=Rr(),r=()=>t.wallet&&"name"in t.wallet?t.wallet.name:n("common.yourWallet",{},"Your wallet");return m(zd,{get header(){return{translationKey:"notifications.confirm.header",translationValues:{name:r()}}},get class(){return e.class},get icon(){return m(My,{})},"data-tc-notification-confirm":"true",children:"Confirm operation in your wallet"})},Iy=z(Tc)` +`,Ry=e=>{const t=In(Io),[n]=Ir(),r=()=>t.wallet&&"name"in t.wallet?t.wallet.name:n("common.yourWallet",{},"Your wallet");return m(zd,{get header(){return{translationKey:"notifications.confirm.header",translationValues:{name:r()}}},get class(){return e.class},get icon(){return m(My,{})},"data-tc-notification-confirm":"true",children:"Confirm operation in your wallet"})},Iy=z(Tc)` margin-top: 2px; -`,$y=e=>m(zd,{header:{translationKey:"notifications.transactionCanceled.header"},text:{translationKey:"notifications.transactionCanceled.text"},get icon(){return m(Iy,{size:"xs"})},get class(){return e.class},"data-tc-notification-tx-cancelled":"true",children:"Transaction cancelled"}),Wy=z(Fd)` +`,$y=e=>m(zd,{header:{translationKey:"notifications.transactionCanceled.header"},text:{translationKey:"notifications.transactionCanceled.text"},get icon(){return m(Iy,{size:"xs"})},get class(){return e.class},"data-tc-notification-tx-cancelled":"true",children:"Transaction cancelled"}),Ny=z(Fd)` margin-top: 2px; -`,Ny=e=>m(zd,{header:{translationKey:"notifications.transactionSent.header"},text:{translationKey:"notifications.transactionSent.text"},get icon(){return m(Wy,{})},get class(){return e.class},"data-tc-notification-tx-sent":"true",children:"Transaction sent"}),fu=Zr` +`,Wy=e=>m(zd,{header:{translationKey:"notifications.transactionSent.header"},text:{translationKey:"notifications.transactionSent.text"},get icon(){return m(Ny,{})},get class(){return e.class},"data-tc-notification-tx-sent":"true",children:"Transaction sent"}),fu=Zr` transform: translateY(-8px); margin-bottom: 12px; -`,Uy={timeout:4500},[H0,Oy]=Ne(null);function By(e){const{timeout:t}=Ct(Ct({},Uy),e),[n,r]=Ne([]),[o,i]=Ne([]);return cn(Vm(Or,l=>{var s;if(!l||!l.showNotification||H0()===l||((s=H0())==null?void 0:s.name)==="confirm-transaction"&&l.name==="confirm-transaction")return;Oy(l),r(d=>d.filter(w=>w.action!=="confirm-transaction"));const c={action:l.name};r(d=>[...d,c]);const f=setTimeout(()=>{r(d=>d.filter(w=>w!==c)),i(d=>d.filter(w=>w!==f))},t);i(d=>[...d,f])})),Rn(()=>{o().forEach(l=>clearTimeout(l))}),n}const jy=ot('
    '),Dy=e=>{const t=By();return(()=>{const n=jy.cloneNode(!0);return _n(n,m(E6,{onBeforeEnter:r=>{_r(r,[{opacity:0,transform:"translateY(0)"},{opacity:1,transform:"translateY(-8px)"}],{duration:200})},onExit:(r,o)=>{_r(r,[{opacity:1,transform:"translateY(-8px)"},{opacity:0,transform:"translateY(-30px)"}],{duration:200}).finished.then(o)},get children(){return m(us,{get each(){return t()},children:r=>m(fs,{get children(){return[m(pn,{get when(){return r.action==="transaction-sent"},get children(){return m(Ny,{class:fu})}}),m(pn,{get when(){return r.action==="transaction-canceled"},get children(){return m($y,{class:fu})}}),m(pn,{get when(){return r.action==="confirm-transaction"},get children(){return m(Ry,{class:fu})}})]}})})}})),nt(()=>Md(n,e.class)),n})()},Rg=z(Yt)` +`,Uy={timeout:4500},[H0,Oy]=We(null);function By(e){const{timeout:t}=Ct(Ct({},Uy),e),[n,r]=We([]),[o,i]=We([]);return un(Vm(Br,l=>{var s;if(!l||!l.showNotification||H0()===l||((s=H0())==null?void 0:s.name)==="confirm-transaction"&&l.name==="confirm-transaction")return;Oy(l),r(d=>d.filter(w=>w.action!=="confirm-transaction"));const c={action:l.name};r(d=>[...d,c]);const f=setTimeout(()=>{r(d=>d.filter(w=>w!==c)),i(d=>d.filter(w=>w!==f))},t);i(d=>[...d,f])})),Rn(()=>{o().forEach(l=>clearTimeout(l))}),n}const jy=ot('
    '),Dy=e=>{const t=By();return(()=>{const n=jy.cloneNode(!0);return _n(n,m(E6,{onBeforeEnter:r=>{kr(r,[{opacity:0,transform:"translateY(0)"},{opacity:1,transform:"translateY(-8px)"}],{duration:200})},onExit:(r,o)=>{kr(r,[{opacity:1,transform:"translateY(-8px)"},{opacity:0,transform:"translateY(-30px)"}],{duration:200}).finished.then(o)},get children(){return m(us,{get each(){return t()},children:r=>m(fs,{get children(){return[m(pn,{get when(){return r.action==="transaction-sent"},get children(){return m(Wy,{class:fu})}}),m(pn,{get when(){return r.action==="transaction-canceled"},get children(){return m($y,{class:fu})}}),m(pn,{get when(){return r.action==="confirm-transaction"},get children(){return m(Ry,{class:fu})}})]}})})}})),nt(()=>Md(n,e.class)),n})()},Rg=z(Yt)` background-color: ${e=>e.theme.colors.connectButton.background}; color: ${e=>e.theme.colors.connectButton.foreground}; box-shadow: ${e=>`0 4px 24px ${ds(e.theme.colors.constant.black,.16)}`}; @@ -664,7 +664,7 @@ PERFORMANCE OF THIS SOFTWARE. > div:first-child { margin-top: 20px; } -`;function Ig(e){return e.split("-")[0]}function Qy(e){return e.split("-")[1]}function Yy(e){return["top","bottom"].includes(Ig(e))?"x":"y"}function Zy(e){return e==="y"?"height":"width"}function F0(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,l=r.y+r.height/2-o.height/2,s=Yy(t),c=Zy(s),f=r[c]/2-o[c]/2,d=Ig(t),w=s==="x";let h;switch(d){case"top":h={x:i,y:r.y-o.height};break;case"bottom":h={x:i,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:l};break;case"left":h={x:r.x-o.width,y:l};break;default:h={x:r.x,y:r.y}}switch(Qy(t)){case"start":h[s]-=f*(n&&w?-1:1);break;case"end":h[s]+=f*(n&&w?-1:1);break}return h}const Gy=(e,t,n)=>xt(void 0,null,function*(){const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),c=yield l.isRTL==null?void 0:l.isRTL(t);let f=yield l.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:w}=F0(f,r,c),h=r,S={},C=0;for(let _=0;_t.brand+"/"+t.version).join(" "),Fs):navigator.userAgent}function Mr(e){return e instanceof no(e).HTMLElement}function lr(e){return e instanceof no(e).Element}function Wg(e){return e instanceof no(e).Node}function V0(e){if(typeof ShadowRoot>"u")return!1;const t=no(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Ac(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Pr(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function Jy(e){return["table","td","th"].includes(To(e))}function Vd(e){const t=/firefox/i.test($g()),n=Pr(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||(r?r!=="none":!1)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)||["transform","perspective"].some(o=>n.willChange.includes(o))||["paint","layout","strict","content"].some(o=>{const i=n.contain;return i!=null?i.includes(o):!1})}function Ng(){return!/^((?!chrome|android).)*safari/i.test($g())}function Kd(e){return["html","body","#document"].includes(To(e))}const K0=Math.min,Pl=Math.max,q0=Math.round,Tf={x:1,y:1};function rs(e){const t=!lr(e)&&e.contextElement?e.contextElement:lr(e)?e:null;if(!t)return Tf;const n=t.getBoundingClientRect(),r=Pr(t);if(r.boxSizing!=="border-box")return Mr(t)?{x:t.offsetWidth>0&&q0(n.width)/t.offsetWidth||1,y:t.offsetHeight>0&&q0(n.height)/t.offsetHeight||1}:Tf;let o=n.width/parseFloat(r.width),i=n.height/parseFloat(r.height);return(!o||!Number.isFinite(o))&&(o=1),(!i||!Number.isFinite(i))&&(i=1),{x:o,y:i}}function Ao(e,t,n,r){var o,i,l,s;t===void 0&&(t=!1),n===void 0&&(n=!1);const c=e.getBoundingClientRect();let f=Tf;t&&(r?lr(r)&&(f=rs(r)):f=rs(e));const d=lr(e)?no(e):window,w=!Ng()&&n,h=(c.left+(w&&(o=(i=d.visualViewport)==null?void 0:i.offsetLeft)!=null?o:0))/f.x,S=(c.top+(w&&(l=(s=d.visualViewport)==null?void 0:s.offsetTop)!=null?l:0))/f.y,C=c.width/f.x,_=c.height/f.y;return{width:C,height:_,top:S,right:h+C,bottom:S+_,left:h,x:h,y:S}}function $o(e){return((Wg(e)?e.ownerDocument:e.document)||window.document).documentElement}function Lc(e){return lr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ug(e){return Ao($o(e)).left+Lc(e).scrollLeft}function Xy(e,t,n){const r=Mr(t),o=$o(t),i=Ao(e,!0,n==="fixed",t);let l={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((To(t)!=="body"||Ac(o))&&(l=Lc(t)),Mr(t)){const c=Ao(t,!0);s.x=c.x+t.clientLeft,s.y=c.y+t.clientTop}else o&&(s.x=Ug(o));return{x:i.left+l.scrollLeft-s.x,y:i.top+l.scrollTop-s.y,width:i.width,height:i.height}}function os(e){if(To(e)==="html")return e;const t=e.assignedSlot||e.parentNode||(V0(e)?e.host:null)||$o(e);return V0(t)?t.host:t}function Q0(e){return!Mr(e)||Pr(e).position==="fixed"?null:e.offsetParent}function ew(e){let t=os(e);for(;Mr(t)&&!Kd(t);){if(Vd(t))return t;t=os(t)}return null}function Y0(e){const t=no(e);let n=Q0(e);for(;n&&Jy(n)&&Pr(n).position==="static";)n=Q0(n);return n&&(To(n)==="html"||To(n)==="body"&&Pr(n).position==="static"&&!Vd(n))?t:n||ew(e)||t}function tw(e){if(Mr(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Ao(e);return{width:t.width,height:t.height}}function nw(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Mr(n),i=$o(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0},s={x:1,y:1};const c={x:0,y:0};if((o||!o&&r!=="fixed")&&((To(n)!=="body"||Ac(i))&&(l=Lc(n)),Mr(n))){const f=Ao(n);s=rs(n),c.x=f.x+n.clientLeft,c.y=f.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-l.scrollLeft*s.x+c.x,y:t.y*s.y-l.scrollTop*s.y+c.y}}function rw(e,t){const n=no(e),r=$o(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,c=0;if(o){i=o.width,l=o.height;const f=Ng();(f||!f&&t==="fixed")&&(s=o.offsetLeft,c=o.offsetTop)}return{width:i,height:l,x:s,y:c}}function ow(e){var t;const n=$o(e),r=Lc(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Pl(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),l=Pl(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let s=-r.scrollLeft+Ug(e);const c=-r.scrollTop;return Pr(o||n).direction==="rtl"&&(s+=Pl(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:l,x:s,y:c}}function Og(e){const t=os(e);return Kd(t)?e.ownerDocument.body:Mr(t)&&Ac(t)?t:Og(t)}function Ml(e,t){var n;t===void 0&&(t=[]);const r=Og(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=no(r);return o?t.concat(i,i.visualViewport||[],Ac(r)?r:[]):t.concat(r,Ml(r))}function iw(e,t){const n=Ao(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Mr(e)?rs(e):{x:1,y:1},l=e.clientWidth*i.x,s=e.clientHeight*i.y,c=o*i.x,f=r*i.y;return{top:f,left:c,right:c+l,bottom:f+s,x:c,y:f,width:l,height:s}}function Z0(e,t,n){return t==="viewport"?z0(rw(e,n)):lr(t)?iw(t,n):z0(ow($o(e)))}function lw(e,t){const n=t.get(e);if(n)return n;let r=Ml(e).filter(s=>lr(s)&&To(s)!=="body"),o=null;const i=Pr(e).position==="fixed";let l=i?os(e):e;for(;lr(l)&&!Kd(l);){const s=Pr(l),c=Vd(l);(i?!c&&!o:!c&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position))?r=r.filter(d=>d!==l):o=s,l=os(l)}return t.set(e,r),r}function sw(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?lw(t,this._c):[].concat(n),r],s=l[0],c=l.reduce((f,d)=>{const w=Z0(t,d,o);return f.top=Pl(w.top,f.top),f.right=K0(w.right,f.right),f.bottom=K0(w.bottom,f.bottom),f.left=Pl(w.left,f.left),f},Z0(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}const aw={getClippingRect:sw,convertOffsetParentRelativeRectToViewportRelativeRect:nw,isElement:lr,getDimensions:tw,getOffsetParent:Y0,getDocumentElement:$o,getScale:rs,getElementRects(e){return xt(this,null,function*(){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Y0,i=this.getDimensions;return{reference:Xy(t,yield o(n),r),floating:Ct({x:0,y:0},yield i(n))}})},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Pr(e).direction==="rtl"};function cw(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=!0,animationFrame:s=!1}=r,c=o&&!s,f=c||i?[...lr(e)?Ml(e):e.contextElement?Ml(e.contextElement):[],...Ml(t)]:[];f.forEach(C=>{c&&C.addEventListener("scroll",n,{passive:!0}),i&&C.addEventListener("resize",n)});let d=null;if(l){let C=!0;d=new ResizeObserver(()=>{C||n(),C=!1}),lr(e)&&!s&&d.observe(e),!lr(e)&&e.contextElement&&!s&&d.observe(e.contextElement),d.observe(t)}let w,h=s?Ao(e):null;s&&S();function S(){const C=Ao(e);h&&(C.x!==h.x||C.y!==h.y||C.width!==h.width||C.height!==h.height)&&n(),h=C,w=requestAnimationFrame(S)}return n(),()=>{var C;f.forEach(_=>{c&&_.removeEventListener("scroll",n),i&&_.removeEventListener("resize",n)}),(C=d)==null||C.disconnect(),d=null,s&&cancelAnimationFrame(w)}}const uw=(e,t,n)=>{const r=new Map,o=Ct({platform:aw},n),i=Qn(Ct({},o.platform),{_c:r});return Gy(e,t,Qn(Ct({},o),{platform:i}))};function fw(e,t,n){let r=()=>{var w;return(w=n==null?void 0:n.placement)!=null?w:"bottom"},o=()=>{var w;return(w=n==null?void 0:n.strategy)!=null?w:"absolute"},[i,l]=Ne({x:null,y:null,placement:r(),strategy:o(),middlewareData:{}}),[s,c]=Ne();cn(()=>{let w=s();if(w)throw w.value});let f=de(()=>(e(),t(),{}));function d(){let w=e(),h=t();if(w&&h){let S=f();uw(w,h,{middleware:n==null?void 0:n.middleware,placement:r(),strategy:o()}).then(C=>{S===f()&&l(C)},C=>{c(C)})}}return cn(()=>{let w=e(),h=t();if(n==null||n.middleware,r(),o(),w&&h)if(n!=null&&n.whileElementsMounted){let S=n.whileElementsMounted(w,h,d);S&&Rn(S)}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}}const dw=ot(''),hw=()=>{const e=Et(),t=In(Yi),n=In(Io),[r,o]=Ne(!1),[i,l]=Ne(t.account),[s,c]=Ne(!t.account);let f;const[d,w]=Ne(),[h,S]=Ne(),C=fw(h,d,{whileElementsMounted:cw,placement:"bottom-end"}),_=()=>{const p=i();if(p){const y=Fp(p.address,p.chain===Ra.TESTNET);return y.slice(0,4)+"…"+y.slice(-4)}return""};n.connectionRestored.then(()=>c(!1));const O=t.onStatusChange(p=>{if(!p){o(!1),l(null),c(!1);return}l(p.account),c(!1)}),b=p=>{if(!i()||!r())return;const y=h().contains(p.target),E=f.contains(p.target);!y&&!E&&o(!1)};return Km(()=>{document.body.addEventListener("click",b)}),Rn(()=>{document.body.removeEventListener("click",b),O()}),m(ji,{component:Ur,get children(){return[m(je,{get when(){return s()},get children(){return m(Fy,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return m(zy,{})}})}}),m(je,{get when(){return!s()},get children(){return[m(je,{get when(){return!i()},get children(){return m(Rg,{onClick:()=>n.openModal(),"data-tc-connect-button":"true",scale:"s",get children(){return[m(E8,{get fill(){return e.colors.connectButton.foreground}}),m(Gn,{translationKey:"button.connectWallet",fontSize:"15px",lineHeight:"18px",fontWeight:"590",get color(){return e.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),m(je,{get when(){return i()},get children(){return m(Vy,{get children(){return[m(Hy,{onClick:()=>o(p=>!p),ref:S,"data-tc-dropdown-button":"true",scale:"s",get children(){return[m(Gn,{fontSize:"15px",fontWeight:"590",lineHeight:"18px",get children(){return _()}}),m(Cg,{direction:"bottom"})]}}),m(ig,{get children(){const p=un(()=>document.importNode(dw,!0));return Al(w,p),p.style.setProperty("z-index","999"),p._$owner=qm(),_n(p,m(jd,{onBeforeEnter:y=>{_r(y,[{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(y,E)=>{_r(y,[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(E)},get children(){return m(je,{get when(){return r()},get children(){return m(Ky,{get hidden(){return!r()},onClose:()=>o(!1),ref(y){const E=f;typeof E=="function"?E(y):f=y}})}})}}),null),_n(p,m(qy,{}),null),nt(y=>{var E,T;const W=C.strategy,I=`${(E=C.y)!=null?E:0}px`,L=`${(T=C.x)!=null?T:0}px`;return W!==y._v$&&p.style.setProperty("position",y._v$=W),I!==y._v$2&&p.style.setProperty("top",y._v$2=I),L!==y._v$3&&p.style.setProperty("left",y._v$3=L),y},{_v$:void 0,_v$2:void 0,_v$3:void 0}),p}})]}})}})]}})]}})},Bg=z(Sg)` +`;function Ig(e){return e.split("-")[0]}function Qy(e){return e.split("-")[1]}function Yy(e){return["top","bottom"].includes(Ig(e))?"x":"y"}function Zy(e){return e==="y"?"height":"width"}function F0(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,l=r.y+r.height/2-o.height/2,s=Yy(t),c=Zy(s),f=r[c]/2-o[c]/2,d=Ig(t),w=s==="x";let h;switch(d){case"top":h={x:i,y:r.y-o.height};break;case"bottom":h={x:i,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:l};break;case"left":h={x:r.x-o.width,y:l};break;default:h={x:r.x,y:r.y}}switch(Qy(t)){case"start":h[s]-=f*(n&&w?-1:1);break;case"end":h[s]+=f*(n&&w?-1:1);break}return h}const Gy=(e,t,n)=>xt(void 0,null,function*(){const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),c=yield l.isRTL==null?void 0:l.isRTL(t);let f=yield l.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:w}=F0(f,r,c),h=r,S={},C=0;for(let _=0;_t.brand+"/"+t.version).join(" "),Fs):navigator.userAgent}function Rr(e){return e instanceof no(e).HTMLElement}function lr(e){return e instanceof no(e).Element}function Ng(e){return e instanceof no(e).Node}function V0(e){if(typeof ShadowRoot>"u")return!1;const t=no(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Ac(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Mr(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function Jy(e){return["table","td","th"].includes(To(e))}function Vd(e){const t=/firefox/i.test($g()),n=Mr(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||(r?r!=="none":!1)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)||["transform","perspective"].some(o=>n.willChange.includes(o))||["paint","layout","strict","content"].some(o=>{const i=n.contain;return i!=null?i.includes(o):!1})}function Wg(){return!/^((?!chrome|android).)*safari/i.test($g())}function Kd(e){return["html","body","#document"].includes(To(e))}const K0=Math.min,Pl=Math.max,q0=Math.round,Tf={x:1,y:1};function rs(e){const t=!lr(e)&&e.contextElement?e.contextElement:lr(e)?e:null;if(!t)return Tf;const n=t.getBoundingClientRect(),r=Mr(t);if(r.boxSizing!=="border-box")return Rr(t)?{x:t.offsetWidth>0&&q0(n.width)/t.offsetWidth||1,y:t.offsetHeight>0&&q0(n.height)/t.offsetHeight||1}:Tf;let o=n.width/parseFloat(r.width),i=n.height/parseFloat(r.height);return(!o||!Number.isFinite(o))&&(o=1),(!i||!Number.isFinite(i))&&(i=1),{x:o,y:i}}function Ao(e,t,n,r){var o,i,l,s;t===void 0&&(t=!1),n===void 0&&(n=!1);const c=e.getBoundingClientRect();let f=Tf;t&&(r?lr(r)&&(f=rs(r)):f=rs(e));const d=lr(e)?no(e):window,w=!Wg()&&n,h=(c.left+(w&&(o=(i=d.visualViewport)==null?void 0:i.offsetLeft)!=null?o:0))/f.x,S=(c.top+(w&&(l=(s=d.visualViewport)==null?void 0:s.offsetTop)!=null?l:0))/f.y,C=c.width/f.x,_=c.height/f.y;return{width:C,height:_,top:S,right:h+C,bottom:S+_,left:h,x:h,y:S}}function $o(e){return((Ng(e)?e.ownerDocument:e.document)||window.document).documentElement}function Lc(e){return lr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ug(e){return Ao($o(e)).left+Lc(e).scrollLeft}function Xy(e,t,n){const r=Rr(t),o=$o(t),i=Ao(e,!0,n==="fixed",t);let l={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((To(t)!=="body"||Ac(o))&&(l=Lc(t)),Rr(t)){const c=Ao(t,!0);s.x=c.x+t.clientLeft,s.y=c.y+t.clientTop}else o&&(s.x=Ug(o));return{x:i.left+l.scrollLeft-s.x,y:i.top+l.scrollTop-s.y,width:i.width,height:i.height}}function os(e){if(To(e)==="html")return e;const t=e.assignedSlot||e.parentNode||(V0(e)?e.host:null)||$o(e);return V0(t)?t.host:t}function Q0(e){return!Rr(e)||Mr(e).position==="fixed"?null:e.offsetParent}function ew(e){let t=os(e);for(;Rr(t)&&!Kd(t);){if(Vd(t))return t;t=os(t)}return null}function Y0(e){const t=no(e);let n=Q0(e);for(;n&&Jy(n)&&Mr(n).position==="static";)n=Q0(n);return n&&(To(n)==="html"||To(n)==="body"&&Mr(n).position==="static"&&!Vd(n))?t:n||ew(e)||t}function tw(e){if(Rr(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Ao(e);return{width:t.width,height:t.height}}function nw(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Rr(n),i=$o(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0},s={x:1,y:1};const c={x:0,y:0};if((o||!o&&r!=="fixed")&&((To(n)!=="body"||Ac(i))&&(l=Lc(n)),Rr(n))){const f=Ao(n);s=rs(n),c.x=f.x+n.clientLeft,c.y=f.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-l.scrollLeft*s.x+c.x,y:t.y*s.y-l.scrollTop*s.y+c.y}}function rw(e,t){const n=no(e),r=$o(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,c=0;if(o){i=o.width,l=o.height;const f=Wg();(f||!f&&t==="fixed")&&(s=o.offsetLeft,c=o.offsetTop)}return{width:i,height:l,x:s,y:c}}function ow(e){var t;const n=$o(e),r=Lc(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Pl(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),l=Pl(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let s=-r.scrollLeft+Ug(e);const c=-r.scrollTop;return Mr(o||n).direction==="rtl"&&(s+=Pl(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:l,x:s,y:c}}function Og(e){const t=os(e);return Kd(t)?e.ownerDocument.body:Rr(t)&&Ac(t)?t:Og(t)}function Ml(e,t){var n;t===void 0&&(t=[]);const r=Og(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=no(r);return o?t.concat(i,i.visualViewport||[],Ac(r)?r:[]):t.concat(r,Ml(r))}function iw(e,t){const n=Ao(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Rr(e)?rs(e):{x:1,y:1},l=e.clientWidth*i.x,s=e.clientHeight*i.y,c=o*i.x,f=r*i.y;return{top:f,left:c,right:c+l,bottom:f+s,x:c,y:f,width:l,height:s}}function Z0(e,t,n){return t==="viewport"?z0(rw(e,n)):lr(t)?iw(t,n):z0(ow($o(e)))}function lw(e,t){const n=t.get(e);if(n)return n;let r=Ml(e).filter(s=>lr(s)&&To(s)!=="body"),o=null;const i=Mr(e).position==="fixed";let l=i?os(e):e;for(;lr(l)&&!Kd(l);){const s=Mr(l),c=Vd(l);(i?!c&&!o:!c&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position))?r=r.filter(d=>d!==l):o=s,l=os(l)}return t.set(e,r),r}function sw(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?lw(t,this._c):[].concat(n),r],s=l[0],c=l.reduce((f,d)=>{const w=Z0(t,d,o);return f.top=Pl(w.top,f.top),f.right=K0(w.right,f.right),f.bottom=K0(w.bottom,f.bottom),f.left=Pl(w.left,f.left),f},Z0(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}const aw={getClippingRect:sw,convertOffsetParentRelativeRectToViewportRelativeRect:nw,isElement:lr,getDimensions:tw,getOffsetParent:Y0,getDocumentElement:$o,getScale:rs,getElementRects(e){return xt(this,null,function*(){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Y0,i=this.getDimensions;return{reference:Xy(t,yield o(n),r),floating:Ct({x:0,y:0},yield i(n))}})},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Mr(e).direction==="rtl"};function cw(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=!0,animationFrame:s=!1}=r,c=o&&!s,f=c||i?[...lr(e)?Ml(e):e.contextElement?Ml(e.contextElement):[],...Ml(t)]:[];f.forEach(C=>{c&&C.addEventListener("scroll",n,{passive:!0}),i&&C.addEventListener("resize",n)});let d=null;if(l){let C=!0;d=new ResizeObserver(()=>{C||n(),C=!1}),lr(e)&&!s&&d.observe(e),!lr(e)&&e.contextElement&&!s&&d.observe(e.contextElement),d.observe(t)}let w,h=s?Ao(e):null;s&&S();function S(){const C=Ao(e);h&&(C.x!==h.x||C.y!==h.y||C.width!==h.width||C.height!==h.height)&&n(),h=C,w=requestAnimationFrame(S)}return n(),()=>{var C;f.forEach(_=>{c&&_.removeEventListener("scroll",n),i&&_.removeEventListener("resize",n)}),(C=d)==null||C.disconnect(),d=null,s&&cancelAnimationFrame(w)}}const uw=(e,t,n)=>{const r=new Map,o=Ct({platform:aw},n),i=Qn(Ct({},o.platform),{_c:r});return Gy(e,t,Qn(Ct({},o),{platform:i}))};function fw(e,t,n){let r=()=>{var w;return(w=n==null?void 0:n.placement)!=null?w:"bottom"},o=()=>{var w;return(w=n==null?void 0:n.strategy)!=null?w:"absolute"},[i,l]=We({x:null,y:null,placement:r(),strategy:o(),middlewareData:{}}),[s,c]=We();un(()=>{let w=s();if(w)throw w.value});let f=de(()=>(e(),t(),{}));function d(){let w=e(),h=t();if(w&&h){let S=f();uw(w,h,{middleware:n==null?void 0:n.middleware,placement:r(),strategy:o()}).then(C=>{S===f()&&l(C)},C=>{c(C)})}}return un(()=>{let w=e(),h=t();if(n==null||n.middleware,r(),o(),w&&h)if(n!=null&&n.whileElementsMounted){let S=n.whileElementsMounted(w,h,d);S&&Rn(S)}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}}const dw=ot(''),hw=()=>{const e=Et(),t=In(Yi),n=In(Io),[r,o]=We(!1),[i,l]=We(t.account),[s,c]=We(!t.account);let f;const[d,w]=We(),[h,S]=We(),C=fw(h,d,{whileElementsMounted:cw,placement:"bottom-end"}),_=()=>{const p=i();if(p){const y=Fp(p.address,p.chain===Ra.TESTNET);return y.slice(0,4)+"…"+y.slice(-4)}return""};n.connectionRestored.then(()=>c(!1));const O=t.onStatusChange(p=>{if(!p){o(!1),l(null),c(!1);return}l(p.account),c(!1)}),b=p=>{if(!i()||!r())return;const y=h().contains(p.target),E=f.contains(p.target);!y&&!E&&o(!1)};return Km(()=>{document.body.addEventListener("click",b)}),Rn(()=>{document.body.removeEventListener("click",b),O()}),m(ji,{component:Or,get children(){return[m(je,{get when(){return s()},get children(){return m(Fy,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return m(zy,{})}})}}),m(je,{get when(){return!s()},get children(){return[m(je,{get when(){return!i()},get children(){return m(Rg,{onClick:()=>n.openModal(),"data-tc-connect-button":"true",scale:"s",get children(){return[m(E8,{get fill(){return e.colors.connectButton.foreground}}),m(Gn,{translationKey:"button.connectWallet",fontSize:"15px",lineHeight:"18px",fontWeight:"590",get color(){return e.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),m(je,{get when(){return i()},get children(){return m(Vy,{get children(){return[m(Hy,{onClick:()=>o(p=>!p),ref:S,"data-tc-dropdown-button":"true",scale:"s",get children(){return[m(Gn,{fontSize:"15px",fontWeight:"590",lineHeight:"18px",get children(){return _()}}),m(Cg,{direction:"bottom"})]}}),m(ig,{get children(){const p=fn(()=>document.importNode(dw,!0));return Al(w,p),p.style.setProperty("z-index","999"),p._$owner=qm(),_n(p,m(jd,{onBeforeEnter:y=>{kr(y,[{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(y,E)=>{kr(y,[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(E)},get children(){return m(je,{get when(){return r()},get children(){return m(Ky,{get hidden(){return!r()},onClose:()=>o(!1),ref(y){const E=f;typeof E=="function"?E(y):f=y}})}})}}),null),_n(p,m(qy,{}),null),nt(y=>{var E,T;const N=C.strategy,I=`${(E=C.y)!=null?E:0}px`,L=`${(T=C.x)!=null?T:0}px`;return N!==y._v$&&p.style.setProperty("position",y._v$=N),I!==y._v$2&&p.style.setProperty("top",y._v$2=I),L!==y._v$3&&p.style.setProperty("left",y._v$3=L),y},{_v$:void 0,_v$2:void 0,_v$3:void 0}),p}})]}})}})]}})]}})},Bg=z(Sg)` padding-left: 24px; padding-right: 24px; padding-top: 18px; @@ -676,7 +676,7 @@ PERFORMANCE OF THIS SOFTWARE. min-height: 364px; } -`,jg=z(Ir)` +`,jg=z($r)` margin-top: 12px; ${er("mobile")} { @@ -702,7 +702,7 @@ PERFORMANCE OF THIS SOFTWARE. display: flex; flex-direction: column; align-items: center; -`,yw=z(Ir)` +`,yw=z($r)` margin-bottom: 18px; `;z.div` height: 1px; @@ -759,7 +759,7 @@ PERFORMANCE OF THIS SOFTWARE. min-height: 232px; `,Aw=z(Ec)` margin-bottom: 24px; -`,Lw=z(Ir)` +`,Lw=z($r)` max-width: 288px; margin: 0 auto 2px; `,Pw=z(Ro)` @@ -788,7 +788,7 @@ PERFORMANCE OF THIS SOFTWARE. color: ${e=>e.theme.colors.text.secondary}; text-align: center; margin-bottom: 20px; -`,Ww=z(Yt)` +`,Nw=z(Yt)` margin-top: -8px; margin-bottom: 24px; width: 100%; @@ -796,15 +796,15 @@ PERFORMANCE OF THIS SOFTWARE. border-radius: ${e=>_w[e.theme.borderRadius]}; font-size: 16px; line-height: 20px; -`,Nw=z(ri)` +`,Ww=z(ri)` width: 32px; height: 32px; border-radius: ${e=>kw[e.theme.borderRadius]}; -`,ln=e=>{const[t]=Rr();return de(()=>{var n;return t(e.translationKey,e.translationValues,(n=e.children)==null?void 0:n.toString())})};function St(e,t){let n;typeof t=="string"?n=t:n=Gr()?t.twaReturnUrl||t.returnStrategy:"none";const r=Uw(e,"ret",n);if(!zo(e))return r;const o=r.slice(r.lastIndexOf("&")+1);return r.slice(0,r.lastIndexOf("&"))+"-"+Ep(o)}function ms(e,t){t=Ct({},t);const n=Ow(e),r=new URL(n);if(r.searchParams.has("startapp")||r.searchParams.append("startapp","tonconnect"),Gr())Dr("ios","android","macos")?(t.returnStrategy="back",t.twaReturnUrl=void 0,hl(St(r.toString(),t))):Dr("tdesktop")||Dr("weba")?hl(St(r.toString(),t)):Dr("web")?(t.returnStrategy="back",t.twaReturnUrl=void 0,hl(St(r.toString(),t))):Pt(St(r.toString(),t));else if(Sr("ios")){t.returnStrategy==="back"&&(Xe("safari")?t.returnStrategy="back":Xe("chrome")?t.returnStrategy="googlechrome://":Xe("firefox")?t.returnStrategy="firefox://":Xe("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const o=Xe("chrome"),i=Xe("firefox");if((o||i)&&!t.forceRedirect){const s=St(r.toString(),t.returnStrategy),c=Ks(s);ho(c,()=>Pt(s))}else{const s=St(r.toString(),t.returnStrategy);Pt(s)}}else if(Sr("android")){t.returnStrategy="none";const o=Xe("chrome"),i=Xe("firefox");if((o||i)&&!t.forceRedirect){const s=St(r.toString(),t.returnStrategy),c=Ks(s);ho(c,()=>Pt(s))}else{const s=St(r.toString(),t.returnStrategy);Pt(s)}}else if(Sr("ipad")){t.returnStrategy==="back"&&(Xe("safari")?t.returnStrategy="back":Xe("chrome")?t.returnStrategy="googlechrome://":Xe("firefox")?t.returnStrategy="firefox://":Xe("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const o=Xe("chrome"),i=Xe("firefox");if((o||i)&&!t.forceRedirect){const s=St(r.toString(),t.returnStrategy),c=Ks(s);ho(c,()=>Pt(s))}else{const s=St(r.toString(),t.returnStrategy);Pt(s)}}else if(Sr("macos","windows","linux"))if(t.returnStrategy="none",t.twaReturnUrl=void 0,t.forceRedirect)Pt(St(r.toString(),t));else{const o=St(r.toString(),t),i=Ks(o);ho(i,()=>Pt(o))}else Pt(St(r.toString(),t))}function ys(e,t,n,r){if(n=Ct({},n),Gr())if(Dr("ios","android")){n.returnStrategy==="back"&&(n.returnStrategy="tg://resolve"),r("universal-link");const o=St(e,n.returnStrategy);hl(o,()=>{r("universal-link"),Pt(o)})}else if(Dr("macos","tdesktop")){n.returnStrategy==="back"&&(n.returnStrategy="tg://resolve");const o=St(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),ho(Ds(o,t),()=>{r("universal-link"),Pt(o)})):(r("universal-link"),Pt(o))}else if(Dr("weba")){n.returnStrategy==="back"&&(Xe("safari")?n.returnStrategy=location.href:Xe("chrome")?n.returnStrategy="googlechrome://":Xe("firefox")?n.returnStrategy="firefox://":Xe("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href);const o=St(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),ho(Ds(o,t),()=>{r("universal-link"),Pt(o)})):(r("universal-link"),Pt(o))}else if(Dr("web")){n.returnStrategy==="back"&&(Xe("safari")?n.returnStrategy=location.href:Xe("chrome")?n.returnStrategy="googlechrome://":Xe("firefox")?n.returnStrategy="firefox://":Xe("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href);const o=St(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),ho(Ds(o,t),()=>{r("universal-link"),Pt(o)})):(r("universal-link"),Pt(o))}else{r("universal-link");const o=St(e,n.returnStrategy);Pt(o)}else if(Sr("ios"))n.returnStrategy==="back"&&(Xe("safari")?n.returnStrategy="none":Xe("chrome")?n.returnStrategy="googlechrome://":Xe("firefox")?n.returnStrategy="firefox://":Xe("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),Xe("chrome")?(r("universal-link"),Ha(St(e,n.returnStrategy),"_self")):(r("universal-link"),Pt(St(e,n.returnStrategy)));else if(Sr("android"))n.returnStrategy==="back"&&(Xe("chrome")?n.returnStrategy="googlechrome://":Xe("firefox")?n.returnStrategy="firefox://":Xe("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),r("universal-link"),Pt(St(e,n.returnStrategy));else if(Sr("ipad"))n.returnStrategy==="back"&&(Xe("safari")?n.returnStrategy="none":Xe("chrome")?n.returnStrategy="googlechrome://":Xe("firefox")?n.returnStrategy="firefox://":Xe("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),Xe("chrome")?(r("universal-link"),Ha(St(e,n.returnStrategy),"_self")):(r("universal-link"),Pt(St(e,n.returnStrategy)));else if(Sr("macos","windows","linux")){n.returnStrategy==="back"&&(Xe("safari")?n.returnStrategy="none":Xe("chrome")?n.returnStrategy="googlechrome://":Xe("firefox")?n.returnStrategy="firefox://":Xe("opera")?n.returnStrategy="opera-http://":n.returnStrategy="none");const o=St(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),ho(Ds(o,t),()=>{r("universal-link"),Pt(o)})):(r("universal-link"),Pt(o))}else r("universal-link"),Pt(St(e,n.returnStrategy))}function Uw(e,t,n){const r=new URL(e);return r.searchParams.append(t,n),r.toString()}function Ow(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}function Ks(e){const t=new URL(e),[,n,r]=t.pathname.split("/"),o=t.searchParams.get("startapp");return`tg://resolve?domain=${n}&appname=${r}&startapp=${o}`}const Hg=e=>{const[t,n]=Ne("mobile"),[r,o]=Ne(!1),[i,l]=Ne(),[s,c]=Ne(!0),f=In(Yi),d=f.onStatusChange(()=>{},()=>{e.wallet.appName!==zr&&o(!0)});Rn(d);const w=()=>{try{const O=f.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest);l(O)}catch{}};cn(()=>{un(t)!=="extension"&&(Rl(e.wallet)||G0(e.wallet))&&w()});const h=()=>{o(!1),t()==="extension"&&w(),n("mobile"),gn(Qn(Ct({},e.wallet),{openMethod:"qrcode"}))},S=()=>{o(!1),t()==="extension"&&w(),n("desktop");const O=!s();c(!1),ys(i(),e.wallet.deepLink,{returnStrategy:ht.returnStrategy,forceRedirect:O},b=>{gn(Qn(Ct({},e.wallet),{openMethod:b}))})},C=()=>{const O=!s();c(!1),gn(Qn(Ct({},e.wallet),{openMethod:"universal-link"})),ms(i(),{returnStrategy:ht.returnStrategy,twaReturnUrl:ht.twaReturnUrl,forceRedirect:O})},_=()=>{o(!1),n("extension"),Vo(e.wallet)&&(gn(e.wallet),f.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest))};return Rl(e.wallet)?h():J0(e.wallet)?_():S(),m(Ew,{"data-tc-wallets-modal-connection-desktop":"true",get children(){return[m(je,{get when(){return!e.backDisabled},get children(){return m(Mw,{icon:"arrow",onClick:()=>e.onBackClick()})}}),m(Lw,{get children(){return e.wallet.name}}),m(je,{get when(){return t()==="mobile"},get children(){return m(Pw,{translationKey:"walletModal.desktopConnectionModal.scanQR",get translationValues(){return{name:e.wallet.name}},get children(){return["Scan the QR code below with your phone’s or ",de(()=>e.wallet.name),"’s camera"]}})}}),m(Tw,{get qr(){return t()==="mobile"},get children(){return m(fs,{get children(){return[m(pn,{get when(){return t()==="mobile"},get children(){return m(Aw,{disableCopy:!1,get sourceUrl(){return St(i(),"none")},get imageUrl(){return e.wallet.imageUrl}})}}),m(pn,{get when(){return r()},get children(){return[m($w,{size:"s"}),m(Vs,{translationKey:"walletModal.desktopConnectionModal.connectionDeclined",children:"Connection declined"}),m(gl,{get children(){return m(Yt,{get leftIcon(){return m(Ll,{})},get onClick(){return t()==="extension"?_:S},get children(){return m(ln,{translationKey:"common.retry",children:"Retry"})}})}})]}}),m(pn,{get when(){return t()==="extension"},get children(){return[m(je,{get when(){return Vo(e.wallet)},get children(){return[m(Iw,{size:"s"}),m(Vs,{translationKey:"walletModal.desktopConnectionModal.continueInExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",de(()=>e.wallet.name)," browser extension…"]}}),m(gl,{get children(){return m(Yt,{get leftIcon(){return m(Ll,{})},onClick:_,get children(){return m(ln,{translationKey:"common.retry",children:"Retry"})}})}})]}}),m(je,{get when(){return!Vo(e.wallet)},get children(){return[m(Vs,{translationKey:"walletModal.desktopConnectionModal.dontHaveExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Seems you don't have installed ",de(()=>e.wallet.name)," browser extension"]}}),m(gl,{get children(){return m(Ga,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return m(Yt,{get rightIcon(){return m(B0,{})},onClick:_,get children(){return m(ln,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",de(()=>e.wallet.name)]}})}})}})}})]}})]}}),m(pn,{get when(){return t()==="desktop"},get children(){return[m(to,{size:"m"}),m(Vs,{translationKey:"walletModal.desktopConnectionModal.continueOnDesktop",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",de(()=>e.wallet.name)," on desktop…"]}}),m(gl,{get children(){return[m(Yt,{get leftIcon(){return m(Ll,{})},onClick:S,get children(){return m(ln,{translationKey:"common.retry",children:"Retry"})}}),m(Ga,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return m(Yt,{get rightIcon(){return m(B0,{})},get children(){return m(ln,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",de(()=>e.wallet.name)]}})}})}})]}})]}})]}})}}),m(je,{get when(){return e.wallet.appName===zr},get children(){return m(Ww,{get rightIcon(){return m(Nw,{get src(){return vs.TG}})},scale:"s",onClick:C,get children(){return m(ln,{translationKey:"walletModal.desktopConnectionModal.openWalletOnTelegram",children:"Open Wallet in Telegram on desktop"})}})}}),m(je,{get when(){return e.wallet.appName!==zr},get children(){return m(Rw,{get children(){return[m(je,{get when(){return de(()=>t()!=="mobile")()&&Rl(e.wallet)},get children(){return m(du,{appearance:"secondary",get leftIcon(){return m(F8,{})},onClick:h,get children(){return m(ln,{translationKey:"common.mobile",children:"Mobile"})}})}}),m(je,{get when(){return de(()=>t()!=="extension")()&&J0(e.wallet)},get children(){return m(du,{appearance:"secondary",get leftIcon(){return m(D8,{})},onClick:_,get children(){return m(ln,{translationKey:"common.browserExtension",children:"Browser Extension"})}})}}),m(je,{get when(){return de(()=>t()!=="desktop")()&&G0(e.wallet)},get children(){return m(du,{appearance:"secondary",get leftIcon(){return m(V8,{})},onClick:S,get children(){return m(ln,{translationKey:"common.desktop",children:"Desktop"})}})}})]}})}})]}})},Bw=z.div``,jw=z(oi)` +`,sn=e=>{const[t]=Ir();return de(()=>{var n;return t(e.translationKey,e.translationValues,(n=e.children)==null?void 0:n.toString())})};function St(e,t){let n;typeof t=="string"?n=t:n=Gr()?t.twaReturnUrl||t.returnStrategy:"none";const r=Uw(e,"ret",n);if(!zo(e))return r;const o=r.slice(r.lastIndexOf("&")+1);return r.slice(0,r.lastIndexOf("&"))+"-"+Ep(o)}function ms(e,t){t=Ct({},t);const n=Ow(e),r=new URL(n);if(r.searchParams.has("startapp")||r.searchParams.append("startapp","tonconnect"),Gr())Hr("ios","android","macos")?(t.returnStrategy="back",t.twaReturnUrl=void 0,hl(St(r.toString(),t))):Hr("tdesktop")||Hr("weba")?hl(St(r.toString(),t)):Hr("web")?(t.returnStrategy="back",t.twaReturnUrl=void 0,hl(St(r.toString(),t))):Pt(St(r.toString(),t));else if(_r("ios")){t.returnStrategy==="back"&&(Xe("safari")?t.returnStrategy="back":Xe("chrome")?t.returnStrategy="googlechrome://":Xe("firefox")?t.returnStrategy="firefox://":Xe("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const o=Xe("chrome"),i=Xe("firefox");if((o||i)&&!t.forceRedirect){const s=St(r.toString(),t.returnStrategy),c=Ks(s);ho(c,()=>Pt(s))}else{const s=St(r.toString(),t.returnStrategy);Pt(s)}}else if(_r("android")){t.returnStrategy="none";const o=Xe("chrome"),i=Xe("firefox");if((o||i)&&!t.forceRedirect){const s=St(r.toString(),t.returnStrategy),c=Ks(s);ho(c,()=>Pt(s))}else{const s=St(r.toString(),t.returnStrategy);Pt(s)}}else if(_r("ipad")){t.returnStrategy==="back"&&(Xe("safari")?t.returnStrategy="back":Xe("chrome")?t.returnStrategy="googlechrome://":Xe("firefox")?t.returnStrategy="firefox://":Xe("opera")?t.returnStrategy="opera-http://":t.returnStrategy=location.href);const o=Xe("chrome"),i=Xe("firefox");if((o||i)&&!t.forceRedirect){const s=St(r.toString(),t.returnStrategy),c=Ks(s);ho(c,()=>Pt(s))}else{const s=St(r.toString(),t.returnStrategy);Pt(s)}}else if(_r("macos","windows","linux"))if(t.returnStrategy="none",t.twaReturnUrl=void 0,t.forceRedirect)Pt(St(r.toString(),t));else{const o=St(r.toString(),t),i=Ks(o);ho(i,()=>Pt(o))}else Pt(St(r.toString(),t))}function ys(e,t,n,r){if(n=Ct({},n),Gr())if(Hr("ios","android")){n.returnStrategy==="back"&&(n.returnStrategy="tg://resolve"),r("universal-link");const o=St(e,n.returnStrategy);hl(o,()=>{r("universal-link"),Pt(o)})}else if(Hr("macos","tdesktop")){n.returnStrategy==="back"&&(n.returnStrategy="tg://resolve");const o=St(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),ho(Ds(o,t),()=>{r("universal-link"),Pt(o)})):(r("universal-link"),Pt(o))}else if(Hr("weba")){n.returnStrategy==="back"&&(Xe("safari")?n.returnStrategy=location.href:Xe("chrome")?n.returnStrategy="googlechrome://":Xe("firefox")?n.returnStrategy="firefox://":Xe("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href);const o=St(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),ho(Ds(o,t),()=>{r("universal-link"),Pt(o)})):(r("universal-link"),Pt(o))}else if(Hr("web")){n.returnStrategy==="back"&&(Xe("safari")?n.returnStrategy=location.href:Xe("chrome")?n.returnStrategy="googlechrome://":Xe("firefox")?n.returnStrategy="firefox://":Xe("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href);const o=St(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),ho(Ds(o,t),()=>{r("universal-link"),Pt(o)})):(r("universal-link"),Pt(o))}else{r("universal-link");const o=St(e,n.returnStrategy);Pt(o)}else if(_r("ios"))n.returnStrategy==="back"&&(Xe("safari")?n.returnStrategy="none":Xe("chrome")?n.returnStrategy="googlechrome://":Xe("firefox")?n.returnStrategy="firefox://":Xe("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),Xe("chrome")?(r("universal-link"),Ha(St(e,n.returnStrategy),"_self")):(r("universal-link"),Pt(St(e,n.returnStrategy)));else if(_r("android"))n.returnStrategy==="back"&&(Xe("chrome")?n.returnStrategy="googlechrome://":Xe("firefox")?n.returnStrategy="firefox://":Xe("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),r("universal-link"),Pt(St(e,n.returnStrategy));else if(_r("ipad"))n.returnStrategy==="back"&&(Xe("safari")?n.returnStrategy="none":Xe("chrome")?n.returnStrategy="googlechrome://":Xe("firefox")?n.returnStrategy="firefox://":Xe("opera")?n.returnStrategy="opera-http://":n.returnStrategy=location.href),Xe("chrome")?(r("universal-link"),Ha(St(e,n.returnStrategy),"_self")):(r("universal-link"),Pt(St(e,n.returnStrategy)));else if(_r("macos","windows","linux")){n.returnStrategy==="back"&&(Xe("safari")?n.returnStrategy="none":Xe("chrome")?n.returnStrategy="googlechrome://":Xe("firefox")?n.returnStrategy="firefox://":Xe("opera")?n.returnStrategy="opera-http://":n.returnStrategy="none");const o=St(e,n.returnStrategy);!!t&&!n.forceRedirect?(r("custom-deeplink"),ho(Ds(o,t),()=>{r("universal-link"),Pt(o)})):(r("universal-link"),Pt(o))}else r("universal-link"),Pt(St(e,n.returnStrategy))}function Uw(e,t,n){const r=new URL(e);return r.searchParams.append(t,n),r.toString()}function Ow(e){const t=new URL(e);return t.searchParams.has("attach")&&(t.searchParams.delete("attach"),t.pathname+="/start"),t.toString()}function Ks(e){const t=new URL(e),[,n,r]=t.pathname.split("/"),o=t.searchParams.get("startapp");return`tg://resolve?domain=${n}&appname=${r}&startapp=${o}`}const Hg=e=>{const[t,n]=We("mobile"),[r,o]=We(!1),[i,l]=We(),[s,c]=We(!0),f=In(Yi),d=f.onStatusChange(()=>{},()=>{e.wallet.appName!==Vr&&o(!0)});Rn(d);const w=()=>{try{const O=f.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest);l(O)}catch{}};un(()=>{fn(t)!=="extension"&&(Rl(e.wallet)||G0(e.wallet))&&w()});const h=()=>{o(!1),t()==="extension"&&w(),n("mobile"),gn(Qn(Ct({},e.wallet),{openMethod:"qrcode"}))},S=()=>{o(!1),t()==="extension"&&w(),n("desktop");const O=!s();c(!1),ys(i(),e.wallet.deepLink,{returnStrategy:ht.returnStrategy,forceRedirect:O},b=>{gn(Qn(Ct({},e.wallet),{openMethod:b}))})},C=()=>{const O=!s();c(!1),gn(Qn(Ct({},e.wallet),{openMethod:"universal-link"})),ms(i(),{returnStrategy:ht.returnStrategy,twaReturnUrl:ht.twaReturnUrl,forceRedirect:O})},_=()=>{o(!1),n("extension"),Vo(e.wallet)&&(gn(e.wallet),f.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest))};return Rl(e.wallet)?h():J0(e.wallet)?_():S(),m(Ew,{"data-tc-wallets-modal-connection-desktop":"true",get children(){return[m(je,{get when(){return!e.backDisabled},get children(){return m(Mw,{icon:"arrow",onClick:()=>e.onBackClick()})}}),m(Lw,{get children(){return e.wallet.name}}),m(je,{get when(){return t()==="mobile"},get children(){return m(Pw,{translationKey:"walletModal.desktopConnectionModal.scanQR",get translationValues(){return{name:e.wallet.name}},get children(){return["Scan the QR code below with your phone’s or ",de(()=>e.wallet.name),"’s camera"]}})}}),m(Tw,{get qr(){return t()==="mobile"},get children(){return m(fs,{get children(){return[m(pn,{get when(){return t()==="mobile"},get children(){return m(Aw,{disableCopy:!1,get sourceUrl(){return St(i(),"none")},get imageUrl(){return e.wallet.imageUrl}})}}),m(pn,{get when(){return r()},get children(){return[m($w,{size:"s"}),m(Vs,{translationKey:"walletModal.desktopConnectionModal.connectionDeclined",children:"Connection declined"}),m(gl,{get children(){return m(Yt,{get leftIcon(){return m(Ll,{})},get onClick(){return t()==="extension"?_:S},get children(){return m(sn,{translationKey:"common.retry",children:"Retry"})}})}})]}}),m(pn,{get when(){return t()==="extension"},get children(){return[m(je,{get when(){return Vo(e.wallet)},get children(){return[m(Iw,{size:"s"}),m(Vs,{translationKey:"walletModal.desktopConnectionModal.continueInExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",de(()=>e.wallet.name)," browser extension…"]}}),m(gl,{get children(){return m(Yt,{get leftIcon(){return m(Ll,{})},onClick:_,get children(){return m(sn,{translationKey:"common.retry",children:"Retry"})}})}})]}}),m(je,{get when(){return!Vo(e.wallet)},get children(){return[m(Vs,{translationKey:"walletModal.desktopConnectionModal.dontHaveExtension",get translationValues(){return{name:e.wallet.name}},get children(){return["Seems you don't have installed ",de(()=>e.wallet.name)," browser extension"]}}),m(gl,{get children(){return m(Ga,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return m(Yt,{get rightIcon(){return m(B0,{})},onClick:_,get children(){return m(sn,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",de(()=>e.wallet.name)]}})}})}})}})]}})]}}),m(pn,{get when(){return t()==="desktop"},get children(){return[m(to,{size:"m"}),m(Vs,{translationKey:"walletModal.desktopConnectionModal.continueOnDesktop",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",de(()=>e.wallet.name)," on desktop…"]}}),m(gl,{get children(){return[m(Yt,{get leftIcon(){return m(Ll,{})},onClick:S,get children(){return m(sn,{translationKey:"common.retry",children:"Retry"})}}),m(Ga,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return m(Yt,{get rightIcon(){return m(B0,{})},get children(){return m(sn,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:e.wallet.name}},get children(){return["Get ",de(()=>e.wallet.name)]}})}})}})]}})]}})]}})}}),m(je,{get when(){return e.wallet.appName===Vr},get children(){return m(Nw,{get rightIcon(){return m(Ww,{get src(){return vs.TG}})},scale:"s",onClick:C,get children(){return m(sn,{translationKey:"walletModal.desktopConnectionModal.openWalletOnTelegram",children:"Open Wallet in Telegram on desktop"})}})}}),m(je,{get when(){return e.wallet.appName!==Vr},get children(){return m(Rw,{get children(){return[m(je,{get when(){return de(()=>t()!=="mobile")()&&Rl(e.wallet)},get children(){return m(du,{appearance:"secondary",get leftIcon(){return m(F8,{})},onClick:h,get children(){return m(sn,{translationKey:"common.mobile",children:"Mobile"})}})}}),m(je,{get when(){return de(()=>t()!=="extension")()&&J0(e.wallet)},get children(){return m(du,{appearance:"secondary",get leftIcon(){return m(D8,{})},onClick:_,get children(){return m(sn,{translationKey:"common.browserExtension",children:"Browser Extension"})}})}}),m(je,{get when(){return de(()=>t()!=="desktop")()&&G0(e.wallet)},get children(){return m(du,{appearance:"secondary",get leftIcon(){return m(V8,{})},onClick:S,get children(){return m(sn,{translationKey:"common.desktop",children:"Desktop"})}})}})]}})}})]}})},Bw=z.div``,jw=z(oi)` position: absolute; top: 16px; left: 16px; -`,Dw=z(Ir)` +`,Dw=z($r)` margin-bottom: 18px; `,hu=z.div` padding: 16px 0; @@ -826,7 +826,7 @@ PERFORMANCE OF THIS SOFTWARE. align-items: center; justify-content: center; gap: 8px; -`,Fw={GET_A_WALLET:"https://ton.org/wallets?filters[wallet_features][slug][$in]=dapp-auth&pagination[limit]=-1"},Fg=e=>m(Bw,{"data-tc-wallets-modal-info":"true",get children(){return[m(jw,{icon:"arrow",onClick:()=>e.onBackClick()}),m(Dw,{translationKey:"walletModal.infoModal.whatIsAWallet",children:"What is a wallet"}),m(Mg,{get children(){return[m(hu,{get children(){return[m(G8,{class:pu}),m(gu,{translationKey:"walletModal.infoModal.secureDigitalAssets",children:"Secure digital assets storage"}),m(vu,{translationKey:"walletModal.infoModal.walletProtects",children:"A wallet protects and manages your digital assets including TON, tokens and collectables."})]}}),m(hu,{get children(){return[m(X8,{class:pu}),m(gu,{translationKey:"walletModal.infoModal.controlIdentity",children:"Control your Web3 identity"}),m(vu,{translationKey:"walletModal.infoModal.manageIdentity",children:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem."})]}}),m(hu,{get children(){return[m(ty,{class:pu}),m(gu,{translationKey:"walletModal.infoModal.effortlessCryptoTransactions",children:"Effortless crypto transactions"}),m(vu,{translationKey:"walletModal.infoModal.easilySend",children:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications."})]}}),m(Hw,{get children(){return m(Ga,{get href(){return Fw.GET_A_WALLET},blank:!0,get children(){return m(Yt,{get rightIcon(){return m(Y8,{})},get children(){return m(ln,{translationKey:"walletModal.infoModal.getAWallet",children:"Get a Wallet"})}})}})}})]}})]}}),zw=z.div``,Vw=z.div` +`,Fw={GET_A_WALLET:"https://ton.org/wallets?filters[wallet_features][slug][$in]=dapp-auth&pagination[limit]=-1"},Fg=e=>m(Bw,{"data-tc-wallets-modal-info":"true",get children(){return[m(jw,{icon:"arrow",onClick:()=>e.onBackClick()}),m(Dw,{translationKey:"walletModal.infoModal.whatIsAWallet",children:"What is a wallet"}),m(Mg,{get children(){return[m(hu,{get children(){return[m(G8,{class:pu}),m(gu,{translationKey:"walletModal.infoModal.secureDigitalAssets",children:"Secure digital assets storage"}),m(vu,{translationKey:"walletModal.infoModal.walletProtects",children:"A wallet protects and manages your digital assets including TON, tokens and collectables."})]}}),m(hu,{get children(){return[m(X8,{class:pu}),m(gu,{translationKey:"walletModal.infoModal.controlIdentity",children:"Control your Web3 identity"}),m(vu,{translationKey:"walletModal.infoModal.manageIdentity",children:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem."})]}}),m(hu,{get children(){return[m(ty,{class:pu}),m(gu,{translationKey:"walletModal.infoModal.effortlessCryptoTransactions",children:"Effortless crypto transactions"}),m(vu,{translationKey:"walletModal.infoModal.easilySend",children:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications."})]}}),m(Hw,{get children(){return m(Ga,{get href(){return Fw.GET_A_WALLET},blank:!0,get children(){return m(Yt,{get rightIcon(){return m(Y8,{})},get children(){return m(sn,{translationKey:"walletModal.infoModal.getAWallet",children:"Get a Wallet"})}})}})}})]}})]}}),zw=z.div``,Vw=z.div` flex: 1; margin-top: 18px; display: flex; @@ -834,7 +834,7 @@ PERFORMANCE OF THIS SOFTWARE. align-items: center; justify-content: center; min-height: 232px; -`,Kw=z(Ir)` +`,Kw=z($r)` max-width: 262px; margin: 0 auto 8px; `,qw=z(oi)` @@ -867,7 +867,7 @@ PERFORMANCE OF THIS SOFTWARE. justify-content: center; gap: 8px; padding-bottom: 16px; -`,Xw=z(Ir)` +`,Xw=z($r)` margin-bottom: 2px; padding: 0 64px; `,e9=z(Ro)` @@ -876,7 +876,7 @@ PERFORMANCE OF THIS SOFTWARE. min-height: 44px; `,t9=z.div` padding: 0 24px 24px; -`,n9=e=>[m(Xw,{get children(){return e.walletInfo.name}}),m(e9,{translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){return{name:e.walletInfo.name}},get children(){return["Scan the QR code below with your phone’s or ",de(()=>e.walletInfo.name),"’s camera"]}}),m(t9,{get children(){return m(Ec,{get imageUrl(){return e.walletInfo.imageUrl},get sourceUrl(){return St(e.universalLink,"none")},disableCopy:!0})}})],zg=e=>{const t=Et(),[n,r]=Ne(!0),[o,i]=Ne(!1),[l,s]=Ne(!1),c=In(Yi),f=c.onStatusChange(()=>{},()=>{s(!0)}),d=de(()=>c.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest)),w=()=>{gn(Qn(Ct({},e.wallet),{openMethod:"universal-link"})),ms(d(),{returnStrategy:ht.returnStrategy,twaReturnUrl:ht.twaReturnUrl,forceRedirect:!0})},h=()=>{const O=d();if(zo(O))return w();s(!1);const b=!n();r(!1),ys(d(),e.wallet.deepLink,{returnStrategy:ht.returnStrategy,forceRedirect:b},p=>{gn(Qn(Ct({},e.wallet),{openMethod:p}))})},S=()=>{s(!1),i(!0),gn(Qn(Ct({},e.wallet),{openMethod:"qrcode"}))},C=()=>{i(!1),gn(Qn(Ct({},e.wallet),{openMethod:"universal-link"}))},_=()=>{o()?C():e.onBackClick()};return Rn(f),h(),m(zw,{"data-tc-wallets-modal-connection-mobile":"true",get children(){return[m(je,{get when(){return!e.backDisabled||o()},get children(){return m(qw,{icon:"arrow",onClick:_})}}),m(je,{get when(){return o()},get children(){return m(n9,{get universalLink(){return d()},get walletInfo(){return e.wallet}})}}),m(je,{get when(){return!o()},get children(){return[m(Kw,{get children(){return e.wallet.name}}),m(Vw,{get children(){return[m(je,{get when(){return l()},get children(){return[m(Jw,{size:"s"}),m(X0,{translationKey:"walletModal.mobileConnectionModal.connectionDeclined",children:"Connection declined"}),m(eh,{get children(){return[m(Yt,{get leftIcon(){return m(Ll,{})},onClick:h,get children(){return m(ln,{translationKey:"common.retry",children:"Retry"})}}),m(Yt,{get leftIcon(){return m(Ef,{get fill(){return t.colors.accent}})},onClick:S,get children(){return m(ln,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}}),m(je,{get when(){return!l()},get children(){return[m(Gw,{size:"s"}),m(X0,{translationKey:"walletModal.mobileConnectionModal.continueIn",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",de(()=>e.wallet.name),"…"]}}),m(eh,{get children(){return[m(Yt,{get leftIcon(){return m(Ll,{})},onClick:h,get children(){return m(ln,{translationKey:"common.retry",children:"Retry"})}}),m(Yt,{get leftIcon(){return m(Ef,{get fill(){return t.colors.accent}})},onClick:S,get children(){return m(ln,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})]}}),m(Qw,{get children(){return[m(Yw,{get src(){return e.wallet.imageUrl}}),m(Hd,{get children(){return e.wallet.name}}),m(Zw,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return m(Yt,{get children(){return m(ln,{translationKey:"common.get",children:"GET"})}})}})]}})]}})]}})},Vg={m:"16px",s:"12px",none:"0"},r9={m:"6px",s:"6px",none:"0"},o9=z.ul` +`,n9=e=>[m(Xw,{get children(){return e.walletInfo.name}}),m(e9,{translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){return{name:e.walletInfo.name}},get children(){return["Scan the QR code below with your phone’s or ",de(()=>e.walletInfo.name),"’s camera"]}}),m(t9,{get children(){return m(Ec,{get imageUrl(){return e.walletInfo.imageUrl},get sourceUrl(){return St(e.universalLink,"none")},disableCopy:!0})}})],zg=e=>{const t=Et(),[n,r]=We(!0),[o,i]=We(!1),[l,s]=We(!1),c=In(Yi),f=c.onStatusChange(()=>{},()=>{s(!0)}),d=de(()=>c.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest)),w=()=>{gn(Qn(Ct({},e.wallet),{openMethod:"universal-link"})),ms(d(),{returnStrategy:ht.returnStrategy,twaReturnUrl:ht.twaReturnUrl,forceRedirect:!0})},h=()=>{const O=d();if(zo(O))return w();s(!1);const b=!n();r(!1),ys(d(),e.wallet.deepLink,{returnStrategy:ht.returnStrategy,forceRedirect:b},p=>{gn(Qn(Ct({},e.wallet),{openMethod:p}))})},S=()=>{s(!1),i(!0),gn(Qn(Ct({},e.wallet),{openMethod:"qrcode"}))},C=()=>{i(!1),gn(Qn(Ct({},e.wallet),{openMethod:"universal-link"}))},_=()=>{o()?C():e.onBackClick()};return Rn(f),h(),m(zw,{"data-tc-wallets-modal-connection-mobile":"true",get children(){return[m(je,{get when(){return!e.backDisabled||o()},get children(){return m(qw,{icon:"arrow",onClick:_})}}),m(je,{get when(){return o()},get children(){return m(n9,{get universalLink(){return d()},get walletInfo(){return e.wallet}})}}),m(je,{get when(){return!o()},get children(){return[m(Kw,{get children(){return e.wallet.name}}),m(Vw,{get children(){return[m(je,{get when(){return l()},get children(){return[m(Jw,{size:"s"}),m(X0,{translationKey:"walletModal.mobileConnectionModal.connectionDeclined",children:"Connection declined"}),m(eh,{get children(){return[m(Yt,{get leftIcon(){return m(Ll,{})},onClick:h,get children(){return m(sn,{translationKey:"common.retry",children:"Retry"})}}),m(Yt,{get leftIcon(){return m(Ef,{get fill(){return t.colors.accent}})},onClick:S,get children(){return m(sn,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}}),m(je,{get when(){return!l()},get children(){return[m(Gw,{size:"s"}),m(X0,{translationKey:"walletModal.mobileConnectionModal.continueIn",get translationValues(){return{name:e.wallet.name}},get children(){return["Continue in ",de(()=>e.wallet.name),"…"]}}),m(eh,{get children(){return[m(Yt,{get leftIcon(){return m(Ll,{})},onClick:h,get children(){return m(sn,{translationKey:"common.retry",children:"Retry"})}}),m(Yt,{get leftIcon(){return m(Ef,{get fill(){return t.colors.accent}})},onClick:S,get children(){return m(sn,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})]}}),m(Qw,{get children(){return[m(Yw,{get src(){return e.wallet.imageUrl}}),m(Hd,{get children(){return e.wallet.name}}),m(Zw,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return m(Yt,{get children(){return m(sn,{translationKey:"common.get",children:"GET"})}})}})]}})]}})]}})},Vg={m:"16px",s:"12px",none:"0"},r9={m:"6px",s:"6px",none:"0"},o9=z.ul` display: flex; justify-content: space-between; margin: 0 auto; @@ -946,7 +946,7 @@ PERFORMANCE OF THIS SOFTWARE. background-color: ${e=>e.theme.colors.background.tint}; margin-bottom: 8px; -`,l9=z(Ir)` +`,l9=z($r)` margin-top: 38px; margin-bottom: 4px; padding: 0 24px; @@ -976,7 +976,7 @@ PERFORMANCE OF THIS SOFTWARE. position: absolute; top: 16px; left: 16px; -`,u9=z(Ir)` +`,u9=z($r)` margin-bottom: 2px; padding: 0 64px; `,f9=z(Ro)` @@ -984,7 +984,7 @@ PERFORMANCE OF THIS SOFTWARE. padding: 0 64px; `,d9=z.div` padding: 0 24px 24px; -`,h9=e=>[m(u9,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),m(f9,{translationKey:"walletModal.mobileUniversalModal.scan",children:"Scan with your mobile wallet"}),m(d9,{get children(){return m(Ec,{get imageUrl(){return vs.TON},get sourceUrl(){return St(e.universalLink,"none")},disableCopy:!0})}})];function Kg(e){const t=new Set(e.filter(Td).map(n=>n.bridgeUrl));return Array.from(t).map(n=>({bridgeUrl:n}))}function qg(e,t){const n=new Set(e==null?void 0:e.map(o=>o.bridgeUrl)),r=new Set(t==null?void 0:t.map(o=>o.bridgeUrl));return n.size===r.size&&[...n].every(o=>r.has(o))}const oh=ot("
  • "),p9=ot('
    '),g9=e=>{const[t,n]=Ne(!1),[r,o]=Ne(!0),[i,l]=Ne(null),s=ht.connector,c=()=>e.walletsList.filter(y=>Rl(y)&&y.appName!==zr),f=()=>c().length>7,d=de(()=>Kg(e.walletsList),null,{equals:qg}),w=()=>(i()||l(s.connect(d(),e.additionalRequest)),i());gn({openMethod:"universal-link"});const[h,S]=Ne(void 0),C=()=>xt(void 0,null,function*(){h()!==void 0&&clearTimeout(h()),yield Dd(w());const y=setTimeout(()=>S(void 0),1500);S(y)}),_=()=>{const y=!r();o(!1),ys(w(),void 0,{returnStrategy:ht.returnStrategy,forceRedirect:y},E=>{gn({openMethod:E})})},O=()=>{l(null);const y=e.walletsList.find(W=>W.appName===zr);if(!y||!Td(y))throw new qt("@wallet bot not found in the wallets list");const E=s.connect({bridgeUrl:y.bridgeUrl,universalLink:y.universalLink},e.additionalRequest),T=!r();o(!1),ms(E,{returnStrategy:ht.returnStrategy,twaReturnUrl:ht.twaReturnUrl,forceRedirect:T})},b=()=>{n(!0),gn({openMethod:"qrcode"})},p=()=>{n(!1),gn({openMethod:"universal-link"})};return(()=>{const y=p9.cloneNode(!0);return _n(y,m(je,{get when(){return t()},get children(){return[m(rh,{icon:"arrow",onClick:p}),m(h9,{get universalLink(){return w()}})]}}),null),_n(y,m(je,{get when(){return!t()},get children(){return[m(rh,{get icon(){return m(Ef,{})},onClick:b}),m(l9,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),m(s9,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegramOrSelect",children:"Open Wallet in Telegram or select your wallet to connect"}),m(a9,{get leftIcon(){return m(ry,{})},get rightIcon(){return m(c9,{get src(){return vs.TG}})},onClick:O,scale:"s",get children(){return m(ln,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegram",children:"Open Wallet in Telegram"})}}),m(o9,{get children(){return[m(us,{get each(){return de(()=>!!f())()?c().slice(0,4):c()},children:E=>(()=>{const T=oh.cloneNode(!0);return _n(T,m(Ya,{get icon(){return E.imageUrl},get name(){return E.name},onClick:()=>e.onSelect(E)})),T})()}),m(je,{get when(){return f()},get children(){const E=oh.cloneNode(!0);return _n(E,m(Lg,{labelLine1:"View all",labelLine2:"wallets",get images(){return c().slice(3,7).map(T=>T.imageUrl)},onClick:()=>e.onSelectAllWallets()})),E}}),m(i9,{children:" "}),m(th,{onClick:_,get children(){return[m(nh,{get children(){return m(_8,{})}}),m(Gn,{fontWeight:590,translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})]}}),m(th,{onClick:C,get children(){return[m(nh,{get children(){return de(()=>h()!==void 0)()?m(iy,{}):m(Ag,{})}}),m(Gn,{fontWeight:590,get translationKey(){return h()!==void 0?"common.copied":"common.copyLink"},get children(){return h()!==void 0?"Copied":"Copy Link"}})]}})]}})]}}),null),y})()},Qg={m:"16px",s:"8px",none:"0"},v9={m:"8px",s:"4px",none:"0"},m9=z.div` +`,h9=e=>[m(u9,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),m(f9,{translationKey:"walletModal.mobileUniversalModal.scan",children:"Scan with your mobile wallet"}),m(d9,{get children(){return m(Ec,{get imageUrl(){return vs.TON},get sourceUrl(){return St(e.universalLink,"none")},disableCopy:!0})}})];function Kg(e){const t=new Set(e.filter(Td).map(n=>n.bridgeUrl));return Array.from(t).map(n=>({bridgeUrl:n}))}function qg(e,t){const n=new Set(e==null?void 0:e.map(o=>o.bridgeUrl)),r=new Set(t==null?void 0:t.map(o=>o.bridgeUrl));return n.size===r.size&&[...n].every(o=>r.has(o))}const oh=ot("
  • "),p9=ot('
    '),g9=e=>{const[t,n]=We(!1),[r,o]=We(!0),[i,l]=We(null),s=ht.connector,c=()=>e.walletsList.filter(y=>Rl(y)&&y.appName!==Vr),f=()=>c().length>7,d=de(()=>Kg(e.walletsList),null,{equals:qg}),w=()=>(i()||l(s.connect(d(),e.additionalRequest)),i());gn({openMethod:"universal-link"});const[h,S]=We(void 0),C=()=>xt(void 0,null,function*(){h()!==void 0&&clearTimeout(h()),yield Dd(w());const y=setTimeout(()=>S(void 0),1500);S(y)}),_=()=>{const y=!r();o(!1),ys(w(),void 0,{returnStrategy:ht.returnStrategy,forceRedirect:y},E=>{gn({openMethod:E})})},O=()=>{l(null);const y=e.walletsList.find(N=>N.appName===Vr);if(!y||!Td(y))throw new qt("@wallet bot not found in the wallets list");const E=s.connect({bridgeUrl:y.bridgeUrl,universalLink:y.universalLink},e.additionalRequest),T=!r();o(!1),ms(E,{returnStrategy:ht.returnStrategy,twaReturnUrl:ht.twaReturnUrl,forceRedirect:T})},b=()=>{n(!0),gn({openMethod:"qrcode"})},p=()=>{n(!1),gn({openMethod:"universal-link"})};return(()=>{const y=p9.cloneNode(!0);return _n(y,m(je,{get when(){return t()},get children(){return[m(rh,{icon:"arrow",onClick:p}),m(h9,{get universalLink(){return w()}})]}}),null),_n(y,m(je,{get when(){return!t()},get children(){return[m(rh,{get icon(){return m(Ef,{})},onClick:b}),m(l9,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your wallet"}),m(s9,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegramOrSelect",children:"Open Wallet in Telegram or select your wallet to connect"}),m(a9,{get leftIcon(){return m(ry,{})},get rightIcon(){return m(c9,{get src(){return vs.TG}})},onClick:O,scale:"s",get children(){return m(sn,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegram",children:"Open Wallet in Telegram"})}}),m(o9,{get children(){return[m(us,{get each(){return de(()=>!!f())()?c().slice(0,4):c()},children:E=>(()=>{const T=oh.cloneNode(!0);return _n(T,m(Ya,{get icon(){return E.imageUrl},get name(){return E.name},onClick:()=>e.onSelect(E)})),T})()}),m(je,{get when(){return f()},get children(){const E=oh.cloneNode(!0);return _n(E,m(Lg,{labelLine1:"View all",labelLine2:"wallets",get images(){return c().slice(3,7).map(T=>T.imageUrl)},onClick:()=>e.onSelectAllWallets()})),E}}),m(i9,{children:" "}),m(th,{onClick:_,get children(){return[m(nh,{get children(){return m(_8,{})}}),m(Gn,{fontWeight:590,translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})]}}),m(th,{onClick:C,get children(){return[m(nh,{get children(){return de(()=>h()!==void 0)()?m(iy,{}):m(Ag,{})}}),m(Gn,{fontWeight:590,get translationKey(){return h()!==void 0?"common.copied":"common.copyLink"},get children(){return h()!==void 0?"Copied":"Copy Link"}})]}})]}})]}}),null),y})()},Qg={m:"16px",s:"8px",none:"0"},v9={m:"8px",s:"4px",none:"0"},m9=z.div` display: flex; flex-direction: column; align-items: center; @@ -1065,12 +1065,12 @@ PERFORMANCE OF THIS SOFTWARE. `;z(Gn)` color: ${e=>e.theme.colors.text.secondary}; font-size: 16px; -`;const b9=ot("
  • "),S9=e=>{const[t,n]=Ne(!1),r=ht.connector,o=de(()=>Kg(e.walletsList),null,{equals:qg});gn({openMethod:"qrcode"});const i=de(()=>r.connect(o(),e.additionalRequest));return m(m9,{onClick:()=>n(!1),"data-tc-wallets-modal-universal-desktop":"true",get children(){return[m(Ir,{translationKey:"walletModal.desktopUniversalModal.connectYourWallet",children:"Connect your wallet"}),m(y9,{translationKey:"walletModal.desktopUniversalModal.scan",children:"Scan with your mobile wallet"}),m(x9,{get sourceUrl(){return St(i(),"none")},get disableCopy(){return t()},get imageUrl(){return vs.TON}}),m(w9,{translationKey:"walletModal.desktopUniversalModal.availableWallets",children:"Available wallets"}),m(C9,{get children(){return[m(us,{get each(){return e.walletsList.slice(0,3)},children:l=>(()=>{const s=b9.cloneNode(!0);return _n(s,m(Pg,{wallet:l,onClick:()=>e.onSelect(l)})),s})()}),m(Lg,{labelLine1:"View all",labelLine2:"wallets",get images(){return e.walletsList.slice(3,7).map(l=>l.imageUrl)},onClick:()=>e.onSelectAllWallets()})]}})]}})},_9=()=>{const{locale:e}=Rr()[1];cn(()=>e(ht.language)),cn(()=>{P0()?Za():(i(null),s("universal"),f(!1))});const t=In(Yi),n=In(Io),[r]=zm(()=>n.getWallets()),[o,i]=Ne(null),[l,s]=Ne("universal"),[c,f]=Ne(!1),d=de(()=>{if(r.state!=="ready")return null;let p=qd(r(),ht.walletsListConfiguration);const y=p.filter(Vo),E=p.filter(P=>!Vo(P));p=(y||[]).concat(E);const T=ht.preferredWalletAppName,W=p.find(P=>co(P,T)),I=p.filter(P=>co(P,T)).length>=2;T&&W&&!I&&(p=[Qn(Ct({},W),{isPreferred:!0})].concat(p.filter(P=>!co(P,T))));const L=p.find(P=>co(P,zr));return L&&(p=[L].concat(p.filter(P=>!co(P,zr)))),p}),w=()=>{var p;return((p=ht.connectRequestParameters)==null?void 0:p.state)==="loading"},h=de(()=>{var p;if(!w())return(p=ht.connectRequestParameters)==null?void 0:p.value}),S=p=>{n.closeModal(p)},C=t.onStatusChange(p=>{p&&S("wallet-selected")}),_=()=>{s("all-wallets")},O=()=>{s("universal")},b=()=>{i(null)};return Rn(()=>{i(null),f(!1)}),Rn(C),m(Bg,{get opened(){return P0()},get enableAndroidBackHandler(){return ht.enableAndroidBackHandler},onClose:()=>S("action-cancelled"),onClickQuestion:()=>f(p=>!p),"data-tc-wallets-modal-container":"true",get children(){return[m(je,{get when(){return c()},get children(){return m(Fg,{onBackClick:()=>f(!1)})}}),m(je,{get when(){return!c()},get children(){return[m(je,{get when(){return w()||!d()},get children(){return[m(jg,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),m(Dg,{get children(){return m(to,{size:"m"})}})]}}),m(je,{get when(){return de(()=>!w())()&&d()},get children(){return m(fs,{get children(){return[m(pn,{get when(){return o()},get children(){return m(ji,{get component(){return Hi()?zg:Hg},get wallet(){return o()},get additionalRequest(){return h()},onBackClick:b})}}),m(pn,{get when(){return l()==="universal"},get children(){return m(ji,{get component(){return Hi()?g9:S9},onSelect:i,get walletsList(){return d()},get additionalRequest(){return h()},onSelectAllWallets:_})}}),m(pn,{get when(){return l()==="all-wallets"},get children(){return m(Sw,{get walletsList(){return d()},onBack:O,onSelect:i})}})]}})}})]}})]}})},k9=z.div` +`;const b9=ot("
  • "),S9=e=>{const[t,n]=We(!1),r=ht.connector,o=de(()=>Kg(e.walletsList),null,{equals:qg});gn({openMethod:"qrcode"});const i=de(()=>r.connect(o(),e.additionalRequest));return m(m9,{onClick:()=>n(!1),"data-tc-wallets-modal-universal-desktop":"true",get children(){return[m($r,{translationKey:"walletModal.desktopUniversalModal.connectYourWallet",children:"Connect your wallet"}),m(y9,{translationKey:"walletModal.desktopUniversalModal.scan",children:"Scan with your mobile wallet"}),m(x9,{get sourceUrl(){return St(i(),"none")},get disableCopy(){return t()},get imageUrl(){return vs.TON}}),m(w9,{translationKey:"walletModal.desktopUniversalModal.availableWallets",children:"Available wallets"}),m(C9,{get children(){return[m(us,{get each(){return e.walletsList.slice(0,3)},children:l=>(()=>{const s=b9.cloneNode(!0);return _n(s,m(Pg,{wallet:l,onClick:()=>e.onSelect(l)})),s})()}),m(Lg,{labelLine1:"View all",labelLine2:"wallets",get images(){return e.walletsList.slice(3,7).map(l=>l.imageUrl)},onClick:()=>e.onSelectAllWallets()})]}})]}})},_9=()=>{const{locale:e}=Ir()[1];un(()=>e(ht.language)),un(()=>{P0()?Za():(i(null),s("universal"),f(!1))});const t=In(Yi),n=In(Io),[r]=zm(()=>n.getWallets()),[o,i]=We(null),[l,s]=We("universal"),[c,f]=We(!1),d=de(()=>{if(r.state!=="ready")return null;let p=qd(r(),ht.walletsListConfiguration);const y=p.filter(Vo),E=p.filter(P=>!Vo(P));p=(y||[]).concat(E);const T=ht.preferredWalletAppName,N=p.find(P=>co(P,T)),I=p.filter(P=>co(P,T)).length>=2;T&&N&&!I&&(p=[Qn(Ct({},N),{isPreferred:!0})].concat(p.filter(P=>!co(P,T))));const L=p.find(P=>co(P,Vr));return L&&(p=[L].concat(p.filter(P=>!co(P,Vr)))),p}),w=()=>{var p;return((p=ht.connectRequestParameters)==null?void 0:p.state)==="loading"},h=de(()=>{var p;if(!w())return(p=ht.connectRequestParameters)==null?void 0:p.value}),S=p=>{n.closeModal(p)},C=t.onStatusChange(p=>{p&&S("wallet-selected")}),_=()=>{s("all-wallets")},O=()=>{s("universal")},b=()=>{i(null)};return Rn(()=>{i(null),f(!1)}),Rn(C),m(Bg,{get opened(){return P0()},get enableAndroidBackHandler(){return ht.enableAndroidBackHandler},onClose:()=>S("action-cancelled"),onClickQuestion:()=>f(p=>!p),"data-tc-wallets-modal-container":"true",get children(){return[m(je,{get when(){return c()},get children(){return m(Fg,{onBackClick:()=>f(!1)})}}),m(je,{get when(){return!c()},get children(){return[m(je,{get when(){return w()||!d()},get children(){return[m(jg,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),m(Dg,{get children(){return m(to,{size:"m"})}})]}}),m(je,{get when(){return de(()=>!w())()&&d()},get children(){return m(fs,{get children(){return[m(pn,{get when(){return o()},get children(){return m(ji,{get component(){return Hi()?zg:Hg},get wallet(){return o()},get additionalRequest(){return h()},onBackClick:b})}}),m(pn,{get when(){return l()==="universal"},get children(){return m(ji,{get component(){return Hi()?g9:S9},onSelect:i,get walletsList(){return d()},get additionalRequest(){return h()},onSelectAllWallets:_})}}),m(pn,{get when(){return l()==="all-wallets"},get children(){return m(Sw,{get walletsList(){return d()},onBack:O,onSelect:i})}})]}})}})]}})]}})},k9=z.div` display: flex; flex-direction: column; align-items: center; padding-bottom: 8px; -`,E9=z(Ir)` +`,E9=z($r)` margin-top: 16px; `,T9=z(Gn)` font-weight: 510; @@ -1088,7 +1088,7 @@ PERFORMANCE OF THIS SOFTWARE. width: 16px; `,ih=z(Yt)` margin-top: 32px; -`,Qd=e=>{const t=gs(e),n=In(Io),[r,o]=Ne(!0),[i,l]=Ne(!1);cn(()=>{const d=Or();l(!!d&&"sent"in d&&d.sent)});let s;n!=null&&n.wallet&&"universalLink"in n.wallet&&(n.wallet.openMethod==="universal-link"||zo(n.wallet.universalLink)&&Gr())&&(s=n.wallet.universalLink);let c;n!=null&&n.wallet&&"deepLink"in n.wallet&&(n.wallet.openMethod==="custom-deeplink"||zo(n.wallet.deepLink)&&Gr())&&(c=n.wallet.deepLink);const f=()=>{const d=Or(),w="returnStrategy"in d?d.returnStrategy:ht.returnStrategy,h=!r();o(!1),zo(s)?ms(s,{returnStrategy:w,twaReturnUrl:"twaReturnUrl"in d?d.twaReturnUrl:ht.twaReturnUrl,forceRedirect:h}):ys(s,c,{returnStrategy:w,forceRedirect:h},()=>{})};return m(k9,Ar(t,{get children(){return[de(()=>e.icon),m(E9,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),m(T9,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),m(je,{get when(){return!i()&&(e.showButton==="open-wallet"&&s||e.showButton!=="open-wallet")},get children(){return m(A9,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return m(L9,{})}})}}),m(je,{get when(){return i()},get children(){return[m(je,{get when(){return e.showButton!=="open-wallet"},get children(){return m(ih,{onClick:()=>e.onClose(),get children(){return m(ln,{translationKey:"common.close",children:"Close"})}})}}),m(je,{get when(){return e.showButton==="open-wallet"&&s},get children(){return m(ih,{onClick:f,get children(){return m(ln,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},P9=e=>{const t=In(Io),[n]=Rr(),r=()=>t.wallet&&"name"in t.wallet?t.wallet.name:n("common.yourWallet",{},"Your wallet");return m(Qd,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:r()}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return m(to,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},M9=e=>m(Qd,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return m(Tc,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),R9=e=>m(Qd,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return m(Fd,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),I9=()=>m(Sg,{get opened(){var e;return de(()=>Or()!==null)()&&((e=Or())==null?void 0:e.openModal)===!0},get enableAndroidBackHandler(){return ht.enableAndroidBackHandler},onClose:()=>Si(null),"data-tc-actions-modal-container":"true",get children(){return m(fs,{get children(){return[m(pn,{get when(){return Or().name==="transaction-sent"},get children(){return m(R9,{onClose:()=>Si(null)})}}),m(pn,{get when(){return Or().name==="transaction-canceled"},get children(){return m(M9,{onClose:()=>Si(null)})}}),m(pn,{get when(){return Or().name==="confirm-transaction"},get children(){return m(P9,{onClose:()=>Si(null)})}})]}})}}),$9=()=>{const{locale:e}=Rr()[1];cn(()=>e(ht.language)),cn(()=>{R0()&&Za()});const t=In(Yi),n=In(Io),[r,o]=Ne(!1),i=()=>{var f;return((f=ht.connectRequestParameters)==null?void 0:f.state)==="loading"},l=de(()=>{var f;if(!i())return(f=ht.connectRequestParameters)==null?void 0:f.value}),s=f=>{n.closeSingleWalletModal(f)},c=t.onStatusChange(f=>{f&&s("wallet-selected")});return Rn(c),Rn(()=>{o(!1)}),m(Bg,{get opened(){return R0()},get enableAndroidBackHandler(){return ht.enableAndroidBackHandler},onClose:()=>s("action-cancelled"),onClickQuestion:()=>o(f=>!f),"data-tc-wallets-modal-container":"true",get children(){return[m(je,{get when(){return r()},get children(){return m(Fg,{onBackClick:()=>o(!1)})}}),m(je,{get when(){return!r()},get children(){return[m(je,{get when(){return i()},get children(){return[m(jg,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),m(Dg,{get children(){return m(to,{size:"m"})}})]}}),m(je,{get when(){return!i()},get children(){return m(ji,{get component(){return Hi()?zg:Hg},get wallet(){return V4()},get additionalRequest(){return l()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},W9=e=>{const t=c8(a6,ht.language);return B4(),O4(),m(Eg.Provider,{value:t,get children(){return m(Io.Provider,{get value(){return e.tonConnectUI},get children(){return m(Yi.Provider,{get value(){return ht.connector},get children(){return[m(P4,{}),m(A4,{theme:v6,get children(){return[m(je,{get when(){return ht.buttonRootId},get children(){return m(ig,{get mount(){return document.getElementById(ht.buttonRootId)},get children(){return m(hw,{})}})}}),m(ji,{component:Ur,get children(){return[m(_9,{}),m($9,{}),m(I9,{})]}})]}})]}})}})}})},Vn={openWalletsModal:()=>void setTimeout(()=>L0({status:"opened",closeReason:null})),closeWalletsModal:e=>void setTimeout(()=>L0({status:"closed",closeReason:e})),openSingleWalletModal:e=>{setTimeout(()=>M0({status:"opened",closeReason:null,walletInfo:e}))},closeSingleWalletModal:e=>void setTimeout(()=>M0({status:"closed",closeReason:e})),setAction:e=>void setTimeout(()=>Si(e)),clearAction:()=>void setTimeout(()=>Si(null)),getSelectedWalletInfo:()=>K4(),removeSelectedWalletInfo:()=>gn(null),renderApp:(e,t)=>c4(()=>m(W9,{tonConnectUI:t}),document.getElementById(e))};class N9{constructor(t){Me(this,"connector"),Me(this,"setConnectRequestParametersCallback"),Me(this,"consumers",[]),Me(this,"tracker"),Me(this,"state",Cf()),this.connector=t.connector,this.tracker=t.tracker,this.setConnectRequestParametersCallback=t.setConnectRequestParametersCallback,cn(()=>{const n=Cf();this.state=n,this.consumers.forEach(r=>r(n))})}open(){return xt(this,null,function*(){this.tracker.trackConnectionStarted();const n=(yield this.connector.getWallets()).find(Cc);return n?this.connectEmbeddedWallet(n):this.openWalletsModal()})}close(t="action-cancelled"){t==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),Vn.closeWalletsModal(t)}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(n=>n!==t)}}connectEmbeddedWallet(t){const n=o=>{gn(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},r=ht.connectRequestParameters;(r==null?void 0:r.state)==="loading"?this.setConnectRequestParametersCallback(n):n(r==null?void 0:r.value)}openWalletsModal(){return xt(this,null,function*(){return Gr()&&Bd(),Vn.openWalletsModal(),new Promise(t=>{const n=this.onStateChange(r=>{const{status:o}=r;o==="opened"&&(n(),t())})})})}}class U9{constructor(t){Me(this,"connector"),Me(this,"consumers",[]),this.connector=t.connector,cn(()=>{const n=Or();this.consumers.forEach(r=>r(n))})}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(n=>n!==t)}}}class O9{constructor(t){Me(this,"connector"),Me(this,"setConnectRequestParametersCallback"),Me(this,"consumers",[]),Me(this,"tracker"),Me(this,"state",Fa()),this.connector=t.connector,this.tracker=t.tracker,this.setConnectRequestParametersCallback=t.setConnectRequestParametersCallback,cn(()=>{const n=Fa();this.state=n,this.consumers.forEach(r=>r(n))})}open(t){return xt(this,null,function*(){this.tracker.trackConnectionStarted();const n=yield this.connector.getWallets(),r=qd(n,ht.walletsListConfiguration),o=r.find(Cc);if(!!o)return this.connectEmbeddedWallet(o);const s=r.filter(Td).find(d=>co(d,t));if(!!s)return this.openSingleWalletModal(s);const f=`Trying to open modal window with unknown wallet "${t}".`;throw this.tracker.trackConnectionError(f),new qt(f)})}close(t="action-cancelled"){t==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),Vn.closeSingleWalletModal("action-cancelled")}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(n=>n!==t)}}connectEmbeddedWallet(t){const n=o=>{gn(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},r=ht.connectRequestParameters;(r==null?void 0:r.state)==="loading"?this.setConnectRequestParametersCallback(n):n(r==null?void 0:r.value)}openSingleWalletModal(t){return xt(this,null,function*(){return Gr()&&Bd(),Vn.openSingleWalletModal(t),new Promise(n=>{const r=this.onStateChange(o=>{const{status:i}=o;i==="opened"&&(r(),n())})})})}}class B9{constructor(t){Me(this,"eventPrefix","ton-connect-ui-"),Me(this,"tonConnectUiVersion"),Me(this,"tonConnectSdkVersion",null),Me(this,"eventDispatcher");var n;this.eventDispatcher=(n=t==null?void 0:t.eventDispatcher)!=null?n:new Hp,this.tonConnectUiVersion=t.tonConnectUiVersion,this.init().catch()}get version(){return ni({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return xt(this,null,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch{}})}setRequestVersionHandler(){return xt(this,null,function*(){yield this.eventDispatcher.addEventListener("ton-connect-ui-request-version",()=>xt(this,null,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-ui-response-version",Mp(this.tonConnectUiVersion))}))})}requestTonConnectSdkVersion(){return xt(this,null,function*(){return new Promise((t,n)=>xt(this,null,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-response-version",r=>{t(r.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-request-version",Pp())}catch(r){n(r)}}))})}dispatchUserActionEvent(t){var n;try{(n=this.eventDispatcher)==null||n.dispatchEvent(`${this.eventPrefix}${t.type}`,t).catch()}catch{}}trackConnectionStarted(...t){try{const n=Rp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionCompleted(...t){try{const n=Ip(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionError(...t){try{const n=$p(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringStarted(...t){try{const n=Wp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringCompleted(...t){try{const n=Np(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringError(...t){try{const n=Up(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackDisconnection(...t){try{const n=Dp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSentForSignature(...t){try{const n=Op(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigned(...t){try{const n=Bp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigningFailed(...t){try{const n=jp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}}const j9="2.0.5";class D9{constructor(t){if(Me(this,"walletInfoStorage",new F4),Me(this,"preferredWalletStorage",new z4),Me(this,"tracker"),Me(this,"walletInfo",null),Me(this,"systemThemeChangeUnsubscribe",null),Me(this,"actionsConfiguration"),Me(this,"walletsList"),Me(this,"connectRequestParametersCallback"),Me(this,"connector"),Me(this,"modal"),Me(this,"singleWalletModal"),Me(this,"transactionModal"),Me(this,"connectionRestored",Promise.resolve(!1)),t&&"connector"in t&&t.connector)this.connector=t.connector;else if(t&&"manifestUrl"in t&&t.manifestUrl)this.connector=new Xo({manifestUrl:t.manifestUrl,eventDispatcher:t==null?void 0:t.eventDispatcher});else throw new qt("You have to specify a `manifestUrl` or a `connector` in the options.");this.tracker=new B9({eventDispatcher:t==null?void 0:t.eventDispatcher,tonConnectUiVersion:j9}),this.modal=new N9({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:o=>{this.connectRequestParametersCallback=o}}),this.singleWalletModal=new O9({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:o=>{this.connectRequestParametersCallback=o}}),this.transactionModal=new U9({connector:this.connector}),this.walletsList=this.getWallets(),this.walletsList.then(o=>ug(pw(o.map(i=>i.imageUrl))));const n=this.normalizeWidgetRoot(t==null?void 0:t.widgetRootId);this.subscribeToWalletChange(),(t==null?void 0:t.restoreConnection)!==!1&&(this.connectionRestored=j4(()=>xt(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=bo(t,{uiPreferences:{theme:"SYSTEM"}});const r=this.preferredWalletStorage.getPreferredWalletAppName();zs({connector:this.connector,preferredWalletAppName:r}),Vn.renderApp(n,this)}static getWallets(){return Xo.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?Ct(Ct({},this.connector.wallet),this.walletInfo):null}set uiOptions(t){var n,r,o,i,l;this.checkButtonRootExist(t.buttonRootId),this.actionsConfiguration=t.actionsConfiguration,(n=t.uiPreferences)!=null&&n.theme?((r=t.uiPreferences)==null?void 0:r.theme)!=="SYSTEM"?((o=this.systemThemeChangeUnsubscribe)==null||o.call(this),au(t.uiPreferences.theme,t.uiPreferences.colorsSet)):(au($4(),t.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=W4(au))):(i=t.uiPreferences)!=null&&i.colorsSet&&y6(t.uiPreferences.colorsSet),(l=t.uiPreferences)!=null&&l.borderRadius&&m6(t.uiPreferences.borderRadius),zs(s=>{var c,f;const d=bo(Ct(Ct(Ct(Ct({},t.language&&{language:t.language}),!!((c=t.actionsConfiguration)!=null&&c.returnStrategy)&&{returnStrategy:t.actionsConfiguration.returnStrategy}),!!((f=t.actionsConfiguration)!=null&&f.twaReturnUrl)&&{twaReturnUrl:t.actionsConfiguration.twaReturnUrl}),!!t.walletsListConfiguration&&{walletsListConfiguration:t.walletsListConfiguration}),Di(s));return t.buttonRootId!==void 0&&(d.buttonRootId=t.buttonRootId),t.enableAndroidBackHandler!==void 0&&(d.enableAndroidBackHandler=t.enableAndroidBackHandler),d})}setConnectRequestParameters(t){var n;zs({connectRequestParameters:t}),((t==null?void 0:t.state)==="ready"||!t)&&((n=this.connectRequestParametersCallback)==null||n.call(this,t==null?void 0:t.value))}getWallets(){return xt(this,null,function*(){return this.connector.getWallets()})}onStatusChange(t,n){return this.connector.onStatusChange(r=>xt(this,null,function*(){if(r){const o=yield this.getSelectedWalletInfo(r);t(Ct(Ct({},r),o||this.walletInfoStorage.getWalletInfo()))}else t(r)}),n)}openModal(){return xt(this,null,function*(){return this.modal.open()})}closeModal(t){this.modal.close(t)}onModalStateChange(t){return this.modal.onStateChange(t)}get modalState(){return this.modal.state}openSingleWalletModal(t){return xt(this,null,function*(){return this.singleWalletModal.open(t)})}closeSingleWalletModal(t){this.singleWalletModal.close(t)}onSingleWalletModalStateChange(t){return this.singleWalletModal.onStateChange(t)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(){return xt(this,null,function*(){const n=(yield this.getWallets()).find(Cc);return n?yield this.connectEmbeddedWallet(n):yield this.connectExternalWallet()})}disconnect(){return this.tracker.trackDisconnection(this.wallet,"dapp"),Vn.clearAction(),Vn.removeSelectedWalletInfo(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(t,n){return xt(this,null,function*(){if(this.tracker.trackTransactionSentForSignature(this.wallet,t),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,t,"Wallet was not connected"),new qt("Connect wallet to send a transaction.");Gr()&&Bd();const{notifications:r,modals:o,returnStrategy:i,twaReturnUrl:l,skipRedirectToWallet:s}=this.getModalsAndNotificationsConfiguration(n);Vn.setAction({name:"confirm-transaction",showNotification:r.includes("before"),openModal:o.includes("before"),sent:!1});const c=()=>{f.signal.aborted||(Vn.setAction({name:"confirm-transaction",showNotification:r.includes("before"),openModal:o.includes("before"),sent:!0}),this.walletInfo&&"universalLink"in this.walletInfo&&(this.walletInfo.openMethod==="universal-link"||this.walletInfo.openMethod==="custom-deeplink")&&(zo(this.walletInfo.universalLink)?ms(this.walletInfo.universalLink,{returnStrategy:i,twaReturnUrl:l||ht.twaReturnUrl,forceRedirect:!1}):ys(this.walletInfo.universalLink,this.walletInfo.deepLink,{returnStrategy:i,forceRedirect:!1},()=>{})))},f=new AbortController,d=this.onTransactionModalStateChange(w=>{w!=null&&w.openModal||(d(),w||f.abort())});try{const w=yield this.waitForSendTransaction({transaction:t,signal:f.signal},c);return this.tracker.trackTransactionSigned(this.wallet,t,w),Vn.setAction({name:"transaction-sent",showNotification:r.includes("success"),openModal:o.includes("success")}),w}catch(w){throw Vn.setAction({name:"transaction-canceled",showNotification:r.includes("error"),openModal:o.includes("error")}),w instanceof Le?w:(console.error(w),new qt("Unhandled error:"+w))}finally{d()}})}connectEmbeddedWallet(t){return xt(this,null,function*(){const n=o=>{gn(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},r=ht.connectRequestParameters;return(r==null?void 0:r.state)==="loading"?this.connectRequestParametersCallback=n:n(r==null?void 0:r.value),yield this.waitForWalletConnection({ignoreErrors:!1})})}connectExternalWallet(){return xt(this,null,function*(){const t=new AbortController;Vn.openWalletsModal();const n=this.onModalStateChange(r=>{const{status:o,closeReason:i}=r;o!=="opened"&&(n(),i==="action-cancelled"&&t.abort())});return yield this.waitForWalletConnection({ignoreErrors:!0,signal:t.signal})})}waitForWalletConnection(t){return xt(this,null,function*(){return new Promise((n,r)=>{this.tracker.trackConnectionStarted();const{ignoreErrors:o=!1,signal:i=null}=t;if(i&&i.aborted)return this.tracker.trackConnectionError("Connection was cancelled"),r(new qt("Wallet was not connected"));const l=f=>xt(this,null,function*(){if(f)this.tracker.trackConnectionCompleted(f),c(),n(f);else{if(this.tracker.trackConnectionError("Connection was cancelled"),o)return;c(),r(new qt("Wallet was not connected"))}}),s=f=>{this.tracker.trackConnectionError(f.message),!o&&(c(),r(f))},c=this.onStatusChange(f=>l(f),f=>s(f));i&&i.addEventListener("abort",()=>{c(),r(new qt("Wallet was not connected"))},{once:!0})})})}waitForSendTransaction(t,n){return xt(this,null,function*(){return new Promise((r,o)=>{const{transaction:i,signal:l}=t;if(l.aborted)return this.tracker.trackTransactionSigningFailed(this.wallet,i,"Transaction was cancelled"),o(new qt("Transaction was not sent"));const s=d=>xt(this,null,function*(){r(d)}),c=d=>{o(d)},f=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,i,"Transaction was cancelled"),o(new qt("Transaction was not sent"))};l.addEventListener("abort",f,{once:!0}),this.connector.sendTransaction(i,{onRequestSent:n,signal:l}).then(d=>(l.removeEventListener("abort",f),s(d))).catch(d=>(l.removeEventListener("abort",f),c(d)))})})}onTransactionModalStateChange(t){return this.transactionModal.onStateChange(t)}subscribeToWalletChange(){this.connector.onStatusChange(t=>xt(this,null,function*(){var n;t?(yield this.updateWalletInfo(t),this.setPreferredWalletAppName(((n=this.walletInfo)==null?void 0:n.appName)||t.device.appName)):this.walletInfoStorage.removeWalletInfo()}))}setPreferredWalletAppName(t){this.preferredWalletStorage.setPreferredWalletAppName(t),zs({preferredWalletAppName:t})}getSelectedWalletInfo(t){return xt(this,null,function*(){let n=Vn.getSelectedWalletInfo();if(!n)return null;let r;if("name"in n)r=n;else{const i=qd(yield this.walletsList,ht.walletsListConfiguration).find(l=>co(l,t.device.appName));if(!i)throw new qt(`Cannot find WalletInfo for the '${t.device.appName}' wallet`);r=Ct(Ct({},i),n)}return r})}updateWalletInfo(t){return xt(this,null,function*(){const n=yield this.getSelectedWalletInfo(t);if(n){this.walletInfo=n,this.walletInfoStorage.setWalletInfo(n);return}const r=this.walletInfoStorage.getWalletInfo();if(r){this.walletInfo=r;return}this.walletInfo=(yield this.walletsList).find(o=>co(o,t.device.appName))||null})}normalizeWidgetRoot(t){if(!t||!document.getElementById(t)){t="tc-widget-root";const n=document.createElement("div");n.id=t,document.body.appendChild(n)}return t}checkButtonRootExist(t){if(t!=null&&!document.getElementById(t))throw new qt(`${t} element not found in the document.`)}getModalsAndNotificationsConfiguration(t){var n,r,o,i,l,s;const c=["before","success","error"];let f=c;(n=this.actionsConfiguration)!=null&&n.notifications&&((r=this.actionsConfiguration)==null?void 0:r.notifications)!=="all"&&(f=this.actionsConfiguration.notifications),t!=null&&t.notifications&&(t.notifications==="all"?f=c:f=t.notifications);let d=["before"];(o=this.actionsConfiguration)!=null&&o.modals&&(this.actionsConfiguration.modals==="all"?d=c:d=this.actionsConfiguration.modals),t!=null&&t.modals&&(t.modals==="all"?d=c:d=t.modals);const w=(t==null?void 0:t.returnStrategy)||((i=this.actionsConfiguration)==null?void 0:i.returnStrategy)||"back",h=(t==null?void 0:t.twaReturnUrl)||((l=this.actionsConfiguration)==null?void 0:l.twaReturnUrl);let S=(t==null?void 0:t.skipRedirectToWallet)||((s=this.actionsConfiguration)==null?void 0:s.skipRedirectToWallet)||"ios";return Gr()&&(S="never"),{notifications:f,modals:d,returnStrategy:w,twaReturnUrl:h,skipRedirectToWallet:S}}}var H9=Object.defineProperty,Ja=Object.getOwnPropertySymbols,Yg=Object.prototype.hasOwnProperty,Zg=Object.prototype.propertyIsEnumerable,lh=(e,t,n)=>t in e?H9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F9=(e,t)=>{for(var n in t||(t={}))Yg.call(t,n)&&lh(e,n,t[n]);if(Ja)for(var n of Ja(t))Zg.call(t,n)&&lh(e,n,t[n]);return e},z9=(e,t)=>{var n={};for(var r in e)Yg.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ja)for(var r of Ja(e))t.indexOf(r)<0&&Zg.call(e,r)&&(n[r]=e[r]);return n},Gg={exports:{}},il={};/** +`,Qd=e=>{const t=gs(e),n=In(Io),[r,o]=We(!0),[i,l]=We(!1);un(()=>{const d=Br();l(!!d&&"sent"in d&&d.sent)});let s;n!=null&&n.wallet&&"universalLink"in n.wallet&&(n.wallet.openMethod==="universal-link"||zo(n.wallet.universalLink)&&Gr())&&(s=n.wallet.universalLink);let c;n!=null&&n.wallet&&"deepLink"in n.wallet&&(n.wallet.openMethod==="custom-deeplink"||zo(n.wallet.deepLink)&&Gr())&&(c=n.wallet.deepLink);const f=()=>{const d=Br(),w="returnStrategy"in d?d.returnStrategy:ht.returnStrategy,h=!r();o(!1),zo(s)?ms(s,{returnStrategy:w,twaReturnUrl:"twaReturnUrl"in d?d.twaReturnUrl:ht.twaReturnUrl,forceRedirect:h}):ys(s,c,{returnStrategy:w,forceRedirect:h},()=>{})};return m(k9,Lr(t,{get children(){return[de(()=>e.icon),m(E9,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),m(T9,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),m(je,{get when(){return!i()&&(e.showButton==="open-wallet"&&s||e.showButton!=="open-wallet")},get children(){return m(A9,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return m(L9,{})}})}}),m(je,{get when(){return i()},get children(){return[m(je,{get when(){return e.showButton!=="open-wallet"},get children(){return m(ih,{onClick:()=>e.onClose(),get children(){return m(sn,{translationKey:"common.close",children:"Close"})}})}}),m(je,{get when(){return e.showButton==="open-wallet"&&s},get children(){return m(ih,{onClick:f,get children(){return m(sn,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},P9=e=>{const t=In(Io),[n]=Ir(),r=()=>t.wallet&&"name"in t.wallet?t.wallet.name:n("common.yourWallet",{},"Your wallet");return m(Qd,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:r()}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return m(to,{size:"m"})},onClose:()=>e.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},M9=e=>m(Qd,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return m(Tc,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":"true"}),R9=e=>m(Qd,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return m(Fd,{size:"m"})},onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":"true"}),I9=()=>m(Sg,{get opened(){var e;return de(()=>Br()!==null)()&&((e=Br())==null?void 0:e.openModal)===!0},get enableAndroidBackHandler(){return ht.enableAndroidBackHandler},onClose:()=>Si(null),"data-tc-actions-modal-container":"true",get children(){return m(fs,{get children(){return[m(pn,{get when(){return Br().name==="transaction-sent"},get children(){return m(R9,{onClose:()=>Si(null)})}}),m(pn,{get when(){return Br().name==="transaction-canceled"},get children(){return m(M9,{onClose:()=>Si(null)})}}),m(pn,{get when(){return Br().name==="confirm-transaction"},get children(){return m(P9,{onClose:()=>Si(null)})}})]}})}}),$9=()=>{const{locale:e}=Ir()[1];un(()=>e(ht.language)),un(()=>{R0()&&Za()});const t=In(Yi),n=In(Io),[r,o]=We(!1),i=()=>{var f;return((f=ht.connectRequestParameters)==null?void 0:f.state)==="loading"},l=de(()=>{var f;if(!i())return(f=ht.connectRequestParameters)==null?void 0:f.value}),s=f=>{n.closeSingleWalletModal(f)},c=t.onStatusChange(f=>{f&&s("wallet-selected")});return Rn(c),Rn(()=>{o(!1)}),m(Bg,{get opened(){return R0()},get enableAndroidBackHandler(){return ht.enableAndroidBackHandler},onClose:()=>s("action-cancelled"),onClickQuestion:()=>o(f=>!f),"data-tc-wallets-modal-container":"true",get children(){return[m(je,{get when(){return r()},get children(){return m(Fg,{onBackClick:()=>o(!1)})}}),m(je,{get when(){return!r()},get children(){return[m(je,{get when(){return i()},get children(){return[m(jg,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),m(Dg,{get children(){return m(to,{size:"m"})}})]}}),m(je,{get when(){return!i()},get children(){return m(ji,{get component(){return Hi()?zg:Hg},get wallet(){return V4()},get additionalRequest(){return l()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},N9=e=>{const t=c8(a6,ht.language);return B4(),O4(),m(Eg.Provider,{value:t,get children(){return m(Io.Provider,{get value(){return e.tonConnectUI},get children(){return m(Yi.Provider,{get value(){return ht.connector},get children(){return[m(P4,{}),m(A4,{theme:v6,get children(){return[m(je,{get when(){return ht.buttonRootId},get children(){return m(ig,{get mount(){return document.getElementById(ht.buttonRootId)},get children(){return m(hw,{})}})}}),m(ji,{component:Or,get children(){return[m(_9,{}),m($9,{}),m(I9,{})]}})]}})]}})}})}})},Vn={openWalletsModal:()=>void setTimeout(()=>L0({status:"opened",closeReason:null})),closeWalletsModal:e=>void setTimeout(()=>L0({status:"closed",closeReason:e})),openSingleWalletModal:e=>{setTimeout(()=>M0({status:"opened",closeReason:null,walletInfo:e}))},closeSingleWalletModal:e=>void setTimeout(()=>M0({status:"closed",closeReason:e})),setAction:e=>void setTimeout(()=>Si(e)),clearAction:()=>void setTimeout(()=>Si(null)),getSelectedWalletInfo:()=>K4(),removeSelectedWalletInfo:()=>gn(null),renderApp:(e,t)=>c4(()=>m(N9,{tonConnectUI:t}),document.getElementById(e))};class W9{constructor(t){Me(this,"connector"),Me(this,"setConnectRequestParametersCallback"),Me(this,"consumers",[]),Me(this,"tracker"),Me(this,"state",Cf()),this.connector=t.connector,this.tracker=t.tracker,this.setConnectRequestParametersCallback=t.setConnectRequestParametersCallback,un(()=>{const n=Cf();this.state=n,this.consumers.forEach(r=>r(n))})}open(){return xt(this,null,function*(){this.tracker.trackConnectionStarted();const n=(yield this.connector.getWallets()).find(Cc);return n?this.connectEmbeddedWallet(n):this.openWalletsModal()})}close(t="action-cancelled"){t==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),Vn.closeWalletsModal(t)}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(n=>n!==t)}}connectEmbeddedWallet(t){const n=o=>{gn(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},r=ht.connectRequestParameters;(r==null?void 0:r.state)==="loading"?this.setConnectRequestParametersCallback(n):n(r==null?void 0:r.value)}openWalletsModal(){return xt(this,null,function*(){return Gr()&&Bd(),Vn.openWalletsModal(),new Promise(t=>{const n=this.onStateChange(r=>{const{status:o}=r;o==="opened"&&(n(),t())})})})}}class U9{constructor(t){Me(this,"connector"),Me(this,"consumers",[]),this.connector=t.connector,un(()=>{const n=Br();this.consumers.forEach(r=>r(n))})}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(n=>n!==t)}}}class O9{constructor(t){Me(this,"connector"),Me(this,"setConnectRequestParametersCallback"),Me(this,"consumers",[]),Me(this,"tracker"),Me(this,"state",Fa()),this.connector=t.connector,this.tracker=t.tracker,this.setConnectRequestParametersCallback=t.setConnectRequestParametersCallback,un(()=>{const n=Fa();this.state=n,this.consumers.forEach(r=>r(n))})}open(t){return xt(this,null,function*(){this.tracker.trackConnectionStarted();const n=yield this.connector.getWallets(),r=qd(n,ht.walletsListConfiguration),o=r.find(Cc);if(!!o)return this.connectEmbeddedWallet(o);const s=r.filter(Td).find(d=>co(d,t));if(!!s)return this.openSingleWalletModal(s);const f=`Trying to open modal window with unknown wallet "${t}".`;throw this.tracker.trackConnectionError(f),new qt(f)})}close(t="action-cancelled"){t==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),Vn.closeSingleWalletModal("action-cancelled")}onStateChange(t){return this.consumers.push(t),()=>{this.consumers=this.consumers.filter(n=>n!==t)}}connectEmbeddedWallet(t){const n=o=>{gn(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},r=ht.connectRequestParameters;(r==null?void 0:r.state)==="loading"?this.setConnectRequestParametersCallback(n):n(r==null?void 0:r.value)}openSingleWalletModal(t){return xt(this,null,function*(){return Gr()&&Bd(),Vn.openSingleWalletModal(t),new Promise(n=>{const r=this.onStateChange(o=>{const{status:i}=o;i==="opened"&&(r(),n())})})})}}class B9{constructor(t){Me(this,"eventPrefix","ton-connect-ui-"),Me(this,"tonConnectUiVersion"),Me(this,"tonConnectSdkVersion",null),Me(this,"eventDispatcher");var n;this.eventDispatcher=(n=t==null?void 0:t.eventDispatcher)!=null?n:new Hp,this.tonConnectUiVersion=t.tonConnectUiVersion,this.init().catch()}get version(){return ni({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return xt(this,null,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch{}})}setRequestVersionHandler(){return xt(this,null,function*(){yield this.eventDispatcher.addEventListener("ton-connect-ui-request-version",()=>xt(this,null,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-ui-response-version",Mp(this.tonConnectUiVersion))}))})}requestTonConnectSdkVersion(){return xt(this,null,function*(){return new Promise((t,n)=>xt(this,null,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-response-version",r=>{t(r.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-request-version",Pp())}catch(r){n(r)}}))})}dispatchUserActionEvent(t){var n;try{(n=this.eventDispatcher)==null||n.dispatchEvent(`${this.eventPrefix}${t.type}`,t).catch()}catch{}}trackConnectionStarted(...t){try{const n=Rp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionCompleted(...t){try{const n=Ip(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionError(...t){try{const n=$p(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringStarted(...t){try{const n=Np(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringCompleted(...t){try{const n=Wp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackConnectionRestoringError(...t){try{const n=Up(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackDisconnection(...t){try{const n=Dp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSentForSignature(...t){try{const n=Op(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigned(...t){try{const n=Bp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}trackTransactionSigningFailed(...t){try{const n=jp(this.version,...t);this.dispatchUserActionEvent(n)}catch{}}}const j9="2.0.5";class D9{constructor(t){if(Me(this,"walletInfoStorage",new F4),Me(this,"preferredWalletStorage",new z4),Me(this,"tracker"),Me(this,"walletInfo",null),Me(this,"systemThemeChangeUnsubscribe",null),Me(this,"actionsConfiguration"),Me(this,"walletsList"),Me(this,"connectRequestParametersCallback"),Me(this,"connector"),Me(this,"modal"),Me(this,"singleWalletModal"),Me(this,"transactionModal"),Me(this,"connectionRestored",Promise.resolve(!1)),t&&"connector"in t&&t.connector)this.connector=t.connector;else if(t&&"manifestUrl"in t&&t.manifestUrl)this.connector=new Xo({manifestUrl:t.manifestUrl,eventDispatcher:t==null?void 0:t.eventDispatcher});else throw new qt("You have to specify a `manifestUrl` or a `connector` in the options.");this.tracker=new B9({eventDispatcher:t==null?void 0:t.eventDispatcher,tonConnectUiVersion:j9}),this.modal=new W9({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:o=>{this.connectRequestParametersCallback=o}}),this.singleWalletModal=new O9({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:o=>{this.connectRequestParametersCallback=o}}),this.transactionModal=new U9({connector:this.connector}),this.walletsList=this.getWallets(),this.walletsList.then(o=>ug(pw(o.map(i=>i.imageUrl))));const n=this.normalizeWidgetRoot(t==null?void 0:t.widgetRootId);this.subscribeToWalletChange(),(t==null?void 0:t.restoreConnection)!==!1&&(this.connectionRestored=j4(()=>xt(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=bo(t,{uiPreferences:{theme:"SYSTEM"}});const r=this.preferredWalletStorage.getPreferredWalletAppName();zs({connector:this.connector,preferredWalletAppName:r}),Vn.renderApp(n,this)}static getWallets(){return Xo.getWallets()}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?Ct(Ct({},this.connector.wallet),this.walletInfo):null}set uiOptions(t){var n,r,o,i,l;this.checkButtonRootExist(t.buttonRootId),this.actionsConfiguration=t.actionsConfiguration,(n=t.uiPreferences)!=null&&n.theme?((r=t.uiPreferences)==null?void 0:r.theme)!=="SYSTEM"?((o=this.systemThemeChangeUnsubscribe)==null||o.call(this),au(t.uiPreferences.theme,t.uiPreferences.colorsSet)):(au($4(),t.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=N4(au))):(i=t.uiPreferences)!=null&&i.colorsSet&&y6(t.uiPreferences.colorsSet),(l=t.uiPreferences)!=null&&l.borderRadius&&m6(t.uiPreferences.borderRadius),zs(s=>{var c,f;const d=bo(Ct(Ct(Ct(Ct({},t.language&&{language:t.language}),!!((c=t.actionsConfiguration)!=null&&c.returnStrategy)&&{returnStrategy:t.actionsConfiguration.returnStrategy}),!!((f=t.actionsConfiguration)!=null&&f.twaReturnUrl)&&{twaReturnUrl:t.actionsConfiguration.twaReturnUrl}),!!t.walletsListConfiguration&&{walletsListConfiguration:t.walletsListConfiguration}),Di(s));return t.buttonRootId!==void 0&&(d.buttonRootId=t.buttonRootId),t.enableAndroidBackHandler!==void 0&&(d.enableAndroidBackHandler=t.enableAndroidBackHandler),d})}setConnectRequestParameters(t){var n;zs({connectRequestParameters:t}),((t==null?void 0:t.state)==="ready"||!t)&&((n=this.connectRequestParametersCallback)==null||n.call(this,t==null?void 0:t.value))}getWallets(){return xt(this,null,function*(){return this.connector.getWallets()})}onStatusChange(t,n){return this.connector.onStatusChange(r=>xt(this,null,function*(){if(r){const o=yield this.getSelectedWalletInfo(r);t(Ct(Ct({},r),o||this.walletInfoStorage.getWalletInfo()))}else t(r)}),n)}openModal(){return xt(this,null,function*(){return this.modal.open()})}closeModal(t){this.modal.close(t)}onModalStateChange(t){return this.modal.onStateChange(t)}get modalState(){return this.modal.state}openSingleWalletModal(t){return xt(this,null,function*(){return this.singleWalletModal.open(t)})}closeSingleWalletModal(t){this.singleWalletModal.close(t)}onSingleWalletModalStateChange(t){return this.singleWalletModal.onStateChange(t)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(){return xt(this,null,function*(){const n=(yield this.getWallets()).find(Cc);return n?yield this.connectEmbeddedWallet(n):yield this.connectExternalWallet()})}disconnect(){return this.tracker.trackDisconnection(this.wallet,"dapp"),Vn.clearAction(),Vn.removeSelectedWalletInfo(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(t,n){return xt(this,null,function*(){if(this.tracker.trackTransactionSentForSignature(this.wallet,t),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,t,"Wallet was not connected"),new qt("Connect wallet to send a transaction.");Gr()&&Bd();const{notifications:r,modals:o,returnStrategy:i,twaReturnUrl:l,skipRedirectToWallet:s}=this.getModalsAndNotificationsConfiguration(n);Vn.setAction({name:"confirm-transaction",showNotification:r.includes("before"),openModal:o.includes("before"),sent:!1});const c=()=>{f.signal.aborted||(Vn.setAction({name:"confirm-transaction",showNotification:r.includes("before"),openModal:o.includes("before"),sent:!0}),this.walletInfo&&"universalLink"in this.walletInfo&&(this.walletInfo.openMethod==="universal-link"||this.walletInfo.openMethod==="custom-deeplink")&&(zo(this.walletInfo.universalLink)?ms(this.walletInfo.universalLink,{returnStrategy:i,twaReturnUrl:l||ht.twaReturnUrl,forceRedirect:!1}):ys(this.walletInfo.universalLink,this.walletInfo.deepLink,{returnStrategy:i,forceRedirect:!1},()=>{})))},f=new AbortController,d=this.onTransactionModalStateChange(w=>{w!=null&&w.openModal||(d(),w||f.abort())});try{const w=yield this.waitForSendTransaction({transaction:t,signal:f.signal},c);return this.tracker.trackTransactionSigned(this.wallet,t,w),Vn.setAction({name:"transaction-sent",showNotification:r.includes("success"),openModal:o.includes("success")}),w}catch(w){throw Vn.setAction({name:"transaction-canceled",showNotification:r.includes("error"),openModal:o.includes("error")}),w instanceof Le?w:(console.error(w),new qt("Unhandled error:"+w))}finally{d()}})}connectEmbeddedWallet(t){return xt(this,null,function*(){const n=o=>{gn(t),this.connector.connect({jsBridgeKey:t.jsBridgeKey},o)},r=ht.connectRequestParameters;return(r==null?void 0:r.state)==="loading"?this.connectRequestParametersCallback=n:n(r==null?void 0:r.value),yield this.waitForWalletConnection({ignoreErrors:!1})})}connectExternalWallet(){return xt(this,null,function*(){const t=new AbortController;Vn.openWalletsModal();const n=this.onModalStateChange(r=>{const{status:o,closeReason:i}=r;o!=="opened"&&(n(),i==="action-cancelled"&&t.abort())});return yield this.waitForWalletConnection({ignoreErrors:!0,signal:t.signal})})}waitForWalletConnection(t){return xt(this,null,function*(){return new Promise((n,r)=>{this.tracker.trackConnectionStarted();const{ignoreErrors:o=!1,signal:i=null}=t;if(i&&i.aborted)return this.tracker.trackConnectionError("Connection was cancelled"),r(new qt("Wallet was not connected"));const l=f=>xt(this,null,function*(){if(f)this.tracker.trackConnectionCompleted(f),c(),n(f);else{if(this.tracker.trackConnectionError("Connection was cancelled"),o)return;c(),r(new qt("Wallet was not connected"))}}),s=f=>{this.tracker.trackConnectionError(f.message),!o&&(c(),r(f))},c=this.onStatusChange(f=>l(f),f=>s(f));i&&i.addEventListener("abort",()=>{c(),r(new qt("Wallet was not connected"))},{once:!0})})})}waitForSendTransaction(t,n){return xt(this,null,function*(){return new Promise((r,o)=>{const{transaction:i,signal:l}=t;if(l.aborted)return this.tracker.trackTransactionSigningFailed(this.wallet,i,"Transaction was cancelled"),o(new qt("Transaction was not sent"));const s=d=>xt(this,null,function*(){r(d)}),c=d=>{o(d)},f=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,i,"Transaction was cancelled"),o(new qt("Transaction was not sent"))};l.addEventListener("abort",f,{once:!0}),this.connector.sendTransaction(i,{onRequestSent:n,signal:l}).then(d=>(l.removeEventListener("abort",f),s(d))).catch(d=>(l.removeEventListener("abort",f),c(d)))})})}onTransactionModalStateChange(t){return this.transactionModal.onStateChange(t)}subscribeToWalletChange(){this.connector.onStatusChange(t=>xt(this,null,function*(){var n;t?(yield this.updateWalletInfo(t),this.setPreferredWalletAppName(((n=this.walletInfo)==null?void 0:n.appName)||t.device.appName)):this.walletInfoStorage.removeWalletInfo()}))}setPreferredWalletAppName(t){this.preferredWalletStorage.setPreferredWalletAppName(t),zs({preferredWalletAppName:t})}getSelectedWalletInfo(t){return xt(this,null,function*(){let n=Vn.getSelectedWalletInfo();if(!n)return null;let r;if("name"in n)r=n;else{const i=qd(yield this.walletsList,ht.walletsListConfiguration).find(l=>co(l,t.device.appName));if(!i)throw new qt(`Cannot find WalletInfo for the '${t.device.appName}' wallet`);r=Ct(Ct({},i),n)}return r})}updateWalletInfo(t){return xt(this,null,function*(){const n=yield this.getSelectedWalletInfo(t);if(n){this.walletInfo=n,this.walletInfoStorage.setWalletInfo(n);return}const r=this.walletInfoStorage.getWalletInfo();if(r){this.walletInfo=r;return}this.walletInfo=(yield this.walletsList).find(o=>co(o,t.device.appName))||null})}normalizeWidgetRoot(t){if(!t||!document.getElementById(t)){t="tc-widget-root";const n=document.createElement("div");n.id=t,document.body.appendChild(n)}return t}checkButtonRootExist(t){if(t!=null&&!document.getElementById(t))throw new qt(`${t} element not found in the document.`)}getModalsAndNotificationsConfiguration(t){var n,r,o,i,l,s;const c=["before","success","error"];let f=c;(n=this.actionsConfiguration)!=null&&n.notifications&&((r=this.actionsConfiguration)==null?void 0:r.notifications)!=="all"&&(f=this.actionsConfiguration.notifications),t!=null&&t.notifications&&(t.notifications==="all"?f=c:f=t.notifications);let d=["before"];(o=this.actionsConfiguration)!=null&&o.modals&&(this.actionsConfiguration.modals==="all"?d=c:d=this.actionsConfiguration.modals),t!=null&&t.modals&&(t.modals==="all"?d=c:d=t.modals);const w=(t==null?void 0:t.returnStrategy)||((i=this.actionsConfiguration)==null?void 0:i.returnStrategy)||"back",h=(t==null?void 0:t.twaReturnUrl)||((l=this.actionsConfiguration)==null?void 0:l.twaReturnUrl);let S=(t==null?void 0:t.skipRedirectToWallet)||((s=this.actionsConfiguration)==null?void 0:s.skipRedirectToWallet)||"ios";return Gr()&&(S="never"),{notifications:f,modals:d,returnStrategy:w,twaReturnUrl:h,skipRedirectToWallet:S}}}var H9=Object.defineProperty,Ja=Object.getOwnPropertySymbols,Yg=Object.prototype.hasOwnProperty,Zg=Object.prototype.propertyIsEnumerable,lh=(e,t,n)=>t in e?H9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F9=(e,t)=>{for(var n in t||(t={}))Yg.call(t,n)&&lh(e,n,t[n]);if(Ja)for(var n of Ja(t))Zg.call(t,n)&&lh(e,n,t[n]);return e},z9=(e,t)=>{var n={};for(var r in e)Yg.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ja)for(var r of Ja(e))t.indexOf(r)<0&&Zg.call(e,r)&&(n[r]=e[r]);return n},Gg={exports:{}},il={};/** * @license React * react-jsx-runtime.production.min.js * @@ -1096,4 +1096,4 @@ PERFORMANCE OF THIS SOFTWARE. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var sh;function V9(){if(sh)return il;sh=1;var e=xh,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(s,c,f){var d,w={},h=null,S=null;f!==void 0&&(h=""+f),c.key!==void 0&&(h=""+c.key),c.ref!==void 0&&(S=c.ref);for(d in c)r.call(c,d)&&!i.hasOwnProperty(d)&&(w[d]=c[d]);if(s&&s.defaultProps)for(d in c=s.defaultProps,c)w[d]===void 0&&(w[d]=c[d]);return{$$typeof:t,type:s,key:h,ref:S,props:w,_owner:o.current}}return il.Fragment=n,il.jsx=l,il.jsxs=l,il}(function(e){e.exports=V9()})(Gg);const Jg=Gg.exports.jsx;function Xg(){return typeof window<"u"}function K9(){return!Xg()}const ev=Vr.createContext(null);let mu=null;const q9=e=>{var t=e,{children:n}=t,r=z9(t,["children"]);return Xg()&&!mu&&(mu=new D9(r)),Jg(ev.Provider,{value:mu,children:n})},Q9=Vr.memo(q9);class Yd extends qt{constructor(...t){super(...t),Object.setPrototypeOf(this,Yd.prototype)}}class Zd extends Yd{constructor(...t){super(...t),Object.setPrototypeOf(this,Zd.prototype)}}function Y9(e){if(!e)throw new Zd("You should add on the top of the app to use TonConnect");return!0}function tv(){const e=Vr.useContext(ev),t=Vr.useCallback(n=>{e&&(e.uiOptions=n)},[e]);return K9()?[null,()=>{}]:(Y9(e),[e,t])}const ah="ton-connect-button",Z9=({className:e,style:t})=>{const[n,r]=tv();return Vr.useEffect(()=>(r({buttonRootId:ah}),()=>r({buttonRootId:null})),[r]),Jg("div",{id:ah,className:e,style:F9({width:"fit-content"},t)})},G9=Vr.memo(Z9),J9=()=>{const[e,t]=tv();return t({uiPreferences:{borderRadius:"s"}}),hn.jsx("footer",{className:"footer"})},X9=()=>hn.jsx("header",{children:hn.jsx("div",{id:"wallet-connect-button-wrapper",children:hn.jsx(G9,{})})}),e7=""+new URL("coobot_23-C3PiL-Kj.jpg",import.meta.url).href;function t7(){return hn.jsx(Q9,{manifestUrl:"https://rosticom.github.io/coobot-merkaba-tma/tonconnect-manifest.json",uiPreferences:{theme:$t.DARK},walletsListConfiguration:{includeWallets:[{appName:"safepalwallet",name:"SafePal",imageUrl:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",aboutUrl:"https://www.safepal.com",universalLink:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",jsBridgeKey:"safepalwallet",bridgeUrl:"https://ton-bridge.safepal.com/tonbridge/v1/bridge",platforms:["ios","android","chrome","firefox"]},{appName:"bitgetTonWallet",name:"Bitget Wallet",imageUrl:"https://raw.githubusercontent.com/bitkeepwallet/download/main/logo/png/bitget%20wallet_logo_iOS.png",aboutUrl:"https://web3.bitget.com",deepLink:"bitkeep://",jsBridgeKey:"bitgetTonWallet",bridgeUrl:"https://bridge.tonapi.io/bridge",platforms:["ios","android","chrome"],universalLink:"https://bkcode.vip/ton-connect"},{appName:"tonwallet",name:"TON Wallet",imageUrl:"https://wallet.ton.org/assets/ui/qr-logo.png",aboutUrl:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",universalLink:"https://wallet.ton.org/ton-connect",jsBridgeKey:"tonwallet",bridgeUrl:"https://bridge.tonapi.io/bridge",platforms:["chrome","android"]}]},actionsConfiguration:{twaReturnUrl:"https://rosticom.github.io/coobot-merkaba-tma/"},children:hn.jsxs("div",{className:"app",children:[hn.jsx(X9,{}),hn.jsx("div",{children:hn.jsx("a",{href:"https://t.me/+JuO8mZMYOnRmN2Ux",children:hn.jsx("img",{src:e7,className:"logo",alt:"Coobot chat"})})}),hn.jsx("div",{className:"card",children:hn.jsx("p",{children:hn.jsx("a",{href:"https://t.me/gasPump_bot/app?startapp=eyJyZWZfdXNlcl9pZCI6NTY1ODY0MzE4LCJ0b2tlbl9hZGRyZXNzIjoiRVFEZGlyd3l5YXNST2tvUnc5bUJCekJkUUhjYUFjOUV5OFpoak1TdXRkdHJmU2M1In0",children:"Please, buy some $COO to be rich"})})}),hn.jsx("p",{className:"read-the-docs",children:"buying or selling on the crypto market? doesn't matter with quantum technology!"}),hn.jsx(J9,{})]})})}var nv={},Pc={};(function(){var e={},t="";try{t=location.hash.toString()}catch{}var n=c(t),r=b("initParams");if(r)for(var o in r)typeof n[o]>"u"&&(n[o]=r[o]);O("initParams",n);var i=!1,l;try{if(i=window.parent!=null&&window!=window.parent,i){window.addEventListener("message",function(p){if(p.source===window.parent){try{var y=JSON.parse(p.data)}catch{return}if(!(!y||!y.eventType))if(y.eventType=="set_custom_style")p.origin==="https://web.telegram.org"&&(l.innerHTML=y.eventData);else if(y.eventType=="reload_iframe"){try{window.parent.postMessage(JSON.stringify({eventType:"iframe_will_reload"}),"*")}catch{}location.reload()}else h(y.eventType,y.eventData)}}),l=document.createElement("style"),document.head.appendChild(l);try{window.parent.postMessage(JSON.stringify({eventType:"iframe_ready",eventData:{reload_supported:!0}}),"*")}catch{}}}catch{}function s(p){try{return p=p.replace(/\+/g,"%20"),decodeURIComponent(p)}catch{return p}}function c(p){p=p.replace(/^#/,"");var y={};if(!p.length)return y;if(p.indexOf("=")<0&&p.indexOf("?")<0)return y._path=s(p),y;var E=p.indexOf("?");if(E>=0){var T=p.substr(0,E);y._path=s(T),p=p.substr(E+1)}var W=f(p);for(var I in W)y[I]=W[I];return y}function f(p){var y={};if(!p.length)return y;var E=p.split("&"),T,W,I,L;for(T=0;T=0?p+"&"+y:T.length>0?p+"?"+y:p+y}function w(p,y,E){if(y||(y=function(){}),E===void 0&&(E=""),console.log("[Telegram.WebView] > postEvent",p,E),window.TelegramWebviewProxy!==void 0)TelegramWebviewProxy.postEvent(p,JSON.stringify(E)),y();else if(window.external&&"notify"in window.external)window.external.notify(JSON.stringify({eventType:p,eventData:E})),y();else if(i)try{var T="https://web.telegram.org";T="*",window.parent.postMessage(JSON.stringify({eventType:p,eventData:E}),T),y()}catch(W){y(W)}else y({notAvailable:!0})}function h(p,y){console.log("[Telegram.WebView] < receiveEvent",p,y),S(p,function(E){E(p,y)})}function S(p,y){var E=e[p];if(!(E===void 0||!E.length))for(var T=0;Tit?1:-1;return 0}function re(A){return G(f,A)>=0}function Se(A){if(window.Blob)try{return new Blob([A]).size}catch{}for(var R=A.length,j=A.length-1;j>=0;j--){var oe=A.charCodeAt(j);oe>127&&oe<=2047?R++:oe>2047&&oe<=65535&&(R+=2),oe>=56320&&oe<=57343&&j--}return R}var _e=function(){var A=!1,R={};Object.defineProperty(R,"isVisible",{set:function(Oe){Ge({is_visible:Oe})},get:function(){return A},enumerable:!0});var j=null;t.onEvent("back_button_pressed",oe);function oe(){T("backButtonClicked")}function he(){return{is_visible:A}}function it(Oe){return typeof Oe>"u"&&(Oe=he()),JSON.stringify(Oe)}function Ae(){return re("6.1")?!0:(console.warn("[Telegram.WebApp] BackButton is not supported in version "+f),!1)}function Dt(){var Oe=he(),Tt=it(Oe);j!==Tt&&(j=Tt,t.postEvent("web_app_setup_back_button",!1,Oe))}function Ge(Oe){return Ae()&&(typeof Oe.is_visible<"u"&&(A=!!Oe.is_visible),Dt()),R}return R.onClick=function(Oe){return Ae()&&W("backButtonClicked",Oe),R},R.offClick=function(Oe){return Ae()&&I("backButtonClicked",Oe),R},R.show=function(){return Ge({is_visible:!0})},R.hide=function(){return Ge({is_visible:!1})},R}(),Ve=0,bt=function(){var A=!1,R=!0,j=!1,oe="CONTINUE",he=!1,it=!1,Ae={};Object.defineProperty(Ae,"text",{set:function(u){Ae.setParams({text:u})},get:function(){return oe},enumerable:!0}),Object.defineProperty(Ae,"color",{set:function(u){Ae.setParams({color:u})},get:function(){return he||s.button_color||"#2481cc"},enumerable:!0}),Object.defineProperty(Ae,"textColor",{set:function(u){Ae.setParams({text_color:u})},get:function(){return it||s.button_text_color||"#ffffff"},enumerable:!0}),Object.defineProperty(Ae,"isVisible",{set:function(u){Ae.setParams({is_visible:u})},get:function(){return A},enumerable:!0}),Object.defineProperty(Ae,"isProgressVisible",{get:function(){return j},enumerable:!0}),Object.defineProperty(Ae,"isActive",{set:function(u){Ae.setParams({is_active:u})},get:function(){return R},enumerable:!0});var Dt=null;t.onEvent("main_button_pressed",tr);var Ge=null,Oe={};if(n.tgWebAppDebug){Ge=document.createElement("tg-main-button"),Oe={font:"600 14px/18px sans-serif",display:"none",width:"100%",height:"48px",borderRadius:"0",background:"no-repeat right center",position:"fixed",left:"0",right:"0",bottom:"0",margin:"0",padding:"15px 20px",textAlign:"center",boxSizing:"border-box",zIndex:"10000"};for(var Tt in Oe)Ge.style[Tt]=Oe[Tt];document.addEventListener("DOMContentLoaded",function u(g){document.removeEventListener("DOMContentLoaded",u),document.body.appendChild(Ge),Ge.addEventListener("click",tr,!1)})}function tr(){R&&T("mainButtonClicked")}function ii(){var u=Ae.color,g=Ae.textColor;return A?{is_visible:!0,is_active:R,is_progress_visible:j,text:oe,color:u,text_color:g}:{is_visible:!1}}function ws(u){return typeof u>"u"&&(u=ii()),JSON.stringify(u)}function Zi(){var u=ii(),g=ws(u);Dt!==g&&(Dt=g,t.postEvent("web_app_setup_main_button",!1,u),n.tgWebAppDebug&&Ln(u))}function Ln(u){u.is_visible?(Ge.style.display="block",Ve=48,Ge.style.opacity=u.is_active?"1":"0.8",Ge.style.cursor=u.is_active?"pointer":"auto",Ge.disabled=!u.is_active,Ge.innerText=u.text,Ge.style.backgroundImage=u.is_progress_visible?"url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewport%3D%220%200%2048%2048%22%20width%3D%2248px%22%20height%3D%2248px%22%3E%3Ccircle%20cx%3D%2250%25%22%20cy%3D%2250%25%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222.25%22%20stroke-linecap%3D%22round%22%20fill%3D%22none%22%20stroke-dashoffset%3D%22106%22%20r%3D%229%22%20stroke-dasharray%3D%2256.52%22%20rotate%3D%22-90%22%3E%3Canimate%20attributeName%3D%22stroke-dashoffset%22%20attributeType%3D%22XML%22%20dur%3D%22360s%22%20from%3D%220%22%20to%3D%2212500%22%20repeatCount%3D%22indefinite%22%3E%3C%2Fanimate%3E%3CanimateTransform%20attributeName%3D%22transform%22%20attributeType%3D%22XML%22%20type%3D%22rotate%22%20dur%3D%221s%22%20from%3D%22-90%2024%2024%22%20to%3D%22630%2024%2024%22%20repeatCount%3D%22indefinite%22%3E%3C%2FanimateTransform%3E%3C%2Fcircle%3E%3C%2Fsvg%3E')":"none",Ge.style.backgroundColor=u.color,Ge.style.color=u.text_color):(Ge.style.display="none",Ve=0),document.documentElement&&(document.documentElement.style.boxSizing="border-box",document.documentElement.style.paddingBottom=Ve+"px"),ne()}function xs(u){if(typeof u.text<"u"){var g=E(u.text);if(!g.length)throw console.error("[Telegram.WebApp] Main button text is required",u.text),Error("WebAppMainButtonParamInvalid");if(g.length>64)throw console.error("[Telegram.WebApp] Main button text is too long",g),Error("WebAppMainButtonParamInvalid");oe=g}if(typeof u.color<"u")if(u.color===!1||u.color===null)he=!1;else{var v=D(u.color);if(!v)throw console.error("[Telegram.WebApp] Main button color format is invalid",u.color),Error("WebAppMainButtonParamInvalid");he=v}if(typeof u.text_color<"u")if(u.text_color===!1||u.text_color===null)it=!1;else{var a=D(u.text_color);if(!a)throw console.error("[Telegram.WebApp] Main button text color format is invalid",u.text_color),Error("WebAppMainButtonParamInvalid");it=a}if(typeof u.is_visible<"u"){if(u.is_visible&&!Ae.text.length)throw console.error("[Telegram.WebApp] Main button text is required"),Error("WebAppMainButtonParamInvalid");A=!!u.is_visible}return typeof u.is_active<"u"&&(R=!!u.is_active),Zi(),Ae}return Ae.setText=function(u){return Ae.setParams({text:u})},Ae.onClick=function(u){return W("mainButtonClicked",u),Ae},Ae.offClick=function(u){return I("mainButtonClicked",u),Ae},Ae.show=function(){return Ae.setParams({is_visible:!0})},Ae.hide=function(){return Ae.setParams({is_visible:!1})},Ae.enable=function(){return Ae.setParams({is_active:!0})},Ae.disable=function(){return Ae.setParams({is_active:!1})},Ae.showProgress=function(u){return R=!!u,j=!0,Zi(),Ae},Ae.hideProgress=function(){return Ae.isActive||(R=!0),j=!1,Zi(),Ae},Ae.setParams=xs,Ae}(),Pe=function(){var A=!1,R={};Object.defineProperty(R,"isVisible",{set:function(Oe){Ge({is_visible:Oe})},get:function(){return A},enumerable:!0});var j=null;t.onEvent("settings_button_pressed",oe);function oe(){T("settingsButtonClicked")}function he(){return{is_visible:A}}function it(Oe){return typeof Oe>"u"&&(Oe=he()),JSON.stringify(Oe)}function Ae(){return re("6.10")?!0:(console.warn("[Telegram.WebApp] SettingsButton is not supported in version "+f),!1)}function Dt(){var Oe=he(),Tt=it(Oe);j!==Tt&&(j=Tt,t.postEvent("web_app_setup_settings_button",!1,Oe))}function Ge(Oe){return Ae()&&(typeof Oe.is_visible<"u"&&(A=!!Oe.is_visible),Dt()),R}return R.onClick=function(Oe){return Ae()&&W("settingsButtonClicked",Oe),R},R.offClick=function(Oe){return Ae()&&I("settingsButtonClicked",Oe),R},R.show=function(){return Ge({is_visible:!0})},R.hide=function(){return Ge({is_visible:!1})},R}(),Rt=function(){var A={};function R(j){if(!re("6.1"))return console.warn("[Telegram.WebApp] HapticFeedback is not supported in version "+f),A;if(j.type=="impact"){if(j.impact_style!="light"&&j.impact_style!="medium"&&j.impact_style!="heavy"&&j.impact_style!="rigid"&&j.impact_style!="soft")throw console.error("[Telegram.WebApp] Haptic impact style is invalid",j.impact_style),Error("WebAppHapticImpactStyleInvalid")}else if(j.type=="notification"){if(j.notification_type!="error"&&j.notification_type!="success"&&j.notification_type!="warning")throw console.error("[Telegram.WebApp] Haptic notification type is invalid",j.notification_type),Error("WebAppHapticNotificationTypeInvalid")}else if(j.type!="selection_change")throw console.error("[Telegram.WebApp] Haptic feedback type is invalid",j.type),Error("WebAppHapticFeedbackTypeInvalid");return t.postEvent("web_app_trigger_haptic_feedback",!1,j),A}return A.impactOccurred=function(j){return R({type:"impact",impact_style:j})},A.notificationOccurred=function(j){return R({type:"notification",notification_type:j})},A.selectionChanged=function(){return R({type:"selection_change"})},A}(),jt=function(){var A={};function R(j,oe,he){if(!re("6.9"))throw console.error("[Telegram.WebApp] CloudStorage is not supported in version "+f),Error("WebAppMethodUnsupported");return zn(j,oe,he),A}return A.setItem=function(j,oe,he){return R("saveStorageValue",{key:j,value:oe},he)},A.getItem=function(j,oe){return A.getItems([j],oe?function(he,it){he?oe(he):oe(null,it[j])}:null)},A.getItems=function(j,oe){return R("getStorageValues",{keys:j},oe)},A.removeItem=function(j,oe){return A.removeItems([j],oe)},A.removeItems=function(j,oe){return R("deleteStorageValues",{keys:j},oe)},A.getKeys=function(j){return R("getStorageKeys",{},j)},A}(),Nn={};function Zt(A,R){if(R.slug&&Nn[R.slug]){var j=Nn[R.slug];delete Nn[R.slug],j.callback&&j.callback(R.status),T("invoiceClosed",{url:j.url,status:R.status})}}var Jt=!1;function An(A,R){if(Jt){var j=Jt;Jt=!1;var oe=null;typeof R.button_id<"u"&&(oe=R.button_id),j.callback&&j.callback(oe),T("popupClosed",{button_id:oe})}}var Ie=!1;function st(A,R){if(Ie){var j=Ie,oe=null;typeof R.data<"u"&&(oe=R.data),j.callback&&j.callback(oe)&&(Ie=!1,t.postEvent("web_app_close_scan_qr_popup",!1)),T("qrTextReceived",{data:oe})}}function Ue(A,R){Ie=!1}function wt(A,R){if(R.req_id&&U[R.req_id]){var j=U[R.req_id];delete U[R.req_id];var oe=null;typeof R.data<"u"&&(oe=R.data),j.callback&&j.callback(oe),T("clipboardTextReceived",{data:oe})}}var on=!1;function Un(A,R){if(on){var j=on;on=!1,j.callback&&j.callback(R.status=="allowed"),T("writeAccessRequested",{status:R.status})}}function at(A,R){var j,oe,he=0,it=function(){zn("getRequestedContact",{},function(Dt,Ge){Ge&&Ge.length?(clearTimeout(oe),A(Ge)):(he+=50,j=setTimeout(it,he))})},Ae=function(){clearTimeout(j),A("")};oe=setTimeout(Ae,R),it()}var Te=!1;function fn(A,R){if(Te){var j=Te;Te=!1;var oe=R.status=="sent",he={status:R.status};oe?at(function(it){if(it&&it.length){he.response=it,he.responseUnsafe=e.urlParseQueryString(it);for(var Ae in he.responseUnsafe){var Dt=he.responseUnsafe[Ae];try{(Dt.substr(0,1)=="{"&&Dt.substr(-1)=="}"||Dt.substr(0,1)=="["&&Dt.substr(-1)=="]")&&(he.responseUnsafe[Ae]=JSON.parse(Dt))}catch{}}}j.callback&&j.callback(oe,he),T("contactRequested",he)},3e3):(j.callback&&j.callback(oe,he),T("contactRequested",he))}}function cr(A,R){if(R.req_id&&U[R.req_id]){var j=U[R.req_id];delete U[R.req_id];var oe=null,he=null;typeof R.result<"u"&&(oe=R.result),typeof R.error<"u"&&(he=R.error),j.callback&&j.callback(he,oe)}}function zn(A,R,j){if(!re("6.9"))throw console.error("[Telegram.WebApp] Method invokeCustomMethod is not supported in version "+f),Error("WebAppMethodUnsupported");var oe=$(16),he={req_id:oe,method:A,params:R||{}};U[oe]={callback:j},t.postEvent("web_app_invoke_custom_method",!1,he)}window.Telegram||(window.Telegram={}),Object.defineProperty(o,"initData",{get:function(){return i},enumerable:!0}),Object.defineProperty(o,"initDataUnsafe",{get:function(){return l},enumerable:!0}),Object.defineProperty(o,"version",{get:function(){return f},enumerable:!0}),Object.defineProperty(o,"platform",{get:function(){return d},enumerable:!0}),Object.defineProperty(o,"colorScheme",{get:function(){return c},enumerable:!0}),Object.defineProperty(o,"themeParams",{get:function(){return s},enumerable:!0}),Object.defineProperty(o,"isExpanded",{get:function(){return ee},enumerable:!0}),Object.defineProperty(o,"viewportHeight",{get:function(){return(M===!1?window.innerHeight:M)-Ve},enumerable:!0}),Object.defineProperty(o,"viewportStableHeight",{get:function(){return(X===!1?window.innerHeight:X)-Ve},enumerable:!0}),Object.defineProperty(o,"isClosingConfirmationEnabled",{set:function(A){Re(A)},get:function(){return Ce},enumerable:!0}),Object.defineProperty(o,"headerColor",{set:function(A){et(A)},get:function(){return ye()},enumerable:!0}),Object.defineProperty(o,"backgroundColor",{set:function(A){Tn(A)},get:function(){return ut()},enumerable:!0}),Object.defineProperty(o,"BackButton",{value:_e,enumerable:!0}),Object.defineProperty(o,"MainButton",{value:bt,enumerable:!0}),Object.defineProperty(o,"SettingsButton",{value:Pe,enumerable:!0}),Object.defineProperty(o,"HapticFeedback",{value:Rt,enumerable:!0}),Object.defineProperty(o,"CloudStorage",{value:jt,enumerable:!0}),o.setHeaderColor=function(A){o.headerColor=A},o.setBackgroundColor=function(A){o.backgroundColor=A},o.enableClosingConfirmation=function(){o.isClosingConfirmationEnabled=!0},o.disableClosingConfirmation=function(){o.isClosingConfirmationEnabled=!1},o.isVersionAtLeast=function(A){return re(A)},o.onEvent=function(A,R){W(A,R)},o.offEvent=function(A,R){I(A,R)},o.sendData=function(A){if(!A||!A.length)throw console.error("[Telegram.WebApp] Data is required",A),Error("WebAppDataInvalid");if(Se(A)>4096)throw console.error("[Telegram.WebApp] Data is too long",A),Error("WebAppDataInvalid");t.postEvent("web_app_data_send",!1,{data:A})},o.switchInlineQuery=function(A,R){if(!re("6.6"))throw console.error("[Telegram.WebApp] Method switchInlineQuery is not supported in version "+f),Error("WebAppMethodUnsupported");if(!n.tgWebAppBotInline)throw console.error("[Telegram.WebApp] Inline mode is disabled for this bot. Read more about inline mode: https://core.telegram.org/bots/inline"),Error("WebAppInlineModeDisabled");if(A=A||"",A.length>256)throw console.error("[Telegram.WebApp] Inline query is too long",A),Error("WebAppInlineQueryInvalid");var j=[];if(R){if(!Array.isArray(R))throw console.error("[Telegram.WebApp] Choose chat types should be an array",R),Error("WebAppInlineChooseChatTypesInvalid");for(var oe={users:1,bots:1,groups:1,channels:1},he=0;he64)throw console.error("[Telegram.WebApp] Popup title is too long",j),Error("WebAppPopupParamInvalid");j.length>0&&(it.title=j)}if(typeof A.message<"u"&&(oe=E(A.message)),!oe.length)throw console.error("[Telegram.WebApp] Popup message is required",A.message),Error("WebAppPopupParamInvalid");if(oe.length>256)throw console.error("[Telegram.WebApp] Popup message is too long",oe),Error("WebAppPopupParamInvalid");if(it.message=oe,typeof A.buttons<"u"){if(!Array.isArray(A.buttons))throw console.error("[Telegram.WebApp] Popup buttons should be an array",A.buttons),Error("WebAppPopupParamInvalid");for(var Ae=0;Ae64))throw console.error("[Telegram.WebApp] Popup button id is too long",Oe),Error("WebAppPopupParamInvalid");Ge.id=Oe;var Tt=Dt.type;if(typeof Tt>"u"&&(Tt="default"),Ge.type=Tt,!(Tt=="ok"||Tt=="close"||Tt=="cancel"))if(Tt=="default"||Tt=="destructive"){var tr="";if(typeof Dt.text<"u"&&(tr=E(Dt.text)),!tr.length)throw console.error("[Telegram.WebApp] Popup button text is required for type "+Tt,Dt.text),Error("WebAppPopupParamInvalid");if(tr.length>64)throw console.error("[Telegram.WebApp] Popup button text is too long",tr),Error("WebAppPopupParamInvalid");Ge.text=tr}else throw console.error("[Telegram.WebApp] Popup button type is invalid",Tt),Error("WebAppPopupParamInvalid");he.push(Ge)}}else he.push({id:"",type:"close"});if(he.length<1)throw console.error("[Telegram.WebApp] Popup should have at least one button"),Error("WebAppPopupParamInvalid");if(he.length>3)throw console.error("[Telegram.WebApp] Popup should not have more than 3 buttons"),Error("WebAppPopupParamInvalid");it.buttons=he,Jt={callback:R},t.postEvent("web_app_open_popup",!1,it)},o.showAlert=function(A,R){o.showPopup({message:A},R?function(){R()}:null)},o.showConfirm=function(A,R){o.showPopup({message:A,buttons:[{type:"ok",id:"ok"},{type:"cancel"}]},R?function(j){R(j=="ok")}:null)},o.showScanQrPopup=function(A,R){if(!re("6.4"))throw console.error("[Telegram.WebApp] Method showScanQrPopup is not supported in version "+f),Error("WebAppMethodUnsupported");if(Ie)throw console.error("[Telegram.WebApp] Popup is already opened"),Error("WebAppScanQrPopupOpened");var j="",oe={};if(typeof A.text<"u"){if(j=E(A.text),j.length>64)throw console.error("[Telegram.WebApp] Scan QR popup text is too long",j),Error("WebAppScanQrPopupParamInvalid");j.length>0&&(oe.text=j)}Ie={callback:R},t.postEvent("web_app_open_scan_qr_popup",!1,oe)},o.closeScanQrPopup=function(){if(!re("6.4"))throw console.error("[Telegram.WebApp] Method closeScanQrPopup is not supported in version "+f),Error("WebAppMethodUnsupported");Ie=!1,t.postEvent("web_app_close_scan_qr_popup",!1)},o.readTextFromClipboard=function(A){if(!re("6.4"))throw console.error("[Telegram.WebApp] Method readTextFromClipboard is not supported in version "+f),Error("WebAppMethodUnsupported");var R=$(16),j={req_id:R};U[R]={callback:A},t.postEvent("web_app_read_text_from_clipboard",!1,j)},o.requestWriteAccess=function(A){if(!re("6.9"))throw console.error("[Telegram.WebApp] Method requestWriteAccess is not supported in version "+f),Error("WebAppMethodUnsupported");if(on)throw console.error("[Telegram.WebApp] Write access is already requested"),Error("WebAppWriteAccessRequested");on={callback:A},t.postEvent("web_app_request_write_access")},o.requestContact=function(A){if(!re("6.9"))throw console.error("[Telegram.WebApp] Method requestContact is not supported in version "+f),Error("WebAppMethodUnsupported");if(Te)throw console.error("[Telegram.WebApp] Contact is already requested"),Error("WebAppContactRequested");Te={callback:A},t.postEvent("web_app_request_phone")},o.invokeCustomMethod=function(A,R,j){zn(A,R,j)},o.ready=function(){t.postEvent("web_app_ready")},o.expand=function(){t.postEvent("web_app_expand")},o.close=function(){t.postEvent("web_app_close")},window.Telegram.WebApp=o,yt(),K(),ne(),n.tgWebAppShowSettings&&Pe.show(),window.addEventListener("resize",p),r&&document.addEventListener("click",y),t.onEvent("theme_changed",_),t.onEvent("viewport_changed",b),t.onEvent("invoice_closed",Zt),t.onEvent("popup_closed",An),t.onEvent("qr_text_received",st),t.onEvent("scan_qr_popup_closed",Ue),t.onEvent("clipboard_text_received",wt),t.onEvent("write_access_requested",Un),t.onEvent("phone_requested",fn),t.onEvent("custom_method_invoked",cr),t.postEvent("web_app_request_theme"),t.postEvent("web_app_request_viewport")})();Object.defineProperty(Pc,"__esModule",{value:!0});Pc.WebApp=void 0;var n7=window;Pc.WebApp=n7.Telegram.WebApp;Object.defineProperty(nv,"__esModule",{value:!0});var r7=Pc,o7=nv.default=r7.WebApp;o7.ready();yu.createRoot(document.getElementById("root")).render(hn.jsx(xh.StrictMode,{children:hn.jsx(t7,{})})); + */var sh;function V9(){if(sh)return il;sh=1;var e=xh,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(s,c,f){var d,w={},h=null,S=null;f!==void 0&&(h=""+f),c.key!==void 0&&(h=""+c.key),c.ref!==void 0&&(S=c.ref);for(d in c)r.call(c,d)&&!i.hasOwnProperty(d)&&(w[d]=c[d]);if(s&&s.defaultProps)for(d in c=s.defaultProps,c)w[d]===void 0&&(w[d]=c[d]);return{$$typeof:t,type:s,key:h,ref:S,props:w,_owner:o.current}}return il.Fragment=n,il.jsx=l,il.jsxs=l,il}(function(e){e.exports=V9()})(Gg);const Jg=Gg.exports.jsx;function Xg(){return typeof window<"u"}function K9(){return!Xg()}const ev=mr.createContext(null);let mu=null;const q9=e=>{var t=e,{children:n}=t,r=z9(t,["children"]);return Xg()&&!mu&&(mu=new D9(r)),Jg(ev.Provider,{value:mu,children:n})},Q9=mr.memo(q9);class Yd extends qt{constructor(...t){super(...t),Object.setPrototypeOf(this,Yd.prototype)}}class Zd extends Yd{constructor(...t){super(...t),Object.setPrototypeOf(this,Zd.prototype)}}function Y9(e){if(!e)throw new Zd("You should add on the top of the app to use TonConnect");return!0}function tv(){const e=mr.useContext(ev),t=mr.useCallback(n=>{e&&(e.uiOptions=n)},[e]);return K9()?[null,()=>{}]:(Y9(e),[e,t])}const ah="ton-connect-button",Z9=({className:e,style:t})=>{const[n,r]=tv();return mr.useEffect(()=>(r({buttonRootId:ah}),()=>r({buttonRootId:null})),[r]),Jg("div",{id:ah,className:e,style:F9({width:"fit-content"},t)})},G9=mr.memo(Z9),J9=()=>{const[e,t]=tv();return t({uiPreferences:{borderRadius:"m"}}),en.jsx("footer",{className:"footer"})},X9=()=>{const[e,t]=mr.useState("");return mr.useEffect(()=>{const n=window.Telegram.WebApp;if(n){n.ready();const r=n.initDataUnsafe.user;r&&t(r.first_name+(r.last_name?" "+r.last_name:""))}},[]),console.log("user name: ",e),en.jsx("header",{children:en.jsxs("div",{id:"header-row",children:[en.jsx("div",{id:"wallet-connect-button-wrapper",children:en.jsx(G9,{})}),en.jsx("div",{id:"user-name",children:e})]})})},e7=""+new URL("coobot_23-C3PiL-Kj.jpg",import.meta.url).href;function t7(){return en.jsx(Q9,{manifestUrl:"https://rosticom.github.io/coobot-merkaba-tma/tonconnect-manifest.json",uiPreferences:{theme:$t.DARK},walletsListConfiguration:{includeWallets:[{appName:"safepalwallet",name:"SafePal",imageUrl:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",aboutUrl:"https://www.safepal.com",universalLink:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",jsBridgeKey:"safepalwallet",bridgeUrl:"https://ton-bridge.safepal.com/tonbridge/v1/bridge",platforms:["ios","android","chrome","firefox"]},{appName:"bitgetTonWallet",name:"Bitget Wallet",imageUrl:"https://raw.githubusercontent.com/bitkeepwallet/download/main/logo/png/bitget%20wallet_logo_iOS.png",aboutUrl:"https://web3.bitget.com",deepLink:"bitkeep://",jsBridgeKey:"bitgetTonWallet",bridgeUrl:"https://bridge.tonapi.io/bridge",platforms:["ios","android","chrome"],universalLink:"https://bkcode.vip/ton-connect"},{appName:"tonwallet",name:"TON Wallet",imageUrl:"https://wallet.ton.org/assets/ui/qr-logo.png",aboutUrl:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",universalLink:"https://wallet.ton.org/ton-connect",jsBridgeKey:"tonwallet",bridgeUrl:"https://bridge.tonapi.io/bridge",platforms:["chrome","android"]}]},actionsConfiguration:{twaReturnUrl:"https://rosticom.github.io/coobot-merkaba-tma/"},children:en.jsxs("div",{className:"app",children:[en.jsx(X9,{}),en.jsx("div",{children:en.jsx("a",{href:"https://t.me/+JuO8mZMYOnRmN2Ux",children:en.jsx("img",{src:e7,className:"logo",alt:"Coobot chat"})})}),en.jsx("div",{className:"card",children:en.jsx("p",{children:en.jsx("a",{href:"https://t.me/gasPump_bot/app?startapp=eyJyZWZfdXNlcl9pZCI6NTY1ODY0MzE4LCJ0b2tlbl9hZGRyZXNzIjoiRVFEZGlyd3l5YXNST2tvUnc5bUJCekJkUUhjYUFjOUV5OFpoak1TdXRkdHJmU2M1In0",children:"Please, buy some $COO to be rich"})})}),en.jsx("p",{className:"read-the-docs",children:"buying or selling on the crypto market? doesn't matter with quantum technology!"}),en.jsx(J9,{})]})})}var nv={},Pc={};(function(){var e={},t="";try{t=location.hash.toString()}catch{}var n=c(t),r=b("initParams");if(r)for(var o in r)typeof n[o]>"u"&&(n[o]=r[o]);O("initParams",n);var i=!1,l;try{if(i=window.parent!=null&&window!=window.parent,i){window.addEventListener("message",function(p){if(p.source===window.parent){try{var y=JSON.parse(p.data)}catch{return}if(!(!y||!y.eventType))if(y.eventType=="set_custom_style")p.origin==="https://web.telegram.org"&&(l.innerHTML=y.eventData);else if(y.eventType=="reload_iframe"){try{window.parent.postMessage(JSON.stringify({eventType:"iframe_will_reload"}),"*")}catch{}location.reload()}else h(y.eventType,y.eventData)}}),l=document.createElement("style"),document.head.appendChild(l);try{window.parent.postMessage(JSON.stringify({eventType:"iframe_ready",eventData:{reload_supported:!0}}),"*")}catch{}}}catch{}function s(p){try{return p=p.replace(/\+/g,"%20"),decodeURIComponent(p)}catch{return p}}function c(p){p=p.replace(/^#/,"");var y={};if(!p.length)return y;if(p.indexOf("=")<0&&p.indexOf("?")<0)return y._path=s(p),y;var E=p.indexOf("?");if(E>=0){var T=p.substr(0,E);y._path=s(T),p=p.substr(E+1)}var N=f(p);for(var I in N)y[I]=N[I];return y}function f(p){var y={};if(!p.length)return y;var E=p.split("&"),T,N,I,L;for(T=0;T=0?p+"&"+y:T.length>0?p+"?"+y:p+y}function w(p,y,E){if(y||(y=function(){}),E===void 0&&(E=""),console.log("[Telegram.WebView] > postEvent",p,E),window.TelegramWebviewProxy!==void 0)TelegramWebviewProxy.postEvent(p,JSON.stringify(E)),y();else if(window.external&&"notify"in window.external)window.external.notify(JSON.stringify({eventType:p,eventData:E})),y();else if(i)try{var T="https://web.telegram.org";T="*",window.parent.postMessage(JSON.stringify({eventType:p,eventData:E}),T),y()}catch(N){y(N)}else y({notAvailable:!0})}function h(p,y){console.log("[Telegram.WebView] < receiveEvent",p,y),S(p,function(E){E(p,y)})}function S(p,y){var E=e[p];if(!(E===void 0||!E.length))for(var T=0;Tit?1:-1;return 0}function re(A){return G(f,A)>=0}function Se(A){if(window.Blob)try{return new Blob([A]).size}catch{}for(var R=A.length,j=A.length-1;j>=0;j--){var oe=A.charCodeAt(j);oe>127&&oe<=2047?R++:oe>2047&&oe<=65535&&(R+=2),oe>=56320&&oe<=57343&&j--}return R}var _e=function(){var A=!1,R={};Object.defineProperty(R,"isVisible",{set:function(Oe){Ge({is_visible:Oe})},get:function(){return A},enumerable:!0});var j=null;t.onEvent("back_button_pressed",oe);function oe(){T("backButtonClicked")}function he(){return{is_visible:A}}function it(Oe){return typeof Oe>"u"&&(Oe=he()),JSON.stringify(Oe)}function Ae(){return re("6.1")?!0:(console.warn("[Telegram.WebApp] BackButton is not supported in version "+f),!1)}function Dt(){var Oe=he(),Tt=it(Oe);j!==Tt&&(j=Tt,t.postEvent("web_app_setup_back_button",!1,Oe))}function Ge(Oe){return Ae()&&(typeof Oe.is_visible<"u"&&(A=!!Oe.is_visible),Dt()),R}return R.onClick=function(Oe){return Ae()&&N("backButtonClicked",Oe),R},R.offClick=function(Oe){return Ae()&&I("backButtonClicked",Oe),R},R.show=function(){return Ge({is_visible:!0})},R.hide=function(){return Ge({is_visible:!1})},R}(),Ve=0,bt=function(){var A=!1,R=!0,j=!1,oe="CONTINUE",he=!1,it=!1,Ae={};Object.defineProperty(Ae,"text",{set:function(u){Ae.setParams({text:u})},get:function(){return oe},enumerable:!0}),Object.defineProperty(Ae,"color",{set:function(u){Ae.setParams({color:u})},get:function(){return he||s.button_color||"#2481cc"},enumerable:!0}),Object.defineProperty(Ae,"textColor",{set:function(u){Ae.setParams({text_color:u})},get:function(){return it||s.button_text_color||"#ffffff"},enumerable:!0}),Object.defineProperty(Ae,"isVisible",{set:function(u){Ae.setParams({is_visible:u})},get:function(){return A},enumerable:!0}),Object.defineProperty(Ae,"isProgressVisible",{get:function(){return j},enumerable:!0}),Object.defineProperty(Ae,"isActive",{set:function(u){Ae.setParams({is_active:u})},get:function(){return R},enumerable:!0});var Dt=null;t.onEvent("main_button_pressed",tr);var Ge=null,Oe={};if(n.tgWebAppDebug){Ge=document.createElement("tg-main-button"),Oe={font:"600 14px/18px sans-serif",display:"none",width:"100%",height:"48px",borderRadius:"0",background:"no-repeat right center",position:"fixed",left:"0",right:"0",bottom:"0",margin:"0",padding:"15px 20px",textAlign:"center",boxSizing:"border-box",zIndex:"10000"};for(var Tt in Oe)Ge.style[Tt]=Oe[Tt];document.addEventListener("DOMContentLoaded",function u(g){document.removeEventListener("DOMContentLoaded",u),document.body.appendChild(Ge),Ge.addEventListener("click",tr,!1)})}function tr(){R&&T("mainButtonClicked")}function ii(){var u=Ae.color,g=Ae.textColor;return A?{is_visible:!0,is_active:R,is_progress_visible:j,text:oe,color:u,text_color:g}:{is_visible:!1}}function ws(u){return typeof u>"u"&&(u=ii()),JSON.stringify(u)}function Zi(){var u=ii(),g=ws(u);Dt!==g&&(Dt=g,t.postEvent("web_app_setup_main_button",!1,u),n.tgWebAppDebug&&Ln(u))}function Ln(u){u.is_visible?(Ge.style.display="block",Ve=48,Ge.style.opacity=u.is_active?"1":"0.8",Ge.style.cursor=u.is_active?"pointer":"auto",Ge.disabled=!u.is_active,Ge.innerText=u.text,Ge.style.backgroundImage=u.is_progress_visible?"url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewport%3D%220%200%2048%2048%22%20width%3D%2248px%22%20height%3D%2248px%22%3E%3Ccircle%20cx%3D%2250%25%22%20cy%3D%2250%25%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222.25%22%20stroke-linecap%3D%22round%22%20fill%3D%22none%22%20stroke-dashoffset%3D%22106%22%20r%3D%229%22%20stroke-dasharray%3D%2256.52%22%20rotate%3D%22-90%22%3E%3Canimate%20attributeName%3D%22stroke-dashoffset%22%20attributeType%3D%22XML%22%20dur%3D%22360s%22%20from%3D%220%22%20to%3D%2212500%22%20repeatCount%3D%22indefinite%22%3E%3C%2Fanimate%3E%3CanimateTransform%20attributeName%3D%22transform%22%20attributeType%3D%22XML%22%20type%3D%22rotate%22%20dur%3D%221s%22%20from%3D%22-90%2024%2024%22%20to%3D%22630%2024%2024%22%20repeatCount%3D%22indefinite%22%3E%3C%2FanimateTransform%3E%3C%2Fcircle%3E%3C%2Fsvg%3E')":"none",Ge.style.backgroundColor=u.color,Ge.style.color=u.text_color):(Ge.style.display="none",Ve=0),document.documentElement&&(document.documentElement.style.boxSizing="border-box",document.documentElement.style.paddingBottom=Ve+"px"),ne()}function xs(u){if(typeof u.text<"u"){var g=E(u.text);if(!g.length)throw console.error("[Telegram.WebApp] Main button text is required",u.text),Error("WebAppMainButtonParamInvalid");if(g.length>64)throw console.error("[Telegram.WebApp] Main button text is too long",g),Error("WebAppMainButtonParamInvalid");oe=g}if(typeof u.color<"u")if(u.color===!1||u.color===null)he=!1;else{var v=D(u.color);if(!v)throw console.error("[Telegram.WebApp] Main button color format is invalid",u.color),Error("WebAppMainButtonParamInvalid");he=v}if(typeof u.text_color<"u")if(u.text_color===!1||u.text_color===null)it=!1;else{var a=D(u.text_color);if(!a)throw console.error("[Telegram.WebApp] Main button text color format is invalid",u.text_color),Error("WebAppMainButtonParamInvalid");it=a}if(typeof u.is_visible<"u"){if(u.is_visible&&!Ae.text.length)throw console.error("[Telegram.WebApp] Main button text is required"),Error("WebAppMainButtonParamInvalid");A=!!u.is_visible}return typeof u.is_active<"u"&&(R=!!u.is_active),Zi(),Ae}return Ae.setText=function(u){return Ae.setParams({text:u})},Ae.onClick=function(u){return N("mainButtonClicked",u),Ae},Ae.offClick=function(u){return I("mainButtonClicked",u),Ae},Ae.show=function(){return Ae.setParams({is_visible:!0})},Ae.hide=function(){return Ae.setParams({is_visible:!1})},Ae.enable=function(){return Ae.setParams({is_active:!0})},Ae.disable=function(){return Ae.setParams({is_active:!1})},Ae.showProgress=function(u){return R=!!u,j=!0,Zi(),Ae},Ae.hideProgress=function(){return Ae.isActive||(R=!0),j=!1,Zi(),Ae},Ae.setParams=xs,Ae}(),Pe=function(){var A=!1,R={};Object.defineProperty(R,"isVisible",{set:function(Oe){Ge({is_visible:Oe})},get:function(){return A},enumerable:!0});var j=null;t.onEvent("settings_button_pressed",oe);function oe(){T("settingsButtonClicked")}function he(){return{is_visible:A}}function it(Oe){return typeof Oe>"u"&&(Oe=he()),JSON.stringify(Oe)}function Ae(){return re("6.10")?!0:(console.warn("[Telegram.WebApp] SettingsButton is not supported in version "+f),!1)}function Dt(){var Oe=he(),Tt=it(Oe);j!==Tt&&(j=Tt,t.postEvent("web_app_setup_settings_button",!1,Oe))}function Ge(Oe){return Ae()&&(typeof Oe.is_visible<"u"&&(A=!!Oe.is_visible),Dt()),R}return R.onClick=function(Oe){return Ae()&&N("settingsButtonClicked",Oe),R},R.offClick=function(Oe){return Ae()&&I("settingsButtonClicked",Oe),R},R.show=function(){return Ge({is_visible:!0})},R.hide=function(){return Ge({is_visible:!1})},R}(),Rt=function(){var A={};function R(j){if(!re("6.1"))return console.warn("[Telegram.WebApp] HapticFeedback is not supported in version "+f),A;if(j.type=="impact"){if(j.impact_style!="light"&&j.impact_style!="medium"&&j.impact_style!="heavy"&&j.impact_style!="rigid"&&j.impact_style!="soft")throw console.error("[Telegram.WebApp] Haptic impact style is invalid",j.impact_style),Error("WebAppHapticImpactStyleInvalid")}else if(j.type=="notification"){if(j.notification_type!="error"&&j.notification_type!="success"&&j.notification_type!="warning")throw console.error("[Telegram.WebApp] Haptic notification type is invalid",j.notification_type),Error("WebAppHapticNotificationTypeInvalid")}else if(j.type!="selection_change")throw console.error("[Telegram.WebApp] Haptic feedback type is invalid",j.type),Error("WebAppHapticFeedbackTypeInvalid");return t.postEvent("web_app_trigger_haptic_feedback",!1,j),A}return A.impactOccurred=function(j){return R({type:"impact",impact_style:j})},A.notificationOccurred=function(j){return R({type:"notification",notification_type:j})},A.selectionChanged=function(){return R({type:"selection_change"})},A}(),jt=function(){var A={};function R(j,oe,he){if(!re("6.9"))throw console.error("[Telegram.WebApp] CloudStorage is not supported in version "+f),Error("WebAppMethodUnsupported");return zn(j,oe,he),A}return A.setItem=function(j,oe,he){return R("saveStorageValue",{key:j,value:oe},he)},A.getItem=function(j,oe){return A.getItems([j],oe?function(he,it){he?oe(he):oe(null,it[j])}:null)},A.getItems=function(j,oe){return R("getStorageValues",{keys:j},oe)},A.removeItem=function(j,oe){return A.removeItems([j],oe)},A.removeItems=function(j,oe){return R("deleteStorageValues",{keys:j},oe)},A.getKeys=function(j){return R("getStorageKeys",{},j)},A}(),Wn={};function Zt(A,R){if(R.slug&&Wn[R.slug]){var j=Wn[R.slug];delete Wn[R.slug],j.callback&&j.callback(R.status),T("invoiceClosed",{url:j.url,status:R.status})}}var Jt=!1;function An(A,R){if(Jt){var j=Jt;Jt=!1;var oe=null;typeof R.button_id<"u"&&(oe=R.button_id),j.callback&&j.callback(oe),T("popupClosed",{button_id:oe})}}var Ie=!1;function st(A,R){if(Ie){var j=Ie,oe=null;typeof R.data<"u"&&(oe=R.data),j.callback&&j.callback(oe)&&(Ie=!1,t.postEvent("web_app_close_scan_qr_popup",!1)),T("qrTextReceived",{data:oe})}}function Ue(A,R){Ie=!1}function wt(A,R){if(R.req_id&&U[R.req_id]){var j=U[R.req_id];delete U[R.req_id];var oe=null;typeof R.data<"u"&&(oe=R.data),j.callback&&j.callback(oe),T("clipboardTextReceived",{data:oe})}}var ln=!1;function Un(A,R){if(ln){var j=ln;ln=!1,j.callback&&j.callback(R.status=="allowed"),T("writeAccessRequested",{status:R.status})}}function at(A,R){var j,oe,he=0,it=function(){zn("getRequestedContact",{},function(Dt,Ge){Ge&&Ge.length?(clearTimeout(oe),A(Ge)):(he+=50,j=setTimeout(it,he))})},Ae=function(){clearTimeout(j),A("")};oe=setTimeout(Ae,R),it()}var Te=!1;function dn(A,R){if(Te){var j=Te;Te=!1;var oe=R.status=="sent",he={status:R.status};oe?at(function(it){if(it&&it.length){he.response=it,he.responseUnsafe=e.urlParseQueryString(it);for(var Ae in he.responseUnsafe){var Dt=he.responseUnsafe[Ae];try{(Dt.substr(0,1)=="{"&&Dt.substr(-1)=="}"||Dt.substr(0,1)=="["&&Dt.substr(-1)=="]")&&(he.responseUnsafe[Ae]=JSON.parse(Dt))}catch{}}}j.callback&&j.callback(oe,he),T("contactRequested",he)},3e3):(j.callback&&j.callback(oe,he),T("contactRequested",he))}}function cr(A,R){if(R.req_id&&U[R.req_id]){var j=U[R.req_id];delete U[R.req_id];var oe=null,he=null;typeof R.result<"u"&&(oe=R.result),typeof R.error<"u"&&(he=R.error),j.callback&&j.callback(he,oe)}}function zn(A,R,j){if(!re("6.9"))throw console.error("[Telegram.WebApp] Method invokeCustomMethod is not supported in version "+f),Error("WebAppMethodUnsupported");var oe=$(16),he={req_id:oe,method:A,params:R||{}};U[oe]={callback:j},t.postEvent("web_app_invoke_custom_method",!1,he)}window.Telegram||(window.Telegram={}),Object.defineProperty(o,"initData",{get:function(){return i},enumerable:!0}),Object.defineProperty(o,"initDataUnsafe",{get:function(){return l},enumerable:!0}),Object.defineProperty(o,"version",{get:function(){return f},enumerable:!0}),Object.defineProperty(o,"platform",{get:function(){return d},enumerable:!0}),Object.defineProperty(o,"colorScheme",{get:function(){return c},enumerable:!0}),Object.defineProperty(o,"themeParams",{get:function(){return s},enumerable:!0}),Object.defineProperty(o,"isExpanded",{get:function(){return ee},enumerable:!0}),Object.defineProperty(o,"viewportHeight",{get:function(){return(M===!1?window.innerHeight:M)-Ve},enumerable:!0}),Object.defineProperty(o,"viewportStableHeight",{get:function(){return(X===!1?window.innerHeight:X)-Ve},enumerable:!0}),Object.defineProperty(o,"isClosingConfirmationEnabled",{set:function(A){Re(A)},get:function(){return Ce},enumerable:!0}),Object.defineProperty(o,"headerColor",{set:function(A){et(A)},get:function(){return ye()},enumerable:!0}),Object.defineProperty(o,"backgroundColor",{set:function(A){Tn(A)},get:function(){return ut()},enumerable:!0}),Object.defineProperty(o,"BackButton",{value:_e,enumerable:!0}),Object.defineProperty(o,"MainButton",{value:bt,enumerable:!0}),Object.defineProperty(o,"SettingsButton",{value:Pe,enumerable:!0}),Object.defineProperty(o,"HapticFeedback",{value:Rt,enumerable:!0}),Object.defineProperty(o,"CloudStorage",{value:jt,enumerable:!0}),o.setHeaderColor=function(A){o.headerColor=A},o.setBackgroundColor=function(A){o.backgroundColor=A},o.enableClosingConfirmation=function(){o.isClosingConfirmationEnabled=!0},o.disableClosingConfirmation=function(){o.isClosingConfirmationEnabled=!1},o.isVersionAtLeast=function(A){return re(A)},o.onEvent=function(A,R){N(A,R)},o.offEvent=function(A,R){I(A,R)},o.sendData=function(A){if(!A||!A.length)throw console.error("[Telegram.WebApp] Data is required",A),Error("WebAppDataInvalid");if(Se(A)>4096)throw console.error("[Telegram.WebApp] Data is too long",A),Error("WebAppDataInvalid");t.postEvent("web_app_data_send",!1,{data:A})},o.switchInlineQuery=function(A,R){if(!re("6.6"))throw console.error("[Telegram.WebApp] Method switchInlineQuery is not supported in version "+f),Error("WebAppMethodUnsupported");if(!n.tgWebAppBotInline)throw console.error("[Telegram.WebApp] Inline mode is disabled for this bot. Read more about inline mode: https://core.telegram.org/bots/inline"),Error("WebAppInlineModeDisabled");if(A=A||"",A.length>256)throw console.error("[Telegram.WebApp] Inline query is too long",A),Error("WebAppInlineQueryInvalid");var j=[];if(R){if(!Array.isArray(R))throw console.error("[Telegram.WebApp] Choose chat types should be an array",R),Error("WebAppInlineChooseChatTypesInvalid");for(var oe={users:1,bots:1,groups:1,channels:1},he=0;he64)throw console.error("[Telegram.WebApp] Popup title is too long",j),Error("WebAppPopupParamInvalid");j.length>0&&(it.title=j)}if(typeof A.message<"u"&&(oe=E(A.message)),!oe.length)throw console.error("[Telegram.WebApp] Popup message is required",A.message),Error("WebAppPopupParamInvalid");if(oe.length>256)throw console.error("[Telegram.WebApp] Popup message is too long",oe),Error("WebAppPopupParamInvalid");if(it.message=oe,typeof A.buttons<"u"){if(!Array.isArray(A.buttons))throw console.error("[Telegram.WebApp] Popup buttons should be an array",A.buttons),Error("WebAppPopupParamInvalid");for(var Ae=0;Ae64))throw console.error("[Telegram.WebApp] Popup button id is too long",Oe),Error("WebAppPopupParamInvalid");Ge.id=Oe;var Tt=Dt.type;if(typeof Tt>"u"&&(Tt="default"),Ge.type=Tt,!(Tt=="ok"||Tt=="close"||Tt=="cancel"))if(Tt=="default"||Tt=="destructive"){var tr="";if(typeof Dt.text<"u"&&(tr=E(Dt.text)),!tr.length)throw console.error("[Telegram.WebApp] Popup button text is required for type "+Tt,Dt.text),Error("WebAppPopupParamInvalid");if(tr.length>64)throw console.error("[Telegram.WebApp] Popup button text is too long",tr),Error("WebAppPopupParamInvalid");Ge.text=tr}else throw console.error("[Telegram.WebApp] Popup button type is invalid",Tt),Error("WebAppPopupParamInvalid");he.push(Ge)}}else he.push({id:"",type:"close"});if(he.length<1)throw console.error("[Telegram.WebApp] Popup should have at least one button"),Error("WebAppPopupParamInvalid");if(he.length>3)throw console.error("[Telegram.WebApp] Popup should not have more than 3 buttons"),Error("WebAppPopupParamInvalid");it.buttons=he,Jt={callback:R},t.postEvent("web_app_open_popup",!1,it)},o.showAlert=function(A,R){o.showPopup({message:A},R?function(){R()}:null)},o.showConfirm=function(A,R){o.showPopup({message:A,buttons:[{type:"ok",id:"ok"},{type:"cancel"}]},R?function(j){R(j=="ok")}:null)},o.showScanQrPopup=function(A,R){if(!re("6.4"))throw console.error("[Telegram.WebApp] Method showScanQrPopup is not supported in version "+f),Error("WebAppMethodUnsupported");if(Ie)throw console.error("[Telegram.WebApp] Popup is already opened"),Error("WebAppScanQrPopupOpened");var j="",oe={};if(typeof A.text<"u"){if(j=E(A.text),j.length>64)throw console.error("[Telegram.WebApp] Scan QR popup text is too long",j),Error("WebAppScanQrPopupParamInvalid");j.length>0&&(oe.text=j)}Ie={callback:R},t.postEvent("web_app_open_scan_qr_popup",!1,oe)},o.closeScanQrPopup=function(){if(!re("6.4"))throw console.error("[Telegram.WebApp] Method closeScanQrPopup is not supported in version "+f),Error("WebAppMethodUnsupported");Ie=!1,t.postEvent("web_app_close_scan_qr_popup",!1)},o.readTextFromClipboard=function(A){if(!re("6.4"))throw console.error("[Telegram.WebApp] Method readTextFromClipboard is not supported in version "+f),Error("WebAppMethodUnsupported");var R=$(16),j={req_id:R};U[R]={callback:A},t.postEvent("web_app_read_text_from_clipboard",!1,j)},o.requestWriteAccess=function(A){if(!re("6.9"))throw console.error("[Telegram.WebApp] Method requestWriteAccess is not supported in version "+f),Error("WebAppMethodUnsupported");if(ln)throw console.error("[Telegram.WebApp] Write access is already requested"),Error("WebAppWriteAccessRequested");ln={callback:A},t.postEvent("web_app_request_write_access")},o.requestContact=function(A){if(!re("6.9"))throw console.error("[Telegram.WebApp] Method requestContact is not supported in version "+f),Error("WebAppMethodUnsupported");if(Te)throw console.error("[Telegram.WebApp] Contact is already requested"),Error("WebAppContactRequested");Te={callback:A},t.postEvent("web_app_request_phone")},o.invokeCustomMethod=function(A,R,j){zn(A,R,j)},o.ready=function(){t.postEvent("web_app_ready")},o.expand=function(){t.postEvent("web_app_expand")},o.close=function(){t.postEvent("web_app_close")},window.Telegram.WebApp=o,yt(),K(),ne(),n.tgWebAppShowSettings&&Pe.show(),window.addEventListener("resize",p),r&&document.addEventListener("click",y),t.onEvent("theme_changed",_),t.onEvent("viewport_changed",b),t.onEvent("invoice_closed",Zt),t.onEvent("popup_closed",An),t.onEvent("qr_text_received",st),t.onEvent("scan_qr_popup_closed",Ue),t.onEvent("clipboard_text_received",wt),t.onEvent("write_access_requested",Un),t.onEvent("phone_requested",dn),t.onEvent("custom_method_invoked",cr),t.postEvent("web_app_request_theme"),t.postEvent("web_app_request_viewport")})();Object.defineProperty(Pc,"__esModule",{value:!0});Pc.WebApp=void 0;var n7=window;Pc.WebApp=n7.Telegram.WebApp;Object.defineProperty(nv,"__esModule",{value:!0});var r7=Pc,o7=nv.default=r7.WebApp;o7.ready();yu.createRoot(document.getElementById("root")).render(en.jsx(xh.StrictMode,{children:en.jsx(t7,{})})); diff --git a/docs/assets/index-Dh_EqXUg.css b/docs/assets/index-Dh_EqXUg.css new file mode 100644 index 0000000..aae9fcc --- /dev/null +++ b/docs/assets/index-Dh_EqXUg.css @@ -0,0 +1 @@ +.footer{padding:20px;display:flex;gap:20px;justify-content:flex-end;align-items:center;flex-wrap:wrap}.footer>div>label{color:#fff;margin-right:5px}.footer-checkbox-container{display:flex;flex-direction:column}.footer-checkbox-container>span{color:#fff;font-weight:700;margin-bottom:4px}.footer-checkbox-container input{margin-left:3px}header{align-items:right;justify-content:space-between}header>span{font-size:30px;line-height:34px;color:#66aaeee8;font-weight:700;margin:16px}header #wallet-connect-button-wrapper{display:flex;justify-content:right;margin-bottom:32px}#root{max-width:1280px;margin:0 auto;padding:2rem;text-align:center;min-height:88vh}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s;border-radius:50%}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}.card{padding:2em}.read-the-docs{color:#888}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}} diff --git a/docs/index.html b/docs/index.html index a7a39d7..8adf081 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,14 +1,14 @@ - - - - - - - Coobot - - - - -
    - - + + + + + + + Coobot + + + + +
    + + diff --git a/package.json b/package.json index 882c6e9..466df6a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "coobot-merkaba", "private": true, - "version": "0.0.2", + "version": "0.0.3", "type": "module", "scripts": { "dev": "vite", diff --git a/src/App.tsx b/src/App.tsx index 854b455..4bd43a3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,7 +3,7 @@ import { THEME, TonConnectUIProvider } from "@tonconnect/ui-react"; import { Footer } from "./components/Footer/Footer"; import { Header } from "./components/Header/Header"; -import { TxForm } from "./components/TxForm/TxForm"; +// import { TxForm } from "./components/TxForm/TxForm"; // import { useState } from 'react' // import reactLogo from './assets/merkaba_tv.jpg' @@ -59,9 +59,9 @@ function App() { }} >
    -
    +
    {/* */} - {/**/} + {/* */}
    diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx index c2e2e28..71c2d6e 100644 --- a/src/components/Footer/Footer.tsx +++ b/src/components/Footer/Footer.tsx @@ -1,4 +1,5 @@ -// import {BorderRadius, Locales, ReturnStrategy, Theme, THEME, useTonConnectUI} from "@tonconnect/ui-react"; +// import {Locales, ReturnStrategy, Theme, THEME, useTonConnectUI} from "@tonconnect/ui-react"; +// import {BorderRadius} from "@tonconnect/ui-react"; import {useTonConnectUI} from "@tonconnect/ui-react"; import './footer.scss'; // import {useEffect, useState} from "react"; @@ -29,7 +30,9 @@ export const Footer = () => { // setOptions({uiPreferences: {borderRadius: borders as BorderRadius}}) // } - setOptions({uiPreferences: {borderRadius: 's'}}) // or 'm' + setOptions({uiPreferences: {borderRadius: 'm'}}) // or 's' + + // console.log("hi!"); // const onCheckboxChange = (position: number) => { // setCheckboxes(state => state.map((item, index) => index === position ? !item : item )); diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index b9030c4..a20807a 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -8,13 +8,37 @@ declare global { } } + import { useEffect, useState } from 'react'; + +// const TelegramUserInfo = () => { +// } + export const Header = () => { - // const userName = Telegram.WebApp.initDataUnsafe.user.id - window.Telegram.WebApp.HapticFeedback.notificationOccurred("success"); + const [userName, setUserName] = useState(''); + + useEffect(() => { + const tg = window.Telegram.WebApp; + + if (tg) { + tg.ready(); + const user = tg.initDataUnsafe.user; + if (user) { + setUserName(user.first_name + (user.last_name ? ' ' + user.last_name : '')); + } + } + }, []); + // const userName = Telegram.WebApp.initDataUnsafe.user.id; + // const userName = window.Telegram.WebApp.initDataUnsafe.user?.username; + // window.Telegram.WebApp.HapticFeedback.notificationOccurred("success"); + console.log("user name: ", userName); return
    -
    - +
    + +
    + +
    +
    {userName}
    {/* */} {/* My App with React UI */} diff --git a/src/components/Header/header.scss b/src/components/Header/header.scss index dfc2a1a..0280f82 100644 --- a/src/components/Header/header.scss +++ b/src/components/Header/header.scss @@ -11,7 +11,7 @@ header { // display: flex; align-items: right; - // justify-content: space-between; + justify-content: space-between; // padding: 10px 25px; > span { diff --git a/src/components/TxForm/TxForm.tsx b/src/components/TxForm/TxForm.tsx index 9768a43..b2fd4e0 100644 --- a/src/components/TxForm/TxForm.tsx +++ b/src/components/TxForm/TxForm.tsx @@ -1,4 +1,4 @@ -import React, {useCallback, useState} from 'react'; +import {useCallback, useState} from 'react'; import JsonView from 'react18-json-view'; import './style.scss'; import {SendTransactionRequest, useTonConnectUI, useTonWallet} from "@tonconnect/ui-react";