@bluxcc/core 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,35 +1,35 @@
1
- import{Networks as e,Keypair as t,xdr as n,Transaction as r,StrKey as i,Asset as o,rpc as a,scValToNative as s,Horizon as c,Federation as u,extractBaseAddress as l,Address as d,Contract as f,TransactionBuilder as h,Account as p,BASE_FEE as b,TimeoutInfinite as m,Operation as g,Memo as v,Claimant as y}from"@stellar/stellar-sdk";import*as w from"@stellar/stellar-sdk";export{w as StellarSdk};export{Asset}from"@stellar/stellar-sdk";import{useStore as x}from"zustand";import{createStore as A}from"zustand/vanilla";import E from"@albedo-link/intent";import S from"@lobstrco/signer-extension-api";import*as _ from"@ledgerhq/hw-app-str";import O,{signTransaction as N,isConnected as k,signMessage as T,signAuthEntry as C,requestAccess as I}from"@stellar/freighter-api";import B,{useState as L,useEffect as M,useRef as R,useLayoutEffect as P,useMemo as U,createElement as j}from"react";import{createRoot as F}from"react-dom/client";import{jsxs as D,Fragment as z,jsx as $}from"react/jsx-runtime";import W from"@walletconnect/core";import q from"@walletconnect/sign-client";import{QRCodeCanvas as X}from"qrcode.react";var K=function(e,t){return K=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},K(e,t)};var H,V,G,Y,J=function(){return J=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},J.apply(this,arguments)};function Z(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function Q(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})}function ee(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function te(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,function(e){e.Api="API",e.Rabet="Rabet",e.Albedo="Albedo",e.Freighter="Freighter",e.Xbull="xBull",e.Lobstr="LOBSTR",e.Hana="Hana",e.WalletConnect="Wallet Connect",e.Hot="Hot",e.Klever="Klever",e.Ledger="Ledger",e.Bitget="Bitget",e.Onekey="Onekey",e.CactusLink="Cactus Link",e.Fordefi="Fordefi",e.Trezor="Trezor"}(H||(H={})),function(e){e.PUBLIC="Public Global Stellar Network ; September 2015",e.TESTNET="Test SDF Network ; September 2015",e.FUTURENET="Test SDF Future Network ; October 2022",e.SANDBOX="Local Sandbox Stellar Network ; September 2022",e.STANDALONE="Standalone Network ; February 2017"}(V||(V={})),function(e){e.ONBOARDING="ONBOARDING",e.PASSKEY_ONBOARDING="PASSKEY_ONBOARDING",e.SOCIALS_ONBOARDING="SOCIALS_ONBOARDING",e.WRONG_NETWORK="WRONG_NETWORK",e.WAITING="WAITING",e.SUCCESSFUL="SUCCESSFUL",e.FAILED="FAILED",e.PROFILE="PROFILE",e.SEND_TRANSACTION="SEND_TRANSACTION",e.SEND="SEND",e.ACTIVITY="ACTIVITY",e.OTP="OTP",e.RECEIVE="RECEIVE",e.BALANCES="BALANCES",e.SWAP="SWAP",e.BALANCE_DETAILS="BALANCE_DETAILS",e.TOKEN_DETAILS="TOKEN_DETAILS",e.ABOUT="ABOUT",e.ADD_TOKEN="ADD_TOKEN",e.SIGN_MESSAGE="SIGN_MESSAGE",e.WALLET_CONNECT="WALLET_CONNECT",e.SELECT_ASSET="SELECT_ASSET",e.FUND_ME="FUND_ME",e.FUND_ME_CRYPTO="FUND_ME_CRYPTO",e.ACCEPT_TERMS_AND_PRIVACY="ACCEPT_TERMS_AND_PRIVACY"}(G||(G={})),function(e){e.SmallEmail="smallemail.svg",e.Email="email.svg",e.Albedo="albedo.svg",e.Stellar="stellar.svg"}(Y||(Y={}));var ne,re={assetIssuer:"",assetCode:"XLM",assetBalance:"0",assetType:"native"},ie={assetIssuer:"GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",assetCode:"USDC",assetBalance:"0",assetType:"credit_alphanum4"},oe={assetIssuer:"GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5",assetCode:"USDC",assetBalance:"0",assetType:"credit_alphanum4"},ae={assetIssuer:"GDHU6WRG4IEQXM5NZ4BMPKOXHW76MZM4Y2IEMFDVXBSDP6SJY4ITNPP2",assetCode:"EURC",assetBalance:"0",assetType:"credit_alphanum4"},se=function(t){return t===e.PUBLIC?[ie,ae]:t===e.TESTNET?[oe]:[]},ce={logo:"",fontFamily:"Manrope",textColor:"#000000",accentColor:"#0c1083",background:"#ffffff",fieldBackground:"#ffffff",borderRadius:"24px",borderColor:"#cdceee",borderWidth:"1px",backdropBlur:"1px",backdropColor:"#00000033",boxShadow:"0px 4px 80px 0px #00000008"},ue=A(function(){return{config:{appId:"",lang:"en",appName:"",networks:[],defaultNetwork:"",excludeWallets:[],loginMethods:["wallet"],showWalletUIs:!0,explorer:"stellarchain",isPersistent:!1,promptOnWrongNetwork:!1,appearance:ce,walletConnect:{icons:[],url:"",projectId:"",description:""}},user:void 0,authState:{isReady:!1,isAuthenticated:!1},stellar:void 0}}),le=function(e){return x(ue,e)},de=ue.getState,fe=ue.subscribe,he=ue.getInitialState;!function(e){e.LoggedIn="blux:logged_in",e.LoggedOut="blux:logged_out",e.NetworkChanged="blux:network_changed",e.ModalOpened="blux:modal_opened",e.ModalClosed="blux:modal_closed"}(ne||(ne={}));var pe=function(){function e(){this.handlers=new Map}return e.prototype.on=function(e,t){var n,r=this,i=null!==(n=this.handlers.get(e))&&void 0!==n?n:new Set;return i.add(t),this.handlers.set(e,i),function(){return r.off(e,t)}},e.prototype.off=function(e,t){var n=this.handlers.get(e);n&&(n.delete(t),0===n.size&&this.handlers.delete(e))},e.prototype.once=function(e,t){var n=this,r=function(i){try{t(i)}finally{n.off(e,r)}};return this.on(e,r)},e.prototype.emit=function(e,t){var n=this.handlers.get(e);if(n)for(var r=0,i=Array.from(n);r<i.length;r++){var o=i[r];try{o(t)}catch(e){}}},e.prototype.clear=function(e){e?this.handlers.delete(e):this.handlers.clear()},e}(),be=new pe,me={field:"send",sendAsset:re,swapToAsset:re,swapFromAsset:re,userPicked:!1},ge=A(function(e){return{logos:null,assetMeta:null,emitter:be,auth:void 0,config:{appId:"",lang:"en",appName:"",networks:[],defaultNetwork:"",excludeWallets:[],isPersistent:!1,showWalletUIs:!0,loginMethods:["wallet"],explorer:"stellarchain",promptOnWrongNetwork:!1,appearance:ce,walletConnect:{icons:[],url:"",projectId:"",description:""}},login:void 0,loginError:void 0,stellar:void 0,signMessage:void 0,signAuthEntry:void 0,sendTransaction:void 0,wallets:[],waitingStatus:"login",showAllWallets:!1,modal:{isOpen:!1,route:G.ONBOARDING,dynamicTitle:"",alert:{type:"none",message:""}},authState:{isReady:!1,isAuthenticated:!1},balances:{error:null,loading:!1,balances:[]},balanceValues:{},apiResponse:void 0,transactions:{error:null,loading:!1,transactions:[]},selectAsset:J({},me),detailsAsset:void 0,customTokens:{mainnet:[],testnet:[]},balancesTab:"assets",detailsToken:void 0,walletConnectClient:void 0,networkSyncDisabled:!1,setConfig:function(t){return e(function(e){return J(J({},e),{config:t})})},setWallets:function(t){return e(function(e){return J(J({},e),{wallets:t})})},setIsReady:function(t){return e(function(e){return J(J({},e),{authState:J(J({},e.authState),{isReady:t})})})},setShowAllWallets:function(t){return e(function(e){return J(J({},e),{showAllWallets:t})})},setRoute:function(t){return e(function(e){return J(J({},e),{modal:J(J({},e.modal),{route:t})})})},setSendTransaction:function(t,n,r){return void 0===r&&(r=G.SEND_TRANSACTION),e(function(e){return J(J({},e),{sendTransaction:t,modal:J(J({},e.modal),{isOpen:n,route:r}),waitingStatus:"sendTransaction"})})},setSignMessage:function(t,n,r){return void 0===r&&(r=G.SIGN_MESSAGE),e(function(e){return J(J({},e),{signMessage:t,modal:J(J({},e.modal),{isOpen:n,route:r}),waitingStatus:"signMessage"})})},setSignAuthEntry:function(t,n,r){return void 0===r&&(r=G.SIGN_MESSAGE),e(function(e){return J(J({},e),{signAuthEntry:t,modal:J(J({},e.modal),{isOpen:n,route:r}),waitingStatus:"signAuthEntry"})})},setStellar:function(t){return e(function(e){var n=!!e.stellar&&e.stellar.activeNetwork!==t.activeNetwork;return J(J(J({},e),{stellar:t}),n?{selectAsset:J({},me),detailsAsset:void 0,detailsToken:void 0,balanceValues:{}}:{})})},approveSendTransaction:function(){return e(function(e){return J(J({},e),{modal:J(J({},e.modal),{isOpen:!0,route:G.WAITING}),waitingStatus:"sendTransaction"})})},openModal:function(t){e(function(e){return J(J({},e),{modal:J(J({},e.modal),{route:t,isOpen:!0})})}),ve().emitter.emit(ne.ModalOpened,{modal:t,reason:"openModal"})},setDynamicTitle:function(t){return e(function(e){return J(J({},e),{modal:J(J({},e.modal),{dynamicTitle:t})})})},setAlert:function(t,n){return e(function(e){return J(J({},e),{modal:J(J({},e.modal),{alert:{type:t,message:n}})})})},closeModal:function(){return e(function(e){return J(J({},e),{modal:J(J({},e.modal),{isOpen:!1})})})},connectWallet:function(t){var n=t===H.WalletConnect?G.WALLET_CONNECT:G.WAITING;e(function(e){return J(J({},e),{loginError:void 0,waitingStatus:"login",user:{address:"",walletPassphrase:"",authMethod:"wallet",authValue:t},modal:J(J({},e.modal),{isOpen:!0,route:n})})}),ve().emitter.emit(ne.ModalOpened,{modal:n,reason:"connectWallet",meta:{walletName:t}})},setIsAuthenticated:function(t){return e(function(e){return J(J({},e),{authState:J(J({},e.authState),{isAuthenticated:t})})})},connectWalletSuccessful:function(t,n){return e(function(e){var r,i;return J(J({},e),{authState:J({},e.authState),user:J(J({},e.user),{address:t,walletPassphrase:n,authValue:(null===(r=e.user)||void 0===r?void 0:r.authValue)||"",authMethod:(null===(i=e.user)||void 0===i?void 0:i.authMethod)||""})})})},connectEmail:function(t){return e(function(e){return J(J({},e),{loginError:void 0,waitingStatus:"login",user:{address:"",authValue:t,authMethod:"email",walletPassphrase:""},modal:J(J({},e.modal),{isOpen:!0,route:G.OTP})})})},connectSocial:function(t){return e(function(e){return J(J({},e),{loginError:void 0,waitingStatus:"login",user:{address:"",authValue:"",authMethod:t,walletPassphrase:""},modal:J(J({},e.modal),{isOpen:!0,route:G.SOCIALS_ONBOARDING})})})},logoutAction:function(){return e(function(e){return J(J({},e),{user:void 0,auth:void 0,loginError:void 0,waitingStatus:"login",selectAsset:J({},me),detailsAsset:void 0,detailsToken:void 0,customTokens:{mainnet:[],testnet:[]},balancesTab:"assets",balanceValues:{},authState:J(J({},e.authState),{isAuthenticated:!1}),modal:J(J({},e.modal),{isOpen:!1})})})},setBalances:function(t){return e(function(e){return J(J({},e),{balances:t})})},setBalanceValues:function(t){return e(function(e){return J(J({},e),{balanceValues:t})})},setAuth:function(t){return e(function(e){return J(J({},e),{auth:t})})},setTransactions:function(t){return e(function(e){return J(J({},e),{transactions:t})})},setSelectAsset:function(t){return e(function(e){return J(J({},e),{selectAsset:t})})},setDetailsAsset:function(t){return e(function(e){return J(J({},e),{detailsAsset:t})})},setCustomTokens:function(t){return e(function(e){return J(J({},e),{customTokens:t})})},addCustomToken:function(t){return e(function(e){var n,r,i=(null!==(r=e.customTokens[t.network])&&void 0!==r?r:[]).filter(function(e){return e.id!==t.id&&e.contractAddress!==t.contractAddress});return J(J({},e),{customTokens:J(J({},e.customTokens),(n={},n[t.network]=te(te([],i,!0),[t],!1),n))})})},removeCustomToken:function(t,n){return e(function(e){var r,i;return J(J({},e),{customTokens:J(J({},e.customTokens),(r={},r[t]=(null!==(i=e.customTokens[t])&&void 0!==i?i:[]).filter(function(e){return e.id!==n}),r))})})},setCustomTokenBalances:function(t,n){return e(function(e){var r,i;return J(J({},e),{customTokens:J(J({},e.customTokens),(r={},r[t]=(null!==(i=e.customTokens[t])&&void 0!==i?i:[]).map(function(e){return null!=n[e.id]?J(J({},e),{balance:n[e.id]}):e}),r))})})},setBalancesTab:function(t){return e(function(e){return J(J({},e),{balancesTab:t})})},setDetailsToken:function(t){return e(function(e){return J(J({},e),{detailsToken:t})})},setWalletConnectClient:function(t,n){return e(function(e){return J(J({},e),{walletConnect:{client:t,connection:n}})})},cleanUp:function(t){return e(function(e){var n;return J(J({},e),((n={})[t]=void 0,n))})},setNetworkSyncDisabled:function(t){return e(function(e){return J(J({},e),{networkSyncDisabled:t})})},setAppearance:function(t){return e(function(e){return J(J({},e),{config:J(J({},e.config),{appearance:J(J({},e.config.appearance),t)})})})},setApiResponse:function(t){return e(function(e){return J(J({},e),{apiResponse:t})})},setLoginError:function(t){return e(function(e){return J(J({},e),{loginError:t})})},setLogin:function(t){return e(function(e){return J(J({},e),{login:t})})},setLogos:function(t){return e(function(e){return J(J({},e),{logos:t})})},setAssetMeta:function(t){return e(function(e){return J(J({},e),{assetMeta:t})})}}}),ve=ge.getState,ye=ge.setState;ge.subscribe,ge.getInitialState;var we,xe,Ae=function(e){return x(ge,e)};xe=(we=ge).getState(),ue.setState({user:xe.user,config:xe.config,stellar:xe.stellar,authState:xe.authState}),we.subscribe(function(e){ue.setState({user:e.user,config:e.config,stellar:e.stellar,authState:e.authState})});var Ee=function(e){function t(t){var n=e.call(this,t&&t.trim()?t:"This account is not allowed to access this app")||this;return n.name="BluxAccessDeniedError",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}K(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),Se=function(e){return e instanceof Ee||e instanceof Error&&"BluxAccessDeniedError"===e.name},_e="__BLUX__JWT_STORE",Oe="__BLUX__RECENT_CONNECTION_METHODS",Ne="stellar:pubnet",ke="stellar:testnet",Te="https://api.blux.cc",Ce="blux-app-id",Ie=function(e,t){return Q(void 0,void 0,void 0,function(){var n,r;return ee(this,function(i){switch(i.label){case 0:if(!e)throw new Error("BLUX: appId is missing in config.");return[4,Ix("".concat(Te,"/auth"),{method:"POST",headers:(r={},r[Ce]=e,r.Accept="application/json",r["Content-Type"]="application/json",r),body:JSON.stringify({wallet:"",auth_method:"passkey",auth_value:t})})];case 1:if(400===(n=i.sent()).status)throw new Error("BLUX: invalid inputs");if(500===n.status)throw new Error("BLUX: server error");if(429===n.status)throw new Error("BLUX: too many requests");if(200===n.status)return[2,n.result];throw new Error("BLUX: Unexpected response from api")}})})},Be=function(e,t,n){return Q(void 0,void 0,void 0,function(){var r,i,o,a,s,c;return ee(this,function(u){switch(u.label){case 0:if(!e)throw new Error("BLUX: appId is missing in config.");return r=n.credential,"register"===n.step?(o=r.response,i={challenge_id:t.challenge_id,attestation_object:Nx(o.attestationObject),client_data_json:Nx(o.clientDataJSON),transports:"function"==typeof o.getTransports?o.getTransports():[]}):(a=r.response,i={challenge_id:t.challenge_id,client_data_json:Nx(a.clientDataJSON),authenticator_data:Nx(a.authenticatorData),signature:Nx(a.signature)}),[4,Ix("".concat(Te,"/auth/code"),{method:"POST",headers:(c={},c[Ce]=e,c.Accept="application/json",c["Content-Type"]="application/json",c),body:JSON.stringify({auth_method:"passkey",auth_value:r.id,code:JSON.stringify(i)})})];case 1:if(400===(s=u.sent()).status)throw new Error("BLUX: invalid inputs");if(401===s.status)throw new Error("BLUX: passkey verification failed");if(403===s.status)throw new Error("BLUX: This account already has a passkey; sign in with the existing one.");if(404===s.status)throw new Error("BLUX: user not found");if(500===s.status)throw new Error("BLUX: server error");if(429===s.status)throw new Error("BLUX: too many requests");if(200===s.status)return[2,s.result];throw new Error("BLUX: Unexpected response from api")}})})},Le=function(e,t){return Q(void 0,void 0,void 0,function(){var n,r;return ee(this,function(i){switch(i.label){case 0:if(!e)throw new Error("BLUX: appId is missing in config.");i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Ix("".concat(Te,"/auth"),{method:"POST",headers:(r={},r[Ce]=e,r.Accept="application/json",r["Content-Type"]="application/json",r),body:JSON.stringify({wallet:"",auth_method:"email",auth_value:t})})];case 2:return n=i.sent(),[3,4];case 3:throw i.sent(),new Error("BLUX: Unexpected response from api");case 4:if(403===n.status)throw new Ee(n.error);if(400===n.status)throw new Error("BLUX: invalid inputs");if(500===n.status)throw new Error("BLUX: server error");if(429===n.status)throw new Error("BLUX: too many requests");if(200===n.status)return[2,!0];throw new Error("BLUX: Unexpected response from api")}})})},Me=function(e,t,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];return Q(void 0,te([e,t,n],r,!0),void 0,function(e,t,n,r){var i,o;return void 0===r&&(r="signed_transaction"),ee(this,function(a){switch(a.label){case 0:if(!e)throw new Error("BLUX: appId is missing in config.");if(!n)throw new Error("BLUX: wallet address is missing.");a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Ix("".concat(Te,"/auth"),{method:"POST",headers:(o={},o[Ce]=e,o.Accept="application/json",o["Content-Type"]="application/json",o),body:JSON.stringify({wallet:n,auth_method:"wallet",auth_value:t,proof_type:r})})];case 2:return i=a.sent(),[3,4];case 3:throw a.sent(),new Error("BLUX: Unexpected response from api");case 4:if(403===i.status)throw new Ee(i.error);if(400===i.status)throw new Error("BLUX: invalid inputs");if(500===i.status)throw new Error("BLUX: server error");if(429===i.status)throw new Error("BLUX: too many requests");if(200===i.status)return[2,i.result];throw new Error("BLUX: Unexpected response from api")}})})},Re=function(e,t,n){return Q(void 0,void 0,void 0,function(){var r,i;return ee(this,function(o){switch(o.label){case 0:if(!e)throw new Error("BLUX: appId is missing in config.");o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Ix("".concat(Te,"/auth/code"),{method:"POST",headers:(i={},i[Ce]=e,i.Accept="application/json",i["Content-Type"]="application/json",i),body:JSON.stringify(J(J({auth_method:"wallet",code:t},(null==n?void 0:n.proofType)?{proof_type:n.proofType}:{}),(null==n?void 0:n.challenge)?{challenge:n.challenge}:{}))})];case 2:return r=o.sent(),[3,4];case 3:throw o.sent(),new Error("BLUX: Unexpected response from api");case 4:if(403===r.status)throw new Ee(r.error);if(401===r.status)throw new Error("BLUX: Challenge verification failed");if(400===r.status)throw new Error("BLUX: Login challenge expired. Please try again.");if(404===r.status)throw new Error("BLUX: user not found");if(500===r.status)throw new Error("BLUX: server error");if(429===r.status)throw new Error("BLUX: too many requests");if(200===r.status)return[2,r.result];throw new Error("BLUX: Unexpected response from api")}})})},Pe=function(e,t,n){return Q(void 0,void 0,void 0,function(){var r,i;return ee(this,function(o){switch(o.label){case 0:if(!e)throw new Error("BLUX: appId is missing in config.");o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Ix("".concat(Te,"/auth/code"),{method:"POST",headers:(i={},i[Ce]=e,i.Accept="application/json",i["Content-Type"]="application/json",i),body:JSON.stringify({code:n,wallet:"",auth_method:"email",auth_value:t.authValue})})];case 2:return r=o.sent(),[3,4];case 3:throw o.sent(),new Error("BLUX: Unexpected response from api");case 4:if(403===r.status)throw new Ee(r.error);if(400===r.status)throw new Error("BLUX: invalid inputs");if(500===r.status)throw new Error("BLUX: server error");if(404===r.status)throw new Error("BLUX: invalid code");if(429===r.status)throw new Error("BLUX: too many requests");if(200===r.status)return[2,r.result];throw new Error("BLUX: Unexpected response from api")}})})},Ue=function(e){return Q(void 0,void 0,void 0,function(){var t;return ee(this,function(n){switch(n.label){case 0:return[4,Ix("".concat(Te,"/users"),{method:"GET",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}})];case 1:if(401===(t=n.sent()).status)throw new Error("BLUX: invalid JWT");if(500===t.status)throw new Error("BLUX: server error");if(404===t.status)throw new Error("BLUX: user nout found");if(429===t.status)throw new Error("BLUX: too many requests");if(200===t.status)return[2,t.result];throw new Error("BLUX: Unexpected response from api")}})})},je=function(e,t){return Q(void 0,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Ix("".concat(Te,"/users/sign-message"),{method:"POST",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({message:t})})];case 1:if(401===(n=r.sent()).status)throw new Error("BLUX: invalid JWT");if(500===n.status)throw new Error("BLUX: server error");if(404===n.status)throw new Error("BLUX: user nout found");if(429===n.status)throw new Error("BLUX: too many requests");if(200===n.status&&n.result)return[2,n.result];throw new Error("BLUX: Unexpected response from api");case 2:throw r.sent(),new Error("BLUX: Unexpected response from api");case 3:return[2]}})})},Fe=function(e,t,n){return Q(void 0,void 0,void 0,function(){var r;return ee(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,Ix("".concat(Te,"/users/sign-transaction"),{method:"POST",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({xdr:t,network:n})})];case 1:if(401===(r=i.sent()).status)throw new Error("BLUX: invalid JWT");if(500===r.status)throw new Error("BLUX: server error");if(404===r.status)throw new Error("BLUX: user nout found");if(429===r.status)throw new Error("BLUX: too many requests");if(200===r.status&&r.result)return[2,r.result];throw new Error("BLUX: Unexpected response from api");case 2:throw i.sent(),new Error("BLUX: Unexpected response from api");case 3:return[2]}})})},De=function(e,t,n){return Q(void 0,void 0,void 0,function(){var r;return ee(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,Ix("".concat(Te,"/users/sign-auth-entry"),{method:"POST",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({auth_entry:t,network:n})})];case 1:if(401===(r=i.sent()).status)throw new Error("BLUX: invalid JWT");if(500===r.status)throw new Error("BLUX: server error");if(404===r.status)throw new Error("BLUX: user nout found");if(429===r.status)throw new Error("BLUX: too many requests");if(200===r.status&&r.result)return[2,r.result];throw new Error("BLUX: Unexpected response from api");case 2:throw i.sent(),new Error("BLUX: Unexpected response from api");case 3:return[2]}})})},ze=function(e){return{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}},$e=function(e,t,n){return Q(void 0,void 0,void 0,function(){var r;return ee(this,function(i){switch(i.label){case 0:return[4,Ix("".concat(Te,"/tokens"),{method:"POST",headers:ze(e),body:JSON.stringify({contract_address:t,network:n})})];case 1:if(401===(r=i.sent()).status)throw new Error("BLUX: invalid JWT");if(409===r.status)throw new Error("BLUX: token already added");if(502===r.status)throw new Error("BLUX: could not reach the network to validate the token");if(400===r.status)throw new Error(r.error||"BLUX: invalid token, or token limit reached");if(200===r.status&&r.result)return[2,r.result];throw new Error("BLUX: Unexpected response from api")}})})},We=function(e,t){return Q(void 0,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return[4,Ix("".concat(Te,"/tokens/").concat(t),{method:"DELETE",headers:ze(e)})];case 1:if(401===(n=r.sent()).status)throw new Error("BLUX: invalid JWT");if(404===n.status)throw new Error("BLUX: token not in your list");if(400===n.status)throw new Error("BLUX: invalid token id");if(200===n.status)return[2,!0];throw new Error("BLUX: Unexpected response from api")}})})},qe={name:H.Api,website:"https://blux.cc",connect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: API wallet is not defined.")})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2]})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: API wallet is not defined.")})})},isAvailable:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2,!1]})})},signAuthEntry:function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i,o;return ee(this,function(a){switch(a.label){case 0:if(a.trys.push([0,2,,3]),n=ve(),!(r=null===(o=n.auth)||void 0===o?void 0:o.JWT))throw new Error("BLUX: Failed to sign the auth entry from API");return[4,De(r,e,t.network)];case 1:if(i=a.sent())return[2,i];throw new Error("BLUX: Failed to sign the auth entry from API");case 2:throw a.sent(),new Error("BLUX: Failed to sign the auth entry from API");case 3:return[2]}})})},signMessage:function(e,t){return Q(void 0,void 0,void 0,function(){var t,n,r,i;return ee(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),t=ve(),!(n=null===(i=t.auth)||void 0===i?void 0:i.JWT))throw new Error("BLUX: Failed to sign the message from API");return[4,je(n,e)];case 1:if(r=o.sent())return[2,r];throw new Error("BLUX: Failed to sign the message from API");case 2:throw o.sent(),new Error("BLUX: Failed to sign the message from API");case 3:return[2]}})})},signTransaction:function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i,o;return ee(this,function(a){switch(a.label){case 0:if(a.trys.push([0,2,,3]),n=ve(),!(r=null===(o=n.auth)||void 0===o?void 0:o.JWT))throw new Error("BLUX: Failed to sign the transaction from API");return[4,Fe(r,e,t.network)];case 1:if(i=a.sent())return[2,i];throw new Error("BLUX: Failed to sign the transaction from API");case 2:throw a.sent(),new Error("BLUX: Failed to sign the transaction from API.");case 3:return[2]}})})}},Xe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function He(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var Ve,Ge={},Ye={},Je={},Ze={},Qe={};function et(){return Ve||(Ve=1,Qe.__esModule=!0,Qe.integers=void 0,Qe.integers=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"]),Qe}var tt,nt={};function rt(){if(tt)return nt;tt=1,nt.__esModule=!0,nt.DecodeBuffer=nt.EncodeBuffer=void 0;var e=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var n=t.substring(1),r=parseInt(n)/8;this.resize_if_necessary(r);var i="f"===t[0]?"setFloat".concat(n):"i"===t[0]?"setInt".concat(n):"setUint".concat(n);this.view[i](this.offset,e,!0),this.offset+=r},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}();nt.EncodeBuffer=e;var t=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),n=parseInt(t)/8;this.assert_enough_buffer(n);var r="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),i=this.view[r](this.offset,!0);return this.offset+=n,i},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}();return nt.DecodeBuffer=t,nt}var it,ot,at={};function st(){if(it)return at;it=1;var e=at&&at.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();at.__esModule=!0,at.validate_schema=at.ErrorSchema=at.expect_enum=at.expect_same_size=at.expect_bigint=at.expect_type=at.isArrayLike=void 0;var t=et();at.isArrayLike=function(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e)},at.expect_type=function(e,t,n){if(typeof e!==t)throw new Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(n.join(".")))},at.expect_bigint=function(e,t){if(!["number","string","bigint","boolean"].includes(typeof e)&&!("object"==typeof e&&null!==e&&"toString"in e))throw new Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))},at.expect_same_size=function(e,t,n){if(e!==t)throw new Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(n.join(".")))},at.expect_enum=function(e,t){if("object"!=typeof e||null===e)throw new Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))};var n=t.integers.concat(["bool","string"]),r=["option","enum","array","set","map","struct"],i=function(t){function n(e,n){var r="Invalid schema: ".concat(JSON.stringify(e)," expected ").concat(n);return t.call(this,r)||this}return e(n,t),n}(Error);function o(e){if("string"!=typeof e||!n.includes(e)){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&r.includes(t[0])){var a=t[0];if("option"===a)return o(e[a]);if("enum"===a)return function(e){if(!Array.isArray(e))throw new i(e,"Array");for(var t=0,n=e;t<n.length;t++){var r=n[t];if("object"!=typeof r||!("struct"in r))throw new Error('Missing "struct" key in enum schema');if("object"!=typeof r.struct||1!==Object.keys(r.struct).length)throw new Error('The "struct" in each enum must have a single key');o({struct:r.struct})}}(e[a]);if("array"===a)return function(e){if("object"!=typeof e)throw new i(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw new Error("Invalid schema: ".concat(e));if("type"in e)return o(e.type);throw new i(e,"{ type, len? }")}(e[a]);if("set"===a)return o(e[a]);if("map"===a)return function(e){if("object"!=typeof e||!("key"in e)||!("value"in e))throw new i(e,"{ key, value }");o(e.key),o(e.value)}(e[a]);if("struct"===a)return function(e){if("object"!=typeof e)throw new i(e,"object");for(var t in e)o(e[t])}(e[a])}}throw new i(e,r.join(", ")+" or "+n.join(", "))}}return at.ErrorSchema=i,at.validate_schema=o,at}var ct,ut,lt={};var dt,ft={exports:{}},ht=He(Object.freeze({__proto__:null,default:{}}));var pt,bt={},mt={};function gt(){return pt||(pt=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.KeySize=mt.KeyType=void 0,function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1"}(e||(mt.KeyType=e={})),mt.KeySize={SECRET_KEY:32,ED25519_PUBLIC_KEY:32,SECP256k1_PUBLIC_KEY:64}),mt;var e}var vt,yt={},wt={};function xt(){if(vt)return wt;vt=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.KeyPairBase=void 0;return wt.KeyPairBase=class{},wt}var At,Et={},St={},_t={};var Ot,Nt={},kt={},Tt={GasLimitExceeded:"Exceeded the maximum amount of gas allowed to burn per contract",MethodEmptyName:"Method name is empty",WasmerCompileError:"Wasmer compilation error: {{msg}}",GuestPanic:"Smart contract panicked: {{panic_msg}}",Memory:"Error creating Wasm memory",GasExceeded:"Exceeded the prepaid gas",MethodUTF8Error:"Method name is not valid UTF8 string",BadUTF16:"String encoding is bad UTF-16 sequence",WasmTrap:"WebAssembly trap: {{msg}}",GasInstrumentation:"Gas instrumentation failed or contract has denied instructions.",InvalidPromiseIndex:"{{promise_idx}} does not correspond to existing promises",InvalidPromiseResultIndex:"Accessed invalid promise result index: {{result_idx}}",Deserialization:"Error happened while deserializing the module",MethodNotFound:"Contract method is not found",InvalidRegisterId:"Accessed invalid register id: {{register_id}}",InvalidReceiptIndex:"VM Logic returned an invalid receipt index: {{receipt_index}}",EmptyMethodName:"Method name is empty in contract call",CannotReturnJointPromise:"Returning joint promise is currently prohibited",StackHeightInstrumentation:"Stack instrumentation failed",CodeDoesNotExist:"Cannot find contract code for account {{account_id}}",MethodInvalidSignature:"Invalid method signature",IntegerOverflow:"Integer overflow happened during contract execution",MemoryAccessViolation:"MemoryAccessViolation",InvalidIteratorIndex:"Iterator index {{iterator_index}} does not exist",IteratorWasInvalidated:"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie",InvalidAccountId:"VM Logic returned an invalid account id",Serialization:"Error happened while serializing the module",CannotAppendActionToJointPromise:"Actions can only be appended to non-joint promise.",InternalMemoryDeclared:"Internal memory declaration has been found in the module",Instantiate:"Error happened during instantiation",ProhibitedInView:"{{method_name}} is not allowed in view calls",InvalidMethodName:"VM Logic returned an invalid method name",BadUTF8:"String encoding is bad UTF-8 sequence",BalanceExceeded:"Exceeded the account balance",LinkError:"Wasm contract link error: {{msg}}",InvalidPublicKey:"VM Logic provided an invalid public key",ActorNoPermission:"Actor {{actor_id}} doesn't have permission to account {{account_id}} to complete the action",LackBalanceForState:"The account {{account_id}} wouldn't have enough balance to cover storage, required to have {{amount}} yoctoNEAR more",ReceiverMismatch:"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.",CostOverflow:"Transaction gas or balance cost is too high",InvalidSignature:"Transaction is not signed with the given public key",AccessKeyNotFound:'Signer "{{account_id}}" doesn\'t have access key with the given public_key {{public_key}}',NotEnoughBalance:"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}",NotEnoughAllowance:"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}",Expired:"Transaction has expired",DeleteAccountStaking:"Account {{account_id}} is staking and can not be deleted",SignerDoesNotExist:"Signer {{signer_id}} does not exist",TriesToStake:"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}",AddKeyAlreadyExists:"The public key {{public_key}} is already used for an existing access key",InvalidSigner:"Invalid signer account ID {{signer_id}} according to requirements",CreateAccountNotAllowed:"The new account_id {{account_id}} can't be created by {{predecessor_id}}",RequiresFullAccess:"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key",TriesToUnstake:"Account {{account_id}} is not yet staked, but tried to unstake",InvalidNonce:"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}",AccountAlreadyExists:"Can't create a new account {{account_id}}, because it already exists",InvalidChain:"Transaction parent block hash doesn't belong to the current chain",AccountDoesNotExist:"Can't complete the action because account {{account_id}} doesn't exist",AccessKeyDoesNotExist:"Can't complete the action because access key {{public_key}} doesn't exist",MethodNameMismatch:"Transaction method name {{method_name}} isn't allowed by the access key",DeleteAccountHasRent:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent",DeleteAccountHasEnoughBalance:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it's storage",InvalidReceiver:"Invalid receiver account ID {{receiver_id}} according to requirements",DeleteKeyDoesNotExist:"Account {{account_id}} tries to remove an access key that doesn't exist",Timeout:"Timeout exceeded",Closed:"Connection closed",ShardCongested:"Shard {{shard_id}} rejected the transaction due to congestion level {{congestion_level}}, try again later",ShardStuck:"Shard {{shard_id}} rejected the transaction because it missed {{missed_chunks}} chunks and needs to recover before accepting new transactions, try again later"};function Ct(){if(Ot)return kt;Ot=1;var e=kt&&kt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kt,"__esModule",{value:!0}),kt.ErrorMessages=void 0;const t=e(Tt);return kt.ErrorMessages=t.default,kt}var It,Bt={},Lt={},Mt={};var Rt,Pt={};var Ut,jt={};var Ft,Dt={},zt={};var $t,Wt,qt,Xt={};function Kt(){return Wt||(Wt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FinalExecutionStatusBasic=e.ExecutionStatusBasic=e.IdType=void 0;var t,n=(Ft||(Ft=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.IdType=void 0,function(e){e.Transaction="transaction",e.Receipt="receipt"}(t||(zt.IdType=t={}))),zt);Object.defineProperty(e,"IdType",{enumerable:!0,get:function(){return n.IdType}});var r,i,o=($t||($t=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.FinalExecutionStatusBasic=Xt.ExecutionStatusBasic=void 0,function(e){e.Unknown="Unknown",e.Pending="Pending",e.Failure="Failure"}(r||(Xt.ExecutionStatusBasic=r={})),function(e){e.NotStarted="NotStarted",e.Started="Started",e.Failure="Failure"}(i||(Xt.FinalExecutionStatusBasic=i={}))),Xt);Object.defineProperty(e,"ExecutionStatusBasic",{enumerable:!0,get:function(){return o.ExecutionStatusBasic}}),Object.defineProperty(e,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return o.FinalExecutionStatusBasic}})}(Dt)),Dt}function Ht(){return qt||(qt=1,e=Lt,t=Lt&&Lt.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=Lt&&Lt.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)},Object.defineProperty(e,"__esModule",{value:!0}),n((It||(It=1,Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.Assignable=void 0,Mt.Assignable=class{constructor(e){Object.keys(e).map(t=>{this[t]=e[t]})}}),Mt),e),n((Rt||(Rt=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.Enum=void 0,Pt.Enum=class{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}),Pt),e),n(function(){if(Ut)return jt;Ut=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.ErrorContext=jt.TypedError=jt.ArgumentTypeError=jt.PositionalArgsError=void 0;class e extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}jt.PositionalArgsError=e;class t extends Error{constructor(e,t,n){super(`Expected ${t} for '${e}' argument, but got '${JSON.stringify(n)}'`)}}jt.ArgumentTypeError=t;class n extends Error{type;context;constructor(e,t,n){super(e),this.type=t||"UntypedError",this.context=n}}return jt.TypedError=n,jt.ErrorContext=class{transactionHash;constructor(e){this.transactionHash=e}},jt}(),e),n(Kt(),e)),Lt;var e,t,n}var Vt,Gt={exports:{}};function Yt(){return Vt||(Vt=1,Gt.exports=function(){
1
+ import{Networks as e,Keypair as t,xdr as n,Transaction as r,StrKey as i,Asset as o,rpc as a,scValToNative as s,Horizon as c,Federation as u,extractBaseAddress as l,Address as d,Contract as f,TransactionBuilder as h,Account as p,BASE_FEE as b,TimeoutInfinite as m,Operation as g,Memo as v,Claimant as y,StellarToml as w}from"@stellar/stellar-sdk";import*as x from"@stellar/stellar-sdk";export{x as StellarSdk};export{Asset}from"@stellar/stellar-sdk";import{useStore as A}from"zustand";import{createStore as E}from"zustand/vanilla";import S from"@albedo-link/intent";import _ from"@lobstrco/signer-extension-api";import*as O from"@ledgerhq/hw-app-str";import N,{signTransaction as k,isConnected as T,signMessage as C,signAuthEntry as I,requestAccess as B}from"@stellar/freighter-api";import L,{useState as M,useEffect as R,useRef as P,useLayoutEffect as U,useMemo as j,createElement as F}from"react";import{createRoot as D}from"react-dom/client";import{jsxs as z,Fragment as $,jsx as W}from"react/jsx-runtime";import X from"@walletconnect/core";import q from"@walletconnect/sign-client";import{QRCodeCanvas as K}from"qrcode.react";var G=function(e,t){return G=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},G(e,t)};var H,V,Y,J,Z=function(){return Z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Z.apply(this,arguments)};function Q(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function ee(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})}function te(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function ne(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,function(e){e.Api="API",e.Rabet="Rabet",e.Albedo="Albedo",e.Freighter="Freighter",e.Xbull="xBull",e.Lobstr="LOBSTR",e.Hana="Hana",e.WalletConnect="Wallet Connect",e.Hot="Hot",e.Klever="Klever",e.Ledger="Ledger",e.Bitget="Bitget",e.Onekey="Onekey",e.CactusLink="Cactus Link",e.Fordefi="Fordefi",e.Trezor="Trezor"}(H||(H={})),function(e){e.PUBLIC="Public Global Stellar Network ; September 2015",e.TESTNET="Test SDF Network ; September 2015",e.FUTURENET="Test SDF Future Network ; October 2022",e.SANDBOX="Local Sandbox Stellar Network ; September 2022",e.STANDALONE="Standalone Network ; February 2017"}(V||(V={})),function(e){e.ONBOARDING="ONBOARDING",e.PASSKEY_ONBOARDING="PASSKEY_ONBOARDING",e.SOCIALS_ONBOARDING="SOCIALS_ONBOARDING",e.WRONG_NETWORK="WRONG_NETWORK",e.WAITING="WAITING",e.SUCCESSFUL="SUCCESSFUL",e.FAILED="FAILED",e.PROFILE="PROFILE",e.SEND_TRANSACTION="SEND_TRANSACTION",e.SEND="SEND",e.ACTIVITY="ACTIVITY",e.OTP="OTP",e.RECEIVE="RECEIVE",e.BALANCES="BALANCES",e.SWAP="SWAP",e.BALANCE_DETAILS="BALANCE_DETAILS",e.TOKEN_DETAILS="TOKEN_DETAILS",e.ABOUT="ABOUT",e.ADD_TOKEN="ADD_TOKEN",e.SIGN_MESSAGE="SIGN_MESSAGE",e.WALLET_CONNECT="WALLET_CONNECT",e.SELECT_ASSET="SELECT_ASSET",e.FUND_ME="FUND_ME",e.FUND_ME_CRYPTO="FUND_ME_CRYPTO",e.ACCEPT_TERMS_AND_PRIVACY="ACCEPT_TERMS_AND_PRIVACY"}(Y||(Y={})),function(e){e.SmallEmail="smallemail.svg",e.Email="email.svg",e.Albedo="albedo.svg",e.Stellar="stellar.svg"}(J||(J={}));var re,ie={assetIssuer:"",assetCode:"XLM",assetBalance:"0",assetType:"native"},oe={assetIssuer:"GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",assetCode:"USDC",assetBalance:"0",assetType:"credit_alphanum4"},ae={assetIssuer:"GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5",assetCode:"USDC",assetBalance:"0",assetType:"credit_alphanum4"},se={assetIssuer:"GDHU6WRG4IEQXM5NZ4BMPKOXHW76MZM4Y2IEMFDVXBSDP6SJY4ITNPP2",assetCode:"EURC",assetBalance:"0",assetType:"credit_alphanum4"},ce=function(t){return t===e.PUBLIC?[oe,se]:t===e.TESTNET?[ae]:[]},ue={logo:"",fontFamily:"Manrope",textColor:"#000000",accentColor:"#0c1083",background:"#ffffff",fieldBackground:"#ffffff",borderRadius:"24px",borderColor:"#cdceee",borderWidth:"1px",backdropBlur:"1px",backdropColor:"#00000033",boxShadow:"0px 4px 80px 0px #00000008"},le=E(function(){return{config:{appId:"",lang:"en",appName:"",networks:[],defaultNetwork:"",excludeWallets:[],loginMethods:["wallet"],showWalletUIs:!0,explorer:"stellarchain",isPersistent:!1,promptOnWrongNetwork:!1,appearance:ue,walletConnect:{icons:[],url:"",projectId:"",description:""}},user:void 0,authState:{isReady:!1,isAuthenticated:!1},stellar:void 0}}),de=function(e){return A(le,e)},fe=le.getState,he=le.subscribe,pe=le.getInitialState;!function(e){e.LoggedIn="blux:logged_in",e.LoggedOut="blux:logged_out",e.NetworkChanged="blux:network_changed",e.ModalOpened="blux:modal_opened",e.ModalClosed="blux:modal_closed"}(re||(re={}));var be=function(){function e(){this.handlers=new Map}return e.prototype.on=function(e,t){var n,r=this,i=null!==(n=this.handlers.get(e))&&void 0!==n?n:new Set;return i.add(t),this.handlers.set(e,i),function(){return r.off(e,t)}},e.prototype.off=function(e,t){var n=this.handlers.get(e);n&&(n.delete(t),0===n.size&&this.handlers.delete(e))},e.prototype.once=function(e,t){var n=this,r=function(i){try{t(i)}finally{n.off(e,r)}};return this.on(e,r)},e.prototype.emit=function(e,t){var n=this.handlers.get(e);if(n)for(var r=0,i=Array.from(n);r<i.length;r++){var o=i[r];try{o(t)}catch(e){}}},e.prototype.clear=function(e){e?this.handlers.delete(e):this.handlers.clear()},e}(),me=new be,ge={field:"send",sendAsset:ie,swapToAsset:ie,swapFromAsset:ie,userPicked:!1},ve=E(function(e){return{logos:null,assetMeta:null,emitter:me,auth:void 0,config:{appId:"",lang:"en",appName:"",networks:[],defaultNetwork:"",excludeWallets:[],isPersistent:!1,showWalletUIs:!0,loginMethods:["wallet"],explorer:"stellarchain",promptOnWrongNetwork:!1,appearance:ue,walletConnect:{icons:[],url:"",projectId:"",description:""}},login:void 0,loginError:void 0,stellar:void 0,signMessage:void 0,signAuthEntry:void 0,sendTransaction:void 0,wallets:[],waitingStatus:"login",showAllWallets:!1,modal:{isOpen:!1,route:Y.ONBOARDING,dynamicTitle:"",alert:{type:"none",message:""}},authState:{isReady:!1,isAuthenticated:!1},balances:{error:null,loading:!1,balances:[]},balanceValues:{},apiResponse:void 0,accountRefreshNonce:0,selectAsset:Z({},ge),detailsAsset:void 0,customTokens:{mainnet:[],testnet:[]},balancesTab:"assets",detailsToken:void 0,walletConnectClient:void 0,networkSyncDisabled:!1,setConfig:function(t){return e(function(e){return Z(Z({},e),{config:t})})},setWallets:function(t){return e(function(e){return Z(Z({},e),{wallets:t})})},setIsReady:function(t){return e(function(e){return Z(Z({},e),{authState:Z(Z({},e.authState),{isReady:t})})})},setShowAllWallets:function(t){return e(function(e){return Z(Z({},e),{showAllWallets:t})})},setRoute:function(t){return e(function(e){return Z(Z({},e),{modal:Z(Z({},e.modal),{route:t})})})},setSendTransaction:function(t,n,r){return void 0===r&&(r=Y.SEND_TRANSACTION),e(function(e){return Z(Z({},e),{sendTransaction:t,modal:Z(Z({},e.modal),{isOpen:n,route:r}),waitingStatus:"sendTransaction"})})},setSignMessage:function(t,n,r){return void 0===r&&(r=Y.SIGN_MESSAGE),e(function(e){return Z(Z({},e),{signMessage:t,modal:Z(Z({},e.modal),{isOpen:n,route:r}),waitingStatus:"signMessage"})})},setSignAuthEntry:function(t,n,r){return void 0===r&&(r=Y.SIGN_MESSAGE),e(function(e){return Z(Z({},e),{signAuthEntry:t,modal:Z(Z({},e.modal),{isOpen:n,route:r}),waitingStatus:"signAuthEntry"})})},setStellar:function(t){return e(function(e){var n=!!e.stellar&&e.stellar.activeNetwork!==t.activeNetwork;return Z(Z(Z({},e),{stellar:t}),n?{selectAsset:Z({},ge),detailsAsset:void 0,detailsToken:void 0,balanceValues:{},balances:{error:null,loading:!0,balances:[]},accountRefreshNonce:e.accountRefreshNonce+1}:{})})},approveSendTransaction:function(){return e(function(e){return Z(Z({},e),{modal:Z(Z({},e.modal),{isOpen:!0,route:Y.WAITING}),waitingStatus:"sendTransaction"})})},openModal:function(t){e(function(e){return Z(Z({},e),{showAllWallets:t!==Y.ONBOARDING&&e.showAllWallets,modal:Z(Z({},e.modal),{route:t,isOpen:!0})})}),ye().emitter.emit(re.ModalOpened,{modal:t,reason:"openModal"})},setDynamicTitle:function(t){return e(function(e){return Z(Z({},e),{modal:Z(Z({},e.modal),{dynamicTitle:t})})})},setAlert:function(t,n){return e(function(e){return Z(Z({},e),{modal:Z(Z({},e.modal),{alert:{type:t,message:n}})})})},closeModal:function(){return e(function(e){return Z(Z({},e),{showAllWallets:!1,modal:Z(Z({},e.modal),{isOpen:!1})})})},connectWallet:function(t){var n=t===H.WalletConnect?Y.WALLET_CONNECT:Y.WAITING;e(function(e){return Z(Z({},e),{loginError:void 0,waitingStatus:"login",user:{address:"",walletPassphrase:"",authMethod:"wallet",authValue:t},modal:Z(Z({},e.modal),{isOpen:!0,route:n})})}),ye().emitter.emit(re.ModalOpened,{modal:n,reason:"connectWallet",meta:{walletName:t}})},setIsAuthenticated:function(t){return e(function(e){return Z(Z({},e),{authState:Z(Z({},e.authState),{isAuthenticated:t})})})},connectWalletSuccessful:function(t,n){return e(function(e){var r,i;return Z(Z({},e),{authState:Z({},e.authState),user:Z(Z({},e.user),{address:t,walletPassphrase:n,authValue:(null===(r=e.user)||void 0===r?void 0:r.authValue)||"",authMethod:(null===(i=e.user)||void 0===i?void 0:i.authMethod)||""})})})},connectEmail:function(t){return e(function(e){return Z(Z({},e),{loginError:void 0,waitingStatus:"login",user:{address:"",authValue:t,authMethod:"email",walletPassphrase:""},modal:Z(Z({},e.modal),{isOpen:!0,route:Y.OTP})})})},connectSms:function(t){return e(function(e){return Z(Z({},e),{loginError:void 0,waitingStatus:"login",user:{address:"",authValue:t,authMethod:"sms",walletPassphrase:""},modal:Z(Z({},e.modal),{isOpen:!0,route:Y.OTP})})})},connectSocial:function(t){return e(function(e){return Z(Z({},e),{loginError:void 0,waitingStatus:"login",user:{address:"",authValue:"",authMethod:t,walletPassphrase:""},modal:Z(Z({},e.modal),{isOpen:!0,route:Y.SOCIALS_ONBOARDING})})})},logoutAction:function(){return e(function(e){return Z(Z({},e),{user:void 0,auth:void 0,loginError:void 0,waitingStatus:"login",showAllWallets:!1,selectAsset:Z({},ge),detailsAsset:void 0,detailsToken:void 0,customTokens:{mainnet:[],testnet:[]},balancesTab:"assets",balanceValues:{},balances:{error:null,loading:!1,balances:[]},authState:Z(Z({},e.authState),{isAuthenticated:!1}),modal:Z(Z({},e.modal),{isOpen:!1})})})},setBalances:function(t){return e(function(e){return Z(Z({},e),{balances:t})})},setBalanceValues:function(t){return e(function(e){return Z(Z({},e),{balanceValues:t})})},setAuth:function(t){return e(function(e){return Z(Z({},e),{auth:t})})},bumpAccountRefresh:function(){return e(function(e){return Z(Z({},e),{accountRefreshNonce:e.accountRefreshNonce+1})})},setSelectAsset:function(t){return e(function(e){return Z(Z({},e),{selectAsset:t})})},setDetailsAsset:function(t){return e(function(e){return Z(Z({},e),{detailsAsset:t})})},setCustomTokens:function(t){return e(function(e){return Z(Z({},e),{customTokens:t})})},addCustomToken:function(t){return e(function(e){var n,r,i=(null!==(r=e.customTokens[t.network])&&void 0!==r?r:[]).filter(function(e){return e.id!==t.id&&e.contractAddress!==t.contractAddress});return Z(Z({},e),{customTokens:Z(Z({},e.customTokens),(n={},n[t.network]=ne(ne([],i,!0),[t],!1),n))})})},removeCustomToken:function(t,n){return e(function(e){var r,i;return Z(Z({},e),{customTokens:Z(Z({},e.customTokens),(r={},r[t]=(null!==(i=e.customTokens[t])&&void 0!==i?i:[]).filter(function(e){return e.id!==n}),r))})})},setCustomTokenBalances:function(t,n){return e(function(e){var r,i;return Z(Z({},e),{customTokens:Z(Z({},e.customTokens),(r={},r[t]=(null!==(i=e.customTokens[t])&&void 0!==i?i:[]).map(function(e){return null!=n[e.id]?Z(Z({},e),{balance:n[e.id]}):e}),r))})})},setBalancesTab:function(t){return e(function(e){return Z(Z({},e),{balancesTab:t})})},setDetailsToken:function(t){return e(function(e){return Z(Z({},e),{detailsToken:t})})},setWalletConnectClient:function(t,n){return e(function(e){return Z(Z({},e),{walletConnect:{client:t,connection:n}})})},cleanUp:function(t){return e(function(e){var n;return Z(Z({},e),((n={})[t]=void 0,n))})},setNetworkSyncDisabled:function(t){return e(function(e){return Z(Z({},e),{networkSyncDisabled:t})})},setAppearance:function(t){return e(function(e){return Z(Z({},e),{config:Z(Z({},e.config),{appearance:Z(Z({},e.config.appearance),t)})})})},setApiResponse:function(t){return e(function(e){return Z(Z({},e),{apiResponse:t})})},setLoginError:function(t){return e(function(e){return Z(Z({},e),{loginError:t})})},setLogin:function(t){return e(function(e){return Z(Z({},e),{login:t})})},setLogos:function(t){return e(function(e){return Z(Z({},e),{logos:t})})},setAssetMeta:function(t){return e(function(e){return Z(Z({},e),{assetMeta:t})})}}}),ye=ve.getState,we=ve.setState;ve.subscribe,ve.getInitialState;var xe,Ae,Ee=function(e){return A(ve,e)};Ae=(xe=ve).getState(),le.setState({user:Ae.user,config:Ae.config,stellar:Ae.stellar,authState:Ae.authState}),xe.subscribe(function(e){le.setState({user:e.user,config:e.config,stellar:e.stellar,authState:e.authState})});var Se=function(e){function t(t){var n=e.call(this,t&&t.trim()?t:"This account is not allowed to access this app")||this;return n.name="BluxAccessDeniedError",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}G(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),_e=function(e){return e instanceof Se||e instanceof Error&&"BluxAccessDeniedError"===e.name},Oe="__BLUX__JWT_STORE",Ne="__BLUX__RECENT_CONNECTION_METHODS",ke="stellar:pubnet",Te="stellar:testnet",Ce="https://api.blux.cc",Ie="blux-app-id",Be=function(e,t){return ee(void 0,void 0,void 0,function(){var n,r;return te(this,function(i){switch(i.label){case 0:if(!e)throw new Error("BLUX: appId is missing in config.");return[4,Lx("".concat(Ce,"/auth"),{method:"POST",headers:(r={},r[Ie]=e,r.Accept="application/json",r["Content-Type"]="application/json",r),body:JSON.stringify({wallet:"",auth_method:"passkey",auth_value:t})})];case 1:if(400===(n=i.sent()).status)throw new Error("BLUX: invalid inputs");if(500===n.status)throw new Error("BLUX: server error");if(429===n.status)throw new Error("BLUX: too many requests");if(200===n.status)return[2,n.result];throw new Error("BLUX: Unexpected response from api")}})})},Le=function(e,t,n){return ee(void 0,void 0,void 0,function(){var r,i,o,a,s,c;return te(this,function(u){switch(u.label){case 0:if(!e)throw new Error("BLUX: appId is missing in config.");return r=n.credential,"register"===n.step?(o=r.response,i={challenge_id:t.challenge_id,attestation_object:Tx(o.attestationObject),client_data_json:Tx(o.clientDataJSON),transports:"function"==typeof o.getTransports?o.getTransports():[]}):(a=r.response,i={challenge_id:t.challenge_id,client_data_json:Tx(a.clientDataJSON),authenticator_data:Tx(a.authenticatorData),signature:Tx(a.signature)}),[4,Lx("".concat(Ce,"/auth/code"),{method:"POST",headers:(c={},c[Ie]=e,c.Accept="application/json",c["Content-Type"]="application/json",c),body:JSON.stringify({auth_method:"passkey",auth_value:r.id,code:JSON.stringify(i)})})];case 1:if(400===(s=u.sent()).status)throw new Error("BLUX: invalid inputs");if(401===s.status)throw new Error("BLUX: passkey verification failed");if(403===s.status)throw new Error("BLUX: This account already has a passkey; sign in with the existing one.");if(404===s.status)throw new Error("BLUX: user not found");if(500===s.status)throw new Error("BLUX: server error");if(429===s.status)throw new Error("BLUX: too many requests");if(200===s.status)return[2,s.result];throw new Error("BLUX: Unexpected response from api")}})})},Me=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return ee(void 0,ne([e,t],n,!0),void 0,function(e,t,n){var r,i;return void 0===n&&(n="email"),te(this,function(o){switch(o.label){case 0:if(!e)throw new Error("BLUX: appId is missing in config.");o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Lx("".concat(Ce,"/auth"),{method:"POST",headers:(i={},i[Ie]=e,i.Accept="application/json",i["Content-Type"]="application/json",i),body:JSON.stringify({wallet:"",auth_method:n,auth_value:t})})];case 2:return r=o.sent(),[3,4];case 3:throw o.sent(),new Error("BLUX: Unexpected response from api");case 4:if(403===r.status)throw new Se(r.error);if(400===r.status)throw new Error("BLUX: invalid inputs");if(500===r.status)throw new Error("BLUX: server error");if(503===r.status)throw new Error("BLUX: SMS is not configured");if(429===r.status)throw new Error("BLUX: too many requests");if(200===r.status)return[2,!0];throw new Error("BLUX: Unexpected response from api")}})})},Re=function(e,t,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];return ee(void 0,ne([e,t,n],r,!0),void 0,function(e,t,n,r){var i,o;return void 0===r&&(r="signed_transaction"),te(this,function(a){switch(a.label){case 0:if(!e)throw new Error("BLUX: appId is missing in config.");if(!n)throw new Error("BLUX: wallet address is missing.");a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Lx("".concat(Ce,"/auth"),{method:"POST",headers:(o={},o[Ie]=e,o.Accept="application/json",o["Content-Type"]="application/json",o),body:JSON.stringify({wallet:n,auth_method:"wallet",auth_value:t,proof_type:r})})];case 2:return i=a.sent(),[3,4];case 3:throw a.sent(),new Error("BLUX: Unexpected response from api");case 4:if(403===i.status)throw new Se(i.error);if(400===i.status)throw new Error("BLUX: invalid inputs");if(500===i.status)throw new Error("BLUX: server error");if(429===i.status)throw new Error("BLUX: too many requests");if(200===i.status)return[2,i.result];throw new Error("BLUX: Unexpected response from api")}})})},Pe=function(e,t,n){return ee(void 0,void 0,void 0,function(){var r,i;return te(this,function(o){switch(o.label){case 0:if(!e)throw new Error("BLUX: appId is missing in config.");o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Lx("".concat(Ce,"/auth/code"),{method:"POST",headers:(i={},i[Ie]=e,i.Accept="application/json",i["Content-Type"]="application/json",i),body:JSON.stringify(Z(Z({auth_method:"wallet",code:t},(null==n?void 0:n.proofType)?{proof_type:n.proofType}:{}),(null==n?void 0:n.challenge)?{challenge:n.challenge}:{}))})];case 2:return r=o.sent(),[3,4];case 3:throw o.sent(),new Error("BLUX: Unexpected response from api");case 4:if(403===r.status)throw new Se(r.error);if(401===r.status)throw new Error("BLUX: Challenge verification failed");if(400===r.status)throw new Error("BLUX: Login challenge expired. Please try again.");if(404===r.status)throw new Error("BLUX: user not found");if(500===r.status)throw new Error("BLUX: server error");if(429===r.status)throw new Error("BLUX: too many requests");if(200===r.status)return[2,r.result];throw new Error("BLUX: Unexpected response from api")}})})},Ue=function(e,t,n){return ee(void 0,void 0,void 0,function(){var r,i;return te(this,function(o){switch(o.label){case 0:if(!e)throw new Error("BLUX: appId is missing in config.");o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Lx("".concat(Ce,"/auth/code"),{method:"POST",headers:(i={},i[Ie]=e,i.Accept="application/json",i["Content-Type"]="application/json",i),body:JSON.stringify({code:n,wallet:"",auth_method:"sms"===t.authMethod||"phone"===t.authMethod?"sms":"email",auth_value:t.authValue})})];case 2:return r=o.sent(),[3,4];case 3:throw o.sent(),new Error("BLUX: Unexpected response from api");case 4:if(403===r.status)throw new Se(r.error);if(400===r.status)throw new Error("BLUX: invalid inputs");if(500===r.status)throw new Error("BLUX: server error");if(404===r.status)throw new Error("BLUX: invalid code");if(429===r.status)throw new Error("BLUX: too many requests");if(200===r.status)return[2,r.result];throw new Error("BLUX: Unexpected response from api")}})})},je=function(e){return ee(void 0,void 0,void 0,function(){var t;return te(this,function(n){switch(n.label){case 0:return[4,Lx("".concat(Ce,"/users"),{method:"GET",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}})];case 1:if(401===(t=n.sent()).status)throw new Error("BLUX: invalid JWT");if(500===t.status)throw new Error("BLUX: server error");if(404===t.status)throw new Error("BLUX: user nout found");if(429===t.status)throw new Error("BLUX: too many requests");if(200===t.status)return[2,t.result];throw new Error("BLUX: Unexpected response from api")}})})},Fe=function(e,t){return ee(void 0,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Lx("".concat(Ce,"/users/sign-message"),{method:"POST",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({message:t})})];case 1:if(401===(n=r.sent()).status)throw new Error("BLUX: invalid JWT");if(500===n.status)throw new Error("BLUX: server error");if(404===n.status)throw new Error("BLUX: user nout found");if(429===n.status)throw new Error("BLUX: too many requests");if(200===n.status&&n.result)return[2,n.result];throw new Error("BLUX: Unexpected response from api");case 2:throw r.sent(),new Error("BLUX: Unexpected response from api");case 3:return[2]}})})},De=function(e,t,n){return ee(void 0,void 0,void 0,function(){var r;return te(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,Lx("".concat(Ce,"/users/sign-transaction"),{method:"POST",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({xdr:t,network:n})})];case 1:if(401===(r=i.sent()).status)throw new Error("BLUX: invalid JWT");if(500===r.status)throw new Error("BLUX: server error");if(404===r.status)throw new Error("BLUX: user nout found");if(429===r.status)throw new Error("BLUX: too many requests");if(200===r.status&&r.result)return[2,r.result];throw new Error("BLUX: Unexpected response from api");case 2:throw i.sent(),new Error("BLUX: Unexpected response from api");case 3:return[2]}})})},ze=function(e,t,n){return ee(void 0,void 0,void 0,function(){var r;return te(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,Lx("".concat(Ce,"/users/sign-auth-entry"),{method:"POST",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({auth_entry:t,network:n})})];case 1:if(401===(r=i.sent()).status)throw new Error("BLUX: invalid JWT");if(500===r.status)throw new Error("BLUX: server error");if(404===r.status)throw new Error("BLUX: user nout found");if(429===r.status)throw new Error("BLUX: too many requests");if(200===r.status&&r.result)return[2,r.result];throw new Error("BLUX: Unexpected response from api");case 2:throw i.sent(),new Error("BLUX: Unexpected response from api");case 3:return[2]}})})},$e=function(e){return{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}},We=function(e,t,n){return ee(void 0,void 0,void 0,function(){var r;return te(this,function(i){switch(i.label){case 0:return[4,Lx("".concat(Ce,"/tokens"),{method:"POST",headers:$e(e),body:JSON.stringify({contract_address:t,network:n})})];case 1:if(401===(r=i.sent()).status)throw new Error("BLUX: invalid JWT");if(409===r.status)throw new Error("BLUX: token already added");if(502===r.status)throw new Error("BLUX: could not reach the network to validate the token");if(400===r.status)throw new Error(r.error||"BLUX: invalid token, or token limit reached");if(200===r.status&&r.result)return[2,r.result];throw new Error("BLUX: Unexpected response from api")}})})},Xe=function(e,t){return ee(void 0,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:return[4,Lx("".concat(Ce,"/tokens/").concat(t),{method:"DELETE",headers:$e(e)})];case 1:if(401===(n=r.sent()).status)throw new Error("BLUX: invalid JWT");if(404===n.status)throw new Error("BLUX: token not in your list");if(400===n.status)throw new Error("BLUX: invalid token id");if(200===n.status)return[2,!0];throw new Error("BLUX: Unexpected response from api")}})})},qe={name:H.Api,website:"https://blux.cc",connect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: API wallet is not defined.")})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2]})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: API wallet is not defined.")})})},isAvailable:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2,!1]})})},signAuthEntry:function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i,o;return te(this,function(a){switch(a.label){case 0:if(a.trys.push([0,2,,3]),n=ye(),!(r=null===(o=n.auth)||void 0===o?void 0:o.JWT))throw new Error("BLUX: Failed to sign the auth entry from API");return[4,ze(r,e,t.network)];case 1:if(i=a.sent())return[2,i];throw new Error("BLUX: Failed to sign the auth entry from API");case 2:throw a.sent(),new Error("BLUX: Failed to sign the auth entry from API");case 3:return[2]}})})},signMessage:function(e,t){return ee(void 0,void 0,void 0,function(){var t,n,r,i;return te(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),t=ye(),!(n=null===(i=t.auth)||void 0===i?void 0:i.JWT))throw new Error("BLUX: Failed to sign the message from API");return[4,Fe(n,e)];case 1:if(r=o.sent())return[2,r];throw new Error("BLUX: Failed to sign the message from API");case 2:throw o.sent(),new Error("BLUX: Failed to sign the message from API");case 3:return[2]}})})},signTransaction:function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i,o;return te(this,function(a){switch(a.label){case 0:if(a.trys.push([0,2,,3]),n=ye(),!(r=null===(o=n.auth)||void 0===o?void 0:o.JWT))throw new Error("BLUX: Failed to sign the transaction from API");return[4,De(r,e,t.network)];case 1:if(i=a.sent())return[2,i];throw new Error("BLUX: Failed to sign the transaction from API");case 2:throw a.sent(),new Error("BLUX: Failed to sign the transaction from API.");case 3:return[2]}})})}},Ke="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ge(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function He(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var Ve,Ye={},Je={},Ze={},Qe={},et={};function tt(){return Ve||(Ve=1,et.__esModule=!0,et.integers=void 0,et.integers=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"]),et}var nt,rt={};function it(){if(nt)return rt;nt=1,rt.__esModule=!0,rt.DecodeBuffer=rt.EncodeBuffer=void 0;var e=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var n=t.substring(1),r=parseInt(n)/8;this.resize_if_necessary(r);var i="f"===t[0]?"setFloat".concat(n):"i"===t[0]?"setInt".concat(n):"setUint".concat(n);this.view[i](this.offset,e,!0),this.offset+=r},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}();rt.EncodeBuffer=e;var t=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),n=parseInt(t)/8;this.assert_enough_buffer(n);var r="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),i=this.view[r](this.offset,!0);return this.offset+=n,i},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}();return rt.DecodeBuffer=t,rt}var ot,at,st={};function ct(){if(ot)return st;ot=1;var e=st&&st.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();st.__esModule=!0,st.validate_schema=st.ErrorSchema=st.expect_enum=st.expect_same_size=st.expect_bigint=st.expect_type=st.isArrayLike=void 0;var t=tt();st.isArrayLike=function(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e)},st.expect_type=function(e,t,n){if(typeof e!==t)throw new Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(n.join(".")))},st.expect_bigint=function(e,t){if(!["number","string","bigint","boolean"].includes(typeof e)&&!("object"==typeof e&&null!==e&&"toString"in e))throw new Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))},st.expect_same_size=function(e,t,n){if(e!==t)throw new Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(n.join(".")))},st.expect_enum=function(e,t){if("object"!=typeof e||null===e)throw new Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))};var n=t.integers.concat(["bool","string"]),r=["option","enum","array","set","map","struct"],i=function(t){function n(e,n){var r="Invalid schema: ".concat(JSON.stringify(e)," expected ").concat(n);return t.call(this,r)||this}return e(n,t),n}(Error);function o(e){if("string"!=typeof e||!n.includes(e)){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&r.includes(t[0])){var a=t[0];if("option"===a)return o(e[a]);if("enum"===a)return function(e){if(!Array.isArray(e))throw new i(e,"Array");for(var t=0,n=e;t<n.length;t++){var r=n[t];if("object"!=typeof r||!("struct"in r))throw new Error('Missing "struct" key in enum schema');if("object"!=typeof r.struct||1!==Object.keys(r.struct).length)throw new Error('The "struct" in each enum must have a single key');o({struct:r.struct})}}(e[a]);if("array"===a)return function(e){if("object"!=typeof e)throw new i(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw new Error("Invalid schema: ".concat(e));if("type"in e)return o(e.type);throw new i(e,"{ type, len? }")}(e[a]);if("set"===a)return o(e[a]);if("map"===a)return function(e){if("object"!=typeof e||!("key"in e)||!("value"in e))throw new i(e,"{ key, value }");o(e.key),o(e.value)}(e[a]);if("struct"===a)return function(e){if("object"!=typeof e)throw new i(e,"object");for(var t in e)o(e[t])}(e[a])}}throw new i(e,r.join(", ")+" or "+n.join(", "))}}return st.ErrorSchema=i,st.validate_schema=o,st}var ut,lt,dt={};var ft,ht={exports:{}},pt=He(Object.freeze({__proto__:null,default:{}}));var bt,mt={},gt={};function vt(){return bt||(bt=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.KeySize=gt.KeyType=void 0,function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1"}(e||(gt.KeyType=e={})),gt.KeySize={SECRET_KEY:32,ED25519_PUBLIC_KEY:32,SECP256k1_PUBLIC_KEY:64}),gt;var e}var yt,wt={},xt={};function At(){if(yt)return xt;yt=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.KeyPairBase=void 0;return xt.KeyPairBase=class{},xt}var Et,St={},_t={},Ot={};var Nt,kt={},Tt={},Ct={GasLimitExceeded:"Exceeded the maximum amount of gas allowed to burn per contract",MethodEmptyName:"Method name is empty",WasmerCompileError:"Wasmer compilation error: {{msg}}",GuestPanic:"Smart contract panicked: {{panic_msg}}",Memory:"Error creating Wasm memory",GasExceeded:"Exceeded the prepaid gas",MethodUTF8Error:"Method name is not valid UTF8 string",BadUTF16:"String encoding is bad UTF-16 sequence",WasmTrap:"WebAssembly trap: {{msg}}",GasInstrumentation:"Gas instrumentation failed or contract has denied instructions.",InvalidPromiseIndex:"{{promise_idx}} does not correspond to existing promises",InvalidPromiseResultIndex:"Accessed invalid promise result index: {{result_idx}}",Deserialization:"Error happened while deserializing the module",MethodNotFound:"Contract method is not found",InvalidRegisterId:"Accessed invalid register id: {{register_id}}",InvalidReceiptIndex:"VM Logic returned an invalid receipt index: {{receipt_index}}",EmptyMethodName:"Method name is empty in contract call",CannotReturnJointPromise:"Returning joint promise is currently prohibited",StackHeightInstrumentation:"Stack instrumentation failed",CodeDoesNotExist:"Cannot find contract code for account {{account_id}}",MethodInvalidSignature:"Invalid method signature",IntegerOverflow:"Integer overflow happened during contract execution",MemoryAccessViolation:"MemoryAccessViolation",InvalidIteratorIndex:"Iterator index {{iterator_index}} does not exist",IteratorWasInvalidated:"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie",InvalidAccountId:"VM Logic returned an invalid account id",Serialization:"Error happened while serializing the module",CannotAppendActionToJointPromise:"Actions can only be appended to non-joint promise.",InternalMemoryDeclared:"Internal memory declaration has been found in the module",Instantiate:"Error happened during instantiation",ProhibitedInView:"{{method_name}} is not allowed in view calls",InvalidMethodName:"VM Logic returned an invalid method name",BadUTF8:"String encoding is bad UTF-8 sequence",BalanceExceeded:"Exceeded the account balance",LinkError:"Wasm contract link error: {{msg}}",InvalidPublicKey:"VM Logic provided an invalid public key",ActorNoPermission:"Actor {{actor_id}} doesn't have permission to account {{account_id}} to complete the action",LackBalanceForState:"The account {{account_id}} wouldn't have enough balance to cover storage, required to have {{amount}} yoctoNEAR more",ReceiverMismatch:"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.",CostOverflow:"Transaction gas or balance cost is too high",InvalidSignature:"Transaction is not signed with the given public key",AccessKeyNotFound:'Signer "{{account_id}}" doesn\'t have access key with the given public_key {{public_key}}',NotEnoughBalance:"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}",NotEnoughAllowance:"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}",Expired:"Transaction has expired",DeleteAccountStaking:"Account {{account_id}} is staking and can not be deleted",SignerDoesNotExist:"Signer {{signer_id}} does not exist",TriesToStake:"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}",AddKeyAlreadyExists:"The public key {{public_key}} is already used for an existing access key",InvalidSigner:"Invalid signer account ID {{signer_id}} according to requirements",CreateAccountNotAllowed:"The new account_id {{account_id}} can't be created by {{predecessor_id}}",RequiresFullAccess:"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key",TriesToUnstake:"Account {{account_id}} is not yet staked, but tried to unstake",InvalidNonce:"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}",AccountAlreadyExists:"Can't create a new account {{account_id}}, because it already exists",InvalidChain:"Transaction parent block hash doesn't belong to the current chain",AccountDoesNotExist:"Can't complete the action because account {{account_id}} doesn't exist",AccessKeyDoesNotExist:"Can't complete the action because access key {{public_key}} doesn't exist",MethodNameMismatch:"Transaction method name {{method_name}} isn't allowed by the access key",DeleteAccountHasRent:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent",DeleteAccountHasEnoughBalance:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it's storage",InvalidReceiver:"Invalid receiver account ID {{receiver_id}} according to requirements",DeleteKeyDoesNotExist:"Account {{account_id}} tries to remove an access key that doesn't exist",Timeout:"Timeout exceeded",Closed:"Connection closed",ShardCongested:"Shard {{shard_id}} rejected the transaction due to congestion level {{congestion_level}}, try again later",ShardStuck:"Shard {{shard_id}} rejected the transaction because it missed {{missed_chunks}} chunks and needs to recover before accepting new transactions, try again later"};function It(){if(Nt)return Tt;Nt=1;var e=Tt&&Tt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.ErrorMessages=void 0;const t=e(Ct);return Tt.ErrorMessages=t.default,Tt}var Bt,Lt={},Mt={},Rt={};var Pt,Ut={};var jt,Ft={};var Dt,zt={},$t={};var Wt,Xt,qt,Kt={};function Gt(){return Xt||(Xt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FinalExecutionStatusBasic=e.ExecutionStatusBasic=e.IdType=void 0;var t,n=(Dt||(Dt=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.IdType=void 0,function(e){e.Transaction="transaction",e.Receipt="receipt"}(t||($t.IdType=t={}))),$t);Object.defineProperty(e,"IdType",{enumerable:!0,get:function(){return n.IdType}});var r,i,o=(Wt||(Wt=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.FinalExecutionStatusBasic=Kt.ExecutionStatusBasic=void 0,function(e){e.Unknown="Unknown",e.Pending="Pending",e.Failure="Failure"}(r||(Kt.ExecutionStatusBasic=r={})),function(e){e.NotStarted="NotStarted",e.Started="Started",e.Failure="Failure"}(i||(Kt.FinalExecutionStatusBasic=i={}))),Kt);Object.defineProperty(e,"ExecutionStatusBasic",{enumerable:!0,get:function(){return o.ExecutionStatusBasic}}),Object.defineProperty(e,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return o.FinalExecutionStatusBasic}})}(zt)),zt}function Ht(){return qt||(qt=1,e=Mt,t=Mt&&Mt.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=Mt&&Mt.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)},Object.defineProperty(e,"__esModule",{value:!0}),n((Bt||(Bt=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.Assignable=void 0,Rt.Assignable=class{constructor(e){Object.keys(e).map(t=>{this[t]=e[t]})}}),Rt),e),n((Pt||(Pt=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.Enum=void 0,Ut.Enum=class{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}),Ut),e),n(function(){if(jt)return Ft;jt=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.ErrorContext=Ft.TypedError=Ft.ArgumentTypeError=Ft.PositionalArgsError=void 0;class e extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}Ft.PositionalArgsError=e;class t extends Error{constructor(e,t,n){super(`Expected ${t} for '${e}' argument, but got '${JSON.stringify(n)}'`)}}Ft.ArgumentTypeError=t;class n extends Error{type;context;constructor(e,t,n){super(e),this.type=t||"UntypedError",this.context=n}}return Ft.TypedError=n,Ft.ErrorContext=class{transactionHash;constructor(e){this.transactionHash=e}},Ft}(),e),n(Gt(),e)),Mt;var e,t,n}var Vt,Yt={exports:{}};function Jt(){return Vt||(Vt=1,Yt.exports=function(){
2
2
  /*!
3
3
  * mustache.js - Logic-less {{mustache}} templates with JavaScript
4
4
  * http://github.com/janl/mustache.js
5
5
  */
6
- var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function n(e){return"function"==typeof e}function r(e){return t(e)?"array":typeof e}function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(e,t){return null!=e&&"object"==typeof e&&t in e}function a(e,t){return null!=e&&"object"!=typeof e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var s=RegExp.prototype.test;function c(e,t){return s.call(e,t)}var u=/\S/;function l(e){return!c(u,e)}var d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function f(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return d[e]})}var h=/\s*/,p=/\s+/,b=/\s*=/,m=/\s*\}/,g=/#|\^|\/|>|\{|&|=|!/;function v(e,n){if(!e)return[];var r,o,a,s=!1,c=[],u=[],d=[],f=!1,v=!1,A="",E=0;function _(){if(f&&!v)for(;d.length;)delete u[d.pop()];else d=[];f=!1,v=!1}function O(e){if("string"==typeof e&&(e=e.split(p,2)),!t(e)||2!==e.length)throw new Error("Invalid tags: "+e);r=new RegExp(i(e[0])+"\\s*"),o=new RegExp("\\s*"+i(e[1])),a=new RegExp("\\s*"+i("}"+e[1]))}O(n||S.tags);for(var N,k,T,C,I,B,L=new x(e);!L.eos();){if(N=L.pos,T=L.scanUntil(r))for(var M=0,R=T.length;M<R;++M)l(C=T.charAt(M))?(d.push(u.length),A+=C):(v=!0,s=!0,A+=" "),u.push(["text",C,N,N+1]),N+=1,"\n"===C&&(_(),A="",E=0,s=!1);if(!L.scan(r))break;if(f=!0,k=L.scan(g)||"name",L.scan(h),"="===k?(T=L.scanUntil(b),L.scan(b),L.scanUntil(o)):"{"===k?(T=L.scanUntil(a),L.scan(m),L.scanUntil(o),k="&"):T=L.scanUntil(o),!L.scan(o))throw new Error("Unclosed tag at "+L.pos);if(I=">"==k?[k,T,N,L.pos,A,E,s]:[k,T,N,L.pos],E++,u.push(I),"#"===k||"^"===k)c.push(I);else if("/"===k){if(!(B=c.pop()))throw new Error('Unopened section "'+T+'" at '+N);if(B[1]!==T)throw new Error('Unclosed section "'+B[1]+'" at '+N)}else"name"===k||"{"===k||"&"===k?v=!0:"="===k&&O(T)}if(_(),B=c.pop())throw new Error('Unclosed section "'+B[1]+'" at '+L.pos);return w(y(u))}function y(e){for(var t,n,r=[],i=0,o=e.length;i<o;++i)(t=e[i])&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}function w(e){for(var t,n=[],r=n,i=[],o=0,a=e.length;o<a;++o)switch((t=e[o])[0]){case"#":case"^":r.push(t),i.push(t),r=t[4]=[];break;case"/":i.pop()[5]=t[2],r=i.length>0?i[i.length-1][4]:n;break;default:r.push(t)}return n}function x(e){this.string=e,this.tail=e,this.pos=0}function A(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function E(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}x.prototype.eos=function(){return""===this.tail},x.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},x.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},A.prototype.push=function(e){return new A(e,this)},A.prototype.lookup=function(e){var t,r=this.cache;if(r.hasOwnProperty(e))t=r[e];else{for(var i,s,c,u=this,l=!1;u;){if(e.indexOf(".")>0)for(i=u.view,s=e.split("."),c=0;null!=i&&c<s.length;)c===s.length-1&&(l=o(i,s[c])||a(i,s[c])),i=i[s[c++]];else i=u.view[e],l=o(u.view,e);if(l){t=i;break}u=u.parent}r[e]=t}return n(t)&&(t=t.call(this.view)),t},E.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},E.prototype.parse=function(e,t){var n=this.templateCache,r=e+":"+(t||S.tags).join(":"),i=void 0!==n,o=i?n.get(r):void 0;return null==o&&(o=v(e,t),i&&n.set(r,o)),o},E.prototype.render=function(e,t,n,r){var i=this.parse(e,r),o=t instanceof A?t:new A(t,void 0);return this.renderTokens(i,o,n,e,r)},E.prototype.renderTokens=function(e,t,n,r,i){for(var o,a,s,c="",u=0,l=e.length;u<l;++u)s=void 0,"#"===(a=(o=e[u])[0])?s=this.renderSection(o,t,n,r):"^"===a?s=this.renderInverted(o,t,n,r):">"===a?s=this.renderPartial(o,t,n,i):"&"===a?s=this.unescapedValue(o,t):"name"===a?s=this.escapedValue(o,t):"text"===a&&(s=this.rawValue(o)),void 0!==s&&(c+=s);return c},E.prototype.renderSection=function(e,r,i,o){var a=this,s="",c=r.lookup(e[1]);function u(e){return a.render(e,r,i)}if(c){if(t(c))for(var l=0,d=c.length;l<d;++l)s+=this.renderTokens(e[4],r.push(c[l]),i,o);else if("object"==typeof c||"string"==typeof c||"number"==typeof c)s+=this.renderTokens(e[4],r.push(c),i,o);else if(n(c)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");null!=(c=c.call(r.view,o.slice(e[3],e[5]),u))&&(s+=c)}else s+=this.renderTokens(e[4],r,i,o);return s}},E.prototype.renderInverted=function(e,n,r,i){var o=n.lookup(e[1]);if(!o||t(o)&&0===o.length)return this.renderTokens(e[4],n,r,i)},E.prototype.indentPartial=function(e,t,n){for(var r=t.replace(/[^ \t]/g,""),i=e.split("\n"),o=0;o<i.length;o++)i[o].length&&(o>0||!n)&&(i[o]=r+i[o]);return i.join("\n")},E.prototype.renderPartial=function(e,t,r,i){if(r){var o=n(r)?r(e[1]):r[e[1]];if(null!=o){var a=e[6],s=e[5],c=e[4],u=o;return 0==s&&c&&(u=this.indentPartial(o,c,a)),this.renderTokens(this.parse(u,i),t,r,u)}}},E.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},E.prototype.escapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return S.escape(n)},E.prototype.rawValue=function(e){return e[1]};var S={name:"mustache.js",version:"4.0.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){_.templateCache=e},get templateCache(){return _.templateCache}},_=new E;return S.clearCache=function(){return _.clearCache()},S.parse=function(e,t){return _.parse(e,t)},S.render=function(e,t,n,i){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+r(e)+'" was given as the first argument for mustache#render(template, view, partials)');return _.render(e,t,n,i)},S.escape=f,S.Scanner=x,S.Context=A,S.Writer=E,S}()),Gt.exports}var Jt,Zt,Qt={},en={};function tn(){return Jt||(Jt=1,function(e){function t(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function n(e,...n){if(!t(e))throw new Error("Uint8Array expected");if(n.length>0&&!n.includes(e.length))throw new Error("Uint8Array expected of length "+n+", got length="+e.length)}function r(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>"string"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function i(e){if("function"!=typeof e)throw new Error("function expected");return!0}function o(e,t){if("string"!=typeof t)throw new Error(`${e}: string expected`);return!0}function a(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function s(e){if(!Array.isArray(e))throw new Error("array expected")}function c(e,t){if(!r(!0,t))throw new Error(`${e}: array of strings expected`)}function u(e,t){if(!r(!1,t))throw new Error(`${e}: array of numbers expected`)}function l(...e){const t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map(e=>e.encode).reduceRight(n,t),decode:e.map(e=>e.decode).reduce(n,t)}}function d(e){const t="string"==typeof e?e.split(""):e,n=t.length;c("alphabet",t);const r=new Map(t.map((e,t)=>[e,t]));return{encode:r=>(s(r),r.map(r=>{if(!Number.isSafeInteger(r)||r<0||r>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${r}". Allowed: ${e}`);return t[r]})),decode:t=>(s(t),t.map(t=>{o("alphabet.decode",t);const n=r.get(t);if(void 0===n)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return n}))}}function f(e=""){return o("join",e),{encode:t=>(c("join.decode",t),t.join(e)),decode:t=>(o("join.decode",t),t.split(e))}}function h(e,t="="){return a(e),o("padding",t),{encode(n){for(c("padding.encode",n);n.length*e%8;)n.push(t);return n},decode(n){c("padding.decode",n);let r=n.length;if(r*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;r>0&&n[r-1]===t;r--){if((r-1)*e%8==0)throw new Error("padding: invalid, string has too much padding")}return n.slice(0,r)}}}function p(e){return i(e),{encode:e=>e,decode:t=>e(t)}}function b(e,t,n){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(s(e),!e.length)return[];let r=0;const i=[],o=Array.from(e,e=>{if(a(e),e<0||e>=t)throw new Error(`invalid integer: ${e}`);return e}),c=o.length;for(;;){let e=0,a=!0;for(let i=r;i<c;i++){const s=o[i],c=t*e,u=c+s;if(!Number.isSafeInteger(u)||c/t!==e||u-s!==c)throw new Error("convertRadix: carry overflow");const l=u/n;e=u%n;const d=Math.floor(l);if(o[i]=d,!Number.isSafeInteger(d)||d*n+e!==u)throw new Error("convertRadix: carry overflow");a&&(d?a=!1:r=i)}if(i.push(e),a)break}for(let t=0;t<e.length-1&&0===e[t];t++)i.push(0);return i.reverse()}
6
+ var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function n(e){return"function"==typeof e}function r(e){return t(e)?"array":typeof e}function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(e,t){return null!=e&&"object"==typeof e&&t in e}function a(e,t){return null!=e&&"object"!=typeof e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var s=RegExp.prototype.test;function c(e,t){return s.call(e,t)}var u=/\S/;function l(e){return!c(u,e)}var d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function f(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return d[e]})}var h=/\s*/,p=/\s+/,b=/\s*=/,m=/\s*\}/,g=/#|\^|\/|>|\{|&|=|!/;function v(e,n){if(!e)return[];var r,o,a,s=!1,c=[],u=[],d=[],f=!1,v=!1,A="",E=0;function _(){if(f&&!v)for(;d.length;)delete u[d.pop()];else d=[];f=!1,v=!1}function O(e){if("string"==typeof e&&(e=e.split(p,2)),!t(e)||2!==e.length)throw new Error("Invalid tags: "+e);r=new RegExp(i(e[0])+"\\s*"),o=new RegExp("\\s*"+i(e[1])),a=new RegExp("\\s*"+i("}"+e[1]))}O(n||S.tags);for(var N,k,T,C,I,B,L=new x(e);!L.eos();){if(N=L.pos,T=L.scanUntil(r))for(var M=0,R=T.length;M<R;++M)l(C=T.charAt(M))?(d.push(u.length),A+=C):(v=!0,s=!0,A+=" "),u.push(["text",C,N,N+1]),N+=1,"\n"===C&&(_(),A="",E=0,s=!1);if(!L.scan(r))break;if(f=!0,k=L.scan(g)||"name",L.scan(h),"="===k?(T=L.scanUntil(b),L.scan(b),L.scanUntil(o)):"{"===k?(T=L.scanUntil(a),L.scan(m),L.scanUntil(o),k="&"):T=L.scanUntil(o),!L.scan(o))throw new Error("Unclosed tag at "+L.pos);if(I=">"==k?[k,T,N,L.pos,A,E,s]:[k,T,N,L.pos],E++,u.push(I),"#"===k||"^"===k)c.push(I);else if("/"===k){if(!(B=c.pop()))throw new Error('Unopened section "'+T+'" at '+N);if(B[1]!==T)throw new Error('Unclosed section "'+B[1]+'" at '+N)}else"name"===k||"{"===k||"&"===k?v=!0:"="===k&&O(T)}if(_(),B=c.pop())throw new Error('Unclosed section "'+B[1]+'" at '+L.pos);return w(y(u))}function y(e){for(var t,n,r=[],i=0,o=e.length;i<o;++i)(t=e[i])&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}function w(e){for(var t,n=[],r=n,i=[],o=0,a=e.length;o<a;++o)switch((t=e[o])[0]){case"#":case"^":r.push(t),i.push(t),r=t[4]=[];break;case"/":i.pop()[5]=t[2],r=i.length>0?i[i.length-1][4]:n;break;default:r.push(t)}return n}function x(e){this.string=e,this.tail=e,this.pos=0}function A(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function E(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}x.prototype.eos=function(){return""===this.tail},x.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},x.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},A.prototype.push=function(e){return new A(e,this)},A.prototype.lookup=function(e){var t,r=this.cache;if(r.hasOwnProperty(e))t=r[e];else{for(var i,s,c,u=this,l=!1;u;){if(e.indexOf(".")>0)for(i=u.view,s=e.split("."),c=0;null!=i&&c<s.length;)c===s.length-1&&(l=o(i,s[c])||a(i,s[c])),i=i[s[c++]];else i=u.view[e],l=o(u.view,e);if(l){t=i;break}u=u.parent}r[e]=t}return n(t)&&(t=t.call(this.view)),t},E.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},E.prototype.parse=function(e,t){var n=this.templateCache,r=e+":"+(t||S.tags).join(":"),i=void 0!==n,o=i?n.get(r):void 0;return null==o&&(o=v(e,t),i&&n.set(r,o)),o},E.prototype.render=function(e,t,n,r){var i=this.parse(e,r),o=t instanceof A?t:new A(t,void 0);return this.renderTokens(i,o,n,e,r)},E.prototype.renderTokens=function(e,t,n,r,i){for(var o,a,s,c="",u=0,l=e.length;u<l;++u)s=void 0,"#"===(a=(o=e[u])[0])?s=this.renderSection(o,t,n,r):"^"===a?s=this.renderInverted(o,t,n,r):">"===a?s=this.renderPartial(o,t,n,i):"&"===a?s=this.unescapedValue(o,t):"name"===a?s=this.escapedValue(o,t):"text"===a&&(s=this.rawValue(o)),void 0!==s&&(c+=s);return c},E.prototype.renderSection=function(e,r,i,o){var a=this,s="",c=r.lookup(e[1]);function u(e){return a.render(e,r,i)}if(c){if(t(c))for(var l=0,d=c.length;l<d;++l)s+=this.renderTokens(e[4],r.push(c[l]),i,o);else if("object"==typeof c||"string"==typeof c||"number"==typeof c)s+=this.renderTokens(e[4],r.push(c),i,o);else if(n(c)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");null!=(c=c.call(r.view,o.slice(e[3],e[5]),u))&&(s+=c)}else s+=this.renderTokens(e[4],r,i,o);return s}},E.prototype.renderInverted=function(e,n,r,i){var o=n.lookup(e[1]);if(!o||t(o)&&0===o.length)return this.renderTokens(e[4],n,r,i)},E.prototype.indentPartial=function(e,t,n){for(var r=t.replace(/[^ \t]/g,""),i=e.split("\n"),o=0;o<i.length;o++)i[o].length&&(o>0||!n)&&(i[o]=r+i[o]);return i.join("\n")},E.prototype.renderPartial=function(e,t,r,i){if(r){var o=n(r)?r(e[1]):r[e[1]];if(null!=o){var a=e[6],s=e[5],c=e[4],u=o;return 0==s&&c&&(u=this.indentPartial(o,c,a)),this.renderTokens(this.parse(u,i),t,r,u)}}},E.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},E.prototype.escapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return S.escape(n)},E.prototype.rawValue=function(e){return e[1]};var S={name:"mustache.js",version:"4.0.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){_.templateCache=e},get templateCache(){return _.templateCache}},_=new E;return S.clearCache=function(){return _.clearCache()},S.parse=function(e,t){return _.parse(e,t)},S.render=function(e,t,n,i){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+r(e)+'" was given as the first argument for mustache#render(template, view, partials)');return _.render(e,t,n,i)},S.escape=f,S.Scanner=x,S.Context=A,S.Writer=E,S}()),Yt.exports}var Zt,Qt,en={},tn={};function nn(){return Zt||(Zt=1,function(e){function t(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function n(e,...n){if(!t(e))throw new Error("Uint8Array expected");if(n.length>0&&!n.includes(e.length))throw new Error("Uint8Array expected of length "+n+", got length="+e.length)}function r(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>"string"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function i(e){if("function"!=typeof e)throw new Error("function expected");return!0}function o(e,t){if("string"!=typeof t)throw new Error(`${e}: string expected`);return!0}function a(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function s(e){if(!Array.isArray(e))throw new Error("array expected")}function c(e,t){if(!r(!0,t))throw new Error(`${e}: array of strings expected`)}function u(e,t){if(!r(!1,t))throw new Error(`${e}: array of numbers expected`)}function l(...e){const t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map(e=>e.encode).reduceRight(n,t),decode:e.map(e=>e.decode).reduce(n,t)}}function d(e){const t="string"==typeof e?e.split(""):e,n=t.length;c("alphabet",t);const r=new Map(t.map((e,t)=>[e,t]));return{encode:r=>(s(r),r.map(r=>{if(!Number.isSafeInteger(r)||r<0||r>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${r}". Allowed: ${e}`);return t[r]})),decode:t=>(s(t),t.map(t=>{o("alphabet.decode",t);const n=r.get(t);if(void 0===n)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return n}))}}function f(e=""){return o("join",e),{encode:t=>(c("join.decode",t),t.join(e)),decode:t=>(o("join.decode",t),t.split(e))}}function h(e,t="="){return a(e),o("padding",t),{encode(n){for(c("padding.encode",n);n.length*e%8;)n.push(t);return n},decode(n){c("padding.decode",n);let r=n.length;if(r*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;r>0&&n[r-1]===t;r--){if((r-1)*e%8==0)throw new Error("padding: invalid, string has too much padding")}return n.slice(0,r)}}}function p(e){return i(e),{encode:e=>e,decode:t=>e(t)}}function b(e,t,n){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(s(e),!e.length)return[];let r=0;const i=[],o=Array.from(e,e=>{if(a(e),e<0||e>=t)throw new Error(`invalid integer: ${e}`);return e}),c=o.length;for(;;){let e=0,a=!0;for(let i=r;i<c;i++){const s=o[i],c=t*e,u=c+s;if(!Number.isSafeInteger(u)||c/t!==e||u-s!==c)throw new Error("convertRadix: carry overflow");const l=u/n;e=u%n;const d=Math.floor(l);if(o[i]=d,!Number.isSafeInteger(d)||d*n+e!==u)throw new Error("convertRadix: carry overflow");a&&(d?a=!1:r=i)}if(i.push(e),a)break}for(let t=0;t<e.length-1&&0===e[t];t++)i.push(0);return i.reverse()}
7
7
  /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
8
- Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.createBase58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64urlnopad=e.base64url=e.base64nopad=e.base64=e.base32crockford=e.base32hexnopad=e.base32hex=e.base32nopad=e.base32=e.base16=e.utils=void 0;const m=(e,t)=>0===t?e:m(t,e%t),g=(e,t)=>e+(t-m(e,t)),v=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function y(e,t,n,r){if(s(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(g(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${g(t,n)}`);let i=0,o=0;const c=v[t],u=v[n]-1,l=[];for(const r of e){if(a(r),r>=c)throw new Error(`convertRadix2: invalid data word=${r} from=${t}`);if(i=i<<t|r,o+t>32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=n;o-=n)l.push((i>>o-n&u)>>>0);const e=v[o];if(void 0===e)throw new Error("invalid carry");i&=e-1}if(i=i<<n-o&u,!r&&o>=t)throw new Error("Excess padding");if(!r&&i>0)throw new Error(`Non-zero padding: ${i}`);return r&&o>0&&l.push(i>>>0),l}function w(e){a(e);return{encode:n=>{if(!t(n))throw new Error("radix.encode input should be Uint8Array");return b(Array.from(n),256,e)},decode:t=>(u("radix.decode",t),Uint8Array.from(b(t,e,256)))}}function x(e,n=!1){if(a(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(g(8,e)>32||g(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!t(r))throw new Error("radix2.encode input should be Uint8Array");return y(Array.from(r),8,e,!n)},decode:t=>(u("radix2.decode",t),Uint8Array.from(y(t,e,8,n)))}}function A(e){return i(e),function(...t){try{return e.apply(null,t)}catch(e){}}}function E(e,n){return a(e),i(n),{encode(r){if(!t(r))throw new Error("checksum.encode: input should be Uint8Array");const i=n(r).slice(0,e),o=new Uint8Array(r.length+e);return o.set(r),o.set(i,r.length),o},decode(r){if(!t(r))throw new Error("checksum.decode: input should be Uint8Array");const i=r.slice(0,-e),o=r.slice(-e),a=n(i).slice(0,e);for(let t=0;t<e;t++)if(a[t]!==o[t])throw new Error("Invalid checksum");return i}}}e.utils={alphabet:d,chain:l,checksum:E,convertRadix:b,convertRadix2:y,radix:w,radix2:x,join:f,padding:h},e.base16=l(x(4),d("0123456789ABCDEF"),f("")),e.base32=l(x(5),d("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),h(5),f("")),e.base32nopad=l(x(5),d("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),f("")),e.base32hex=l(x(5),d("0123456789ABCDEFGHIJKLMNOPQRSTUV"),h(5),f("")),e.base32hexnopad=l(x(5),d("0123456789ABCDEFGHIJKLMNOPQRSTUV"),f("")),e.base32crockford=l(x(5),d("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),f(""),p(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const S=(()=>"function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64)(),_=(e,t)=>{o("base64",e);const n=t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,r=t?"base64url":"base64";if(e.length>0&&!n.test(e))throw new Error("invalid base64");return Uint8Array.fromBase64(e,{alphabet:r,lastChunkHandling:"strict"})};e.base64=S?{encode:e=>(n(e),e.toBase64()),decode:e=>_(e,!1)}:l(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),h(6),f("")),e.base64nopad=l(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),f("")),e.base64url=S?{encode:e=>(n(e),e.toBase64({alphabet:"base64url"})),decode:e=>_(e,!0)}:l(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),h(6),f("")),e.base64urlnopad=l(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),f(""));const O=e=>l(w(58),d(e),f(""));e.base58=O("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=O("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=O("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const N=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(t){let n="";for(let r=0;r<t.length;r+=8){const i=t.subarray(r,r+8);n+=e.base58.encode(i).padStart(N[i.length],"1")}return n},decode(t){let n=[];for(let r=0;r<t.length;r+=11){const i=t.slice(r,r+11),o=N.indexOf(i.length),a=e.base58.decode(i);for(let e=0;e<a.length-o;e++)if(0!==a[e])throw new Error("base58xmr: wrong padding");n=n.concat(Array.from(a.slice(a.length-o)))}return Uint8Array.from(n)}};e.createBase58check=t=>l(E(4,e=>t(t(e))),e.base58),e.base58check=e.createBase58check;const k=l(d("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),f("")),T=[996825010,642813549,513874426,1027748829,705979059];function C(e){const t=e>>25;let n=(33554431&e)<<5;for(let e=0;e<T.length;e++)1==(t>>e&1)&&(n^=T[e]);return n}function I(e,t,n=1){const r=e.length;let i=1;for(let t=0;t<r;t++){const n=e.charCodeAt(t);if(n<33||n>126)throw new Error(`Invalid prefix (${e})`);i=C(i)^n>>5}i=C(i);for(let t=0;t<r;t++)i=C(i)^31&e.charCodeAt(t);for(let e of t)i=C(i)^e;for(let e=0;e<6;e++)i=C(i);return i^=n,k.encode(y([i%v[30]],30,5,!1))}function B(e){const n="bech32"===e?1:734539939,r=x(5),i=r.decode,a=r.encode,s=A(i);function c(e,r,i=90){o("bech32.encode prefix",e),t(r)&&(r=Array.from(r)),u("bech32.encode",r);const a=e.length;if(0===a)throw new TypeError(`Invalid prefix length ${a}`);const s=a+7+r.length;if(!1!==i&&s>i)throw new TypeError(`Length ${s} exceeds limit ${i}`);const c=e.toLowerCase(),l=I(c,r,n);return`${c}1${k.encode(r)}${l}`}function l(e,t=90){o("bech32.decode input",e);const r=e.length;if(r<8||!1!==t&&r>t)throw new TypeError(`invalid string length: ${r} (${e}). Expected (8..${t})`);const i=e.toLowerCase();if(e!==i&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const a=i.lastIndexOf("1");if(0===a||-1===a)throw new Error('Letter "1" must be present between prefix and data only');const s=i.slice(0,a),c=i.slice(a+1);if(c.length<6)throw new Error("Data must be at least 6 characters long");const u=k.decode(c).slice(0,-6),l=I(s,u,n);if(!c.endsWith(l))throw new Error(`Invalid checksum in ${e}: expected "${l}"`);return{prefix:s,words:u}}return{encode:c,decode:l,encodeFromBytes:function(e,t){return c(e,a(t))},decodeToBytes:function(e){const{prefix:t,words:n}=l(e,!1);return{prefix:t,words:n,bytes:i(n)}},decodeUnsafe:A(l),fromWords:i,fromWordsUnsafe:s,toWords:a}}e.bech32=B("bech32"),e.bech32m=B("bech32m"),e.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)};const L=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),M={encode:e=>(n(e),e.toHex()),decode:e=>(o("hex",e),Uint8Array.fromHex(e))};e.hex=L?M:l(x(4),d("0123456789abcdef"),f(""),p(e=>{if("string"!=typeof e||e.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));const R={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},P="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";e.bytesToString=(e,n)=>{if("string"!=typeof e||!R.hasOwnProperty(e))throw new TypeError(P);if(!t(n))throw new TypeError("bytesToString() expects Uint8Array");return R[e].encode(n)},e.str=e.bytesToString;e.stringToBytes=(e,t)=>{if(!R.hasOwnProperty(e))throw new TypeError(P);if("string"!=typeof t)throw new TypeError("stringToBytes() expects string");return R[e].decode(t)},e.bytes=e.stringToBytes}(en)),en}function nn(){return Zt||(Zt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.baseDecode=e.baseEncode=e.parseNearAmount=e.formatNearAmount=e.NEAR_NOMINATION=e.NEAR_NOMINATION_EXP=void 0;const t=tn();e.NEAR_NOMINATION_EXP=24,e.NEAR_NOMINATION=10n**BigInt(e.NEAR_NOMINATION_EXP);const n=[];for(let t=0,r=5n;t<e.NEAR_NOMINATION_EXP;t++,r*=10n)n[t]=r;e.formatNearAmount=function(t,r=e.NEAR_NOMINATION_EXP){let i=BigInt(t);if(r!==e.NEAR_NOMINATION_EXP){const t=e.NEAR_NOMINATION_EXP-r-1;t>0&&(i+=n[t])}const o=(t=i.toString()).substring(0,t.length-e.NEAR_NOMINATION_EXP)||"0",a=t.substring(t.length-e.NEAR_NOMINATION_EXP).padStart(e.NEAR_NOMINATION_EXP,"0").substring(0,r);return`${function(e){const t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}(o)}.${a}`.replace(/\.?0*$/,"")},e.parseNearAmount=function(t){if(!t)return null;const n=(t=t.replace(/,/g,"").trim()).split("."),r=n[0],i=n[1]||"";if(n.length>2||i.length>e.NEAR_NOMINATION_EXP)throw new Error(`Cannot parse '${t}' as NEAR amount`);return function(e){if(""===(e=e.replace(/^0+/,"")))return"0";return e}(r+i.padEnd(e.NEAR_NOMINATION_EXP,"0"))},e.baseEncode=function(e){if("string"==typeof e){const t=[];for(let n=0;n<e.length;n++)t.push(e.charCodeAt(n));e=new Uint8Array(t)}return t.base58.encode(e)},e.baseDecode=function(e){return t.base58.decode(e)}}(Qt)),Qt}var rn,on,an={schema:{AccessKeyNotFound:{name:"AccessKeyNotFound",subtypes:[],props:{account_id:"",public_key:""}},AccountAlreadyExists:{name:"AccountAlreadyExists",subtypes:[],props:{account_id:""}},AccountDoesNotExist:{name:"AccountDoesNotExist",subtypes:[],props:{account_id:""}},ActionError:{name:"ActionError",subtypes:["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],props:{index:""}},ActionsValidationError:{name:"ActionsValidationError",subtypes:["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],props:{}},ActorNoPermission:{name:"ActorNoPermission",subtypes:[],props:{account_id:"",actor_id:""}},AddKeyAlreadyExists:{name:"AddKeyAlreadyExists",subtypes:[],props:{account_id:"",public_key:""}},AddKeyMethodNameLengthExceeded:{name:"AddKeyMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},AddKeyMethodNamesNumberOfBytesExceeded:{name:"AddKeyMethodNamesNumberOfBytesExceeded",subtypes:[],props:{limit:"",total_number_of_bytes:""}},AltBn128InvalidInput:{name:"AltBn128InvalidInput",subtypes:[],props:{msg:""}},BadUTF16:{name:"BadUTF16",subtypes:[],props:{}},BadUTF8:{name:"BadUTF8",subtypes:[],props:{}},BalanceExceeded:{name:"BalanceExceeded",subtypes:[],props:{}},BalanceMismatchError:{name:"BalanceMismatchError",subtypes:[],props:{final_accounts_balance:"",final_postponed_receipts_balance:"",forwarded_buffered_receipts_balance:"",incoming_receipts_balance:"",incoming_validator_rewards:"",initial_accounts_balance:"",initial_postponed_receipts_balance:"",new_buffered_receipts_balance:"",new_delayed_receipts_balance:"",other_burnt_amount:"",outgoing_receipts_balance:"",processed_delayed_receipts_balance:"",slashed_burnt_amount:"",tx_burnt_amount:""}},CallIndirectOOB:{name:"CallIndirectOOB",subtypes:[],props:{}},CannotAppendActionToJointPromise:{name:"CannotAppendActionToJointPromise",subtypes:[],props:{}},CannotReturnJointPromise:{name:"CannotReturnJointPromise",subtypes:[],props:{}},CodeDoesNotExist:{name:"CodeDoesNotExist",subtypes:[],props:{account_id:""}},CompilationError:{name:"CompilationError",subtypes:["CodeDoesNotExist","PrepareError","WasmerCompileError"],props:{}},ContractSizeExceeded:{name:"ContractSizeExceeded",subtypes:[],props:{limit:"",size:""}},CostOverflow:{name:"CostOverflow",subtypes:[],props:{}},CreateAccountNotAllowed:{name:"CreateAccountNotAllowed",subtypes:[],props:{account_id:"",predecessor_id:""}},CreateAccountOnlyByRegistrar:{name:"CreateAccountOnlyByRegistrar",subtypes:[],props:{account_id:"",predecessor_id:"",registrar_account_id:""}},DelegateActionExpired:{name:"DelegateActionExpired",subtypes:[],props:{}},DelegateActionInvalidNonce:{name:"DelegateActionInvalidNonce",subtypes:[],props:{ak_nonce:"",delegate_nonce:""}},DelegateActionInvalidSignature:{name:"DelegateActionInvalidSignature",subtypes:[],props:{}},DelegateActionMustBeOnlyOne:{name:"DelegateActionMustBeOnlyOne",subtypes:[],props:{}},DelegateActionNonceTooLarge:{name:"DelegateActionNonceTooLarge",subtypes:[],props:{delegate_nonce:"",upper_bound:""}},DelegateActionSenderDoesNotMatchTxReceiver:{name:"DelegateActionSenderDoesNotMatchTxReceiver",subtypes:[],props:{receiver_id:"",sender_id:""}},DeleteAccountStaking:{name:"DeleteAccountStaking",subtypes:[],props:{account_id:""}},DeleteAccountWithLargeState:{name:"DeleteAccountWithLargeState",subtypes:[],props:{account_id:""}},DeleteActionMustBeFinal:{name:"DeleteActionMustBeFinal",subtypes:[],props:{}},DeleteKeyDoesNotExist:{name:"DeleteKeyDoesNotExist",subtypes:[],props:{account_id:"",public_key:""}},DepositWithFunctionCall:{name:"DepositWithFunctionCall",subtypes:[],props:{}},Deprecated:{name:"Deprecated",subtypes:[],props:{method_name:""}},Deserialization:{name:"Deserialization",subtypes:[],props:{}},ECRecoverError:{name:"ECRecoverError",subtypes:[],props:{msg:""}},Ed25519VerifyInvalidInput:{name:"Ed25519VerifyInvalidInput",subtypes:[],props:{msg:""}},EmptyMethodName:{name:"EmptyMethodName",subtypes:[],props:{}},Expired:{name:"Expired",subtypes:[],props:{}},FunctionCallArgumentsLengthExceeded:{name:"FunctionCallArgumentsLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallMethodNameLengthExceeded:{name:"FunctionCallMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallZeroAttachedGas:{name:"FunctionCallZeroAttachedGas",subtypes:[],props:{}},GasExceeded:{name:"GasExceeded",subtypes:[],props:{}},GasInstrumentation:{name:"GasInstrumentation",subtypes:[],props:{}},GasLimitExceeded:{name:"GasLimitExceeded",subtypes:[],props:{}},GenericTrap:{name:"GenericTrap",subtypes:[],props:{}},GuestPanic:{name:"GuestPanic",subtypes:[],props:{panic_msg:""}},HostError:{name:"HostError",subtypes:["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecoverError","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],props:{}},IllegalArithmetic:{name:"IllegalArithmetic",subtypes:[],props:{}},IncorrectCallIndirectSignature:{name:"IncorrectCallIndirectSignature",subtypes:[],props:{}},IndirectCallToNull:{name:"IndirectCallToNull",subtypes:[],props:{}},Instantiate:{name:"Instantiate",subtypes:[],props:{}},InsufficientStake:{name:"InsufficientStake",subtypes:[],props:{account_id:"",minimum_stake:"",stake:""}},IntegerOverflow:{name:"IntegerOverflow",subtypes:[],props:{}},InternalMemoryDeclared:{name:"InternalMemoryDeclared",subtypes:[],props:{}},InvalidAccessKeyError:{name:"InvalidAccessKeyError",subtypes:["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],props:{}},InvalidAccountId:{name:"InvalidAccountId",subtypes:[],props:{}},InvalidChain:{name:"InvalidChain",subtypes:[],props:{}},InvalidDataReceiverId:{name:"InvalidDataReceiverId",subtypes:[],props:{account_id:""}},InvalidIteratorIndex:{name:"InvalidIteratorIndex",subtypes:[],props:{iterator_index:""}},InvalidMethodName:{name:"InvalidMethodName",subtypes:[],props:{}},InvalidNonce:{name:"InvalidNonce",subtypes:[],props:{ak_nonce:"",tx_nonce:""}},InvalidPredecessorId:{name:"InvalidPredecessorId",subtypes:[],props:{account_id:""}},InvalidPromiseIndex:{name:"InvalidPromiseIndex",subtypes:[],props:{promise_idx:""}},InvalidPromiseResultIndex:{name:"InvalidPromiseResultIndex",subtypes:[],props:{result_idx:""}},InvalidPublicKey:{name:"InvalidPublicKey",subtypes:[],props:{}},InvalidReceiptIndex:{name:"InvalidReceiptIndex",subtypes:[],props:{receipt_index:""}},InvalidReceiverId:{name:"InvalidReceiverId",subtypes:[],props:{account_id:""}},InvalidRegisterId:{name:"InvalidRegisterId",subtypes:[],props:{register_id:""}},InvalidSignature:{name:"InvalidSignature",subtypes:[],props:{}},InvalidSignerId:{name:"InvalidSignerId",subtypes:[],props:{account_id:""}},InvalidTxError:{name:"InvalidTxError",subtypes:["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded","StorageError","ShardCongested","ShardStuck"],props:{}},IteratorWasInvalidated:{name:"IteratorWasInvalidated",subtypes:[],props:{iterator_index:""}},KeyLengthExceeded:{name:"KeyLengthExceeded",subtypes:[],props:{length:"",limit:""}},LackBalanceForState:{name:"LackBalanceForState",subtypes:[],props:{account_id:"",amount:""}},Memory:{name:"Memory",subtypes:[],props:{}},MemoryAccessViolation:{name:"MemoryAccessViolation",subtypes:[],props:{}},MemoryOutOfBounds:{name:"MemoryOutOfBounds",subtypes:[],props:{}},MethodEmptyName:{name:"MethodEmptyName",subtypes:[],props:{}},MethodInvalidSignature:{name:"MethodInvalidSignature",subtypes:[],props:{}},MethodNameMismatch:{name:"MethodNameMismatch",subtypes:[],props:{method_name:""}},MethodNotFound:{name:"MethodNotFound",subtypes:[],props:{}},MethodResolveError:{name:"MethodResolveError",subtypes:["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],props:{}},MisalignedAtomicAccess:{name:"MisalignedAtomicAccess",subtypes:[],props:{}},NonceTooLarge:{name:"NonceTooLarge",subtypes:[],props:{tx_nonce:"",upper_bound:""}},NotEnoughAllowance:{name:"NotEnoughAllowance",subtypes:[],props:{account_id:"",allowance:"",cost:"",public_key:""}},NotEnoughBalance:{name:"NotEnoughBalance",subtypes:[],props:{balance:"",cost:"",signer_id:""}},NumberInputDataDependenciesExceeded:{name:"NumberInputDataDependenciesExceeded",subtypes:[],props:{limit:"",number_of_input_data_dependencies:""}},NumberOfLogsExceeded:{name:"NumberOfLogsExceeded",subtypes:[],props:{limit:""}},NumberPromisesExceeded:{name:"NumberPromisesExceeded",subtypes:[],props:{limit:"",number_of_promises:""}},OnlyImplicitAccountCreationAllowed:{name:"OnlyImplicitAccountCreationAllowed",subtypes:[],props:{account_id:""}},PrepareError:{name:"PrepareError",subtypes:["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],props:{}},ProhibitedInView:{name:"ProhibitedInView",subtypes:[],props:{method_name:""}},ReceiptSizeExceeded:{name:"ReceiptSizeExceeded",subtypes:[],props:{limit:"",size:""}},ReceiptValidationError:{name:"ReceiptValidationError",subtypes:["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation","ReceiptSizeExceeded"],props:{}},ReceiverMismatch:{name:"ReceiverMismatch",subtypes:[],props:{ak_receiver:"",tx_receiver:""}},RequiresFullAccess:{name:"RequiresFullAccess",subtypes:[],props:{}},ReturnedValueLengthExceeded:{name:"ReturnedValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},Serialization:{name:"Serialization",subtypes:[],props:{}},ShardCongested:{name:"ShardCongested",subtypes:[],props:{congestion_level:"",shard_id:""}},ShardStuck:{name:"ShardStuck",subtypes:[],props:{missed_chunks:"",shard_id:""}},SignerDoesNotExist:{name:"SignerDoesNotExist",subtypes:[],props:{signer_id:""}},StackHeightInstrumentation:{name:"StackHeightInstrumentation",subtypes:[],props:{}},StackOverflow:{name:"StackOverflow",subtypes:[],props:{}},TooManyFunctions:{name:"TooManyFunctions",subtypes:[],props:{}},TooManyLocals:{name:"TooManyLocals",subtypes:[],props:{}},TotalLogLengthExceeded:{name:"TotalLogLengthExceeded",subtypes:[],props:{length:"",limit:""}},TotalNumberOfActionsExceeded:{name:"TotalNumberOfActionsExceeded",subtypes:[],props:{limit:"",total_number_of_actions:""}},TotalPrepaidGasExceeded:{name:"TotalPrepaidGasExceeded",subtypes:[],props:{limit:"",total_prepaid_gas:""}},TransactionSizeExceeded:{name:"TransactionSizeExceeded",subtypes:[],props:{limit:"",size:""}},TriesToStake:{name:"TriesToStake",subtypes:[],props:{account_id:"",balance:"",locked:"",stake:""}},TriesToUnstake:{name:"TriesToUnstake",subtypes:[],props:{account_id:""}},TxExecutionError:{name:"TxExecutionError",subtypes:["ActionError","InvalidTxError"],props:{}},Unreachable:{name:"Unreachable",subtypes:[],props:{}},UnsuitableStakingKey:{name:"UnsuitableStakingKey",subtypes:[],props:{public_key:""}},UnsupportedProtocolFeature:{name:"UnsupportedProtocolFeature",subtypes:[],props:{protocol_feature:"",version:""}},ValueLengthExceeded:{name:"ValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},WasmTrap:{name:"WasmTrap",subtypes:["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],props:{}},WasmerCompileError:{name:"WasmerCompileError",subtypes:[],props:{msg:""}},Closed:{name:"Closed",subtypes:[],props:{}},ServerError:{name:"ServerError",subtypes:["TxExecutionError","Timeout","Closed"],props:{}},Timeout:{name:"Timeout",subtypes:[],props:{}}}};function sn(){if(rn)return Bt;rn=1;var e=Bt&&Bt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.getErrorTypeFromErrorMessage=Bt.formatError=Bt.parseResultError=Bt.parseRpcError=Bt.ServerError=void 0;const t=Ht(),n=e(Yt()),r=nn(),i=Ct(),o=e(an),a={formatNear:()=>(e,t)=>(0,r.formatNearAmount)(t(e))};class s extends t.TypedError{}Bt.ServerError=s;class c extends s{transaction_outcome}function u(e){const t={},n=d(e,o.default.schema,t,""),r=new s(l(n,t),n);return Object.assign(r,t),r}function l(e,t){return"string"==typeof i.ErrorMessages[e]?n.default.render(i.ErrorMessages[e],{...t,...a}):JSON.stringify(t)}function d(e,t,n,r){let i,o,a;for(const n in t){if(h(e[n]))return e[n];if(f(e[n]))i=e[n],o=t[n],a=n;else{if(!f(e.kind)||!f(e.kind[n]))continue;i=e.kind[n],o=t[n],a=n}}if(i&&o){for(const e of Object.keys(o.props))n[e]=i[e];return d(i,t,n,a)}return n.kind=e,r}function f(e){return"[object Object]"===Object.prototype.toString.call(e)}function h(e){return"[object String]"===Object.prototype.toString.call(e)}return Bt.parseRpcError=u,Bt.parseResultError=function(e){const t=u(e.status.Failure),n=new c;return Object.assign(n,t),n.type=t.type,n.message=t.message,n.transaction_outcome=e.transaction_outcome,n},Bt.formatError=l,Bt.getErrorTypeFromErrorMessage=function(e,t){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(e):case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(e):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return t}},Bt}function cn(){return on||(on=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseRpcError=e.parseResultError=e.getErrorTypeFromErrorMessage=e.formatError=e.ServerError=e.ErrorMessages=void 0;var t=Ct();Object.defineProperty(e,"ErrorMessages",{enumerable:!0,get:function(){return t.ErrorMessages}});var n=sn();Object.defineProperty(e,"ServerError",{enumerable:!0,get:function(){return n.ServerError}}),Object.defineProperty(e,"formatError",{enumerable:!0,get:function(){return n.formatError}}),Object.defineProperty(e,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return n.getErrorTypeFromErrorMessage}}),Object.defineProperty(e,"parseResultError",{enumerable:!0,get:function(){return n.parseResultError}}),Object.defineProperty(e,"parseRpcError",{enumerable:!0,get:function(){return n.parseRpcError}})}(Nt)),Nt}var un,ln={},dn={},fn={};function hn(){if(un)return fn;un=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.ConsoleLogger=void 0;return fn.ConsoleLogger=class{logLevels;constructor(e){this.logLevels=e}isLevelEnabled=e=>this.logLevels.includes(e);print(e,t,...n){switch(e){case"error":case"fatal":return console.error(t,...n);case"warn":return console.warn(t,...n);case"log":return console.log(t,...n);case"debug":case"verbose":return console.debug(t,...n)}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}},fn}var pn,bn,mn,gn={};function vn(){return bn||(bn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Logger=e.ConsoleLogger=void 0;var t=hn();Object.defineProperty(e,"ConsoleLogger",{enumerable:!0,get:function(){return t.ConsoleLogger}});var n=function(){if(pn)return gn;pn=1,Object.defineProperty(gn,"__esModule",{value:!0}),gn.Logger=void 0;const e=new(hn().ConsoleLogger)(["verbose","debug","log","warn","error","fatal"]);return gn.Logger=class{static instanceRef=e;static overrideLogger=e=>{this.instanceRef=e};static error(e,...t){this.instanceRef?.error(e,...t)}static log(e,...t){this.instanceRef?.log(e,...t)}static warn(e,...t){this.instanceRef?.warn(e,...t)}static debug(e,...t){this.instanceRef?.debug?.(e,...t)}static verbose(e,...t){this.instanceRef?.verbose?.(e,...t)}static fatal(e,...t){this.instanceRef?.fatal?.(e,...t)}},gn}();Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return n.Logger}})}(dn)),dn}var yn,wn={};var xn,An,En={};
8
+ Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.createBase58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64urlnopad=e.base64url=e.base64nopad=e.base64=e.base32crockford=e.base32hexnopad=e.base32hex=e.base32nopad=e.base32=e.base16=e.utils=void 0;const m=(e,t)=>0===t?e:m(t,e%t),g=(e,t)=>e+(t-m(e,t)),v=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function y(e,t,n,r){if(s(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(g(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${g(t,n)}`);let i=0,o=0;const c=v[t],u=v[n]-1,l=[];for(const r of e){if(a(r),r>=c)throw new Error(`convertRadix2: invalid data word=${r} from=${t}`);if(i=i<<t|r,o+t>32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=n;o-=n)l.push((i>>o-n&u)>>>0);const e=v[o];if(void 0===e)throw new Error("invalid carry");i&=e-1}if(i=i<<n-o&u,!r&&o>=t)throw new Error("Excess padding");if(!r&&i>0)throw new Error(`Non-zero padding: ${i}`);return r&&o>0&&l.push(i>>>0),l}function w(e){a(e);return{encode:n=>{if(!t(n))throw new Error("radix.encode input should be Uint8Array");return b(Array.from(n),256,e)},decode:t=>(u("radix.decode",t),Uint8Array.from(b(t,e,256)))}}function x(e,n=!1){if(a(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(g(8,e)>32||g(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!t(r))throw new Error("radix2.encode input should be Uint8Array");return y(Array.from(r),8,e,!n)},decode:t=>(u("radix2.decode",t),Uint8Array.from(y(t,e,8,n)))}}function A(e){return i(e),function(...t){try{return e.apply(null,t)}catch(e){}}}function E(e,n){return a(e),i(n),{encode(r){if(!t(r))throw new Error("checksum.encode: input should be Uint8Array");const i=n(r).slice(0,e),o=new Uint8Array(r.length+e);return o.set(r),o.set(i,r.length),o},decode(r){if(!t(r))throw new Error("checksum.decode: input should be Uint8Array");const i=r.slice(0,-e),o=r.slice(-e),a=n(i).slice(0,e);for(let t=0;t<e;t++)if(a[t]!==o[t])throw new Error("Invalid checksum");return i}}}e.utils={alphabet:d,chain:l,checksum:E,convertRadix:b,convertRadix2:y,radix:w,radix2:x,join:f,padding:h},e.base16=l(x(4),d("0123456789ABCDEF"),f("")),e.base32=l(x(5),d("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),h(5),f("")),e.base32nopad=l(x(5),d("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),f("")),e.base32hex=l(x(5),d("0123456789ABCDEFGHIJKLMNOPQRSTUV"),h(5),f("")),e.base32hexnopad=l(x(5),d("0123456789ABCDEFGHIJKLMNOPQRSTUV"),f("")),e.base32crockford=l(x(5),d("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),f(""),p(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const S=(()=>"function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64)(),_=(e,t)=>{o("base64",e);const n=t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,r=t?"base64url":"base64";if(e.length>0&&!n.test(e))throw new Error("invalid base64");return Uint8Array.fromBase64(e,{alphabet:r,lastChunkHandling:"strict"})};e.base64=S?{encode:e=>(n(e),e.toBase64()),decode:e=>_(e,!1)}:l(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),h(6),f("")),e.base64nopad=l(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),f("")),e.base64url=S?{encode:e=>(n(e),e.toBase64({alphabet:"base64url"})),decode:e=>_(e,!0)}:l(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),h(6),f("")),e.base64urlnopad=l(x(6),d("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),f(""));const O=e=>l(w(58),d(e),f(""));e.base58=O("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=O("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=O("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const N=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(t){let n="";for(let r=0;r<t.length;r+=8){const i=t.subarray(r,r+8);n+=e.base58.encode(i).padStart(N[i.length],"1")}return n},decode(t){let n=[];for(let r=0;r<t.length;r+=11){const i=t.slice(r,r+11),o=N.indexOf(i.length),a=e.base58.decode(i);for(let e=0;e<a.length-o;e++)if(0!==a[e])throw new Error("base58xmr: wrong padding");n=n.concat(Array.from(a.slice(a.length-o)))}return Uint8Array.from(n)}};e.createBase58check=t=>l(E(4,e=>t(t(e))),e.base58),e.base58check=e.createBase58check;const k=l(d("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),f("")),T=[996825010,642813549,513874426,1027748829,705979059];function C(e){const t=e>>25;let n=(33554431&e)<<5;for(let e=0;e<T.length;e++)1==(t>>e&1)&&(n^=T[e]);return n}function I(e,t,n=1){const r=e.length;let i=1;for(let t=0;t<r;t++){const n=e.charCodeAt(t);if(n<33||n>126)throw new Error(`Invalid prefix (${e})`);i=C(i)^n>>5}i=C(i);for(let t=0;t<r;t++)i=C(i)^31&e.charCodeAt(t);for(let e of t)i=C(i)^e;for(let e=0;e<6;e++)i=C(i);return i^=n,k.encode(y([i%v[30]],30,5,!1))}function B(e){const n="bech32"===e?1:734539939,r=x(5),i=r.decode,a=r.encode,s=A(i);function c(e,r,i=90){o("bech32.encode prefix",e),t(r)&&(r=Array.from(r)),u("bech32.encode",r);const a=e.length;if(0===a)throw new TypeError(`Invalid prefix length ${a}`);const s=a+7+r.length;if(!1!==i&&s>i)throw new TypeError(`Length ${s} exceeds limit ${i}`);const c=e.toLowerCase(),l=I(c,r,n);return`${c}1${k.encode(r)}${l}`}function l(e,t=90){o("bech32.decode input",e);const r=e.length;if(r<8||!1!==t&&r>t)throw new TypeError(`invalid string length: ${r} (${e}). Expected (8..${t})`);const i=e.toLowerCase();if(e!==i&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const a=i.lastIndexOf("1");if(0===a||-1===a)throw new Error('Letter "1" must be present between prefix and data only');const s=i.slice(0,a),c=i.slice(a+1);if(c.length<6)throw new Error("Data must be at least 6 characters long");const u=k.decode(c).slice(0,-6),l=I(s,u,n);if(!c.endsWith(l))throw new Error(`Invalid checksum in ${e}: expected "${l}"`);return{prefix:s,words:u}}return{encode:c,decode:l,encodeFromBytes:function(e,t){return c(e,a(t))},decodeToBytes:function(e){const{prefix:t,words:n}=l(e,!1);return{prefix:t,words:n,bytes:i(n)}},decodeUnsafe:A(l),fromWords:i,fromWordsUnsafe:s,toWords:a}}e.bech32=B("bech32"),e.bech32m=B("bech32m"),e.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)};const L=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),M={encode:e=>(n(e),e.toHex()),decode:e=>(o("hex",e),Uint8Array.fromHex(e))};e.hex=L?M:l(x(4),d("0123456789abcdef"),f(""),p(e=>{if("string"!=typeof e||e.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));const R={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},P="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";e.bytesToString=(e,n)=>{if("string"!=typeof e||!R.hasOwnProperty(e))throw new TypeError(P);if(!t(n))throw new TypeError("bytesToString() expects Uint8Array");return R[e].encode(n)},e.str=e.bytesToString;e.stringToBytes=(e,t)=>{if(!R.hasOwnProperty(e))throw new TypeError(P);if("string"!=typeof t)throw new TypeError("stringToBytes() expects string");return R[e].decode(t)},e.bytes=e.stringToBytes}(tn)),tn}function rn(){return Qt||(Qt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.baseDecode=e.baseEncode=e.parseNearAmount=e.formatNearAmount=e.NEAR_NOMINATION=e.NEAR_NOMINATION_EXP=void 0;const t=nn();e.NEAR_NOMINATION_EXP=24,e.NEAR_NOMINATION=10n**BigInt(e.NEAR_NOMINATION_EXP);const n=[];for(let t=0,r=5n;t<e.NEAR_NOMINATION_EXP;t++,r*=10n)n[t]=r;e.formatNearAmount=function(t,r=e.NEAR_NOMINATION_EXP){let i=BigInt(t);if(r!==e.NEAR_NOMINATION_EXP){const t=e.NEAR_NOMINATION_EXP-r-1;t>0&&(i+=n[t])}const o=(t=i.toString()).substring(0,t.length-e.NEAR_NOMINATION_EXP)||"0",a=t.substring(t.length-e.NEAR_NOMINATION_EXP).padStart(e.NEAR_NOMINATION_EXP,"0").substring(0,r);return`${function(e){const t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}(o)}.${a}`.replace(/\.?0*$/,"")},e.parseNearAmount=function(t){if(!t)return null;const n=(t=t.replace(/,/g,"").trim()).split("."),r=n[0],i=n[1]||"";if(n.length>2||i.length>e.NEAR_NOMINATION_EXP)throw new Error(`Cannot parse '${t}' as NEAR amount`);return function(e){if(""===(e=e.replace(/^0+/,"")))return"0";return e}(r+i.padEnd(e.NEAR_NOMINATION_EXP,"0"))},e.baseEncode=function(e){if("string"==typeof e){const t=[];for(let n=0;n<e.length;n++)t.push(e.charCodeAt(n));e=new Uint8Array(t)}return t.base58.encode(e)},e.baseDecode=function(e){return t.base58.decode(e)}}(en)),en}var on,an,sn={schema:{AccessKeyNotFound:{name:"AccessKeyNotFound",subtypes:[],props:{account_id:"",public_key:""}},AccountAlreadyExists:{name:"AccountAlreadyExists",subtypes:[],props:{account_id:""}},AccountDoesNotExist:{name:"AccountDoesNotExist",subtypes:[],props:{account_id:""}},ActionError:{name:"ActionError",subtypes:["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],props:{index:""}},ActionsValidationError:{name:"ActionsValidationError",subtypes:["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],props:{}},ActorNoPermission:{name:"ActorNoPermission",subtypes:[],props:{account_id:"",actor_id:""}},AddKeyAlreadyExists:{name:"AddKeyAlreadyExists",subtypes:[],props:{account_id:"",public_key:""}},AddKeyMethodNameLengthExceeded:{name:"AddKeyMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},AddKeyMethodNamesNumberOfBytesExceeded:{name:"AddKeyMethodNamesNumberOfBytesExceeded",subtypes:[],props:{limit:"",total_number_of_bytes:""}},AltBn128InvalidInput:{name:"AltBn128InvalidInput",subtypes:[],props:{msg:""}},BadUTF16:{name:"BadUTF16",subtypes:[],props:{}},BadUTF8:{name:"BadUTF8",subtypes:[],props:{}},BalanceExceeded:{name:"BalanceExceeded",subtypes:[],props:{}},BalanceMismatchError:{name:"BalanceMismatchError",subtypes:[],props:{final_accounts_balance:"",final_postponed_receipts_balance:"",forwarded_buffered_receipts_balance:"",incoming_receipts_balance:"",incoming_validator_rewards:"",initial_accounts_balance:"",initial_postponed_receipts_balance:"",new_buffered_receipts_balance:"",new_delayed_receipts_balance:"",other_burnt_amount:"",outgoing_receipts_balance:"",processed_delayed_receipts_balance:"",slashed_burnt_amount:"",tx_burnt_amount:""}},CallIndirectOOB:{name:"CallIndirectOOB",subtypes:[],props:{}},CannotAppendActionToJointPromise:{name:"CannotAppendActionToJointPromise",subtypes:[],props:{}},CannotReturnJointPromise:{name:"CannotReturnJointPromise",subtypes:[],props:{}},CodeDoesNotExist:{name:"CodeDoesNotExist",subtypes:[],props:{account_id:""}},CompilationError:{name:"CompilationError",subtypes:["CodeDoesNotExist","PrepareError","WasmerCompileError"],props:{}},ContractSizeExceeded:{name:"ContractSizeExceeded",subtypes:[],props:{limit:"",size:""}},CostOverflow:{name:"CostOverflow",subtypes:[],props:{}},CreateAccountNotAllowed:{name:"CreateAccountNotAllowed",subtypes:[],props:{account_id:"",predecessor_id:""}},CreateAccountOnlyByRegistrar:{name:"CreateAccountOnlyByRegistrar",subtypes:[],props:{account_id:"",predecessor_id:"",registrar_account_id:""}},DelegateActionExpired:{name:"DelegateActionExpired",subtypes:[],props:{}},DelegateActionInvalidNonce:{name:"DelegateActionInvalidNonce",subtypes:[],props:{ak_nonce:"",delegate_nonce:""}},DelegateActionInvalidSignature:{name:"DelegateActionInvalidSignature",subtypes:[],props:{}},DelegateActionMustBeOnlyOne:{name:"DelegateActionMustBeOnlyOne",subtypes:[],props:{}},DelegateActionNonceTooLarge:{name:"DelegateActionNonceTooLarge",subtypes:[],props:{delegate_nonce:"",upper_bound:""}},DelegateActionSenderDoesNotMatchTxReceiver:{name:"DelegateActionSenderDoesNotMatchTxReceiver",subtypes:[],props:{receiver_id:"",sender_id:""}},DeleteAccountStaking:{name:"DeleteAccountStaking",subtypes:[],props:{account_id:""}},DeleteAccountWithLargeState:{name:"DeleteAccountWithLargeState",subtypes:[],props:{account_id:""}},DeleteActionMustBeFinal:{name:"DeleteActionMustBeFinal",subtypes:[],props:{}},DeleteKeyDoesNotExist:{name:"DeleteKeyDoesNotExist",subtypes:[],props:{account_id:"",public_key:""}},DepositWithFunctionCall:{name:"DepositWithFunctionCall",subtypes:[],props:{}},Deprecated:{name:"Deprecated",subtypes:[],props:{method_name:""}},Deserialization:{name:"Deserialization",subtypes:[],props:{}},ECRecoverError:{name:"ECRecoverError",subtypes:[],props:{msg:""}},Ed25519VerifyInvalidInput:{name:"Ed25519VerifyInvalidInput",subtypes:[],props:{msg:""}},EmptyMethodName:{name:"EmptyMethodName",subtypes:[],props:{}},Expired:{name:"Expired",subtypes:[],props:{}},FunctionCallArgumentsLengthExceeded:{name:"FunctionCallArgumentsLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallMethodNameLengthExceeded:{name:"FunctionCallMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallZeroAttachedGas:{name:"FunctionCallZeroAttachedGas",subtypes:[],props:{}},GasExceeded:{name:"GasExceeded",subtypes:[],props:{}},GasInstrumentation:{name:"GasInstrumentation",subtypes:[],props:{}},GasLimitExceeded:{name:"GasLimitExceeded",subtypes:[],props:{}},GenericTrap:{name:"GenericTrap",subtypes:[],props:{}},GuestPanic:{name:"GuestPanic",subtypes:[],props:{panic_msg:""}},HostError:{name:"HostError",subtypes:["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecoverError","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],props:{}},IllegalArithmetic:{name:"IllegalArithmetic",subtypes:[],props:{}},IncorrectCallIndirectSignature:{name:"IncorrectCallIndirectSignature",subtypes:[],props:{}},IndirectCallToNull:{name:"IndirectCallToNull",subtypes:[],props:{}},Instantiate:{name:"Instantiate",subtypes:[],props:{}},InsufficientStake:{name:"InsufficientStake",subtypes:[],props:{account_id:"",minimum_stake:"",stake:""}},IntegerOverflow:{name:"IntegerOverflow",subtypes:[],props:{}},InternalMemoryDeclared:{name:"InternalMemoryDeclared",subtypes:[],props:{}},InvalidAccessKeyError:{name:"InvalidAccessKeyError",subtypes:["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],props:{}},InvalidAccountId:{name:"InvalidAccountId",subtypes:[],props:{}},InvalidChain:{name:"InvalidChain",subtypes:[],props:{}},InvalidDataReceiverId:{name:"InvalidDataReceiverId",subtypes:[],props:{account_id:""}},InvalidIteratorIndex:{name:"InvalidIteratorIndex",subtypes:[],props:{iterator_index:""}},InvalidMethodName:{name:"InvalidMethodName",subtypes:[],props:{}},InvalidNonce:{name:"InvalidNonce",subtypes:[],props:{ak_nonce:"",tx_nonce:""}},InvalidPredecessorId:{name:"InvalidPredecessorId",subtypes:[],props:{account_id:""}},InvalidPromiseIndex:{name:"InvalidPromiseIndex",subtypes:[],props:{promise_idx:""}},InvalidPromiseResultIndex:{name:"InvalidPromiseResultIndex",subtypes:[],props:{result_idx:""}},InvalidPublicKey:{name:"InvalidPublicKey",subtypes:[],props:{}},InvalidReceiptIndex:{name:"InvalidReceiptIndex",subtypes:[],props:{receipt_index:""}},InvalidReceiverId:{name:"InvalidReceiverId",subtypes:[],props:{account_id:""}},InvalidRegisterId:{name:"InvalidRegisterId",subtypes:[],props:{register_id:""}},InvalidSignature:{name:"InvalidSignature",subtypes:[],props:{}},InvalidSignerId:{name:"InvalidSignerId",subtypes:[],props:{account_id:""}},InvalidTxError:{name:"InvalidTxError",subtypes:["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded","StorageError","ShardCongested","ShardStuck"],props:{}},IteratorWasInvalidated:{name:"IteratorWasInvalidated",subtypes:[],props:{iterator_index:""}},KeyLengthExceeded:{name:"KeyLengthExceeded",subtypes:[],props:{length:"",limit:""}},LackBalanceForState:{name:"LackBalanceForState",subtypes:[],props:{account_id:"",amount:""}},Memory:{name:"Memory",subtypes:[],props:{}},MemoryAccessViolation:{name:"MemoryAccessViolation",subtypes:[],props:{}},MemoryOutOfBounds:{name:"MemoryOutOfBounds",subtypes:[],props:{}},MethodEmptyName:{name:"MethodEmptyName",subtypes:[],props:{}},MethodInvalidSignature:{name:"MethodInvalidSignature",subtypes:[],props:{}},MethodNameMismatch:{name:"MethodNameMismatch",subtypes:[],props:{method_name:""}},MethodNotFound:{name:"MethodNotFound",subtypes:[],props:{}},MethodResolveError:{name:"MethodResolveError",subtypes:["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],props:{}},MisalignedAtomicAccess:{name:"MisalignedAtomicAccess",subtypes:[],props:{}},NonceTooLarge:{name:"NonceTooLarge",subtypes:[],props:{tx_nonce:"",upper_bound:""}},NotEnoughAllowance:{name:"NotEnoughAllowance",subtypes:[],props:{account_id:"",allowance:"",cost:"",public_key:""}},NotEnoughBalance:{name:"NotEnoughBalance",subtypes:[],props:{balance:"",cost:"",signer_id:""}},NumberInputDataDependenciesExceeded:{name:"NumberInputDataDependenciesExceeded",subtypes:[],props:{limit:"",number_of_input_data_dependencies:""}},NumberOfLogsExceeded:{name:"NumberOfLogsExceeded",subtypes:[],props:{limit:""}},NumberPromisesExceeded:{name:"NumberPromisesExceeded",subtypes:[],props:{limit:"",number_of_promises:""}},OnlyImplicitAccountCreationAllowed:{name:"OnlyImplicitAccountCreationAllowed",subtypes:[],props:{account_id:""}},PrepareError:{name:"PrepareError",subtypes:["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],props:{}},ProhibitedInView:{name:"ProhibitedInView",subtypes:[],props:{method_name:""}},ReceiptSizeExceeded:{name:"ReceiptSizeExceeded",subtypes:[],props:{limit:"",size:""}},ReceiptValidationError:{name:"ReceiptValidationError",subtypes:["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation","ReceiptSizeExceeded"],props:{}},ReceiverMismatch:{name:"ReceiverMismatch",subtypes:[],props:{ak_receiver:"",tx_receiver:""}},RequiresFullAccess:{name:"RequiresFullAccess",subtypes:[],props:{}},ReturnedValueLengthExceeded:{name:"ReturnedValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},Serialization:{name:"Serialization",subtypes:[],props:{}},ShardCongested:{name:"ShardCongested",subtypes:[],props:{congestion_level:"",shard_id:""}},ShardStuck:{name:"ShardStuck",subtypes:[],props:{missed_chunks:"",shard_id:""}},SignerDoesNotExist:{name:"SignerDoesNotExist",subtypes:[],props:{signer_id:""}},StackHeightInstrumentation:{name:"StackHeightInstrumentation",subtypes:[],props:{}},StackOverflow:{name:"StackOverflow",subtypes:[],props:{}},TooManyFunctions:{name:"TooManyFunctions",subtypes:[],props:{}},TooManyLocals:{name:"TooManyLocals",subtypes:[],props:{}},TotalLogLengthExceeded:{name:"TotalLogLengthExceeded",subtypes:[],props:{length:"",limit:""}},TotalNumberOfActionsExceeded:{name:"TotalNumberOfActionsExceeded",subtypes:[],props:{limit:"",total_number_of_actions:""}},TotalPrepaidGasExceeded:{name:"TotalPrepaidGasExceeded",subtypes:[],props:{limit:"",total_prepaid_gas:""}},TransactionSizeExceeded:{name:"TransactionSizeExceeded",subtypes:[],props:{limit:"",size:""}},TriesToStake:{name:"TriesToStake",subtypes:[],props:{account_id:"",balance:"",locked:"",stake:""}},TriesToUnstake:{name:"TriesToUnstake",subtypes:[],props:{account_id:""}},TxExecutionError:{name:"TxExecutionError",subtypes:["ActionError","InvalidTxError"],props:{}},Unreachable:{name:"Unreachable",subtypes:[],props:{}},UnsuitableStakingKey:{name:"UnsuitableStakingKey",subtypes:[],props:{public_key:""}},UnsupportedProtocolFeature:{name:"UnsupportedProtocolFeature",subtypes:[],props:{protocol_feature:"",version:""}},ValueLengthExceeded:{name:"ValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},WasmTrap:{name:"WasmTrap",subtypes:["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],props:{}},WasmerCompileError:{name:"WasmerCompileError",subtypes:[],props:{msg:""}},Closed:{name:"Closed",subtypes:[],props:{}},ServerError:{name:"ServerError",subtypes:["TxExecutionError","Timeout","Closed"],props:{}},Timeout:{name:"Timeout",subtypes:[],props:{}}}};function cn(){if(on)return Lt;on=1;var e=Lt&&Lt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.getErrorTypeFromErrorMessage=Lt.formatError=Lt.parseResultError=Lt.parseRpcError=Lt.ServerError=void 0;const t=Ht(),n=e(Jt()),r=rn(),i=It(),o=e(sn),a={formatNear:()=>(e,t)=>(0,r.formatNearAmount)(t(e))};class s extends t.TypedError{}Lt.ServerError=s;class c extends s{transaction_outcome}function u(e){const t={},n=d(e,o.default.schema,t,""),r=new s(l(n,t),n);return Object.assign(r,t),r}function l(e,t){return"string"==typeof i.ErrorMessages[e]?n.default.render(i.ErrorMessages[e],{...t,...a}):JSON.stringify(t)}function d(e,t,n,r){let i,o,a;for(const n in t){if(h(e[n]))return e[n];if(f(e[n]))i=e[n],o=t[n],a=n;else{if(!f(e.kind)||!f(e.kind[n]))continue;i=e.kind[n],o=t[n],a=n}}if(i&&o){for(const e of Object.keys(o.props))n[e]=i[e];return d(i,t,n,a)}return n.kind=e,r}function f(e){return"[object Object]"===Object.prototype.toString.call(e)}function h(e){return"[object String]"===Object.prototype.toString.call(e)}return Lt.parseRpcError=u,Lt.parseResultError=function(e){const t=u(e.status.Failure),n=new c;return Object.assign(n,t),n.type=t.type,n.message=t.message,n.transaction_outcome=e.transaction_outcome,n},Lt.formatError=l,Lt.getErrorTypeFromErrorMessage=function(e,t){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(e):case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(e):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return t}},Lt}function un(){return an||(an=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseRpcError=e.parseResultError=e.getErrorTypeFromErrorMessage=e.formatError=e.ServerError=e.ErrorMessages=void 0;var t=It();Object.defineProperty(e,"ErrorMessages",{enumerable:!0,get:function(){return t.ErrorMessages}});var n=cn();Object.defineProperty(e,"ServerError",{enumerable:!0,get:function(){return n.ServerError}}),Object.defineProperty(e,"formatError",{enumerable:!0,get:function(){return n.formatError}}),Object.defineProperty(e,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return n.getErrorTypeFromErrorMessage}}),Object.defineProperty(e,"parseResultError",{enumerable:!0,get:function(){return n.parseResultError}}),Object.defineProperty(e,"parseRpcError",{enumerable:!0,get:function(){return n.parseRpcError}})}(kt)),kt}var ln,dn={},fn={},hn={};function pn(){if(ln)return hn;ln=1,Object.defineProperty(hn,"__esModule",{value:!0}),hn.ConsoleLogger=void 0;return hn.ConsoleLogger=class{logLevels;constructor(e){this.logLevels=e}isLevelEnabled=e=>this.logLevels.includes(e);print(e,t,...n){switch(e){case"error":case"fatal":return console.error(t,...n);case"warn":return console.warn(t,...n);case"log":return console.log(t,...n);case"debug":case"verbose":return console.debug(t,...n)}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}},hn}var bn,mn,gn,vn={};function yn(){return mn||(mn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Logger=e.ConsoleLogger=void 0;var t=pn();Object.defineProperty(e,"ConsoleLogger",{enumerable:!0,get:function(){return t.ConsoleLogger}});var n=function(){if(bn)return vn;bn=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.Logger=void 0;const e=new(pn().ConsoleLogger)(["verbose","debug","log","warn","error","fatal"]);return vn.Logger=class{static instanceRef=e;static overrideLogger=e=>{this.instanceRef=e};static error(e,...t){this.instanceRef?.error(e,...t)}static log(e,...t){this.instanceRef?.log(e,...t)}static warn(e,...t){this.instanceRef?.warn(e,...t)}static debug(e,...t){this.instanceRef?.debug?.(e,...t)}static verbose(e,...t){this.instanceRef?.verbose?.(e,...t)}static fatal(e,...t){this.instanceRef?.fatal?.(e,...t)}},vn}();Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return n.Logger}})}(fn)),fn}var wn,xn={};var An,En,Sn={};
9
9
  /*!
10
10
  * depd
11
11
  * Copyright(c) 2015 Douglas Christopher Wilson
12
12
  * MIT Licensed
13
- */var Sn,_n,On,Nn={};function kn(){if(Sn)return Nn;return Sn=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.sortBigIntAsc=void 0,Nn.sortBigIntAsc=function(e,t){return e<t?-1:e>t?1:0},Nn}function Tn(){if(_n)return En;_n=1;var e=En&&En.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(En,"__esModule",{value:!0}),En.diffEpochValidators=En.findSeatPrice=void 0;const t=e(function(){if(An)return xn;function e(e,t){if("function"!=typeof e)throw new TypeError("argument fn must be a function");return e}function t(e,t,n){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("argument obj must be object");var r=Object.getOwnPropertyDescriptor(e,t);if(!r)throw new TypeError("must call property on owner object");if(!r.configurable)throw new TypeError("property must be configurable")}return An=1,xn=function(n){if(!n)throw new TypeError("argument namespace is required");function r(e){}return r._file=void 0,r._ignored=!0,r._namespace=n,r._traced=!1,r._warned=Object.create(null),r.function=e,r.property=t,r}}()),n=kn();return En.findSeatPrice=function(e,r,i,o){if(o&&o<49)return function(e,t){const r=e.map(e=>BigInt(e.stake)).sort(n.sortBigIntAsc),i=BigInt(t),o=r.reduce((e,t)=>e+t);if(o<i)throw new Error("Stakes are below seats");let a=1n,s=o+1n;for(;a!==s-1n;){const e=(a+s)/2n;let t=!1,n=0n;for(let o=0;o<r.length;++o)if(n+=r[o]/e,n>=i){a=e,t=!0;break}t||(s=e)}return a}(e,r);if(!i){(0,t.default)("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),i=[1,6250]}return function(e,t,r){if(2!=r.length)throw Error("minimumStakeRatio should have 2 elements");const i=e.map(e=>BigInt(e.stake)).sort(n.sortBigIntAsc),o=i.reduce((e,t)=>e+t);return e.length<t?o*BigInt(r[0])/BigInt(r[1]):i[0]+1n}(e,r,i)},En.diffEpochValidators=function(e,t){const n=new Map;e.forEach(e=>n.set(e.account_id,e));const r=new Set(t.map(e=>e.account_id));return{newValidators:t.filter(e=>!n.has(e.account_id)),removedValidators:e.filter(e=>!r.has(e.account_id)),changedValidators:t.filter(e=>n.has(e.account_id)&&n.get(e.account_id).stake!=e.stake).map(e=>({current:n.get(e.account_id),next:e}))}},En}function Cn(){return On||(On=1,e=St,t=St&&St.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=St&&St.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)},Object.defineProperty(e,"__esModule",{value:!0}),n((At||(At=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.DEFAULT_FUNCTION_CALL_GAS=void 0,_t.DEFAULT_FUNCTION_CALL_GAS=30000000000000n),_t),e),n(cn(),e),n(nn(),e),n(function(){if(mn)return ln;mn=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.printTxOutcomeLogs=ln.printTxOutcomeLogsAndFailures=void 0;const e=cn(),t=vn();function n({contractId:e,logs:n,prefix:r=""}){for(const i of n)t.Logger.log(`${r}Log [${e}]: ${i}`)}return ln.printTxOutcomeLogsAndFailures=function({contractId:r,outcome:i}){const o=[i.transaction_outcome,...i.receipts_outcome].reduce((t,n)=>{const r="object"==typeof n.outcome.status&&"object"==typeof n.outcome.status.Failure;return n.outcome.logs.length||r?t.concat({receiptIds:n.outcome.receipt_ids,logs:n.outcome.logs,failure:"object"==typeof n.outcome.status&&void 0!==n.outcome.status.Failure?(0,e.parseRpcError)(n.outcome.status.Failure):null}):t},[]);for(const e of o)t.Logger.log(`Receipt${e.receiptIds.length>1?"s":""}: ${e.receiptIds.join(", ")}`),n({contractId:r,logs:e.logs,prefix:"\t"}),e.failure&&t.Logger.warn(`\tFailure [${r}]: ${e.failure}`)},ln.printTxOutcomeLogs=n,ln}(),e),n((yn||(yn=1,Object.defineProperty(wn,"__esModule",{value:!0}),wn.getTransactionLastResult=void 0,wn.getTransactionLastResult=function(e){if("object"==typeof e.status&&"string"==typeof e.status.SuccessValue){const t=Buffer.from(e.status.SuccessValue,"base64").toString();try{return JSON.parse(t)}catch(e){return t}}return null}),wn),e),n(Tn(),e),n(vn(),e),n(kn(),e)),St;var e,t,n}var In,Bn={},Ln={},Mn={},Rn={};function Pn(){if(In)return Rn;function e(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function t(e,...t){if(!((n=e)instanceof Uint8Array||ArrayBuffer.isView(n)&&"Uint8Array"===n.constructor.name))throw new Error("Uint8Array expected");var n;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}return In=1,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.anumber=e,Rn.abytes=t,Rn.ahash=function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");e(t.outputLen),e(t.blockLen)},Rn.aexists=function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},Rn.aoutput=function(e,n){t(e);const r=n.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)},Rn}var Un,jn,Fn,Dn={},zn={};function $n(){return jn||(jn=1,function(e){
13
+ */var _n,On,Nn,kn={};function Tn(){if(_n)return kn;return _n=1,Object.defineProperty(kn,"__esModule",{value:!0}),kn.sortBigIntAsc=void 0,kn.sortBigIntAsc=function(e,t){return e<t?-1:e>t?1:0},kn}function Cn(){if(On)return Sn;On=1;var e=Sn&&Sn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.diffEpochValidators=Sn.findSeatPrice=void 0;const t=e(function(){if(En)return An;function e(e,t){if("function"!=typeof e)throw new TypeError("argument fn must be a function");return e}function t(e,t,n){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("argument obj must be object");var r=Object.getOwnPropertyDescriptor(e,t);if(!r)throw new TypeError("must call property on owner object");if(!r.configurable)throw new TypeError("property must be configurable")}return En=1,An=function(n){if(!n)throw new TypeError("argument namespace is required");function r(e){}return r._file=void 0,r._ignored=!0,r._namespace=n,r._traced=!1,r._warned=Object.create(null),r.function=e,r.property=t,r}}()),n=Tn();return Sn.findSeatPrice=function(e,r,i,o){if(o&&o<49)return function(e,t){const r=e.map(e=>BigInt(e.stake)).sort(n.sortBigIntAsc),i=BigInt(t),o=r.reduce((e,t)=>e+t);if(o<i)throw new Error("Stakes are below seats");let a=1n,s=o+1n;for(;a!==s-1n;){const e=(a+s)/2n;let t=!1,n=0n;for(let o=0;o<r.length;++o)if(n+=r[o]/e,n>=i){a=e,t=!0;break}t||(s=e)}return a}(e,r);if(!i){(0,t.default)("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),i=[1,6250]}return function(e,t,r){if(2!=r.length)throw Error("minimumStakeRatio should have 2 elements");const i=e.map(e=>BigInt(e.stake)).sort(n.sortBigIntAsc),o=i.reduce((e,t)=>e+t);return e.length<t?o*BigInt(r[0])/BigInt(r[1]):i[0]+1n}(e,r,i)},Sn.diffEpochValidators=function(e,t){const n=new Map;e.forEach(e=>n.set(e.account_id,e));const r=new Set(t.map(e=>e.account_id));return{newValidators:t.filter(e=>!n.has(e.account_id)),removedValidators:e.filter(e=>!r.has(e.account_id)),changedValidators:t.filter(e=>n.has(e.account_id)&&n.get(e.account_id).stake!=e.stake).map(e=>({current:n.get(e.account_id),next:e}))}},Sn}function In(){return Nn||(Nn=1,e=_t,t=_t&&_t.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=_t&&_t.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)},Object.defineProperty(e,"__esModule",{value:!0}),n((Et||(Et=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.DEFAULT_FUNCTION_CALL_GAS=void 0,Ot.DEFAULT_FUNCTION_CALL_GAS=30000000000000n),Ot),e),n(un(),e),n(rn(),e),n(function(){if(gn)return dn;gn=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.printTxOutcomeLogs=dn.printTxOutcomeLogsAndFailures=void 0;const e=un(),t=yn();function n({contractId:e,logs:n,prefix:r=""}){for(const i of n)t.Logger.log(`${r}Log [${e}]: ${i}`)}return dn.printTxOutcomeLogsAndFailures=function({contractId:r,outcome:i}){const o=[i.transaction_outcome,...i.receipts_outcome].reduce((t,n)=>{const r="object"==typeof n.outcome.status&&"object"==typeof n.outcome.status.Failure;return n.outcome.logs.length||r?t.concat({receiptIds:n.outcome.receipt_ids,logs:n.outcome.logs,failure:"object"==typeof n.outcome.status&&void 0!==n.outcome.status.Failure?(0,e.parseRpcError)(n.outcome.status.Failure):null}):t},[]);for(const e of o)t.Logger.log(`Receipt${e.receiptIds.length>1?"s":""}: ${e.receiptIds.join(", ")}`),n({contractId:r,logs:e.logs,prefix:"\t"}),e.failure&&t.Logger.warn(`\tFailure [${r}]: ${e.failure}`)},dn.printTxOutcomeLogs=n,dn}(),e),n((wn||(wn=1,Object.defineProperty(xn,"__esModule",{value:!0}),xn.getTransactionLastResult=void 0,xn.getTransactionLastResult=function(e){if("object"==typeof e.status&&"string"==typeof e.status.SuccessValue){const t=Buffer.from(e.status.SuccessValue,"base64").toString();try{return JSON.parse(t)}catch(e){return t}}return null}),xn),e),n(Cn(),e),n(yn(),e),n(Tn(),e)),_t;var e,t,n}var Bn,Ln={},Mn={},Rn={},Pn={};function Un(){if(Bn)return Pn;function e(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function t(e,...t){if(!((n=e)instanceof Uint8Array||ArrayBuffer.isView(n)&&"Uint8Array"===n.constructor.name))throw new Error("Uint8Array expected");var n;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}return Bn=1,Object.defineProperty(Pn,"__esModule",{value:!0}),Pn.anumber=e,Pn.abytes=t,Pn.ahash=function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");e(t.outputLen),e(t.blockLen)},Pn.aexists=function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},Pn.aoutput=function(e,n){t(e);const r=n.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)},Pn}var jn,Fn,Dn,zn={},$n={};function Wn(){return Fn||(Fn=1,function(e){
14
14
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
15
- Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.nextTick=e.byteSwapIfBE=e.isLE=void 0,e.isBytes=function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name},e.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},e.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},e.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},e.rotr=function(e,t){return e<<32-t|e>>>t},e.rotl=function(e,t){return e<<t|e>>>32-t>>>0},e.byteSwap=r,e.byteSwap32=function(e){for(let t=0;t<e.length;t++)e[t]=r(e[t])},e.bytesToHex=function(e){(0,n.abytes)(e);let t="";for(let n=0;n<e.length;n++)t+=i[e[n]];return t},e.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=a(e.charCodeAt(i)),o=a(e.charCodeAt(i+1));if(void 0===n||void 0===o){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}r[t]=16*n+o}return r},e.asyncLoop=async function(t,n,r){let i=Date.now();for(let o=0;o<t;o++){r(o);const t=Date.now()-i;t>=0&&t<n||(await(0,e.nextTick)(),i+=t)}},e.utf8ToBytes=s,e.toBytes=c,e.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){const i=e[r];(0,n.abytes)(i),t+=i.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r},e.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!=={}.toString.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},e.wrapConstructor=function(e){const t=t=>e().update(c(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t},e.wrapConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(c(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},e.wrapXOFConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(c(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},e.randomBytes=function(e=32){if(t.crypto&&"function"==typeof t.crypto.getRandomValues)return t.crypto.getRandomValues(new Uint8Array(e));if(t.crypto&&"function"==typeof t.crypto.randomBytes)return t.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const t=(Un||(Un=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.crypto=void 0,zn.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0),zn),n=Pn();function r(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}e.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],e.byteSwapIfBE=e.isLE?e=>e:e=>r(e);const i=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const o={_0:48,_9:57,A:65,F:70,a:97,f:102};function a(e){return e>=o._0&&e<=o._9?e-o._0:e>=o.A&&e<=o.F?e-(o.A-10):e>=o.a&&e<=o.f?e-(o.a-10):void 0}function s(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function c(e){return"string"==typeof e&&(e=s(e)),(0,n.abytes)(e),e}e.nextTick=async()=>{};e.Hash=class{clone(){return this._cloneInto()}}}(Dn)),Dn}function Wn(){if(Fn)return Mn;Fn=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.HashMD=void 0,Mn.setBigUint64=n,Mn.Chi=function(e,t,n){return e&t^~e&n},Mn.Maj=function(e,t,n){return e&t^e&n^t&n};const e=Pn(),t=$n();function n(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const i=BigInt(32),o=BigInt(4294967295),a=Number(n>>i&o),s=Number(n&o),c=r?4:0,u=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+u,s,r)}class r extends t.Hash{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,t.createView)(this.buffer)}update(n){(0,e.aexists)(this);const{view:r,buffer:i,blockLen:o}=this,a=(n=(0,t.toBytes)(n)).length;for(let e=0;e<a;){const s=Math.min(o-this.pos,a-e);if(s===o){const r=(0,t.createView)(n);for(;o<=a-e;e+=o)this.process(r,e);continue}i.set(n.subarray(e,e+s),this.pos),this.pos+=s,e+=s,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=n.length,this.roundClean(),this}digestInto(r){(0,e.aexists)(this),(0,e.aoutput)(r,this),this.finished=!0;const{buffer:i,view:o,blockLen:a,isLE:s}=this;let{pos:c}=this;i[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>a-c&&(this.process(o,0),c=0);for(let e=c;e<a;e++)i[e]=0;n(o,a-8,BigInt(8*this.length),s),this.process(o,0);const u=(0,t.createView)(r),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=l/4,f=this.get();if(d>f.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],s)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:i,destroyed:o,pos:a}=this;return e.length=r,e.pos=a,e.finished=i,e.destroyed=o,r%t&&e.buffer.set(n),e}}return Mn.HashMD=r,Mn}var qn,Xn,Kn={};function Hn(){if(qn)return Kn;qn=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.add5L=Kn.add5H=Kn.add4H=Kn.add4L=Kn.add3H=Kn.add3L=Kn.rotlBL=Kn.rotlBH=Kn.rotlSL=Kn.rotlSH=Kn.rotr32L=Kn.rotr32H=Kn.rotrBL=Kn.rotrBH=Kn.rotrSL=Kn.rotrSH=Kn.shrSL=Kn.shrSH=Kn.toBig=void 0,Kn.fromBig=n,Kn.split=r,Kn.add=g;const e=BigInt(2**32-1),t=BigInt(32);function n(n,r=!1){return r?{h:Number(n&e),l:Number(n>>t&e)}:{h:0|Number(n>>t&e),l:0|Number(n&e)}}function r(e,t=!1){let r=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:a,l:s}=n(e[o],t);[r[o],i[o]]=[a,s]}return[r,i]}const i=(e,n)=>BigInt(e>>>0)<<t|BigInt(n>>>0);Kn.toBig=i;const o=(e,t,n)=>e>>>n;Kn.shrSH=o;const a=(e,t,n)=>e<<32-n|t>>>n;Kn.shrSL=a;const s=(e,t,n)=>e>>>n|t<<32-n;Kn.rotrSH=s;const c=(e,t,n)=>e<<32-n|t>>>n;Kn.rotrSL=c;const u=(e,t,n)=>e<<64-n|t>>>n-32;Kn.rotrBH=u;const l=(e,t,n)=>e>>>n-32|t<<64-n;Kn.rotrBL=l;const d=(e,t)=>t;Kn.rotr32H=d;const f=(e,t)=>e;Kn.rotr32L=f;const h=(e,t,n)=>e<<n|t>>>32-n;Kn.rotlSH=h;const p=(e,t,n)=>t<<n|e>>>32-n;Kn.rotlSL=p;const b=(e,t,n)=>t<<n-32|e>>>64-n;Kn.rotlBH=b;const m=(e,t,n)=>e<<n-32|t>>>64-n;function g(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:0|i}}Kn.rotlBL=m;const v=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);Kn.add3L=v;const y=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;Kn.add3H=y;const w=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);Kn.add4L=w;const x=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0;Kn.add4H=x;const A=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0);Kn.add5L=A;const E=(e,t,n,r,i,o)=>t+n+r+i+o+(e/2**32|0)|0;Kn.add5H=E;const S={fromBig:n,split:r,toBig:i,shrSH:o,shrSL:a,rotrSH:s,rotrSL:c,rotrBH:u,rotrBL:l,rotr32H:d,rotr32L:f,rotlSH:h,rotlSL:p,rotlBH:b,rotlBL:m,add:g,add3L:v,add3H:y,add4L:w,add4H:x,add5H:E,add5L:A};return Kn.default=S,Kn}function Vn(){if(Xn)return Ln;Xn=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.sha384=Ln.sha512_256=Ln.sha512_224=Ln.sha512=Ln.SHA384=Ln.SHA512_256=Ln.SHA512_224=Ln.SHA512=void 0;const e=Wn(),t=Hn(),n=$n(),[r,i]=(()=>t.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),o=new Uint32Array(80),a=new Uint32Array(80);class s extends e.HashMD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:o,Dh:a,Dl:s,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:b}=this;return[e,t,n,r,i,o,a,s,c,u,l,d,f,h,p,b]}set(e,t,n,r,i,o,a,s,c,u,l,d,f,h,p,b){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|b}process(e,n){for(let t=0;t<16;t++,n+=4)o[t]=e.getUint32(n),a[t]=e.getUint32(n+=4);for(let e=16;e<80;e++){const n=0|o[e-15],r=0|a[e-15],i=t.default.rotrSH(n,r,1)^t.default.rotrSH(n,r,8)^t.default.shrSH(n,r,7),s=t.default.rotrSL(n,r,1)^t.default.rotrSL(n,r,8)^t.default.shrSL(n,r,7),c=0|o[e-2],u=0|a[e-2],l=t.default.rotrSH(c,u,19)^t.default.rotrBH(c,u,61)^t.default.shrSH(c,u,6),d=t.default.rotrSL(c,u,19)^t.default.rotrBL(c,u,61)^t.default.shrSL(c,u,6),f=t.default.add4L(s,d,a[e-7],a[e-16]),h=t.default.add4H(f,i,l,o[e-7],o[e-16]);o[e]=0|h,a[e]=0|f}let{Ah:s,Al:c,Bh:u,Bl:l,Ch:d,Cl:f,Dh:h,Dl:p,Eh:b,El:m,Fh:g,Fl:v,Gh:y,Gl:w,Hh:x,Hl:A}=this;for(let e=0;e<80;e++){const n=t.default.rotrSH(b,m,14)^t.default.rotrSH(b,m,18)^t.default.rotrBH(b,m,41),E=t.default.rotrSL(b,m,14)^t.default.rotrSL(b,m,18)^t.default.rotrBL(b,m,41),S=b&g^~b&y,_=m&v^~m&w,O=t.default.add5L(A,E,_,i[e],a[e]),N=t.default.add5H(O,x,n,S,r[e],o[e]),k=0|O,T=t.default.rotrSH(s,c,28)^t.default.rotrBH(s,c,34)^t.default.rotrBH(s,c,39),C=t.default.rotrSL(s,c,28)^t.default.rotrBL(s,c,34)^t.default.rotrBL(s,c,39),I=s&u^s&d^u&d,B=c&l^c&f^l&f;x=0|y,A=0|w,y=0|g,w=0|v,g=0|b,v=0|m,({h:b,l:m}=t.default.add(0|h,0|p,0|N,0|k)),h=0|d,p=0|f,d=0|u,f=0|l,u=0|s,l=0|c;const L=t.default.add3L(k,C,B);s=t.default.add3H(L,N,T,I),c=0|L}({h:s,l:c}=t.default.add(0|this.Ah,0|this.Al,0|s,0|c)),({h:u,l:l}=t.default.add(0|this.Bh,0|this.Bl,0|u,0|l)),({h:d,l:f}=t.default.add(0|this.Ch,0|this.Cl,0|d,0|f)),({h:h,l:p}=t.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:b,l:m}=t.default.add(0|this.Eh,0|this.El,0|b,0|m)),({h:g,l:v}=t.default.add(0|this.Fh,0|this.Fl,0|g,0|v)),({h:y,l:w}=t.default.add(0|this.Gh,0|this.Gl,0|y,0|w)),({h:x,l:A}=t.default.add(0|this.Hh,0|this.Hl,0|x,0|A)),this.set(s,c,u,l,d,f,h,p,b,m,g,v,y,w,x,A)}roundClean(){o.fill(0),a.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Ln.SHA512=s;class c extends s{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}Ln.SHA512_224=c;class u extends s{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}Ln.SHA512_256=u;class l extends s{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}return Ln.SHA384=l,Ln.sha512=(0,n.wrapConstructor)(()=>new s),Ln.sha512_224=(0,n.wrapConstructor)(()=>new c),Ln.sha512_256=(0,n.wrapConstructor)(()=>new u),Ln.sha384=(0,n.wrapConstructor)(()=>new l),Ln}var Gn,Yn,Jn,Zn={},Qn={},er={};function tr(){if(Gn)return er;Gn=1,
15
+ Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.nextTick=e.byteSwapIfBE=e.isLE=void 0,e.isBytes=function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name},e.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},e.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},e.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},e.rotr=function(e,t){return e<<32-t|e>>>t},e.rotl=function(e,t){return e<<t|e>>>32-t>>>0},e.byteSwap=r,e.byteSwap32=function(e){for(let t=0;t<e.length;t++)e[t]=r(e[t])},e.bytesToHex=function(e){(0,n.abytes)(e);let t="";for(let n=0;n<e.length;n++)t+=i[e[n]];return t},e.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=a(e.charCodeAt(i)),o=a(e.charCodeAt(i+1));if(void 0===n||void 0===o){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}r[t]=16*n+o}return r},e.asyncLoop=async function(t,n,r){let i=Date.now();for(let o=0;o<t;o++){r(o);const t=Date.now()-i;t>=0&&t<n||(await(0,e.nextTick)(),i+=t)}},e.utf8ToBytes=s,e.toBytes=c,e.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){const i=e[r];(0,n.abytes)(i),t+=i.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r},e.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!=={}.toString.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},e.wrapConstructor=function(e){const t=t=>e().update(c(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t},e.wrapConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(c(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},e.wrapXOFConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(c(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},e.randomBytes=function(e=32){if(t.crypto&&"function"==typeof t.crypto.getRandomValues)return t.crypto.getRandomValues(new Uint8Array(e));if(t.crypto&&"function"==typeof t.crypto.randomBytes)return t.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const t=(jn||(jn=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.crypto=void 0,$n.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0),$n),n=Un();function r(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}e.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],e.byteSwapIfBE=e.isLE?e=>e:e=>r(e);const i=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const o={_0:48,_9:57,A:65,F:70,a:97,f:102};function a(e){return e>=o._0&&e<=o._9?e-o._0:e>=o.A&&e<=o.F?e-(o.A-10):e>=o.a&&e<=o.f?e-(o.a-10):void 0}function s(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function c(e){return"string"==typeof e&&(e=s(e)),(0,n.abytes)(e),e}e.nextTick=async()=>{};e.Hash=class{clone(){return this._cloneInto()}}}(zn)),zn}function Xn(){if(Dn)return Rn;Dn=1,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.HashMD=void 0,Rn.setBigUint64=n,Rn.Chi=function(e,t,n){return e&t^~e&n},Rn.Maj=function(e,t,n){return e&t^e&n^t&n};const e=Un(),t=Wn();function n(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const i=BigInt(32),o=BigInt(4294967295),a=Number(n>>i&o),s=Number(n&o),c=r?4:0,u=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+u,s,r)}class r extends t.Hash{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,t.createView)(this.buffer)}update(n){(0,e.aexists)(this);const{view:r,buffer:i,blockLen:o}=this,a=(n=(0,t.toBytes)(n)).length;for(let e=0;e<a;){const s=Math.min(o-this.pos,a-e);if(s===o){const r=(0,t.createView)(n);for(;o<=a-e;e+=o)this.process(r,e);continue}i.set(n.subarray(e,e+s),this.pos),this.pos+=s,e+=s,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=n.length,this.roundClean(),this}digestInto(r){(0,e.aexists)(this),(0,e.aoutput)(r,this),this.finished=!0;const{buffer:i,view:o,blockLen:a,isLE:s}=this;let{pos:c}=this;i[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>a-c&&(this.process(o,0),c=0);for(let e=c;e<a;e++)i[e]=0;n(o,a-8,BigInt(8*this.length),s),this.process(o,0);const u=(0,t.createView)(r),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=l/4,f=this.get();if(d>f.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],s)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:i,destroyed:o,pos:a}=this;return e.length=r,e.pos=a,e.finished=i,e.destroyed=o,r%t&&e.buffer.set(n),e}}return Rn.HashMD=r,Rn}var qn,Kn,Gn={};function Hn(){if(qn)return Gn;qn=1,Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.add5L=Gn.add5H=Gn.add4H=Gn.add4L=Gn.add3H=Gn.add3L=Gn.rotlBL=Gn.rotlBH=Gn.rotlSL=Gn.rotlSH=Gn.rotr32L=Gn.rotr32H=Gn.rotrBL=Gn.rotrBH=Gn.rotrSL=Gn.rotrSH=Gn.shrSL=Gn.shrSH=Gn.toBig=void 0,Gn.fromBig=n,Gn.split=r,Gn.add=g;const e=BigInt(2**32-1),t=BigInt(32);function n(n,r=!1){return r?{h:Number(n&e),l:Number(n>>t&e)}:{h:0|Number(n>>t&e),l:0|Number(n&e)}}function r(e,t=!1){let r=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:a,l:s}=n(e[o],t);[r[o],i[o]]=[a,s]}return[r,i]}const i=(e,n)=>BigInt(e>>>0)<<t|BigInt(n>>>0);Gn.toBig=i;const o=(e,t,n)=>e>>>n;Gn.shrSH=o;const a=(e,t,n)=>e<<32-n|t>>>n;Gn.shrSL=a;const s=(e,t,n)=>e>>>n|t<<32-n;Gn.rotrSH=s;const c=(e,t,n)=>e<<32-n|t>>>n;Gn.rotrSL=c;const u=(e,t,n)=>e<<64-n|t>>>n-32;Gn.rotrBH=u;const l=(e,t,n)=>e>>>n-32|t<<64-n;Gn.rotrBL=l;const d=(e,t)=>t;Gn.rotr32H=d;const f=(e,t)=>e;Gn.rotr32L=f;const h=(e,t,n)=>e<<n|t>>>32-n;Gn.rotlSH=h;const p=(e,t,n)=>t<<n|e>>>32-n;Gn.rotlSL=p;const b=(e,t,n)=>t<<n-32|e>>>64-n;Gn.rotlBH=b;const m=(e,t,n)=>e<<n-32|t>>>64-n;function g(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:0|i}}Gn.rotlBL=m;const v=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);Gn.add3L=v;const y=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;Gn.add3H=y;const w=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);Gn.add4L=w;const x=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0;Gn.add4H=x;const A=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0);Gn.add5L=A;const E=(e,t,n,r,i,o)=>t+n+r+i+o+(e/2**32|0)|0;Gn.add5H=E;const S={fromBig:n,split:r,toBig:i,shrSH:o,shrSL:a,rotrSH:s,rotrSL:c,rotrBH:u,rotrBL:l,rotr32H:d,rotr32L:f,rotlSH:h,rotlSL:p,rotlBH:b,rotlBL:m,add:g,add3L:v,add3H:y,add4L:w,add4H:x,add5H:E,add5L:A};return Gn.default=S,Gn}function Vn(){if(Kn)return Mn;Kn=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.sha384=Mn.sha512_256=Mn.sha512_224=Mn.sha512=Mn.SHA384=Mn.SHA512_256=Mn.SHA512_224=Mn.SHA512=void 0;const e=Xn(),t=Hn(),n=Wn(),[r,i]=(()=>t.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),o=new Uint32Array(80),a=new Uint32Array(80);class s extends e.HashMD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:o,Dh:a,Dl:s,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:b}=this;return[e,t,n,r,i,o,a,s,c,u,l,d,f,h,p,b]}set(e,t,n,r,i,o,a,s,c,u,l,d,f,h,p,b){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|b}process(e,n){for(let t=0;t<16;t++,n+=4)o[t]=e.getUint32(n),a[t]=e.getUint32(n+=4);for(let e=16;e<80;e++){const n=0|o[e-15],r=0|a[e-15],i=t.default.rotrSH(n,r,1)^t.default.rotrSH(n,r,8)^t.default.shrSH(n,r,7),s=t.default.rotrSL(n,r,1)^t.default.rotrSL(n,r,8)^t.default.shrSL(n,r,7),c=0|o[e-2],u=0|a[e-2],l=t.default.rotrSH(c,u,19)^t.default.rotrBH(c,u,61)^t.default.shrSH(c,u,6),d=t.default.rotrSL(c,u,19)^t.default.rotrBL(c,u,61)^t.default.shrSL(c,u,6),f=t.default.add4L(s,d,a[e-7],a[e-16]),h=t.default.add4H(f,i,l,o[e-7],o[e-16]);o[e]=0|h,a[e]=0|f}let{Ah:s,Al:c,Bh:u,Bl:l,Ch:d,Cl:f,Dh:h,Dl:p,Eh:b,El:m,Fh:g,Fl:v,Gh:y,Gl:w,Hh:x,Hl:A}=this;for(let e=0;e<80;e++){const n=t.default.rotrSH(b,m,14)^t.default.rotrSH(b,m,18)^t.default.rotrBH(b,m,41),E=t.default.rotrSL(b,m,14)^t.default.rotrSL(b,m,18)^t.default.rotrBL(b,m,41),S=b&g^~b&y,_=m&v^~m&w,O=t.default.add5L(A,E,_,i[e],a[e]),N=t.default.add5H(O,x,n,S,r[e],o[e]),k=0|O,T=t.default.rotrSH(s,c,28)^t.default.rotrBH(s,c,34)^t.default.rotrBH(s,c,39),C=t.default.rotrSL(s,c,28)^t.default.rotrBL(s,c,34)^t.default.rotrBL(s,c,39),I=s&u^s&d^u&d,B=c&l^c&f^l&f;x=0|y,A=0|w,y=0|g,w=0|v,g=0|b,v=0|m,({h:b,l:m}=t.default.add(0|h,0|p,0|N,0|k)),h=0|d,p=0|f,d=0|u,f=0|l,u=0|s,l=0|c;const L=t.default.add3L(k,C,B);s=t.default.add3H(L,N,T,I),c=0|L}({h:s,l:c}=t.default.add(0|this.Ah,0|this.Al,0|s,0|c)),({h:u,l:l}=t.default.add(0|this.Bh,0|this.Bl,0|u,0|l)),({h:d,l:f}=t.default.add(0|this.Ch,0|this.Cl,0|d,0|f)),({h:h,l:p}=t.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:b,l:m}=t.default.add(0|this.Eh,0|this.El,0|b,0|m)),({h:g,l:v}=t.default.add(0|this.Fh,0|this.Fl,0|g,0|v)),({h:y,l:w}=t.default.add(0|this.Gh,0|this.Gl,0|y,0|w)),({h:x,l:A}=t.default.add(0|this.Hh,0|this.Hl,0|x,0|A)),this.set(s,c,u,l,d,f,h,p,b,m,g,v,y,w,x,A)}roundClean(){o.fill(0),a.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Mn.SHA512=s;class c extends s{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}Mn.SHA512_224=c;class u extends s{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}Mn.SHA512_256=u;class l extends s{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}return Mn.SHA384=l,Mn.sha512=(0,n.wrapConstructor)(()=>new s),Mn.sha512_224=(0,n.wrapConstructor)(()=>new c),Mn.sha512_256=(0,n.wrapConstructor)(()=>new u),Mn.sha384=(0,n.wrapConstructor)(()=>new l),Mn}var Yn,Jn,Zn,Qn={},er={},tr={};function nr(){if(Yn)return tr;Yn=1,
16
16
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
17
- Object.defineProperty(er,"__esModule",{value:!0}),er.notImplemented=er.bitMask=void 0,er.isBytes=r,er.abytes=i,er.abool=function(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)},er.bytesToHex=a,er.numberToHexUnpadded=s,er.hexToNumber=c,er.hexToBytes=d,er.bytesToNumberBE=function(e){return c(a(e))},er.bytesToNumberLE=function(e){return i(e),c(a(Uint8Array.from(e).reverse()))},er.numberToBytesBE=f,er.numberToBytesLE=function(e,t){return f(e,t).reverse()},er.numberToVarBytesBE=function(e){return d(s(e))},er.ensureBytes=function(e,t,n){let i;if("string"==typeof t)try{i=d(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!r(t))throw new Error(e+" must be hex string or Uint8Array");i=Uint8Array.from(t)}const o=i.length;if("number"==typeof n&&o!==n)throw new Error(e+" of length "+n+" expected, got "+o);return i},er.concatBytes=h,er.equalBytes=function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n},er.utf8ToBytes=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))},er.inRange=b,er.aInRange=function(e,t,n,r){if(!b(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)},er.bitLen=function(n){let r;for(r=0;n>e;n>>=t,r+=1);return r},er.bitGet=function(e,n){return e>>BigInt(n)&t},er.bitSet=function(n,r,i){return n|(i?t:e)<<BigInt(r)},er.createHmacDrbg=function(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");let r=m(e),i=m(e),o=0;const a=()=>{r.fill(1),i.fill(0),o=0},s=(...e)=>n(i,r,...e),c=(e=m())=>{i=s(g([0]),e),r=s(),0!==e.length&&(i=s(g([1]),e),r=s())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e<t;){r=s();const t=r.slice();n.push(t),e+=r.length}return h(...n)};return(e,t)=>{let n;for(a(),c(e);!(n=t(u()));)c();return a(),n}},er.validateObject=function(e,t,n={}){const r=(t,n,r)=>{const i=v[n];if("function"!=typeof i)throw new Error("invalid validator function");const o=e[t];if(!(r&&void 0===o||i(o,e)))throw new Error("param "+String(t)+" is invalid. Expected "+n+", got "+o)};for(const[e,n]of Object.entries(t))r(e,n,!1);for(const[e,t]of Object.entries(n))r(e,t,!0);return e},er.memoized=function(e){const t=new WeakMap;return(n,...r)=>{const i=t.get(n);if(void 0!==i)return i;const o=e(n,...r);return t.set(n,o),o}};const e=BigInt(0),t=BigInt(1),n=BigInt(2);function r(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function i(e){if(!r(e))throw new Error("Uint8Array expected")}const o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function a(e){i(e);let t="";for(let n=0;n<e.length;n++)t+=o[e[n]];return t}function s(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function c(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return""===t?e:BigInt("0x"+t)}const u={_0:48,_9:57,A:65,F:70,a:97,f:102};function l(e){return e>=u._0&&e<=u._9?e-u._0:e>=u.A&&e<=u.F?e-(u.A-10):e>=u.a&&e<=u.f?e-(u.a-10):void 0}function d(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=l(e.charCodeAt(i)),o=l(e.charCodeAt(i+1));if(void 0===n||void 0===o){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}r[t]=16*n+o}return r}function f(e,t){return d(e.toString(16).padStart(2*t,"0"))}function h(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];i(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n}const p=t=>"bigint"==typeof t&&e<=t;function b(e,t,n){return p(e)&&p(t)&&p(n)&&t<=e&&e<n}er.bitMask=e=>(n<<BigInt(e-1))-t;const m=e=>new Uint8Array(e),g=e=>Uint8Array.from(e);const v={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||r(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};return er.notImplemented=()=>{throw new Error("not implemented")},er}function nr(){if(Yn)return Qn;Yn=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.isNegativeLE=void 0,Qn.mod=c,Qn.pow=u,Qn.pow2=function(e,n,r){let i=e;for(;n-- >t;)i*=i,i%=r;return i},Qn.invert=l,Qn.tonelliShanks=d,Qn.FpSqrt=f,Qn.validateField=function(t){const n=h.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,e.validateObject)(t,n)},Qn.FpPow=p,Qn.FpInvertBatch=b,Qn.FpDiv=function(e,t,n){return e.mul(t,"bigint"==typeof n?l(n,e.ORDER):e.inv(n))},Qn.FpLegendre=m,Qn.FpIsSquare=function(e){const t=m(e.ORDER);return n=>{const r=t(e,n);return e.eql(r,e.ZERO)||e.eql(r,e.ONE)}},Qn.nLength=g,Qn.Field=function(r,i,o=!1,a={}){if(r<=t)throw new Error("invalid field: expected ORDER > 0, got "+r);const{nBitLength:s,nByteLength:u}=g(r,i);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let d;const h=Object.freeze({ORDER:r,isLE:o,BITS:s,BYTES:u,MASK:(0,e.bitMask)(s),ZERO:t,ONE:n,create:e=>c(e,r),isValid:e=>{if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return t<=e&&e<r},is0:e=>e===t,isOdd:e=>(e&n)===n,neg:e=>c(-e,r),eql:(e,t)=>e===t,sqr:e=>c(e*e,r),add:(e,t)=>c(e+t,r),sub:(e,t)=>c(e-t,r),mul:(e,t)=>c(e*t,r),pow:(e,t)=>p(h,e,t),div:(e,t)=>c(e*l(t,r),r),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:e=>l(e,r),sqrt:a.sqrt||(e=>(d||(d=f(r)),d(h,e))),invertBatch:e=>b(h,e),cmov:(e,t,n)=>n?t:e,toBytes:t=>o?(0,e.numberToBytesLE)(t,u):(0,e.numberToBytesBE)(t,u),fromBytes:t=>{if(t.length!==u)throw new Error("Field.fromBytes: expected "+u+" bytes, got "+t.length);return o?(0,e.bytesToNumberLE)(t):(0,e.bytesToNumberBE)(t)}});return Object.freeze(h)},Qn.FpSqrtOdd=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?n:e.neg(n)},Qn.FpSqrtEven=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?e.neg(n):n},Qn.hashToPrivateScalar=function(t,r,i=!1){t=(0,e.ensureBytes)("privateHash",t);const o=t.length,a=g(r).nByteLength+8;if(a<24||o<a||o>1024)throw new Error("hashToPrivateScalar: expected "+a+"-1024 bytes of input, got "+o);const s=i?(0,e.bytesToNumberLE)(t):(0,e.bytesToNumberBE)(t);return c(s,r-n)+n},Qn.getFieldBytesLength=v,Qn.getMinHashLength=y,Qn.mapHashToField=function(t,r,i=!1){const o=t.length,a=v(r),s=y(r);if(o<16||o<s||o>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+o);const u=i?(0,e.bytesToNumberLE)(t):(0,e.bytesToNumberBE)(t),l=c(u,r-n)+n;return i?(0,e.numberToBytesLE)(l,a):(0,e.numberToBytesBE)(l,a)};
17
+ Object.defineProperty(tr,"__esModule",{value:!0}),tr.notImplemented=tr.bitMask=void 0,tr.isBytes=r,tr.abytes=i,tr.abool=function(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)},tr.bytesToHex=a,tr.numberToHexUnpadded=s,tr.hexToNumber=c,tr.hexToBytes=d,tr.bytesToNumberBE=function(e){return c(a(e))},tr.bytesToNumberLE=function(e){return i(e),c(a(Uint8Array.from(e).reverse()))},tr.numberToBytesBE=f,tr.numberToBytesLE=function(e,t){return f(e,t).reverse()},tr.numberToVarBytesBE=function(e){return d(s(e))},tr.ensureBytes=function(e,t,n){let i;if("string"==typeof t)try{i=d(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!r(t))throw new Error(e+" must be hex string or Uint8Array");i=Uint8Array.from(t)}const o=i.length;if("number"==typeof n&&o!==n)throw new Error(e+" of length "+n+" expected, got "+o);return i},tr.concatBytes=h,tr.equalBytes=function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n},tr.utf8ToBytes=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))},tr.inRange=b,tr.aInRange=function(e,t,n,r){if(!b(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)},tr.bitLen=function(n){let r;for(r=0;n>e;n>>=t,r+=1);return r},tr.bitGet=function(e,n){return e>>BigInt(n)&t},tr.bitSet=function(n,r,i){return n|(i?t:e)<<BigInt(r)},tr.createHmacDrbg=function(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");let r=m(e),i=m(e),o=0;const a=()=>{r.fill(1),i.fill(0),o=0},s=(...e)=>n(i,r,...e),c=(e=m())=>{i=s(g([0]),e),r=s(),0!==e.length&&(i=s(g([1]),e),r=s())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e<t;){r=s();const t=r.slice();n.push(t),e+=r.length}return h(...n)};return(e,t)=>{let n;for(a(),c(e);!(n=t(u()));)c();return a(),n}},tr.validateObject=function(e,t,n={}){const r=(t,n,r)=>{const i=v[n];if("function"!=typeof i)throw new Error("invalid validator function");const o=e[t];if(!(r&&void 0===o||i(o,e)))throw new Error("param "+String(t)+" is invalid. Expected "+n+", got "+o)};for(const[e,n]of Object.entries(t))r(e,n,!1);for(const[e,t]of Object.entries(n))r(e,t,!0);return e},tr.memoized=function(e){const t=new WeakMap;return(n,...r)=>{const i=t.get(n);if(void 0!==i)return i;const o=e(n,...r);return t.set(n,o),o}};const e=BigInt(0),t=BigInt(1),n=BigInt(2);function r(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function i(e){if(!r(e))throw new Error("Uint8Array expected")}const o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function a(e){i(e);let t="";for(let n=0;n<e.length;n++)t+=o[e[n]];return t}function s(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function c(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return""===t?e:BigInt("0x"+t)}const u={_0:48,_9:57,A:65,F:70,a:97,f:102};function l(e){return e>=u._0&&e<=u._9?e-u._0:e>=u.A&&e<=u.F?e-(u.A-10):e>=u.a&&e<=u.f?e-(u.a-10):void 0}function d(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=l(e.charCodeAt(i)),o=l(e.charCodeAt(i+1));if(void 0===n||void 0===o){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}r[t]=16*n+o}return r}function f(e,t){return d(e.toString(16).padStart(2*t,"0"))}function h(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];i(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n}const p=t=>"bigint"==typeof t&&e<=t;function b(e,t,n){return p(e)&&p(t)&&p(n)&&t<=e&&e<n}tr.bitMask=e=>(n<<BigInt(e-1))-t;const m=e=>new Uint8Array(e),g=e=>Uint8Array.from(e);const v={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||r(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};return tr.notImplemented=()=>{throw new Error("not implemented")},tr}function rr(){if(Jn)return er;Jn=1,Object.defineProperty(er,"__esModule",{value:!0}),er.isNegativeLE=void 0,er.mod=c,er.pow=u,er.pow2=function(e,n,r){let i=e;for(;n-- >t;)i*=i,i%=r;return i},er.invert=l,er.tonelliShanks=d,er.FpSqrt=f,er.validateField=function(t){const n=h.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,e.validateObject)(t,n)},er.FpPow=p,er.FpInvertBatch=b,er.FpDiv=function(e,t,n){return e.mul(t,"bigint"==typeof n?l(n,e.ORDER):e.inv(n))},er.FpLegendre=m,er.FpIsSquare=function(e){const t=m(e.ORDER);return n=>{const r=t(e,n);return e.eql(r,e.ZERO)||e.eql(r,e.ONE)}},er.nLength=g,er.Field=function(r,i,o=!1,a={}){if(r<=t)throw new Error("invalid field: expected ORDER > 0, got "+r);const{nBitLength:s,nByteLength:u}=g(r,i);if(u>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let d;const h=Object.freeze({ORDER:r,isLE:o,BITS:s,BYTES:u,MASK:(0,e.bitMask)(s),ZERO:t,ONE:n,create:e=>c(e,r),isValid:e=>{if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return t<=e&&e<r},is0:e=>e===t,isOdd:e=>(e&n)===n,neg:e=>c(-e,r),eql:(e,t)=>e===t,sqr:e=>c(e*e,r),add:(e,t)=>c(e+t,r),sub:(e,t)=>c(e-t,r),mul:(e,t)=>c(e*t,r),pow:(e,t)=>p(h,e,t),div:(e,t)=>c(e*l(t,r),r),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:e=>l(e,r),sqrt:a.sqrt||(e=>(d||(d=f(r)),d(h,e))),invertBatch:e=>b(h,e),cmov:(e,t,n)=>n?t:e,toBytes:t=>o?(0,e.numberToBytesLE)(t,u):(0,e.numberToBytesBE)(t,u),fromBytes:t=>{if(t.length!==u)throw new Error("Field.fromBytes: expected "+u+" bytes, got "+t.length);return o?(0,e.bytesToNumberLE)(t):(0,e.bytesToNumberBE)(t)}});return Object.freeze(h)},er.FpSqrtOdd=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?n:e.neg(n)},er.FpSqrtEven=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?e.neg(n):n},er.hashToPrivateScalar=function(t,r,i=!1){t=(0,e.ensureBytes)("privateHash",t);const o=t.length,a=g(r).nByteLength+8;if(a<24||o<a||o>1024)throw new Error("hashToPrivateScalar: expected "+a+"-1024 bytes of input, got "+o);const s=i?(0,e.bytesToNumberLE)(t):(0,e.bytesToNumberBE)(t);return c(s,r-n)+n},er.getFieldBytesLength=v,er.getMinHashLength=y,er.mapHashToField=function(t,r,i=!1){const o=t.length,a=v(r),s=y(r);if(o<16||o<s||o>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+o);const u=i?(0,e.bytesToNumberLE)(t):(0,e.bytesToNumberBE)(t),l=c(u,r-n)+n;return i?(0,e.numberToBytesLE)(l,a):(0,e.numberToBytesBE)(l,a)};
18
18
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
19
- const e=tr(),t=BigInt(0),n=BigInt(1),r=BigInt(2),i=BigInt(3),o=BigInt(4),a=BigInt(5),s=BigInt(8);function c(e,n){const r=e%n;return r>=t?r:n+r}function u(e,r,i){if(r<t)throw new Error("invalid exponent, negatives unsupported");if(i<=t)throw new Error("invalid modulus");if(i===n)return t;let o=n;for(;r>t;)r&n&&(o=o*e%i),e=e*e%i,r>>=n;return o}function l(e,r){if(e===t)throw new Error("invert: expected non-zero number");if(r<=t)throw new Error("invert: expected positive modulus, got "+r);let i=c(e,r),o=r,a=t,s=n;for(;i!==t;){const e=o%i,t=a-s*(o/i);o=i,i=e,a=s,s=t}if(o!==n)throw new Error("invert: does not exist");return c(a,r)}function d(e){const i=(e-n)/r;let a,s,c;for(a=e-n,s=0;a%r===t;a/=r,s++);for(c=r;c<e&&u(c,i,e)!==e-n;c++)if(c>1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===s){const t=(e+n)/o;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}const l=(a+n)/r;return function(e,t){if(e.pow(t,i)===e.neg(e.ONE))throw new Error("Cannot find square root");let r=s,o=e.pow(e.mul(e.ONE,c),a),u=e.pow(t,l),d=e.pow(t,a);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let n=e.sqr(d);t<r&&!e.eql(n,e.ONE);t++)n=e.sqr(n);const i=e.pow(o,n<<BigInt(r-t-1));o=e.sqr(i),u=e.mul(u,i),d=e.mul(d,o),r=t}return u}}function f(e){if(e%o===i){const t=(e+n)/o;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}if(e%s===a){const t=(e-a)/s;return function(e,n){const i=e.mul(n,r),o=e.pow(i,t),a=e.mul(n,o),s=e.mul(e.mul(a,r),o),c=e.mul(a,e.sub(s,e.ONE));if(!e.eql(e.sqr(c),n))throw new Error("Cannot find square root");return c}}return d(e)}Qn.isNegativeLE=(e,t)=>(c(e,t)&n)===n;const h=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function p(e,r,i){if(i<t)throw new Error("invalid exponent, negatives unsupported");if(i===t)return e.ONE;if(i===n)return r;let o=e.ONE,a=r;for(;i>t;)i&n&&(o=e.mul(o,a)),a=e.sqr(a),i>>=n;return o}function b(e,t){const n=new Array(t.length),r=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),i=e.inv(r);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),i),n}function m(e){const t=(e-n)/r;return(e,n)=>e.pow(n,t)}function g(e,t){const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function v(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function y(e){const t=v(e);return t+Math.ceil(t/2)}return Qn}function rr(){if(Jn)return Zn;Jn=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.wNAF=function(e,t){return{constTimeNegate:i,hasPrecomputes:e=>1!==d(e),unsafeLadder(t,i,o=e.ZERO){let a=t;for(;i>n;)i&r&&(o=o.add(a)),a=a.double(),i>>=r;return o},precomputeWindow(e,n){const{windows:r,windowSize:i}=a(n,t),o=[];let s=e,c=s;for(let e=0;e<r;e++){c=s,o.push(c);for(let e=1;e<i;e++)c=c.add(s),o.push(c);s=c.double()}return o},wNAF(n,o,s){const{windows:c,windowSize:u}=a(n,t);let l=e.ZERO,d=e.BASE;const f=BigInt(2**n-1),h=2**n,p=BigInt(n);for(let e=0;e<c;e++){const t=e*u;let n=Number(s&f);s>>=p,n>u&&(n-=h,s+=r);const a=t,c=t+Math.abs(n)-1,b=e%2!=0,m=n<0;0===n?d=d.add(i(b,o[a])):l=l.add(i(m,o[c]))}return{p:l,f:d}},wNAFUnsafe(i,o,s,c=e.ZERO){const{windows:u,windowSize:l}=a(i,t),d=BigInt(2**i-1),f=2**i,h=BigInt(i);for(let e=0;e<u;e++){const t=e*l;if(s===n)break;let i=Number(s&d);if(s>>=h,i>l&&(i-=f,s+=r),0===i)continue;let a=o[t+Math.abs(i)-1];i<0&&(a=a.negate()),c=c.add(a)}return c},getPrecomputes(e,t,n){let r=u.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&u.set(t,n(r))),r},wNAFCached(e,t,n){const r=d(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)},wNAFCachedUnsafe(e,t,n,r){const i=d(e);return 1===i?this.unsafeLadder(e,t,r):this.wNAFUnsafe(i,this.getPrecomputes(i,e,n),t,r)},setWindowSize(e,n){o(n,t),l.set(e,n),u.delete(e)}}},Zn.pippenger=function(e,n,r,i){if(s(r,e),c(i,n),r.length!==i.length)throw new Error("arrays of points and scalars must have equal length");const o=e.ZERO,a=(0,t.bitLen)(BigInt(r.length)),u=a>12?a-3:a>4?a-2:a?2:1,l=(1<<u)-1,d=new Array(l+1).fill(o),f=Math.floor((n.BITS-1)/u)*u;let h=o;for(let e=f;e>=0;e-=u){d.fill(o);for(let t=0;t<i.length;t++){const n=i[t],o=Number(n>>BigInt(e)&BigInt(l));d[o]=d[o].add(r[t])}let t=o;for(let e=d.length-1,n=o;e>0;e--)n=n.add(d[e]),t=t.add(n);if(h=h.add(t),0!==e)for(let e=0;e<u;e++)h=h.double()}return h},Zn.precomputeMSMUnsafe=function(e,t,n,r){o(r,t.BITS),s(n,e);const i=e.ZERO,a=2**r-1,u=Math.ceil(t.BITS/r),l=BigInt((1<<r)-1),d=n.map(e=>{const t=[];for(let n=0,r=e;n<a;n++)t.push(r),r=r.add(e);return t});return e=>{if(c(e,t),e.length>n.length)throw new Error("array of scalars must be smaller than array of points");let o=i;for(let t=0;t<u;t++){if(o!==i)for(let e=0;e<r;e++)o=o.double();const n=BigInt(u*r-(t+1)*r);for(let t=0;t<e.length;t++){const r=e[t],i=Number(r>>n&l);i&&(o=o.add(d[t][i-1]))}}return o}},Zn.validateBasic=function(n){return(0,e.validateField)(n.Fp),(0,t.validateObject)(n,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,e.nLength)(n.n,n.nBitLength),...n,p:n.Fp.ORDER})};
19
+ const e=nr(),t=BigInt(0),n=BigInt(1),r=BigInt(2),i=BigInt(3),o=BigInt(4),a=BigInt(5),s=BigInt(8);function c(e,n){const r=e%n;return r>=t?r:n+r}function u(e,r,i){if(r<t)throw new Error("invalid exponent, negatives unsupported");if(i<=t)throw new Error("invalid modulus");if(i===n)return t;let o=n;for(;r>t;)r&n&&(o=o*e%i),e=e*e%i,r>>=n;return o}function l(e,r){if(e===t)throw new Error("invert: expected non-zero number");if(r<=t)throw new Error("invert: expected positive modulus, got "+r);let i=c(e,r),o=r,a=t,s=n;for(;i!==t;){const e=o%i,t=a-s*(o/i);o=i,i=e,a=s,s=t}if(o!==n)throw new Error("invert: does not exist");return c(a,r)}function d(e){const i=(e-n)/r;let a,s,c;for(a=e-n,s=0;a%r===t;a/=r,s++);for(c=r;c<e&&u(c,i,e)!==e-n;c++)if(c>1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===s){const t=(e+n)/o;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}const l=(a+n)/r;return function(e,t){if(e.pow(t,i)===e.neg(e.ONE))throw new Error("Cannot find square root");let r=s,o=e.pow(e.mul(e.ONE,c),a),u=e.pow(t,l),d=e.pow(t,a);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let n=e.sqr(d);t<r&&!e.eql(n,e.ONE);t++)n=e.sqr(n);const i=e.pow(o,n<<BigInt(r-t-1));o=e.sqr(i),u=e.mul(u,i),d=e.mul(d,o),r=t}return u}}function f(e){if(e%o===i){const t=(e+n)/o;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}if(e%s===a){const t=(e-a)/s;return function(e,n){const i=e.mul(n,r),o=e.pow(i,t),a=e.mul(n,o),s=e.mul(e.mul(a,r),o),c=e.mul(a,e.sub(s,e.ONE));if(!e.eql(e.sqr(c),n))throw new Error("Cannot find square root");return c}}return d(e)}er.isNegativeLE=(e,t)=>(c(e,t)&n)===n;const h=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function p(e,r,i){if(i<t)throw new Error("invalid exponent, negatives unsupported");if(i===t)return e.ONE;if(i===n)return r;let o=e.ONE,a=r;for(;i>t;)i&n&&(o=e.mul(o,a)),a=e.sqr(a),i>>=n;return o}function b(e,t){const n=new Array(t.length),r=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),i=e.inv(r);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),i),n}function m(e){const t=(e-n)/r;return(e,n)=>e.pow(n,t)}function g(e,t){const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function v(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function y(e){const t=v(e);return t+Math.ceil(t/2)}return er}function ir(){if(Zn)return Qn;Zn=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.wNAF=function(e,t){return{constTimeNegate:i,hasPrecomputes:e=>1!==d(e),unsafeLadder(t,i,o=e.ZERO){let a=t;for(;i>n;)i&r&&(o=o.add(a)),a=a.double(),i>>=r;return o},precomputeWindow(e,n){const{windows:r,windowSize:i}=a(n,t),o=[];let s=e,c=s;for(let e=0;e<r;e++){c=s,o.push(c);for(let e=1;e<i;e++)c=c.add(s),o.push(c);s=c.double()}return o},wNAF(n,o,s){const{windows:c,windowSize:u}=a(n,t);let l=e.ZERO,d=e.BASE;const f=BigInt(2**n-1),h=2**n,p=BigInt(n);for(let e=0;e<c;e++){const t=e*u;let n=Number(s&f);s>>=p,n>u&&(n-=h,s+=r);const a=t,c=t+Math.abs(n)-1,b=e%2!=0,m=n<0;0===n?d=d.add(i(b,o[a])):l=l.add(i(m,o[c]))}return{p:l,f:d}},wNAFUnsafe(i,o,s,c=e.ZERO){const{windows:u,windowSize:l}=a(i,t),d=BigInt(2**i-1),f=2**i,h=BigInt(i);for(let e=0;e<u;e++){const t=e*l;if(s===n)break;let i=Number(s&d);if(s>>=h,i>l&&(i-=f,s+=r),0===i)continue;let a=o[t+Math.abs(i)-1];i<0&&(a=a.negate()),c=c.add(a)}return c},getPrecomputes(e,t,n){let r=u.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&u.set(t,n(r))),r},wNAFCached(e,t,n){const r=d(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)},wNAFCachedUnsafe(e,t,n,r){const i=d(e);return 1===i?this.unsafeLadder(e,t,r):this.wNAFUnsafe(i,this.getPrecomputes(i,e,n),t,r)},setWindowSize(e,n){o(n,t),l.set(e,n),u.delete(e)}}},Qn.pippenger=function(e,n,r,i){if(s(r,e),c(i,n),r.length!==i.length)throw new Error("arrays of points and scalars must have equal length");const o=e.ZERO,a=(0,t.bitLen)(BigInt(r.length)),u=a>12?a-3:a>4?a-2:a?2:1,l=(1<<u)-1,d=new Array(l+1).fill(o),f=Math.floor((n.BITS-1)/u)*u;let h=o;for(let e=f;e>=0;e-=u){d.fill(o);for(let t=0;t<i.length;t++){const n=i[t],o=Number(n>>BigInt(e)&BigInt(l));d[o]=d[o].add(r[t])}let t=o;for(let e=d.length-1,n=o;e>0;e--)n=n.add(d[e]),t=t.add(n);if(h=h.add(t),0!==e)for(let e=0;e<u;e++)h=h.double()}return h},Qn.precomputeMSMUnsafe=function(e,t,n,r){o(r,t.BITS),s(n,e);const i=e.ZERO,a=2**r-1,u=Math.ceil(t.BITS/r),l=BigInt((1<<r)-1),d=n.map(e=>{const t=[];for(let n=0,r=e;n<a;n++)t.push(r),r=r.add(e);return t});return e=>{if(c(e,t),e.length>n.length)throw new Error("array of scalars must be smaller than array of points");let o=i;for(let t=0;t<u;t++){if(o!==i)for(let e=0;e<r;e++)o=o.double();const n=BigInt(u*r-(t+1)*r);for(let t=0;t<e.length;t++){const r=e[t],i=Number(r>>n&l);i&&(o=o.add(d[t][i-1]))}}return o}},Qn.validateBasic=function(n){return(0,e.validateField)(n.Fp),(0,t.validateObject)(n,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,e.nLength)(n.n,n.nBitLength),...n,p:n.Fp.ORDER})};
20
20
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
21
- const e=nr(),t=tr(),n=BigInt(0),r=BigInt(1);function i(e,t){const n=t.negate();return e?n:t}function o(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function a(e,t){o(e,t);return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}function s(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,n)=>{if(!(e instanceof t))throw new Error("invalid point at index "+n)})}function c(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,n)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+n)})}const u=new WeakMap,l=new WeakMap;function d(e){return l.get(e)||1}return Zn}var ir,or={};function ar(){if(ir)return or;ir=1,Object.defineProperty(or,"__esModule",{value:!0}),or.twistedEdwards=function(u){const l=function(t){const r=(0,e.validateBasic)(t);return n.validateObject(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...r})}(u),{Fp:d,n:f,prehash:h,hash:p,randomBytes:b,nByteLength:m,h:g}=l,v=a<<BigInt(8*m)-o,y=d.create,w=(0,t.Field)(l.n,l.nBitLength),x=l.uvRatio||((e,t)=>{try{return{isValid:!0,value:d.sqrt(e*d.inv(t))}}catch(e){return{isValid:!1,value:i}}}),A=l.adjustScalarBytes||(e=>e),E=l.domain||((e,t,n)=>{if((0,r.abool)("phflag",n),t.length||n)throw new Error("Contexts/pre-hash are not supported");return e});function S(e,t){n.aInRange("coordinate "+e,t,i,v)}function _(e){if(!(e instanceof k))throw new Error("ExtendedPoint expected")}const O=(0,r.memoized)((e,t)=>{const{ex:n,ey:r,ez:a}=e,c=e.is0();null==t&&(t=c?s:d.inv(a));const u=y(n*t),l=y(r*t),f=y(a*t);if(c)return{x:i,y:o};if(f!==o)throw new Error("invZ was invalid");return{x:u,y:l}}),N=(0,r.memoized)(e=>{const{a:t,d:n}=l;if(e.is0())throw new Error("bad point: ZERO");const{ex:r,ey:i,ez:o,et:a}=e,s=y(r*r),c=y(i*i),u=y(o*o),d=y(u*u),f=y(s*t);if(y(u*y(f+c))!==y(d+y(n*y(s*c))))throw new Error("bad point: equation left != right (1)");if(y(r*i)!==y(o*a))throw new Error("bad point: equation left != right (2)");return!0});class k{constructor(e,t,n,r){this.ex=e,this.ey=t,this.ez=n,this.et=r,S("x",e),S("y",t),S("z",n),S("t",r),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof k)throw new Error("extended point not allowed");const{x:t,y:n}=e||{};return S("x",t),S("y",n),new k(t,n,o,y(t*n))}static normalizeZ(e){const t=d.invertBatch(e.map(e=>e.ez));return e.map((e,n)=>e.toAffine(t[n])).map(k.fromAffine)}static msm(t,n){return(0,e.pippenger)(k,w,t,n)}_setWindowSize(e){I.setWindowSize(this,e)}assertValidity(){N(this)}equals(e){_(e);const{ex:t,ey:n,ez:r}=this,{ex:i,ey:o,ez:a}=e,s=y(t*a),c=y(i*r),u=y(n*a),l=y(o*r);return s===c&&u===l}is0(){return this.equals(k.ZERO)}negate(){return new k(y(-this.ex),this.ey,this.ez,y(-this.et))}double(){const{a:e}=l,{ex:t,ey:n,ez:r}=this,i=y(t*t),o=y(n*n),s=y(a*y(r*r)),c=y(e*i),u=t+n,d=y(y(u*u)-i-o),f=c+o,h=f-s,p=c-o,b=y(d*h),m=y(f*p),g=y(d*p),v=y(h*f);return new k(b,m,v,g)}add(e){_(e);const{a:t,d:n}=l,{ex:r,ey:o,ez:s,et:c}=this,{ex:u,ey:d,ez:f,et:h}=e;if(t===BigInt(-1)){const e=y((o-r)*(d+u)),t=y((o+r)*(d-u)),n=y(t-e);if(n===i)return this.double();const l=y(s*a*h),p=y(c*a*f),b=p+l,m=t+e,g=p-l,v=y(b*n),w=y(m*g),x=y(b*g),A=y(n*m);return new k(v,w,A,x)}const p=y(r*u),b=y(o*d),m=y(c*n*h),g=y(s*f),v=y((r+o)*(u+d)-p-b),w=g-m,x=g+m,A=y(b-t*p),E=y(v*w),S=y(x*A),O=y(v*A),N=y(w*x);return new k(E,S,N,O)}subtract(e){return this.add(e.negate())}wNAF(e){return I.wNAFCached(this,e,k.normalizeZ)}multiply(e){const t=e;n.aInRange("scalar",t,o,f);const{p:r,f:i}=this.wNAF(t);return k.normalizeZ([r,i])[0]}multiplyUnsafe(e,t=k.ZERO){const r=e;return n.aInRange("scalar",r,i,f),r===i?C:this.is0()||r===o?this:I.wNAFCachedUnsafe(this,r,k.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(g).is0()}isTorsionFree(){return I.unsafeLadder(this,f).is0()}toAffine(e){return O(this,e)}clearCofactor(){const{h:e}=l;return e===o?this:this.multiplyUnsafe(e)}static fromHex(e,t=!1){const{d:a,a:s}=l,c=d.BYTES;e=(0,r.ensureBytes)("pointHex",e,c),(0,r.abool)("zip215",t);const u=e.slice(),f=e[c-1];u[c-1]=-129&f;const h=n.bytesToNumberLE(u),p=t?v:d.ORDER;n.aInRange("pointHex.y",h,i,p);const b=y(h*h),m=y(b-o),g=y(a*b-s);let{isValid:w,value:A}=x(m,g);if(!w)throw new Error("Point.fromHex: invalid y coordinate");const E=(A&o)===o,S=!!(128&f);if(!t&&A===i&&S)throw new Error("Point.fromHex: x=0 and x_0=1");return S!==E&&(A=y(-A)),k.fromAffine({x:A,y:h})}static fromPrivateKey(e){return M(e).point}toRawBytes(){const{x:e,y:t}=this.toAffine(),r=n.numberToBytesLE(t,d.BYTES);return r[r.length-1]|=e&o?128:0,r}toHex(){return n.bytesToHex(this.toRawBytes())}}k.BASE=new k(l.Gx,l.Gy,o,y(l.Gx*l.Gy)),k.ZERO=new k(i,o,o,i);const{BASE:T,ZERO:C}=k,I=(0,e.wNAF)(k,8*m);function B(e){return(0,t.mod)(e,f)}function L(e){return B(n.bytesToNumberLE(e))}function M(e){const t=d.BYTES;e=(0,r.ensureBytes)("private key",e,t);const n=(0,r.ensureBytes)("hashed private key",p(e),2*t),i=A(n.slice(0,t)),o=n.slice(t,2*t),a=L(i),s=T.multiply(a),c=s.toRawBytes();return{head:i,prefix:o,scalar:a,point:s,pointBytes:c}}function R(e=new Uint8Array,...t){const i=n.concatBytes(...t);return L(p(E(i,(0,r.ensureBytes)("context",e),!!h)))}const P=c;T._setWindowSize(8);const U={getExtendedPublicKey:M,randomPrivateKey:()=>b(d.BYTES),precompute:(e=8,t=k.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};return{CURVE:l,getPublicKey:function(e){return M(e).pointBytes},sign:function(e,t,o={}){e=(0,r.ensureBytes)("message",e),h&&(e=h(e));const{prefix:a,scalar:s,pointBytes:c}=M(t),u=R(o.context,a,e),l=T.multiply(u).toRawBytes(),p=B(u+R(o.context,l,c,e)*s);n.aInRange("signature.s",p,i,f);const b=n.concatBytes(l,n.numberToBytesLE(p,d.BYTES));return(0,r.ensureBytes)("result",b,2*d.BYTES)},verify:function(e,t,i,o=P){const{context:a,zip215:s}=o,c=d.BYTES;e=(0,r.ensureBytes)("signature",e,2*c),t=(0,r.ensureBytes)("message",t),i=(0,r.ensureBytes)("publicKey",i,c),void 0!==s&&(0,r.abool)("zip215",s),h&&(t=h(t));const u=n.bytesToNumberLE(e.slice(c,2*c));let l,f,p;try{l=k.fromHex(i,s),f=k.fromHex(e.slice(0,c),s),p=T.multiplyUnsafe(u)}catch(e){return!1}if(!s&&l.isSmallOrder())return!1;const b=R(a,f.toRawBytes(),l.toRawBytes(),t);return f.add(l.multiplyUnsafe(b)).subtract(p).clearCofactor().equals(k.ZERO)},ExtendedPoint:k,utils:U}};
21
+ const e=rr(),t=nr(),n=BigInt(0),r=BigInt(1);function i(e,t){const n=t.negate();return e?n:t}function o(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function a(e,t){o(e,t);return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}function s(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,n)=>{if(!(e instanceof t))throw new Error("invalid point at index "+n)})}function c(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,n)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+n)})}const u=new WeakMap,l=new WeakMap;function d(e){return l.get(e)||1}return Qn}var or,ar={};function sr(){if(or)return ar;or=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.twistedEdwards=function(u){const l=function(t){const r=(0,e.validateBasic)(t);return n.validateObject(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...r})}(u),{Fp:d,n:f,prehash:h,hash:p,randomBytes:b,nByteLength:m,h:g}=l,v=a<<BigInt(8*m)-o,y=d.create,w=(0,t.Field)(l.n,l.nBitLength),x=l.uvRatio||((e,t)=>{try{return{isValid:!0,value:d.sqrt(e*d.inv(t))}}catch(e){return{isValid:!1,value:i}}}),A=l.adjustScalarBytes||(e=>e),E=l.domain||((e,t,n)=>{if((0,r.abool)("phflag",n),t.length||n)throw new Error("Contexts/pre-hash are not supported");return e});function S(e,t){n.aInRange("coordinate "+e,t,i,v)}function _(e){if(!(e instanceof k))throw new Error("ExtendedPoint expected")}const O=(0,r.memoized)((e,t)=>{const{ex:n,ey:r,ez:a}=e,c=e.is0();null==t&&(t=c?s:d.inv(a));const u=y(n*t),l=y(r*t),f=y(a*t);if(c)return{x:i,y:o};if(f!==o)throw new Error("invZ was invalid");return{x:u,y:l}}),N=(0,r.memoized)(e=>{const{a:t,d:n}=l;if(e.is0())throw new Error("bad point: ZERO");const{ex:r,ey:i,ez:o,et:a}=e,s=y(r*r),c=y(i*i),u=y(o*o),d=y(u*u),f=y(s*t);if(y(u*y(f+c))!==y(d+y(n*y(s*c))))throw new Error("bad point: equation left != right (1)");if(y(r*i)!==y(o*a))throw new Error("bad point: equation left != right (2)");return!0});class k{constructor(e,t,n,r){this.ex=e,this.ey=t,this.ez=n,this.et=r,S("x",e),S("y",t),S("z",n),S("t",r),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof k)throw new Error("extended point not allowed");const{x:t,y:n}=e||{};return S("x",t),S("y",n),new k(t,n,o,y(t*n))}static normalizeZ(e){const t=d.invertBatch(e.map(e=>e.ez));return e.map((e,n)=>e.toAffine(t[n])).map(k.fromAffine)}static msm(t,n){return(0,e.pippenger)(k,w,t,n)}_setWindowSize(e){I.setWindowSize(this,e)}assertValidity(){N(this)}equals(e){_(e);const{ex:t,ey:n,ez:r}=this,{ex:i,ey:o,ez:a}=e,s=y(t*a),c=y(i*r),u=y(n*a),l=y(o*r);return s===c&&u===l}is0(){return this.equals(k.ZERO)}negate(){return new k(y(-this.ex),this.ey,this.ez,y(-this.et))}double(){const{a:e}=l,{ex:t,ey:n,ez:r}=this,i=y(t*t),o=y(n*n),s=y(a*y(r*r)),c=y(e*i),u=t+n,d=y(y(u*u)-i-o),f=c+o,h=f-s,p=c-o,b=y(d*h),m=y(f*p),g=y(d*p),v=y(h*f);return new k(b,m,v,g)}add(e){_(e);const{a:t,d:n}=l,{ex:r,ey:o,ez:s,et:c}=this,{ex:u,ey:d,ez:f,et:h}=e;if(t===BigInt(-1)){const e=y((o-r)*(d+u)),t=y((o+r)*(d-u)),n=y(t-e);if(n===i)return this.double();const l=y(s*a*h),p=y(c*a*f),b=p+l,m=t+e,g=p-l,v=y(b*n),w=y(m*g),x=y(b*g),A=y(n*m);return new k(v,w,A,x)}const p=y(r*u),b=y(o*d),m=y(c*n*h),g=y(s*f),v=y((r+o)*(u+d)-p-b),w=g-m,x=g+m,A=y(b-t*p),E=y(v*w),S=y(x*A),O=y(v*A),N=y(w*x);return new k(E,S,N,O)}subtract(e){return this.add(e.negate())}wNAF(e){return I.wNAFCached(this,e,k.normalizeZ)}multiply(e){const t=e;n.aInRange("scalar",t,o,f);const{p:r,f:i}=this.wNAF(t);return k.normalizeZ([r,i])[0]}multiplyUnsafe(e,t=k.ZERO){const r=e;return n.aInRange("scalar",r,i,f),r===i?C:this.is0()||r===o?this:I.wNAFCachedUnsafe(this,r,k.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(g).is0()}isTorsionFree(){return I.unsafeLadder(this,f).is0()}toAffine(e){return O(this,e)}clearCofactor(){const{h:e}=l;return e===o?this:this.multiplyUnsafe(e)}static fromHex(e,t=!1){const{d:a,a:s}=l,c=d.BYTES;e=(0,r.ensureBytes)("pointHex",e,c),(0,r.abool)("zip215",t);const u=e.slice(),f=e[c-1];u[c-1]=-129&f;const h=n.bytesToNumberLE(u),p=t?v:d.ORDER;n.aInRange("pointHex.y",h,i,p);const b=y(h*h),m=y(b-o),g=y(a*b-s);let{isValid:w,value:A}=x(m,g);if(!w)throw new Error("Point.fromHex: invalid y coordinate");const E=(A&o)===o,S=!!(128&f);if(!t&&A===i&&S)throw new Error("Point.fromHex: x=0 and x_0=1");return S!==E&&(A=y(-A)),k.fromAffine({x:A,y:h})}static fromPrivateKey(e){return M(e).point}toRawBytes(){const{x:e,y:t}=this.toAffine(),r=n.numberToBytesLE(t,d.BYTES);return r[r.length-1]|=e&o?128:0,r}toHex(){return n.bytesToHex(this.toRawBytes())}}k.BASE=new k(l.Gx,l.Gy,o,y(l.Gx*l.Gy)),k.ZERO=new k(i,o,o,i);const{BASE:T,ZERO:C}=k,I=(0,e.wNAF)(k,8*m);function B(e){return(0,t.mod)(e,f)}function L(e){return B(n.bytesToNumberLE(e))}function M(e){const t=d.BYTES;e=(0,r.ensureBytes)("private key",e,t);const n=(0,r.ensureBytes)("hashed private key",p(e),2*t),i=A(n.slice(0,t)),o=n.slice(t,2*t),a=L(i),s=T.multiply(a),c=s.toRawBytes();return{head:i,prefix:o,scalar:a,point:s,pointBytes:c}}function R(e=new Uint8Array,...t){const i=n.concatBytes(...t);return L(p(E(i,(0,r.ensureBytes)("context",e),!!h)))}const P=c;T._setWindowSize(8);const U={getExtendedPublicKey:M,randomPrivateKey:()=>b(d.BYTES),precompute:(e=8,t=k.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};return{CURVE:l,getPublicKey:function(e){return M(e).pointBytes},sign:function(e,t,o={}){e=(0,r.ensureBytes)("message",e),h&&(e=h(e));const{prefix:a,scalar:s,pointBytes:c}=M(t),u=R(o.context,a,e),l=T.multiply(u).toRawBytes(),p=B(u+R(o.context,l,c,e)*s);n.aInRange("signature.s",p,i,f);const b=n.concatBytes(l,n.numberToBytesLE(p,d.BYTES));return(0,r.ensureBytes)("result",b,2*d.BYTES)},verify:function(e,t,i,o=P){const{context:a,zip215:s}=o,c=d.BYTES;e=(0,r.ensureBytes)("signature",e,2*c),t=(0,r.ensureBytes)("message",t),i=(0,r.ensureBytes)("publicKey",i,c),void 0!==s&&(0,r.abool)("zip215",s),h&&(t=h(t));const u=n.bytesToNumberLE(e.slice(c,2*c));let l,f,p;try{l=k.fromHex(i,s),f=k.fromHex(e.slice(0,c),s),p=T.multiplyUnsafe(u)}catch(e){return!1}if(!s&&l.isSmallOrder())return!1;const b=R(a,f.toRawBytes(),l.toRawBytes(),t);return f.add(l.multiplyUnsafe(b)).subtract(p).clearCofactor().equals(k.ZERO)},ExtendedPoint:k,utils:U}};
22
22
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
23
- const e=rr(),t=nr(),n=tr(),r=tr(),i=BigInt(0),o=BigInt(1),a=BigInt(2),s=BigInt(8),c={zip215:!0};return or}var sr,cr={};function ur(){if(sr)return cr;sr=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.expand_message_xmd=a,cr.expand_message_xof=s,cr.hash_to_field=c,cr.isogenyMap=function(e,t){const n=t.map(e=>Array.from(e).reverse());return(t,r)=>{const[i,o,a,s]=n.map(n=>n.reduce((n,r)=>e.add(e.mul(n,t),r)));return t=e.div(i,o),r=e.mul(r,e.div(a,s)),{x:t,y:r}}},cr.createHasher=function(e,t,n){if("function"!=typeof t)throw new Error("mapToCurve() must be defined");return{hashToCurve(r,i){const o=c(r,2,{...n,DST:n.DST,...i}),a=e.fromAffine(t(o[0])),s=e.fromAffine(t(o[1])),u=a.add(s).clearCofactor();return u.assertValidity(),u},encodeToCurve(r,i){const o=c(r,1,{...n,DST:n.encodeDST,...i}),a=e.fromAffine(t(o[0])).clearCofactor();return a.assertValidity(),a},mapToCurve(n){if(!Array.isArray(n))throw new Error("mapToCurve: expected array of bigints");for(const e of n)if("bigint"!=typeof e)throw new Error("mapToCurve: expected array of bigints");const r=e.fromAffine(t(n)).clearCofactor();return r.assertValidity(),r}}};const e=nr(),t=tr(),n=t.bytesToNumberBE;function r(e,t){if(o(e),o(t),e<0||e>=1<<8*t)throw new Error("invalid I2OSP input: "+e);const n=Array.from({length:t}).fill(0);for(let r=t-1;r>=0;r--)n[r]=255&e,e>>>=8;return new Uint8Array(n)}function i(e,t){const n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[r]^t[r];return n}function o(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function a(e,n,a,s){(0,t.abytes)(e),(0,t.abytes)(n),o(a),n.length>255&&(n=s((0,t.concatBytes)((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-"),n)));const{outputLen:c,blockLen:u}=s,l=Math.ceil(a/c);if(a>65535||l>255)throw new Error("expand_message_xmd: invalid lenInBytes");const d=(0,t.concatBytes)(n,r(n.length,1)),f=r(0,u),h=r(a,2),p=new Array(l),b=s((0,t.concatBytes)(f,e,h,r(0,1),d));p[0]=s((0,t.concatBytes)(b,r(1,1),d));for(let e=1;e<=l;e++){const n=[i(b,p[e-1]),r(e+1,1),d];p[e]=s((0,t.concatBytes)(...n))}return(0,t.concatBytes)(...p).slice(0,a)}function s(e,n,i,a,s){if((0,t.abytes)(e),(0,t.abytes)(n),o(i),n.length>255){const e=Math.ceil(2*a/8);n=s.create({dkLen:e}).update((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(n).digest()}if(i>65535||n.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:i}).update(e).update(r(i,2)).update(n).update(r(n.length,1)).digest()}function c(r,i,c){(0,t.validateObject)(c,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:u,k:l,m:d,hash:f,expand:h,DST:p}=c;(0,t.abytes)(r),o(i);const b="string"==typeof p?(0,t.utf8ToBytes)(p):p,m=u.toString(2).length,g=Math.ceil((m+l)/8),v=i*d*g;let y;if("xmd"===h)y=a(r,b,v,f);else if("xof"===h)y=s(r,b,v,l,f);else{if("_internal_pass"!==h)throw new Error('expand must be "xmd" or "xof"');y=r}const w=new Array(i);for(let t=0;t<i;t++){const r=new Array(d);for(let i=0;i<d;i++){const o=g*(i+t*d),a=y.subarray(o,o+g);r[i]=(0,e.mod)(n(a),u)}w[t]=r}return w}return cr}var lr,dr,fr={};function hr(){if(lr)return fr;lr=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.montgomery=function(i){const o=function(e){return(0,t.validateObject)(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})}(i),{P:a}=o,s=t=>(0,e.mod)(t,a),c=o.montgomeryBits,u=Math.ceil(c/8),l=o.nByteLength,d=o.adjustScalarBytes||(e=>e),f=o.powPminus2||(t=>(0,e.pow)(t,a-BigInt(2),a));function h(e,t,n){const r=s(e*(t-n));return[t=s(t-r),n=s(n+r)]}const p=(o.a-BigInt(2))/BigInt(4);function b(e){return(0,t.numberToBytesLE)(s(e),u)}function m(e,i){const o=function(e){const n=(0,t.ensureBytes)("u coordinate",e,u);return 32===l&&(n[31]&=127),(0,t.bytesToNumberLE)(n)}(i),m=function(e,i){(0,t.aInRange)("u",e,n,a),(0,t.aInRange)("scalar",i,n,a);const o=i,u=e;let l,d=r,b=n,m=e,g=r,v=n;for(let e=BigInt(c-1);e>=n;e--){const t=o>>e&r;v^=t,l=h(v,d,m),d=l[0],m=l[1],l=h(v,b,g),b=l[0],g=l[1],v=t;const n=d+b,i=s(n*n),a=d-b,c=s(a*a),f=i-c,y=m+g,w=s((m-g)*n),x=s(y*a),A=w+x,E=w-x;m=s(A*A),g=s(u*s(E*E)),d=s(i*c),b=s(f*(i+s(p*f)))}l=h(v,d,m),d=l[0],m=l[1],l=h(v,b,g),b=l[0],g=l[1];const y=f(b);return s(d*y)}(o,function(e){const n=(0,t.ensureBytes)("scalar",e),r=n.length;if(r!==u&&r!==l)throw new Error("invalid scalar, expected "+u+" or "+l+" bytes, got "+r);return(0,t.bytesToNumberLE)(d(n))}(e));if(m===n)throw new Error("invalid private or public key received");return b(m)}const g=b(o.Gu);function v(e){return m(e,g)}return{scalarMult:m,scalarMultBase:v,getSharedSecret:(e,t)=>m(e,t),getPublicKey:e=>v(e),utils:{randomPrivateKey:()=>o.randomBytes(o.nByteLength)},GuBytes:g}};
23
+ const e=ir(),t=rr(),n=nr(),r=nr(),i=BigInt(0),o=BigInt(1),a=BigInt(2),s=BigInt(8),c={zip215:!0};return ar}var cr,ur={};function lr(){if(cr)return ur;cr=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.expand_message_xmd=a,ur.expand_message_xof=s,ur.hash_to_field=c,ur.isogenyMap=function(e,t){const n=t.map(e=>Array.from(e).reverse());return(t,r)=>{const[i,o,a,s]=n.map(n=>n.reduce((n,r)=>e.add(e.mul(n,t),r)));return t=e.div(i,o),r=e.mul(r,e.div(a,s)),{x:t,y:r}}},ur.createHasher=function(e,t,n){if("function"!=typeof t)throw new Error("mapToCurve() must be defined");return{hashToCurve(r,i){const o=c(r,2,{...n,DST:n.DST,...i}),a=e.fromAffine(t(o[0])),s=e.fromAffine(t(o[1])),u=a.add(s).clearCofactor();return u.assertValidity(),u},encodeToCurve(r,i){const o=c(r,1,{...n,DST:n.encodeDST,...i}),a=e.fromAffine(t(o[0])).clearCofactor();return a.assertValidity(),a},mapToCurve(n){if(!Array.isArray(n))throw new Error("mapToCurve: expected array of bigints");for(const e of n)if("bigint"!=typeof e)throw new Error("mapToCurve: expected array of bigints");const r=e.fromAffine(t(n)).clearCofactor();return r.assertValidity(),r}}};const e=rr(),t=nr(),n=t.bytesToNumberBE;function r(e,t){if(o(e),o(t),e<0||e>=1<<8*t)throw new Error("invalid I2OSP input: "+e);const n=Array.from({length:t}).fill(0);for(let r=t-1;r>=0;r--)n[r]=255&e,e>>>=8;return new Uint8Array(n)}function i(e,t){const n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[r]^t[r];return n}function o(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function a(e,n,a,s){(0,t.abytes)(e),(0,t.abytes)(n),o(a),n.length>255&&(n=s((0,t.concatBytes)((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-"),n)));const{outputLen:c,blockLen:u}=s,l=Math.ceil(a/c);if(a>65535||l>255)throw new Error("expand_message_xmd: invalid lenInBytes");const d=(0,t.concatBytes)(n,r(n.length,1)),f=r(0,u),h=r(a,2),p=new Array(l),b=s((0,t.concatBytes)(f,e,h,r(0,1),d));p[0]=s((0,t.concatBytes)(b,r(1,1),d));for(let e=1;e<=l;e++){const n=[i(b,p[e-1]),r(e+1,1),d];p[e]=s((0,t.concatBytes)(...n))}return(0,t.concatBytes)(...p).slice(0,a)}function s(e,n,i,a,s){if((0,t.abytes)(e),(0,t.abytes)(n),o(i),n.length>255){const e=Math.ceil(2*a/8);n=s.create({dkLen:e}).update((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(n).digest()}if(i>65535||n.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:i}).update(e).update(r(i,2)).update(n).update(r(n.length,1)).digest()}function c(r,i,c){(0,t.validateObject)(c,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:u,k:l,m:d,hash:f,expand:h,DST:p}=c;(0,t.abytes)(r),o(i);const b="string"==typeof p?(0,t.utf8ToBytes)(p):p,m=u.toString(2).length,g=Math.ceil((m+l)/8),v=i*d*g;let y;if("xmd"===h)y=a(r,b,v,f);else if("xof"===h)y=s(r,b,v,l,f);else{if("_internal_pass"!==h)throw new Error('expand must be "xmd" or "xof"');y=r}const w=new Array(i);for(let t=0;t<i;t++){const r=new Array(d);for(let i=0;i<d;i++){const o=g*(i+t*d),a=y.subarray(o,o+g);r[i]=(0,e.mod)(n(a),u)}w[t]=r}return w}return ur}var dr,fr,hr={};function pr(){if(dr)return hr;dr=1,Object.defineProperty(hr,"__esModule",{value:!0}),hr.montgomery=function(i){const o=function(e){return(0,t.validateObject)(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})}(i),{P:a}=o,s=t=>(0,e.mod)(t,a),c=o.montgomeryBits,u=Math.ceil(c/8),l=o.nByteLength,d=o.adjustScalarBytes||(e=>e),f=o.powPminus2||(t=>(0,e.pow)(t,a-BigInt(2),a));function h(e,t,n){const r=s(e*(t-n));return[t=s(t-r),n=s(n+r)]}const p=(o.a-BigInt(2))/BigInt(4);function b(e){return(0,t.numberToBytesLE)(s(e),u)}function m(e,i){const o=function(e){const n=(0,t.ensureBytes)("u coordinate",e,u);return 32===l&&(n[31]&=127),(0,t.bytesToNumberLE)(n)}(i),m=function(e,i){(0,t.aInRange)("u",e,n,a),(0,t.aInRange)("scalar",i,n,a);const o=i,u=e;let l,d=r,b=n,m=e,g=r,v=n;for(let e=BigInt(c-1);e>=n;e--){const t=o>>e&r;v^=t,l=h(v,d,m),d=l[0],m=l[1],l=h(v,b,g),b=l[0],g=l[1],v=t;const n=d+b,i=s(n*n),a=d-b,c=s(a*a),f=i-c,y=m+g,w=s((m-g)*n),x=s(y*a),A=w+x,E=w-x;m=s(A*A),g=s(u*s(E*E)),d=s(i*c),b=s(f*(i+s(p*f)))}l=h(v,d,m),d=l[0],m=l[1],l=h(v,b,g),b=l[0],g=l[1];const y=f(b);return s(d*y)}(o,function(e){const n=(0,t.ensureBytes)("scalar",e),r=n.length;if(r!==u&&r!==l)throw new Error("invalid scalar, expected "+u+" or "+l+" bytes, got "+r);return(0,t.bytesToNumberLE)(d(n))}(e));if(m===n)throw new Error("invalid private or public key received");return b(m)}const g=b(o.Gu);function v(e){return m(e,g)}return{scalarMult:m,scalarMultBase:v,getSharedSecret:(e,t)=>m(e,t),getPublicKey:e=>v(e),utils:{randomPrivateKey:()=>o.randomBytes(o.nByteLength)},GuBytes:g}};
24
24
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
25
- const e=nr(),t=tr(),n=BigInt(0),r=BigInt(1);return fr}function pr(){return dr||(dr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hash_to_ristretto255=e.hashToRistretto255=e.RistrettoPoint=e.encodeToCurve=e.hashToCurve=e.edwardsToMontgomery=e.x25519=e.ed25519ph=e.ed25519ctx=e.ed25519=e.ED25519_TORSION_SUBGROUP=void 0,e.edwardsToMontgomeryPub=E,e.edwardsToMontgomeryPriv=function(e){const t=x.hash(e.subarray(0,32));return x.adjustScalarBytes(t).subarray(0,32)};
25
+ const e=rr(),t=nr(),n=BigInt(0),r=BigInt(1);return hr}function br(){return fr||(fr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hash_to_ristretto255=e.hashToRistretto255=e.RistrettoPoint=e.encodeToCurve=e.hashToCurve=e.edwardsToMontgomery=e.x25519=e.ed25519ph=e.ed25519ctx=e.ed25519=e.ED25519_TORSION_SUBGROUP=void 0,e.edwardsToMontgomeryPub=E,e.edwardsToMontgomeryPriv=function(e){const t=x.hash(e.subarray(0,32));return x.adjustScalarBytes(t).subarray(0,32)};
26
26
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
27
- const t=Vn(),n=$n(),r=rr(),i=ar(),o=ur(),a=nr(),s=hr(),c=tr(),u=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),d=BigInt(0),f=BigInt(1),h=BigInt(2),p=BigInt(3),b=BigInt(5),m=BigInt(8);function g(e){const t=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),o=u,s=e*e%o*e%o,c=(0,a.pow2)(s,h,o)*s%o,l=(0,a.pow2)(c,f,o)*e%o,d=(0,a.pow2)(l,b,o)*l%o,p=(0,a.pow2)(d,t,o)*d%o,m=(0,a.pow2)(p,n,o)*p%o,g=(0,a.pow2)(m,r,o)*m%o,v=(0,a.pow2)(g,i,o)*g%o,y=(0,a.pow2)(v,i,o)*g%o,w=(0,a.pow2)(y,t,o)*d%o;return{pow_p_5_8:(0,a.pow2)(w,h,o)*e%o,b2:s}}function v(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function y(e,t){const n=u,r=(0,a.mod)(t*t*t,n),i=g(e*(0,a.mod)(r*r*t,n)).pow_p_5_8;let o=(0,a.mod)(e*r*i,n);const s=(0,a.mod)(t*o*o,n),c=o,d=(0,a.mod)(o*l,n),f=s===e,h=s===(0,a.mod)(-e,n),p=s===(0,a.mod)(-e*l,n);return f&&(o=c),(h||p)&&(o=d),(0,a.isNegativeLE)(o,n)&&(o=(0,a.mod)(-o,n)),{isValid:f||h,value:o}}e.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];const w=(()=>(0,a.Field)(u,void 0,!0))(),x=(()=>({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:w,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:m,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:t.sha512,randomBytes:n.randomBytes,adjustScalarBytes:v,uvRatio:y}))();function A(e,t,r){if(t.length>255)throw new Error("Context is too big");return(0,n.concatBytes)((0,n.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,t.length]),t,e)}function E(t){const{y:n}=e.ed25519.ExtendedPoint.fromHex(t),r=BigInt(1);return w.toBytes(w.create((r+n)*w.inv(r-n)))}e.ed25519=(0,i.twistedEdwards)(x),e.ed25519ctx=(0,i.twistedEdwards)({...x,domain:A}),e.ed25519ph=(0,i.twistedEdwards)(Object.assign({},x,{domain:A,prehash:t.sha512})),e.x25519=(0,s.montgomery)({P:u,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:e=>{const t=u,{pow_p_5_8:n,b2:r}=g(e);return(0,a.mod)((0,a.pow2)(n,p,t)*r,t)},adjustScalarBytes:v,randomBytes:n.randomBytes}),e.edwardsToMontgomery=E;const S=(()=>(w.ORDER+p)/m)(),_=(()=>w.pow(h,S))(),O=(()=>w.sqrt(w.neg(w.ONE)))();const N=(()=>(0,a.FpSqrtEven)(w,w.neg(BigInt(486664))))();function k(e){const{xMn:t,xMd:n,yMn:r,yMd:i}=function(e){const t=(w.ORDER-b)/m,n=BigInt(486662);let r=w.sqr(e);r=w.mul(r,h);let i=w.add(r,w.ONE),o=w.neg(n),a=w.sqr(i),s=w.mul(a,i),c=w.mul(r,n);c=w.mul(c,o),c=w.add(c,a),c=w.mul(c,o);let u=w.sqr(s);a=w.sqr(u),u=w.mul(u,s),u=w.mul(u,c),a=w.mul(a,u);let l=w.pow(a,t);l=w.mul(l,u);let d=w.mul(l,O);a=w.sqr(l),a=w.mul(a,s);let p=w.eql(a,c),g=w.cmov(d,l,p),v=w.mul(o,r),y=w.mul(l,e);y=w.mul(y,_);let x=w.mul(y,O),A=w.mul(c,r);a=w.sqr(y),a=w.mul(a,s);let E=w.eql(a,A),S=w.cmov(x,y,E);a=w.sqr(g),a=w.mul(a,s);let N=w.eql(a,c),k=w.cmov(v,o,N),T=w.cmov(S,g,N),C=w.isOdd(T);return T=w.cmov(T,w.neg(T),N!==C),{xMn:k,xMd:i,yMn:T,yMd:f}}(e);let o=w.mul(t,i);o=w.mul(o,N);let a=w.mul(n,r),s=w.sub(t,n),c=w.add(t,n),u=w.mul(a,c),l=w.eql(u,w.ZERO);o=w.cmov(o,w.ZERO,l),a=w.cmov(a,w.ONE,l),s=w.cmov(s,w.ONE,l),c=w.cmov(c,w.ONE,l);const d=w.invertBatch([a,c]);return{x:w.mul(o,d[0]),y:w.mul(s,d[1])}}const T=(()=>(0,o.createHasher)(e.ed25519.ExtendedPoint,e=>k(e[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:w.ORDER,m:1,k:128,expand:"xmd",hash:t.sha512}))();function C(e){if(!(e instanceof D))throw new Error("RistrettoPoint expected")}e.hashToCurve=T.hashToCurve,e.encodeToCurve=T.encodeToCurve;const I=l,B=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),L=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),M=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),R=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),P=e=>y(f,e),U=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),j=t=>e.ed25519.CURVE.Fp.create((0,c.bytesToNumberLE)(t)&U);function F(t){const{d:n}=e.ed25519.CURVE,r=e.ed25519.CURVE.Fp.ORDER,i=e.ed25519.CURVE.Fp.create,o=i(I*t*t),s=i((o+f)*M);let c=BigInt(-1);const u=i((c-n*o)*i(o+n));let{isValid:l,value:d}=y(s,u),h=i(d*t);(0,a.isNegativeLE)(h,r)||(h=i(-h)),l||(d=h),l||(c=o);const p=i(c*(o-f)*R-u),b=d*d,m=i((d+d)*u),g=i(p*B),v=i(f-b),w=i(f+b);return new e.ed25519.ExtendedPoint(i(m*w),i(v*g),i(g*w),i(m*v))}class D{constructor(e){this.ep=e}static fromAffine(t){return new D(e.ed25519.ExtendedPoint.fromAffine(t))}static hashToCurve(e){e=(0,c.ensureBytes)("ristrettoHash",e,64);const t=F(j(e.slice(0,32))),n=F(j(e.slice(32,64)));return new D(t.add(n))}static fromHex(t){t=(0,c.ensureBytes)("ristrettoHex",t,32);const{a:n,d:r}=e.ed25519.CURVE,i=e.ed25519.CURVE.Fp.ORDER,o=e.ed25519.CURVE.Fp.create,s="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",u=j(t);if(!(0,c.equalBytes)((0,c.numberToBytesLE)(u,32),t)||(0,a.isNegativeLE)(u,i))throw new Error(s);const l=o(u*u),h=o(f+n*l),p=o(f-n*l),b=o(h*h),m=o(p*p),g=o(n*r*b-m),{isValid:v,value:y}=P(o(g*m)),w=o(y*p),x=o(y*w*g);let A=o((u+u)*w);(0,a.isNegativeLE)(A,i)&&(A=o(-A));const E=o(h*x),S=o(A*E);if(!v||(0,a.isNegativeLE)(S,i)||E===d)throw new Error(s);return new D(new e.ed25519.ExtendedPoint(A,E,f,S))}static msm(t,n){const i=(0,a.Field)(e.ed25519.CURVE.n,e.ed25519.CURVE.nBitLength);return(0,r.pippenger)(D,i,t,n)}toRawBytes(){let{ex:t,ey:n,ez:r,et:i}=this.ep;const o=e.ed25519.CURVE.Fp.ORDER,s=e.ed25519.CURVE.Fp.create,u=s(s(r+n)*s(r-n)),l=s(t*n),d=s(l*l),{value:f}=P(s(u*d)),h=s(f*u),p=s(f*l),b=s(h*p*i);let m;if((0,a.isNegativeLE)(i*b,o)){let e=s(n*I),r=s(t*I);t=e,n=r,m=s(h*L)}else m=p;(0,a.isNegativeLE)(t*b,o)&&(n=s(-n));let g=s((r-n)*m);return(0,a.isNegativeLE)(g,o)&&(g=s(-g)),(0,c.numberToBytesLE)(g,32)}toHex(){return(0,c.bytesToHex)(this.toRawBytes())}toString(){return this.toHex()}equals(t){C(t);const{ex:n,ey:r}=this.ep,{ex:i,ey:o}=t.ep,a=e.ed25519.CURVE.Fp.create,s=a(n*o)===a(r*i),c=a(r*o)===a(n*i);return s||c}add(e){return C(e),new D(this.ep.add(e.ep))}subtract(e){return C(e),new D(this.ep.subtract(e.ep))}multiply(e){return new D(this.ep.multiply(e))}multiplyUnsafe(e){return new D(this.ep.multiplyUnsafe(e))}double(){return new D(this.ep.double())}negate(){return new D(this.ep.negate())}}e.RistrettoPoint=(D.BASE||(D.BASE=new D(e.ed25519.ExtendedPoint.BASE)),D.ZERO||(D.ZERO=new D(e.ed25519.ExtendedPoint.ZERO)),D);e.hashToRistretto255=(e,r)=>{const i=r.DST,a="string"==typeof i?(0,n.utf8ToBytes)(i):i,s=(0,o.expand_message_xmd)(e,a,64,t.sha512);return D.hashToCurve(s)},e.hash_to_ristretto255=e.hashToRistretto255}(Bn)),Bn}var br,mr={exports:{}},gr={exports:{}},vr={},yr={};var wr,xr,Ar,Er,Sr={};
28
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function _r(){return wr||(wr=1,Sr.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,c=(1<<s)-1,u=c>>1,l=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-l)-1,h>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=u}return(h?-1:1)*a*Math.pow(2,o-r)},Sr.write=function(e,t,n,r,i,o){var a,s,c,u=8*o-i-1,l=(1<<u)-1,d=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*c-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[n+h]=255&a,h+=p,a/=256,u-=8);e[n+h-p]|=128*b}),Sr}
27
+ const t=Vn(),n=Wn(),r=ir(),i=sr(),o=lr(),a=rr(),s=pr(),c=nr(),u=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),d=BigInt(0),f=BigInt(1),h=BigInt(2),p=BigInt(3),b=BigInt(5),m=BigInt(8);function g(e){const t=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),o=u,s=e*e%o*e%o,c=(0,a.pow2)(s,h,o)*s%o,l=(0,a.pow2)(c,f,o)*e%o,d=(0,a.pow2)(l,b,o)*l%o,p=(0,a.pow2)(d,t,o)*d%o,m=(0,a.pow2)(p,n,o)*p%o,g=(0,a.pow2)(m,r,o)*m%o,v=(0,a.pow2)(g,i,o)*g%o,y=(0,a.pow2)(v,i,o)*g%o,w=(0,a.pow2)(y,t,o)*d%o;return{pow_p_5_8:(0,a.pow2)(w,h,o)*e%o,b2:s}}function v(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function y(e,t){const n=u,r=(0,a.mod)(t*t*t,n),i=g(e*(0,a.mod)(r*r*t,n)).pow_p_5_8;let o=(0,a.mod)(e*r*i,n);const s=(0,a.mod)(t*o*o,n),c=o,d=(0,a.mod)(o*l,n),f=s===e,h=s===(0,a.mod)(-e,n),p=s===(0,a.mod)(-e*l,n);return f&&(o=c),(h||p)&&(o=d),(0,a.isNegativeLE)(o,n)&&(o=(0,a.mod)(-o,n)),{isValid:f||h,value:o}}e.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];const w=(()=>(0,a.Field)(u,void 0,!0))(),x=(()=>({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:w,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:m,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:t.sha512,randomBytes:n.randomBytes,adjustScalarBytes:v,uvRatio:y}))();function A(e,t,r){if(t.length>255)throw new Error("Context is too big");return(0,n.concatBytes)((0,n.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,t.length]),t,e)}function E(t){const{y:n}=e.ed25519.ExtendedPoint.fromHex(t),r=BigInt(1);return w.toBytes(w.create((r+n)*w.inv(r-n)))}e.ed25519=(0,i.twistedEdwards)(x),e.ed25519ctx=(0,i.twistedEdwards)({...x,domain:A}),e.ed25519ph=(0,i.twistedEdwards)(Object.assign({},x,{domain:A,prehash:t.sha512})),e.x25519=(0,s.montgomery)({P:u,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:e=>{const t=u,{pow_p_5_8:n,b2:r}=g(e);return(0,a.mod)((0,a.pow2)(n,p,t)*r,t)},adjustScalarBytes:v,randomBytes:n.randomBytes}),e.edwardsToMontgomery=E;const S=(()=>(w.ORDER+p)/m)(),_=(()=>w.pow(h,S))(),O=(()=>w.sqrt(w.neg(w.ONE)))();const N=(()=>(0,a.FpSqrtEven)(w,w.neg(BigInt(486664))))();function k(e){const{xMn:t,xMd:n,yMn:r,yMd:i}=function(e){const t=(w.ORDER-b)/m,n=BigInt(486662);let r=w.sqr(e);r=w.mul(r,h);let i=w.add(r,w.ONE),o=w.neg(n),a=w.sqr(i),s=w.mul(a,i),c=w.mul(r,n);c=w.mul(c,o),c=w.add(c,a),c=w.mul(c,o);let u=w.sqr(s);a=w.sqr(u),u=w.mul(u,s),u=w.mul(u,c),a=w.mul(a,u);let l=w.pow(a,t);l=w.mul(l,u);let d=w.mul(l,O);a=w.sqr(l),a=w.mul(a,s);let p=w.eql(a,c),g=w.cmov(d,l,p),v=w.mul(o,r),y=w.mul(l,e);y=w.mul(y,_);let x=w.mul(y,O),A=w.mul(c,r);a=w.sqr(y),a=w.mul(a,s);let E=w.eql(a,A),S=w.cmov(x,y,E);a=w.sqr(g),a=w.mul(a,s);let N=w.eql(a,c),k=w.cmov(v,o,N),T=w.cmov(S,g,N),C=w.isOdd(T);return T=w.cmov(T,w.neg(T),N!==C),{xMn:k,xMd:i,yMn:T,yMd:f}}(e);let o=w.mul(t,i);o=w.mul(o,N);let a=w.mul(n,r),s=w.sub(t,n),c=w.add(t,n),u=w.mul(a,c),l=w.eql(u,w.ZERO);o=w.cmov(o,w.ZERO,l),a=w.cmov(a,w.ONE,l),s=w.cmov(s,w.ONE,l),c=w.cmov(c,w.ONE,l);const d=w.invertBatch([a,c]);return{x:w.mul(o,d[0]),y:w.mul(s,d[1])}}const T=(()=>(0,o.createHasher)(e.ed25519.ExtendedPoint,e=>k(e[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:w.ORDER,m:1,k:128,expand:"xmd",hash:t.sha512}))();function C(e){if(!(e instanceof D))throw new Error("RistrettoPoint expected")}e.hashToCurve=T.hashToCurve,e.encodeToCurve=T.encodeToCurve;const I=l,B=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),L=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),M=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),R=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),P=e=>y(f,e),U=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),j=t=>e.ed25519.CURVE.Fp.create((0,c.bytesToNumberLE)(t)&U);function F(t){const{d:n}=e.ed25519.CURVE,r=e.ed25519.CURVE.Fp.ORDER,i=e.ed25519.CURVE.Fp.create,o=i(I*t*t),s=i((o+f)*M);let c=BigInt(-1);const u=i((c-n*o)*i(o+n));let{isValid:l,value:d}=y(s,u),h=i(d*t);(0,a.isNegativeLE)(h,r)||(h=i(-h)),l||(d=h),l||(c=o);const p=i(c*(o-f)*R-u),b=d*d,m=i((d+d)*u),g=i(p*B),v=i(f-b),w=i(f+b);return new e.ed25519.ExtendedPoint(i(m*w),i(v*g),i(g*w),i(m*v))}class D{constructor(e){this.ep=e}static fromAffine(t){return new D(e.ed25519.ExtendedPoint.fromAffine(t))}static hashToCurve(e){e=(0,c.ensureBytes)("ristrettoHash",e,64);const t=F(j(e.slice(0,32))),n=F(j(e.slice(32,64)));return new D(t.add(n))}static fromHex(t){t=(0,c.ensureBytes)("ristrettoHex",t,32);const{a:n,d:r}=e.ed25519.CURVE,i=e.ed25519.CURVE.Fp.ORDER,o=e.ed25519.CURVE.Fp.create,s="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",u=j(t);if(!(0,c.equalBytes)((0,c.numberToBytesLE)(u,32),t)||(0,a.isNegativeLE)(u,i))throw new Error(s);const l=o(u*u),h=o(f+n*l),p=o(f-n*l),b=o(h*h),m=o(p*p),g=o(n*r*b-m),{isValid:v,value:y}=P(o(g*m)),w=o(y*p),x=o(y*w*g);let A=o((u+u)*w);(0,a.isNegativeLE)(A,i)&&(A=o(-A));const E=o(h*x),S=o(A*E);if(!v||(0,a.isNegativeLE)(S,i)||E===d)throw new Error(s);return new D(new e.ed25519.ExtendedPoint(A,E,f,S))}static msm(t,n){const i=(0,a.Field)(e.ed25519.CURVE.n,e.ed25519.CURVE.nBitLength);return(0,r.pippenger)(D,i,t,n)}toRawBytes(){let{ex:t,ey:n,ez:r,et:i}=this.ep;const o=e.ed25519.CURVE.Fp.ORDER,s=e.ed25519.CURVE.Fp.create,u=s(s(r+n)*s(r-n)),l=s(t*n),d=s(l*l),{value:f}=P(s(u*d)),h=s(f*u),p=s(f*l),b=s(h*p*i);let m;if((0,a.isNegativeLE)(i*b,o)){let e=s(n*I),r=s(t*I);t=e,n=r,m=s(h*L)}else m=p;(0,a.isNegativeLE)(t*b,o)&&(n=s(-n));let g=s((r-n)*m);return(0,a.isNegativeLE)(g,o)&&(g=s(-g)),(0,c.numberToBytesLE)(g,32)}toHex(){return(0,c.bytesToHex)(this.toRawBytes())}toString(){return this.toHex()}equals(t){C(t);const{ex:n,ey:r}=this.ep,{ex:i,ey:o}=t.ep,a=e.ed25519.CURVE.Fp.create,s=a(n*o)===a(r*i),c=a(r*o)===a(n*i);return s||c}add(e){return C(e),new D(this.ep.add(e.ep))}subtract(e){return C(e),new D(this.ep.subtract(e.ep))}multiply(e){return new D(this.ep.multiply(e))}multiplyUnsafe(e){return new D(this.ep.multiplyUnsafe(e))}double(){return new D(this.ep.double())}negate(){return new D(this.ep.negate())}}e.RistrettoPoint=(D.BASE||(D.BASE=new D(e.ed25519.ExtendedPoint.BASE)),D.ZERO||(D.ZERO=new D(e.ed25519.ExtendedPoint.ZERO)),D);e.hashToRistretto255=(e,r)=>{const i=r.DST,a="string"==typeof i?(0,n.utf8ToBytes)(i):i,s=(0,o.expand_message_xmd)(e,a,64,t.sha512);return D.hashToCurve(s)},e.hash_to_ristretto255=e.hashToRistretto255}(Ln)),Ln}var mr,gr={exports:{}},vr={exports:{}},yr={},wr={};var xr,Ar,Er,Sr,_r={};
28
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function Or(){return xr||(xr=1,_r.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,c=(1<<s)-1,u=c>>1,l=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-l)-1,h>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=u}return(h?-1:1)*a*Math.pow(2,o-r)},_r.write=function(e,t,n,r,i,o){var a,s,c,u=8*o-i-1,l=(1<<u)-1,d=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*c-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[n+h]=255&a,h+=p,a/=256,u-=8);e[n+h-p]|=128*b}),_r}
29
29
  /*!
30
30
  * The buffer module from node.js, for the browser.
31
31
  *
32
32
  * @author Feross Aboukhadijeh <https://feross.org>
33
33
  * @license MIT
34
- */function Or(){return xr||(xr=1,function(e){const t=function(){if(br)return yr;br=1,yr.byteLength=function(e){var t=o(e),n=t[0],r=t[1];return 3*(n+r)/4-r},yr.toByteArray=function(e){var r,i,a=o(e),s=a[0],c=a[1],u=new n(function(e,t,n){return 3*(t+n)/4-n}(0,s,c)),l=0,d=c>0?s-4:s;for(i=0;i<d;i+=4)r=t[e.charCodeAt(i)]<<18|t[e.charCodeAt(i+1)]<<12|t[e.charCodeAt(i+2)]<<6|t[e.charCodeAt(i+3)],u[l++]=r>>16&255,u[l++]=r>>8&255,u[l++]=255&r;return 2===c&&(r=t[e.charCodeAt(i)]<<2|t[e.charCodeAt(i+1)]>>4,u[l++]=255&r),1===c&&(r=t[e.charCodeAt(i)]<<10|t[e.charCodeAt(i+1)]<<4|t[e.charCodeAt(i+2)]>>2,u[l++]=r>>8&255,u[l++]=255&r),u},yr.fromByteArray=function(t){for(var n,r=t.length,i=r%3,o=[],a=16383,c=0,u=r-i;c<u;c+=a)o.push(s(t,c,c+a>u?u:c+a));return 1===i?(n=t[r-1],o.push(e[n>>2]+e[n<<4&63]+"==")):2===i&&(n=(t[r-2]<<8)+t[r-1],o.push(e[n>>10]+e[n>>4&63]+e[n<<2&63]+"=")),o.join("")};for(var e=[],t=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)e[i]=r[i],t[r.charCodeAt(i)]=i;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function a(t){return e[t>>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function s(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(a(r));return i.join("")}return t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63,yr}(),n=_r(),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},e.INSPECT_MAX_BYTES=50;const i=2147483647;function o(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|h(e,t);let r=o(n);const i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(H(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer))return d(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(H(e,SharedArrayBuffer)||e&&H(e.buffer,SharedArrayBuffer)))return d(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return a.from(r,t,n);const i=function(e){if(a.isBuffer(e)){const t=0|f(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||V(e.length)?o(0):l(e);if("Buffer"===e.type&&Array.isArray(e.data))return l(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),o(e<0?0:0|f(e))}function l(e){const t=e.length<0?0:0|f(e.length),n=o(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function d(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,a.prototype),r}function f(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function h(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return X(e).length;default:if(i)return r?-1:q(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return O(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function b(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),V(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,i){let o,a=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let r=-1;for(o=n;o<s;o++)if(u(e,o)===u(t,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===c)return r*a}else-1!==r&&(o-=o-r),r=-1}else for(n+c>s&&(n=s-c),o=n;o>=0;o--){let n=!0;for(let r=0;r<c;r++)if(u(e,o+r)!==u(t,r)){n=!1;break}if(n)return o}return-1}function v(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=t.length;let a;for(r>o/2&&(r=o/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(V(r))return a;e[n+a]=r}return a}function y(e,t,n,r){return K(q(t,e.length-n),e,n,r)}function w(e,t,n,r){return K(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function x(e,t,n,r){return K(X(t),e,n,r)}function A(e,t,n,r){return K(function(e,t){let n,r,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function E(e,n,r){return 0===n&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function S(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=n){let n,r,s,c;switch(a){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(o=c));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=_));return n}(r)}e.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,n){return s(e,t,n)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,n){return function(e,t,n){return c(e),e<=0?o(e):void 0!==t?"string"==typeof n?o(e).fill(t,n):o(e).fill(t):o(e)}(e,t,n)},a.allocUnsafe=function(e){return u(e)},a.allocUnsafeSlow=function(e){return u(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(H(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),H(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=a.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if(H(t,Uint8Array))i+t.length>r.length?(a.isBuffer(t)||(t=a.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!a.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},a.byteLength=h,a.prototype._isBuffer=!0,a.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},a.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},a.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},a.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?S(this,0,e):p.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){let t="";const n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(e,t,n,r,i){if(H(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const c=Math.min(o,s),u=this.slice(r,i),l=e.slice(t,n);for(let e=0;e<c;++e)if(u[e]!==l[e]){o=u[e],s=l[e];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},a.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},a.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},a.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return y(this,e,t,n);case"ascii":case"latin1":case"binary":return w(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function O(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function N(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function k(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=G[e[r]];return i}function T(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function C(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,n,r,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function B(e,t,n,r,i){D(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function L(e,t,n,r,i){D(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function M(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function R(e,t,r,i,o){return t=+t,r>>>=0,o||M(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function P(e,t,r,i,o){return t=+t,r>>>=0,o||M(e,0,r,8),n.write(e,t,r,i,52,8),r+8}a.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,a.prototype),r},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||C(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return r},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||C(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=Y(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||$(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),a.prototype.readBigUInt64BE=Y(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||$(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),a.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||C(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||C(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=Y(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||$(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),a.prototype.readBigInt64BE=Y(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||$(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),a.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),n.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),n.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),n.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),n.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){I(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){I(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigUInt64LE=Y(function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Y(function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);I(this,e,t,n,r-1,-r)}let i=0,o=1,a=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);I(this,e,t,n,r-1,-r)}let i=n-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigInt64LE=Y(function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Y(function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeFloatLE=function(e,t,n){return R(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return R(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return P(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return P(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},a.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const o=a.isBuffer(e)?e:a.from(e,r),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=o[i%s]}return this};const U={};function j(e,t,n){U[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function F(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function D(e,t,n,r,i,o){if(e>n||e<t){const n="bigint"==typeof t?"n":"";let r;throw r=0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`,new U.ERR_OUT_OF_RANGE("value",r,e)}!function(e,t,n){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||$(t,e.length-(n+1))}(r,i,o)}function z(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,n){if(Math.floor(e)!==e)throw z(e,n),new U.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}j("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),j("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),j("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=F(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r},RangeError);const W=/[^+/0-9A-Za-z-_]/g;function q(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function X(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function H(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function V(e){return e!=e}const G=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Y(e){return"undefined"==typeof BigInt?J:e}function J(){throw new Error("BigInt not supported")}}(vr)),vr}
35
- /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */function Nr(){if(Er)return mr.exports;Er=1;var e=65536,t=4294967295;var n=(Ar||(Ar=1,function(e,t){var n=Or(),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=o),o.prototype=Object.create(r.prototype),i(r,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}(gr,gr.exports)),gr.exports).Buffer,r=Xe.crypto||Xe.msCrypto;return r&&r.getRandomValues?mr.exports=function(i,o){if(i>t)throw new RangeError("requested too many random bytes");var a=n.allocUnsafe(i);if(i>0)if(i>e)for(var s=0;s<i;s+=e)r.getRandomValues(a.slice(s,s+e));else r.getRandomValues(a);if("function"==typeof o)return process.nextTick(function(){o(null,a)});return a}:mr.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")},mr.exports}var kr,Tr,Cr={};var Ir,Br,Lr,Mr={},Rr="6.6.1",Pr={},Ur={exports:{}},jr=Ur.exports;function Fr(){return Ir||(Ir=1,function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:ht.Buffer}catch(e){}function a(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function s(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function c(e,t,n,r){for(var i=0,o=Math.min(e.length,n),a=t;a<o;a++){var s=e.charCodeAt(a)-48;i*=r,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)i=s(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)i=s(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,l=n;l<s;l+=r)u=c(e,l,l+r,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var d=1;for(u=c(e,l,e.length,t),l=0;l<a;l++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;n.words[0]=s;for(var u=1;u<r;u++){for(var l=c>>>26,d=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}n.words[u]=0|d,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n.strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],c=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?u[6-c.length]+c+r:c+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=l[e],h=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?b+r:u[f-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(o),l=this.clone();if(c){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[s]=a;for(;s<o;s++)u[s]=0}else{for(s=0;s<o-i;s++)u[s]=0;for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[o-s-1]=a}return u},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 8191&t||(n+=13,t>>>=13),127&t||(n+=7,t>>>=7),15&t||(n+=4,t>>>=4),3&t||(n+=2,t>>>=2),1&t||n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},i.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o<r.length;o++)t=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<n.length;o++)t=(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a<r.length;a++)o=(t=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<n.length;a++)o=(t=(0|n.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var h=function(e,t,n){var r,i,o,a=e.words,s=t.words,c=n.words,u=0,l=0|a[0],d=8191&l,f=l>>>13,h=0|a[1],p=8191&h,b=h>>>13,m=0|a[2],g=8191&m,v=m>>>13,y=0|a[3],w=8191&y,x=y>>>13,A=0|a[4],E=8191&A,S=A>>>13,_=0|a[5],O=8191&_,N=_>>>13,k=0|a[6],T=8191&k,C=k>>>13,I=0|a[7],B=8191&I,L=I>>>13,M=0|a[8],R=8191&M,P=M>>>13,U=0|a[9],j=8191&U,F=U>>>13,D=0|s[0],z=8191&D,$=D>>>13,W=0|s[1],q=8191&W,X=W>>>13,K=0|s[2],H=8191&K,V=K>>>13,G=0|s[3],Y=8191&G,J=G>>>13,Z=0|s[4],Q=8191&Z,ee=Z>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,le=0|s[8],de=8191&le,fe=le>>>13,he=0|s[9],pe=8191&he,be=he>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(u+(r=Math.imul(d,z))|0)+((8191&(i=(i=Math.imul(d,$))+Math.imul(f,z)|0))<<13)|0;u=((o=Math.imul(f,$))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(p,z),i=(i=Math.imul(p,$))+Math.imul(b,z)|0,o=Math.imul(b,$);var ge=(u+(r=r+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(f,q)|0))<<13)|0;u=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,z),i=(i=Math.imul(g,$))+Math.imul(v,z)|0,o=Math.imul(v,$),r=r+Math.imul(p,q)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,X)|0;var ve=(u+(r=r+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,H)|0))<<13)|0;u=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,z),i=(i=Math.imul(w,$))+Math.imul(x,z)|0,o=Math.imul(x,$),r=r+Math.imul(g,q)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,X)|0,r=r+Math.imul(p,H)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,V)|0;var ye=(u+(r=r+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(E,z),i=(i=Math.imul(E,$))+Math.imul(S,z)|0,o=Math.imul(S,$),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,X)|0,r=r+Math.imul(g,H)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,J)|0;var we=(u+(r=r+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(O,z),i=(i=Math.imul(O,$))+Math.imul(N,z)|0,o=Math.imul(N,$),r=r+Math.imul(E,q)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,X)|0,r=r+Math.imul(w,H)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,V)|0,r=r+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,J)|0,r=r+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var xe=(u+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((o=o+Math.imul(f,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(T,z),i=(i=Math.imul(T,$))+Math.imul(C,z)|0,o=Math.imul(C,$),r=r+Math.imul(O,q)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,X)|0,r=r+Math.imul(E,H)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,V)|0,r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,J)|0,r=r+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(b,ne)|0,o=o+Math.imul(b,re)|0;var Ae=(u+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(B,z),i=(i=Math.imul(B,$))+Math.imul(L,z)|0,o=Math.imul(L,$),r=r+Math.imul(T,q)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,X)|0,r=r+Math.imul(O,H)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,J)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Ee=(u+(r=r+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(R,z),i=(i=Math.imul(R,$))+Math.imul(P,z)|0,o=Math.imul(P,$),r=r+Math.imul(B,q)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,X)|0,r=r+Math.imul(T,H)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,J)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0;var Se=(u+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,z),i=(i=Math.imul(j,$))+Math.imul(F,z)|0,o=Math.imul(F,$),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,X)|0,r=r+Math.imul(B,H)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,V)|0,r=r+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,J)|0,r=r+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,r=r+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(v,ce)|0,o=o+Math.imul(v,ue)|0,r=r+Math.imul(p,de)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,fe)|0;var _e=(u+(r=r+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,be)|0)+Math.imul(f,pe)|0))<<13)|0;u=((o=o+Math.imul(f,be)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(j,q),i=(i=Math.imul(j,X))+Math.imul(F,q)|0,o=Math.imul(F,X),r=r+Math.imul(R,H)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,r=r+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,J)|0,r=r+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,ee)|0,r=r+Math.imul(O,ne)|0,i=(i=i+Math.imul(O,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,fe)|0;var Oe=(u+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(j,H),i=(i=Math.imul(j,V))+Math.imul(F,H)|0,o=Math.imul(F,V),r=r+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,J)|0,r=r+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(C,ne)|0,o=o+Math.imul(C,re)|0,r=r+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,r=r+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,fe)|0;var Ne=(u+(r=r+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(v,pe)|0))<<13)|0;u=((o=o+Math.imul(v,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(j,Y),i=(i=Math.imul(j,J))+Math.imul(F,Y)|0,o=Math.imul(F,J),r=r+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,r=r+Math.imul(B,ne)|0,i=(i=i+Math.imul(B,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,r=r+Math.imul(O,ce)|0,i=(i=i+Math.imul(O,ue)|0)+Math.imul(N,ce)|0,o=o+Math.imul(N,ue)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,fe)|0;var ke=(u+(r=r+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(x,pe)|0))<<13)|0;u=((o=o+Math.imul(x,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,Q),i=(i=Math.imul(j,ee))+Math.imul(F,Q)|0,o=Math.imul(F,ee),r=r+Math.imul(R,ne)|0,i=(i=i+Math.imul(R,re)|0)+Math.imul(P,ne)|0,o=o+Math.imul(P,re)|0,r=r+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(C,ce)|0,o=o+Math.imul(C,ue)|0,r=r+Math.imul(O,de)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,fe)|0;var Te=(u+(r=r+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ne),i=(i=Math.imul(j,re))+Math.imul(F,ne)|0,o=Math.imul(F,re),r=r+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,r=r+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,ue)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,ue)|0,r=r+Math.imul(T,de)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(C,de)|0,o=o+Math.imul(C,fe)|0;var Ce=(u+(r=r+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(N,pe)|0))<<13)|0;u=((o=o+Math.imul(N,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,oe),i=(i=Math.imul(j,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),r=r+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,r=r+Math.imul(B,de)|0,i=(i=i+Math.imul(B,fe)|0)+Math.imul(L,de)|0,o=o+Math.imul(L,fe)|0;var Ie=(u+(r=r+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,be)|0)+Math.imul(C,pe)|0))<<13)|0;u=((o=o+Math.imul(C,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,ce),i=(i=Math.imul(j,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),r=r+Math.imul(R,de)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,fe)|0;var Be=(u+(r=r+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,be)|0)+Math.imul(L,pe)|0))<<13)|0;u=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,de),i=(i=Math.imul(j,fe))+Math.imul(F,de)|0,o=Math.imul(F,fe);var Le=(u+(r=r+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(P,pe)|0))<<13)|0;u=((o=o+Math.imul(P,be)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863;var Me=(u+(r=Math.imul(j,pe))|0)+((8191&(i=(i=Math.imul(j,be))+Math.imul(F,pe)|0))<<13)|0;return u=((o=Math.imul(F,be))+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,c[0]=me,c[1]=ge,c[2]=ve,c[3]=ye,c[4]=we,c[5]=xe,c[6]=Ae,c[7]=Ee,c[8]=Se,c[9]=_e,c[10]=Oe,c[11]=Ne,c[12]=ke,c[13]=Te,c[14]=Ce,c[15]=Ie,c[16]=Be,c[17]=Le,c[18]=Me,0!==u&&(c[19]=u,n.length++),n};function p(e,t,n){return(new b).mulp(e,t,n)}function b(e,t){this.x=e,this.y=t}Math.imul||(h=f),i.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=10===this.length&&10===e.length?h(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var l=o-u,d=(0|e.words[l])*(0|t.words[u]),f=67108863&d;s=67108863&(f=f+s|0),i+=(a=(a=a+(d/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):p(this,e,t),n},b.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},b.prototype.revBin=function(e,t,n){if(0===e||e===n-1)return e;for(var r=0,i=0;i<t;i++)r|=(1&e)<<t-i-1,e>>=1;return r},b.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a<o;a++)r[a]=t[e[a]],i[a]=n[e[a]]},b.prototype.transform=function(e,t,n,r,i,o){this.permute(o,e,t,n,r,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,c=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var d=c,f=u,h=0;h<a;h++){var p=n[l+h],b=r[l+h],m=n[l+h+a],g=r[l+h+a],v=d*m-f*g;g=d*g+f*m,m=v,n[l+h]=p+m,r[l+h]=b+g,n[l+h+a]=p-m,r[l+h+a]=b-g,h!==s&&(v=c*d-u*f,f=c*f+u*d,d=v)}},b.prototype.guessLen13b=function(e,t){var n=1|Math.max(t,e),r=1&n,i=0;for(n=n/2|0;n;n>>>=1)i++;return 1<<i+1+r},b.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var i=e[r];e[r]=e[n-r-1],e[n-r-1]=i,i=t[r],t[r]=-t[n-r-1],t[n-r-1]=-i}},b.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var i=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+n;e[r]=67108863&i,n=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(!(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=0;return t},b.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(r),o=this.stub(r),a=new Array(r),s=new Array(r),c=new Array(r),u=new Array(r),l=new Array(r),d=new Array(r),f=n.words;f.length=r,this.convert13b(e.words,e.length,a,r),this.convert13b(t.words,t.length,u,r),this.transform(a,o,s,c,r,i),this.transform(u,o,l,d,r,i);for(var h=0;h<r;h++){var p=s[h]*l[h]-c[h]*d[h];c[h]=s[h]*d[h]+c[h]*l[h],s[h]=p}return this.conjugate(s,c,r),this.transform(s,c,f,o,r,i),this.conjugate(f,o,r),this.normalize13b(f,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),p(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this.length=0===e?1:this.length,this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=(e.words[r]&1<<i)>>>i}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var o=n.sqr();r<t.length;r++,o=o.sqr())0!==t[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,c=(0|this.words[t])-s<<r;this.words[t]=c|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,c=r;if(i-=a,i=Math.max(0,i),c){for(var u=0;u<a;u++)c.words[u]=this.words[u];c.length=a}if(0===a);else if(this.length>a)for(this.length-=a,u=0;u<this.length;u++)this.words[u]=this.words[u+a];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var c=(0|e.words[i])*t;s=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,c=r.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var l=r.clone()._ishlnsubmul(o,1,c);0===l.negative&&(r=l,s&&(s.words[c]=1));for(var d=c-1;d>=0;d--){var f=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(o,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=f)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0===(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,b=1;0===(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(c)):(r.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:r.iushln(u)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,f=1;0===(r.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},r(v,g),v.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&n,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&n)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(y,g),r(w,g),r(x,g),x.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return m[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,o),f=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var b=h,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m<p);var g=this.pow(d,new i(1).iushln(p-m-1));f=f.redMul(g),d=g.redSqr(),h=h.redMul(d),p=m}return f},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var o=n[0],a=0,s=0,c=t.bitLength()%26;for(0===c&&(c=26),r=t.length-1;r>=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var d=u>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}c=26}return o},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new E(e)},r(E,A),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(Ur,jr)),Ur.exports}function Dr(){if(Lr)return Br;function e(e,t){if(!e)throw new Error(t||"Assertion failed")}return Lr=1,Br=e,e.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},Br}var zr,$r,Wr={};function qr(){return zr||(zr=1,function(){var e=Wr;function t(e){return 1===e.length?"0"+e:e}function n(e){for(var n="",r=0;r<e.length;r++)n+=t(e[r].toString(16));return n}e.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"!=typeof e){for(var r=0;r<e.length;r++)n[r]=0|e[r];return n}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(r=0;r<e.length;r+=2)n.push(parseInt(e[r]+e[r+1],16))}else for(r=0;r<e.length;r++){var i=e.charCodeAt(r),o=i>>8,a=255&i;o?n.push(o,a):n.push(a)}return n},e.zero2=t,e.toHex=n,e.encode=function(e,t){return"hex"===t?n(e):e}}()),Wr}function Xr(){return $r||($r=1,function(){var e=Pr,t=Fr(),n=Dr(),r=qr();e.assert=n,e.toArray=r.toArray,e.zero2=r.zero2,e.toHex=r.toHex,e.encode=r.encode,e.getNAF=function(e,t,n){var r,i=new Array(Math.max(e.bitLength(),n)+1);for(r=0;r<i.length;r+=1)i[r]=0;var o=1<<t+1,a=e.clone();for(r=0;r<i.length;r++){var s,c=a.andln(o-1);a.isOdd()?(s=c>(o>>1)-1?(o>>1)-c:c,a.isubn(s)):s=0,i[r]=s,a.iushrn(1)}return i},e.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=1&c?3!==(r=e.andln(7)+i&7)&&5!==r||2!==u?c:-c:0,n[0].push(a),s=1&u?3!==(r=t.andln(7)+o&7)&&5!==r||2!==c?u:-u:0,n[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return n},e.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t},e.intFromLE=function(e){return new t(e,"hex","le")}}()),Pr}var Kr,Hr={exports:{}};function Vr(){if(Kr)return Hr.exports;var e;function t(e){this.rand=e}if(Kr=1,Hr.exports=function(n){return e||(e=new t(null)),e.generate(n)},Hr.exports.Rand=t,t.prototype.generate=function(e){return this._rand(e)},t.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n<t.length;n++)t[n]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(t.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var n=ht;if("function"!=typeof n.randomBytes)throw new Error("Not supported");t.prototype._rand=function(e){return n.randomBytes(e)}}catch(e){}return Hr.exports}var Gr,Yr,Jr={};function Zr(){if(Yr)return Gr;Yr=1;var e=Fr(),t=Xr(),n=t.getNAF,r=t.getJSF,i=t.assert;function o(t,n){this.type=t,this.p=new e(n.p,16),this.red=n.prime?e.red(n.prime):e.mont(this.p),this.zero=new e(0).toRed(this.red),this.one=new e(1).toRed(this.red),this.two=new e(2).toRed(this.red),this.n=n.n&&new e(n.n,16),this.g=n.g&&this.pointFromJSON(n.g,n.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function a(e,t){this.curve=e,this.type=t,this.precomputed=null}return Gr=o,o.prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(e,t){i(e.precomputed);var r=e._getDoubles(),o=n(t,1,this._bitLength),a=(1<<r.step+1)-(r.step%2==0?2:1);a/=3;var s,c,u=[];for(s=0;s<o.length;s+=r.step){c=0;for(var l=s+r.step-1;l>=s;l--)c=(c<<1)+o[l];u.push(c)}for(var d=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=a;h>0;h--){for(s=0;s<u.length;s++)(c=u[s])===h?f=f.mixedAdd(r.points[s]):c===-h&&(f=f.mixedAdd(r.points[s].neg()));d=d.add(f)}return d.toP()},o.prototype._wnafMul=function(e,t){var r=4,o=e._getNAFPoints(r);r=o.wnd;for(var a=o.points,s=n(t,r,this._bitLength),c=this.jpoint(null,null,null),u=s.length-1;u>=0;u--){for(var l=0;u>=0&&0===s[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var d=s[u];i(0!==d),c="affine"===e.type?d>0?c.mixedAdd(a[d-1>>1]):c.mixedAdd(a[-d-1>>1].neg()):d>0?c.add(a[d-1>>1]):c.add(a[-d-1>>1].neg())}return"affine"===e.type?c.toP():c},o.prototype._wnafMulAdd=function(e,t,i,o,a){var s,c,u,l=this._wnafT1,d=this._wnafT2,f=this._wnafT3,h=0;for(s=0;s<o;s++){var p=(u=t[s])._getNAFPoints(e);l[s]=p.wnd,d[s]=p.points}for(s=o-1;s>=1;s-=2){var b=s-1,m=s;if(1===l[b]&&1===l[m]){var g=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(g[1]=t[b].add(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].add(t[m].neg())):(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=r(i[b],i[m]);for(h=Math.max(y[0].length,h),f[b]=new Array(h),f[m]=new Array(h),c=0;c<h;c++){var w=0|y[0][c],x=0|y[1][c];f[b][c]=v[3*(w+1)+(x+1)],f[m][c]=0,d[b]=g}}else f[b]=n(i[b],l[b],this._bitLength),f[m]=n(i[m],l[m],this._bitLength),h=Math.max(f[b].length,h),h=Math.max(f[m].length,h)}var A=this.jpoint(null,null,null),E=this._wnafT4;for(s=h;s>=0;s--){for(var S=0;s>=0;){var _=!0;for(c=0;c<o;c++)E[c]=0|f[c][s],0!==E[c]&&(_=!1);if(!_)break;S++,s--}if(s>=0&&S++,A=A.dblp(S),s<0)break;for(c=0;c<o;c++){var O=E[c];0!==O&&(O>0?u=d[c][O-1>>1]:O<0&&(u=d[c][-O-1>>1].neg()),A="affine"===u.type?A.mixedAdd(u):A.add(u))}}for(s=0;s<o;s++)d[s]=null;return a?A:A.toP()},o.BasePoint=a,a.prototype.eq=function(){throw new Error("Not implemented")},a.prototype.validate=function(){return this.curve.validate(this)},o.prototype.decodePoint=function(e,n){e=t.toArray(e,n);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?i(e[e.length-1]%2==0):7===e[0]&&i(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},a.prototype.encodeCompressed=function(e){return this.encode(e,!0)},a.prototype._encode=function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},a.prototype.encode=function(e,n){return t.encode(this._encode(n),e)},a.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},a.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},a.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)r=r.dbl();n.push(r)}return{step:e,points:n}},a.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,r=1===n?null:this.dbl(),i=1;i<n;i++)t[i]=t[i-1].add(r);return{wnd:e,points:t}},a.prototype._getBeta=function(){return null},a.prototype.dblp=function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},Gr}var Qr,ei,ti,ni,ri,ii,oi,ai,si={exports:{}};function ci(){return Qr||(Qr=1,"function"==typeof Object.create?si.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:si.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),si.exports}function ui(){return ai||(ai=1,function(e){var t=e;t.base=Zr(),t.short=function(){if(ti)return ei;ti=1;var e=Xr(),t=Fr(),n=ci(),r=Zr(),i=e.assert;function o(e){r.call(this,"short",e),this.a=new t(e.a,16).toRed(this.red),this.b=new t(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function a(e,n,i,o){r.BasePoint.call(this,e,"affine"),null===n&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new t(n,16),this.y=new t(i,16),o&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function s(e,n,i,o){r.BasePoint.call(this,e,"jacobian"),null===n&&null===i&&null===o?(this.x=this.curve.one,this.y=this.curve.one,this.z=new t(0)):(this.x=new t(n,16),this.y=new t(i,16),this.z=new t(o,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return n(o,r),ei=o,o.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var n,r;if(e.beta)n=new t(e.beta,16).toRed(this.red);else{var o=this._getEndoRoots(this.p);n=(n=o[0].cmp(o[1])<0?o[0]:o[1]).toRed(this.red)}if(e.lambda)r=new t(e.lambda,16);else{var a=this._getEndoRoots(this.n);0===this.g.mul(a[0]).x.cmp(this.g.x.redMul(n))?r=a[0]:(r=a[1],i(0===this.g.mul(r).x.cmp(this.g.x.redMul(n))))}return{beta:n,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new t(e.a,16),b:new t(e.b,16)}}):this._getEndoBasis(r)}}},o.prototype._getEndoRoots=function(e){var n=e===this.p?this.red:t.mont(e),r=new t(2).toRed(n).redInvm(),i=r.redNeg(),o=new t(3).toRed(n).redNeg().redSqrt().redMul(r);return[i.redAdd(o).fromRed(),i.redSub(o).fromRed()]},o.prototype._getEndoBasis=function(e){for(var n,r,i,o,a,s,c,u,l,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),p=new t(1),b=new t(0),m=new t(0),g=new t(1),v=0;0!==f.cmpn(0);){var y=h.div(f);u=h.sub(y.mul(f)),l=m.sub(y.mul(p));var w=g.sub(y.mul(b));if(!i&&u.cmp(d)<0)n=c.neg(),r=p,i=u.neg(),o=l;else if(i&&2===++v)break;c=u,h=f,f=u,m=p,p=l,g=b,b=w}a=u.neg(),s=l;var x=i.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(x)>=0&&(a=n,s=r),i.negative&&(i=i.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:i,b:o},{a:a,b:s}]},o.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=i.mul(n.a),s=o.mul(r.a),c=i.mul(n.b),u=o.mul(r.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},o.prototype.pointFromX=function(e,n){(e=new t(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=i.fromRed().isOdd();return(n&&!o||!n&&o)&&(i=i.redNeg()),this.point(e,i)},o.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},o.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],c=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),c=c.neg(!0)),r[2*o]=s,r[2*o+1]=c,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var u=this._wnafMulAdd(1,r,i,2*o,n),l=0;l<2*o;l++)r[l]=null,i[l]=null;return u},n(a,r.BasePoint),o.prototype.point=function(e,t,n){return new a(this,e,t,n)},o.prototype.pointFromJSON=function(e,t){return a.fromJSON(this,e,t)},a.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,r=function(e){return n.point(e.x.redMul(n.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}}return t}},a.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},a.fromJSON=function(e,t,n){"string"==typeof t&&(t=JSON.parse(t));var r=e.point(t[0],t[1],n);if(!t[2])return r;function i(t){return e.point(t[0],t[1],n)}var o=t[2];return r.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[r].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[r].concat(o.naf.points.map(i))}},r},a.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},a.prototype.isInfinity=function(){return this.inf},a.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},a.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},a.prototype.getX=function(){return this.x.fromRed()},a.prototype.getY=function(){return this.y.fromRed()},a.prototype.mul=function(e){return e=new t(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},a.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},a.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},a.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},a.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},a.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},n(s,r.BasePoint),o.prototype.jpoint=function(e,t,n){return new s(this,e,t,n)},s.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},s.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},s.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),d=r.redMul(u),f=c.redSqr().redIAdd(l).redISub(d).redISub(d),h=c.redMul(d.redISub(f)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(f,h,p)},s.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=n.redSub(r),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),l=n.redMul(c),d=s.redSqr().redIAdd(u).redISub(l).redISub(l),f=s.redMul(l.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,f,h)},s.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var r=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,c=s.redSqr().redSqr(),u=a.redAdd(a);for(t=0;t<e;t++){var l=o.redSqr(),d=u.redSqr(),f=d.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(r.redMul(c)),p=o.redMul(d),b=h.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),g=h.redMul(m);g=g.redIAdd(g).redISub(f);var v=u.redMul(s);t+1<e&&(c=c.redMul(f)),o=b,s=v,u=g}return this.curve.jpoint(o,u.redMul(i),s)},s.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},s.prototype._zeroDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r),c=s.redSqr().redISub(a).redISub(a),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=s.redMul(a.redISub(c)).redISub(u),n=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),f=d.redSqr(),h=this.x.redAdd(d).redSqr().redISub(l).redISub(f);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),b=p.redSqr(),m=f.redIAdd(f);m=(m=m.redIAdd(m)).redIAdd(m),e=b.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(m),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(e,t,n)},s.prototype._threeDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),c=s.redSqr().redISub(a).redISub(a);e=c;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=s.redMul(a.redISub(c)).redISub(u),n=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),f=this.x.redMul(d),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=f.redIAdd(f),b=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(b),n=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var m=d.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,n)},s.prototype._dbl=function(){var e=this.curve.a,t=this.x,n=this.y,r=this.z,i=r.redSqr().redSqr(),o=t.redSqr(),a=n.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(a),l=s.redSqr().redISub(u.redAdd(u)),d=u.redISub(l),f=a.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=s.redMul(d).redISub(f),p=n.redAdd(n).redMul(r);return this.curve.jpoint(l,h,p)},s.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),r=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(r),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),c=r.redIAdd(r);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(s).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var f=this.y.redMul(u.redMul(c.redISub(u)).redISub(a.redMul(s)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=this.z.redAdd(a).redSqr().redISub(n).redISub(s);return this.curve.jpoint(d,f,h)},s.prototype.mul=function(e,n){return e=new t(e,n),this.curve._wnafMul(this,e)},s.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(0!==this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0))return!1;var r=t.redMul(this.z),i=n.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(r)).cmpn(0)},s.prototype.eqXToP=function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(n))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(t);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},s.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},s.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},ei}(),t.mont=function(){if(ri)return ni;ri=1;var e=Fr(),t=ci(),n=Zr(),r=Xr();function i(t){n.call(this,"mont",t),this.a=new e(t.a,16).toRed(this.red),this.b=new e(t.b,16).toRed(this.red),this.i4=new e(4).toRed(this.red).redInvm(),this.two=new e(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function o(t,r,i){n.BasePoint.call(this,t,"projective"),null===r&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new e(r,16),this.z=new e(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return t(i,n),ni=i,i.prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),r=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},t(o,n.BasePoint),i.prototype.decodePoint=function(e,t){return this.point(r.toArray(e,t),1)},i.prototype.point=function(e,t){return new o(this,e,t)},i.prototype.pointFromJSON=function(e){return o.fromJSON(this,e)},o.prototype.precompute=function(){},o.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},o.fromJSON=function(e,t){return new o(e,t[0],t[1]||e.one)},o.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},o.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),n=e.redSub(t),r=e.redMul(t),i=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(r,i)},o.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),r=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(n),a=i.redMul(r),s=t.z.redMul(o.redAdd(a).redSqr()),c=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},o.prototype.mul=function(e){for(var t=e.clone(),n=this,r=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(n=n.diffAdd(r,this),r=r.dbl()):(r=n.diffAdd(r,this),n=n.dbl());return r},o.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},o.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()},ni}(),t.edwards=function(){if(oi)return ii;oi=1;var e=Xr(),t=Fr(),n=ci(),r=Zr(),i=e.assert;function o(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,r.call(this,"edwards",e),this.a=new t(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new t(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new t(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),i(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function a(e,n,i,o,a){r.BasePoint.call(this,e,"projective"),null===n&&null===i&&null===o?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new t(n,16),this.y=new t(i,16),this.z=o?new t(o,16):this.curve.one,this.t=a&&new t(a,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return n(o,r),ii=o,o.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},o.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},o.prototype.jpoint=function(e,t,n,r){return this.point(e,t,n,r)},o.prototype.pointFromX=function(e,n){(e=new t(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=i.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var c=s.fromRed().isOdd();return(n&&!c||!n&&c)&&(s=s.redNeg()),this.point(e,s)},o.prototype.pointFromY=function(e,n){(e=new t(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(n)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==n&&(s=s.redNeg()),this.point(s,e)},o.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),r=t.redMul(this.a).redAdd(n),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return 0===r.cmp(i)},n(a,r.BasePoint),o.prototype.pointFromJSON=function(e){return a.fromJSON(this,e)},o.prototype.point=function(e,t,n,r){return new a(this,e,t,n,r)},a.fromJSON=function(e,t){return new a(e,t[0],t[1],t[2])},a.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},a.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},a.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var r=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=r.redAdd(t),a=o.redSub(n),s=r.redSub(t),c=i.redMul(a),u=o.redMul(s),l=i.redMul(s),d=a.redMul(o);return this.curve.point(c,u,d,l)},a.prototype._projDbl=function(){var e,t,n,r,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(r=this.curve._mulA(s)).redAdd(c);this.zOne?(e=a.redSub(s).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(r.redSub(c)),n=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=a.redSub(s).redISub(c).redMul(o),t=u.redMul(r.redSub(c)),n=u.redMul(o))}else r=s.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=r.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(r)).redMul(o),t=this.curve._mulC(r).redMul(s.redISub(c)),n=r.redMul(o);return this.curve.point(e,t,n)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},a.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(t),a=i.redSub(r),s=i.redAdd(r),c=n.redAdd(t),u=o.redMul(a),l=s.redMul(c),d=o.redMul(c),f=a.redMul(s);return this.curve.point(u,l,f,d)},a.prototype._projAdd=function(e){var t,n,r=this.z.redMul(e.z),i=r.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),u=i.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),d=r.redMul(c).redMul(l);return this.curve.twisted?(t=r.redMul(u).redMul(a.redSub(this.curve._mulA(o))),n=c.redMul(u)):(t=r.redMul(u).redMul(a.redSub(o)),n=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,n)},a.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},a.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},a.prototype.mulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},a.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},a.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},a.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},a.prototype.getX=function(){return this.normalize(),this.x.fromRed()},a.prototype.getY=function(){return this.normalize(),this.y.fromRed()},a.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},a.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var n=e.clone(),r=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},a.prototype.toP=a.prototype.normalize,a.prototype.mixedAdd=a.prototype.add,ii}()}(Jr)),Jr}var li,di={},fi={},hi={};function pi(){if(li)return hi;li=1;var e=Dr(),t=ci();function n(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function r(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function i(e){return 1===e.length?"0"+e:e}function o(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}return hi.inherits=t,hi.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)r.push(parseInt(e[o]+e[o+1],16))}else for(var i=0,o=0;o<e.length;o++){var a=e.charCodeAt(o);a<128?r[i++]=a:a<2048?(r[i++]=a>>6|192,r[i++]=63&a|128):n(e,o)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++o)),r[i++]=a>>18|240,r[i++]=a>>12&63|128,r[i++]=a>>6&63|128,r[i++]=63&a|128):(r[i++]=a>>12|224,r[i++]=a>>6&63|128,r[i++]=63&a|128)}else for(o=0;o<e.length;o++)r[o]=0|e[o];return r},hi.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=i(e[n].toString(16));return t},hi.htonl=r,hi.toHex32=function(e,t){for(var n="",i=0;i<e.length;i++){var a=e[i];"little"===t&&(a=r(a)),n+=o(a.toString(16))}return n},hi.zero2=i,hi.zero8=o,hi.join32=function(t,n,r,i){var o=r-n;e(o%4==0);for(var a=new Array(o/4),s=0,c=n;s<a.length;s++,c+=4){var u;u="big"===i?t[c]<<24|t[c+1]<<16|t[c+2]<<8|t[c+3]:t[c+3]<<24|t[c+2]<<16|t[c+1]<<8|t[c],a[s]=u>>>0}return a},hi.split32=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r<e.length;r++,i+=4){var o=e[r];"big"===t?(n[i]=o>>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},hi.rotr32=function(e,t){return e>>>t|e<<32-t},hi.rotl32=function(e,t){return e<<t|e>>>32-t},hi.sum32=function(e,t){return e+t>>>0},hi.sum32_3=function(e,t,n){return e+t+n>>>0},hi.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},hi.sum32_5=function(e,t,n,r,i){return e+t+n+r+i>>>0},hi.sum64=function(e,t,n,r){var i=e[t],o=r+e[t+1]>>>0,a=(o<r?1:0)+n+i;e[t]=a>>>0,e[t+1]=o},hi.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},hi.sum64_lo=function(e,t,n,r){return t+r>>>0},hi.sum64_4_hi=function(e,t,n,r,i,o,a,s){var c=0,u=t;return c+=(u=u+r>>>0)<t?1:0,c+=(u=u+o>>>0)<o?1:0,e+n+i+a+(c+=(u=u+s>>>0)<s?1:0)>>>0},hi.sum64_4_lo=function(e,t,n,r,i,o,a,s){return t+r+o+s>>>0},hi.sum64_5_hi=function(e,t,n,r,i,o,a,s,c,u){var l=0,d=t;return l+=(d=d+r>>>0)<t?1:0,l+=(d=d+o>>>0)<o?1:0,l+=(d=d+s>>>0)<s?1:0,e+n+i+a+c+(l+=(d=d+u>>>0)<u?1:0)>>>0},hi.sum64_5_lo=function(e,t,n,r,i,o,a,s,c,u){return t+r+o+s+u>>>0},hi.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},hi.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},hi.shr64_hi=function(e,t,n){return e>>>n},hi.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},hi}var bi,mi={};function gi(){if(bi)return mi;bi=1;var e=pi(),t=Dr();function n(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return mi.BlockHash=n,n.prototype.update=function(t,n){if(t=e.toArray(t,n),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=e.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},n.prototype.digest=function(e){return this.update(this._pad()),t(null===this.pending),this._digest(e)},n.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var i=1;i<n;i++)r[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)r[i++]=0;r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=e>>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o<this.padLength;o++)r[i++]=0;return r},mi}var vi,yi,wi,xi,Ai,Ei,Si,_i,Oi,Ni,ki,Ti,Ci={},Ii={};function Bi(){if(vi)return Ii;vi=1;var e=pi().rotr32;function t(e,t,n){return e&t^~e&n}function n(e,t,n){return e&t^e&n^t&n}function r(e,t,n){return e^t^n}return Ii.ft_1=function(e,i,o,a){return 0===e?t(i,o,a):1===e||3===e?r(i,o,a):2===e?n(i,o,a):void 0},Ii.ch32=t,Ii.maj32=n,Ii.p32=r,Ii.s0_256=function(t){return e(t,2)^e(t,13)^e(t,22)},Ii.s1_256=function(t){return e(t,6)^e(t,11)^e(t,25)},Ii.g0_256=function(t){return e(t,7)^e(t,18)^t>>>3},Ii.g1_256=function(t){return e(t,17)^e(t,19)^t>>>10},Ii}function Li(){if(Ai)return xi;Ai=1;var e=pi(),t=gi(),n=Bi(),r=Dr(),i=e.sum32,o=e.sum32_4,a=e.sum32_5,s=n.ch32,c=n.maj32,u=n.s0_256,l=n.s1_256,d=n.g0_256,f=n.g1_256,h=t.BlockHash,p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;h.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=p,this.W=new Array(64)}return e.inherits(b,h),xi=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var n=this.W,h=0;h<16;h++)n[h]=e[t+h];for(;h<n.length;h++)n[h]=o(f(n[h-2]),n[h-7],d(n[h-15]),n[h-16]);var p=this.h[0],b=this.h[1],m=this.h[2],g=this.h[3],v=this.h[4],y=this.h[5],w=this.h[6],x=this.h[7];for(r(this.k.length===n.length),h=0;h<n.length;h++){var A=a(x,l(v),s(v,y,w),this.k[h],n[h]),E=i(u(p),c(p,b,m));x=w,w=y,y=v,v=i(g,A),g=m,m=b,b=p,p=i(A,E)}this.h[0]=i(this.h[0],p),this.h[1]=i(this.h[1],b),this.h[2]=i(this.h[2],m),this.h[3]=i(this.h[3],g),this.h[4]=i(this.h[4],v),this.h[5]=i(this.h[5],y),this.h[6]=i(this.h[6],w),this.h[7]=i(this.h[7],x)},b.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},xi}function Mi(){if(Oi)return _i;Oi=1;var e=pi(),t=gi(),n=Dr(),r=e.rotr64_hi,i=e.rotr64_lo,o=e.shr64_hi,a=e.shr64_lo,s=e.sum64,c=e.sum64_hi,u=e.sum64_lo,l=e.sum64_4_hi,d=e.sum64_4_lo,f=e.sum64_5_hi,h=e.sum64_5_lo,p=t.BlockHash,b=[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 m(){if(!(this instanceof m))return new m;p.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function g(e,t,n,r,i){var o=e&n^~e&i;return o<0&&(o+=4294967296),o}function v(e,t,n,r,i,o){var a=t&r^~t&o;return a<0&&(a+=4294967296),a}function y(e,t,n,r,i){var o=e&n^e&i^n&i;return o<0&&(o+=4294967296),o}function w(e,t,n,r,i,o){var a=t&r^t&o^r&o;return a<0&&(a+=4294967296),a}function x(e,t){var n=r(e,t,28)^r(t,e,2)^r(t,e,7);return n<0&&(n+=4294967296),n}function A(e,t){var n=i(e,t,28)^i(t,e,2)^i(t,e,7);return n<0&&(n+=4294967296),n}function E(e,t){var n=r(e,t,14)^r(e,t,18)^r(t,e,9);return n<0&&(n+=4294967296),n}function S(e,t){var n=i(e,t,14)^i(e,t,18)^i(t,e,9);return n<0&&(n+=4294967296),n}function _(e,t){var n=r(e,t,1)^r(e,t,8)^o(e,t,7);return n<0&&(n+=4294967296),n}function O(e,t){var n=i(e,t,1)^i(e,t,8)^a(e,t,7);return n<0&&(n+=4294967296),n}function N(e,t){var n=r(e,t,19)^r(t,e,29)^o(e,t,6);return n<0&&(n+=4294967296),n}function k(e,t){var n=i(e,t,19)^i(t,e,29)^a(e,t,6);return n<0&&(n+=4294967296),n}return e.inherits(m,p),_i=m,m.blockSize=1024,m.outSize=512,m.hmacStrength=192,m.padLength=128,m.prototype._prepareBlock=function(e,t){for(var n=this.W,r=0;r<32;r++)n[r]=e[t+r];for(;r<n.length;r+=2){var i=N(n[r-4],n[r-3]),o=k(n[r-4],n[r-3]),a=n[r-14],s=n[r-13],c=_(n[r-30],n[r-29]),u=O(n[r-30],n[r-29]),f=n[r-32],h=n[r-31];n[r]=l(i,o,a,s,c,u,f,h),n[r+1]=d(i,o,a,s,c,u,f,h)}},m.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,i=this.h[0],o=this.h[1],a=this.h[2],l=this.h[3],d=this.h[4],p=this.h[5],b=this.h[6],m=this.h[7],_=this.h[8],O=this.h[9],N=this.h[10],k=this.h[11],T=this.h[12],C=this.h[13],I=this.h[14],B=this.h[15];n(this.k.length===r.length);for(var L=0;L<r.length;L+=2){var M=I,R=B,P=E(_,O),U=S(_,O),j=g(_,O,N,k,T),F=v(_,O,N,k,T,C),D=this.k[L],z=this.k[L+1],$=r[L],W=r[L+1],q=f(M,R,P,U,j,F,D,z,$,W),X=h(M,R,P,U,j,F,D,z,$,W);M=x(i,o),R=A(i,o),P=y(i,o,a,l,d),U=w(i,o,a,l,d,p);var K=c(M,R,P,U),H=u(M,R,P,U);I=T,B=C,T=N,C=k,N=_,k=O,_=c(b,m,q,X),O=u(m,m,q,X),b=d,m=p,d=a,p=l,a=i,l=o,i=c(q,X,K,H),o=u(q,X,K,H)}s(this.h,0,i,o),s(this.h,2,a,l),s(this.h,4,d,p),s(this.h,6,b,m),s(this.h,8,_,O),s(this.h,10,N,k),s(this.h,12,T,C),s(this.h,14,I,B)},m.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},_i}function Ri(){return Ti||(Ti=1,Ci.sha1=function(){if(wi)return yi;wi=1;var e=pi(),t=gi(),n=Bi(),r=e.rotl32,i=e.sum32,o=e.sum32_5,a=n.ft_1,s=t.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function u(){if(!(this instanceof u))return new u;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return e.inherits(u,s),yi=u,u.blockSize=512,u.outSize=160,u.hmacStrength=80,u.padLength=64,u.prototype._update=function(e,t){for(var n=this.W,s=0;s<16;s++)n[s]=e[t+s];for(;s<n.length;s++)n[s]=r(n[s-3]^n[s-8]^n[s-14]^n[s-16],1);var u=this.h[0],l=this.h[1],d=this.h[2],f=this.h[3],h=this.h[4];for(s=0;s<n.length;s++){var p=~~(s/20),b=o(r(u,5),a(p,l,d,f),h,n[s],c[p]);h=f,f=d,d=r(l,30),l=u,u=b}this.h[0]=i(this.h[0],u),this.h[1]=i(this.h[1],l),this.h[2]=i(this.h[2],d),this.h[3]=i(this.h[3],f),this.h[4]=i(this.h[4],h)},u.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},yi}(),Ci.sha224=function(){if(Si)return Ei;Si=1;var e=pi(),t=Li();function n(){if(!(this instanceof n))return new n;t.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return e.inherits(n,t),Ei=n,n.blockSize=512,n.outSize=224,n.hmacStrength=192,n.padLength=64,n.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,7),"big"):e.split32(this.h.slice(0,7),"big")},Ei}(),Ci.sha256=Li(),Ci.sha384=function(){if(ki)return Ni;ki=1;var e=pi(),t=Mi();function n(){if(!(this instanceof n))return new n;t.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return e.inherits(n,t),Ni=n,n.blockSize=1024,n.outSize=384,n.hmacStrength=192,n.padLength=128,n.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,12),"big"):e.split32(this.h.slice(0,12),"big")},Ni}(),Ci.sha512=Mi()),Ci}var Pi,Ui,ji,Fi,Di,zi,$i,Wi,qi,Xi,Ki,Hi,Vi,Gi,Yi,Ji,Zi,Qi,eo,to,no,ro,io,oo,ao,so,co,uo,lo={};function fo(){return Fi||(Fi=1,function(e){var t=e;t.utils=pi(),t.common=gi(),t.sha=Ri(),t.ripemd=function(){if(Pi)return lo;Pi=1;var e=pi(),t=gi(),n=e.rotl32,r=e.sum32,i=e.sum32_3,o=e.sum32_4,a=t.BlockHash;function s(){if(!(this instanceof s))return new s;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function u(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function l(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}e.inherits(s,a),lo.ripemd160=s,s.blockSize=512,s.outSize=160,s.hmacStrength=192,s.padLength=64,s.prototype._update=function(e,t){for(var a=this.h[0],s=this.h[1],b=this.h[2],m=this.h[3],g=this.h[4],v=a,y=s,w=b,x=m,A=g,E=0;E<80;E++){var S=r(n(o(a,c(E,s,b,m),e[d[E]+t],u(E)),h[E]),g);a=g,g=m,m=n(b,10),b=s,s=S,S=r(n(o(v,c(79-E,y,w,x),e[f[E]+t],l(E)),p[E]),A),v=A,A=x,x=n(w,10),w=y,y=S}S=i(this.h[1],b,x),this.h[1]=i(this.h[2],m,A),this.h[2]=i(this.h[3],g,v),this.h[3]=i(this.h[4],a,y),this.h[4]=i(this.h[0],s,w),this.h[0]=S},s.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"little"):e.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],f=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return lo}(),t.hmac=function(){if(ji)return Ui;ji=1;var e=pi(),t=Dr();function n(t,r,i){if(!(this instanceof n))return new n(t,r,i);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(e.toArray(r,i))}return Ui=n,n.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),t(e.length<=this.blockSize);for(var n=e.length;n<this.blockSize;n++)e.push(0);for(n=0;n<e.length;n++)e[n]^=54;for(this.inner=(new this.Hash).update(e),n=0;n<e.length;n++)e[n]^=106;this.outer=(new this.Hash).update(e)},n.prototype.update=function(e,t){return this.inner.update(e,t),this},n.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},Ui}(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}(fi)),fi}function ho(){return $i||($i=1,function(e){var t,n=e,r=fo(),i=ui(),o=Xr().assert;function a(e){"short"===e.type?this.curve=new i.short(e):"edwards"===e.type?this.curve=new i.edwards(e):this.curve=new i.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new a(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=a,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=zi?Di:(zi=1,Di={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}catch(e){t=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}(di)),di}function po(){if(Yi)return Gi;Yi=1;var e=Fr(),t=function(){if(qi)return Wi;qi=1;var e=fo(),t=qr(),n=Dr();function r(e){if(!(this instanceof r))return new r(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var i=t.toArray(e.entropy,e.entropyEnc||"hex"),o=t.toArray(e.nonce,e.nonceEnc||"hex"),a=t.toArray(e.pers,e.persEnc||"hex");n(i.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(i,o,a)}return Wi=r,r.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},r.prototype._hmac=function(){return new e.hmac(this.hash,this.K)},r.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},r.prototype.reseed=function(e,r,i,o){"string"!=typeof r&&(o=i,i=r,r=null),e=t.toArray(e,r),i=t.toArray(i,o),n(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},r.prototype.generate=function(e,n,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof n&&(i=r,r=n,n=null),r&&(r=t.toArray(r,i||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,e);return this._update(r),this._reseed++,t.encode(a,n)},Wi}(),n=Xr(),r=ho(),i=Vr(),o=n.assert,a=function(){if(Ki)return Xi;Ki=1;var e=Fr(),t=Xr().assert;function n(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}return Xi=n,n.fromPublic=function(e,t,r){return t instanceof n?t:new n(e,{pub:t,pubEnc:r})},n.fromPrivate=function(e,t,r){return t instanceof n?t:new n(e,{priv:t,privEnc:r})},n.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},n.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},n.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},n.prototype._importPrivate=function(t,n){this.priv=new e(t,n||16),this.priv=this.priv.umod(this.ec.curve.n)},n.prototype._importPublic=function(e,n){if(e.x||e.y)return"mont"===this.ec.curve.type?t(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||t(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,n)},n.prototype.derive=function(e){return e.validate()||t(e.validate(),"public point not validated"),e.mul(this.priv).getX()},n.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)},n.prototype.verify=function(e,t,n){return this.ec.verify(e,t,this,void 0,n)},n.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},Xi}(),s=function(){if(Vi)return Hi;Vi=1;var e=Fr(),t=Xr(),n=t.assert;function r(t,i){if(t instanceof r)return t;this._importDER(t,i)||(n(t.r&&t.s,"Signature without r or s"),this.r=new e(t.r,16),this.s=new e(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function i(){this.place=0}function o(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;if(0===e[t.place])return!1;for(var i=0,o=0,a=t.place;o<r;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function a(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t<n;)t++;return 0===t?e:e.slice(t)}function s(e,t){if(t<128)e.push(t);else{var n=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}return Hi=r,r.prototype._importDER=function(n,r){n=t.toArray(n,r);var a=new i;if(48!==n[a.place++])return!1;var s=o(n,a);if(!1===s)return!1;if(s+a.place!==n.length)return!1;if(2!==n[a.place++])return!1;var c=o(n,a);if(!1===c)return!1;if(128&n[a.place])return!1;var u=n.slice(a.place,c+a.place);if(a.place+=c,2!==n[a.place++])return!1;var l=o(n,a);if(!1===l)return!1;if(n.length!==l+a.place)return!1;if(128&n[a.place])return!1;var d=n.slice(a.place,l+a.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new e(u),this.s=new e(d),this.recoveryParam=null,!0},r.prototype.toDER=function(e){var n=this.r.toArray(),r=this.s.toArray();for(128&n[0]&&(n=[0].concat(n)),128&r[0]&&(r=[0].concat(r)),n=a(n),r=a(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];s(i,n.length),(i=i.concat(n)).push(2),s(i,r.length);var o=i.concat(r),c=[48];return s(c,o.length),c=c.concat(o),t.encode(c,e)},Hi}();function c(e){if(!(this instanceof c))return new c(e);"string"==typeof e&&(o(Object.prototype.hasOwnProperty.call(r,e),"Unknown curve "+e),e=r[e]),e instanceof r.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}return Gi=c,c.prototype.keyPair=function(e){return new a(this,e)},c.prototype.keyFromPrivate=function(e,t){return a.fromPrivate(this,e,t)},c.prototype.keyFromPublic=function(e,t){return a.fromPublic(this,e,t)},c.prototype.genKeyPair=function(n){n||(n={});for(var r=new t({hash:this.hash,pers:n.pers,persEnc:n.persEnc||"utf8",entropy:n.entropy||i(this.hash.hmacStrength),entropyEnc:n.entropy&&n.entropyEnc||"utf8",nonce:this.n.toArray()}),o=this.n.byteLength(),a=this.n.sub(new e(2));;){var s=new e(r.generate(o));if(!(s.cmp(a)>0))return s.iaddn(1),this.keyFromPrivate(s)}},c.prototype._truncateToN=function(t,n,r){var i;if(e.isBN(t)||"number"==typeof t)i=(t=new e(t,16)).byteLength();else if("object"==typeof t)i=t.length,t=new e(t,16);else{var o=t.toString();i=o.length+1>>>1,t=new e(o,16)}"number"!=typeof r&&(r=8*i);var a=r-this.n.bitLength();return a>0&&(t=t.ushrn(a)),!n&&t.cmp(this.n)>=0?t.sub(this.n):t},c.prototype.sign=function(n,r,i,a){if("object"==typeof i&&(a=i,i=null),a||(a={}),"string"!=typeof n&&"number"!=typeof n&&!e.isBN(n)){o("object"==typeof n&&n&&"number"==typeof n.length,"Expected message to be an array-like, a hex string, or a BN instance"),o(n.length>>>0===n.length);for(var c=0;c<n.length;c++)o((255&n[c])===n[c])}r=this.keyFromPrivate(r,i),n=this._truncateToN(n,!1,a.msgBitLength),o(!n.isNeg(),"Can not sign a negative message");var u=this.n.byteLength(),l=r.getPrivate().toArray("be",u),d=n.toArray("be",u);o(new e(d).eq(n),"Can not sign message");for(var f=new t({hash:this.hash,entropy:l,nonce:d,pers:a.pers,persEnc:a.persEnc||"utf8"}),h=this.n.sub(new e(1)),p=0;;p++){var b=a.k?a.k(p):new e(f.generate(this.n.byteLength()));if(!((b=this._truncateToN(b,!0)).cmpn(1)<=0||b.cmp(h)>=0)){var m=this.g.mul(b);if(!m.isInfinity()){var g=m.getX(),v=g.umod(this.n);if(0!==v.cmpn(0)){var y=b.invm(this.n).mul(v.mul(r.getPrivate()).iadd(n));if(0!==(y=y.umod(this.n)).cmpn(0)){var w=(m.getY().isOdd()?1:0)|(0!==g.cmp(v)?2:0);return a.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),w^=1),new s({r:v,s:y,recoveryParam:w})}}}}}},c.prototype.verify=function(e,t,n,r,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),n=this.keyFromPublic(n,r);var o=(t=new s(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c,u=a.invm(this.n),l=u.mul(e).umod(this.n),d=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(c=this.g.jmulAdd(l,n.getPublic(),d)).isInfinity()&&c.eqXToP(o):!(c=this.g.mulAdd(l,n.getPublic(),d)).isInfinity()&&0===c.getX().umod(this.n).cmp(o)},c.prototype.recoverPubKey=function(t,n,r,i){o((3&r)===r,"The recovery param is more than two bits"),n=new s(n,i);var a=this.n,c=new e(t),u=n.r,l=n.s,d=1&r,f=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");u=f?this.curve.pointFromX(u.add(this.curve.n),d):this.curve.pointFromX(u,d);var h=n.r.invm(a),p=a.sub(c).mul(h).umod(a),b=l.mul(h).umod(a);return this.g.mulAdd(p,u,b)},c.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new s(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")},Gi}function bo(){if(no)return to;no=1;var e=fo(),t=ho(),n=Xr(),r=n.assert,i=n.parseBytes,o=function(){if(Zi)return Ji;Zi=1;var e=Xr(),t=e.assert,n=e.parseBytes,r=e.cachedProperty;function i(e,t){this.eddsa=e,this._secret=n(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=n(t.pub)}return i.fromPublic=function(e,t){return t instanceof i?t:new i(e,{pub:t})},i.fromSecret=function(e,t){return t instanceof i?t:new i(e,{secret:t})},i.prototype.secret=function(){return this._secret},r(i,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),r(i,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),r(i,"privBytes",function(){var e=this.eddsa,t=this.hash(),n=e.encodingLength-1,r=t.slice(0,e.encodingLength);return r[0]&=248,r[n]&=127,r[n]|=64,r}),r(i,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),r(i,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),r(i,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),i.prototype.sign=function(e){return t(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},i.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},i.prototype.getSecret=function(n){return t(this._secret,"KeyPair is public only"),e.encode(this.secret(),n)},i.prototype.getPublic=function(t){return e.encode(this.pubBytes(),t)},Ji=i}(),a=function(){if(eo)return Qi;eo=1;var e=Fr(),t=Xr(),n=t.assert,r=t.cachedProperty,i=t.parseBytes;function o(t,r){this.eddsa=t,"object"!=typeof r&&(r=i(r)),Array.isArray(r)&&(n(r.length===2*t.encodingLength,"Signature has invalid size"),r={R:r.slice(0,t.encodingLength),S:r.slice(t.encodingLength)}),n(r.R&&r.S,"Signature without R or S"),t.isPoint(r.R)&&(this._R=r.R),r.S instanceof e&&(this._S=r.S),this._Rencoded=Array.isArray(r.R)?r.R:r.Rencoded,this._Sencoded=Array.isArray(r.S)?r.S:r.Sencoded}return r(o,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),r(o,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),r(o,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),r(o,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),o.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},o.prototype.toHex=function(){return t.encode(this.toBytes(),"hex").toUpperCase()},Qi=o}();function s(n){if(r("ed25519"===n,"only tested with ed25519 so far"),!(this instanceof s))return new s(n);n=t[n].curve,this.curve=n,this.g=n.g,this.g.precompute(n.n.bitLength()+1),this.pointClass=n.point().constructor,this.encodingLength=Math.ceil(n.n.bitLength()/8),this.hash=e.sha512}return to=s,s.prototype.sign=function(e,t){e=i(e);var n=this.keyFromSecret(t),r=this.hashInt(n.messagePrefix(),e),o=this.g.mul(r),a=this.encodePoint(o),s=this.hashInt(a,n.pubBytes(),e).mul(n.priv()),c=r.add(s).umod(this.curve.n);return this.makeSignature({R:o,S:c,Rencoded:a})},s.prototype.verify=function(e,t,n){if(e=i(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var r=this.keyFromPublic(n),o=this.hashInt(t.Rencoded(),r.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(r.pub().mul(o)).eq(a)},s.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return n.intFromLE(e.digest()).umod(this.curve.n)},s.prototype.keyFromPublic=function(e){return o.fromPublic(this,e)},s.prototype.keyFromSecret=function(e){return o.fromSecret(this,e)},s.prototype.makeSignature=function(e){return e instanceof a?e:new a(this,e)},s.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},s.prototype.decodePoint=function(e){var t=(e=n.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),i=!!(128&e[t]),o=n.intFromLE(r);return this.curve.pointFromY(o,i)},s.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},s.prototype.decodeInt=function(e){return n.intFromLE(e)},s.prototype.isPoint=function(e){return e instanceof this.pointClass},to}function mo(){if(oo)return io;oo=1;const e=(ro||(ro=1,function(){var e=Mr;e.version=Rr,e.utils=Xr(),e.rand=Vr(),e.curve=ui(),e.curves=ho(),e.ec=po(),e.eddsa=bo()}()),Mr).ec,t=new e("secp256k1"),n=t.curve,r=n.n.constructor;function i(e){const i=e[0];switch(i){case 2:case 3:return 33!==e.length?null:function(e,i){let o=new r(i);if(o.cmp(n.p)>=0)return null;o=o.toRed(n.red);let a=o.redSqr().redIMul(o).redIAdd(n.b).redSqrt();3===e!==a.isOdd()&&(a=a.redNeg());const s=o.redSqr().redIMul(o);return a.redSqr().redISub(s.redIAdd(n.b)).isZero()?t.keyPair({pub:{x:o,y:a}}):null}(i,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,i,o){let a=new r(i),s=new r(o);if(a.cmp(n.p)>=0||s.cmp(n.p)>=0)return null;if(a=a.toRed(n.red),s=s.toRed(n.red),(6===e||7===e)&&s.isOdd()!==(7===e))return null;const c=a.redSqr().redIMul(a);return s.redSqr().redISub(c.redIAdd(n.b)).isZero()?t.keyPair({pub:{x:a,y:s}}):null}(i,e.subarray(1,33),e.subarray(33,65));default:return null}}function o(e,t){const n=t.encode(null,33===e.length);for(let t=0;t<e.length;++t)e[t]=n[t]}return io={contextRandomize:()=>0,privateKeyVerify(e){const t=new r(e);return t.cmp(n.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new r(e),i=n.n.sub(t).umod(n.n).toArrayLike(Uint8Array,"be",32);return e.set(i),0},privateKeyTweakAdd(e,t){const i=new r(t);if(i.cmp(n.n)>=0)return 1;if(i.iadd(new r(e)),i.cmp(n.n)>=0&&i.isub(n.n),i.isZero())return 1;const o=i.toArrayLike(Uint8Array,"be",32);return e.set(o),0},privateKeyTweakMul(e,t){let i=new r(t);if(i.cmp(n.n)>=0||i.isZero())return 1;i.imul(new r(e)),i.cmp(n.n)>=0&&(i=i.umod(n.n));const o=i.toArrayLike(Uint8Array,"be",32);return e.set(o),0},publicKeyVerify:e=>null===i(e)?1:0,publicKeyCreate(e,i){const a=new r(i);if(a.cmp(n.n)>=0||a.isZero())return 1;return o(e,t.keyFromPrivate(i).getPublic()),0},publicKeyConvert(e,t){const n=i(t);if(null===n)return 1;return o(e,n.getPublic()),0},publicKeyNegate(e,t){const n=i(t);if(null===n)return 1;const r=n.getPublic();return r.y=r.y.redNeg(),o(e,r),0},publicKeyCombine(e,t){const n=new Array(t.length);for(let e=0;e<t.length;++e)if(n[e]=i(t[e]),null===n[e])return 1;let r=n[0].getPublic();for(let e=1;e<n.length;++e)r=r.add(n[e].pub);return r.isInfinity()?2:(o(e,r),0)},publicKeyTweakAdd(e,t,a){const s=i(t);if(null===s)return 1;if((a=new r(a)).cmp(n.n)>=0)return 2;const c=s.getPublic().add(n.g.mul(a));return c.isInfinity()?2:(o(e,c),0)},publicKeyTweakMul(e,t,a){const s=i(t);if(null===s)return 1;if((a=new r(a)).cmp(n.n)>=0||a.isZero())return 2;return o(e,s.getPublic().mul(a)),0},signatureNormalize(e){const i=new r(e.subarray(0,32)),o=new r(e.subarray(32,64));return i.cmp(n.n)>=0||o.cmp(n.n)>=0?1:(1===o.cmp(t.nh)&&e.set(n.n.sub(o).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const i=t.subarray(0,32),o=t.subarray(32,64);if(new r(i).cmp(n.n)>=0)return 1;if(new r(o).cmp(n.n)>=0)return 1;const{output:a}=e;let s=a.subarray(4,37);s[0]=0,s.set(i,1);let c=33,u=0;for(;c>1&&0===s[u]&&!(128&s[u+1]);--c,++u);if(s=s.subarray(u),128&s[0])return 1;if(c>1&&0===s[0]&&!(128&s[1]))return 1;let l=a.subarray(39,72);l[0]=0,l.set(o,1);let d=33,f=0;for(;d>1&&0===l[f]&&!(128&l[f+1]);--d,++f);return l=l.subarray(f),128&l[0]||d>1&&0===l[0]&&!(128&l[1])?1:(e.outputlen=6+c+d,a[0]=48,a[1]=e.outputlen-2,a[2]=2,a[3]=s.length,a.set(s,4),a[4+c]=2,a[5+c]=l.length,a.set(l,6+c),0)},signatureImport(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;const i=t[3];if(0===i)return 1;if(5+i>=t.length)return 1;if(2!==t[4+i])return 1;const o=t[5+i];if(0===o)return 1;if(6+i+o!==t.length)return 1;if(128&t[4])return 1;if(i>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[i+6])return 1;if(o>1&&0===t[i+6]&&!(128&t[i+7]))return 1;let a=t.subarray(4,4+i);if(33===a.length&&0===a[0]&&(a=a.subarray(1)),a.length>32)return 1;let s=t.subarray(6+i);if(33===s.length&&0===s[0]&&(s=s.slice(1)),s.length>32)throw new Error("S length is too long");let c=new r(a);c.cmp(n.n)>=0&&(c=new r(0));let u=new r(t.subarray(6+i));return u.cmp(n.n)>=0&&(u=new r(0)),e.set(c.toArrayLike(Uint8Array,"be",32),0),e.set(u.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,i,o,a,s){if(s){const e=s;s=t=>{const n=e(i,o,null,a,t);if(!(n instanceof Uint8Array&&32===n.length))throw new Error("This is the way");return new r(n)}}const c=new r(o);if(c.cmp(n.n)>=0||c.isZero())return 1;let u;try{u=t.sign(i,o,{canonical:!0,k:s,pers:a})}catch(e){return 1}return e.signature.set(u.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(u.s.toArrayLike(Uint8Array,"be",32),32),e.recid=u.recoveryParam,0},ecdsaVerify(e,o,a){const s={r:e.subarray(0,32),s:e.subarray(32,64)},c=new r(s.r),u=new r(s.s);if(c.cmp(n.n)>=0||u.cmp(n.n)>=0)return 1;if(1===u.cmp(t.nh)||c.isZero()||u.isZero())return 3;const l=i(a);if(null===l)return 2;const d=l.getPublic();return t.verify(o,s,d)?0:3},ecdsaRecover(e,i,a,s){const c={r:i.slice(0,32),s:i.slice(32,64)},u=new r(c.r),l=new r(c.s);if(u.cmp(n.n)>=0||l.cmp(n.n)>=0)return 1;if(u.isZero()||l.isZero())return 2;let d;try{d=t.recoverPubKey(s,c,a)}catch(e){return 2}return o(e,d),0},ecdh(e,o,a,s,c,u,l){const d=i(o);if(null===d)return 1;const f=new r(a);if(f.cmp(n.n)>=0||f.isZero())return 2;const h=d.getPublic().mul(f);if(void 0===c){const n=h.encode(null,!0),r=t.hash().update(n).digest();for(let t=0;t<32;++t)e[t]=r[t]}else{u||(u=new Uint8Array(32));const t=h.getX().toArray("be",32);for(let e=0;e<32;++e)u[e]=t[e];l||(l=new Uint8Array(32));const n=h.getY().toArray("be",32);for(let e=0;e<32;++e)l[e]=n[e];const r=c(u,l,s);if(!(r instanceof Uint8Array&&r.length===e.length))return 2;e.set(r)}return 0}},io}function go(){return so||(so=1,ao=function(){if(Tr)return kr;Tr=1;const e="Impossible case. Please create issue.",t="The tweak was out of range or the resulted private key is invalid",n="The tweak was out of range or equal to zero",r="Unknow error on context randomization",i="Private Key is invalid",o="Public Key could not be parsed",a="Public Key serialization error",s="The sum of the public keys is not valid",c="Signature could not be parsed",u="The nonce generation function failed, or the private key was invalid",l="Public key could not be recover",d="Scalar was invalid (zero or overflow)";function f(e,t){if(!e)throw new Error(t)}function h(e,t,n){if(f(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==n)if(Array.isArray(n)){const r=`Expected ${e} to be an Uint8Array with length [${n.join(", ")}]`;f(n.includes(t.length),r)}else{const r=`Expected ${e} to be an Uint8Array with length ${n}`;f(t.length===n,r)}}function p(e){f("Boolean"===m(e),"Expected compressed to be a Boolean")}function b(e=e=>new Uint8Array(e),t){return"function"==typeof e&&(e=e(t)),h("output",e,t),e}function m(e){return Object.prototype.toString.call(e).slice(8,-1)}return kr=g=>({contextRandomize(e){if(f(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&h("seed",e,32),1===g.contextRandomize(e))throw new Error(r)},privateKeyVerify:e=>(h("private key",e,32),0===g.privateKeyVerify(e)),privateKeyNegate(t){switch(h("private key",t,32),g.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(e)}},privateKeyTweakAdd(e,n){switch(h("private key",e,32),h("tweak",n,32),g.privateKeyTweakAdd(e,n)){case 0:return e;case 1:throw new Error(t)}},privateKeyTweakMul(e,t){switch(h("private key",e,32),h("tweak",t,32),g.privateKeyTweakMul(e,t)){case 0:return e;case 1:throw new Error(n)}},publicKeyVerify:e=>(h("public key",e,[33,65]),0===g.publicKeyVerify(e)),publicKeyCreate(e,t=!0,n){switch(h("private key",e,32),p(t),n=b(n,t?33:65),g.publicKeyCreate(n,e)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error(a)}},publicKeyConvert(e,t=!0,n){switch(h("public key",e,[33,65]),p(t),n=b(n,t?33:65),g.publicKeyConvert(n,e)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(a)}},publicKeyNegate(t,n=!0,r){switch(h("public key",t,[33,65]),p(n),r=b(r,n?33:65),g.publicKeyNegate(r,t)){case 0:return r;case 1:throw new Error(o);case 2:throw new Error(e);case 3:throw new Error(a)}},publicKeyCombine(e,t=!0,n){f(Array.isArray(e),"Expected public keys to be an Array"),f(e.length>0,"Expected public keys array will have more than zero items");for(const t of e)h("public key",t,[33,65]);switch(p(t),n=b(n,t?33:65),g.publicKeyCombine(n,e)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(s);case 3:throw new Error(a)}},publicKeyTweakAdd(e,n,r=!0,i){switch(h("public key",e,[33,65]),h("tweak",n,32),p(r),i=b(i,r?33:65),g.publicKeyTweakAdd(i,e,n)){case 0:return i;case 1:throw new Error(o);case 2:throw new Error(t)}},publicKeyTweakMul(e,t,r=!0,i){switch(h("public key",e,[33,65]),h("tweak",t,32),p(r),i=b(i,r?33:65),g.publicKeyTweakMul(i,e,t)){case 0:return i;case 1:throw new Error(o);case 2:throw new Error(n)}},signatureNormalize(e){switch(h("signature",e,64),g.signatureNormalize(e)){case 0:return e;case 1:throw new Error(c)}},signatureExport(t,n){h("signature",t,64);const r={output:n=b(n,72),outputlen:72};switch(g.signatureExport(r,t)){case 0:return n.slice(0,r.outputlen);case 1:throw new Error(c);case 2:throw new Error(e)}},signatureImport(t,n){switch(h("signature",t),n=b(n,64),g.signatureImport(n,t)){case 0:return n;case 1:throw new Error(c);case 2:throw new Error(e)}},ecdsaSign(t,n,r={},i){h("message",t,32),h("private key",n,32),f("Object"===m(r),"Expected options to be an Object"),void 0!==r.data&&h("options.data",r.data),void 0!==r.noncefn&&f("Function"===m(r.noncefn),"Expected options.noncefn to be a Function");const o={signature:i=b(i,64),recid:null};switch(g.ecdsaSign(o,t,n,r.data,r.noncefn)){case 0:return o;case 1:throw new Error(u);case 2:throw new Error(e)}},ecdsaVerify(e,t,n){switch(h("signature",e,64),h("message",t,32),h("public key",n,[33,65]),g.ecdsaVerify(e,t,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(c);case 2:throw new Error(o)}},ecdsaRecover(t,n,r,i=!0,o){switch(h("signature",t,64),f("Number"===m(n)&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),h("message",r,32),p(i),o=b(o,i?33:65),g.ecdsaRecover(o,t,n,r)){case 0:return o;case 1:throw new Error(c);case 2:throw new Error(l);case 3:throw new Error(e)}},ecdh(e,t,n={},r){switch(h("public key",e,[33,65]),h("private key",t,32),f("Object"===m(n),"Expected options to be an Object"),void 0!==n.data&&h("options.data",n.data),void 0!==n.hashfn?(f("Function"===m(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&h("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&h("options.ybuf",n.ybuf,32),h("output",r)):r=b(r,32),g.ecdh(r,e,t,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return r;case 1:throw new Error(o);case 2:throw new Error(d)}}}),kr}()(mo())),ao}function vo(){if(co)return Cr;co=1;var e=Cr&&Cr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.PublicKey=void 0;const t=Cn(),n=pr(),r=e(go()),i=gt();class o{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}class a extends o{enum;ed25519Key;secp256k1Key;constructor(e){const t=function(e){switch(e){case i.KeyType.ED25519:return"ed25519Key";case i.KeyType.SECP256K1:return"secp256k1Key";default:throw Error(`unknown type ${e}`)}}(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}static from(e){return"string"==typeof e?a.fromString(e):e}static fromString(e){const n=e.split(":");let r,o;if(1===n.length)r=n[0];else{if(2!==n.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");r=n[1],o=function(e){switch(e.toLowerCase()){case"ed25519":return i.KeyType.ED25519;case"secp256k1":return i.KeyType.SECP256K1;default:throw new Error(`Unknown key type ${e}`)}}(n[0])}const s=(0,t.baseDecode)(r);o||(o=s.length===i.KeySize.SECP256k1_PUBLIC_KEY?i.KeyType.SECP256K1:i.KeyType.ED25519);const c=o===i.KeyType.ED25519?i.KeySize.ED25519_PUBLIC_KEY:i.KeySize.SECP256k1_PUBLIC_KEY;if(s.length!==c)throw new Error(`Invalid public key size (${s.length}), must be ${c}`);return new a({keyType:o,data:s})}toString(){const e=(0,t.baseEncode)(this.data);return`${function(e){switch(e){case i.KeyType.ED25519:return"ed25519";case i.KeyType.SECP256K1:return"secp256k1";default:throw new Error(`Unknown key type ${e}`)}}(this.keyType)}:${e}`}verify(e,t){const o=this.keyType,a=this.data;switch(o){case i.KeyType.ED25519:return n.ed25519.verify(t,e,a);case i.KeyType.SECP256K1:return r.default.ecdsaVerify(t.subarray(0,64),e,new Uint8Array([4,...a]));default:throw new Error(`Unknown key type: ${o}`)}}get keyPair(){return this.ed25519Key||this.secp256k1Key}get keyType(){return this.keyPair.keyType}get data(){return this.keyPair.data}}return Cr.PublicKey=a,Cr}function yo(){if(uo)return Et;uo=1;var e=Et&&Et.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Et,"__esModule",{value:!0}),Et.KeyPairEd25519=void 0;const t=Cn(),n=pr(),r=e(Nr()),i=gt(),o=xt(),a=vo();class s extends o.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();const r=(0,t.baseDecode)(e),o=new Uint8Array(r.slice(0,i.KeySize.SECRET_KEY)),s=n.ed25519.getPublicKey(new Uint8Array(o));this.publicKey=new a.PublicKey({keyType:i.KeyType.ED25519,data:s}),this.secretKey=(0,t.baseEncode)(o),this.extendedSecretKey=e}static fromRandom(){const e=(0,r.default)(i.KeySize.SECRET_KEY),o=n.ed25519.getPublicKey(new Uint8Array(e)),a=new Uint8Array([...e,...o]);return new s((0,t.baseEncode)(a))}sign(e){return{signature:n.ed25519.sign(e,(0,t.baseDecode)(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return Et.KeyPairEd25519=s,Et}var wo,xo,Ao,Eo,So={};function _o(){if(wo)return So;wo=1;var e=So&&So.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(So,"__esModule",{value:!0}),So.KeyPairSecp256k1=void 0;const t=Cn(),n=e(Nr()),r=e(go()),i=gt(),o=xt(),a=vo();class s extends o.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();const n=(0,t.baseDecode)(e),o=new Uint8Array(n.slice(0,i.KeySize.SECRET_KEY)),s=r.default.publicKeyCreate(new Uint8Array(o),!1),c=s.subarray(1,s.length);this.publicKey=new a.PublicKey({keyType:i.KeyType.SECP256K1,data:c}),this.secretKey=(0,t.baseEncode)(o),this.extendedSecretKey=e}static fromRandom(){const e=(0,n.default)(i.KeySize.SECRET_KEY),o=r.default.publicKeyCreate(new Uint8Array(e),!1),a=o.subarray(1,o.length),c=new Uint8Array([...e,...a]);return new s((0,t.baseEncode)(c))}sign(e){const{signature:n,recid:i}=r.default.ecdsaSign(e,(0,t.baseDecode)(this.secretKey));return{signature:new Uint8Array([...n,i]),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`secp256k1:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return So.KeyPairSecp256k1=s,So}function Oo(){return Ao||(Ao=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PublicKey=e.KeyPairSecp256k1=e.KeyPairEd25519=e.KeyPair=e.KeyType=void 0;var t=gt();Object.defineProperty(e,"KeyType",{enumerable:!0,get:function(){return t.KeyType}});var n=function(){if(xo)return yt;xo=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.KeyPair=void 0;const e=xt(),t=yo(),n=_o();class r extends e.KeyPairBase{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return t.KeyPairEd25519.fromRandom();case"SECP256K1":return n.KeyPairSecp256k1.fromRandom();default:throw new Error(`Unknown curve ${e}`)}}static fromString(e){const r=e.split(":");if(2!==r.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");switch(r[0].toUpperCase()){case"ED25519":return new t.KeyPairEd25519(r[1]);case"SECP256K1":return new n.KeyPairSecp256k1(r[1]);default:throw new Error(`Unknown curve: ${r[0]}`)}}}return yt.KeyPair=r,yt}();Object.defineProperty(e,"KeyPair",{enumerable:!0,get:function(){return n.KeyPair}});var r=yo();Object.defineProperty(e,"KeyPairEd25519",{enumerable:!0,get:function(){return r.KeyPairEd25519}});var i=_o();Object.defineProperty(e,"KeyPairSecp256k1",{enumerable:!0,get:function(){return i.KeyPairSecp256k1}});var o=vo();Object.defineProperty(e,"PublicKey",{enumerable:!0,get:function(){return o.PublicKey}})}(bt)),bt}function No(){return Eo||(Eo=1,function(e){var t=Ye&&Ye.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=Ye&&Ye.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Ye&&Ye.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=Ye&&Ye.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.authPayloadSchema=e.AuthPayload=void 0,e.verifySignature=function(t,n){const r=new u(t),i=o.serialize(e.authPayloadSchema,r),s=Uint8Array.from(a.default.sha256.array(i));let l=new Uint8Array(Buffer.from(n.signature,"base64"));return c.PublicKey.from(n.publicKey).verify(s,l)};const o=r(function(){if(ut)return Je;ut=1;var e=Je&&Je.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),t=Je&&Je.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=Je&&Je.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var i in n)"default"!==i&&Object.prototype.hasOwnProperty.call(n,i)&&e(r,n,i);return t(r,n),r};Je.__esModule=!0,Je.deserialize=Je.serialize=void 0;var r=function(){if(ot)return Ze;ot=1;var e=Ze&&Ze.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),t=Ze&&Ze.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=Ze&&Ze.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var i in n)"default"!==i&&Object.prototype.hasOwnProperty.call(n,i)&&e(r,n,i);return t(r,n),r};Ze.__esModule=!0,Ze.BorshSerializer=void 0;var r=et(),i=rt(),o=n(st()),a=function(){function e(e){this.encoded=new i.EncodeBuffer,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(r.integers.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var n=parseInt(t.substring(1));n<=32||"f64"==t?(this.checkTypes&&o.expect_type(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&o.expect_bigint(e,this.fieldPath),this.encode_bigint(BigInt(e),n))},e.prototype.encode_bigint=function(e,t){for(var n=t/8,r=new Uint8Array(n),i=0;i<n;i++)r[i]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(r))},e.prototype.encode_string=function(e){this.checkTypes&&o.expect_type(e,"string",this.fieldPath);for(var t=e,n=[],r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?n.push(i):i<2048?n.push(192|i>>6,128|63&i):i<55296||i>=57344?n.push(224|i>>12,128|i>>6&63,128|63&i):(r++,i=65536+((1023&i)<<10|1023&t.charCodeAt(r)),n.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i))}this.encoded.store_value(n.length,"u32"),this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_boolean=function(e){this.checkTypes&&o.expect_type(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&o.expect_enum(e,this.fieldPath);for(var n=Object.keys(e)[0],r=0;r<t.enum.length;r++){var i=t.enum[r];if(n===Object.keys(i.struct)[0])return this.encoded.store_value(r,"u8"),this.encode_struct(e,i)}throw new Error("Enum key (".concat(n,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(o.isArrayLike(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw new Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?o.expect_same_size(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var n=0;n<e.length;n++)this.encode_value(e[n],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?o.expect_same_size(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);var n=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(n.length,"u32");for(var r=0,i=n;r<i.length;r++){var a=i[r];this.encode_value(a,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);var n=e instanceof Map,r=n?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(r.length,"u32");for(var i=0,a=r;i<a.length;i++){var s=a[i];this.encode_value(s,t.map.key),this.encode_value(n?e.get(s):e[s],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);for(var n=0,r=Object.keys(t.struct);n<r.length;n++){var i=r[n];this.fieldPath.push(i),this.encode_value(e[i],t.struct[i]),this.fieldPath.pop()}},e}();return Ze.BorshSerializer=a,Ze}(),i=function(){if(ct)return lt;ct=1,lt.__esModule=!0,lt.BorshDeserializer=void 0;var e=et(),t=rt(),n=function(){function n(e){this.buffer=new t.DecodeBuffer(e)}return n.prototype.decode=function(e){return this.decode_value(e)},n.prototype.decode_value=function(t){if("string"==typeof t){if(e.integers.includes(t))return this.decode_integer(t);if("string"===t)return this.decode_string();if("bool"===t)return this.decode_boolean()}if("object"==typeof t){if("option"in t)return this.decode_option(t);if("enum"in t)return this.decode_enum(t);if("array"in t)return this.decode_array(t);if("set"in t)return this.decode_set(t);if("map"in t)return this.decode_map(t);if("struct"in t)return this.decode_struct(t)}throw new Error("Unsupported type: ".concat(t))},n.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},n.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var n=e/8,r=new Uint8Array(this.buffer.consume_bytes(n)),i=r.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&r[n-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},n.prototype.decode_string=function(){for(var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e)),n=[],r=0;r<e;++r){var i=t[r];if(i<128)n.push(i);else if(i<224)n.push((31&i)<<6|63&t[++r]);else if(i<240)n.push((15&i)<<12|(63&t[++r])<<6|63&t[++r]);else{var o=(7&i)<<18|(63&t[++r])<<12|(63&t[++r])<<6|63&t[++r];n.push(o)}}return String.fromCodePoint.apply(String,n)},n.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},n.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw new Error("Invalid option ".concat(t));return null},n.prototype.decode_enum=function(e){var t,n=this.buffer.consume_value("u8");if(n>e.enum.length)throw new Error("Enum option ".concat(n," is not available"));var r=e.enum[n].struct,i=Object.keys(r)[0];return(t={})[i]=this.decode_value(r[i]),t},n.prototype.decode_array=function(e){for(var t=[],n=e.array.len?e.array.len:this.decode_integer("u32"),r=0;r<n;++r)t.push(this.decode_value(e.array.type));return t},n.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),n=new Set,r=0;r<t;++r)n.add(this.decode_value(e.set));return n},n.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),n=new Map,r=0;r<t;++r){var i=this.decode_value(e.map.key),o=this.decode_value(e.map.value);n.set(i,o)}return n},n.prototype.decode_struct=function(e){var t={};for(var n in e.struct)t[n]=this.decode_value(e.struct[n]);return t},n}();return lt.BorshDeserializer=n,lt}(),o=n(st());return Je.serialize=function(e,t,n){return void 0===n&&(n=!0),n&&o.validate_schema(e),new r.BorshSerializer(n).encode(t,e)},Je.deserialize=function(e,t,n){return void 0===n&&(n=!0),n&&o.validate_schema(e),new i.BorshDeserializer(t).decode(e)},Je}()),a=i((dt||(dt=1,s=ft,function(){var e="input is invalid type",t="object"==typeof window,n=t?window:{};n.JS_SHA256_NO_WINDOW&&(t=!1);var r=!t&&"object"==typeof self,i=!n.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&"renderer"!=process.type;i?n=Xe:r&&(n=self);var o=!n.JS_SHA256_NO_COMMON_JS&&s.exports,a=!n.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),u=[-2147483648,8388608,32768,128],l=[24,16,8,0],d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=["hex","array","digest","arrayBuffer"],h=[];!n.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!n.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var p=function(e,t){return function(n){return new y(t,!0).update(n)[e]()}},b=function(e){var t=p("hex",e);i&&(t=m(t,e)),t.create=function(){return new y(e)},t.update=function(e){return t.create().update(e)};for(var n=0;n<f.length;++n){var r=f[n];t[r]=p(r,e)}return t},m=function(t,r){var i,o=ht,a=ht.Buffer,s=r?"sha224":"sha256";return i=a.from&&!n.JS_SHA256_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(n){if("string"==typeof n)return o.createHash(s).update(n,"utf8").digest("hex");if(null==n)throw new Error(e);return n.constructor===ArrayBuffer&&(n=new Uint8Array(n)),Array.isArray(n)||ArrayBuffer.isView(n)||n.constructor===a?o.createHash(s).update(i(n)).digest("hex"):t(n)}},g=function(e,t){return function(n,r){return new w(n,t,!0).update(r)[e]()}},v=function(e){var t=g("hex",e);t.create=function(t){return new w(t,e)},t.update=function(e,n){return t.create(e).update(n)};for(var n=0;n<f.length;++n){var r=f[n];t[r]=g(r,e)}return t};function y(e,t){t?(h[0]=h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0,this.blocks=h):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function w(t,n,r){var i,o=typeof t;if("string"===o){var s,c=[],u=t.length,l=0;for(i=0;i<u;++i)(s=t.charCodeAt(i))<128?c[l++]=s:s<2048?(c[l++]=192|s>>>6,c[l++]=128|63&s):s<55296||s>=57344?(c[l++]=224|s>>>12,c[l++]=128|s>>>6&63,c[l++]=128|63&s):(s=65536+((1023&s)<<10|1023&t.charCodeAt(++i)),c[l++]=240|s>>>18,c[l++]=128|s>>>12&63,c[l++]=128|s>>>6&63,c[l++]=128|63&s);t=c}else{if("object"!==o)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e)}t.length>64&&(t=new y(n,!0).update(t).array());var d=[],f=[];for(i=0;i<64;++i){var h=t[i]||0;d[i]=92^h,f[i]=54^h}y.call(this,n,r),this.update(f),this.oKeyPad=d,this.inner=!0,this.sharedMemory=r}y.prototype.update=function(t){if(!this.finalized){var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}for(var i,o,s=0,c=t.length,u=this.blocks;s<c;){if(this.hashed&&(this.hashed=!1,u[0]=this.block,this.block=u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0),n)for(o=this.start;s<c&&o<64;++s)u[o>>>2]|=t[s]<<l[3&o++];else for(o=this.start;s<c&&o<64;++s)(i=t.charCodeAt(s))<128?u[o>>>2]|=i<<l[3&o++]:i<2048?(u[o>>>2]|=(192|i>>>6)<<l[3&o++],u[o>>>2]|=(128|63&i)<<l[3&o++]):i<55296||i>=57344?(u[o>>>2]|=(224|i>>>12)<<l[3&o++],u[o>>>2]|=(128|i>>>6&63)<<l[3&o++],u[o>>>2]|=(128|63&i)<<l[3&o++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++s)),u[o>>>2]|=(240|i>>>18)<<l[3&o++],u[o>>>2]|=(128|i>>>12&63)<<l[3&o++],u[o>>>2]|=(128|i>>>6&63)<<l[3&o++],u[o>>>2]|=(128|63&i)<<l[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=u[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},y.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=u[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},y.prototype.hash=function(){var e,t,n,r,i,o,a,s,c,u=this.h0,l=this.h1,f=this.h2,h=this.h3,p=this.h4,b=this.h5,m=this.h6,g=this.h7,v=this.blocks;for(e=16;e<64;++e)t=((i=v[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,n=((i=v[e-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,v[e]=v[e-16]+t+v[e-7]+n|0;for(c=l&f,e=0;e<64;e+=4)this.first?(this.is224?(o=300032,g=(i=v[0]-1413257819)-150054599|0,h=i+24177077|0):(o=704751109,g=(i=v[0]-210244248)-1521486534|0,h=i+143694565|0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),r=(o=u&l)^u&f^c,g=h+(i=g+(n=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&b^~p&m)+d[e]+v[e])|0,h=i+(t+r)|0),t=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),r=(a=h&u)^h&l^o,m=f+(i=m+(n=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&p^~g&b)+d[e+1]+v[e+1])|0,t=((f=i+(t+r)|0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),r=(s=f&h)^f&u^a,b=l+(i=b+(n=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&g^~m&p)+d[e+2]+v[e+2])|0,t=((l=i+(t+r)|0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),r=(c=l&f)^l&h^s,p=u+(i=p+(n=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+(b&m^~b&g)+d[e+3]+v[e+3])|0,u=i+(t+r)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+u|0,this.h1=this.h1+l|0,this.h2=this.h2+f|0,this.h3=this.h3+h|0,this.h4=this.h4+p|0,this.h5=this.h5+b|0,this.h6=this.h6+m|0,this.h7=this.h7+g|0},y.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,u=c[e>>>28&15]+c[e>>>24&15]+c[e>>>20&15]+c[e>>>16&15]+c[e>>>12&15]+c[e>>>8&15]+c[e>>>4&15]+c[15&e]+c[t>>>28&15]+c[t>>>24&15]+c[t>>>20&15]+c[t>>>16&15]+c[t>>>12&15]+c[t>>>8&15]+c[t>>>4&15]+c[15&t]+c[n>>>28&15]+c[n>>>24&15]+c[n>>>20&15]+c[n>>>16&15]+c[n>>>12&15]+c[n>>>8&15]+c[n>>>4&15]+c[15&n]+c[r>>>28&15]+c[r>>>24&15]+c[r>>>20&15]+c[r>>>16&15]+c[r>>>12&15]+c[r>>>8&15]+c[r>>>4&15]+c[15&r]+c[i>>>28&15]+c[i>>>24&15]+c[i>>>20&15]+c[i>>>16&15]+c[i>>>12&15]+c[i>>>8&15]+c[i>>>4&15]+c[15&i]+c[o>>>28&15]+c[o>>>24&15]+c[o>>>20&15]+c[o>>>16&15]+c[o>>>12&15]+c[o>>>8&15]+c[o>>>4&15]+c[15&o]+c[a>>>28&15]+c[a>>>24&15]+c[a>>>20&15]+c[a>>>16&15]+c[a>>>12&15]+c[a>>>8&15]+c[a>>>4&15]+c[15&a];return this.is224||(u+=c[s>>>28&15]+c[s>>>24&15]+c[s>>>20&15]+c[s>>>16&15]+c[s>>>12&15]+c[s>>>8&15]+c[s>>>4&15]+c[15&s]),u},y.prototype.toString=y.prototype.hex,y.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,c=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r,i>>>24&255,i>>>16&255,i>>>8&255,255&i,o>>>24&255,o>>>16&255,o>>>8&255,255&o,a>>>24&255,a>>>16&255,a>>>8&255,255&a];return this.is224||c.push(s>>>24&255,s>>>16&255,s>>>8&255,255&s),c},y.prototype.array=y.prototype.digest,y.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},w.prototype=new y,w.prototype.finalize=function(){if(y.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();y.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),y.prototype.finalize.call(this)}};var x=b();x.sha256=x,x.sha224=b(!0),x.sha256.hmac=v(),x.sha224.hmac=v(!0),o?s.exports=x:(n.sha256=x.sha256,n.sha224=x.sha224)}()),ft.exports));var s;const c=Oo();class u{message;recipient;nonce;callbackUrl;tag;constructor({message:e,nonce:t,recipient:n}){this.tag=2147484061,this.message=e,this.nonce=t,this.recipient=n}}e.AuthPayload=u,e.authPayloadSchema={struct:{tag:"u32",message:"string",nonce:{array:{type:"u8",len:32}},recipient:"string",callbackUrl:{option:"string"}}}}(Ye)),Ye}var ko={};const To=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function Co(e){return To.test(e)}function Io(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.split(/[:\/]/g).pop().toLowerCase()}Io.valid=Co;var Bo,Lo,Mo,Ro,Po,Uo,jo,Fo=He(Object.freeze({__proto__:null,default:Io,uuid4:Io,valid:Co})),Do={},zo={exports:{}},$o={exports:{}};function Wo(){return Bo||(Bo=1,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&t.rotl(e,8)|4278255360&t.rotl(e,24);for(var n=0;n<e.length;n++)e[n]=t.endian(e[n]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(t){for(var n=[],r=0;r<t.length;r+=3)for(var i=t[r]<<16|t[r+1]<<8|t[r+2],o=0;o<4;o++)8*r+6*o<=8*t.length?n.push(e.charAt(i>>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r<t.length;i=++r%4)0!=i&&n.push((e.indexOf(t.charAt(r-1))&Math.pow(2,-2*i+8)-1)<<2*i|e.indexOf(t.charAt(r))>>>6-2*i);return n}},$o.exports=t),$o.exports;var e,t}function qo(){if(Mo)return Lo;Mo=1;var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}};return Lo=e}function Xo(){return Ro||(Ro=1,function(){var e=Wo(),t=qo().utf8,n=qo().bin,r=function(r,i){var o=e.wordsToBytes(function(n){n.constructor==String?n=t.stringToBytes(n):"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(n)?n=Array.prototype.slice.call(n,0):Array.isArray(n)||(n=n.toString());var r=e.bytesToWords(n),i=8*n.length,o=[],a=1732584193,s=-271733879,c=-1732584194,u=271733878,l=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var d=0;d<r.length;d+=16){for(var f=a,h=s,p=c,b=u,m=l,g=0;g<80;g++){if(g<16)o[g]=r[d+g];else{var v=o[g-3]^o[g-8]^o[g-14]^o[g-16];o[g]=v<<1|v>>>31}var y=(a<<5|a>>>27)+l+(o[g]>>>0)+(g<20?1518500249+(s&c|~s&u):g<40?1859775393+(s^c^u):g<60?(s&c|s&u|c&u)-1894007588:(s^c^u)-899497514);l=u,u=c,c=s<<30|s>>>2,s=a,a=y}a+=f,s+=h,c+=p,u+=b,l+=m}return[a,s,c,u,l]}(r));return i&&i.asBytes?o:i&&i.asString?n.bytesToString(o):e.bytesToHex(o)};r._blocksize=16,r._digestsize=20,zo.exports=r}()),zo.exports}function Ko(){return Uo||(Uo=1,function(e){var t=ko&&ko.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.getExtension=e.RequestFailed=e.wait=void 0;const n=t(Fo),r=Cn(),i=(Po||(Po=1,function(e){var t=Do&&Do.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.createRequest=e.computeRequestId=e.deleteRequest=e.getResponse=e.proxyApi=void 0;const n=t(Xo()),r=t(Fo),i=Cn();e.proxyApi="https://h4n.app",e.getResponse=async t=>{const n=await fetch(`${e.proxyApi}/${t}/response`,{headers:{"content-type":"application/json"},method:"GET"});if(!1===n.ok)throw Error(await n.text());const{data:r}=await n.json();return JSON.parse(r)},e.deleteRequest=async t=>{const n=await fetch(`${e.proxyApi}/${t}`,{headers:{"content-type":"application/json"},method:"DELETE"});if(!1===n.ok)throw Error(await n.text())},e.computeRequestId=async e=>{const t=(0,i.baseEncode)(JSON.stringify({...e,_id:(0,r.default)()})),o=(0,n.default)(t);return{requestId:Buffer.from(o,"hex").toString("base64").replaceAll("/","_").replaceAll("-","+").slice(0,13),query:t}},e.createRequest=async(t,n)=>{const{query:r,requestId:i}=await(0,e.computeRequestId)(t),o=await fetch(`${e.proxyApi}/${i}/request`,{body:JSON.stringify({data:r}),headers:{"content-type":"application/json"},method:"POST",signal:n});if(!1===o.ok)throw Error(await o.text());return i}}(Do)),Do);e.wait=e=>new Promise(t=>setTimeout(t,e));class o extends Error{payload;name="RequestFailed";constructor(e){super(),this.payload=e}}e.RequestFailed=o;let a;e.getExtension=()=>"undefined"==typeof window?null:window.hotExtension,"undefined"!=typeof window&&window.addEventListener("message",e=>{"hot-close"===e.data&&(a?.remove(),a=void 0)});e.default=new class{walletId="https://t.me/herewalletbot/app";ancestorOrigins=["http://localhost:1234","https://my.herewallet.app","https://tgapp-dev.herewallet.app","https://tgapp.herewallet.app","https://beta.herewallet.app"];connection=new Promise(e=>"undefined"==typeof window||window?.self===window?.top?e(null):void this.injectedRequest("initialized",{}).then(e).catch(()=>e(null)));get isInjected(){return"undefined"!=typeof window&&(null!=window.hotExtension?window.hotExtension.autoRun:this.ancestorOrigins.includes(window.location.ancestorOrigins?.[0]))}openInHotBrowserUrl=null;toggleOpenInHotBrowser(e){this.openInHotBrowserUrl=e}customProvider;setupEthProvider(e){this.customProvider=e}async injectedRequest(e,t){const r=(0,n.default)();return new Promise((n,i)=>{const o=e=>{if(e.data.id===r)return window?.removeEventListener("message",o),e.data.success?n(e.data.payload):i(e.data.payload)};window?.parent.postMessage({$hot:!0,method:e,request:t,id:r},"*"),window?.addEventListener("message",o)})}subscribe(e,t){return window.hotExtension?window.hotExtension.subscribe(e,t):()=>{}}async request(t,s){if(null!=window.hotExtension)return window.hotExtension.request(t,s);if(this.isInjected)return this.injectedRequest(t,s);const c=(0,n.default)(),u=window?.Telegram?.WebApp,l=await(0,i.createRequest)({inside:!!this.openInHotBrowserUrl||"ethereum"===t&&null==this.customProvider,origin:"string"==typeof this.openInHotBrowserUrl?this.openInHotBrowserUrl:location.href,$hot:!0,method:t,request:s,id:c}),d=`${this.walletId}?startapp=hotconnect-${(0,r.baseEncode)(l)}`;if(u)u?.openTelegramLink(d);else{(e=>{a?.remove(),a=document.createElement("div");const t=document.createElement("iframe");a?.appendChild(t),t.src=e,t.allow="usb",t.style.border="none",t.style.borderRadius="16px",t.style.background="#fff",t.style.overflow="hidden",t.style.background="#1D1F20",t.style.border="1px solid #2C3034",t.style.width="375px",t.style.height="560px",t.onclick=e=>e.stopPropagation(),a.style.padding="16px",a.style.zIndex="100000000000000",a.style.position="fixed",a.style.display="flex",a.style.justifyContent="center",a.style.alignItems="center",a.style.top="0",a.style.left="0",a.style.width="100%",a.style.height="100%",a.style.background="rgba(0, 0, 0, 0.1)",a.style.backdropFilter="blur(24px)",a.onclick=()=>{a?.remove(),a=void 0},document.body.appendChild(a)})(`${"https://hot-labs.org/hot-widget/index.html"}?hotconnect-${(0,r.baseEncode)(l)}`)}const f=async()=>{await(0,e.wait)(3e3);const t=await(0,i.getResponse)(l).catch(()=>null);if(null==t)return await f();if(t.success)return t.payload;throw new o(t.payload)},h=await f();return a?.remove(),h}}}(ko)),ko}var Ho,Vo=(jo||(jo=1,function(e){var t=Ge&&Ge.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.RequestFailed=e.HOT=e.authPayloadSchema=e.AuthPayload=e.verifySignature=void 0;var n=No();Object.defineProperty(e,"verifySignature",{enumerable:!0,get:function(){return n.verifySignature}}),Object.defineProperty(e,"AuthPayload",{enumerable:!0,get:function(){return n.AuthPayload}}),Object.defineProperty(e,"authPayloadSchema",{enumerable:!0,get:function(){return n.authPayloadSchema}});var r=Ko();Object.defineProperty(e,"HOT",{enumerable:!0,get:function(){return t(r).default}}),Object.defineProperty(e,"RequestFailed",{enumerable:!0,get:function(){return r.RequestFailed}})}(Ge)),Ge).HOT,Go={name:H.Hot,website:"https://hot-labs.org/",authenticateWithSignedMessage:!0,connect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,Vo.request("stellar:getAddress",{})];case 1:return[2,e.sent().address];case 2:throw e.sent(),new Error("BLUX: Failed to connect to Hana wallet.");case 3:return[2]}})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2]})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: HotWallet does not support the getNetwork function")})})},isAvailable:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2,"undefined"!=typeof window&&!!window.hotExtension]})})},signAuthEntry:function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Vo.request("stellar:signAuthEntry",{authEntry:e,accountToSign:t.address})];case 1:return[2,n.sent().signedAuthEntry];case 2:throw n.sent(),new Error("BLUX: Failed to signAuthEntry using HotWallet");case 3:return[2]}})})},signMessage:function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Vo.request("stellar:signMessage",{message:e,accountToSign:t.address})];case 1:return[2,n.sent().signedMessage];case 2:throw n.sent(),new Error("BLUX: Failed to signMessage using HotWallet");case 3:return[2]}})})},signTransaction:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Q(void 0,te([e],t,!0),void 0,function(e,t){return void 0===t&&(t={}),ee(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Vo.request("stellar:signTransaction",{xdr:e,accountToSign:t.address})];case 1:return[2,n.sent().signedTxXdr];case 2:throw n.sent(),new Error("BLUX: Failed to signTransaction using HotWallet");case 3:return[2]}})})}},Yo={name:H.Hana,website:"https://www.hanawallet.io/",authenticateWithSignedMessage:!0,connect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,window.hanaWallet.stellar.getPublicKey()];case 1:if(!e.sent())throw new Error("BLUX: Hana Wallet is not installed or connected.");return[4,window.hanaWallet.stellar.getPublicKey()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("BLUX: Failed to connect to HanaWallet.");case 4:return[2]}})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2]})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){var e,t;return ee(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!(null===(t=window.hanaWallet)||void 0===t?void 0:t.stellar))throw new Error("BLUX: Hana Wallet is not installed.");return[4,window.hanaWallet.stellar.getNetworkDetails()];case 1:return[2,{network:(e=n.sent()).network,passphrase:e.networkPassphrase}];case 2:throw n.sent(),new Error("BLUX: Failed to getNetwork using HanaWallet");case 3:return[2]}})})},isAvailable:function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.hanaWallet)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return Q(void 0,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:if(!("undefined"!=typeof window&&!!(null===(n=window.hanaWallet)||void 0===n?void 0:n.stellar)))throw new Error("BLUX: Failed to signAuthEntry using HanaWallet");r.label=1;case 1:return r.trys.push([1,3,,4]),[4,window.hanaWallet.stellar.signAuthEntry({xdr:e,accountToSign:t.address})];case 2:return[2,r.sent()];case 3:throw r.sent(),new Error("BLUX: Failed to signAuthEntry using HanaWallet");case 4:return[2]}})})},signMessage:function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i,o,a;return ee(this,function(s){switch(s.label){case 0:if(!("undefined"!=typeof window&&!!(null===(a=window.hanaWallet)||void 0===a?void 0:a.stellar)))throw new Error("BLUX: Failed to signMessage using HanaWallet");s.label=1;case 1:return s.trys.push([1,4,,5]),n=Buffer.concat([Buffer.from("Stellar Signed Message:\n","utf8"),Buffer.from(e,"utf8")]),o=(i=Buffer).from,[4,crypto.subtle.digest("SHA-256",n)];case 2:return r=o.apply(i,[s.sent()]),[4,window.hanaWallet.stellar.signBlob({blob:r.toString("base64"),accountToSign:t.address})];case 3:return[2,s.sent()];case 4:throw s.sent(),new Error("BLUX: Failed to signMessage using HanaWallet");case 5:return[2]}})})},signTransaction:function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i,o;return ee(this,function(a){switch(a.label){case 0:if(!("undefined"!=typeof window&&!!(null===(r=window.hanaWallet)||void 0===r?void 0:r.stellar)))throw new Error("BLUX: Failed to signTransaction using HanaWallet");a.label=1;case 1:if(a.trys.push([1,3,,4]),"function"!=typeof(n=null===(o=null===(i=null===window||void 0===window?void 0:window.hanaWallet)||void 0===i?void 0:i.stellar)||void 0===o?void 0:o.signTransaction))throw new Error("BLUX: Failed to signTransaction using HanaWallet");return[4,n({xdr:e,address:t.address,networkPassphrase:t.network})];case 2:return[2,a.sent()];case 3:throw a.sent(),new Error("BLUX: Failed to signTransaction using HanaWallet");case 4:return[2]}})})}},Jo={name:H.Rabet,website:"https://rabet.io",authenticateWithSignedMessage:!0,connect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:if(e.trys.push([0,2,,3]),!window.rabet)throw new Error("BLUX: Rabet Wallet is not installed.");return[4,window.rabet.connect()];case 1:return[2,e.sent().publicKey];case 2:throw e.sent(),new Error("BLUX: Failed to connect to Rabet.");case 3:return[2]}})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){try{if(!window.rabet)throw new Error("BLUX: Rabet Wallet is not installed.");window.rabet.disconnect()}catch(e){}return[2]})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:if(e.trys.push([0,2,,3]),!window.rabet)throw new Error("BLUX: Rabet Wallet is not installed.");return[4,window.rabet.getNetwork()];case 1:return[2,e.sent()];case 2:throw e.sent(),new Error("BLUX: Failed to getNetwork from Rabet");case 3:return[2]}})})},isAvailable:function(){return new Promise(function(e){setTimeout(function(){return e("undefined"!=typeof window&&!!window.rabet)},150)})},signAuthEntry:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: Rabet does not support the signAuthEntry function")})})},signMessage:function(e,t){return Q(void 0,void 0,void 0,function(){var t;return ee(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!window.rabet)throw new Error("BLUX: Rabet Wallet is not installed.");return[4,window.rabet.signMessage(e)];case 1:if(!(t=n.sent()).message||t.error)throw new Error("BLUX: Failed to signMessage from Rabet");return[2,t.message];case 2:throw n.sent(),new Error("BLUX: Failed to signMessage from Rabet");case 3:return[2]}})})},signTransaction:function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!window.rabet)throw new Error("BLUX: Rabet Wallet is not installed.");return[4,window.rabet.sign(e,t.network===V.PUBLIC?"mainnet":"testnet")];case 1:return[2,n.sent().xdr];case 2:throw n.sent(),new Error("BLUX: Failed to sign the transaction with Rabet.");case 3:return[2]}})})}},Zo={name:H.Xbull,website:"https://xbull.app",authenticateWithSignedMessage:!0,connect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:if(e.trys.push([0,3,,4]),!window.xBullSDK)throw new Error("BLUX: xBull Wallet is not installed");return[4,window.xBullSDK.connect({canRequestPublicKey:!0,canRequestSign:!0})];case 1:return e.sent(),[4,window.xBullSDK.getPublicKey()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("BLUX: Failed to connect to xBull");case 4:return[2]}})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2]})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),!window.xBullSDK)throw new Error("BLUX: xBull Wallet is not installed");return[4,window.xBullSDK.getNetwork()];case 1:return[2,{network:(e=t.sent()).network,passphrase:e.networkPassphrase}];case 2:throw t.sent(),new Error("BLUX: Error getting network from Rabet");case 3:return[2]}})})},isAvailable:function(){return new Promise(function(e){setTimeout(function(){e("undefined"!=typeof window&&!!window.xBullSDK)},150)})},signAuthEntry:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: xBull does not support the signAuthEntry function")})})},signMessage:function(e,t){return Q(void 0,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!window.xBullSDK)throw new Error("BLUX: xBull Wallet is not installed");return[4,window.xBullSDK.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:if((n=r.sent()).error)throw new Error("BLUX: Failed to signMessage using xBull");return[2,n.signedMessage];case 2:throw r.sent(),new Error("BLUX: Failed to signMessage using xBull");case 3:return[2]}})})},signTransaction:function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!window.xBullSDK)throw new Error("BLUX: xBull Wallet is not installed.");return[4,window.xBullSDK.signXDR(e,{network:t.network,publicKey:t.address})];case 1:return[2,n.sent()];case 2:throw n.sent(),new Error("BLUX: Failed to sign the transaction with xBull.");case 3:return[2]}})})}},Qo={name:H.Albedo,website:"https://albedo.link",authenticateWithSignedMessage:!0,connect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,E.publicKey({token:"Connect to Albedo"})];case 1:return[2,e.sent().pubkey];case 2:throw e.sent(),new Error("BLUX: Failed to connect to Albedo.");case 3:return[2]}})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2]})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: Albedo does not support the getNetwork function")})})},isAvailable:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2,!0]})})},signAuthEntry:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: Albedo does not support the signAuthEntry function")})})},signMessage:function(e,t){return Q(void 0,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:return[4,E.signMessage({message:e,pubkey:t.address})];case 1:return n=r.sent(),console.log("result"),console.log(n),[2,n.signedMessage]}})})},signTransaction:function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,E.tx({xdr:e,pubkey:t.address,network:t.network})];case 1:return[2,n.sent().signed_envelope_xdr];case 2:throw n.sent(),new Error("BLUX: Failed to sign the transaction with Albedo.");case 3:return[2]}})})}},ea={name:H.Klever,website:"https://klever.io",connect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.getAddress()];case 1:return[2,e.sent().address];case 2:throw e.sent(),new Error("BLUX: Failed to connect to Klever");case 3:return[2]}})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2]})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.getNetwork()];case 1:return[2,{network:(e=t.sent()).network,passphrase:e.networkPassphrase}];case 2:throw t.sent(),new Error("BLUX: Failed to getNetwork from Klever");case 3:return[2]}})})},isAvailable:function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.kleverWallet)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.signAuthEntry(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,n.sent().signedAuthEntry];case 2:throw n.sent(),new Error("BLUX: Failed to signAuthEntry using Klever");case 3:return[2]}})})},signMessage:function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,n.sent().signedMessage];case 2:throw n.sent(),new Error("BLUX: Failed to signMessage using Klever");case 3:return[2]}})})},signTransaction:function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.signTransaction(e,t)];case 1:return[2,n.sent().signedTxXdr];case 2:throw n.sent(),new Error("BLUX: Failed to signTransaction using Klever");case 3:return[2]}})})}},ta={name:H.Lobstr,website:"https://lobstr.co",connect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,S.isConnected()];case 1:if(!e.sent())throw new Error("BLUX: LOBSTR Wallet is not installed or connected.");return[4,S.getPublicKey()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("BLUX: Failed to connect to LOBSTR.");case 4:return[2]}})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2]})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: Failed to get network from LOBSTR")})})},isAvailable:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return[4,S.isConnected()];case 1:return[2,e.sent()]}})})},signAuthEntry:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: LOBSTR does not support the signAuthEntry function")})})},signMessage:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: LOBSTR does not support the signMessage function")})})},signTransaction:function(e){return Q(void 0,void 0,void 0,function(){return ee(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),!S.signTransaction)throw new Error("BLUX: LOBSTR Wallet does not support signing transactions.");return[4,S.signTransaction(e)];case 1:return[2,t.sent()];case 2:throw t.sent(),new Error("BLUX: Failed to sign the transaction with LOBSTR.");case 3:return[2]}})})}},na={name:H.Onekey,website:"https://onekey.so",authenticateWithSignedMessage:!0,connect:function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(e=window.$onekey)||void 0===e?void 0:e.stellar))throw new Error("BLUX: Onekey Wallet is not installed or connected.");return[4,window.$onekey.stellar.getPublicKey()];case 1:return[2,t.sent()];case 2:throw t.sent(),new Error("BLUX: Failed to connect to Onekey.");case 3:return[2]}})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2]})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: Failed to get network from Onekey")})})},isAvailable:function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.$onekey)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return Q(void 0,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(n=window.$onekey)||void 0===n?void 0:n.stellar))throw new Error("BLUX: Onekey Wallet is not installed or connected.");return[4,window.$onekey.stellar.signAuthEntry(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,r.sent().signedAuthEntry];case 2:throw r.sent(),new Error("BLUX: Failed to sign auth entry with Onekey.");case 3:return[2]}})})},signMessage:function(e,t){return Q(void 0,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(n=window.$onekey)||void 0===n?void 0:n.stellar))throw new Error("BLUX: Onekey Wallet is not installed or connected.");return[4,window.$onekey.stellar.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,r.sent().signedMessage];case 2:throw r.sent(),new Error("BLUX: Failed to sign message with Onekey.");case 3:return[2]}})})},signTransaction:function(e,t){return Q(void 0,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(n=window.$onekey)||void 0===n?void 0:n.stellar))throw new Error("BLUX: Onekey Wallet is not installed or connected.");return[4,window.$onekey.stellar.signTransaction(e,{submit:!1,address:t.address,networkPassphrase:t.network})];case 1:return[2,r.sent().signedTxXdr];case 2:throw r.sent(),new Error("BLUX: Failed to sign the transaction with Onekey.");case 3:return[2]}})})}},ra={name:H.Bitget,website:"https://bitget.com",authenticateWithSignedMessage:!0,connect:function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(e=window.bitkeep)||void 0===e?void 0:e.stellar))throw new Error("BLUX: Bitget Wallet is not installed or connected.");return[4,window.bitkeep.stellar.connect()];case 1:return[2,t.sent()];case 2:throw t.sent(),new Error("BLUX: Failed to connect to Bitget.");case 3:return[2]}})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2]})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:return[4,window.bitkeep.stellar.network()];case 1:return[2,{network:(e=t.sent()).network,passphrase:e.networkPassphrase}]}})})},isAvailable:function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.bitkeep)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: Failed to sign auth entry with Bitget")})})},signMessage:function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i;return ee(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(i=window.bitkeep)||void 0===i?void 0:i.stellar))throw new Error("BLUX: Bitkeep Wallet is not installed or connected.");return[4,window.bitkeep.stellar.signMessage(e,t.address)];case 1:return n=o.sent(),r=new Uint8Array(n.match(/.{1,2}/g).map(function(e){return parseInt(e,16)})),[2,btoa(String.fromCharCode.apply(String,r))];case 2:throw o.sent(),new Error("BLUX: Failed to sign message with Bitkeep.");case 3:return[2]}})})},signTransaction:function(e,t){return Q(void 0,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(n=window.bitkeep)||void 0===n?void 0:n.stellar))throw new Error("BLUX: Bitget Wallet is not installed or connected.");return[4,window.bitkeep.stellar.signTransaction(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,r.sent()];case 2:throw r.sent(),new Error("BLUX: Failed to sign the transaction with Bitget.");case 3:return[2]}})})}},ia={exports:{}};var oa=function(){if(Ho)return ia.exports;Ho=1;var e,t="object"==typeof Reflect?Reflect:null,n=t&&"function"==typeof t.apply?t.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}ia.exports=i,ia.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}p(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&p(e,"error",t,n)}(e,i,{once:!0})})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,o,c,u;if(a(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),c=o[t]),void 0===c)c=o[t]=n,++e._eventsCount;else if("function"==typeof c?c=o[t]=r?[n,c]:[c,n]:r?c.unshift(n):c.push(n),(i=s(e))>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=c.length,u=l,console&&console.warn&&console.warn(u)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):h(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function h(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function p(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(o){r.once&&e.removeEventListener(t,i),n(o)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var u=c.length,l=h(c,u);for(r=0;r<u;++r)n(l[r],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return a(t),this.on(e,l(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,l(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,i,o,s;if(a(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},ia.exports}(),aa=Ke(oa);const sa={},ca={},ua=(e,t)=>{ca[e]=t},la=e=>{class t extends Error{cause;constructor(n,r,i){if(super(n||e,i),Object.setPrototypeOf(this,t.prototype),this.name=e,r)for(const e in r)this[e]=r[e];if(i&&"object"==typeof i&&"cause"in i&&!this.cause){const e=i.cause;this.cause=e,"stack"in e&&(this.stack=this.stack+"\nCAUSE: "+e.stack)}}}return sa[e]=t,t};la("AccountNameRequired"),la("AccountNotSupported"),la("AccountAwaitingSendPendingOperations"),la("AmountRequired"),la("BluetoothRequired"),la("BtcUnmatchedApp"),la("CantOpenDevice"),la("CashAddrNotSupported"),la("ClaimRewardsFeesWarning"),la("CurrencyNotSupported"),la("DeviceAppVerifyNotSupported"),la("DeviceGenuineSocketEarlyClose"),la("DeviceNotGenuine"),la("DeviceOnDashboardExpected"),la("DeviceOnDashboardUnexpected"),la("DeviceInOSUExpected"),la("DeviceHalted"),la("DeviceNameInvalid"),la("DeviceSocketFail"),la("DeviceSocketNoBulkStatus"),la("DeviceSocketNoBulkStatus"),la("UnresponsiveDeviceError");const da=la("DisconnectedDevice"),fa=la("DisconnectedDeviceDuringOperation");la("DeviceExtractOnboardingStateError"),la("DeviceOnboardingStatePollingError"),la("EnpointConfig"),la("EthAppPleaseEnableContractData"),la("SolAppPleaseEnableContractData"),la("CeloAppPleaseEnableContractData"),la("FeeEstimationFailed"),la("FirmwareNotRecognized"),la("HardResetFail"),la("InvalidXRPTag"),la("InvalidAddress"),la("InvalidTransactionError"),la("InvalidNonce"),la("InvalidAddressBecauseDestinationIsAlsoSource"),la("LatestMCUInstalledError"),la("LatestFirmwareVersionRequired"),la("UnsupportedFeatureError"),la("NanoSNotSupported"),la("UnknownMCU"),la("LedgerAPIError"),la("LedgerAPIErrorWithMessage"),la("LedgerAPINotAvailable"),la("ManagerAppAlreadyInstalled"),la("ManagerAppRelyOnBTC"),la("ManagerAppDepInstallRequired"),la("ManagerAppDepUninstallRequired"),la("ManagerDeviceLocked"),la("ManagerFirmwareNotEnoughSpace"),la("ManagerNotEnoughSpace"),la("ManagerUninstallBTCDep"),la("NetworkDown"),la("NetworkError"),la("NoAddressesFound"),la("NotEnoughBalance"),la("NotEnoughBalanceFees"),la("NotEnoughBalanceSwap"),la("NotEnoughBalanceToDelegate"),la("UnstakeNotEnoughStakedBalanceLeft"),la("RestakeNotEnoughStakedBalanceLeft"),la("NotEnoughToRestake"),la("NotEnoughToUnstake"),la("NotEnoughBalanceInParentAccount"),la("NotEnoughSpendableBalance"),la("NotEnoughBalanceBecauseDestinationNotCreated"),la("NotEnoughToStake"),la("NoAccessToCamera"),la("NotEnoughGas"),la("NotEnoughGasSwap"),la("TronEmptyAccount"),la("MaybeKeepTronAccountAlive"),la("NotSupportedLegacyAddress"),la("GasLessThanEstimate"),la("PriorityFeeTooLow"),la("PriorityFeeTooHigh"),la("PriorityFeeHigherThanMaxFee"),la("MaxFeeTooLow"),la("PasswordsDontMatch"),la("PasswordIncorrect"),la("RecommendSubAccountsToEmpty"),la("RecommendUndelegation"),la("TimeoutTagged"),la("UnexpectedBootloader"),la("MCUNotGenuineToDashboard"),la("RecipientRequired"),la("UnavailableTezosOriginatedAccountReceive"),la("UnavailableTezosOriginatedAccountSend"),la("UpdateFetchFileFail"),la("UpdateIncorrectHash"),la("UpdateIncorrectSig"),la("UpdateYourApp"),la("UserRefusedDeviceNameChange"),la("UserRefusedAddress"),la("UserRefusedFirmwareUpdate"),la("UserRefusedAllowManager"),la("UserRefusedOnDevice"),la("PinNotSet"),la("ExpertModeRequired");const ha=la("TransportOpenUserCancelled"),pa=la("TransportInterfaceNotAvailable"),ba=la("TransportRaceCondition"),ma=la("TransportWebUSBGestureRequired");var ga;la("TransactionHasBeenValidatedError"),la("TransportExchangeTimeoutError"),la("DeviceShouldStayInApp"),la("WebsocketConnectionError"),la("WebsocketConnectionFailed"),la("WrongDeviceForAccount"),la("WrongDeviceForAccountPayout"),la("MissingSwapPayloadParamaters"),la("WrongDeviceForAccountRefund"),la("WrongAppForCurrency"),la("ETHAddressNonEIP"),la("CantScanQRCode"),la("FeeNotLoaded"),la("FeeNotLoadedSwap"),la("FeeRequired"),la("FeeTooHigh"),la("ValAddressRequired"),la("RedelegateDstValAddressRequired"),la("PendingOperation"),la("SyncError"),la("PairingFailed"),la("PeerRemovedPairing"),la("GenuineCheckFailed"),la("LedgerAPI4xx"),la("LedgerAPI5xx"),la("FirmwareOrAppUpdateRequired"),la("ReplacementTransactionUnderpriced"),la("OpReturnSizeLimit"),la("DustLimit"),la("ConcordiumInsufficientFunds"),la("ConcordiumMemoTooLong"),la("ConcordiumPairingExpiredError"),la("ConcordiumSessionExpiredError"),la("ConcordiumTrustedMetadataServiceError"),la("ConcordiumAddressVerificationFailedError"),la("ConcordiumInvalidMaxFeeError"),la("LanguageNotFound"),la("NoDBPathGiven"),la("DBWrongPassword"),la("DBNotReset"),la("SequenceNumberError"),la("DisabledTransactionBroadcastError"),la("InvalidParameterError"),function(e){e.Unknown="Unknown",e.LocationServicesDisabled="LocationServicesDisabled",e.LocationServicesUnauthorized="LocationServicesUnauthorized",e.BluetoothScanStartFailed="BluetoothScanStartFailed"}(ga||(ga={}));class va extends Error{id;constructor(e,t){const n="TransportError";super(e||n),this.name=n,this.message=e,this.stack=new Error(e).stack,this.id=t}}ua("TransportError",e=>new va(e.message,e.id));const ya={ACCESS_CONDITION_NOT_FULFILLED:38916,ALGORITHM_NOT_SUPPORTED:38020,CLA_NOT_SUPPORTED:28160,CLA_NOT_SUPPORTED_BOOTLOADER:28161,CODE_BLOCKED:38976,CODE_NOT_INITIALIZED:38914,COMMAND_INCOMPATIBLE_FILE_STRUCTURE:27009,CONDITIONS_OF_USE_NOT_SATISFIED:27013,CONTRADICTION_INVALIDATION:38928,CONTRADICTION_SECRET_CODE_STATUS:38920,DEVICE_IN_RECOVERY_MODE:26159,CUSTOM_IMAGE_EMPTY:26158,FILE_ALREADY_EXISTS:27273,FILE_NOT_FOUND:37892,GP_AUTH_FAILED:25344,HALTED:28586,INCONSISTENT_FILE:37896,INCORRECT_DATA:27264,INCORRECT_LENGTH:26368,INCORRECT_P1_P2:27392,INS_NOT_SUPPORTED:27904,DEVICE_NOT_ONBOARDED:27911,DEVICE_NOT_ONBOARDED_2:26129,INVALID_KCV:38021,INVALID_OFFSET:37890,LICENSING:28482,LOCKED_DEVICE:21781,MAX_VALUE_REACHED:38992,MEMORY_PROBLEM:37440,MISSING_CRITICAL_PARAMETER:26624,NO_EF_SELECTED:37888,NOT_ENOUGH_MEMORY_SPACE:27268,OK:36864,PIN_REMAINING_ATTEMPTS:25536,REFERENCED_DATA_NOT_FOUND:27272,SECURITY_STATUS_NOT_SATISFIED:27010,TECHNICAL_PROBLEM:28416,UNKNOWN_APDU:27906,USER_REFUSED_ON_DEVICE:21761,NOT_ENOUGH_SPACE:20738,APP_NOT_FOUND_OR_INVALID_CONTEXT:20771,INVALID_APP_NAME_LENGTH:26378,GEN_AES_KEY_FAILED:21529,INTERNAL_CRYPTO_OPERATION_FAILED:21530,INTERNAL_COMPUTE_AES_CMAC_FAILED:21531,ENCRYPT_APP_STORAGE_FAILED:21532,INVALID_BACKUP_STATE:26178,PIN_NOT_SET:21762,INVALID_BACKUP_LENGTH:26419,INVALID_RESTORE_STATE:26179,INVALID_CHUNK_LENGTH:26420,INVALID_BACKUP_HEADER:26698,SW_BAD_STATE:45063};class wa extends Error{statusCode;statusText;constructor(e,{canBeMappedToChildError:t=!0}={}){const n=Object.keys(ya).find(t=>ya[t]===e)||"UNKNOWN_ERROR",r=`Ledger device: ${function(e){switch(e){case 26368:return"Incorrect length";case 26624:return"Missing critical parameter";case 27010:return"Security not satisfied (dongle locked or have invalid access rights)";case 27013:return"Condition of use not satisfied (denied by the user?)";case 27264:return"Invalid data received";case 27392:return"Invalid parameter received";case 21781:return"Locked device";case 45063:return"Unexpected state on the device"}if(28416<=e&&e<=28671)return"Internal error, please report"}(e)||n} (0x${e.toString(16)})`;if(super(r),this.name="TransportStatusError",this.statusCode=e,this.statusText=n,Object.setPrototypeOf(this,wa.prototype),t&&e===ya.LOCKED_DEVICE)return new xa(r)}}class xa extends wa{constructor(e){super(ya.LOCKED_DEVICE,{canBeMappedToChildError:!1}),e&&(this.message=e),this.name="LockedDeviceError",Object.setPrototypeOf(this,xa.prototype)}}ua("TransportStatusError",e=>new wa(e.statusCode));let Aa=0;const Ea=[],Sa=(e,t,n)=>{const r={type:e,id:String(++Aa),date:new Date};t&&(r.message=t),Na(r)};class _a{type;context;constructor(e,t){this.type=e,this.context=t}trace(e,t){(({type:e,message:t,data:n,context:r})=>{const i={type:e,id:String(++Aa),date:new Date};t&&(i.message=t),n&&(i.data=n),r&&(i.context=r),Na(i)})({type:this.type,message:e,data:t,context:this.context})}getContext(){return this.context}setContext(e){this.context=e}updateContext(e){this.context={...this.context,...e}}getType(){return this.type}setType(e){this.type=e}withType(e){return new _a(e,this.context)}withContext(e){return new _a(this.type,e)}withUpdatedContext(e){return new _a(this.type,{...this.context,...e})}}const Oa=e=>(Ea.push(e),()=>{const t=Ea.indexOf(e);-1!==t&&(Ea[t]=Ea[Ea.length-1],Ea.pop())});function Na(e){for(let t=0;t<Ea.length;t++)try{Ea[t](e)}catch(e){console.error(e)}}"undefined"!=typeof window&&(window.__ledgerLogsListen=Oa);class ka{exchangeTimeout=3e4;unresponsiveTimeout=15e3;deviceModel=null;tracer;constructor({context:e,logType:t}={}){this.tracer=new _a(t??"transport",e)}static isSupported;static list;static listen;static open;exchange(e,{abortTimeoutMs:t}={}){throw new Error("exchange not implemented")}exchangeBulk(e,t){let n=!1;return(async()=>{if(!n)for(const r of e){const e=await this.exchange(r);if(n)return;const i=e.readUInt16BE(e.length-2);if(i!==ya.OK)throw new wa(i);t.next(e)}})().then(()=>!n&&t.complete(),e=>!n&&t.error(e)),{unsubscribe:()=>{n=!0}}}setScrambleKey(e){}close(){return Promise.resolve()}_events=new aa;on(e,t){this._events.on(e,t)}off(e,t){this._events.removeListener(e,t)}emit(e,...t){this._events.emit(e,...t)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(e){this.exchangeTimeout=e}setExchangeUnresponsiveTimeout(e){this.unresponsiveTimeout=e}send=async(e,t,n,r,i=Or().Buffer.alloc(0),o=[ya.OK],{abortTimeoutMs:a}={})=>{const s=this.tracer.withUpdatedContext({function:"send"});if(i.length>=256)throw s.trace("data.length exceeded 256 bytes limit",{dataLength:i.length}),new va("data.length exceed 256 bytes limit. Got: "+i.length,"DataLengthTooBig");const c=await this.exchange(Or().Buffer.concat([Buffer.from([e,t,n,r]),Buffer.from([i.length]),i]),{abortTimeoutMs:a}),u=c.readUInt16BE(c.length-2);if(!o.some(e=>e===u))throw new wa(u);return c};static create(e=3e3,t){return new Promise((n,r)=>{let i=!1;const o=this.listen({next:t=>{i=!0,o&&o.unsubscribe(),a&&clearTimeout(a),this.open(t.descriptor,e).then(n,r)},error:e=>{a&&clearTimeout(a),r(e)},complete:()=>{a&&clearTimeout(a),i||r(new va(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),a=t?setTimeout(()=>{o.unsubscribe(),r(new va(this.ErrorMessage_ListenTimeout,"ListenTimeout"))},t):null})}exchangeBusyPromise;async exchangeAtomicImpl(e){const t=this.tracer.withUpdatedContext({function:"exchangeAtomicImpl",unresponsiveTimeout:this.unresponsiveTimeout});if(this.exchangeBusyPromise)throw t.trace("Atomic exchange is already busy"),new ba("An action was already pending on the Ledger device. Please deny or reconnect.");let n;const r=new Promise(e=>{n=e});this.exchangeBusyPromise=r;let i=!1;const o=setTimeout(()=>{t.trace('Timeout reached, emitting Transport event "unresponsive"',{unresponsiveTimeout:this.unresponsiveTimeout}),i=!0,this.emit("unresponsive")},this.unresponsiveTimeout);try{const n=await e();return i&&(t.trace("Device was unresponsive, emitting responsive"),this.emit("responsive")),n}finally{t.trace("Finalize, clearing busy guard"),clearTimeout(o),n&&n(),this.exchangeBusyPromise=null}}decorateAppAPIMethods(e,t,n){for(const r of t)e[r]=this.decorateAppAPIMethod(r,e[r],e,n)}_appAPIlock=null;decorateAppAPIMethod(e,t,n,r){return async(...i)=>{const{_appAPIlock:o}=this;if(o)return Promise.reject(new va("Ledger Device is busy (lock "+o+")","TransportLocked"));try{return this._appAPIlock=e,this.setScrambleKey(r),await t.apply(n,i)}finally{this._appAPIlock=null}}}setTraceContext(e){this.tracer=this.tracer.withContext(e)}updateTraceContext(e){this.tracer.updateContext(e)}getTraceContext(){return this.tracer.getContext()}static ErrorMessage_ListenTimeout="No Ledger device found (timeout)";static ErrorMessage_NoDeviceFound="No Ledger device found"}function Ta(e){const t=Or().Buffer.alloc(2);return t.writeUInt16BE(e,0),t}const Ca={data:Or().Buffer.alloc(0),dataLength:0,sequence:0};var Ia,Ba,La,Ma,Ra,Pa,Ua,ja,Fa,Da,za,$a,Wa,qa,Xa,Ka,Ha,Va,Ga,Ya,Ja,Za,Qa,es,ts,ns,rs,is,os,as,ss,cs,us,ls,ds,fs,hs,ps,bs,ms,gs,vs,ys,ws,xs,As,Es,Ss,_s,Os,Ns,ks,Ts,Cs,Is,Bs,Ls,Ms,Rs,Ps,Us,js,Fs,Ds,zs,$s,Ws,qs,Xs,Ks,Hs,Vs,Gs,Ys,Js,Zs,Qs,ec,tc,nc,rc,ic,oc,ac,sc,cc,uc,lc,dc,fc={exports:{}};function hc(){if(Ba)return Ia;Ba=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return Ia={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}function pc(){if(Ma)return La;Ma=1;const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return La=e}function bc(){return Ra||(Ra=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=hc(),o=pc(),a=(t=e.exports={}).re=[],s=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let d=0;const f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[f,r]],p=(e,t,n)=>{const r=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=d++;o(e,i,t),l[e]=i,c[i]=t,u[i]=r,a[i]=new RegExp(t,n?"g":void 0),s[i]=new RegExp(r,n?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),p("FULL",`^${c[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),p("LOOSE",`^${c[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),p("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?`+`(?:${c[l.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[l.COERCE],!0),p("COERCERTLFULL",c[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(fc,fc.exports)),fc.exports}function mc(){if(Ua)return Pa;Ua=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Pa=n=>n?"object"!=typeof n?e:n:t}function gc(){if(Fa)return ja;Fa=1;const e=/^[0-9]+$/,t=(t,n)=>{if("number"==typeof t&&"number"==typeof n)return t===n?0:t<n?-1:1;const r=e.test(t),i=e.test(n);return r&&i&&(t=+t,n=+n),t===n?0:r&&!i?-1:i&&!r?1:t<n?-1:1};return ja={compareIdentifiers:t,rcompareIdentifiers:(e,n)=>t(n,e)}}function vc(){if(za)return Da;za=1;const e=pc(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=hc(),{safeRe:r,t:i}=bc(),o=mc(),{compareIdentifiers:a}=gc();class s{constructor(a,c){if(c=o(c),a instanceof s){if(a.loose===!!c.loose&&a.includePrerelease===!!c.includePrerelease)return a;a=a.version}else if("string"!=typeof a)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof a}".`);if(a.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",a,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const u=a.trim().match(c.loose?r[i.LOOSE]:r[i.FULL]);if(!u)throw new TypeError(`Invalid Version: ${a}`);if(this.raw=a,this.major=+u[1],this.minor=+u[2],this.patch=+u[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");u[4]?this.prerelease=u[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<n)return t}return e}):this.prerelease=[],this.build=u[5]?u[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(e("SemVer.compare",this.version,this.options,t),!(t instanceof s)){if("string"==typeof t&&t===this.version)return 0;t=new s(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof s||(e=new s(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(t){if(t instanceof s||(t=new s(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const r=this.prerelease[n],i=t.prerelease[n];if(e("prerelease compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return a(r,i)}while(++n)}compareBuild(t){t instanceof s||(t=new s(t,this.options));let n=0;do{const r=this.build[n],i=t.build[n];if(e("build compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return a(r,i)}while(++n)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?r[i.PRERELEASELOOSE]:r[i.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===a(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Da=s}function yc(){if(Wa)return $a;Wa=1;const e=vc();return $a=(t,n,r=!1)=>{if(t instanceof e)return t;try{return new e(t,n)}catch(e){if(!r)return null;throw e}},$a}function wc(){if(ss)return as;ss=1;const e=vc();return as=(t,n,r)=>new e(t,r).compare(new e(n,r))}function xc(){if(hs)return fs;hs=1;const e=vc();return fs=(t,n,r)=>{const i=new e(t,r),o=new e(n,r);return i.compare(o)||i.compareBuild(o)}}function Ac(){if(ys)return vs;ys=1;const e=wc();return vs=(t,n,r)=>e(t,n,r)>0}function Ec(){if(xs)return ws;xs=1;const e=wc();return ws=(t,n,r)=>e(t,n,r)<0}function Sc(){if(Es)return As;Es=1;const e=wc();return As=(t,n,r)=>0===e(t,n,r)}function _c(){if(_s)return Ss;_s=1;const e=wc();return Ss=(t,n,r)=>0!==e(t,n,r)}function Oc(){if(Ns)return Os;Ns=1;const e=wc();return Os=(t,n,r)=>e(t,n,r)>=0}function Nc(){if(Ts)return ks;Ts=1;const e=wc();return ks=(t,n,r)=>e(t,n,r)<=0}function kc(){if(Is)return Cs;Is=1;const e=Sc(),t=_c(),n=Ac(),r=Oc(),i=Ec(),o=Nc();return Cs=(a,s,c,u)=>{switch(s){case"===":return"object"==typeof a&&(a=a.version),"object"==typeof c&&(c=c.version),a===c;case"!==":return"object"==typeof a&&(a=a.version),"object"==typeof c&&(c=c.version),a!==c;case"":case"=":case"==":return e(a,c,u);case"!=":return t(a,c,u);case">":return n(a,c,u);case">=":return r(a,c,u);case"<":return i(a,c,u);case"<=":return o(a,c,u);default:throw new TypeError(`Invalid operator: ${s}`)}}}function Tc(){if(Us)return Ps;Us=1;const e=/\s+/g;class t{constructor(n,r){if(r=i(r),n instanceof t)return n.loose===!!r.loose&&n.includePrerelease===!!r.includePrerelease?n:new t(n.raw,r);if(n instanceof o)return this.raw=n.value,this.set=[[n]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=n.trim().replace(e," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!b(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+e,n=r.get(t);if(n)return n;const i=this.options.loose,s=i?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(s,k(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],l),a("comparator trim",e),e=e.replace(c[u.TILDETRIM],d),a("tilde trim",e),e=e.replace(c[u.CARETTRIM],f),a("caret trim",e);let m=e.split(" ").map(e=>v(e,this.options)).join(" ").split(/\s+/).map(e=>N(e,this.options));i&&(m=m.filter(e=>(a("loose invalid filter",e,this.options),!!e.match(c[u.COMPARATORLOOSE])))),a("range list",m);const g=new Map,y=m.map(e=>new o(e,this.options));for(const e of y){if(b(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const w=[...g.values()];return r.set(t,w),w}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(t=>g(t,n)&&e.set.some(e=>g(e,n)&&t.every(t=>e.every(e=>t.intersects(e,n)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(T(this.set[t],e,this.options))return!0;return!1}}Ps=t;const n=(Rs||(Rs=1,Ms=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}),Ms),r=new n,i=mc(),o=Cc(),a=pc(),s=vc(),{safeRe:c,t:u,comparatorTrimReplace:l,tildeTrimReplace:d,caretTrimReplace:f}=bc(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:p}=hc(),b=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,g=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},v=(e,t)=>(e=e.replace(c[u.BUILD],""),a("comp",e,t),e=A(e,t),a("caret",e),e=w(e,t),a("tildes",e),e=S(e,t),a("xrange",e),e=O(e,t),a("stars",e),e),y=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,t)=>e.trim().split(/\s+/).map(e=>x(e,t)).join(" "),x=(e,t)=>{const n=t.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(n,(t,n,r,i,o)=>{let s;return a("tilde",e,t,n,r,i,o),y(n)?s="":y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:o?(a("replaceTilde pr",o),s=`>=${n}.${r}.${i}-${o} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,a("tilde return",s),s})},A=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{a("caret",e,t);const n=t.loose?c[u.CARETLOOSE]:c[u.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,i,o,s)=>{let c;return a("caret",e,t,n,i,o,s),y(n)?c="":y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(o)?c="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(a("replaceCaret pr",s),c="0"===n?"0"===i?`>=${n}.${i}.${o}-${s} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o}-${s} <${+n+1}.0.0-0`):(a("no pr"),c="0"===n?"0"===i?`>=${n}.${i}.${o}${r} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o} <${+n+1}.0.0-0`),a("caret return",c),c})},S=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map(e=>_(e,t)).join(" ")),_=(e,t)=>{e=e.trim();const n=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,(n,r,i,o,s,c)=>{a("xRange",e,n,r,i,o,s,c);const u=y(i),l=u||y(o),d=l||y(s),f=d;return"="===r&&f&&(r=""),c=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(l&&(o=0),s=0,">"===r?(r=">=",l?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===r&&(r="<",l?i=+i+1:o=+o+1),"<"===r&&(c="-0"),n=`${r+i}.${o}.${s}${c}`):l?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${o}.0${c} <${i}.${+o+1}.0-0`),a("xRange return",n),n})},O=(e,t)=>(a("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),N=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),k=e=>(t,n,r,i,o,a,s,c,u,l,d,f)=>`${n=y(r)?"":y(i)?`>=${r}.0.0${e?"-0":""}`:y(o)?`>=${r}.${i}.0${e?"-0":""}`:a?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=y(u)?"":y(l)?`<${+u+1}.0.0-0`:y(d)?`<${u}.${+l+1}.0-0`:f?`<=${u}.${l}.${d}-${f}`:e?`<${u}.${l}.${+d+1}-0`:`<=${c}`}`.trim(),T=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(a(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return Ps}function Cc(){if(Fs)return js;Fs=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),a("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new s(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(a("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new s(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,r).test(this.value):""===e.operator?""===e.value||new c(this.value,r).test(e.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}js=t;const n=mc(),{safeRe:r,t:i}=bc(),o=kc(),a=pc(),s=vc(),c=Tc();return js}function Ic(){if(zs)return Ds;zs=1;const e=Tc();return Ds=(t,n,r)=>{try{n=new e(n,r)}catch(e){return!1}return n.test(t)},Ds}function Bc(){if(Js)return Ys;Js=1;const e=Tc();return Ys=(t,n)=>{try{return new e(t,n).range||"*"}catch(e){return null}},Ys}function Lc(){if(Qs)return Zs;Qs=1;const e=vc(),t=Cc(),{ANY:n}=t,r=Tc(),i=Ic(),o=Ac(),a=Ec(),s=Nc(),c=Oc();return Zs=(u,l,d,f)=>{let h,p,b,m,g;switch(u=new e(u,f),l=new r(l,f),d){case">":h=o,p=s,b=a,m=">",g=">=";break;case"<":h=a,p=c,b=o,m="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(u,l,f))return!1;for(let e=0;e<l.set.length;++e){const r=l.set[e];let i=null,o=null;if(r.forEach(e=>{e.semver===n&&(e=new t(">=0.0.0")),i=i||e,o=o||e,h(e.semver,i.semver,f)?i=e:b(e.semver,o.semver,f)&&(o=e)}),i.operator===m||i.operator===g)return!1;if((!o.operator||o.operator===m)&&p(u,o.semver))return!1;if(o.operator===g&&b(u,o.semver))return!1}return!0},Zs}var Mc,Rc=function(){if(dc)return lc;dc=1;const e=bc(),t=hc(),n=vc(),r=gc(),i=yc(),o=function(){if(Xa)return qa;Xa=1;const e=yc();return qa=(t,n)=>{const r=e(t,n);return r?r.version:null},qa}(),a=function(){if(Ha)return Ka;Ha=1;const e=yc();return Ka=(t,n)=>{const r=e(t.trim().replace(/^[=v]+/,""),n);return r?r.version:null},Ka}(),s=function(){if(Ga)return Va;Ga=1;const e=vc();return Va=(t,n,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new e(t instanceof e?t.version:t,r).inc(n,i,o).version}catch(e){return null}},Va}(),c=function(){if(Ja)return Ya;Ja=1;const e=yc();return Ya=(t,n)=>{const r=e(t,null,!0),i=e(n,null,!0),o=r.compare(i);if(0===o)return null;const a=o>0,s=a?r:i,c=a?i:r,u=!!s.prerelease.length;if(c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(0===c.compareMain(s))return c.minor&&!c.patch?"minor":"patch"}const l=u?"pre":"";return r.major!==i.major?l+"major":r.minor!==i.minor?l+"minor":r.patch!==i.patch?l+"patch":"prerelease"}}(),u=function(){if(Qa)return Za;Qa=1;const e=vc();return Za=(t,n)=>new e(t,n).major}(),l=function(){if(ts)return es;ts=1;const e=vc();return es=(t,n)=>new e(t,n).minor}(),d=function(){if(rs)return ns;rs=1;const e=vc();return ns=(t,n)=>new e(t,n).patch}(),f=function(){if(os)return is;os=1;const e=yc();return is=(t,n)=>{const r=e(t,n);return r&&r.prerelease.length?r.prerelease:null},is}(),h=wc(),p=function(){if(us)return cs;us=1;const e=wc();return cs=(t,n,r)=>e(n,t,r)}(),b=function(){if(ds)return ls;ds=1;const e=wc();return ls=(t,n)=>e(t,n,!0)}(),m=xc(),g=function(){if(bs)return ps;bs=1;const e=xc();return ps=(t,n)=>t.sort((t,r)=>e(t,r,n))}(),v=function(){if(gs)return ms;gs=1;const e=xc();return ms=(t,n)=>t.sort((t,r)=>e(r,t,n))}(),y=Ac(),w=Ec(),x=Sc(),A=_c(),E=Oc(),S=Nc(),_=kc(),O=function(){if(Ls)return Bs;Ls=1;const e=vc(),t=yc(),{safeRe:n,t:r}=bc();return Bs=(i,o)=>{if(i instanceof e)return i;if("number"==typeof i&&(i=String(i)),"string"!=typeof i)return null;let a=null;if((o=o||{}).rtl){const e=o.includePrerelease?n[r.COERCERTLFULL]:n[r.COERCERTL];let t;for(;(t=e.exec(i))&&(!a||a.index+a[0].length!==i.length);)a&&t.index+t[0].length===a.index+a[0].length||(a=t),e.lastIndex=t.index+t[1].length+t[2].length;e.lastIndex=-1}else a=i.match(o.includePrerelease?n[r.COERCEFULL]:n[r.COERCE]);if(null===a)return null;const s=a[2],c=a[3]||"0",u=a[4]||"0",l=o.includePrerelease&&a[5]?`-${a[5]}`:"",d=o.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${s}.${c}.${u}${l}${d}`,o)},Bs}(),N=Cc(),k=Tc(),T=Ic(),C=function(){if(Ws)return $s;Ws=1;const e=Tc();return $s=(t,n)=>new e(t,n).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" ")),$s}(),I=function(){if(Xs)return qs;Xs=1;const e=vc(),t=Tc();return qs=(n,r,i)=>{let o=null,a=null,s=null;try{s=new t(r,i)}catch(e){return null}return n.forEach(t=>{s.test(t)&&(o&&-1!==a.compare(t)||(o=t,a=new e(o,i)))}),o},qs}(),B=function(){if(Hs)return Ks;Hs=1;const e=vc(),t=Tc();return Ks=(n,r,i)=>{let o=null,a=null,s=null;try{s=new t(r,i)}catch(e){return null}return n.forEach(t=>{s.test(t)&&(o&&1!==a.compare(t)||(o=t,a=new e(o,i)))}),o},Ks}(),L=function(){if(Gs)return Vs;Gs=1;const e=vc(),t=Tc(),n=Ac();return Vs=(r,i)=>{r=new t(r,i);let o=new e("0.0.0");if(r.test(o))return o;if(o=new e("0.0.0-0"),r.test(o))return o;o=null;for(let t=0;t<r.set.length;++t){const i=r.set[t];let a=null;i.forEach(t=>{const r=new e(t.semver.version);switch(t.operator){case">":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":a&&!n(r,a)||(a=r);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}}),!a||o&&!n(o,a)||(o=a)}return o&&r.test(o)?o:null},Vs}(),M=Bc(),R=Lc(),P=function(){if(tc)return ec;tc=1;const e=Lc();return ec=(t,n,r)=>e(t,n,">",r),ec}(),U=function(){if(rc)return nc;rc=1;const e=Lc();return nc=(t,n,r)=>e(t,n,"<",r),nc}(),j=function(){if(oc)return ic;oc=1;const e=Tc();return ic=(t,n,r)=>(t=new e(t,r),n=new e(n,r),t.intersects(n,r))}(),F=function(){if(sc)return ac;sc=1;const e=Ic(),t=wc();return ac=(n,r,i)=>{const o=[];let a=null,s=null;const c=n.sort((e,n)=>t(e,n,i));for(const t of c)e(t,r,i)?(s=t,a||(a=t)):(s&&o.push([a,s]),s=null,a=null);a&&o.push([a,null]);const u=[];for(const[e,t]of o)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const l=u.join(" || "),d="string"==typeof r.raw?r.raw:String(r);return l.length<d.length?l:r},ac}(),D=function(){if(uc)return cc;uc=1;const e=Tc(),t=Cc(),{ANY:n}=t,r=Ic(),i=wc(),o=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],s=(e,t,s)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===n){if(1===t.length&&t[0].semver===n)return!0;e=s.includePrerelease?o:a}if(1===t.length&&t[0].semver===n){if(s.includePrerelease)return!0;t=a}const l=new Set;let d,f,h,p,b,m,g;for(const t of e)">"===t.operator||">="===t.operator?d=c(d,t,s):"<"===t.operator||"<="===t.operator?f=u(f,t,s):l.add(t.semver);if(l.size>1)return null;if(d&&f){if(h=i(d.semver,f.semver,s),h>0)return null;if(0===h&&(">="!==d.operator||"<="!==f.operator))return null}for(const e of l){if(d&&!r(e,String(d),s))return null;if(f&&!r(e,String(f),s))return null;for(const n of t)if(!r(e,String(n),s))return!1;return!0}let v=!(!f||s.includePrerelease||!f.semver.prerelease.length)&&f.semver,y=!(!d||s.includePrerelease||!d.semver.prerelease.length)&&d.semver;v&&1===v.prerelease.length&&"<"===f.operator&&0===v.prerelease[0]&&(v=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,d)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(p=c(d,e,s),p===e&&p!==d)return!1}else if(">="===d.operator&&!r(d.semver,String(e),s))return!1;if(f)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if(b=u(f,e,s),b===e&&b!==f)return!1}else if("<="===f.operator&&!r(f.semver,String(e),s))return!1;if(!e.operator&&(f||d)&&0!==h)return!1}return!(d&&m&&!f&&0!==h||f&&g&&!d&&0!==h||y||v)},c=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},u=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};return cc=(t,n,r={})=>{if(t===n)return!0;t=new e(t,r),n=new e(n,r);let i=!1;e:for(const e of t.set){for(const t of n.set){const n=s(e,t,r);if(i=i||null!==n,n)continue e}if(i)return!1}return!0}}();return lc={parse:i,valid:o,clean:a,inc:s,diff:c,major:u,minor:l,patch:d,prerelease:f,compare:h,rcompare:p,compareLoose:b,compareBuild:m,sort:g,rsort:v,gt:y,lt:w,eq:x,neq:A,gte:E,lte:S,cmp:_,coerce:O,Comparator:N,Range:k,satisfies:T,toComparators:C,maxSatisfying:I,minSatisfying:B,minVersion:L,validRange:M,outside:R,gtr:P,ltr:U,intersects:j,simplifyRange:F,subset:D,SemVer:n,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:r.compareIdentifiers,rcompareIdentifiers:r.rcompareIdentifiers}}(),Pc=Ke(Rc);!function(e){e.blue="blue",e.nanoS="nanoS",e.nanoSP="nanoSP",e.nanoX="nanoX",e.stax="stax",e.europa="europa",e.apex="apex"}(Mc||(Mc={}));const Uc={[Mc.blue]:{id:Mc.blue,productName:"Ledger Blue",productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:491520,masks:[822083584,822149120],getBlockSize:e=>4096},[Mc.nanoS]:{id:Mc.nanoS,productName:"Ledger Nano S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:327680,masks:[823132160],getBlockSize:e=>Pc.lt(Pc.coerce(e)??"","2.0.0")?4096:2048},[Mc.nanoX]:{id:Mc.nanoX,productName:"Ledger Nano X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2097152,masks:[855638016],getBlockSize:e=>4096,bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]},[Mc.nanoSP]:{id:Mc.nanoSP,productName:"Ledger Nano S Plus",productIdMM:80,legacyUsbProductId:5,usbOnly:!0,memorySize:1569792,masks:[856686592],getBlockSize:e=>32},[Mc.apex]:{id:Mc.apex,productName:"Ledger Nano Gen5",productIdMM:128,legacyUsbProductId:8,usbOnly:!1,memorySize:1569792,masks:[859832320],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-8004-0000-4c6564676572",notifyUuid:"13d63400-2c97-8004-0001-4c6564676572",writeUuid:"13d63400-2c97-8004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-8004-0003-4c6564676572"}]},[Mc.stax]:{id:Mc.stax,productName:"Ledger Stax",productIdMM:96,legacyUsbProductId:6,usbOnly:!1,memorySize:1569792,masks:[857735168],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]},[Mc.europa]:{id:Mc.europa,productName:"Ledger Flex",productIdMM:112,legacyUsbProductId:7,usbOnly:!1,memorySize:1569792,masks:[858783744],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-3004-0000-4c6564676572",notifyUuid:"13d63400-2c97-3004-0001-4c6564676572",writeUuid:"13d63400-2c97-3004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-3004-0003-4c6564676572"}]}};Mc.blue,Mc.nanoS,Mc.nanoSP,Mc.nanoX,Mc.stax,Mc.europa;const jc=Object.values(Uc),Fc=e=>{const t=jc.find(t=>t.legacyUsbProductId===e);if(t)return t;const n=e>>8;return jc.find(e=>e.productIdMM===n)},Dc=[],zc={};for(const e in Uc){const t=Uc[e],{bluetoothSpec:n}=t;if(n)for(let e=0;e<n.length;e++){const r=n[e];Dc.push(r.serviceUuid),zc[r.serviceUuid]=zc[r.serviceUuid.replace(/-/g,"")]={deviceModel:t,...r}}}const $c=[{vendorId:11415}];async function Wc(){return await navigator.usb.requestDevice({filters:$c})}async function qc(){return(await navigator.usb.getDevices()).filter(e=>11415===e.vendorId)}const Xc=()=>Promise.resolve(!!navigator&&!!navigator.usb&&"function"==typeof navigator.usb.getDevices);class Kc extends ka{device;deviceModel;channel=Math.floor(65535*Math.random());packetSize=64;interfaceNumber;constructor(e,t){super(),this.device=e,this.interfaceNumber=t,this.deviceModel=Fc(e.productId)}static isSupported=Xc;static list=qc;static listen=e=>{let t=!1;return async function(){const e=await qc();return e.length>0?e[0]:Wc()}().then(n=>{if(!t){const t=Fc(n.productId);e.next({type:"add",descriptor:n,deviceModel:t}),e.complete()}},t=>{window.DOMException&&t instanceof window.DOMException&&18===t.code?e.error(new ma(t.message)):e.error(new ha(t.message))}),{unsubscribe:function(){t=!0}}};static async request(){const e=await Wc();return Kc.open(e)}static async openConnected(){const e=await qc();return 0===e.length?null:Kc.open(e[0])}static async open(e){await e.open(),null===e.configuration&&await e.selectConfiguration(1),await Hc(e);const t=e.configurations[0].interfaces.find(({alternates:e})=>e.some(e=>255===e.interfaceClass));if(!t)throw new pa("No WebUSB interface found for your Ledger device. Please upgrade firmware or contact techsupport.");const n=t.interfaceNumber;try{await e.claimInterface(n)}catch(t){throw await e.close(),new pa(t.message)}const r=new Kc(e,n),i=t=>{e===t.device&&(navigator.usb.removeEventListener("disconnect",i),r._emitDisconnect(new da))};return navigator.usb.addEventListener("disconnect",i),r}_disconnectEmitted=!1;_emitDisconnect=e=>{this._disconnectEmitted||(this._disconnectEmitted=!0,this.emit("disconnect",e))};async close(){await this.exchangeBusyPromise,await this.device.releaseInterface(this.interfaceNumber),await Hc(this.device),await this.device.close()}async exchange(e){const t=await this.exchangeAtomicImpl(async()=>{const{channel:t,packetSize:n}=this;Sa("apdu","=> "+e.toString("hex"));const r=((e,t)=>({makeBlocks(n){let r=Or().Buffer.concat([Ta(n.length),n]);const i=t-5,o=Math.ceil(r.length/i);r=Or().Buffer.concat([r,Or().Buffer.alloc(o*i-r.length+1).fill(0)]);const a=[];for(let t=0;t<o;t++){const n=Or().Buffer.alloc(5);n.writeUInt16BE(e,0),n.writeUInt8(5,2),n.writeUInt16BE(t,3);const o=r.slice(t*i,(t+1)*i);a.push(Or().Buffer.concat([n,o]))}return a},reduceResponse(t,n){let{data:r,dataLength:i,sequence:o}=t||Ca;if(n.readUInt16BE(0)!==e)throw new va("Invalid channel","InvalidChannel");if(5!==n.readUInt8(2))throw new va("Invalid tag","InvalidTag");if(n.readUInt16BE(3)!==o)throw new va("Invalid sequence","InvalidSequence");t||(i=n.readUInt16BE(5)),o++;const a=n.slice(t?5:7);return r=Or().Buffer.concat([r,a]),r.length>i&&(r=r.slice(0,i)),{data:r,dataLength:i,sequence:o}},getReducedResult(e){if(e&&e.dataLength===e.data.length)return e.data}}))(t,n),i=r.makeBlocks(e);for(let e=0;e<i.length;e++)await this.device.transferOut(3,i[e]);let o,a;for(;!(o=r.getReducedResult(a));){const e=await this.device.transferIn(3,n),t=Buffer.from(e.data.buffer);a=r.reduceResponse(a,t)}return Sa("apdu","<= "+o.toString("hex")),o}).catch(e=>{if(e&&e.message&&e.message.includes("disconnected"))throw this._emitDisconnect(e),new fa(e.message);throw e});return t}setScrambleKey(){}}async function Hc(e){try{await e.reset()}catch(e){console.warn(e)}}var Vc={name:H.Ledger,website:"https://www.ledger.com",connect:function(){return Q(void 0,void 0,void 0,function(){var e,t;return ee(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,Kc.create()];case 1:return e=n.sent(),[4,new _.default(e).getPublicKey("44'/148'/0'")];case 2:return t=n.sent().rawPublicKey,[2,i.encodeEd25519PublicKey(t)];case 3:throw n.sent(),new Error("BLUX: Failed to connect to Ledger.");case 4:return[2]}})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2]})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: Failed to get network from ledger")})})},isAvailable:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return[4,Kc.isSupported()];case 1:return[2,e.sent()]}})})},signAuthEntry:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: ledger does not support the signAuthEntry function")})})},signMessage:function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: Failed to sign the transaction with Ledger.")})})},signTransaction:function(e,i){return Q(void 0,void 0,void 0,function(){var o,a,s,c,u,l;return ee(this,function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),o=new r(e,i.network),[4,Kc.create()];case 1:return a=d.sent(),[4,new _.default(a).signTransaction("44'/148'/0'",o.signatureBase())];case 2:return s=d.sent().signature,c=t.fromPublicKey(i.address),u=c.signatureHint(),l=new n.DecoratedSignature({hint:u,signature:s}),o.signatures.push(l),[2,o.toXDR()];case 3:throw d.sent(),new Error("BLUX: Failed to sign the transaction with Ledger.");case 4:return[2]}})})}};const Gc=Object.values({device:["getFeatures","getDeviceState","getFirmwareHash","firmwareUpdate","resetDevice","loadDevice","recoveryDevice","wipeDevice","backupDevice","changePin","changeWipeCode","changeLanguage","applySettings","applyFlags","authenticateDevice","setBusy","setBrightness","showDeviceTutorial","bleUnpair","requestLogin","cipherKeyValue","unlockPath","getOwnershipId","getOwnershipProof","thpGetCredentials","thpRemoveCredentials","telemetryGet","pingDevice"],blockchain:["blockchainSubscribe","blockchainUnsubscribe","blockchainDisconnect","blockchainSetCustomBackend","blockchainGetInfo","blockchainValidateEvmRpcUrl","blockchainEstimateFee","blockchainGetAccountBalanceHistory","blockchainGetTransactions","blockchainEvmRpcCall","blockchainGetCurrentFiatRates","blockchainGetContractInfo","blockchainGetFiatRatesForTimestamps","blockchainSubscribeFiatRates","blockchainUnsubscribeFiatRates","pushTransaction","getNonce"],account:["getAddress","getPublicKey","getAccountInfo","getAccountDescriptor","discoverAccounts","signMessage","verifyMessage","getSettings","getCoinInfo"],bitcoin:["signTransaction","composeTransaction","authorizeCoinjoin","cancelCoinjoinAuthorization"],ethereum:["ethereumGetAddress","ethereumGetPublicKey","ethereumSignTransaction","ethereumSignMessage","ethereumSignTypedData","ethereumVerifyMessage"],cardano:["cardanoGetAddress","cardanoGetPublicKey","cardanoGetNativeScriptHash","cardanoSignTransaction","cardanoSignMessage","cardanoComposeTransaction"],monero:["moneroGetAddress","moneroGetWatchKey","moneroKeyImageSync","moneroSignTransaction"],ripple:["rippleGetAddress","rippleSignTransaction"],solana:["solanaGetAddress","solanaGetPublicKey","solanaSignTransaction","solanaComposeTransaction"],stellar:["stellarGetAddress","stellarSignTransaction"],tezos:["tezosGetAddress","tezosGetPublicKey","tezosSignTransaction"],tron:["tronGetAddress","tronSignTransaction","tronComposeTransaction"],evolu:["evoluGetNode","evoluSignRegistrationRequest","evoluGetDelegatedIdentityKey"]}).flat(),Yc={Init_NotInitialized:"TrezorConnect not initialized",Init_AlreadyInitialized:"TrezorConnect has been already initialized",Init_ManifestMissing:"Manifest not set. Read more at https://github.com/trezor/trezor-suite/blob/develop/docs/packages/connect/index.md",Handshake_Error:"",Popup_ConnectionMissing:"Unable to establish connection with iframe",Desktop_ConnectionMissing:"Unable to establish connection with Suite",Transport_Missing:"Transport is missing",Method_InvalidPackage:"This package is not suitable to work with browser. Use @trezor/connect-web package instead",Method_InvalidParameter:"",Method_NotAllowed:"Method not allowed for this configuration",Method_PermissionsNotGranted:"Permissions not granted",Method_Cancel:"Canceled",Method_Interrupted:"Popup closed",Method_UnknownCoin:"Coin not found",Method_AddressNotMatch:"Addresses do not match",Method_Override:"override",Method_NoResponse:"Call resolved without response",Method_Unsupported:"Unsupported method",Method_DataOverflowModelOne:"Model One does not support data over 1024 bytes",Backend_NotSupported:"BlockchainLink settings not found in coins.json",Backend_WorkerMissing:"",Backend_Disconnected:"Backend disconnected",Backend_Invalid:"Invalid backend",Backend_Error:"",Runtime:"",Device_NotFound:"Device not found",Device_InitializeFailed:"",Device_FwException:"",Device_ModeException:"",Device_Disconnected:"Device disconnected",Device_UsedElsewhere:"Device is used in another window",Device_InvalidState:"Passphrase is incorrect",Device_CallInProgress:"Device call in progress",Device_MultipleNotSupported:"Multiple devices are not supported",Device_MissingCapability:"Device is missing capability",Device_MissingCapabilityBtcOnly:"Device is missing capability (BTC only)",Device_ThpPairingTagInvalid:"Pairing tag mismatch",Device_ThpStateMissing:"ThpState missing",Device_ThpPairingMethodsException:"No common pairing methods",Failure_UnknownCode:"Unknown error",Failure_EntropyCheck:"",Deeplink_VersionMismatch:"Not compatible with current version of the app",Browser_LocalNetworkPermissionMissing:"Local network permission is missing. Please allow local network access in browser settings."};class Jc extends Error{code;message;constructor(e,t,n){super(t,n),this.code=e,this.message=t}toString(){return`${this.name} (code: ${this.code}): ${this.message}`}}const Zc=(e,t)=>new Jc(e,t||Yc[e]||e),Qc=e=>{const t=e?.error instanceof Error?e.error:e;return t instanceof Error?{message:t.message,code:"code"in t?t.code:"Failure_UnknownCode"}:{...e}},eu=e=>({success:!1,error:{message:e.message,code:e.code??"Failure_UnknownCode"}}),tu="DEVICE_EVENT",nu="iframe-call",ru="core-call-cancel",iu="ui-address_validation",ou="popup-core-loaded",au="popup-handshake",su="popup-closed";var cu=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,uu=Math.ceil,lu=Math.floor,du="[BigNumber Error] ",fu=du+"Number primitive has more than 15 significant digits: ",hu=1e14,pu=14,bu=9007199254740991,mu=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],gu=1e7,vu=1e9;function yu(e){var t=0|e;return e>0||e===t?t:t-1}function wu(e){for(var t,n,r=1,i=e.length,o=e[0]+"";r<i;){for(t=e[r++]+"",n=pu-t.length;n--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function xu(e,t){var n,r,i=e.c,o=t.c,a=e.s,s=t.s,c=e.e,u=t.e;if(!a||!s)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-s:a;if(a!=s)return a;if(n=a<0,r=c==u,!i||!o)return r?0:!i^n?1:-1;if(!r)return c>u^n?1:-1;for(s=(c=i.length)<(u=o.length)?c:u,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^n?1:-1;return c==u?0:c>u^n?1:-1}function Au(e,t,n,r){if(e<t||e>n||e!==lu(e))throw Error(du+(r||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Eu(e){var t=e.c.length-1;return yu(e.e/pu)==t&&e.c[t]%2!=0}function Su(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function _u(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(++t>(r=e.length)){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var Ou=function e(t){var n,r,i,o,a,s,c,u,l,d,f=O.prototype={constructor:O,toString:null,valueOf:null},h=new O(1),p=20,b=4,m=-7,g=21,v=-1e7,y=1e7,w=!1,x=1,A=0,E={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},S="0123456789abcdefghijklmnopqrstuvwxyz",_=!0;function O(e,t){var n,o,a,s,c,u,l,d,f=this;if(!(f instanceof O))return new O(e,t);if(null==t){if(e&&!0===e._isBigNumber)return f.s=e.s,void(!e.c||e.e>y?f.c=f.e=null:e.e<v?f.c=[f.e=0]:(f.e=e.e,f.c=e.c.slice()));if((u="number"==typeof e)&&0*e==0){if(f.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,c=e;c>=10;c/=10,s++);return void(s>y?f.c=f.e=null:(f.e=s,f.c=[e]))}d=String(e)}else{if(!cu.test(d=String(e)))return i(f,d,u);f.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(s=d.indexOf("."))>-1&&(d=d.replace(".","")),(c=d.search(/e/i))>0?(s<0&&(s=c),s+=+d.slice(c+1),d=d.substring(0,c)):s<0&&(s=d.length)}else{if(Au(t,2,S.length,"Base"),10==t&&_)return C(f=new O(e),p+f.e+1,b);if(d=String(e),u="number"==typeof e){if(0*e!=0)return i(f,d,u,t);if(f.s=1/e<0?(d=d.slice(1),-1):1,O.DEBUG&&d.replace(/^0\.0*|\./,"").length>15)throw Error(fu+e)}else f.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(n=S.slice(0,t),s=c=0,l=d.length;c<l;c++)if(n.indexOf(o=d.charAt(c))<0){if("."==o){if(c>s){s=l;continue}}else if(!a&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){a=!0,c=-1,s=0;continue}return i(f,String(e),u,t)}u=!1,(s=(d=r(d,t,10,f.s)).indexOf("."))>-1?d=d.replace(".",""):s=d.length}for(c=0;48===d.charCodeAt(c);c++);for(l=d.length;48===d.charCodeAt(--l););if(d=d.slice(c,++l)){if(l-=c,u&&O.DEBUG&&l>15&&(e>bu||e!==lu(e)))throw Error(fu+f.s*e);if((s=s-c-1)>y)f.c=f.e=null;else if(s<v)f.c=[f.e=0];else{if(f.e=s,f.c=[],c=(s+1)%pu,s<0&&(c+=pu),c<l){for(c&&f.c.push(+d.slice(0,c)),l-=pu;c<l;)f.c.push(+d.slice(c,c+=pu));c=pu-(d=d.slice(c)).length}else c-=l;for(;c--;d+="0");f.c.push(+d)}}else f.c=[f.e=0]}function N(e,t,n,r){var i,o,a,s,c;if(null==n?n=b:Au(n,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)c=wu(e.c),c=1==r||2==r&&(a<=m||a>=g)?Su(c,a):_u(c,a,"0");else if(o=(e=C(new O(e),t,n)).e,s=(c=wu(e.c)).length,1==r||2==r&&(t<=o||o<=m)){for(;s<t;c+="0",s++);c=Su(c,o)}else if(t-=a+(2===r&&o>a),c=_u(c,o,"0"),o+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-s)>0)for(o+1==s&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function k(e,t){for(var n,r,i=1,o=new O(e[0]);i<e.length;i++)(!(r=new O(e[i])).s||(n=xu(o,r))===t||0===n&&o.s===t)&&(o=r);return o}function T(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*pu-1)>y?e.c=e.e=null:n<v?e.c=[e.e=0]:(e.e=n,e.c=t),e}function C(e,t,n,r){var i,o,a,s,c,u,l,d=e.c,f=mu;if(d){e:{for(i=1,s=d[0];s>=10;s/=10,i++);if((o=t-i)<0)o+=pu,a=t,c=d[u=0],l=lu(c/f[i-a-1]%10);else if((u=uu((o+1)/pu))>=d.length){if(!r)break e;for(;d.length<=u;d.push(0));c=l=0,i=1,a=(o%=pu)-pu+1}else{for(c=s=d[u],i=1;s>=10;s/=10,i++);l=(a=(o%=pu)-pu+i)<0?0:lu(c/f[i-a-1]%10)}if(r=r||t<0||null!=d[u+1]||(a<0?c:c%f[i-a-1]),r=n<4?(l||r)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(o>0?a>0?c/f[i-a]:0:d[u-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,r?(t-=e.e+1,d[0]=f[(pu-t%pu)%pu],e.e=-t||0):d[0]=e.e=0,e;if(0==o?(d.length=u,s=1,u--):(d.length=u+1,s=f[pu-o],d[u]=a>0?lu(c/f[i-a]%f[a])*s:0),r)for(;;){if(0==u){for(o=1,a=d[0];a>=10;a/=10,o++);for(a=d[0]+=s,s=1;a>=10;a/=10,s++);o!=s&&(e.e++,d[0]==hu&&(d[0]=1));break}if(d[u]+=s,d[u]!=hu)break;d[u--]=0,s=1}for(o=d.length;0===d[--o];d.pop());}e.e>y?e.c=e.e=null:e.e<v&&(e.c=[e.e=0])}return e}function I(e){var t,n=e.e;return null===n?e.toString():(t=wu(e.c),t=n<=m||n>=g?Su(t,n):_u(t,n,"0"),e.s<0?"-"+t:t)}return O.clone=e,O.ROUND_UP=0,O.ROUND_DOWN=1,O.ROUND_CEIL=2,O.ROUND_FLOOR=3,O.ROUND_HALF_UP=4,O.ROUND_HALF_DOWN=5,O.ROUND_HALF_EVEN=6,O.ROUND_HALF_CEIL=7,O.ROUND_HALF_FLOOR=8,O.EUCLID=9,O.config=O.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(du+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(Au(n=e[t],0,vu,t),p=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(Au(n=e[t],0,8,t),b=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(Au(n[0],-vu,0,t),Au(n[1],0,vu,t),m=n[0],g=n[1]):(Au(n,-vu,vu,t),m=-(g=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)Au(n[0],-vu,-1,t),Au(n[1],1,vu,t),v=n[0],y=n[1];else{if(Au(n,-vu,vu,t),!n)throw Error(du+t+" cannot be zero: "+n);v=-(y=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(du+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw w=!n,Error(du+"crypto unavailable");w=n}else w=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(Au(n=e[t],0,9,t),x=n),e.hasOwnProperty(t="POW_PRECISION")&&(Au(n=e[t],0,vu,t),A=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(du+t+" not an object: "+n);E=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(du+t+" invalid: "+n);_="0123456789"==n.slice(0,10),S=n}}return{DECIMAL_PLACES:p,ROUNDING_MODE:b,EXPONENTIAL_AT:[m,g],RANGE:[v,y],CRYPTO:w,MODULO_MODE:x,POW_PRECISION:A,FORMAT:E,ALPHABET:S}},O.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!O.DEBUG)return!0;var t,n,r=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(r)){if((1===o||-1===o)&&i>=-vu&&i<=vu&&i===lu(i)){if(0===r[0]){if(0===i&&1===r.length)return!0;break e}if((t=(i+1)%pu)<1&&(t+=pu),String(r[0]).length==t){for(t=0;t<r.length;t++)if((n=r[t])<0||n>=hu||n!==lu(n))break e;if(0!==n)return!0}}}else if(null===r&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(du+"Invalid BigNumber: "+e)},O.maximum=O.max=function(){return k(arguments,-1)},O.minimum=O.min=function(){return k(arguments,1)},O.random=(o=9007199254740992,a=Math.random()*o&2097151?function(){return lu(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,r,i,o,s=0,c=[],u=new O(h);if(null==e?e=p:Au(e,0,vu),i=uu(e/pu),w)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));s<i;)(o=131072*t[s]+(t[s+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[s]=n[0],t[s+1]=n[1]):(c.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw w=!1,Error(du+"crypto unavailable");for(t=crypto.randomBytes(i*=7);s<i;)(o=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(c.push(o%1e14),s+=7);s=i/7}if(!w)for(;s<i;)(o=a())<9e15&&(c[s++]=o%1e14);for(i=c[--s],e%=pu,i&&e&&(o=mu[pu-e],c[s]=lu(i/o)*o);0===c[s];c.pop(),s--);if(s<0)c=[r=0];else{for(r=-1;0===c[0];c.splice(0,1),r-=pu);for(s=1,o=c[0];o>=10;o/=10,s++);s<pu&&(r-=pu-s)}return u.e=r,u.c=c,u}),O.sum=function(){for(var e=1,t=arguments,n=new O(t[0]);e<t.length;)n=n.plus(t[e++]);return n},r=function(){var e="0123456789";function t(e,t,n,r){for(var i,o,a=[0],s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,o,a,s){var c,u,l,d,f,h,m,g,v=r.indexOf("."),y=p,w=b;for(v>=0&&(d=A,A=0,r=r.replace(".",""),h=(g=new O(i)).pow(r.length-v),A=d,g.c=t(_u(wu(h.c),h.e,"0"),10,o,e),g.e=g.c.length),l=d=(m=t(r,i,o,s?(c=S,e):(c=e,S))).length;0==m[--d];m.pop());if(!m[0])return c.charAt(0);if(v<0?--l:(h.c=m,h.e=l,h.s=a,m=(h=n(h,g,y,w,o)).c,f=h.r,l=h.e),v=m[u=l+y+1],d=o/2,f=f||u<0||null!=m[u+1],f=w<4?(null!=v||f)&&(0==w||w==(h.s<0?3:2)):v>d||v==d&&(4==w||f||6==w&&1&m[u-1]||w==(h.s<0?8:7)),u<1||!m[0])r=f?_u(c.charAt(1),-y,c.charAt(0)):c.charAt(0);else{if(m.length=u,f)for(--o;++m[--u]>o;)m[u]=0,u||(++l,m=[1].concat(m));for(d=m.length;!m[--d];);for(v=0,r="";v<=d;r+=c.charAt(m[v++]));r=_u(r,l,c.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,i,o,a,s=0,c=e.length,u=t%gu,l=t/gu|0;for(e=e.slice();c--;)s=((i=u*(o=e[c]%gu)+(r=l*o+(a=e[c]/gu|0)*u)%gu*gu+s)/n|0)+(r/gu|0)+l*a,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,o,a,s){var c,u,l,d,f,h,p,b,m,g,v,y,w,x,A,E,S,_=r.s==i.s?1:-1,N=r.c,k=i.c;if(!(N&&N[0]&&k&&k[0]))return new O(r.s&&i.s&&(N?!k||N[0]!=k[0]:k)?N&&0==N[0]||!k?0*_:_/0:NaN);for(m=(b=new O(_)).c=[],_=o+(u=r.e-i.e)+1,s||(s=hu,u=yu(r.e/pu)-yu(i.e/pu),_=_/pu|0),l=0;k[l]==(N[l]||0);l++);if(k[l]>(N[l]||0)&&u--,_<0)m.push(1),d=!0;else{for(x=N.length,E=k.length,l=0,_+=2,(f=lu(s/(k[0]+1)))>1&&(k=e(k,f,s),N=e(N,f,s),E=k.length,x=N.length),w=E,v=(g=N.slice(0,E)).length;v<E;g[v++]=0);S=k.slice(),S=[0].concat(S),A=k[0],k[1]>=s/2&&A++;do{if(f=0,(c=t(k,g,E,v))<0){if(y=g[0],E!=v&&(y=y*s+(g[1]||0)),(f=lu(y/A))>1)for(f>=s&&(f=s-1),p=(h=e(k,f,s)).length,v=g.length;1==t(h,g,p,v);)f--,n(h,E<p?S:k,p,s),p=h.length,c=1;else 0==f&&(c=f=1),p=(h=k.slice()).length;if(p<v&&(h=[0].concat(h)),n(g,h,v,s),v=g.length,-1==c)for(;t(k,g,E,v)<1;)f++,n(g,E<v?S:k,v,s),v=g.length}else 0===c&&(f++,g=[0]);m[l++]=f,g[0]?g[v++]=N[w]||0:(g=[N[w]],v=1)}while((w++<x||null!=g[0])&&_--);d=null!=g[0],m[0]||m.splice(0,1)}if(s==hu){for(l=1,_=m[0];_>=10;_/=10,l++);C(b,o+(b.e=l+u*pu-1)+1,a,d)}else b.e=u,b.r=+d;return b}}(),s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,c=/^([^.]+)\.$/,u=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,d=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,n,r){var i,o=n?t:t.replace(d,"");if(l.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!n&&(o=o.replace(s,function(e,t,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=i?e:t}),r&&(i=r,o=o.replace(c,"$1").replace(u,"0.$1")),t!=o))return new O(o,i);if(O.DEBUG)throw Error(du+"Not a"+(r?" base "+r:"")+" number: "+t);e.s=null}e.c=e.e=null},f.absoluteValue=f.abs=function(){var e=new O(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return xu(this,new O(e,t))},f.decimalPlaces=f.dp=function(e,t){var n,r,i,o=this;if(null!=e)return Au(e,0,vu),null==t?t=b:Au(t,0,8),C(new O(o),e+o.e+1,t);if(!(n=o.c))return null;if(r=((i=n.length-1)-yu(this.e/pu))*pu,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},f.dividedBy=f.div=function(e,t){return n(this,new O(e,t),p,b)},f.dividedToIntegerBy=f.idiv=function(e,t){return n(this,new O(e,t),0,1)},f.exponentiatedBy=f.pow=function(e,t){var n,r,i,o,a,s,c,u,l=this;if((e=new O(e)).c&&!e.isInteger())throw Error(du+"Exponent not an integer: "+I(e));if(null!=t&&(t=new O(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return u=new O(Math.pow(+I(l),a?e.s*(2-Eu(e)):+I(e))),t?u.mod(t):u;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new O(NaN);(r=!s&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return o=l.s<0&&Eu(e)?-0:0,l.e>-1&&(o=1/o),new O(s?1/o:o);A&&(o=uu(A/pu+2))}for(a?(n=new O(.5),s&&(e.s=1),c=Eu(e)):c=(i=Math.abs(+I(e)))%2,u=new O(h);;){if(c){if(!(u=u.times(l)).c)break;o?u.c.length>o&&(u.c.length=o):r&&(u=u.mod(t))}if(i){if(0===(i=lu(i/2)))break;c=i%2}else if(C(e=e.times(n),e.e+1,1),e.e>14)c=Eu(e);else{if(0===(i=+I(e)))break;c=i%2}l=l.times(l),o?l.c&&l.c.length>o&&(l.c.length=o):r&&(l=l.mod(t))}return r?u:(s&&(u=h.div(u)),t?u.mod(t):o?C(u,A,b,void 0):u)},f.integerValue=function(e){var t=new O(this);return null==e?e=b:Au(e,0,8),C(t,t.e+1,e)},f.isEqualTo=f.eq=function(e,t){return 0===xu(this,new O(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return xu(this,new O(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=xu(this,new O(e,t)))||0===t},f.isInteger=function(){return!!this.c&&yu(this.e/pu)>this.c.length-2},f.isLessThan=f.lt=function(e,t){return xu(this,new O(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=xu(this,new O(e,t)))||0===t},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(e,t){var n,r,i,o,a=this,s=a.s;if(t=(e=new O(e,t)).s,!s||!t)return new O(NaN);if(s!=t)return e.s=-t,a.plus(e);var c=a.e/pu,u=e.e/pu,l=a.c,d=e.c;if(!c||!u){if(!l||!d)return l?(e.s=-t,e):new O(d?a:NaN);if(!l[0]||!d[0])return d[0]?(e.s=-t,e):new O(l[0]?a:3==b?-0:0)}if(c=yu(c),u=yu(u),l=l.slice(),s=c-u){for((o=s<0)?(s=-s,i=l):(u=c,i=d),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(o=(s=l.length)<(t=d.length))?s:t,s=t=0;t<r;t++)if(l[t]!=d[t]){o=l[t]<d[t];break}if(o&&(i=l,l=d,d=i,e.s=-e.s),(t=(r=d.length)-(n=l.length))>0)for(;t--;l[n++]=0);for(t=hu-1;r>s;){if(l[--r]<d[r]){for(n=r;n&&!l[--n];l[n]=t);--l[n],l[r]+=hu}l[r]-=d[r]}for(;0==l[0];l.splice(0,1),--u);return l[0]?T(e,l,u):(e.s=3==b?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,t){var r,i,o=this;return e=new O(e,t),!o.c||!e.s||e.c&&!e.c[0]?new O(NaN):!e.c||o.c&&!o.c[0]?new O(o):(9==x?(i=e.s,e.s=1,r=n(o,e,0,3),e.s=i,r.s*=i):r=n(o,e,0,x),(e=o.minus(r.times(e))).c[0]||1!=x||(e.s=o.s),e)},f.multipliedBy=f.times=function(e,t){var n,r,i,o,a,s,c,u,l,d,f,h,p,b,m,g=this,v=g.c,y=(e=new O(e,t)).c;if(!(v&&y&&v[0]&&y[0]))return!g.s||!e.s||v&&!v[0]&&!y||y&&!y[0]&&!v?e.c=e.e=e.s=null:(e.s*=g.s,v&&y?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=yu(g.e/pu)+yu(e.e/pu),e.s*=g.s,(c=v.length)<(d=y.length)&&(p=v,v=y,y=p,i=c,c=d,d=i),i=c+d,p=[];i--;p.push(0));for(b=hu,m=gu,i=d;--i>=0;){for(n=0,f=y[i]%m,h=y[i]/m|0,o=i+(a=c);o>i;)n=((u=f*(u=v[--a]%m)+(s=h*u+(l=v[a]/m|0)*f)%m*m+p[o]+n)/b|0)+(s/m|0)+h*l,p[o--]=u%b;p[o]=n}return n?++r:p.splice(0,1),T(e,p,r)},f.negated=function(){var e=new O(this);return e.s=-e.s||null,e},f.plus=function(e,t){var n,r=this,i=r.s;if(t=(e=new O(e,t)).s,!i||!t)return new O(NaN);if(i!=t)return e.s=-t,r.minus(e);var o=r.e/pu,a=e.e/pu,s=r.c,c=e.c;if(!o||!a){if(!s||!c)return new O(i/0);if(!s[0]||!c[0])return c[0]?e:new O(s[0]?r:0*i)}if(o=yu(o),a=yu(a),s=s.slice(),i=o-a){for(i>0?(a=o,n=c):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for((i=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+c[t]+i)/hu|0,s[t]=hu===s[t]?0:s[t]%hu;return i&&(s=[i].concat(s),++a),T(e,s,a)},f.precision=f.sd=function(e,t){var n,r,i,o=this;if(null!=e&&e!==!!e)return Au(e,1,vu),null==t?t=b:Au(t,0,8),C(new O(o),e,t);if(!(n=o.c))return null;if(r=(i=n.length-1)*pu+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&o.e+1>r&&(r=o.e+1),r},f.shiftedBy=function(e){return Au(e,-9007199254740991,bu),this.times("1e"+e)},f.squareRoot=f.sqrt=function(){var e,t,r,i,o,a=this,s=a.c,c=a.s,u=a.e,l=p+4,d=new O("0.5");if(1!==c||!s||!s[0])return new O(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(c=Math.sqrt(+I(a)))||c==1/0?(((t=wu(s)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=yu((u+1)/2)-(u<0||u%2),r=new O(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):r=new O(c+""),r.c[0])for((c=(u=r.e)+l)<3&&(c=0);;)if(o=r,r=d.times(o.plus(n(a,o,l,1))),wu(o.c).slice(0,c)===(t=wu(r.c)).slice(0,c)){if(r.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(C(r,r.e+p+2,1),e=!r.times(r).eq(a));break}if(!i&&(C(o,o.e+p+2,0),o.times(o).eq(a))){r=o;break}l+=4,c+=4,i=1}return C(r,r.e+p+1,b,e)},f.toExponential=function(e,t){return null!=e&&(Au(e,0,vu),e++),N(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(Au(e,0,vu),e=e+this.e+1),N(this,e,t)},f.toFormat=function(e,t,n){var r,i=this;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=E;else if("object"!=typeof n)throw Error(du+"Argument not an object: "+n);if(r=i.toFixed(e,t),i.c){var o,a=r.split("."),s=+n.groupSize,c=+n.secondaryGroupSize,u=n.groupSeparator||"",l=a[0],d=a[1],f=i.s<0,h=f?l.slice(1):l,p=h.length;if(c&&(o=s,s=c,c=o,p-=o),s>0&&p>0){for(o=p%s||s,l=h.substr(0,o);o<p;o+=s)l+=u+h.substr(o,s);c>0&&(l+=u+h.slice(o)),f&&(l="-"+l)}r=d?l+(n.decimalSeparator||"")+((c=+n.fractionGroupSize)?d.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):d):l}return(n.prefix||"")+r+(n.suffix||"")},f.toFraction=function(e){var t,r,i,o,a,s,c,u,l,d,f,p,m=this,g=m.c;if(null!=e&&(!(c=new O(e)).isInteger()&&(c.c||1!==c.s)||c.lt(h)))throw Error(du+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+I(c));if(!g)return new O(m);for(t=new O(h),l=r=new O(h),i=u=new O(h),p=wu(g),a=t.e=p.length-m.e-1,t.c[0]=mu[(s=a%pu)<0?pu+s:s],e=!e||c.comparedTo(t)>0?a>0?t:l:c,s=y,y=1/0,c=new O(p),u.c[0]=0;d=n(c,t,0,1),1!=(o=r.plus(d.times(i))).comparedTo(e);)r=i,i=o,l=u.plus(d.times(o=l)),u=o,t=c.minus(d.times(o=t)),c=o;return o=n(e.minus(r),i,0,1),u=u.plus(o.times(l)),r=r.plus(o.times(i)),u.s=l.s=m.s,f=n(l,i,a*=2,b).minus(m).abs().comparedTo(n(u,r,a,b).minus(m).abs())<1?[l,i]:[u,r],y=s,f},f.toNumber=function(){return+I(this)},f.toPrecision=function(e,t){return null!=e&&Au(e,1,vu),N(this,e,t,2)},f.toString=function(e){var t,n=this,i=n.s,o=n.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=m||o>=g?Su(wu(n.c),o):_u(wu(n.c),o,"0"):10===e&&_?t=_u(wu((n=C(new O(n),p+o+1,b)).c),n.e,"0"):(Au(e,2,S.length,"Base"),t=r(_u(wu(n.c),o,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return I(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=t&&O.set(t),O}();const Nu=e=>{let t=()=>{},n=()=>{};const r=new Promise((e,r)=>{t=e,n=r});return{id:e,resolve:t,reject:n,promise:r}},ku=e=>{const{initialId:t=0,timeout:n=0,onTimeout:r,generateId:i}=e??{},o=[];let a=t;const s=i??(()=>a++);let c,u=Nu();const l=()=>{const{resolve:e}=u;u=Nu(),e()},d=()=>{const e=Date.now(),t=o.reduce((e,{deadline:t})=>(e&&t?Math.min:Math.max)(e,t),0);c&&clearTimeout(c),c=t?setTimeout(f,Math.max(t-e,0)):void 0},f=()=>{const e=Date.now();o.filter(t=>t.deadline&&t.deadline<=e).forEach(e=>{r?.(e.id),e.deadline=0}),d()},h=(e=n)=>{const t=s(),r=Nu(t),i=e&&Date.now()+e;return o.push({...r,deadline:i}),e&&d(),{promiseId:t,promise:r.promise}},p=e=>{const t=o.findIndex(({id:t})=>t===e),[n]=t>=0?o.splice(t,1):[void 0];return n&&l(),n?.deadline&&d(),n};return{length:()=>o.length,create:h,createConcurrent:async(e,t)=>{for(;o.length>=e;)await u.promise;return h(t)},resolve:(e,t)=>{const n=p(e);return n?.resolve(t),!!n},reject:(e,t)=>{const n=p(e);return n?.reject(t),!!n},resolveAll:e=>{o.forEach(t=>t.resolve(e(t.id)));o.splice(0,o.length).length&&(l(),d())},rejectAll:e=>{o.forEach(t=>t.reject(e));o.splice(0,o.length).length&&(l(),d())}}},Tu=e=>{const t=e??(()=>{const e=Symbol(),t={};return async(n=e)=>{for(;t[n];)await t[n];let r=()=>{};return t[n]=new Promise(e=>{r=e}).finally(()=>{delete t[n]}),r}})();return(e,n)=>t(n).then(t=>Promise.resolve().then(e).finally(t))};class Cu{prefix;enabled;css="";messages;logWriter;MAX_ENTRIES=100;constructor(e,t,n){this.prefix=e,this.enabled=t,this.messages=[],n&&(this.logWriter=n)}setColors(e){this.css="undefined"!=typeof window&&e[this.prefix]?e[this.prefix]:""}addMessage({level:e,prefix:t,timestamp:n},...r){const i={level:e,prefix:t,css:this.css,message:r,timestamp:n||Date.now()};if(this.messages.push(i),this.logWriter)try{this.logWriter.add(i)}catch(e){console.error("There was an error adding log message",e,i)}this.messages.length>this.MAX_ENTRIES&&this.messages.shift()}setWriter(e){this.logWriter=e}log(...e){this.addMessage({level:"log",prefix:this.prefix},...e),this.enabled&&console.log(`%c${this.prefix}`,this.css,...e)}error(...e){this.addMessage({level:"error",prefix:this.prefix},...e),this.enabled&&console.error(`%c${this.prefix}`,this.css,...e)}info(...e){this.addMessage({level:"info",prefix:this.prefix},...e),this.enabled&&console.info(`%c${this.prefix}`,this.css,...e)}warn(...e){this.addMessage({level:"warn",prefix:this.prefix},...e),this.enabled&&console.warn(`%c${this.prefix}`,this.css,...e)}debug(...e){this.addMessage({level:"debug",prefix:this.prefix},...e),this.enabled&&(this.css?console.log(`%c${this.prefix}`,this.css,...e):console.log(this.prefix,...e))}getLog(){return this.messages}}class Iu extends Error{constructor(){super("Aborted by signal")}}const Bu=e=>Array.isArray(e),Lu=(e,t)=>new Promise((n,r)=>{const i=new Iu;if(t.aborted)return r(i);if(void 0===e)return n();let o;const a=()=>{clearTimeout(o),t.removeEventListener("abort",a),r(i)};o=setTimeout(()=>{t.removeEventListener("abort",a),n()},e),t.addEventListener("abort",a)}),Mu=(e,t,n)=>new Promise((r,i)=>{const o=new Iu;if(n.aborted)return i(o);let a;const s=()=>{clearTimeout(a),n.removeEventListener("abort",s),i(o)};a=setTimeout(()=>{n.removeEventListener("abort",s),i(t)},e),n.addEventListener("abort",s)}),Ru=(e,t,n)=>void 0===e?[]:[Mu(e,t,n)],Pu=(e,t)=>new Promise((n,r)=>{const i=new Iu;if(t.aborted)return r(i);if(e?.aborted)return r(i);const o=()=>r(i);e?.addEventListener("abort",o);const a=()=>{e?.removeEventListener("abort",o),t.removeEventListener("abort",a),r(i)};t.addEventListener("abort",a)}),Uu=async(e,t)=>{const n=new AbortController;t.aborted&&n.abort();const r=()=>{t.removeEventListener("abort",r),n.abort()};t.addEventListener("abort",r);try{return await new Promise(t=>t(e(n.signal)))}finally{t.aborted||t.removeEventListener("abort",r)}};class ju extends Error{constructor(){super("Aborted by timeout")}}class Fu extends Error{constructor(){super("Aborted by deadline")}}const Du=async(e,t)=>{const{signal:n,delay:r,attempts:i,timeout:o,deadline:a,gap:s,attemptFailureHandler:c}=t,u=a&&a-Date.now(),l=Bu(i)?i.length:i??(a?1/0:1),d=new AbortController,f=d.signal,h=Bu(i)?e=>i[e]:()=>({timeout:o,gap:s}),p=new Fu,b=new ju,m=t.graceful&&n,g=new AbortController;if(m)if(n.aborted)g.abort();else{const e=()=>{n.removeEventListener("abort",e),f.removeEventListener("abort",e),g.abort()};n.addEventListener("abort",e),f.addEventListener("abort",e)}try{return await Promise.race([...m?[]:[Pu(n,f)],...Ru(u,p,f),Lu(r,f).then(()=>(async(e,t,n,r)=>{for(let i=0;i<e-1&&!r.aborted;i++){const e=new AbortController,o=()=>e.abort();r.addEventListener("abort",o);try{return await t(i,e.signal)}catch(e){o(),await n(i,e)}finally{r.removeEventListener("abort",o)}}return r.aborted?Promise.reject(new Iu):t(e-1,r)})(l,(t,n)=>Promise.race([...Ru(h(t).timeout,b,f),Uu(e,n)]),(e,t)=>{const n=c?.(t);return n?Promise.reject(n):Lu(h(e).gap??0,f)},m?g.signal:f))])}finally{d.abort()}};class zu extends oa.EventEmitter{listenerCount(e){return super.listenerCount(e)}}var $u,Wu,qu;!function(e){e[e.mainnet=764824073]="mainnet",e[e.testnet_preprod=1]="testnet_preprod",e[e.testnet_preview=2]="testnet_preview",e[e.testnet_legacy=1097911063]="testnet_legacy"}($u||($u={})),function(e){e[e.mainnet=1]="mainnet",e[e.testnet=0]="testnet"}(Wu||(Wu={})),function(e){e[e.EdDSA=-8]="EdDSA"}(qu||(qu={}));const Xu="10.0.0-alpha.1";Xu.split(".").map(e=>parseInt(e,10))[0];const Ku=Xu,Hu=((new Date).getTime(),e=>"string"==typeof e?e:Ku);class Vu extends zu{}class Gu extends oa.EventEmitter{_ws;static CONNECTING=0;static OPEN=1;static CLOSING=2;static CLOSED=3;constructor(e,t,n){super(),this._ws=new WebSocket(e),this._ws.onclose=()=>{this.emit("close")},this._ws.onopen=()=>{this.emit("open")},this._ws.onerror=e=>{this.emit("error",new Yu(`WsWrapper error. Ready state: ${this.readyState}`))},this._ws.onmessage=e=>{this.emit("message",e.data)}}close(){this.readyState===Gu.OPEN&&this._ws.close()}send(e){if(this.readyState!==Gu.OPEN)throw new Yu(`Connection is not open. state: ${this.readyState}`);this._ws.send(e)}get readyState(){return this._ws.readyState}}class Yu extends Error{}class Ju extends zu{options;messages;emitter=this;ws;pingTimeout;connectPromise;ping(){return this.sendMessage({type:"ping"})}constructor(e){super(),this.options=e,this.messages=ku({timeout:this.options.timeout||2e4,onTimeout:e=>this.onMessageTimeout(e)})}initWebsocket({url:e,timeout:t,headers:n,agent:r}){if("string"!=typeof e)throw new Yu("websocket_no_url");return e.startsWith("http")&&(e=e.replace("http","ws")),new Gu(e,{timeout:t,headers:{Origin:"https://node.trezor.io",...n},agent:r})}setPingTimeout(){clearTimeout(this.pingTimeout);this.pingTimeout=this.isConnected()?setTimeout(()=>{if(this.isConnected())return this.onPing().catch(()=>{})},this.options.pingTimeout||5e4):void 0}onPing(){return this.ping()}onMessageTimeout(e){const{ws:t}=this;t&&(this.messages.rejectAll(new Yu("websocket_timeout")),t.close())}onError(){this.onClose()}async sendMessage(e,{timeout:t,onIdCreated:n}={}){const{ws:r}=this;if(!r||!this.isConnected())throw new Yu("websocket_not_initialized");let i;if(this.options.concurrency){if(i=await this.messages.createConcurrent(this.options.concurrency,t),!r||!this.isConnected())throw this.messages.resolve(i.promiseId,void 0),new Yu("websocket_not_initialized")}else i=this.messages.create(t);n?.(i.promiseId);const o={id:i.promiseId.toString(),...e};return this.setPingTimeout(),this.options.onSending?.(e),r.send(JSON.stringify(o)),i.promise}sendRawMessage(e){const{ws:t}=this;if(!t||!this.isConnected())throw new Yu("websocket_not_initialized");t.send(e,{binary:"string"!=typeof e}),this.setPingTimeout()}onMessage(e,t){try{const n=JSON.parse(e.toString()),r=Number(n.id);try{const e=t?t(n):n;e&&this.messages.resolve(r,e)}catch(e){this.messages.reject(r,e)}}catch{}finally{this.setPingTimeout()}}async connect(){if(this.connectPromise)return this.connectPromise;if(this.isConnected())return Promise.resolve();this.ws?.readyState===Gu.CLOSING&&await new Promise(e=>this.emitter.once("disconnected",e));const e=Nu();this.connectPromise=e.promise;const t=this.createWebsocket?this.createWebsocket():this.initWebsocket(this.options),n=setTimeout(()=>{this.onClose(),e.reject(new Yu("websocket_timeout"));try{t.close()}catch{}},this.options.connectionTimeout||this.options.timeout||2e4);return t.once("error",t=>{clearTimeout(n),this.onClose(),e.reject(new Yu(t.message))}),t.on("open",()=>{clearTimeout(n),this.init(),e.resolve()}),this.ws=t,e.promise.finally(()=>{this.connectPromise=void 0})}init(){const{ws:e}=this;if(!e||!this.isConnected())throw Error("Websocket init cannot be called");e.removeAllListeners(),e.on("error",e=>this.onError()),e.on("message",e=>this.onMessage(e)),e.on("close",()=>{this.emitter.emit("disconnected"),this.onClose()})}disconnect(){if(this.isConnected()){const e=new Promise(e=>{this.ws?.once("close",e)});return this.ws?.close(),e}return Promise.resolve()}isConnected(){return this.ws?.readyState===Gu.OPEN}onClose(){clearTimeout(this.pingTimeout),this.ws?.removeAllListeners(),this.ws?.on("error",()=>{}),this.messages.rejectAll(new Yu("Websocket closed unexpectedly"))}dispose(){this.removeAllListeners(),this.disconnect(),this.onClose()}}const Zu="#bada55",Qu="#20abd8",el="#f4a744",tl={"@trezor/connect":`color: ${Qu}; background: #000;`,"@trezor/connect-web":`color: ${Qu}; background: #000;`,"@trezor/connect-webextension":`color: ${Qu}; background: #000;`,IFrame:`color: ${el}; background: #000;`,Core:`color: ${el}; background: #000;`,DeviceList:`color: ${Zu}; background: #000;`,Device:`color: ${Zu}; background: #000;`,DeviceCommands:`color: ${Zu}; background: #000;`,"@trezor/transport":`color: ${Zu}; background: #000;`},nl=new class{logs={};writer;colors={};constructor({colors:e}){this.colors=e}initLog(e,t,n){const r=n||this.writer,i=new Cu(e,!!t,r);return this.colors&&i.setColors(this.colors),this.logs[e]=i,i}setLogWriter(e){Object.keys(this.logs).forEach(t=>{if(this.writer=e(),this.writer){this.logs[t].setWriter(this.writer);const{messages:e}=this.logs[t];e.forEach(e=>{this.writer?.add(e)})}})}enableLog(e){Object.keys(this.logs).forEach(t=>{this.logs[t].enabled=!!e})}enableLogByPrefix(e,t){this.logs[e]&&(this.logs[e].enabled=t)}getLog(){let e=[];return Object.keys(this.logs).forEach(t=>{e=e.concat(this.logs[t].messages)}),e.sort((e,t)=>e.timestamp-t.timestamp),e}}({colors:tl}),rl=nl.initLog.bind(nl);nl.setLogWriter.bind(nl),nl.enableLog.bind(nl),nl.enableLogByPrefix.bind(nl),nl.getLog.bind(nl);const il="https://dev.suite.sldev.cz",ol=`${il}/connect/`,al=(e,t)=>{if("http://localhost:8088"===t)return"http://localhost:8000/connect-popup";if(e.startsWith(ol)){const t=(e=>{let t;try{t=new URL(e).pathname}catch{t=new URL(e,il).pathname}const n=t.match(/\/connect\/(.+)/);if(n)return n[1].replace(/^(.+)\/(?:methods|settings)\/.*$/,"$1").replace(/\/$/,"")||void 0})(e);if(t)return`${il}/suite-web/${t}/web/connect-popup`}return"https://suite.trezor.io/web/connect-popup"};class sl extends zu{messages=ku({generateId:()=>crypto.randomUUID()});messagesQueue=[];isConnected=!1;handshakeMaxRetries=5;handshakeRetryInterval=2e3;handshakeFinished;lazyHandshake;logger;sendFn;channel;constructor({sendFn:e,channel:t,logger:n,lazyHandshake:r=!1}){super(),this.channel=t,this.sendFn=e,this.lazyHandshake=r,this.logger=n}init(){return this.handshakeFinished||(this.handshakeFinished=Nu(),this.lazyHandshake||this.handshakeWithPeer()),this.handshakeFinished.promise}handshakeWithPeer(){return this.logger?.log(this.channel.here,"handshake"),Du(async()=>{this.postMessage({type:"channel-handshake-request",data:{success:!0,payload:void 0}},{usePromise:!1,useQueue:!1}),await(this.handshakeFinished?.promise)},{attempts:this.handshakeMaxRetries,timeout:this.handshakeRetryInterval}).then(()=>{this.logger?.log(this.channel.here,"handshake confirmed"),this.messagesQueue.forEach(e=>{e.channel=this.channel,this.sendFn(e)}),this.messagesQueue=[]}).catch(()=>{this.handshakeFinished?.reject(new Error("handshake failed")),this.handshakeFinished=void 0})}onMessage(e){const t=e,{channel:n,id:r,type:i,...o}=t;if(!n?.peer||n.peer!==this.channel.here)return;if(!n?.here||this.channel.peer!==n.here)return;if("channel-handshake-request"===i)return this.postMessage({type:"channel-handshake-confirm",data:{success:!0,payload:void 0}},{usePromise:!1,useQueue:!1}),void(this.lazyHandshake&&this.handshakeWithPeer());if("channel-handshake-confirm"===i)return void this.handshakeFinished?.resolve(void 0);this.messages.resolve(r,{id:r,...o});const a=this.messages.length();a>5&&this.logger?.warn(`too many message promises (${a}). this feels unexpected!`),this.emit("message",t)}postMessage(e,{usePromise:t=!0,useQueue:n=!0}={}){if(e.channel=this.channel,!t){try{this.sendFn(e)}catch{n&&this.messagesQueue.push(e)}return}const{promise:r,promiseId:i}=this.messages.create();e.id=i;try{this.sendFn(e)}catch{n&&this.messagesQueue.push(e)}return r}resolveMessagePromises(e){this.messages.resolveAll(t=>({id:t,payload:e}))}clearPendingSends(){}abortHandshake(e){this.handshakeFinished?.reject(new Error(e??"Handshake aborted")),this.handshakeFinished=void 0}clear(){this.handshakeFinished=void 0}}class cl extends sl{_windowHere;_listener;_origin;constructor({windowHere:e,windowPeer:t,channel:n,logger:r,origin:i}){super({channel:n,sendFn:e=>{t()?.postMessage(e,i)},logger:r}),this._listener=this.listener.bind(this),this._windowHere=e,this._origin=i,this.connect()}listener(e){if(e.origin!==this._origin||"null"===e.origin)return void this.logger?.warn(`WindowWindowChannel: ignoring message from unexpected origin "${e.origin}", expected "${this._origin}"`);const t={...e.data,success:!0,origin:e.origin,payload:e.data.payload||{},channel:e.data.channel||{peer:this.channel.here,here:this.channel.peer}};this.onMessage(t)}connect(){this._windowHere.addEventListener("message",this._listener),this.isConnected=!0}disconnect(){this.isConnected&&(this._windowHere.removeEventListener("message",this._listener),this.isConnected=!1)}}const ul=e=>{if("string"!=typeof e)return"unknown";if(e.startsWith("file://"))return"file://";const[t]=e.match(/^https?:\/\/[^/]+/)??[];return t??"unknown"};class ll extends aa{channel;handshakePromise;logger;popupSrc;manifest;version;closeInterval;locked=!1;closedEmitted=!1;pendingFocusOrCreate=Promise.resolve();constructor({popupSrc:e,manifest:t,version:n,logger:r}){super(),this.logger=r,this.popupSrc=e,this.manifest=t,this.version=n,this.channel=this.createChannel(ul(e)),this.handshakePromise=Nu(),this.handshakePromise.promise.catch(()=>{}),this.channel.on("message",this.handleCoreMessage.bind(this))}async focusOrCreate(){this.pendingFocusOrCreate=this.pendingFocusOrCreate.catch(()=>{}).then(()=>this._focusOrCreate()),await this.pendingFocusOrCreate}async _focusOrCreate(){const e=await this.isOpen();if(!e&&this.locked&&this.reset(!1),!this.locked)return e&&await this.close(),this.locked=!0,this.closedEmitted=!1,this.open();this.focusPopup()}buildPopupUrl(e){return e}focusPopup(){}startCloseMonitoring(){this.closeInterval=setInterval(async()=>{await this.isOpen()||this.handlePopupClosed()},500)}async handleCoreMessage(e){this.logger.debug("handleCoreMessage",e),e.type===ou?(this.channel.postMessage({type:au,payload:{manifest:this.manifest,version:this.version}}),this.handshakePromise?.resolve()):e.type===su?(await this.close(),this.handlePopupClosed()):e.event===tu&&this.emit(tu,e)}handlePopupClosed(){this.emitClosed(),this.reset()}reset(e=!0){this.locked&&(this.locked=!1,this.handshakePromise?.reject(Zc("Method_Interrupted")),this.handshakePromise=Nu(),this.handshakePromise.promise.catch(()=>{}),this.channel.abortHandshake("Popup closed"),this.channel.disconnect(),this.closeInterval&&(clearInterval(this.closeInterval),this.closeInterval=void 0),this.onReset(e))}handleOpenFailure(e){this.logger.error("Failed to open popup:",e);const t=new Error(e);this.channel.abortHandshake(e),this.handshakePromise?.reject(t),this.handlePopupClosed()}async close(){await this.isOpen()&&(this.logger.debug("closing popup"),this.closePopup(),this.channel.clear())}emitClosed(){this.closedEmitted||(this.closedEmitted=!0,this.channel.resolveMessagePromises({success:!1,error:Zc("Method_Interrupted")}),this.emit(su))}}const dl="trezor-connect-bootstrap",fl=()=>document.getElementById(dl)??void 0,hl=()=>{let e,t;const n=()=>{t&&(window.clearTimeout(t),t=void 0)},r=()=>{n(),e?.reject(Zc("Handshake_Error","iframe-blocked"))},i=()=>{const t=fl();if(!t)return r();try{const e=t.contentWindow?.location.origin;if(!e||"null"===e)return r()}catch{}t.onload=null,e?.resolve()};return{create:r=>{if(e)return e.promise;if(fl())return Promise.resolve();e=Nu();const o=(()=>{const e=document.createElement("iframe");return e.id=dl,e.frameBorder="0",e.width="0px",e.height="0px",e.style.position="absolute",e.style.display="none",e.style.border="0px",e.style.width="0px",e.style.height="0px",e})();return t=setTimeout(()=>{e?.reject(Zc("Handshake_Error","iframe-timeout"))},1e4),o.onload=i,o.setAttribute("src",r),document.body.appendChild(o),e.promise.finally(()=>{n()}).catch(e=>{throw o.parentNode&&o.parentNode.removeChild(o),e})},get:fl}},pl={ENV_NOT_SUPPORTED:"env-not-supported",HANDSHAKE_TIMEOUT:"handshake-timeout",STORAGE_ACCESS_DENIED:"storage-access-denied",CHANNEL_ID_MISSING:"channel-id-missing",ORIGIN_MISSING:"origin-missing",UNKNOWN:"unknown"};class bl extends ll{popupWindow;iframe=hl();channelId=(e=>{let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let r=0;r<e;r++)t+=n.charAt(Math.floor(62*Math.random()));return t})(16);createChannel(){return new cl({windowHere:window,windowPeer:()=>this.iframe.get()?.contentWindow||void 0,channel:{here:"@trezor/connect-web",peer:"@trezor/connect-popup"},logger:this.logger,origin:ul(this.popupSrc)})}async open(){const e=`${this.buildPopupUrl(this.popupSrc)}/bootstrap.html?${`connect-popup-req=${this.channelId}`}${this.logger.enabled?"&debug=1":""}`,t=ul(this.popupSrc),n=window.open("about:blank","_blank");if(!n){const e=Zc("Handshake_Error","popup-blocked");return this.handleOpenFailure(e.message),Promise.reject(e)}try{await this.iframe.create(e)}catch(e){return n.close(),this.handleOpenFailure(e.message),Promise.reject(e)}n.location.href=e;const r=new cl({windowHere:window,windowPeer:()=>this.iframe.get()?.contentWindow||void 0,channel:{here:"@trezor/connect-web",peer:"@trezor/connect-bootstrap-iframe"},logger:this.logger,origin:t});r.on("message",e=>{"channel-handshake-error"===e.type&&(n.postMessage({type:"channel-handshake-error",error:e.error},t),this.handleOpenFailure(e.error),r.abortHandshake(e.error))});try{await r.init(),r.disconnect()}catch(e){this.handleOpenFailure(e.message),r.disconnect();return Object.values(pl).includes(e.message)?Promise.reject(Zc("Handshake_Error",e.message)):Promise.reject(e)}return this.channel.isConnected||this.channel.connect(),Promise.resolve()}focusPopup(){this.popupWindow?.focus()}closePopup(){this.popupWindow?.close(),this.popupWindow=void 0}isOpen(){return Promise.resolve(void 0!==this.popupWindow)}onReset(){}}class ml extends sl{currentId;allowedOrigin;messageListener;sendChain=Promise.resolve();static SEND_SETTLE_MS=100;constructor({channel:e,logger:t,currentId:n,allowedOrigin:r}){super({channel:e,sendFn:e=>{this.sendChain=this.sendChain.catch(()=>{}).then(()=>this.doSend(e)).then(()=>new Promise(e=>setTimeout(e,ml.SEND_SETTLE_MS)))},logger:t}),this.currentId=n,this.allowedOrigin=r}async doSend(e){try{const t=await(this.currentId?.());if(this.logger?.debug("CHANNEL sending to tab:",t,"message:",e),!t)throw this.logger?.error("CHANNEL: No tab ID available, cannot send message"),new Error("No tab ID available");e.id||this.logger?.warn("CHANNEL: Message without ID, this might cause issues with response handling",e);const n=await Promise.race([new Promise((e,n)=>{chrome.tabs.get(t,t=>{chrome.runtime.lastError?(this.logger?.error("CHANNEL: Error getting tab:",chrome.runtime.lastError),n(chrome.runtime.lastError)):e(t)})}),new Promise((e,t)=>setTimeout(()=>t(new Error("chrome.tabs.get timeout after 5s")),5e3))]);if(!n?.url)throw new Error("Trezor suite tab URL not available, the manifest must declare host_permissions matching the popup origin");const r=new URL(n.url),i=encodeURIComponent(JSON.stringify(e));r.hash=`#extension-id=${chrome.runtime.id}&message=${i}`,chrome.tabs.update(t,{url:r.toString()})}catch(e){throw this.logger?.error("CHANNEL: Error sending message via tab update:",e),e}}clearPendingSends(){this.sendChain=Promise.resolve()}connect(){this.messageListener?this.logger?.debug("CHANNEL: Listener already registered, skipping"):(this.logger?.debug("CHANNEL: connect called, setting up onMessageExternal listener"),this.messageListener=(e,t,n)=>{if(this.logger?.debug("CHANNEL: onMessageExternal fired:",{message:e,sender:t}),!t.tab)return this.logger?.warn("CHANNEL: Received message not from a tab, ignoring",t),!1;if(this.allowedOrigin){if(!t.tab.url)return this.logger?.warn(`CHANNEL: Missing sender tab URL while allowed origin is configured (allowed=${this.allowedOrigin}). Ignoring.`),!1;let e,n;try{e=new URL(t.tab.url).origin,n=new URL(this.allowedOrigin).origin}catch{return this.logger?.warn(`CHANNEL: Could not parse sender or allowed origin (sender=${t.tab.url}, allowed=${this.allowedOrigin}). Ignoring.`),!1}if(e!==n)return this.logger?.warn(`CHANNEL: Sender origin mismatch — expected ${n}, got ${e}. Ignoring.`),!1}if(!e.channel)return this.logger?.warn("CHANNEL: Received message without channel info, ignoring"),n({error:"Missing channel info"}),!1;this.logger?.debug("CHANNEL: Processing message through onMessage"),this.onMessage(e)},chrome.runtime.onMessageExternal.addListener(this.messageListener),this.isConnected=!0,this.logger?.debug("CHANNEL: Listener registered successfully"))}disconnect(){this.isConnected&&(this.messageListener&&(chrome.runtime.onMessageExternal.removeListener(this.messageListener),this.messageListener=void 0),this.clear(),this.isConnected=!1)}}class gl extends ll{popupWindow;popupWindowPromise=Nu();extensionTabId=0;buildPopupUrl(e){if("undefined"!=typeof chrome&&chrome.runtime?.id){const t=new URLSearchParams;return t.set("extension-id",chrome.runtime.id),e+"#"+t.toString()}return e}checkIfTabExists(e){return new Promise(t=>{chrome.tabs.get(e,()=>{t(!chrome.runtime.lastError)})})}logChromeError(e,t){t&&this.logger.error(`Chrome ${e} error:`,t)}createChannel(e){return new ml({channel:{here:"@trezor/connect-webextension-externally-connectable",peer:"@trezor/suite-web"},currentId:()=>this.popupWindowPromise?.promise.then(e=>e.id),logger:this.logger,allowedOrigin:e})}open(){this.popupWindowPromise=Nu(),this.popupWindowPromise.promise.catch(()=>{});const e=this.buildPopupUrl(this.popupSrc);return chrome.windows.getCurrent(t=>{this.logger.debug("opening popup. currentWindow type:",t.type),"normal"!==t.type?this.openPopupInNewWindow(e):this.openPopupInNewTab(e)}),this.channel.isConnected||(this.channel.connect(),this.channel.init().catch(e=>{this.logger.error("Channel handshake failed:",e)})),Promise.resolve()}openPopupInNewWindow(e){chrome.windows.create({url:e},e=>{if(!e)return this.popupWindowPromise?.reject(new Error("Failed to create popup window")),void this.handleOpenFailure("Failed to create popup window");chrome.tabs.query({windowId:e.id,active:!0},e=>this.onPopupTabResolved(e[0]))})}openPopupInNewTab(e){chrome.tabs.query({currentWindow:!0,active:!0},t=>{if(!t[0]?.id)return this.popupWindowPromise?.reject(new Error("No active tab found")),void this.handleOpenFailure("No active tab found");this.extensionTabId=t[0].id,chrome.tabs.create({url:e,index:t[0].index+1},e=>this.onPopupTabResolved(e))})}onPopupTabResolved(e){this.popupWindow=e,this.logger.debug("popup tab resolved:",e.id),this.popupWindowPromise?.resolve(e),this.startCloseMonitoring()}focusPopup(){this.popupWindow?.id&&chrome.tabs.update(this.popupWindow.id,{active:!0})}closePopup(){const e=this.popupWindow?.id;e&&(chrome.tabs.remove(e,()=>{this.logChromeError("close",chrome.runtime.lastError)}),this.popupWindow=void 0)}isOpen(){return this.popupWindow?.id?this.checkIfTabExists(this.popupWindow.id):Promise.resolve(!1)}onReset(e=!0){e&&this.extensionTabId&&(this.logger.debug("Focusing back to extension tab:",this.extensionTabId),chrome.tabs.update(this.extensionTabId,{active:!0},()=>{this.logChromeError("focus",chrome.runtime.lastError)}),this.extensionTabId=0)}}function vl(e){return Array.isArray(e)}function yl(e){return"bigint"==typeof e}function wl(e){return"boolean"==typeof e}function xl(e){return e instanceof globalThis.Date}function Al(e){return"number"==typeof e}function El(e){return"object"==typeof e&&null!==e}function Sl(e){return e instanceof globalThis.RegExp}function _l(e){return"string"==typeof e}function Ol(e){return e instanceof globalThis.Uint8Array}function Nl(e){return void 0===e}function kl(e){return vl(e)?function(e){return e.map(e=>kl(e))}(e):xl(e)?function(e){return new Date(e.getTime())}(e):Ol(e)?function(e){return new Uint8Array(e)}(e):Sl(e)?function(e){return new RegExp(e.source,e.flags)}(e):El(e)?function(e){const t={};for(const n of Object.getOwnPropertyNames(e))t[n]=kl(e[n]);for(const n of Object.getOwnPropertySymbols(e))t[n]=kl(e[n]);return t}(e):e}function Tl(e){return kl(e)}function Cl(e,t){return Tl(void 0===t?e:{...t,...e})}var Il;function Bl(e){return vl(e)?function(e){return globalThis.Object.freeze(e).map(e=>Bl(e))}(e):xl(e)||Ol(e)||Sl(e)?e:El(e)?function(e){const t={};for(const n of Object.getOwnPropertyNames(e))t[n]=Bl(e[n]);for(const n of Object.getOwnPropertySymbols(e))t[n]=Bl(e[n]);return globalThis.Object.freeze(t)}(e):e}function Ll(e,t){const n=void 0!==t?{...t,...e}:e;switch(Il.InstanceMode){case"freeze":return Bl(n);case"clone":return Tl(n);default:return n}}!function(e){function t(t){const n=function(e){return null!==e&&"object"==typeof e}(t);return e.AllowArrayObject?n:n&&!function(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}(t)}e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1,e.IsExactOptionalProperty=function(t,n){return e.ExactOptionalPropertyTypes?n in t:void 0!==t[n]},e.IsObjectLike=t,e.IsRecordLike=function(e){return t(e)&&!(e instanceof Date)&&!(e instanceof Uint8Array)},e.IsNumberLike=function(t){return e.AllowNaN?function(e){return"number"==typeof e}(t):Number.isFinite(t)},e.IsVoidLike=function(t){const n=function(e){return void 0===e}(t);return e.AllowNullVoid?n||null===t:n}}(Il||(Il={}));class Ml extends Error{constructor(e){super(e)}}const Rl=Symbol.for("TypeBox.Transform"),Pl=Symbol.for("TypeBox.Readonly"),Ul=Symbol.for("TypeBox.Optional"),jl=Symbol.for("TypeBox.Hint"),Fl=Symbol.for("TypeBox.Kind");function Dl(e){return El(e)&&"Readonly"===e[Pl]}function zl(e){return El(e)&&"Optional"===e[Ul]}function $l(e){return ed(e,"Any")}function Wl(e){return ed(e,"Argument")}function ql(e){return ed(e,"Array")}function Xl(e){return ed(e,"AsyncIterator")}function Kl(e){return ed(e,"BigInt")}function Hl(e){return ed(e,"Boolean")}function Vl(e){return ed(e,"Computed")}function Gl(e){return ed(e,"Constructor")}function Yl(e){return ed(e,"Function")}function Jl(e){return ed(e,"Integer")}function Zl(e){return ed(e,"Intersect")}function Ql(e){return ed(e,"Iterator")}function ed(e,t){return El(e)&&Fl in e&&e[Fl]===t}function td(e){return wl(e)||Al(e)||_l(e)}function nd(e){return ed(e,"Literal")}function rd(e){return ed(e,"MappedKey")}function id(e){return ed(e,"MappedResult")}function od(e){return ed(e,"Never")}function ad(e){return ed(e,"Null")}function sd(e){return ed(e,"Number")}function cd(e){return ed(e,"Object")}function ud(e){return ed(e,"Promise")}function ld(e){return ed(e,"Record")}function dd(e){return ed(e,"Ref")}function fd(e){return ed(e,"RegExp")}function hd(e){return ed(e,"String")}function pd(e){return ed(e,"Symbol")}function bd(e){return ed(e,"TemplateLiteral")}function md(e){return El(e)&&Rl in e}function gd(e){return ed(e,"Tuple")}function vd(e){return ed(e,"Undefined")}function yd(e){return ed(e,"Union")}function wd(e){return $l(e)||Wl(e)||ql(e)||Hl(e)||Kl(e)||Xl(e)||Vl(e)||Gl(e)||function(e){return ed(e,"Date")}(e)||Yl(e)||Jl(e)||Zl(e)||Ql(e)||nd(e)||rd(e)||id(e)||od(e)||function(e){return ed(e,"Not")}(e)||ad(e)||sd(e)||cd(e)||ud(e)||ld(e)||dd(e)||fd(e)||hd(e)||pd(e)||bd(e)||function(e){return ed(e,"This")}(e)||gd(e)||vd(e)||yd(e)||function(e){return ed(e,"Uint8Array")}(e)||function(e){return ed(e,"Unknown")}(e)||function(e){return ed(e,"Unsafe")}(e)||function(e){return ed(e,"Void")}(e)||function(e){return El(e)&&Fl in e&&_l(e[Fl])}(e)}const xd=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function Ad(e){try{return new RegExp(e),!0}catch{return!1}}function Ed(e){if(!_l(e))return!1;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n>=7&&n<=13||27===n||127===n)return!1}return!0}function Sd(e){return Nd(e)||ff(e)}function _d(e){return Nl(e)||yl(e)}function Od(e){return Nl(e)||Al(e)}function Nd(e){return Nl(e)||wl(e)}function kd(e){return Nl(e)||_l(e)}function Td(e){return Nl(e)||ff(e)}function Cd(e){return El(e)&&"Optional"===e[Ul]}function Id(e){return Wd(e,"Any")&&kd(e.$id)}function Bd(e){return Wd(e,"Array")&&"array"===e.type&&kd(e.$id)&&ff(e.items)&&Od(e.minItems)&&Od(e.maxItems)&&Nd(e.uniqueItems)&&Td(e.contains)&&Od(e.minContains)&&Od(e.maxContains)}function Ld(e){return Wd(e,"AsyncIterator")&&"AsyncIterator"===e.type&&kd(e.$id)&&ff(e.items)}function Md(e){return Wd(e,"BigInt")&&"bigint"===e.type&&kd(e.$id)&&_d(e.exclusiveMaximum)&&_d(e.exclusiveMinimum)&&_d(e.maximum)&&_d(e.minimum)&&_d(e.multipleOf)}function Rd(e){return Wd(e,"Boolean")&&"boolean"===e.type&&kd(e.$id)}function Pd(e){return Wd(e,"Constructor")&&"Constructor"===e.type&&kd(e.$id)&&vl(e.parameters)&&e.parameters.every(e=>ff(e))&&ff(e.returns)}function Ud(e){return Wd(e,"Date")&&"Date"===e.type&&kd(e.$id)&&Od(e.exclusiveMaximumTimestamp)&&Od(e.exclusiveMinimumTimestamp)&&Od(e.maximumTimestamp)&&Od(e.minimumTimestamp)&&Od(e.multipleOfTimestamp)}function jd(e){return Wd(e,"Function")&&"Function"===e.type&&kd(e.$id)&&vl(e.parameters)&&e.parameters.every(e=>ff(e))&&ff(e.returns)}function Fd(e){return Wd(e,"Integer")&&"integer"===e.type&&kd(e.$id)&&Od(e.exclusiveMaximum)&&Od(e.exclusiveMinimum)&&Od(e.maximum)&&Od(e.minimum)&&Od(e.multipleOf)}function Dd(e){return El(e)&&Object.entries(e).every(([e,t])=>Ed(e)&&ff(t))}function zd(e){return Wd(e,"Intersect")&&(!_l(e.type)||"object"===e.type)&&vl(e.allOf)&&e.allOf.every(e=>ff(e)&&!function(e){return El(e)&&Rl in e}(e))&&kd(e.type)&&(Nd(e.unevaluatedProperties)||Td(e.unevaluatedProperties))&&kd(e.$id)}function $d(e){return Wd(e,"Iterator")&&"Iterator"===e.type&&kd(e.$id)&&ff(e.items)}function Wd(e,t){return El(e)&&Fl in e&&e[Fl]===t}function qd(e){return Hd(e)&&_l(e.const)}function Xd(e){return Hd(e)&&Al(e.const)}function Kd(e){return Hd(e)&&wl(e.const)}function Hd(e){return Wd(e,"Literal")&&kd(e.$id)&&function(e){return wl(e)||Al(e)||_l(e)}(e.const)}function Vd(e){return Wd(e,"Never")&&El(e.not)&&0===Object.getOwnPropertyNames(e.not).length}function Gd(e){return Wd(e,"Not")&&ff(e.not)}function Yd(e){return Wd(e,"Null")&&"null"===e.type&&kd(e.$id)}function Jd(e){return Wd(e,"Number")&&"number"===e.type&&kd(e.$id)&&Od(e.exclusiveMaximum)&&Od(e.exclusiveMinimum)&&Od(e.maximum)&&Od(e.minimum)&&Od(e.multipleOf)}function Zd(e){return Wd(e,"Object")&&"object"===e.type&&kd(e.$id)&&Dd(e.properties)&&Sd(e.additionalProperties)&&Od(e.minProperties)&&Od(e.maxProperties)}function Qd(e){return Wd(e,"Promise")&&"Promise"===e.type&&kd(e.$id)&&ff(e.item)}function ef(e){return Wd(e,"Record")&&"object"===e.type&&kd(e.$id)&&Sd(e.additionalProperties)&&El(e.patternProperties)&&(e=>{const t=Object.getOwnPropertyNames(e.patternProperties);return 1===t.length&&Ad(t[0])&&El(e.patternProperties)&&ff(e.patternProperties[t[0]])})(e)}function tf(e){return Wd(e,"RegExp")&&kd(e.$id)&&_l(e.source)&&_l(e.flags)&&Od(e.maxLength)&&Od(e.minLength)}function nf(e){return Wd(e,"String")&&"string"===e.type&&kd(e.$id)&&Od(e.minLength)&&Od(e.maxLength)&&function(e){return Nl(e)||_l(e)&&Ed(e)&&Ad(e)}(e.pattern)&&function(e){return Nl(e)||_l(e)&&Ed(e)}(e.format)}function rf(e){return Wd(e,"Symbol")&&"symbol"===e.type&&kd(e.$id)}function of(e){return Wd(e,"TemplateLiteral")&&"string"===e.type&&_l(e.pattern)&&"^"===e.pattern[0]&&"$"===e.pattern[e.pattern.length-1]}function af(e){return Wd(e,"Tuple")&&"array"===e.type&&kd(e.$id)&&Al(e.minItems)&&Al(e.maxItems)&&e.minItems===e.maxItems&&(Nl(e.items)&&Nl(e.additionalItems)&&0===e.minItems||vl(e.items)&&e.items.every(e=>ff(e)))}function sf(e){return Wd(e,"Undefined")&&"undefined"===e.type&&kd(e.$id)}function cf(e){return Wd(e,"Union")&&kd(e.$id)&&El(e)&&vl(e.anyOf)&&e.anyOf.every(e=>ff(e))}function uf(e){return Wd(e,"Uint8Array")&&"Uint8Array"===e.type&&kd(e.$id)&&Od(e.minByteLength)&&Od(e.maxByteLength)}function lf(e){return Wd(e,"Unknown")&&kd(e.$id)}function df(e){return Wd(e,"Void")&&"void"===e.type&&kd(e.$id)}function ff(e){return El(e)&&(Id(e)||function(e){return Wd(e,"Argument")&&Al(e.index)}(e)||Bd(e)||Rd(e)||Md(e)||Ld(e)||function(e){return Wd(e,"Computed")&&_l(e.target)&&vl(e.parameters)&&e.parameters.every(e=>ff(e))}(e)||Pd(e)||Ud(e)||jd(e)||Fd(e)||zd(e)||$d(e)||Hd(e)||function(e){return Wd(e,"MappedKey")&&vl(e.keys)&&e.keys.every(e=>Al(e)||_l(e))}(e)||function(e){return Wd(e,"MappedResult")&&Dd(e.properties)}(e)||Vd(e)||Gd(e)||Yd(e)||Jd(e)||Zd(e)||Qd(e)||ef(e)||function(e){return Wd(e,"Ref")&&kd(e.$id)&&_l(e.$ref)}(e)||tf(e)||nf(e)||rf(e)||of(e)||function(e){return Wd(e,"This")&&kd(e.$id)&&_l(e.$ref)}(e)||af(e)||sf(e)||cf(e)||uf(e)||lf(e)||function(e){return Wd(e,"Unsafe")}(e)||df(e)||function(e){return El(e)&&Fl in e&&_l(e[Fl])&&!xd.includes(e[Fl])}(e))}const hf="(0|[1-9][0-9]*)",pf="(.*)",bf=`^${hf}$`,mf=`^${pf}$`,gf=new Map;function vf(e,t){gf.set(e,t)}function yf(e){return Ll({[Fl]:"Any"},e)}function wf(e,t){return Ll({[Fl]:"Array",type:"array",items:e},t)}function xf(e,t){return Ll({[Fl]:"AsyncIterator",type:"AsyncIterator",items:e},t)}function Af(e,t,n){return Ll({[Fl]:"Computed",target:e,parameters:t},n)}function Ef(e,t){return t.reduce((e,t)=>function(e,t){const{[t]:n,...r}=e;return r}(e,t),e)}function Sf(e){return Ll({[Fl]:"Never",not:{}},e)}function _f(e){return Ll({[Fl]:"MappedResult",properties:e})}function Of(e,t,n){return Ll({[Fl]:"Constructor",type:"Constructor",parameters:e,returns:t},n)}function Nf(e,t,n){return Ll({[Fl]:"Function",type:"Function",parameters:e,returns:t},n)}function kf(e,t){return Ll({[Fl]:"Union",anyOf:e},t)}function Tf(e){return e.map(e=>zl(e)?Ef(e,[Ul]):e)}function Cf(e,t){const n=function(e){return e.some(e=>zl(e))}(e);return n?Ih(kf(Tf(e),t)):kf(Tf(e),t)}function If(e,t){return 1===e.length?Ll(e[0],t):0===e.length?Sf(t):Cf(e,t)}function Bf(e,t){return 0===e.length?Sf(t):1===e.length?Ll(e[0],t):kf(e,t)}class Lf extends Ml{}function Mf(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}function Rf(e,t,n){return e[t]===n&&92!==e.charCodeAt(t-1)}function Pf(e,t){return Rf(e,t,"(")}function Uf(e,t){return Rf(e,t,")")}function jf(e,t){return Rf(e,t,"|")}function Ff(e){return function(e){if(!Pf(e,0)||!Uf(e,e.length-1))return!1;let t=0;for(let n=0;n<e.length;n++)if(Pf(e,n)&&(t+=1),Uf(e,n)&&(t-=1),0===t&&n!==e.length-1)return!1;return!0}(e)?Ff(function(e){return e.slice(1,e.length-1)}(e)):function(e){let t=0;for(let n=0;n<e.length;n++)if(Pf(e,n)&&(t+=1),Uf(e,n)&&(t-=1),jf(e,n)&&0===t)return!0;return!1}(e)?function(e){let[t,n]=[0,0];const r=[];for(let i=0;i<e.length;i++)if(Pf(e,i)&&(t+=1),Uf(e,i)&&(t-=1),jf(e,i)&&0===t){const t=e.slice(n,i);t.length>0&&r.push(Ff(t)),n=i+1}const i=e.slice(n);return i.length>0&&r.push(Ff(i)),0===r.length?{type:"const",const:""}:1===r.length?r[0]:{type:"or",expr:r}}(e):function(e){for(let t=0;t<e.length;t++)if(Pf(e,t))return!0;return!1}(e)?function(e){function t(e,t){if(!Pf(e,t))throw new Lf("TemplateLiteralParser: Index must point to open parens");let n=0;for(let r=t;r<e.length;r++)if(Pf(e,r)&&(n+=1),Uf(e,r)&&(n-=1),0===n)return[t,r];throw new Lf("TemplateLiteralParser: Unclosed group parens in expression")}function n(e,t){for(let n=t;n<e.length;n++)if(Pf(e,n))return[t,n];return[t,e.length]}const r=[];for(let i=0;i<e.length;i++)if(Pf(e,i)){const[n,o]=t(e,i),a=e.slice(n,o+1);r.push(Ff(a)),i=o}else{const[t,o]=n(e,i),a=e.slice(t,o);a.length>0&&r.push(Ff(a)),i=o-1}return 0===r.length?{type:"const",const:""}:1===r.length?r[0]:{type:"and",expr:r}}(e):{type:"const",const:Mf(e)}}function Df(e){return Ff(e.slice(1,e.length-1))}class zf extends Ml{}function $f(e){return!function(e){return"or"===e.type&&2===e.expr.length&&"const"===e.expr[0].type&&"0"===e.expr[0].const&&"const"===e.expr[1].type&&"[1-9][0-9]*"===e.expr[1].const}(e)&&!function(e){return"const"===e.type&&".*"===e.const}(e)&&(!!function(e){return"or"===e.type&&2===e.expr.length&&"const"===e.expr[0].type&&"true"===e.expr[0].const&&"const"===e.expr[1].type&&"false"===e.expr[1].const}(e)||("and"===e.type||"or"===e.type?e.expr.every(e=>$f(e)):"const"===e.type||(()=>{throw new zf("Unknown expression type")})()))}class Wf extends Ml{}function*qf(e){if(1===e.length)return yield*e[0];for(const t of e[0])for(const n of qf(e.slice(1)))yield`${t}${n}`}function*Xf(e){return yield*qf(e.expr.map(e=>[...Kf(e)]))}function*Kf(e){return"and"===e.type?yield*Xf(e):"or"===e.type?yield*function*(e){for(const t of e.expr)yield*Kf(t)}(e):"const"===e.type?yield*function*(e){return yield e.const}(e):(()=>{throw new Wf("Unknown expression")})()}function Hf(e){const t=Df(e.pattern);return $f(t)?[...Kf(t)]:[]}function Vf(e,t){return Ll({[Fl]:"Literal",const:e,type:typeof e},t)}function Gf(e){return Ll({[Fl]:"Boolean",type:"boolean"},e)}function Yf(e){return Ll({[Fl]:"BigInt",type:"bigint"},e)}function Jf(e){return Ll({[Fl]:"Number",type:"number"},e)}function Zf(e){return Ll({[Fl]:"String",type:"string"},e)}function*Qf(e){const t=e.trim().replace(/"|'/g,"");return"boolean"===t?yield Gf():"number"===t?yield Jf():"bigint"===t?yield Yf():"string"===t?yield Zf():yield(()=>{const e=t.split("|").map(e=>Vf(e.trim()));return 0===e.length?Sf():1===e.length?e[0]:If(e)})()}function*eh(e){if("{"!==e[1]){const t=Vf("$"),n=th(e.slice(1));return yield*[t,...n]}for(let t=2;t<e.length;t++)if("}"===e[t]){const n=Qf(e.slice(2,t)),r=th(e.slice(t+1));return yield*[...n,...r]}yield Vf(e)}function*th(e){for(let t=0;t<e.length;t++)if("$"===e[t]){const n=Vf(e.slice(0,t)),r=eh(e.slice(t));return yield*[n,...r]}yield Vf(e)}class nh extends Ml{}function rh(e,t){return bd(e)?e.pattern.slice(1,e.pattern.length-1):yd(e)?`(${e.anyOf.map(e=>rh(e,t)).join("|")})`:sd(e)||Jl(e)||Kl(e)?`${t}${hf}`:hd(e)?`${t}${pf}`:nd(e)?`${t}${n=e.const.toString(),n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`:Hl(e)?`${t}(true|false)`:(()=>{throw new nh(`Unexpected Kind '${e[Fl]}'`)})();var n}function ih(e){return`^${e.map(e=>rh(e,"")).join("")}$`}function oh(e){return If(Hf(e).map(e=>Vf(e)))}function ah(e,t){const n=_l(e)?ih([...th(e)]):ih(e);return Ll({[Fl]:"TemplateLiteral",type:"string",pattern:n},t)}function sh(e){const t=[];for(const n of e)t.push(...ch(n));return t}function ch(e){return[...new Set(bd(e)?(n=e,Hf(n).map(e=>e.toString())):yd(e)?sh(e.anyOf):nd(e)?(t=e.const,[t.toString()]):sd(e)||Jl(e)?["[number]"]:[])];var t,n}function uh(e,t,n){return function(e,t,n){const r={};for(const i of Object.getOwnPropertyNames(t))r[i]=mh(e,ch(t[i]),n);return r}(e,t.properties,n)}function lh(e,t){return e.map(e=>hh(e,t))}function dh(e,t){return Rh(function(e){return e.filter(e=>!od(e))}(lh(e,t)))}function fh(e,t){return If(function(e){return e.some(e=>od(e))?[]:e}(lh(e,t)))}function hh(e,t){return Zl(e)?dh(e.allOf,t):yd(e)?fh(e.anyOf,t):gd(e)?function(e,t){return t in e?e[t]:"[number]"===t?If(e):Sf()}(e.items??[],t):ql(e)?function(e,t){return"[number]"===t?e:Sf()}(e.items,t):cd(e)?function(e,t){return t in e?e[t]:Sf()}(e.properties,t):Sf()}function ph(e,t){return t.map(t=>hh(e,t))}function bh(e,t){return If(ph(e,t))}function mh(e,t,n){if(dd(e)||dd(t)){const n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!wd(e)||!wd(t))throw new Ml(n);return Af("Index",[e,t])}return id(t)?function(e,t,n){return _f(uh(e,t,n))}(e,t,n):rd(t)?function(e,t,n){const r=function(e,t,n){return function(e,t,n){return t.reduce((t,r)=>({...t,...gh(e,r,n)}),{})}(e,t.keys,n)}(e,t,n);return _f(r)}(e,t,n):Ll(wd(t)?bh(e,ch(t)):bh(e,t),n)}function gh(e,t,n){return{[t]:mh(e,[t],Tl(n))}}function vh(e,t){return Ll({[Fl]:"Iterator",type:"Iterator",items:e},t)}var yh,wh=function(e,t){const n=function(e){return globalThis.Object.keys(e).filter(t=>!zl(e[t]))}(e);return Ll(n.length>0?{[Fl]:"Object",type:"object",required:n,properties:e}:{[Fl]:"Object",type:"object",properties:e},t)};function xh(e,t){return Ll({[Fl]:"Promise",type:"Promise",item:e},t)}function Ah(e,t){return!1===t?function(e){return Ll(Ef(e,[Pl]))}(e):function(e){return Ll({...e,[Pl]:"Readonly"})}(e)}function Eh(e,t){const n=t??!0;return id(e)?function(e,t){const n=function(e,t){return function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(e))n[r]=Eh(e[r],t);return n}(e.properties,t)}(e,t);return _f(n)}(e,n):Ah(e,n)}function Sh(e,t){return Ll(e.length>0?{[Fl]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[Fl]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}function _h(e,t){return e in t?kh(e,t[e]):_f(t)}function Oh(e,t){return n=e,t.includes(n)?function(e){return{[e]:Vf(e)}}(e):function(e){const t={};for(const n of e)t[n]=Vf(n);return t}(t);var n}function Nh(e,t){return t.map(t=>kh(e,t))}function kh(e,t){const n={...t};return zl(t)?Ih(kh(e,Ef(t,[Ul]))):Dl(t)?Eh(kh(e,Ef(t,[Pl]))):id(t)?_h(e,t.properties):rd(t)?function(e,t){return _h(e,Oh(e,t))}(e,t.keys):Gl(t)?Of(Nh(e,t.parameters),kh(e,t.returns),n):Yl(t)?Nf(Nh(e,t.parameters),kh(e,t.returns),n):Xl(t)?xf(kh(e,t.items),n):Ql(t)?vh(kh(e,t.items),n):Zl(t)?Ph(Nh(e,t.allOf),n):yd(t)?Bf(Nh(e,t.anyOf),n):gd(t)?Sh(Nh(e,t.items??[]),n):cd(t)?wh(function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(t))n[r]=kh(e,t[r]);return n}(e,t.properties),n):ql(t)?wf(kh(e,t.items),n):ud(t)?xh(kh(e,t.item),n):t}function Th(e,t,n){const r=wd(e)?ch(e):e,i=function(e,t){const n={};for(const r of e)n[r]=kh(r,t);return n}(r,t({[Fl]:"MappedKey",keys:r}));return wh(i,n)}function Ch(e,t){return!1===t?function(e){return Ll(Ef(e,[Ul]))}(e):function(e){return Ll({...e,[Ul]:"Optional"})}(e)}function Ih(e,t){const n=t??!0;return id(e)?function(e,t){const n=function(e,t){return function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(e))n[r]=Ih(e[r],t);return n}(e.properties,t)}(e,t);return _f(n)}(e,n):Ch(e,n)}function Bh(e,t={}){const n=e.every(e=>cd(e)),r=wd(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return Ll(!1===t.unevaluatedProperties||wd(t.unevaluatedProperties)||n?{...r,[Fl]:"Intersect",type:"object",allOf:e}:{...r,[Fl]:"Intersect",allOf:e},t)}function Lh(e){return e.map(e=>zl(e)?Ef(e,[Ul]):e)}function Mh(e,t){return function(e){return e.every(e=>zl(e))}(e)?Ih(Bh(Lh(e),t)):Bh(Lh(e),t)}function Rh(e,t={}){if(1===e.length)return Ll(e[0],t);if(0===e.length)return Sf(t);if(e.some(e=>md(e)))throw new Error("Cannot intersect transform types");return Mh(e,t)}function Ph(e,t){if(1===e.length)return Ll(e[0],t);if(0===e.length)return Sf(t);if(e.some(e=>md(e)))throw new Error("Cannot intersect transform types");return Bh(e,t)}function Uh(...e){const[t,n]="string"==typeof e[0]?[e[0],e[1]]:[e[0].$id,e[1]];if("string"!=typeof t)throw new Ml("Ref: $ref must be a string");return Ll({[Fl]:"Ref",$ref:t},n)}function jh(e){return e.map(e=>Fh(e))}function Fh(e,t){return Ll(Vl(e)?(n=e.target,r=e.parameters,Af("Awaited",[Af(n,r)])):Zl(e)?function(e){return Ph(jh(e))}(e.allOf):yd(e)?function(e){return Bf(jh(e))}(e.anyOf):ud(e)?function(e){return Fh(e)}(e.item):dd(e)?Af("Awaited",[Uh(e.$ref)]):e,t);var n,r}function Dh(e){const t=[];for(const n of e)t.push(zh(n));return t}function zh(e){return Zl(e)?function(e){return function(e){const t=[];for(const n of e)t.push(...n);return t}(Dh(e))}(e.allOf):yd(e)?function(e){const t=Dh(e);var n;return 1===(n=t).length?n[0]:n.length>1?function(e,t){return e.reduce((e,t)=>function(e,t){return e.filter(e=>t.includes(e))}(e,t),t)}(n.slice(1),n[0]):[]}(e.anyOf):gd(e)?function(e){return e.map((e,t)=>t.toString())}(e.items??[]):ql(e)?(e.items,["[number]"]):cd(e)?(t=e.properties,globalThis.Object.getOwnPropertyNames(t)):ld(e)?(e.patternProperties,[]):[];var t}function $h(e,t){const n=function(e){return e.map(e=>"[number]"===e?Jf():Vf(e))}(zh(e));return Ll(If(n),t)}function Wh(e,t){return Vl(e)?(n=e.target,r=e.parameters,Af("KeyOf",[Af(n,r)])):dd(e)?Af("KeyOf",[Uh(e.$ref)]):id(e)?function(e,t){const n=function(e,t){return function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(e))n[r]=Wh(e[r],Tl(t));return n}(e.properties,t)}(e,t);return _f(n)}(e,t):$h(e,t);var n,r}function qh(e){const t=[];for(const n of e)t.push(...zh(n));return function(e){return[...new Set(e)]}(t)}function Xh(e,t){const n=[];for(const r of e)n.push(...ph(r,[t]));return function(e){return e.filter(e=>!od(e))}(n)}function Kh(e,t){const n=function(e,t){const n={};for(const r of t)n[r]=Rh(Xh(e,r));return n}(e,qh(e));return wh(n,t)}function Hh(e){return Ll({[Fl]:"Date",type:"Date"},e)}function Vh(e){return Ll({[Fl]:"Null",type:"null"},e)}function Gh(e){return Ll({[Fl]:"Symbol",type:"symbol"},e)}function Yh(e){return Ll({[Fl]:"Undefined",type:"undefined"},e)}function Jh(e){return Ll({[Fl]:"Uint8Array",type:"Uint8Array"},e)}function Zh(e){return Ll({[Fl]:"Unknown"},e)}function Qh(e,t){return!0===t?e:Eh(e)}function ep(e,t){return function(e){return El(e)&&!vl(e)&&!Ol(e)&&Symbol.asyncIterator in e}(e)||function(e){return El(e)&&!vl(e)&&!Ol(e)&&Symbol.iterator in e}(e)?Qh(yf(),t):vl(e)?Eh(Sh(e.map(e=>ep(e,!1)))):Ol(e)?Jh():xl(e)?Hh():El(e)?Qh(wh(function(e){const t={};for(const n of globalThis.Object.getOwnPropertyNames(e))t[n]=Eh(ep(e[n],!1));return t}(e)),t):function(e){return"function"==typeof e}(e)?Qh(Nf([],Zh()),t):Nl(e)?Yh():function(e){return null===e}(e)?Vh():function(e){return"symbol"==typeof e}(e)?Gh():yl(e)?Yf():Al(e)||wl(e)||_l(e)?Vf(e):wh({})}class tp extends Ml{}function np(e){return e===yh.False?e:yh.True}function rp(e){throw new tp(e)}function ip(e){return Vd(e)||zd(e)||cf(e)||lf(e)||Id(e)}function op(e,t){return Vd(t)?lp():zd(t)?up(e,t):cf(t)?kp(e,t):lf(t)?Tp():Id(t)?ap():rp("StructuralRight")}function ap(e,t){return yh.True}function sp(e,t){return Kd(e)||Rd(e)?yh.True:yh.False}function cp(e,t){return Hd(e)&&Al(e.const)||Jd(e)||Fd(e)?yh.True:yh.False}function up(e,t){return t.allOf.every(t=>Ip(e,t)===yh.True)?yh.True:yh.False}function lp(e,t){return yh.False}function dp(e){let[t,n]=[e,0];for(;Gd(t);)t=t.not,n+=1;return n%2==0?t:Zh()}function fp(e,t){return Xd(e)||Jd(e)||Fd(e)?yh.True:yh.False}function hp(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function pp(e){return vp(e)}function bp(e){return hp(e,0)||hp(e,1)&&"description"in e.properties&&cf(e.properties.description)&&2===e.properties.description.anyOf.length&&(nf(e.properties.description.anyOf[0])&&sf(e.properties.description.anyOf[1])||nf(e.properties.description.anyOf[1])&&sf(e.properties.description.anyOf[0]))}function mp(e){return hp(e,0)}function gp(e){return hp(e,0)}function vp(e){const t=Jf();return hp(e,0)||hp(e,1)&&"length"in e.properties&&np(Ip(e.properties.length,t))===yh.True}function yp(e,t){return Ip(e,t)===yh.False||Cd(e)&&!Cd(t)?yh.False:yh.True}function wp(e,t){return lf(e)?yh.False:Id(e)?yh.Union:Vd(e)||qd(e)&&pp(t)||Xd(e)&&mp(t)||Kd(e)&&gp(t)||rf(e)&&bp(t)||Md(e)&&function(e){return hp(e,0)}(t)||nf(e)&&pp(t)||rf(e)&&bp(t)||Jd(e)&&mp(t)||Fd(e)&&mp(t)||Rd(e)&&gp(t)||uf(e)&&function(e){return vp(e)}(t)||Ud(e)&&function(e){return hp(e,0)}(t)||Pd(e)&&function(e){return hp(e,0)}(t)||jd(e)&&function(e){const t=Jf();return hp(e,0)||hp(e,1)&&"length"in e.properties&&np(Ip(e.properties.length,t))===yh.True}(t)?yh.True:ef(e)&&nf(Ap(e))?"Record"===t[jl]?yh.True:yh.False:ef(e)&&Jd(Ap(e))&&hp(t,0)?yh.True:yh.False}function xp(e,t){return ip(t)?op(e,t):Zd(t)&&function(e){const t=Nf([yf()],yf());return hp(e,0)||hp(e,1)&&"then"in e.properties&&np(Ip(e.properties.then,t))===yh.True}(t)?yh.True:Qd(t)?np(Ip(e.item,t.item)):yh.False}function Ap(e){return bf in e.patternProperties?Jf():mf in e.patternProperties?Zf():rp("Unknown record key pattern")}function Ep(e){return bf in e.patternProperties?e.patternProperties[bf]:mf in e.patternProperties?e.patternProperties[mf]:rp("Unable to get record value schema")}function Sp(e,t){const[n,r]=[Ap(t),Ep(t)];return qd(e)&&Jd(n)&&np(Ip(e,r))===yh.True?yh.True:uf(e)&&Jd(n)||nf(e)&&Jd(n)||Bd(e)&&Jd(n)?Ip(e,r):Zd(e)?(()=>{for(const t of Object.getOwnPropertyNames(e.properties))if(yp(r,e.properties[t])===yh.False)return yh.False;return yh.True})():yh.False}function _p(e,t){return Hd(e)&&_l(e.const)||nf(e)?yh.True:yh.False}function Op(e,t){return ip(t)?op(e,t):Zd(t)&&vp(t)||Bd(t)&&function(e,t){return Bd(t)&&void 0!==e.items&&e.items.every(e=>Ip(e,t.items)===yh.True)}(e,t)?yh.True:af(t)?Nl(e.items)&&!Nl(t.items)||!Nl(e.items)&&Nl(t.items)?yh.False:Nl(e.items)&&!Nl(t.items)||e.items.every((e,n)=>Ip(e,t.items[n])===yh.True)?yh.True:yh.False:yh.False}function Np(e,t){return ip(t)?op(e,t):Zd(t)?wp(e,t):ef(t)?Sp(e,t):df(t)?function(e){return sf(e)||sf(e)?yh.True:yh.False}(e):sf(t)?yh.True:yh.False}function kp(e,t){return t.anyOf.some(t=>Ip(e,t)===yh.True)?yh.True:yh.False}function Tp(e,t){return yh.True}function Cp(e,t){return Vd(t)?lp():zd(t)?up(e,t):cf(t)?kp(e,t):Id(t)?ap():nf(t)?_p(e):Jd(t)?fp(e):Fd(t)?cp(e):Rd(t)?sp(e):Bd(t)?function(e){return lf(e)?yh.False:Id(e)?yh.Union:Vd(e)?yh.True:yh.False}(e):af(t)?function(e){return Vd(e)?yh.True:lf(e)?yh.False:Id(e)?yh.Union:yh.False}(e):Zd(t)?wp(e,t):lf(t)?yh.True:yh.False}function Ip(e,t){return of(e)||of(t)?function(e,t){return of(e)?Ip(oh(e),t):of(t)?Ip(e,oh(t)):rp("Invalid fallthrough for TemplateLiteral")}(e,t):tf(e)||tf(t)?function(e,t){return Ip(tf(e)?Zf():e,tf(t)?Zf():t)}(e,t):Gd(e)||Gd(t)?function(e,t){return Gd(e)?Ip(dp(e),t):Gd(t)?Ip(e,dp(t)):rp("Invalid fallthrough for Not")}(e,t):Id(e)?function(e,t){return zd(t)?up(e,t):cf(t)&&t.anyOf.some(e=>Id(e)||lf(e))?yh.True:cf(t)?yh.Union:lf(t)||Id(t)?yh.True:yh.Union}(e,t):Bd(e)?function(e,t){return Zd(t)&&vp(t)?yh.True:ip(t)?op(e,t):Bd(t)?np(Ip(e.items,t.items)):yh.False}(e,t):Md(e)?function(e,t){return ip(t)?op(e,t):Zd(t)?wp(e,t):ef(t)?Sp(e,t):Md(t)?yh.True:yh.False}(e,t):Rd(e)?function(e,t){return ip(t)?op(e,t):Zd(t)?wp(e,t):ef(t)?Sp(e,t):Rd(t)?yh.True:yh.False}(e,t):Ld(e)?function(e,t){return ip(t)?op(e,t):Ld(t)?np(Ip(e.items,t.items)):yh.False}(e,t):Pd(e)?function(e,t){return ip(t)?op(e,t):Zd(t)?wp(e,t):Pd(t)?e.parameters.length>t.parameters.length?yh.False:e.parameters.every((e,n)=>np(Ip(t.parameters[n],e))===yh.True)?np(Ip(e.returns,t.returns)):yh.False:yh.False}(e,t):Ud(e)?function(e,t){return ip(t)?op(e,t):Zd(t)?wp(e,t):ef(t)?Sp(e,t):Ud(t)?yh.True:yh.False}(e,t):jd(e)?function(e,t){return ip(t)?op(e,t):Zd(t)?wp(e,t):jd(t)?e.parameters.length>t.parameters.length?yh.False:e.parameters.every((e,n)=>np(Ip(t.parameters[n],e))===yh.True)?np(Ip(e.returns,t.returns)):yh.False:yh.False}(e,t):Fd(e)?function(e,t){return Fd(t)||Jd(t)?yh.True:ip(t)?op(e,t):Zd(t)?wp(e,t):ef(t)?Sp(e,t):yh.False}(e,t):zd(e)?function(e,t){return e.allOf.some(e=>Ip(e,t)===yh.True)?yh.True:yh.False}(e,t):$d(e)?function(e,t){return ip(t)?op(e,t):$d(t)?np(Ip(e.items,t.items)):yh.False}(e,t):Hd(e)?function(e,t){return Hd(t)&&t.const===e.const?yh.True:ip(t)?op(e,t):Zd(t)?wp(e,t):ef(t)?Sp(e,t):nf(t)?_p(e):Jd(t)?fp(e):Fd(t)?cp(e):Rd(t)?sp(e):yh.False}(e,t):Vd(e)?yh.True:Yd(e)?function(e,t){return ip(t)?op(e,t):Zd(t)?wp(e,t):ef(t)?Sp(e,t):Yd(t)?yh.True:yh.False}(e,t):Jd(e)?function(e,t){return ip(t)?op(e,t):Zd(t)?wp(e,t):ef(t)?Sp(e,t):Fd(t)||Jd(t)?yh.True:yh.False}(e,t):Zd(e)?function(e,t){return ip(t)?op(e,t):ef(t)?Sp(e,t):Zd(t)?(()=>{for(const n of Object.getOwnPropertyNames(t.properties)){if(!(n in e.properties)&&!Cd(t.properties[n]))return yh.False;if(Cd(t.properties[n]))return yh.True;if(yp(e.properties[n],t.properties[n])===yh.False)return yh.False}return yh.True})():yh.False}(e,t):ef(e)?function(e,t){return ip(t)?op(e,t):Zd(t)?wp(e,t):ef(t)?Ip(Ep(e),Ep(t)):yh.False}(e,t):nf(e)?function(e,t){return ip(t)?op(e,t):Zd(t)?wp(e,t):ef(t)?Sp(e,t):nf(t)?yh.True:yh.False}(e,t):rf(e)?function(e,t){return ip(t)?op(e,t):Zd(t)?wp(e,t):ef(t)?Sp(e,t):rf(t)?yh.True:yh.False}(e,t):af(e)?Op(e,t):Qd(e)?xp(e,t):uf(e)?function(e,t){return ip(t)?op(e,t):Zd(t)?wp(e,t):ef(t)?Sp(e,t):uf(t)?yh.True:yh.False}(e,t):sf(e)?Np(e,t):cf(e)?function(e,t){return e.anyOf.every(e=>Ip(e,t)===yh.True)?yh.True:yh.False}(e,t):lf(e)?Cp(e,t):df(e)?function(e,t){return zd(t)?up(e,t):cf(t)?kp(e,t):lf(t)?Tp():Id(t)?ap():Zd(t)?wp(e,t):df(t)?yh.True:yh.False}(e,t):rp(`Unknown left type operand '${e[Fl]}'`)}function Bp(e,t){return Ip(e,t)}function Lp(e,t,n,r,i){return function(e,t,n,r,i){const o={};for(const a of globalThis.Object.getOwnPropertyNames(e))o[a]=Mp(e[a],t,n,r,Tl(i));return o}(e.properties,t,n,r,i)}function Mp(e,t,n,r,i){return id(e)?function(e,t,n,r,i){return _f(Lp(e,t,n,r,i))}(e,t,n,r,i):rd(e)?Ll(function(e,t,n,r,i){const o=function(e,t,n,r,i){return function(e,t,n,r,i){return e.reduce((e,o)=>({...e,...Rp(o,t,n,r,i)}),{})}(e.keys,t,n,r,i)}(e,t,n,r,i);return _f(o)}(e,t,n,r,i)):Ll(function(e,t,n,r){const i=Bp(e,t);return i===yh.Union?Bf([n,r]):i===yh.True?n:r}(e,t,n,r),i)}function Rp(e,t,n,r,i){return{[e]:Mp(Vf(e),t,n,r,Tl(i))}}function Pp(e,t,n={}){return bd(e)?Ll(function(e,t){return Pp(oh(e),t)}(e,t),n):id(e)?Ll(function(e,t){const n=function(e,t){return function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(e))n[r]=Pp(e[r],t);return n}(e.properties,t)}(e,t);return _f(n)}(e,t),n):Ll(yd(e)?function(e,t){const n=e.filter(e=>Bp(e,t)===yh.False);return 1===n.length?n[0]:Bf(n)}(e.anyOf,t):Bp(e,t)!==yh.False?Sf():e,n)}function Up(e,t,n){return bd(e)?Ll(function(e,t){return Up(oh(e),t)}(e,t),n):id(e)?Ll(function(e,t){const n=function(e,t){return function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(e))n[r]=Up(e[r],t);return n}(e.properties,t)}(e,t);return _f(n)}(e,t),n):Ll(yd(e)?function(e,t){const n=e.filter(e=>Bp(e,t)!==yh.False);return 1===n.length?n[0]:Bf(n)}(e.anyOf,t):Bp(e,t)!==yh.False?e:Sf(),n)}function jp(e){return Eh(Ih(e))}function Fp(e,t,n){return Ll({[Fl]:"Record",type:"object",patternProperties:{[e]:t}},n)}function Dp(e,t,n){const r={};for(const n of e)r[n]=t;return wh(r,{...n,[jl]:"Record"})}function zp(e,t,n){return function(e){return $f(Df(e.pattern))}(e)?Dp(ch(e),t,n):Fp(e.pattern,t,n)}function $p(e,t,n={}){return yd(e)?function(e,t,n){return Dp(ch(Bf(e)),t,n)}(e.anyOf,t,n):bd(e)?zp(e,t,n):nd(e)?function(e,t,n){return Dp([e.toString()],t,n)}(e.const,t,n):Hl(e)?function(e,t,n){return wh({true:t,false:t},n)}(0,t,n):Jl(e)?function(e,t,n){return Fp(bf,t,n)}(0,t,n):sd(e)?function(e,t,n){return Fp(bf,t,n)}(0,t,n):fd(e)?function(e,t,n){return Fp(e.source,t,n)}(e,t,n):hd(e)?function(e,t,n){return Fp(Nl(e.pattern)?mf:e.pattern,t,n)}(e,t,n):$l(e)?function(e,t,n){return Fp(mf,t,n)}(0,t,n):od(e)?function(e,t,n){return Fp("^(?!.*)$",t,n)}(0,t,n):Sf(n)}function Wp(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function qp(e){return e.patternProperties[Wp(e)]}function Xp(e,t){const n=function(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((n,r)=>({...n,[r]:Hp(e,t[r])}),{})}(e,t.properties);return{...t,...wh(n)}}function Kp(e,t){const n=Gp(e,function(e){const t=Wp(e);return t===mf?Zf():t===bf?Jf():Zf({pattern:t})}(t)),r=$p(n,Gp(e,qp(t)));return{...t,...r}}function Hp(e,t){const n=Dl(t),r=zl(t),i=Gp(e,t);return n&&r?jp(i):n&&!r?Eh(i):!n&&r?Ih(i):i}function Vp(e,t){return t.map(t=>Gp(e,t))}function Gp(e,t){return Gl(t)||Yl(t)?function(e,t){return t.parameters=Vp(e,t.parameters),t.returns=Gp(e,t.returns),t}(e,t):Zl(t)?function(e,t){return t.allOf=Vp(e,t.allOf),t}(e,t):yd(t)?function(e,t){return t.anyOf=Vp(e,t.anyOf),t}(e,t):gd(t)?function(e,t){return Nl(t.items)||(t.items=Vp(e,t.items)),t}(e,t):ql(t)||Xl(t)||Ql(t)?function(e,t){return t.items=Gp(e,t.items),t}(e,t):ud(t)?function(e,t){return t.item=Gp(e,t.item),t}(e,t):cd(t)?Xp(e,t):ld(t)?Kp(e,t):Wl(t)?function(e,t){return t.index in e?e[t.index]:Zh()}(e,t):t}function Yp(e,t,n){return{[e]:eb(Vf(e),t,Tl(n))}}function Jp(e,t,n){return function(e,t,n){return e.reduce((e,r)=>({...e,...Yp(r,t,n)}),{})}(e.keys,t,n)}function Zp(e,t){return"string"==typeof e?"Uncapitalize"===t?function(e){const[t,n]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),n].join("")}(e):"Capitalize"===t?function(e){const[t,n]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),n].join("")}(e):"Uppercase"===t?function(e){return e.toUpperCase()}(e):"Lowercase"===t?function(e){return e.toLowerCase()}(e):e:e.toString()}function Qp(e,t){return e.map(e=>eb(e,t))}function eb(e,t,n={}){return rd(e)?function(e,t,n){return _f(Jp(e,t,n))}(e,t,n):bd(e)?function(e,t,n){const r=Df(e.pattern);return $f(r)?ah([Bf(Qp([...Kf(r)].map(e=>Vf(e)),t))],n):{...e,pattern:Zp(e.pattern,t)}}(e,t,n):yd(e)?Bf(Qp(e.anyOf,t),n):nd(e)?Vf(Zp(e.const,t),n):Ll(e,n)}function tb(e,t,n){return function(e,t,n){const r={};for(const i of globalThis.Object.getOwnPropertyNames(e))r[i]=rb(e[i],t,Tl(n));return r}(e.properties,t,n)}function nb(e,t){return Zl(e)?Ph(function(e,t){return e.map(e=>nb(e,t))}(e.allOf,t)):yd(e)?Bf(function(e,t){return e.map(e=>nb(e,t))}(e.anyOf,t)):cd(e)?function(e,t,n){const r=Ef(e,[Rl,"$id","required","properties"]),i=function(e,t){return t.reduce((e,t)=>function(e,t){const{[t]:n,...r}=e;return r}(e,t),e)}(n,t);return wh(i,r)}(e,t,e.properties):wh({})}function rb(e,t,n){const r=vl(t)?function(e){const t=e.reduce((e,t)=>td(t)?[...e,Vf(t)]:e,[]);return Bf(t)}(t):t,i=wd(t)?ch(t):t,o=dd(e),a=dd(t);return id(e)?function(e,t,n){return _f(tb(e,t,n))}(e,i,n):rd(t)?function(e,t,n){const r=function(e,t,n){return function(e,t,n){return t.reduce((t,r)=>({...t,...ib(e,r,n)}),{})}(e,t.keys,n)}(e,t,n);return _f(r)}(e,t,n):o&&a||!o&&a||o&&!a?Af("Omit",[e,r],n):Ll({...nb(e,i),...n})}function ib(e,t,n){return{[t]:rb(e,[t],Tl(n))}}function ob(e,t,n){return function(e,t,n){const r={};for(const i of globalThis.Object.getOwnPropertyNames(e))r[i]=sb(e[i],t,Tl(n));return r}(e.properties,t,n)}function ab(e,t){return Zl(e)?Ph(function(e,t){return e.map(e=>ab(e,t))}(e.allOf,t)):yd(e)?Bf(function(e,t){return e.map(e=>ab(e,t))}(e.anyOf,t)):cd(e)?function(e,t,n){const r=Ef(e,[Rl,"$id","required","properties"]),i=function(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}(n,t);return wh(i,r)}(e,t,e.properties):wh({})}function sb(e,t,n){const r=vl(t)?function(e){const t=e.reduce((e,t)=>td(t)?[...e,Vf(t)]:e,[]);return Bf(t)}(t):t,i=wd(t)?ch(t):t,o=dd(e),a=dd(t);return id(e)?function(e,t,n){return _f(ob(e,t,n))}(e,i,n):rd(t)?function(e,t,n){const r=function(e,t,n){return function(e,t,n){return t.reduce((t,r)=>({...t,...cb(e,r,n)}),{})}(e,t.keys,n)}(e,t,n);return _f(r)}(e,t,n):o&&a||!o&&a||o&&!a?Af("Pick",[e,r],n):Ll({...ab(e,i),...n})}function cb(e,t,n){return{[t]:sb(e,[t],Tl(n))}}function ub(e,t){const n=Ef(e,[Rl,"$id","required","properties"]),r=function(e){const t={};for(const n of globalThis.Object.getOwnPropertyNames(e))t[n]=Ih(e[n]);return t}(t);return wh(r,n)}function lb(e){return e.map(e=>db(e))}function db(e){return Vl(e)?(t=e.target,n=e.parameters,Af("Partial",[Af(t,n)])):dd(e)?Af("Partial",[Uh(e.$ref)]):Zl(e)?Ph(lb(e.allOf)):yd(e)?Bf(lb(e.anyOf)):cd(e)?ub(e,e.properties):Kl(e)||Hl(e)||Jl(e)||nd(e)||ad(e)||sd(e)||hd(e)||pd(e)||vd(e)?e:wh({});var t,n}function fb(e,t){return id(e)?function(e,t){const n=function(e,t){return function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(e))n[r]=fb(e[r],Tl(t));return n}(e.properties,t)}(e,t);return _f(n)}(e,t):Ll({...db(e),...t})}function hb(e,t){const n=Ef(e,[Rl,"$id","required","properties"]),r=function(e){const t={};for(const n of globalThis.Object.getOwnPropertyNames(e))t[n]=Ef(e[n],[Ul]);return t}(t);return wh(r,n)}function pb(e){return e.map(e=>bb(e))}function bb(e){return Vl(e)?(t=e.target,n=e.parameters,Af("Required",[Af(t,n)])):dd(e)?Af("Required",[Uh(e.$ref)]):Zl(e)?Ph(pb(e.allOf)):yd(e)?Bf(pb(e.anyOf)):cd(e)?hb(e,e.properties):Kl(e)||Hl(e)||Jl(e)||nd(e)||ad(e)||sd(e)||hd(e)||pd(e)||vd(e)?e:wh({});var t,n}function mb(e,t){return id(e)?function(e,t){const n=function(e,t){return function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(e))n[r]=mb(e[r],t);return n}(e.properties,t)}(e,t);return _f(n)}(e,t):Ll({...bb(e),...t})}function gb(e,t){return t in e?dd(e[t])?gb(e,e[t].$ref):wb(e,e[t]):Sf()}function vb(e,t,n){const r=function(e,t){return t.map(t=>dd(t)?gb(e,t.$ref):wb(e,t))}(e,n);return"Awaited"===t?function(e){return Fh(e[0])}(r):"Index"===t?function(e){return mh(e[0],e[1])}(r):"KeyOf"===t?function(e){return Wh(e[0])}(r):"Partial"===t?function(e){return fb(e[0])}(r):"Omit"===t?function(e){return rb(e[0],e[1])}(r):"Pick"===t?function(e){return sb(e[0],e[1])}(r):"Required"===t?function(e){return mb(e[0])}(r):Sf()}function yb(e,t){return t.map(t=>wb(e,t))}function wb(e,t){return zl(t)?Ll(wb(e,Ef(t,[Ul])),t):Dl(t)?Ll(wb(e,Ef(t,[Pl])),t):md(t)?Ll(function(e,t){return dd(t)?{...gb(e,t.$ref),[Rl]:t[Rl]}:t}(e,t),t):ql(t)?Ll(function(e,t){return wf(wb(e,t))}(e,t.items),t):Xl(t)?Ll(function(e,t){return xf(wb(e,t))}(e,t.items),t):Vl(t)?Ll(vb(e,t.target,t.parameters)):Gl(t)?Ll(function(e,t,n){return Of(yb(e,t),wb(e,n))}(e,t.parameters,t.returns),t):Yl(t)?Ll(function(e,t,n){return Nf(yb(e,t),wb(e,n))}(e,t.parameters,t.returns),t):Zl(t)?Ll(function(e,t){return Ph(yb(e,t))}(e,t.allOf),t):Ql(t)?Ll(function(e,t){return vh(wb(e,t))}(e,t.items),t):cd(t)?Ll(function(e,t){return wh(globalThis.Object.keys(t).reduce((n,r)=>({...n,[r]:wb(e,t[r])}),{}))}(e,t.properties),t):ld(t)?Ll(function(e,t){const[n,r]=[wb(e,qp(t)),Wp(t)],i=Cl(t);return i.patternProperties[r]=n,i}(e,t)):gd(t)?Ll(function(e,t){return Sh(yb(e,t))}(e,t.items||[]),t):yd(t)?Ll(function(e,t){return Bf(yb(e,t))}(e,t.anyOf),t):t}function xb(e,t){return t in e?wb(e,e[t]):Sf()}!function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"}(yh||(yh={}));class Ab{constructor(e){const t=(n=e,globalThis.Object.getOwnPropertyNames(n).reduce((e,t)=>({...e,[t]:xb(n,t)}),{}));var n;const r=this.WithIdentifiers(t);this.$defs=r}Import(e,t){const n={...this.$defs,[e]:Ll(this.$defs[e],t)};return Ll({[Fl]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:{...e[n],$id:n}}),{})}}let Eb=0;function Sb(e){return function(e){return Zl(e)?e.allOf:yd(e)?e.anyOf:gd(e)?e.items??[]:[]}(e)}class _b{constructor(e){this.schema=e}Decode(e){return new Ob(this.schema,e)}}class Ob{constructor(e,t){this.schema=e,this.decode=t}EncodeTransform(e,t){const n={Encode:n=>t[Rl].Encode(e(n)),Decode:e=>this.decode(t[Rl].Decode(e))};return{...t,[Rl]:n}}EncodeSchema(e,t){const n={Decode:this.decode,Encode:e};return{...t,[Rl]:n}}Encode(e){return md(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}}class Nb{ReadonlyOptional(e){return jp(e)}Readonly(e,t){return Eh(e,t??!0)}Optional(e,t){return Ih(e,t??!0)}Any(e){return yf(e)}Array(e,t){return wf(e,t)}Boolean(e){return Gf(e)}Capitalize(e,t){return function(e,t={}){return eb(e,"Capitalize",t)}(e,t)}Composite(e,t){return Kh(e,t)}Const(e,t){return function(e,t){return Ll(ep(e,!0),t)}(e,t)}Enum(e,t){return function(e,t){if(Nl(e))throw new Error("Enum undefined or empty");const n=globalThis.Object.getOwnPropertyNames(e).filter(e=>isNaN(e)).map(t=>e[t]);return Bf([...new Set(n)].map(e=>Vf(e)),{...t,[jl]:"Enum"})}(e,t)}Exclude(e,t,n){return Pp(e,t,n)}Extends(e,t,n,r,i){return Mp(e,t,n,r,i)}Extract(e,t,n){return Up(e,t,n)}Index(e,t,n){return mh(e,t,n)}Integer(e){return function(e){return Ll({[Fl]:"Integer",type:"integer"},e)}(e)}Intersect(e,t){return Ph(e,t)}KeyOf(e,t){return Wh(e,t)}Literal(e,t){return Vf(e,t)}Lowercase(e,t){return function(e,t={}){return eb(e,"Lowercase",t)}(e,t)}Mapped(e,t,n){return Th(e,t,n)}Module(e){return function(e){return new Ab(e)}(e)}Never(e){return Sf(e)}Not(e,t){return function(e,t){return Ll({[Fl]:"Not",not:e},t)}(e,t)}Null(e){return Vh(e)}Number(e){return Jf(e)}Object(e,t){return wh(e,t)}Omit(e,t,n){return rb(e,t,n)}Partial(e,t){return fb(e,t)}Pick(e,t,n){return sb(e,t,n)}Record(e,t,n){return $p(e,t,n)}Recursive(e,t){return function(e,t={}){Nl(t.$id)&&(t.$id="T"+Eb++);const n=Cl(e({[Fl]:"This",$ref:`${t.$id}`}));return n.$id=t.$id,Ll({[jl]:"Recursive",...n},t)}(e,t)}Ref(...e){return Uh(e[0],e[1])}Required(e,t){return mb(e,t)}Rest(e){return Sb(e)}String(e){return Zf(e)}TemplateLiteral(e,t){return ah(e,t)}Transform(e){return function(e){return new _b(e)}(e)}Tuple(e,t){return Sh(e,t)}Uncapitalize(e,t){return function(e,t={}){return eb(e,"Uncapitalize",t)}(e,t)}Union(e,t){return Bf(e,t)}Unknown(e){return Zh(e)}Unsafe(e){return function(e={}){return Ll({[Fl]:e[Fl]??"Unsafe"},e)}(e)}Uppercase(e,t){return function(e,t={}){return eb(e,"Uppercase",t)}(e,t)}}class kb extends Nb{Argument(e){return function(e){return Ll({[Fl]:"Argument",index:e})}(e)}AsyncIterator(e,t){return xf(e,t)}Awaited(e,t){return Fh(e,t)}BigInt(e){return Yf(e)}ConstructorParameters(e,t){return function(e,t){return Gl(e)?Sh(e.parameters,t):Sf(t)}(e,t)}Constructor(e,t,n){return Of(e,t,n)}Date(e={}){return Hh(e)}Function(e,t,n){return Nf(e,t,n)}InstanceType(e,t){return function(e,t){return Gl(e)?Ll(e.returns,t):Sf(t)}(e,t)}Instantiate(e,t){return Gp(t,Cl(e))}Iterator(e,t){return vh(e,t)}Parameters(e,t){return function(e,t){return Yl(e)?Sh(e.parameters,t):Sf()}(e,t)}Promise(e,t){return xh(e,t)}RegExp(e,t){return function(e,t){const n=_l(e)?new globalThis.RegExp(e):e;return Ll({[Fl]:"RegExp",type:"RegExp",source:n.source,flags:n.flags},t)}(e,t)}ReturnType(e,t){return function(e,t){return Yl(e)?Ll(e.returns,t):Sf(t)}(e,t)}Symbol(e){return Gh(e)}Undefined(e){return Yh(e)}Uint8Array(e){return Jh(e)}Void(e){return function(e){return Ll({[Fl]:"Void",type:"void"},e)}(e)}}const Tb=(e,t,n=[])=>{const r=Object.getOwnPropertyDescriptors(t);for(let e of n)delete r[e];Object.defineProperties(e,r)},Cb=(e,t=[e])=>{const n=Object.getPrototypeOf(e);return null===n?t:Cb(n,[...t,n])},Ib=(e,t,n=[])=>{var r;const i=null!==(r=((...e)=>{if(0===e.length)return;let t;const n=e.map(e=>Cb(e));for(;n.every(e=>e.length>0);){const e=n.map(e=>e.pop()),r=e[0];if(!e.every(e=>e===r))break;t=r}return t})(...e))&&void 0!==r?r:Object.prototype,o=Object.create(i),a=Cb(i);for(let t of e){let e=Cb(t);for(let t=e.length-1;t>=0;t--){let r=e[t];-1===a.indexOf(r)&&(Tb(o,r,["constructor",...n]),a.push(r))}}return o.constructor=t,o},Bb=e=>e.filter((t,n)=>e.indexOf(t)==n),Lb=new WeakMap,Mb=e=>Lb.get(e),Rb=(e,t)=>{var n,r;const i=Bb([...Object.getOwnPropertyNames(e),...Object.getOwnPropertyNames(t)]),o={};for(let a of i)o[a]=Bb([...null!==(n=null==e?void 0:e[a])&&void 0!==n?n:[],...null!==(r=null==t?void 0:t[a])&&void 0!==r?r:[]]);return o},Pb=(e,t)=>{var n,r,i,o;return{property:Rb(null!==(n=null==e?void 0:e.property)&&void 0!==n?n:{},null!==(r=null==t?void 0:t.property)&&void 0!==r?r:{}),method:Rb(null!==(i=null==e?void 0:e.method)&&void 0!==i?i:{},null!==(o=null==t?void 0:t.method)&&void 0!==o?o:{})}},Ub=new Map,jb=(...e)=>{const t=((...e)=>{var t;const n=new Set,r=new Set([...e]);for(;r.size>0;)for(let e of r){const i=[...Cb(e.prototype).map(e=>e.constructor),...null!==(t=Mb(e))&&void 0!==t?t:[]].filter(e=>!n.has(e));for(let e of i)r.add(e);n.add(e),r.delete(e)}return[...n]})(...e).map(e=>Ub.get(e)).filter(e=>!!e);return 0==t.length?{}:1==t.length?t[0]:t.reduce((e,t)=>((e,t)=>{var n,r,i,o,a,s;return{class:Bb([...null!==(n=null==e?void 0:e.class)&&void 0!==n?n:[],...null!==(r=null==t?void 0:t.class)&&void 0!==r?r:[]]),static:Pb(null!==(i=null==e?void 0:e.static)&&void 0!==i?i:{},null!==(o=null==t?void 0:t.static)&&void 0!==o?o:{}),instance:Pb(null!==(a=null==e?void 0:e.instance)&&void 0!==a?a:{},null!==(s=null==t?void 0:t.instance)&&void 0!==s?s:{})}})(e,t))};function Fb(...e){var t,n,r;const i=e.map(e=>e.prototype);function o(...t){for(const n of e)Tb(this,new n(...t))}o.prototype=Ib(i,o),Object.setPrototypeOf(o,Ib(e,null,["prototype"]));let a=o;{const i=jb(...e);for(let e of null!==(t=null==i?void 0:i.class)&&void 0!==t?t:[]){const t=e(a);t&&(a=t)}Db(null!==(n=null==i?void 0:i.static)&&void 0!==n?n:{},a),Db(null!==(r=null==i?void 0:i.instance)&&void 0!==r?r:{},a.prototype)}var s,c;return s=a,c=e,Lb.set(s,c),a}const Db=(e,t)=>{const n=e.property,r=e.method;if(n)for(let e in n)for(let r of n[e])r(t,e);if(r)for(let e in r)for(let n of r[e])n(t,e,Object.getOwnPropertyDescriptor(t,e))};vf("ArrayBuffer",(e,t)=>t instanceof ArrayBuffer);class zb extends kb{ArrayBuffer(e){return Ll({[Fl]:"ArrayBuffer",type:"ArrayBuffer"},e)}}vf("Buffer",(e,t)=>t instanceof Buffer);class $b extends kb{Buffer(e){return Ll({[Fl]:"Buffer",type:"Buffer"},e)}}class Wb extends kb{KeyOfEnum(e,t){const n=Object.keys(e).map(e=>this.Literal(e));return this.Union(n,{...t,[jl]:"KeyOfEnum"})}Enum(e,t){const n=Object.entries(e).filter(([e,t])=>"string"==typeof e||!isNaN(e)).map(([e,t])=>this.Literal(t,{$id:e}));return this.Union(n,{...t,[jl]:"Enum"})}}vf("Uint",(e,t)=>("string"==typeof t||"number"==typeof t)&&!("number"==typeof t&&!Number.isSafeInteger(t)||!/^(?:[1-9]\d*|\d)$/.test(t.toString().replace(/^-/,e.allowNegative?"":"-"))));class qb extends kb{Uint(e){return Ll({[Fl]:"Uint",type:"Uint"},e)}}class Xb extends(Fb(kb,zb,$b,Wb,qb)){}const Kb=new Xb,Hb=Kb.Object({dispose:Kb.Unsafe(),cancel:Kb.Unsafe(),on:Kb.Unsafe(),off:Kb.Unsafe(),removeAllListeners:Kb.Unsafe(),uiResponse:Kb.Unsafe(),updateConnectSettings:Kb.Unsafe()}),Vb=Kb.Object({getFeatures:Kb.Unsafe(),getDeviceState:Kb.Unsafe(),getFirmwareHash:Kb.Unsafe(),firmwareUpdate:Kb.Unsafe(),resetDevice:Kb.Unsafe(),loadDevice:Kb.Unsafe(),recoveryDevice:Kb.Unsafe(),wipeDevice:Kb.Unsafe(),backupDevice:Kb.Unsafe(),changePin:Kb.Unsafe(),changeWipeCode:Kb.Unsafe(),changeLanguage:Kb.Unsafe(),applySettings:Kb.Unsafe(),applyFlags:Kb.Unsafe(),authenticateDevice:Kb.Unsafe(),setBusy:Kb.Unsafe(),setBrightness:Kb.Unsafe(),showDeviceTutorial:Kb.Unsafe(),bleUnpair:Kb.Unsafe(),requestLogin:Kb.Unsafe(),cipherKeyValue:Kb.Unsafe(),unlockPath:Kb.Unsafe(),getOwnershipId:Kb.Unsafe(),getOwnershipProof:Kb.Unsafe(),thpGetCredentials:Kb.Unsafe(),thpRemoveCredentials:Kb.Unsafe(),telemetryGet:Kb.Unsafe(),pingDevice:Kb.Unsafe()}),Gb=Kb.Object({blockchainSubscribe:Kb.Unsafe(),blockchainUnsubscribe:Kb.Unsafe(),blockchainDisconnect:Kb.Unsafe(),blockchainSetCustomBackend:Kb.Unsafe(),blockchainGetInfo:Kb.Unsafe(),blockchainValidateEvmRpcUrl:Kb.Unsafe(),blockchainEstimateFee:Kb.Unsafe(),blockchainGetAccountBalanceHistory:Kb.Unsafe(),blockchainGetTransactions:Kb.Unsafe(),blockchainEvmRpcCall:Kb.Unsafe(),blockchainGetCurrentFiatRates:Kb.Unsafe(),blockchainGetContractInfo:Kb.Unsafe(),blockchainGetFiatRatesForTimestamps:Kb.Unsafe(),blockchainSubscribeFiatRates:Kb.Unsafe(),blockchainUnsubscribeFiatRates:Kb.Unsafe(),pushTransaction:Kb.Unsafe(),getNonce:Kb.Unsafe()}),Yb=Kb.Object({getAddress:Kb.Unsafe(),getPublicKey:Kb.Unsafe(),getAccountInfo:Kb.Unsafe(),getAccountDescriptor:Kb.Unsafe(),discoverAccounts:Kb.Unsafe(),signMessage:Kb.Unsafe(),verifyMessage:Kb.Unsafe(),getSettings:Kb.Unsafe(),getCoinInfo:Kb.Unsafe()}),Jb=Kb.Object({signTransaction:Kb.Unsafe(),composeTransaction:Kb.Unsafe(),authorizeCoinjoin:Kb.Unsafe(),cancelCoinjoinAuthorization:Kb.Unsafe()}),Zb=Kb.Object({ethereumGetAddress:Kb.Unsafe(),ethereumGetPublicKey:Kb.Unsafe(),ethereumSignTransaction:Kb.Unsafe(),ethereumSignMessage:Kb.Unsafe(),ethereumSignTypedData:Kb.Unsafe(),ethereumVerifyMessage:Kb.Unsafe()}),Qb=Kb.Object({cardanoGetAddress:Kb.Unsafe(),cardanoGetPublicKey:Kb.Unsafe(),cardanoGetNativeScriptHash:Kb.Unsafe(),cardanoSignTransaction:Kb.Unsafe(),cardanoSignMessage:Kb.Unsafe(),cardanoComposeTransaction:Kb.Unsafe()}),em=Kb.Object({moneroGetAddress:Kb.Unsafe(),moneroGetWatchKey:Kb.Unsafe(),moneroKeyImageSync:Kb.Unsafe(),moneroSignTransaction:Kb.Unsafe()}),tm=Kb.Object({rippleGetAddress:Kb.Unsafe(),rippleSignTransaction:Kb.Unsafe()}),nm=Kb.Object({solanaGetAddress:Kb.Unsafe(),solanaGetPublicKey:Kb.Unsafe(),solanaSignTransaction:Kb.Unsafe(),solanaComposeTransaction:Kb.Unsafe()}),rm=Kb.Object({stellarGetAddress:Kb.Unsafe(),stellarSignTransaction:Kb.Unsafe()}),im=Kb.Object({tezosGetAddress:Kb.Unsafe(),tezosGetPublicKey:Kb.Unsafe(),tezosSignTransaction:Kb.Unsafe()}),om=Kb.Object({tronGetAddress:Kb.Unsafe(),tronSignTransaction:Kb.Unsafe(),tronComposeTransaction:Kb.Unsafe()}),am=Kb.Object({evoluGetNode:Kb.Unsafe(),evoluSignRegistrationRequest:Kb.Unsafe(),evoluGetDelegatedIdentityKey:Kb.Unsafe()});var sm;Kb.Composite([Hb,Vb,Gb,Yb,Jb,Zb,Qb,em,tm,nm,rm,im,om,am]),function(e){e.T1B1="T1B1",e.T2T1="T2T1",e.T2B1="T2B1",e.T3B1="T3B1",e.T3T1="T3T1",e.T3W1="T3W1",e.UNKNOWN="UNKNOWN"}(sm||(sm={})),Kb.Object({blockTime:Kb.Number(),minFee:Kb.Number(),maxFee:Kb.Number(),minPriorityFee:Kb.Number(),dustLimit:Kb.Number()});const cm=Kb.Object({label:Kb.Union([Kb.Literal("high"),Kb.Literal("normal"),Kb.Literal("economy"),Kb.Literal("low"),Kb.Literal("custom")]),blocks:Kb.Number(),feePerUnit:Kb.String(),feePerTx:Kb.Optional(Kb.String()),feeLimit:Kb.Optional(Kb.String()),baseFeePerGas:Kb.Optional(Kb.String()),maxFeePerGas:Kb.Optional(Kb.String()),maxPriorityFeePerGas:Kb.Optional(Kb.String())});Kb.Union([Kb.Object({name:Kb.String(),fee:Kb.Literal("0"),feePerByte:Kb.Optional(Kb.Undefined()),blocks:Kb.Optional(Kb.Undefined()),disabled:Kb.Literal(!0)}),Kb.Object({name:Kb.String(),fee:Kb.String(),feePerByte:Kb.String(),blocks:Kb.Number(),minutes:Kb.Number(),total:Kb.String()})]);const um=Kb.Object({public:Kb.Number(),private:Kb.Number()}),lm=Kb.Object({messagePrefix:Kb.String(),bech32:Kb.String(),bip32:um,pubKeyHash:Kb.Number(),scriptHash:Kb.Number(),wif:Kb.Number(),forkId:Kb.Optional(Kb.Number())});Kb.Object({coin:Kb.String(),identity:Kb.Optional(Kb.String())});const dm=Kb.Record(Kb.KeyOfEnum(sm),Kb.Union([Kb.String(),Kb.Literal(!1)])),fm=Kb.Object({type:Kb.String(),url:Kb.Array(Kb.String())}),hm=Kb.Object({label:Kb.String(),name:Kb.String(),shortcut:Kb.String(),slip44:Kb.Number(),support:dm,decimals:Kb.Number(),blockchainLink:Kb.Optional(fm),blockTime:Kb.Number(),minFee:Kb.Number(),maxFee:Kb.Number(),minPriorityFee:Kb.Number(),defaultFees:Kb.Array(cm)}),pm=Kb.Intersect([hm,Kb.Object({type:Kb.Literal("bitcoin"),cashAddrPrefix:Kb.Optional(Kb.String()),curveName:Kb.String(),dustLimit:Kb.Number(),forceBip143:Kb.Boolean(),hashGenesisBlock:Kb.String(),maxAddressLength:Kb.Number(),maxFeeSatoshiKb:Kb.Number(),minAddressLength:Kb.Number(),minFeeSatoshiKb:Kb.Number(),segwit:Kb.Boolean(),xPubMagic:Kb.Number(),xPubMagicSegwitNative:Kb.Optional(Kb.Number()),xPubMagicSegwit:Kb.Optional(Kb.Number()),taproot:Kb.Optional(Kb.Boolean()),network:lm,isBitcoin:Kb.Boolean()})]),bm=Kb.Intersect([hm,Kb.Object({type:Kb.Literal("ethereum"),chainId:Kb.Number(),network:Kb.Optional(Kb.Undefined())})]);Kb.Omit(bm,["minFee","maxFee","defaultFees","minPriorityFee","blockTime"]);const mm=Kb.Intersect([hm,Kb.Object({type:Kb.Literal("misc"),curve:Kb.String(),network:Kb.Optional(Kb.Undefined())})]);Kb.Union([pm,bm,mm]);const gm=Kb.Union([Kb.String(),Kb.Array(Kb.Number())],{description:"Derivation Path (BIP32).",$id:"DerivationPath"});Kb.Object({path:gm,address:Kb.Optional(Kb.String()),showOnTrezor:Kb.Optional(Kb.Boolean({default:!0})),chunkify:Kb.Optional(Kb.Boolean())});const vm=Kb.Object({path:gm,showOnTrezor:Kb.Optional(Kb.Boolean()),suppressBackupWarning:Kb.Optional(Kb.Boolean()),chunkify:Kb.Optional(Kb.Boolean())}),ym=Kb.Object({publicKey:Kb.String(),path:Kb.Array(Kb.Number()),serializedPath:Kb.String()});var wm;Kb.Object({appName:Kb.String(),appIcon:Kb.Optional(Kb.String()),appUrl:Kb.String(),email:Kb.String()}),function(e){e[e.ButtonRequest_Other=1]="ButtonRequest_Other",e[e.ButtonRequest_FeeOverThreshold=2]="ButtonRequest_FeeOverThreshold",e[e.ButtonRequest_ConfirmOutput=3]="ButtonRequest_ConfirmOutput",e[e.ButtonRequest_ResetDevice=4]="ButtonRequest_ResetDevice",e[e.ButtonRequest_ConfirmWord=5]="ButtonRequest_ConfirmWord",e[e.ButtonRequest_WipeDevice=6]="ButtonRequest_WipeDevice",e[e.ButtonRequest_ProtectCall=7]="ButtonRequest_ProtectCall",e[e.ButtonRequest_SignTx=8]="ButtonRequest_SignTx",e[e.ButtonRequest_FirmwareCheck=9]="ButtonRequest_FirmwareCheck",e[e.ButtonRequest_Address=10]="ButtonRequest_Address",e[e.ButtonRequest_PublicKey=11]="ButtonRequest_PublicKey",e[e.ButtonRequest_MnemonicWordCount=12]="ButtonRequest_MnemonicWordCount",e[e.ButtonRequest_MnemonicInput=13]="ButtonRequest_MnemonicInput",e[e._Deprecated_ButtonRequest_PassphraseType=14]="_Deprecated_ButtonRequest_PassphraseType",e[e.ButtonRequest_UnknownDerivationPath=15]="ButtonRequest_UnknownDerivationPath",e[e.ButtonRequest_RecoveryHomepage=16]="ButtonRequest_RecoveryHomepage",e[e.ButtonRequest_Success=17]="ButtonRequest_Success",e[e.ButtonRequest_Warning=18]="ButtonRequest_Warning",e[e.ButtonRequest_PassphraseEntry=19]="ButtonRequest_PassphraseEntry",e[e.ButtonRequest_PinEntry=20]="ButtonRequest_PinEntry"}(wm||(wm={})),Kb.Enum(wm);const xm=Kb.KeyOfEnum(wm,{$id:"ButtonRequestType"});var Am;!function(e){e[e.Failure_UnexpectedMessage=1]="Failure_UnexpectedMessage",e[e.Failure_ButtonExpected=2]="Failure_ButtonExpected",e[e.Failure_DataError=3]="Failure_DataError",e[e.Failure_ActionCancelled=4]="Failure_ActionCancelled",e[e.Failure_PinExpected=5]="Failure_PinExpected",e[e.Failure_PinCancelled=6]="Failure_PinCancelled",e[e.Failure_PinInvalid=7]="Failure_PinInvalid",e[e.Failure_InvalidSignature=8]="Failure_InvalidSignature",e[e.Failure_ProcessError=9]="Failure_ProcessError",e[e.Failure_NotEnoughFunds=10]="Failure_NotEnoughFunds",e[e.Failure_NotInitialized=11]="Failure_NotInitialized",e[e.Failure_PinMismatch=12]="Failure_PinMismatch",e[e.Failure_WipeCodeMismatch=13]="Failure_WipeCodeMismatch",e[e.Failure_InvalidSession=14]="Failure_InvalidSession",e[e.Failure_Busy=15]="Failure_Busy",e[e.Failure_ThpUnallocatedSession=16]="Failure_ThpUnallocatedSession",e[e.Failure_InvalidProtocol=17]="Failure_InvalidProtocol",e[e.Failure_InProgress=19]="Failure_InProgress",e[e.Failure_FirmwareError=99]="Failure_FirmwareError"}(Am||(Am={})),Kb.Enum(Am);const Em=Kb.KeyOfEnum(Am,{$id:"FailureType"});var Sm;!function(e){e[e.PinMatrixRequestType_Current=1]="PinMatrixRequestType_Current",e[e.PinMatrixRequestType_NewFirst=2]="PinMatrixRequestType_NewFirst",e[e.PinMatrixRequestType_NewSecond=3]="PinMatrixRequestType_NewSecond",e[e.PinMatrixRequestType_WipeCodeFirst=4]="PinMatrixRequestType_WipeCodeFirst",e[e.PinMatrixRequestType_WipeCodeSecond=5]="PinMatrixRequestType_WipeCodeSecond"}(Sm||(Sm={})),Kb.Enum(Sm);const _m=Kb.KeyOfEnum(Sm,{$id:"PinMatrixRequestType"});Kb.Object({},{$id:"ButtonAck"}),Kb.Object({code:Kb.Optional(xm),pages:Kb.Optional(Kb.Number()),name:Kb.Optional(Kb.String())},{$id:"ButtonRequest"});const Om=Kb.Object({coin_type:Kb.Number(),amount:Kb.String(),address:Kb.String(),address_n:Kb.Array(Kb.Number()),mac:Kb.String()},{$id:"CoinPurchaseMemo"});Kb.Object({},{$id:"Deprecated_PassphraseStateAck"}),Kb.Object({state:Kb.Optional(Kb.String())},{$id:"Deprecated_PassphraseStateRequest"}),Kb.Object({code:Kb.Optional(Em),message:Kb.Optional(Kb.String())},{$id:"Failure"});const Nm=Kb.Object({depth:Kb.Number(),fingerprint:Kb.Number(),child_num:Kb.Number(),chain_code:Kb.String(),private_key:Kb.Optional(Kb.String()),public_key:Kb.String()},{$id:"HDNodeType"});Kb.Object({passphrase:Kb.Optional(Kb.String()),_state:Kb.Optional(Kb.String()),on_device:Kb.Optional(Kb.Boolean())},{$id:"PassphraseAck"}),Kb.Object({_on_device:Kb.Optional(Kb.Boolean())},{$id:"PassphraseRequest"});const km=Kb.Object({text:Kb.String()},{$id:"TextMemo"}),Tm=Kb.Object({address:Kb.String(),address_n:Kb.Array(Kb.Number()),mac:Kb.String()},{$id:"RefundMemo"}),Cm=Kb.Object({title:Kb.String(),text:Kb.String()},{$id:"TextDetailsMemo"}),Im=Kb.Object({text_memo:Kb.Optional(km),refund_memo:Kb.Optional(Tm),coin_purchase_memo:Kb.Optional(Om),text_details_memo:Kb.Optional(Cm)},{$id:"PaymentRequestMemo"}),Bm=Kb.Object({nonce:Kb.Optional(Kb.String()),recipient_name:Kb.String(),memos:Kb.Optional(Kb.Array(Im)),amount:Kb.Optional(Kb.String()),signature:Kb.String()},{$id:"PaymentRequest"});var Lm;Kb.Object({pin:Kb.String()},{$id:"PinMatrixAck"}),Kb.Object({type:Kb.Optional(_m)},{$id:"PinMatrixRequest"}),Kb.Object({message:Kb.String()},{$id:"Success"}),function(e){e[e.BITCOIN=0]="BITCOIN",e[e.MILLIBITCOIN=1]="MILLIBITCOIN",e[e.MICROBITCOIN=2]="MICROBITCOIN",e[e.SATOSHI=3]="SATOSHI"}(Lm||(Lm={}));const Mm=Kb.Enum(Lm);var Rm;!function(e){e[e.SSGen=0]="SSGen",e[e.SSRTX=1]="SSRTX"}(Rm||(Rm={}));const Pm=Kb.Enum(Rm);var Um;!function(e){e[e.SPENDADDRESS=0]="SPENDADDRESS",e[e.SPENDMULTISIG=1]="SPENDMULTISIG",e[e.EXTERNAL=2]="EXTERNAL",e[e.SPENDWITNESS=3]="SPENDWITNESS",e[e.SPENDP2SHWITNESS=4]="SPENDP2SHWITNESS",e[e.SPENDTAPROOT=5]="SPENDTAPROOT"}(Um||(Um={})),Kb.Enum(Um);const jm=Kb.KeyOfEnum(Um,{$id:"InputScriptType"});var Fm;!function(e){e[e.PRESERVED=0]="PRESERVED",e[e.LEXICOGRAPHIC=1]="LEXICOGRAPHIC"}(Fm||(Fm={}));const Dm=Kb.Enum(Fm);var zm;!function(e){e[e.PAYTOADDRESS=0]="PAYTOADDRESS",e[e.PAYTOSCRIPTHASH=1]="PAYTOSCRIPTHASH",e[e.PAYTOMULTISIG=2]="PAYTOMULTISIG",e[e.PAYTOOPRETURN=3]="PAYTOOPRETURN",e[e.PAYTOWITNESS=4]="PAYTOWITNESS",e[e.PAYTOP2SHWITNESS=5]="PAYTOP2SHWITNESS",e[e.PAYTOTAPROOT=6]="PAYTOTAPROOT"}(zm||(zm={})),Kb.Enum(zm);const $m=Kb.KeyOfEnum(zm,{$id:"OutputScriptType"});var Wm;!function(e){e[e.TXINPUT=0]="TXINPUT",e[e.TXOUTPUT=1]="TXOUTPUT",e[e.TXMETA=2]="TXMETA",e[e.TXFINISHED=3]="TXFINISHED",e[e.TXEXTRADATA=4]="TXEXTRADATA",e[e.TXORIGINPUT=5]="TXORIGINPUT",e[e.TXORIGOUTPUT=6]="TXORIGOUTPUT",e[e.TXPAYMENTREQ=7]="TXPAYMENTREQ"}(Wm||(Wm={})),Kb.Enum(Wm);const qm=Kb.KeyOfEnum(Wm,{$id:"RequestType"});Kb.Object({address:Kb.String(),mac:Kb.Optional(Kb.String())},{$id:"Address"}),Kb.Object({coordinator:Kb.String(),max_rounds:Kb.Number(),max_coordinator_fee_rate:Kb.Number(),max_fee_per_kvbyte:Kb.Number(),address_n:Kb.Array(Kb.Number()),coin_name:Kb.Optional(Kb.String()),script_type:Kb.Optional(jm),amount_unit:Kb.Optional(Mm)},{$id:"AuthorizeCoinJoin"});const Xm=Kb.Object({fee_rate:Kb.Number(),no_fee_threshold:Kb.Number(),min_registrable_amount:Kb.Number(),mask_public_key:Kb.Optional(Kb.String()),signature:Kb.Optional(Kb.String())},{$id:"CoinJoinRequest"}),Km=Kb.Object({node:Kb.Union([Nm,Kb.String()]),address_n:Kb.Array(Kb.Number())},{$id:"HDNodePathType"}),Hm=Kb.Object({pubkeys:Kb.Array(Km),signatures:Kb.Array(Kb.String()),m:Kb.Number(),nodes:Kb.Optional(Kb.Array(Nm)),address_n:Kb.Optional(Kb.Array(Kb.Number())),pubkeys_order:Kb.Optional(Dm)},{$id:"MultisigRedeemScriptType"});Kb.Object({address_n:Kb.Array(Kb.Number()),coin_name:Kb.Optional(Kb.String()),show_display:Kb.Optional(Kb.Boolean()),multisig:Kb.Optional(Hm),script_type:Kb.Optional(jm),ignore_xpub_magic:Kb.Optional(Kb.Boolean()),chunkify:Kb.Optional(Kb.Boolean())},{$id:"GetAddress"}),Kb.Object({address_n:Kb.Array(Kb.Number()),coin_name:Kb.Optional(Kb.String()),multisig:Kb.Optional(Hm),script_type:Kb.Optional(jm)},{$id:"GetOwnershipId"}),Kb.Object({address_n:Kb.Array(Kb.Number()),coin_name:Kb.Optional(Kb.String()),script_type:Kb.Optional(jm),multisig:Kb.Optional(Hm),user_confirmation:Kb.Optional(Kb.Boolean()),ownership_ids:Kb.Optional(Kb.Array(Kb.String())),commitment_data:Kb.Optional(Kb.String())},{$id:"GetOwnershipProof"}),Kb.Object({address_n:Kb.Array(Kb.Number()),ecdsa_curve_name:Kb.Optional(Kb.String()),show_display:Kb.Optional(Kb.Boolean()),coin_name:Kb.Optional(Kb.String()),script_type:Kb.Optional(jm),ignore_xpub_magic:Kb.Optional(Kb.Boolean())},{$id:"GetPublicKey"}),Kb.Object({address:Kb.String(),signature:Kb.String()},{$id:"MessageSignature"}),Kb.Object({ownership_id:Kb.String()},{$id:"OwnershipId"}),Kb.Object({ownership_proof:Kb.String(),signature:Kb.String()},{$id:"OwnershipProof"});const Vm=Kb.Object({prev_hash:Kb.String(),prev_index:Kb.Number(),script_sig:Kb.String(),sequence:Kb.Number(),decred_tree:Kb.Optional(Kb.Number())},{$id:"PrevInput"}),Gm=Kb.Object({amount:Kb.Uint(),script_pubkey:Kb.String(),decred_script_version:Kb.Optional(Kb.Number())},{$id:"PrevOutput"}),Ym=Kb.Object({version:Kb.Number(),lock_time:Kb.Number(),inputs_count:Kb.Number(),outputs_count:Kb.Number(),extra_data_len:Kb.Optional(Kb.Number()),expiry:Kb.Optional(Kb.Number()),version_group_id:Kb.Optional(Kb.Number()),timestamp:Kb.Optional(Kb.Number()),branch_id:Kb.Optional(Kb.Number())},{$id:"PrevTx"});Kb.Object({node:Nm,xpub:Kb.String(),root_fingerprint:Kb.Optional(Kb.Number()),descriptor:Kb.Optional(Kb.String())},{$id:"PublicKey"}),Kb.Object({address_n:Kb.Array(Kb.Number()),message:Kb.String(),coin_name:Kb.Optional(Kb.String()),script_type:Kb.Optional(jm),no_script_type:Kb.Optional(Kb.Boolean()),chunkify:Kb.Optional(Kb.Boolean())},{$id:"SignMessage"}),Kb.Object({outputs_count:Kb.Number(),inputs_count:Kb.Number(),coin_name:Kb.Optional(Kb.String()),version:Kb.Optional(Kb.Number()),lock_time:Kb.Optional(Kb.Number()),expiry:Kb.Optional(Kb.Number()),overwintered:Kb.Optional(Kb.Boolean()),version_group_id:Kb.Optional(Kb.Number()),timestamp:Kb.Optional(Kb.Number()),branch_id:Kb.Optional(Kb.Number()),amount_unit:Kb.Optional(Mm),decred_staking_ticket:Kb.Optional(Kb.Boolean()),serialize:Kb.Optional(Kb.Boolean()),coinjoin_request:Kb.Optional(Xm),chunkify:Kb.Optional(Kb.Boolean())},{$id:"SignTx"});const Jm=Kb.Exclude(jm,Kb.Literal("EXTERNAL"),{$id:"InternalInputScriptType"}),Zm=Kb.Object({prev_hash:Kb.String(),prev_index:Kb.Number(),amount:Kb.Uint(),sequence:Kb.Optional(Kb.Number()),multisig:Kb.Optional(Hm),decred_tree:Kb.Optional(Kb.Number()),orig_hash:Kb.Optional(Kb.String()),orig_index:Kb.Optional(Kb.Number()),decred_staking_spend:Kb.Optional(Pm),script_pubkey:Kb.Optional(Kb.String()),coinjoin_flags:Kb.Optional(Kb.Number()),script_sig:Kb.Optional(Kb.String()),witness:Kb.Optional(Kb.String()),ownership_proof:Kb.Optional(Kb.String()),commitment_data:Kb.Optional(Kb.String())},{$id:"CommonTxInputType"}),Qm=Kb.Union([Kb.Intersect([Zm,Kb.Object({address_n:Kb.Array(Kb.Number()),script_type:Kb.Optional(Jm)})]),Kb.Intersect([Zm,Kb.Object({address_n:Kb.Optional(Kb.Undefined()),script_type:Kb.Literal("EXTERNAL"),script_pubkey:Kb.String()})])],{$id:"TxInputType"}),eg=Cl(Qm,{$id:"TxInput"}),tg=Kb.Object({amount:Kb.Uint(),script_pubkey:Kb.String(),decred_script_version:Kb.Optional(Kb.Number())},{$id:"TxOutputBinType"}),ng=Kb.Exclude($m,Kb.Literal("PAYTOOPRETURN"),{$id:"ChangeOutputScriptType"}),rg=Kb.Union([Kb.Object({address:Kb.String(),address_n:Kb.Optional(Kb.Undefined()),script_type:Kb.Optional(Kb.Literal("PAYTOADDRESS")),amount:Kb.Uint(),multisig:Kb.Optional(Hm),orig_hash:Kb.Optional(Kb.String()),orig_index:Kb.Optional(Kb.Number()),payment_req_index:Kb.Optional(Kb.Number())}),Kb.Object({address:Kb.Optional(Kb.Undefined()),address_n:Kb.Array(Kb.Number()),script_type:Kb.Optional(ng),amount:Kb.Uint(),multisig:Kb.Optional(Hm),orig_hash:Kb.Optional(Kb.String()),orig_index:Kb.Optional(Kb.Number()),payment_req_index:Kb.Optional(Kb.Number())}),Kb.Object({address:Kb.Optional(Kb.Undefined()),address_n:Kb.Optional(Kb.Undefined()),amount:Kb.Union([Kb.Literal("0"),Kb.Literal(0)]),op_return_data:Kb.String(),script_type:Kb.Literal("PAYTOOPRETURN"),orig_hash:Kb.Optional(Kb.String()),orig_index:Kb.Optional(Kb.Number()),payment_req_index:Kb.Optional(Kb.Number())})],{$id:"TxOutputType"}),ig=Cl(rg,{$id:"TxOutput"}),og=Kb.Union([Kb.Object({inputs:Kb.Array(Kb.Union([Qm,Vm]))}),Kb.Object({bin_outputs:Kb.Array(tg)}),Kb.Object({outputs:Kb.Array(rg)}),Kb.Object({extra_data:Kb.String()}),Kb.Object({version:Kb.Optional(Kb.Number()),lock_time:Kb.Optional(Kb.Number()),inputs_cnt:Kb.Number(),outputs_cnt:Kb.Number(),extra_data:Kb.Optional(Kb.String()),extra_data_len:Kb.Optional(Kb.Number()),timestamp:Kb.Optional(Kb.Number()),version_group_id:Kb.Optional(Kb.Number()),expiry:Kb.Optional(Kb.Number()),branch_id:Kb.Optional(Kb.Number())})],{$id:"TxAckResponse"});Kb.Object({tx:og},{$id:"TxAck"});const ag=Kb.Object({input:eg},{$id:"TxAckInputWrapper"});Kb.Object({tx:ag},{$id:"TxAckInput"});const sg=Kb.Object({output:ig},{$id:"TxAckOutputWrapper"});Kb.Object({tx:sg},{$id:"TxAckOutput"});const cg=Kb.Object({extra_data_chunk:Kb.String()},{$id:"TxAckPrevExtraDataWrapper"});Kb.Object({tx:cg},{$id:"TxAckPrevExtraData"});const ug=Kb.Object({input:Vm},{$id:"TxAckPrevInputWrapper"});Kb.Object({tx:ug},{$id:"TxAckPrevInput"}),Kb.Object({tx:Ym},{$id:"TxAckPrevMeta"});const lg=Kb.Object({output:Gm},{$id:"TxAckPrevOutputWrapper"});Kb.Object({tx:lg},{$id:"TxAckPrevOutput"});const dg=Kb.Object({request_index:Kb.Number(),tx_hash:Kb.Optional(Kb.String()),extra_data_len:Kb.Optional(Kb.Number()),extra_data_offset:Kb.Optional(Kb.Number())},{$id:"TxRequestDetailsType"}),fg=Kb.Object({signature_index:Kb.Optional(Kb.Number()),signature:Kb.Optional(Kb.String()),serialized_tx:Kb.Optional(Kb.String())},{$id:"TxRequestSerializedType"});var hg;Kb.Object({request_type:qm,details:dg,serialized:Kb.Optional(fg)},{$id:"TxRequest"}),Kb.Object({address:Kb.String(),signature:Kb.String(),message:Kb.String(),coin_name:Kb.Optional(Kb.String()),chunkify:Kb.Optional(Kb.Boolean())},{$id:"VerifyMessage"}),function(e){e[e.BASE=0]="BASE",e[e.BASE_SCRIPT_KEY=1]="BASE_SCRIPT_KEY",e[e.BASE_KEY_SCRIPT=2]="BASE_KEY_SCRIPT",e[e.BASE_SCRIPT_SCRIPT=3]="BASE_SCRIPT_SCRIPT",e[e.POINTER=4]="POINTER",e[e.POINTER_SCRIPT=5]="POINTER_SCRIPT",e[e.ENTERPRISE=6]="ENTERPRISE",e[e.ENTERPRISE_SCRIPT=7]="ENTERPRISE_SCRIPT",e[e.BYRON=8]="BYRON",e[e.REWARD=14]="REWARD",e[e.REWARD_SCRIPT=15]="REWARD_SCRIPT"}(hg||(hg={}));const pg=Kb.Enum(hg);var bg;!function(e){e[e.STAKE_REGISTRATION=0]="STAKE_REGISTRATION",e[e.STAKE_DEREGISTRATION=1]="STAKE_DEREGISTRATION",e[e.STAKE_DELEGATION=2]="STAKE_DELEGATION",e[e.STAKE_POOL_REGISTRATION=3]="STAKE_POOL_REGISTRATION",e[e.STAKE_REGISTRATION_CONWAY=7]="STAKE_REGISTRATION_CONWAY",e[e.STAKE_DEREGISTRATION_CONWAY=8]="STAKE_DEREGISTRATION_CONWAY",e[e.VOTE_DELEGATION=9]="VOTE_DELEGATION"}(bg||(bg={}));const mg=Kb.Enum(bg);var gg;!function(e){e[e.CIP15=0]="CIP15",e[e.CIP36=1]="CIP36"}(gg||(gg={}));const vg=Kb.Enum(gg);var yg;!function(e){e[e.LEDGER=0]="LEDGER",e[e.ICARUS=1]="ICARUS",e[e.ICARUS_TREZOR=2]="ICARUS_TREZOR"}(yg||(yg={}));const wg=Kb.Enum(yg);var xg;!function(e){e[e.KEY_HASH=0]="KEY_HASH",e[e.SCRIPT_HASH=1]="SCRIPT_HASH",e[e.ABSTAIN=2]="ABSTAIN",e[e.NO_CONFIDENCE=3]="NO_CONFIDENCE"}(xg||(xg={}));const Ag=Kb.Enum(xg);var Eg;!function(e){e[e.HIDE=0]="HIDE",e[e.BECH32=1]="BECH32",e[e.POLICY_ID=2]="POLICY_ID"}(Eg||(Eg={}));const Sg=Kb.Enum(Eg);var _g;!function(e){e[e.PUB_KEY=0]="PUB_KEY",e[e.ALL=1]="ALL",e[e.ANY=2]="ANY",e[e.N_OF_K=3]="N_OF_K",e[e.INVALID_BEFORE=4]="INVALID_BEFORE",e[e.INVALID_HEREAFTER=5]="INVALID_HEREAFTER"}(_g||(_g={}));const Og=Kb.Enum(_g);var Ng;!function(e){e[e.SINGLE_HOST_IP=0]="SINGLE_HOST_IP",e[e.SINGLE_HOST_NAME=1]="SINGLE_HOST_NAME",e[e.MULTIPLE_HOST_NAME=2]="MULTIPLE_HOST_NAME"}(Ng||(Ng={}));const kg=Kb.Enum(Ng);var Tg;!function(e){e[e.NONE=0]="NONE",e[e.CVOTE_REGISTRATION_SIGNATURE=1]="CVOTE_REGISTRATION_SIGNATURE"}(Tg||(Tg={}));const Cg=Kb.Enum(Tg);var Ig;!function(e){e[e.ARRAY_LEGACY=0]="ARRAY_LEGACY",e[e.MAP_BABBAGE=1]="MAP_BABBAGE"}(Ig||(Ig={}));const Bg=Kb.Enum(Ig);var Lg;!function(e){e[e.ORDINARY_TRANSACTION=0]="ORDINARY_TRANSACTION",e[e.POOL_REGISTRATION_AS_OWNER=1]="POOL_REGISTRATION_AS_OWNER",e[e.MULTISIG_TRANSACTION=2]="MULTISIG_TRANSACTION",e[e.PLUTUS_TRANSACTION=3]="PLUTUS_TRANSACTION"}(Lg||(Lg={}));const Mg=Kb.Enum(Lg);var Rg;!function(e){e[e.BYRON_WITNESS=0]="BYRON_WITNESS",e[e.SHELLEY_WITNESS=1]="SHELLEY_WITNESS"}(Rg||(Rg={}));const Pg=Kb.Enum(Rg);Kb.Object({address:Kb.String(),mac:Kb.Optional(Kb.String())},{$id:"CardanoAddress"});const Ug=Kb.Object({block_index:Kb.Number(),tx_index:Kb.Number(),certificate_index:Kb.Number()},{$id:"CardanoBlockchainPointerType"}),jg=Kb.Object({address_type:pg,address_n:Kb.Array(Kb.Number()),address_n_staking:Kb.Array(Kb.Number()),staking_key_hash:Kb.Optional(Kb.String()),certificate_pointer:Kb.Optional(Ug),script_payment_hash:Kb.Optional(Kb.String()),script_staking_hash:Kb.Optional(Kb.String())},{$id:"CardanoAddressParametersType"});Kb.Object({policy_id:Kb.String(),tokens_count:Kb.Number()},{$id:"CardanoAssetGroup"});const Fg=Kb.Object({vote_public_key:Kb.String(),weight:Kb.Uint()},{$id:"CardanoCVoteRegistrationDelegation"}),Dg=Kb.Object({vote_public_key:Kb.Optional(Kb.String()),staking_path:Kb.Array(Kb.Number()),payment_address_parameters:Kb.Optional(jg),nonce:Kb.Uint(),format:Kb.Optional(vg),delegations:Kb.Optional(Kb.Array(Fg)),voting_purpose:Kb.Optional(Kb.Uint()),payment_address:Kb.Optional(Kb.String())},{$id:"CardanoCVoteRegistrationParametersType"}),zg=Kb.Object({type:Ag,key_hash:Kb.Optional(Kb.String()),script_hash:Kb.Optional(Kb.String())},{$id:"CardanoDRep"});Kb.Object({show_display:Kb.Optional(Kb.Boolean()),protocol_magic:Kb.Number(),network_id:Kb.Number(),address_parameters:jg,derivation_type:wg,chunkify:Kb.Optional(Kb.Boolean())},{$id:"CardanoGetAddress"});const $g=Kb.Recursive(e=>Kb.Object({type:Og,scripts:Kb.Optional(Kb.Array(e)),key_hash:Kb.Optional(Kb.String()),key_path:Kb.Optional(Kb.Array(Kb.Number())),required_signatures_count:Kb.Optional(Kb.Number()),invalid_before:Kb.Optional(Kb.Uint()),invalid_hereafter:Kb.Optional(Kb.Uint())}),{$id:"CardanoNativeScript"});Kb.Object({script:$g,display_format:Sg,derivation_type:wg},{$id:"CardanoGetNativeScriptHash"}),Kb.Object({address_n:Kb.Array(Kb.Number()),show_display:Kb.Optional(Kb.Boolean()),derivation_type:wg},{$id:"CardanoGetPublicKey"}),Kb.Object({length:Kb.Number(),offset:Kb.Number()},{$id:"CardanoMessageDataRequest"}),Kb.Object({data:Kb.String()},{$id:"CardanoMessageDataResponse"}),Kb.Object({signature:Kb.String(),address:Kb.String(),pub_key:Kb.String()},{$id:"CardanoMessageSignature"}),Kb.Object({script_hash:Kb.String()},{$id:"CardanoNativeScriptHash"});const Wg=Kb.Object({url:Kb.String(),hash:Kb.String()},{$id:"CardanoPoolMetadataType"});Kb.Object({staking_key_path:Kb.Optional(Kb.Array(Kb.Number())),staking_key_hash:Kb.Optional(Kb.String())},{$id:"CardanoPoolOwner"});const qg=Kb.Object({pool_id:Kb.String(),vrf_key_hash:Kb.String(),pledge:Kb.Uint(),cost:Kb.Uint(),margin_numerator:Kb.Uint(),margin_denominator:Kb.Uint(),reward_account:Kb.String(),metadata:Kb.Optional(Wg),owners_count:Kb.Number(),relays_count:Kb.Number()},{$id:"CardanoPoolParametersType"});var Xg;Kb.Object({type:kg,ipv4_address:Kb.Optional(Kb.String()),ipv6_address:Kb.Optional(Kb.String()),host_name:Kb.Optional(Kb.String()),port:Kb.Optional(Kb.Number())},{$id:"CardanoPoolRelayParameters"}),Kb.Object({xpub:Kb.String(),node:Nm},{$id:"CardanoPublicKey"}),Kb.Object({protocol_magic:Kb.Optional(Kb.Number()),network_id:Kb.Optional(Kb.Number()),signing_path:Kb.Array(Kb.Number()),payload_size:Kb.Number(),prefer_hex_display:Kb.Boolean(),address_parameters:Kb.Optional(jg),derivation_type:wg},{$id:"CardanoSignMessageInit"}),Kb.Object({},{$id:"CardanoSignTxFinished"}),Kb.Object({signing_mode:Mg,protocol_magic:Kb.Number(),network_id:Kb.Number(),inputs_count:Kb.Number(),outputs_count:Kb.Number(),fee:Kb.Uint(),ttl:Kb.Optional(Kb.Uint()),certificates_count:Kb.Number(),withdrawals_count:Kb.Number(),has_auxiliary_data:Kb.Boolean(),validity_interval_start:Kb.Optional(Kb.Uint()),witness_requests_count:Kb.Number(),minting_asset_groups_count:Kb.Number(),derivation_type:wg,include_network_id:Kb.Optional(Kb.Boolean()),script_data_hash:Kb.Optional(Kb.String()),collateral_inputs_count:Kb.Number(),required_signers_count:Kb.Number(),has_collateral_return:Kb.Optional(Kb.Boolean()),total_collateral:Kb.Optional(Kb.Uint()),reference_inputs_count:Kb.Optional(Kb.Number()),chunkify:Kb.Optional(Kb.Boolean()),tag_cbor_sets:Kb.Optional(Kb.Boolean()),payment_req:Kb.Optional(Bm)},{$id:"CardanoSignTxInit"}),Kb.Object({asset_name_bytes:Kb.String(),amount:Kb.Optional(Kb.Uint()),mint_amount:Kb.Optional(Kb.Uint({allowNegative:!0}))},{$id:"CardanoToken"}),Kb.Object({cvote_registration_parameters:Kb.Optional(Dg),hash:Kb.Optional(Kb.String())},{$id:"CardanoTxAuxiliaryData"}),Kb.Object({type:Cg,auxiliary_data_hash:Kb.Optional(Kb.String()),cvote_registration_signature:Kb.Optional(Kb.String())},{$id:"CardanoTxAuxiliaryDataSupplement"}),Kb.Object({tx_hash:Kb.String()},{$id:"CardanoTxBodyHash"}),Kb.Object({type:mg,path:Kb.Optional(Kb.Array(Kb.Number())),pool:Kb.Optional(Kb.String()),pool_parameters:Kb.Optional(qg),script_hash:Kb.Optional(Kb.String()),key_hash:Kb.Optional(Kb.String()),deposit:Kb.Optional(Kb.Uint()),drep:Kb.Optional(zg)},{$id:"CardanoTxCertificate"}),Kb.Object({prev_hash:Kb.String(),prev_index:Kb.Number()},{$id:"CardanoTxCollateralInput"}),Kb.Object({},{$id:"CardanoTxHostAck"}),Kb.Object({data:Kb.String()},{$id:"CardanoTxInlineDatumChunk"}),Kb.Object({prev_hash:Kb.String(),prev_index:Kb.Number()},{$id:"CardanoTxInput"}),Kb.Object({},{$id:"CardanoTxItemAck"}),Kb.Object({asset_groups_count:Kb.Number()},{$id:"CardanoTxMint"}),Kb.Object({address:Kb.Optional(Kb.String()),address_parameters:Kb.Optional(jg),amount:Kb.Uint(),asset_groups_count:Kb.Number(),datum_hash:Kb.Optional(Kb.String()),format:Kb.Optional(Bg),inline_datum_size:Kb.Optional(Kb.Number()),reference_script_size:Kb.Optional(Kb.Number())},{$id:"CardanoTxOutput"}),Kb.Object({prev_hash:Kb.String(),prev_index:Kb.Number()},{$id:"CardanoTxReferenceInput"}),Kb.Object({data:Kb.String()},{$id:"CardanoTxReferenceScriptChunk"}),Kb.Object({key_hash:Kb.Optional(Kb.String()),key_path:Kb.Optional(Kb.Array(Kb.Number()))},{$id:"CardanoTxRequiredSigner"}),Kb.Object({path:Kb.Optional(Kb.Array(Kb.Number())),amount:Kb.Uint(),script_hash:Kb.Optional(Kb.String()),key_hash:Kb.Optional(Kb.String())},{$id:"CardanoTxWithdrawal"}),Kb.Object({path:Kb.Array(Kb.Number())},{$id:"CardanoTxWitnessRequest"}),Kb.Object({type:Pg,pub_key:Kb.String(),signature:Kb.String(),chain_code:Kb.Optional(Kb.String())},{$id:"CardanoTxWitnessResponse"}),function(e){e[e.NotAvailable=0]="NotAvailable",e[e.Required=1]="Required",e[e.Available=2]="Available"}(Xg||(Xg={})),Kb.Enum(Xg);const Kg=Kb.KeyOfEnum(Xg,{$id:"BackupAvailability"});var Hg;!function(e){e[e.Display=0]="Display",e[e.N4W1=1]="N4W1"}(Hg||(Hg={}));const Vg=Kb.Enum(Hg);var Gg;!function(e){e[e.Bip39=0]="Bip39",e[e.Slip39_Basic=1]="Slip39_Basic",e[e.Slip39_Advanced=2]="Slip39_Advanced",e[e.Slip39_Single_Extendable=3]="Slip39_Single_Extendable",e[e.Slip39_Basic_Extendable=4]="Slip39_Basic_Extendable",e[e.Slip39_Advanced_Extendable=5]="Slip39_Advanced_Extendable"}(Gg||(Gg={}));const Yg=Kb.Enum(Gg),Jg=Kb.KeyOfEnum(Gg,{$id:"BackupType"});var Zg;!function(e){e[e.STOP_AND_WAIT=0]="STOP_AND_WAIT",e[e.INSTALL_UPGRADE=1]="INSTALL_UPGRADE"}(Zg||(Zg={}));const Qg=Kb.Enum(Zg);var ev;!function(e){e[e.Capability_Bitcoin=1]="Capability_Bitcoin",e[e.Capability_Bitcoin_like=2]="Capability_Bitcoin_like",e[e.Capability_Binance=3]="Capability_Binance",e[e.Capability_Cardano=4]="Capability_Cardano",e[e.Capability_Crypto=5]="Capability_Crypto",e[e.Capability_EOS=6]="Capability_EOS",e[e.Capability_Ethereum=7]="Capability_Ethereum",e[e.Capability_Lisk=8]="Capability_Lisk",e[e.Capability_Monero=9]="Capability_Monero",e[e.Capability_NEM=10]="Capability_NEM",e[e.Capability_Ripple=11]="Capability_Ripple",e[e.Capability_Stellar=12]="Capability_Stellar",e[e.Capability_Tezos=13]="Capability_Tezos",e[e.Capability_U2F=14]="Capability_U2F",e[e.Capability_Shamir=15]="Capability_Shamir",e[e.Capability_ShamirGroups=16]="Capability_ShamirGroups",e[e.Capability_PassphraseEntry=17]="Capability_PassphraseEntry",e[e.Capability_Solana=18]="Capability_Solana",e[e.Capability_Translations=19]="Capability_Translations",e[e.Capability_Brightness=20]="Capability_Brightness",e[e.Capability_Haptic=21]="Capability_Haptic",e[e.Capability_BLE=22]="Capability_BLE",e[e.Capability_NFC=23]="Capability_NFC",e[e.Capability_Tron=24]="Capability_Tron",e[e.Capability_N4W1=25]="Capability_N4W1"}(ev||(ev={})),Kb.Enum(ev);const tv=Kb.KeyOfEnum(ev,{$id:"Capability"});var nv;!function(e){e.T1B1="T1B1",e.T2T1="T2T1",e.T2B1="T2B1",e.T3B1="T3B1",e.T3T1="T3T1",e.T3W1="T3W1",e.UNKNOWN="UNKNOWN"}(nv||(nv={}));const rv=Kb.Enum(nv);var iv;!function(e){e[e.North=0]="North",e[e.East=90]="East",e[e.South=180]="South",e[e.West=270]="West"}(iv||(iv={}));const ov=Kb.Enum(iv),av=Kb.KeyOfEnum(iv,{$id:"DisplayRotation"});var sv;!function(e){e[e.Toif=1]="Toif",e[e.Jpeg=2]="Jpeg",e[e.ToiG=3]="ToiG"}(sv||(sv={})),Kb.Enum(sv);const cv=Kb.KeyOfEnum(sv,{$id:"HomescreenFormat"});var uv;!function(e){e[e.ScrambledWords=0]="ScrambledWords",e[e.Matrix=1]="Matrix"}(uv||(uv={}));const lv=Kb.Enum(uv);var dv;!function(e){e[e.Nothing=0]="Nothing",e[e.Recovery=1]="Recovery",e[e.Backup=2]="Backup"}(dv||(dv={})),Kb.Enum(dv);const fv=Kb.KeyOfEnum(dv,{$id:"RecoveryStatus"});var hv;!function(e){e[e.NormalRecovery=0]="NormalRecovery",e[e.DryRun=1]="DryRun",e[e.UnlockRepeatedBackup=2]="UnlockRepeatedBackup"}(hv||(hv={})),Kb.Enum(hv);const pv=Kb.KeyOfEnum(hv,{$id:"RecoveryType"});var bv;!function(e){e[e.Strict=0]="Strict",e[e.PromptAlways=1]="PromptAlways",e[e.PromptTemporarily=2]="PromptTemporarily"}(bv||(bv={})),Kb.Enum(bv);const mv=Kb.KeyOfEnum(bv,{$id:"SafetyCheckLevel"});var gv;!function(e){e[e.DISABLE=0]="DISABLE",e[e.ENABLE=1]="ENABLE",e[e.REFRESH=2]="REFRESH"}(gv||(gv={}));const vv=Kb.Enum(gv);var yv;!function(e){e[e.WordRequestType_Plain=0]="WordRequestType_Plain",e[e.WordRequestType_Matrix9=1]="WordRequestType_Matrix9",e[e.WordRequestType_Matrix6=2]="WordRequestType_Matrix6"}(yv||(yv={})),Kb.Enum(yv);const wv=Kb.KeyOfEnum(yv,{$id:"WordRequestType"});Kb.Object({flags:Kb.Number()},{$id:"ApplyFlags"});const xv=Kb.Object({language:Kb.Optional(Kb.String()),label:Kb.Optional(Kb.String()),use_passphrase:Kb.Optional(Kb.Boolean()),homescreen:Kb.Optional(Kb.String()),_passphrase_source:Kb.Optional(Kb.Number()),auto_lock_delay_ms:Kb.Optional(Kb.Number()),display_rotation:Kb.Optional(Kb.Union([av,ov])),passphrase_always_on_device:Kb.Optional(Kb.Boolean()),safety_checks:Kb.Optional(mv),experimental_features:Kb.Optional(Kb.Boolean()),hide_passphrase_from_host:Kb.Optional(Kb.Boolean()),haptic_feedback:Kb.Optional(Kb.Boolean()),homescreen_length:Kb.Optional(Kb.Number()),auto_lock_delay_battery_ms:Kb.Optional(Kb.Number())},{$id:"ApplySettings"});Kb.Object({challenge:Kb.String()},{$id:"AuthenticateDevice"}),Kb.Object({optiga_certificates:Kb.Array(Kb.String()),optiga_signature:Kb.String(),tropic_certificates:Kb.Array(Kb.String()),tropic_signature:Kb.Optional(Kb.String()),mcu_certificates:Kb.Array(Kb.String()),mcu_signature:Kb.Optional(Kb.String())},{$id:"AuthenticityProof"});const Av=Kb.Object({member_threshold:Kb.Number(),member_count:Kb.Number()},{$id:"Slip39Group"});var Ev;Kb.Object({group_threshold:Kb.Optional(Kb.Number()),groups:Kb.Optional(Kb.Array(Av)),backup_method:Kb.Optional(Vg)},{$id:"BackupDevice"}),Kb.Object({},{$id:"Cancel"}),Kb.Object({},{$id:"CancelAuthorization"}),Kb.Object({data_length:Kb.Number(),show_display:Kb.Optional(Kb.Boolean())},{$id:"ChangeLanguage"}),Kb.Object({remove:Kb.Optional(Kb.Boolean())},{$id:"ChangePin"}),Kb.Object({remove:Kb.Optional(Kb.Boolean())},{$id:"ChangeWipeCode"}),Kb.Object({data_chunk:Kb.String()},{$id:"DataChunkAck"}),Kb.Object({data_length:Kb.Number(),data_offset:Kb.Number()},{$id:"DataChunkRequest"}),Kb.Object({},{$id:"DoPreauthorized"}),Kb.Object({},{$id:"EndSession"}),Kb.Object({entropy:Kb.String()},{$id:"Entropy"}),Kb.Object({entropy:Kb.String()},{$id:"EntropyAck"}),Kb.Object({finish:Kb.Optional(Kb.Boolean())},{$id:"EntropyCheckContinue"}),Kb.Object({},{$id:"EntropyCheckReady"}),Kb.Object({entropy_commitment:Kb.Optional(Kb.String()),prev_entropy:Kb.Optional(Kb.String())},{$id:"EntropyRequest"}),Kb.Object({vendor:Kb.String(),major_version:Kb.Number(),minor_version:Kb.Number(),patch_version:Kb.Number(),build_version:Kb.Optional(Kb.Number()),bootloader_mode:Kb.Union([Kb.Boolean(),Kb.Null()]),device_id:Kb.Union([Kb.String(),Kb.Null()]),pin_protection:Kb.Union([Kb.Boolean(),Kb.Null()]),passphrase_protection:Kb.Union([Kb.Boolean(),Kb.Null()]),language:Kb.Union([Kb.String(),Kb.Null()]),label:Kb.Union([Kb.String(),Kb.Null()]),initialized:Kb.Union([Kb.Boolean(),Kb.Null()]),revision:Kb.Union([Kb.String(),Kb.Null()]),bootloader_hash:Kb.Union([Kb.String(),Kb.Null()]),imported:Kb.Union([Kb.Boolean(),Kb.Null()]),unlocked:Kb.Union([Kb.Boolean(),Kb.Null()]),_passphrase_cached:Kb.Optional(Kb.Boolean()),firmware_present:Kb.Union([Kb.Boolean(),Kb.Null()]),backup_availability:Kb.Union([Kg,Kb.Null()]),flags:Kb.Union([Kb.Number(),Kb.Null()]),model:Kb.String(),fw_major:Kb.Union([Kb.Number(),Kb.Null()]),fw_minor:Kb.Union([Kb.Number(),Kb.Null()]),fw_patch:Kb.Union([Kb.Number(),Kb.Null()]),fw_build:Kb.Optional(Kb.Number()),fw_vendor:Kb.Union([Kb.String(),Kb.Null()]),unfinished_backup:Kb.Union([Kb.Boolean(),Kb.Null()]),no_backup:Kb.Union([Kb.Boolean(),Kb.Null()]),recovery_status:Kb.Union([fv,Kb.Null()]),capabilities:Kb.Array(tv),backup_type:Kb.Union([Jg,Kb.Null()]),sd_card_present:Kb.Union([Kb.Boolean(),Kb.Null()]),sd_protection:Kb.Union([Kb.Boolean(),Kb.Null()]),wipe_code_protection:Kb.Union([Kb.Boolean(),Kb.Null()]),session_id:Kb.Union([Kb.String(),Kb.Null()]),passphrase_always_on_device:Kb.Union([Kb.Boolean(),Kb.Null()]),safety_checks:Kb.Union([mv,Kb.Null()]),auto_lock_delay_ms:Kb.Union([Kb.Number(),Kb.Null()]),display_rotation:Kb.Union([av,Kb.Null()]),experimental_features:Kb.Union([Kb.Boolean(),Kb.Null()]),busy:Kb.Optional(Kb.Boolean()),homescreen_format:Kb.Optional(cv),hide_passphrase_from_host:Kb.Optional(Kb.Boolean()),internal_model:rv,unit_color:Kb.Optional(Kb.Number()),unit_btconly:Kb.Optional(Kb.Boolean()),homescreen_width:Kb.Optional(Kb.Number()),homescreen_height:Kb.Optional(Kb.Number()),bootloader_locked:Kb.Optional(Kb.Boolean()),language_version_matches:Kb.Optional(Kb.Boolean()),unit_packaging:Kb.Optional(Kb.Number()),haptic_feedback:Kb.Optional(Kb.Boolean()),recovery_type:Kb.Optional(pv),optiga_sec:Kb.Optional(Kb.Number()),soc:Kb.Optional(Kb.Number()),firmware_corrupted:Kb.Optional(Kb.Boolean()),auto_lock_delay_battery_ms:Kb.Optional(Kb.Number()),led:Kb.Optional(Kb.Boolean()),usb_connected:Kb.Optional(Kb.Boolean()),wireless_connected:Kb.Optional(Kb.Boolean())},{$id:"Features"}),Kb.Object({hash:Kb.String()},{$id:"FirmwareHash"}),Kb.Object({size:Kb.Number()},{$id:"GetEntropy"}),Kb.Object({},{$id:"GetFeatures"}),Kb.Object({challenge:Kb.Optional(Kb.String())},{$id:"GetFirmwareHash"}),Kb.Object({},{$id:"GetNextU2FCounter"}),Kb.Object({},{$id:"GetNonce"}),Kb.Object({},{$id:"GetSerialNumber"}),Kb.Object({session_id:Kb.Optional(Kb.String()),_skip_passphrase:Kb.Optional(Kb.Boolean()),derive_cardano:Kb.Optional(Kb.Boolean())},{$id:"Initialize"}),Kb.Object({mnemonics:Kb.Array(Kb.String()),pin:Kb.Optional(Kb.String()),passphrase_protection:Kb.Optional(Kb.Boolean()),language:Kb.Optional(Kb.String()),label:Kb.Optional(Kb.String()),skip_checksum:Kb.Optional(Kb.Boolean()),u2f_counter:Kb.Optional(Kb.Number()),needs_backup:Kb.Optional(Kb.Boolean()),no_backup:Kb.Optional(Kb.Boolean()),unfinished_backup:Kb.Optional(Kb.Boolean())},{$id:"LoadDevice"}),Kb.Object({},{$id:"LockDevice"}),Kb.Object({u2f_counter:Kb.Number()},{$id:"NextU2FCounter"}),Kb.Object({nonce:Kb.String()},{$id:"Nonce"}),Kb.Object({message:Kb.Optional(Kb.String()),button_protection:Kb.Optional(Kb.Boolean())},{$id:"Ping"}),Kb.Object({},{$id:"PreauthorizedRequest"}),Kb.Object({boot_command:Kb.Optional(Qg),firmware_header:Kb.Optional(Kb.String())},{$id:"RebootToBootloader"}),Kb.Object({word_count:Kb.Optional(Kb.Number()),passphrase_protection:Kb.Optional(Kb.Boolean()),pin_protection:Kb.Optional(Kb.Boolean()),language:Kb.Optional(Kb.String()),label:Kb.Optional(Kb.String()),enforce_wordlist:Kb.Optional(Kb.Boolean()),input_method:Kb.Optional(lv),u2f_counter:Kb.Optional(Kb.Number()),type:Kb.Optional(pv),backup_method:Kb.Optional(Vg)},{$id:"RecoveryDevice"}),Kb.Object({strength:Kb.Optional(Kb.Number()),passphrase_protection:Kb.Optional(Kb.Boolean()),pin_protection:Kb.Optional(Kb.Boolean()),language:Kb.Optional(Kb.String()),label:Kb.Optional(Kb.String()),u2f_counter:Kb.Optional(Kb.Number()),skip_backup:Kb.Optional(Kb.Boolean()),no_backup:Kb.Optional(Kb.Boolean()),backup_type:Kb.Optional(Yg),entropy_check:Kb.Optional(Kb.Boolean()),backup_method:Kb.Optional(Vg)},{$id:"ResetDevice"}),Kb.Object({operation:vv},{$id:"SdProtect"}),Kb.Object({serial_number:Kb.String()},{$id:"SerialNumber"}),Kb.Object({value:Kb.Optional(Kb.Number())},{$id:"SetBrightness"}),Kb.Object({expiry_ms:Kb.Optional(Kb.Number())},{$id:"SetBusy"}),Kb.Object({u2f_counter:Kb.Number()},{$id:"SetU2FCounter"}),Kb.Object({},{$id:"ShowDeviceTutorial"}),Kb.Object({},{$id:"UnlockBootloader"}),Kb.Object({mac:Kb.String()},{$id:"UnlockedPathRequest"}),Kb.Object({address_n:Kb.Array(Kb.Number()),mac:Kb.Optional(Kb.String())},{$id:"UnlockPath"}),Kb.Object({},{$id:"WipeDevice"}),Kb.Object({word:Kb.String()},{$id:"WordAck"}),Kb.Object({type:wv},{$id:"WordRequest"}),function(e){e[e.MAINNET=0]="MAINNET",e[e.TESTNET=1]="TESTNET",e[e.STAGENET=2]="STAGENET",e[e.FAKECHAIN=3]="FAKECHAIN"}(Ev||(Ev={}));const Sv=Kb.Enum(Ev);Kb.Object({ins:Kb.Optional(Kb.Number()),p1:Kb.Optional(Kb.Number()),p2:Kb.Optional(Kb.Number()),pd:Kb.Array(Kb.Number()),data1:Kb.Optional(Kb.String()),data2:Kb.Optional(Kb.String())},{$id:"DebugMoneroDiagAck"}),Kb.Object({ins:Kb.Optional(Kb.Number()),p1:Kb.Optional(Kb.Number()),p2:Kb.Optional(Kb.Number()),pd:Kb.Array(Kb.Number()),data1:Kb.Optional(Kb.String()),data2:Kb.Optional(Kb.String())},{$id:"DebugMoneroDiagRequest"});const _v=Kb.Object({spend_public_key:Kb.Optional(Kb.String()),view_public_key:Kb.Optional(Kb.String())},{$id:"MoneroAccountPublicAddress"});Kb.Object({address:Kb.String()},{$id:"MoneroAddress"});const Ov=Kb.Object({iv:Kb.Optional(Kb.String()),blob:Kb.Optional(Kb.String())},{$id:"MoneroExportedKeyImage"});Kb.Object({address_n:Kb.Array(Kb.Number()),show_display:Kb.Optional(Kb.Boolean()),network_type:Kb.Optional(Sv),account:Kb.Optional(Kb.Number()),minor:Kb.Optional(Kb.Number()),payment_id:Kb.Optional(Kb.String()),chunkify:Kb.Optional(Kb.Boolean())},{$id:"MoneroGetAddress"}),Kb.Object({salt:Kb.Optional(Kb.String()),tx_keys:Kb.Optional(Kb.String()),tx_derivations:Kb.Optional(Kb.String())},{$id:"MoneroGetTxKeyAck"}),Kb.Object({address_n:Kb.Array(Kb.Number()),network_type:Kb.Optional(Sv),salt1:Kb.String(),salt2:Kb.String(),tx_enc_keys:Kb.String(),tx_prefix_hash:Kb.String(),reason:Kb.Optional(Kb.Number()),view_public_key:Kb.Optional(Kb.String())},{$id:"MoneroGetTxKeyRequest"}),Kb.Object({address_n:Kb.Array(Kb.Number()),network_type:Kb.Optional(Sv)},{$id:"MoneroGetWatchKey"}),Kb.Object({},{$id:"MoneroKeyImageExportInitAck"});const Nv=Kb.Object({account:Kb.Number(),minor_indices:Kb.Array(Kb.Number())},{$id:"MoneroSubAddressIndicesList"});Kb.Object({num:Kb.Number(),hash:Kb.Uint8Array(),address_n:Kb.Array(Kb.Number()),network_type:Kb.Optional(Sv),subs:Kb.Array(Nv)},{$id:"MoneroKeyImageExportInitRequest"}),Kb.Object({enc_key:Kb.Optional(Kb.String())},{$id:"MoneroKeyImageSyncFinalAck"}),Kb.Object({},{$id:"MoneroKeyImageSyncFinalRequest"}),Kb.Object({kis:Kb.Array(Ov)},{$id:"MoneroKeyImageSyncStepAck"});const kv=Kb.Object({out_key:Kb.Uint8Array(),tx_pub_key:Kb.Uint8Array(),additional_tx_pub_keys:Kb.Array(Kb.Uint8Array()),internal_output_index:Kb.Number(),sub_addr_major:Kb.Optional(Kb.Number()),sub_addr_minor:Kb.Optional(Kb.Number())},{$id:"MoneroTransferDetails"});Kb.Object({tdis:Kb.Array(kv)},{$id:"MoneroKeyImageSyncStepRequest"}),Kb.Object({},{$id:"MoneroLiveRefreshFinalAck"}),Kb.Object({},{$id:"MoneroLiveRefreshFinalRequest"}),Kb.Object({},{$id:"MoneroLiveRefreshStartAck"}),Kb.Object({address_n:Kb.Array(Kb.Number()),network_type:Kb.Optional(Sv)},{$id:"MoneroLiveRefreshStartRequest"}),Kb.Object({salt:Kb.Optional(Kb.String()),key_image:Kb.Optional(Kb.String())},{$id:"MoneroLiveRefreshStepAck"}),Kb.Object({out_key:Kb.String(),recv_deriv:Kb.String(),real_out_idx:Kb.Number(),sub_addr_major:Kb.Number(),sub_addr_minor:Kb.Number()},{$id:"MoneroLiveRefreshStepRequest"});const Tv=Kb.Object({K:Kb.Optional(Kb.String()),L:Kb.Optional(Kb.String()),R:Kb.Optional(Kb.String()),ki:Kb.Optional(Kb.String())},{$id:"MoneroMultisigKLRki"}),Cv=Kb.Object({dest:Kb.String(),commitment:Kb.String()},{$id:"MoneroRctKeyPublic"}),Iv=Kb.Object({idx:Kb.Optional(Kb.Number()),key:Kb.Optional(Cv)},{$id:"MoneroOutputEntry"}),Bv=Kb.Object({txn_fee:Kb.Optional(Kb.Number()),message:Kb.Optional(Kb.String()),rv_type:Kb.Optional(Kb.Number())},{$id:"MoneroRingCtSig"}),Lv=Kb.Object({rsig_type:Kb.Optional(Kb.Number()),offload_type:Kb.Optional(Kb.Number()),grouping:Kb.Array(Kb.Number()),mask:Kb.Optional(Kb.String()),rsig:Kb.Optional(Kb.String()),rsig_parts:Kb.Array(Kb.String()),bp_version:Kb.Optional(Kb.Number())},{$id:"MoneroTransactionRsigData"});Kb.Object({rsig_data:Kb.Optional(Lv)},{$id:"MoneroTransactionAllInputsSetAck"}),Kb.Object({},{$id:"MoneroTransactionAllInputsSetRequest"}),Kb.Object({extra:Kb.Optional(Kb.String()),tx_prefix_hash:Kb.String(),rv:Bv,full_message_hash:Kb.Optional(Kb.String())},{$id:"MoneroTransactionAllOutSetAck"}),Kb.Object({rsig_data:Kb.Optional(Lv)},{$id:"MoneroTransactionAllOutSetRequest"});const Mv=Kb.Object({amount:Kb.Optional(Kb.Uint()),addr:Kb.Optional(_v),is_subaddress:Kb.Optional(Kb.Boolean()),original:Kb.Optional(Kb.String()),is_integrated:Kb.Optional(Kb.Boolean())},{$id:"MoneroTransactionDestinationEntry"}),Rv=Kb.Object({version:Kb.Optional(Kb.Number()),payment_id:Kb.Optional(Kb.String()),unlock_time:Kb.Optional(Kb.Number()),outputs:Kb.Array(Mv),change_dts:Kb.Optional(Mv),num_inputs:Kb.Optional(Kb.Number()),mixin:Kb.Optional(Kb.Number()),fee:Kb.Optional(Kb.Uint()),account:Kb.Optional(Kb.Number()),minor_indices:Kb.Array(Kb.Number()),rsig_data:Kb.Optional(Lv),integrated_indices:Kb.Array(Kb.Number()),client_version:Kb.Optional(Kb.Number()),hard_fork:Kb.Optional(Kb.Number()),monero_version:Kb.Optional(Kb.String()),chunkify:Kb.Optional(Kb.Boolean())},{$id:"MoneroTransactionData"});Kb.Object({cout_key:Kb.Optional(Kb.String()),salt:Kb.Optional(Kb.String()),rand_mult:Kb.Optional(Kb.String()),tx_enc_keys:Kb.Optional(Kb.String()),opening_key:Kb.Optional(Kb.String())},{$id:"MoneroTransactionFinalAck"}),Kb.Object({},{$id:"MoneroTransactionFinalRequest"}),Kb.Object({hmacs:Kb.Array(Kb.String()),rsig_data:Kb.Optional(Lv)},{$id:"MoneroTransactionInitAck"}),Kb.Object({version:Kb.Optional(Kb.Number()),address_n:Kb.Array(Kb.Number()),network_type:Kb.Optional(Sv),tsx_data:Kb.Optional(Rv)},{$id:"MoneroTransactionInitRequest"}),Kb.Object({},{$id:"MoneroTransactionInputViniAck"});const Pv=Kb.Object({outputs:Kb.Array(Iv),real_output:Kb.Optional(Kb.Number()),real_out_tx_key:Kb.Optional(Kb.String()),real_out_additional_tx_keys:Kb.Array(Kb.String()),real_output_in_tx_index:Kb.Optional(Kb.Number()),amount:Kb.Optional(Kb.Uint()),rct:Kb.Optional(Kb.Boolean()),mask:Kb.Optional(Kb.String()),multisig_kLRki:Kb.Optional(Tv),subaddr_minor:Kb.Optional(Kb.Number())},{$id:"MoneroTransactionSourceEntry"});var Uv;Kb.Object({src_entr:Kb.Optional(Pv),vini:Kb.Optional(Kb.String()),vini_hmac:Kb.Optional(Kb.String()),pseudo_out:Kb.Optional(Kb.String()),pseudo_out_hmac:Kb.Optional(Kb.String()),orig_idx:Kb.Optional(Kb.Number())},{$id:"MoneroTransactionInputViniRequest"}),Kb.Object({vini:Kb.String(),vini_hmac:Kb.String(),pseudo_out:Kb.String(),pseudo_out_hmac:Kb.String(),pseudo_out_alpha:Kb.String(),spend_key:Kb.String()},{$id:"MoneroTransactionSetInputAck"}),Kb.Object({src_entr:Kb.Optional(Pv)},{$id:"MoneroTransactionSetInputRequest"}),Kb.Object({tx_out:Kb.Optional(Kb.String()),vouti_hmac:Kb.Optional(Kb.String()),rsig_data:Kb.Optional(Lv),out_pk:Kb.Optional(Kb.String()),ecdh_info:Kb.Optional(Kb.String())},{$id:"MoneroTransactionSetOutputAck"}),Kb.Object({dst_entr:Kb.Optional(Mv),dst_entr_hmac:Kb.Optional(Kb.String()),rsig_data:Kb.Optional(Lv),is_offloaded_bp:Kb.Optional(Kb.Boolean())},{$id:"MoneroTransactionSetOutputRequest"}),Kb.Object({signature:Kb.Optional(Kb.String()),pseudo_out:Kb.Optional(Kb.String())},{$id:"MoneroTransactionSignInputAck"}),Kb.Object({src_entr:Kb.Optional(Pv),vini:Kb.Optional(Kb.String()),vini_hmac:Kb.Optional(Kb.String()),pseudo_out:Kb.Optional(Kb.String()),pseudo_out_hmac:Kb.Optional(Kb.String()),pseudo_out_alpha:Kb.Optional(Kb.String()),spend_key:Kb.Optional(Kb.String()),orig_idx:Kb.Optional(Kb.Number())},{$id:"MoneroTransactionSignInputRequest"}),Kb.Object({watch_key:Kb.String(),address:Kb.String()},{$id:"MoneroWatchKey"}),function(e){e[e.NATIVE=0]="NATIVE",e[e.ALPHANUM4=1]="ALPHANUM4",e[e.ALPHANUM12=2]="ALPHANUM12"}(Uv||(Uv={}));const jv=Kb.Enum(Uv);var Fv;!function(e){e[e.NONE=0]="NONE",e[e.TEXT=1]="TEXT",e[e.ID=2]="ID",e[e.HASH=3]="HASH",e[e.RETURN=4]="RETURN"}(Fv||(Fv={}));const Dv=Kb.Enum(Fv);var zv;!function(e){e[e.ACCOUNT=0]="ACCOUNT",e[e.PRE_AUTH=1]="PRE_AUTH",e[e.HASH=2]="HASH"}(zv||(zv={}));const $v=Kb.Enum(zv),Wv=Kb.Object({source_account:Kb.Optional(Kb.String()),destination_account:Kb.String()},{$id:"StellarAccountMergeOp"});Kb.Object({address:Kb.String(),mac:Kb.Optional(Kb.String())},{$id:"StellarAddress"});const qv=Kb.Object({source_account:Kb.Optional(Kb.String()),trusted_account:Kb.String(),asset_type:jv,asset_code:Kb.Optional(Kb.String()),is_authorized:Kb.Boolean()},{$id:"StellarAllowTrustOp"}),Xv=Kb.Object({type:Kb.Union([Kb.Literal(0),Kb.Literal(1),Kb.Literal(2),Kb.Literal("NATIVE"),Kb.Literal("ALPHANUM4"),Kb.Literal("ALPHANUM12")]),code:Kb.Optional(Kb.String()),issuer:Kb.Optional(Kb.String())},{$id:"StellarAsset"}),Kv=Kb.Object({source_account:Kb.Optional(Kb.String()),bump_to:Kb.Uint()},{$id:"StellarBumpSequenceOp"}),Hv=Kb.Object({source_account:Kb.Optional(Kb.String()),asset:Xv,limit:Kb.Uint()},{$id:"StellarChangeTrustOp"}),Vv=Kb.Object({source_account:Kb.Optional(Kb.String()),balance_id:Kb.String()},{$id:"StellarClaimClaimableBalanceOp"}),Gv=Kb.Object({source_account:Kb.Optional(Kb.String()),new_account:Kb.String(),starting_balance:Kb.Uint()},{$id:"StellarCreateAccountOp"}),Yv=Kb.Object({source_account:Kb.Optional(Kb.String()),selling_asset:Xv,buying_asset:Xv,amount:Kb.Uint(),price_n:Kb.Number(),price_d:Kb.Number()},{$id:"StellarCreatePassiveSellOfferOp"});Kb.Object({address_n:Kb.Array(Kb.Number()),show_display:Kb.Optional(Kb.Boolean()),chunkify:Kb.Optional(Kb.Boolean())},{$id:"StellarGetAddress"});const Jv=Kb.Object({source_account:Kb.Optional(Kb.String()),selling_asset:Xv,buying_asset:Xv,amount:Kb.Uint(),price_n:Kb.Number(),price_d:Kb.Number(),offer_id:Kb.Uint()},{$id:"StellarManageBuyOfferOp"}),Zv=Kb.Object({source_account:Kb.Optional(Kb.String()),key:Kb.String(),value:Kb.Optional(Kb.Union([Kb.Buffer(),Kb.String()]))},{$id:"StellarManageDataOp"}),Qv=Kb.Object({source_account:Kb.Optional(Kb.String()),selling_asset:Xv,buying_asset:Xv,amount:Kb.Uint(),price_n:Kb.Number(),price_d:Kb.Number(),offer_id:Kb.Uint()},{$id:"StellarManageSellOfferOp"}),ey=Kb.Object({source_account:Kb.Optional(Kb.String()),send_asset:Xv,send_max:Kb.Uint(),destination_account:Kb.String(),destination_asset:Xv,destination_amount:Kb.Uint(),paths:Kb.Optional(Kb.Array(Xv))},{$id:"StellarPathPaymentStrictReceiveOp"}),ty=Kb.Object({source_account:Kb.Optional(Kb.String()),send_asset:Xv,send_amount:Kb.Uint(),destination_account:Kb.String(),destination_asset:Xv,destination_min:Kb.Uint(),paths:Kb.Optional(Kb.Array(Xv))},{$id:"StellarPathPaymentStrictSendOp"}),ny=Kb.Object({source_account:Kb.Optional(Kb.String()),destination_account:Kb.String(),asset:Xv,amount:Kb.Uint()},{$id:"StellarPaymentOp"}),ry=Kb.Object({source_account:Kb.Optional(Kb.String()),inflation_destination_account:Kb.Optional(Kb.String()),clear_flags:Kb.Optional(Kb.Number()),set_flags:Kb.Optional(Kb.Number()),master_weight:Kb.Optional(Kb.Uint()),low_threshold:Kb.Optional(Kb.Uint()),medium_threshold:Kb.Optional(Kb.Uint()),high_threshold:Kb.Optional(Kb.Uint()),home_domain:Kb.Optional(Kb.String()),signer_type:Kb.Optional($v),signer_key:Kb.Optional(Kb.Union([Kb.Buffer(),Kb.String()])),signer_weight:Kb.Optional(Kb.Number())},{$id:"StellarSetOptionsOp"});var iy;Kb.Object({public_key:Kb.String(),signature:Kb.String()},{$id:"StellarSignedTx"}),Kb.Object({address_n:Kb.Array(Kb.Number()),network_passphrase:Kb.String(),source_account:Kb.String(),fee:Kb.Uint(),sequence_number:Kb.Uint(),timebounds_start:Kb.Number(),timebounds_end:Kb.Number(),memo_type:Dv,memo_text:Kb.Optional(Kb.String()),memo_id:Kb.Optional(Kb.Uint()),memo_hash:Kb.Optional(Kb.Union([Kb.Buffer(),Kb.String()])),num_operations:Kb.Number(),payment_req:Kb.Optional(Bm)},{$id:"StellarSignTx"}),Kb.Object({},{$id:"StellarTxOpRequest"}),function(e){e[e.TransferContract=1]="TransferContract",e[e.VoteWitnessContract=4]="VoteWitnessContract",e[e.TriggerSmartContract=31]="TriggerSmartContract",e[e.FreezeBalanceV2Contract=54]="FreezeBalanceV2Contract",e[e.UnfreezeBalanceV2Contract=55]="UnfreezeBalanceV2Contract",e[e.WithdrawExpireUnfreezeContract=56]="WithdrawExpireUnfreezeContract"}(iy||(iy={}));const oy=Kb.Enum(iy);var ay;!function(e){e[e.BANDWIDTH=0]="BANDWIDTH",e[e.ENERGY=1]="ENERGY"}(ay||(ay={}));const sy=Kb.Enum(ay);Kb.Object({address:Kb.String(),mac:Kb.Optional(Kb.String())},{$id:"TronAddress"}),Kb.Object({},{$id:"TronContractRequest"});const cy=Kb.Object({owner_address:Kb.String(),balance:Kb.Number(),resource:Kb.Optional(sy)},{$id:"TronFreezeBalanceV2Contract"});Kb.Object({address_n:Kb.Array(Kb.Number()),show_display:Kb.Optional(Kb.Boolean()),chunkify:Kb.Optional(Kb.Boolean())},{$id:"TronGetAddress"});const uy=Kb.Object({type_url:Kb.String(),value:Kb.String()},{$id:"TronRawParameter"}),ly=Kb.Object({type:oy,parameter:uy},{$id:"TronRawContract"});Kb.Object({ref_block_bytes:Kb.String(),ref_block_hash:Kb.String(),expiration:Kb.Number(),data:Kb.Optional(Kb.String()),contract:Kb.Array(ly),timestamp:Kb.Number(),fee_limit:Kb.Optional(Kb.Number())},{$id:"TronRawTransaction"}),Kb.Object({signature:Kb.String()},{$id:"TronSignature"}),Kb.Object({address_n:Kb.Array(Kb.Number()),ref_block_bytes:Kb.String(),ref_block_hash:Kb.String(),expiration:Kb.Number(),data:Kb.Optional(Kb.String()),timestamp:Kb.Number(),fee_limit:Kb.Optional(Kb.Number())},{$id:"TronSignTx"});const dy=Kb.Object({owner_address:Kb.String(),to_address:Kb.String(),amount:Kb.Uint()},{$id:"TronTransferContract"}),fy=Kb.Object({owner_address:Kb.String(),contract_address:Kb.String(),data:Kb.String()},{$id:"TronTriggerSmartContract"}),hy=Kb.Object({owner_address:Kb.String(),balance:Kb.Number(),resource:Kb.Optional(sy)},{$id:"TronUnfreezeBalanceV2Contract"}),py=Kb.Object({address:Kb.String(),count:Kb.Number()},{$id:"TronVote"}),by=Kb.Object({owner_address:Kb.String(),votes:Kb.Array(py)},{$id:"TronVoteWitnessContract"}),my=Kb.Object({owner_address:Kb.String()},{$id:"TronWithdrawUnfreeze"}),gy=Kb.Object({blockIndex:Kb.Number(),txIndex:Kb.Number(),certificateIndex:Kb.Number()}),vy=Kb.Object({addressType:pg,path:Kb.Optional(gm),stakingPath:Kb.Optional(gm),stakingKeyHash:Kb.Optional(Kb.String()),certificatePointer:Kb.Optional(gy),paymentScriptHash:Kb.Optional(Kb.String()),stakingScriptHash:Kb.Optional(Kb.String())});Kb.Object({addressParameters:vy,protocolMagic:Kb.Number(),networkId:Kb.Number(),address:Kb.Optional(Kb.String()),showOnTrezor:Kb.Optional(Kb.Boolean()),derivationType:Kb.Optional(wg),chunkify:Kb.Optional(Kb.Boolean())});const yy=Kb.Recursive(e=>Kb.Object({type:Og,scripts:Kb.Optional(Kb.Array(e)),keyHash:Kb.Optional(Kb.String()),keyPath:Kb.Optional(gm),requiredSignaturesCount:Kb.Optional(Kb.Number()),invalidBefore:Kb.Optional(Kb.String()),invalidHereafter:Kb.Optional(Kb.String())}));Kb.Object({script:yy,displayFormat:Sg,derivationType:Kb.Optional(wg)}),Kb.Object({scriptHash:Kb.String()}),Kb.Intersect([vm,Kb.Object({derivationType:Kb.Optional(wg)})]);const wy=Kb.Object({path:Kb.Optional(gm),prev_hash:Kb.String(),prev_index:Kb.Number()}),xy=Kb.Object({assetNameBytes:Kb.String(),amount:Kb.Optional(Kb.String()),mintAmount:Kb.Optional(Kb.String())}),Ay=Kb.Object({policyId:Kb.String(),tokenAmounts:Kb.Array(xy)}),Ey=Kb.Intersect([Kb.Union([Kb.Object({addressParameters:vy}),Kb.Object({address:Kb.String()})]),Kb.Object({amount:Kb.String(),tokenBundle:Kb.Optional(Kb.Array(Ay)),datumHash:Kb.Optional(Kb.String()),format:Kb.Optional(Bg),inlineDatum:Kb.Optional(Kb.String()),referenceScript:Kb.Optional(Kb.String())})]),Sy=Kb.Object({stakingKeyPath:Kb.Optional(gm),stakingKeyHash:Kb.Optional(Kb.String())}),_y=Kb.Object({type:kg,ipv4Address:Kb.Optional(Kb.String()),ipv6Address:Kb.Optional(Kb.String()),port:Kb.Optional(Kb.Number()),hostName:Kb.Optional(Kb.String())}),Oy=Kb.Object({url:Kb.String(),hash:Kb.String()}),Ny=Kb.Object({numerator:Kb.String(),denominator:Kb.String()}),ky=Kb.Object({poolId:Kb.String(),vrfKeyHash:Kb.String(),pledge:Kb.String(),cost:Kb.String(),margin:Ny,rewardAccount:Kb.String(),owners:Kb.Array(Sy,{minItems:1}),relays:Kb.Array(_y),metadata:Kb.Optional(Oy)}),Ty=Kb.Object({type:Ag,keyHash:Kb.Optional(Kb.String()),scriptHash:Kb.Optional(Kb.String())}),Cy=Kb.Object({type:mg,path:Kb.Optional(gm),pool:Kb.Optional(Kb.String()),poolParameters:Kb.Optional(ky),scriptHash:Kb.Optional(Kb.String()),keyHash:Kb.Optional(Kb.String()),deposit:Kb.Optional(Kb.String()),dRep:Kb.Optional(Ty)}),Iy=Kb.Object({path:Kb.Optional(gm),amount:Kb.String(),scriptHash:Kb.Optional(Kb.String()),keyHash:Kb.Optional(Kb.String())}),By=Kb.Array(Ay),Ly=Kb.Object({path:Kb.Optional(gm),prev_hash:Kb.String(),prev_index:Kb.Number()}),My=Kb.Object({keyPath:Kb.Optional(gm),keyHash:Kb.Optional(Kb.String())}),Ry=Kb.Object({prev_hash:Kb.String(),prev_index:Kb.Number()}),Py=Kb.Object({votePublicKey:Kb.String(),weight:Kb.Number()}),Uy=Kb.Object({votePublicKey:Kb.Optional(Kb.String()),stakingPath:gm,paymentAddressParameters:Kb.Optional(vy),nonce:Kb.String(),format:Kb.Optional(vg),delegations:Kb.Optional(Kb.Array(Py)),votingPurpose:Kb.Optional(Kb.Number()),paymentAddress:Kb.Optional(Kb.String())}),jy=Kb.Object({hash:Kb.Optional(Kb.String()),cVoteRegistrationParameters:Kb.Optional(Uy)}),Fy=Kb.Object({inputs:Kb.Array(wy),outputs:Kb.Array(Ey),fee:Kb.Uint(),ttl:Kb.Optional(Kb.Uint()),certificates:Kb.Optional(Kb.Array(Cy)),withdrawals:Kb.Optional(Kb.Array(Iy)),validityIntervalStart:Kb.Optional(Kb.String()),auxiliaryData:Kb.Optional(jy),mint:Kb.Optional(By),scriptDataHash:Kb.Optional(Kb.String()),collateralInputs:Kb.Optional(Kb.Array(Ly)),requiredSigners:Kb.Optional(Kb.Array(My)),collateralReturn:Kb.Optional(Ey),totalCollateral:Kb.Optional(Kb.String()),referenceInputs:Kb.Optional(Kb.Array(Ry)),additionalWitnessRequests:Kb.Optional(Kb.Array(gm)),protocolMagic:Kb.Number(),networkId:Kb.Number(),signingMode:Mg,derivationType:Kb.Optional(wg),includeNetworkId:Kb.Optional(Kb.Boolean()),chunkify:Kb.Optional(Kb.Boolean()),tagCborSets:Kb.Optional(Kb.Boolean()),payment_req:Kb.Optional(Bm)});Kb.Intersect([Fy,Kb.Object({unsignedTx:Kb.Object({body:Kb.String(),hash:Kb.String()}),testnet:Kb.Boolean()})]);const Dy=Kb.Object({type:Pg,pubKey:Kb.String(),signature:Kb.String(),chainCode:Kb.Optional(Kb.String())}),zy=Kb.Object({type:Cg,auxiliaryDataHash:Kb.String(),cVoteRegistrationSignature:Kb.Optional(Kb.String())});Kb.Object({hash:Kb.String(),witnesses:Kb.Array(Dy),auxiliaryDataSupplement:Kb.Optional(zy)}),Kb.Object({path:gm,payload:Kb.String(),preferHexDisplay:Kb.Optional(Kb.Boolean()),networkId:Kb.Optional(Kb.Number()),protocolMagic:Kb.Optional(Kb.Number()),addressParameters:Kb.Optional(vy),derivationType:Kb.Optional(wg)});const $y=Kb.Object({1:Kb.Literal(qu.EdDSA),address:Kb.String()}),Wy=Kb.Object({hashed:Kb.Boolean(),version:Kb.Number()}),qy=Kb.Object({protected:$y,unprotected:Wy});Kb.Object({headers:qy,payload:Kb.String(),signature:Kb.String(),pubKey:Kb.String(),coseSignature:Kb.String(),coseKey:Kb.String()}),Kb.Object({path:gm,coin:Kb.Optional(Kb.String()),message:Kb.String(),hex:Kb.Optional(Kb.Boolean()),no_script_type:Kb.Optional(Kb.Boolean())}),Kb.Object({address:Kb.String(),signature:Kb.String(),message:Kb.String(),coin:Kb.String(),hex:Kb.Optional(Kb.Boolean())});const Xy=Kb.Object({amount:Kb.String(),destination:Kb.String(),destinationTag:Kb.Optional(Kb.Number())}),Ky=Kb.Object({fee:Kb.String(),flags:Kb.Optional(Kb.Number()),sequence:Kb.Number(),maxLedgerVersion:Kb.Optional(Kb.Number()),payment:Xy});Kb.Object({path:gm,transaction:Ky,payment_req:Kb.Optional(Bm),chunkify:Kb.Optional(Kb.Boolean())}),Kb.Object({serializedTx:Kb.String(),signature:Kb.String()}),Kb.Object({path:gm,message:Kb.String(),hex:Kb.Optional(Kb.Boolean())});const Hy=Kb.Object({to:Kb.Union([Kb.String(),Kb.Null()]),value:Kb.String(),gasPrice:Kb.String(),gasLimit:Kb.String(),maxFeePerGas:Kb.Optional(Kb.Undefined()),maxPriorityFeePerGas:Kb.Optional(Kb.Undefined()),nonce:Kb.String(),data:Kb.Optional(Kb.String()),chainId:Kb.Number(),txType:Kb.Optional(Kb.Number()),payment_req:Kb.Optional(Bm)}),Vy=Kb.Object({address:Kb.String(),storageKeys:Kb.Array(Kb.String())}),Gy=Kb.Object({to:Kb.Union([Kb.String(),Kb.Null()]),value:Kb.String(),gasLimit:Kb.String(),gasPrice:Kb.Optional(Kb.Undefined()),nonce:Kb.String(),data:Kb.Optional(Kb.String()),chainId:Kb.Number(),maxFeePerGas:Kb.String(),maxPriorityFeePerGas:Kb.String(),accessList:Kb.Optional(Kb.Array(Vy)),payment_req:Kb.Optional(Bm)});Kb.Object({path:gm,transaction:Kb.Union([Hy,Gy]),chunkify:Kb.Optional(Kb.Boolean())}),Kb.Object({v:Kb.String(),r:Kb.String(),s:Kb.String(),serializedTx:Kb.String()});const Yy=Kb.Object({name:Kb.String(),type:Kb.String()}),Jy=Kb.Object({EIP712Domain:Kb.Array(Yy)},{additionalProperties:Kb.Array(Yy)}),Zy=Kb.Object({types:Jy,primaryType:Kb.String(),domain:Kb.Object({name:Kb.Optional(Kb.String()),version:Kb.Optional(Kb.String()),chainId:Kb.Optional(Kb.Union([Kb.Number(),Kb.BigInt(),Kb.String()])),verifyingContract:Kb.Optional(Kb.String()),salt:Kb.Optional(Kb.Union([Kb.ArrayBuffer(),Kb.String()]))}),message:Kb.Object({},{additionalProperties:Kb.Any()})});Kb.Object({path:gm,data:Zy,metamask_v4_compat:Kb.Boolean(),domain_separator_hash:Kb.Optional(Kb.Undefined()),message_hash:Kb.Optional(Kb.Undefined()),show_message_hash:Kb.Optional(Kb.Boolean())}),Kb.Object({path:gm,data:Zy,metamask_v4_compat:Kb.Boolean(),domain_separator_hash:Kb.String(),message_hash:Kb.Optional(Kb.String()),show_message_hash:Kb.Optional(Kb.Boolean())}),Kb.Object({address:Kb.String(),message:Kb.String(),hex:Kb.Optional(Kb.Boolean()),signature:Kb.String()}),Kb.Object({path:gm,address:Kb.Optional(Kb.String()),showOnTrezor:Kb.Optional(Kb.Boolean()),networkType:Kb.Optional(Sv),account:Kb.Optional(Kb.Number()),minor:Kb.Optional(Kb.Number()),paymentId:Kb.Optional(Kb.String()),chunkify:Kb.Optional(Kb.Boolean())},{$id:"MoneroGetAddress"}),Kb.Object({path:gm,networkType:Kb.Optional(Sv)},{$id:"MoneroGetWatchKey"}),Kb.Object({watch_key:Kb.String(),address:Kb.String()},{$id:"MoneroWatchKey"});const Qy=Kb.Object({out_key:Kb.String(),tx_pub_key:Kb.String(),additional_tx_pub_keys:Kb.Optional(Kb.Union([Kb.Array(Kb.String()),Kb.String()])),internal_output_index:Kb.Number(),sub_addr_major:Kb.Optional(Kb.Number()),sub_addr_minor:Kb.Optional(Kb.Number())},{$id:"MoneroTransferDetails"}),ew=Kb.Object({account:Kb.Number(),minor_indices:Kb.Array(Kb.Number())},{$id:"MoneroSubAddressIndicesList"});Kb.Object({path:gm,networkType:Kb.Optional(Sv),subs:Kb.Optional(Kb.Array(ew)),tdis:Kb.Array(Qy)},{$id:"MoneroKeyImageSync"});const tw=Kb.Object({iv:Kb.String(),key_image:Kb.String()},{$id:"MoneroExportedKeyImage"});Kb.Object({key_images:Kb.Array(tw),signature:Kb.String()},{$id:"MoneroKeyImageSyncResult"});const nw=Kb.Object({idx:Kb.Number(),key:Kb.Object({dest:Kb.String(),commitment:Kb.String()})},{$id:"MoneroOutputEntry"}),rw=Kb.Object({K:Kb.Optional(Kb.String()),L:Kb.Optional(Kb.String()),R:Kb.Optional(Kb.String()),ki:Kb.Optional(Kb.String())},{$id:"MoneroMultisigKLRki"}),iw=Kb.Object({outputs:Kb.Array(nw),real_output:Kb.Number(),real_out_tx_key:Kb.String(),real_out_additional_tx_keys:Kb.Array(Kb.String()),real_output_in_tx_index:Kb.Number(),amount:Kb.Number(),rct:Kb.Boolean(),mask:Kb.String(),subaddr_minor:Kb.Number(),multisig_kLRki:Kb.Optional(rw)},{$id:"MoneroTransactionSourceEntry"}),ow=Kb.Object({spend_public_key:Kb.String(),view_public_key:Kb.String()}),aw=Kb.Object({amount:Kb.Number(),addr:ow,is_subaddress:Kb.Boolean(),original:Kb.String(),is_integrated:Kb.Boolean()},{$id:"MoneroTransactionDestinationEntry"}),sw=Kb.Object({rsig_type:Kb.Number(),offload_type:Kb.Optional(Kb.Number()),grouping:Kb.Array(Kb.Number()),mask:Kb.Optional(Kb.String()),rsig:Kb.Optional(Kb.String()),rsig_parts:Kb.Optional(Kb.Array(Kb.String())),bp_version:Kb.Number()},{$id:"MoneroTransactionRsigData"}),cw=Kb.Object({version:Kb.Number(),payment_id:Kb.Optional(Kb.String()),unlock_time:Kb.Number(),outputs:Kb.Array(aw),change_dts:Kb.Optional(aw),num_inputs:Kb.Number(),mixin:Kb.Number(),fee:Kb.Number(),account:Kb.Number(),rsig_data:sw,minor_indices:Kb.Optional(Kb.Array(Kb.Number())),integrated_indices:Kb.Optional(Kb.Array(Kb.Number())),client_version:Kb.Number(),hard_fork:Kb.Number(),monero_version:Kb.Optional(Kb.String()),chunkify:Kb.Optional(Kb.Boolean())},{$id:"MoneroTransactionData"});Kb.Object({path:gm,networkType:Sv,tsx_data:cw,inputs:Kb.Array(iw)},{$id:"MoneroSignTransaction"});const uw=Kb.Object({txn_fee:Kb.Optional(Kb.Number()),message:Kb.Optional(Kb.String()),rv_type:Kb.Optional(Kb.Number())},{$id:"MoneroRingCtSig"});Kb.Object({signatures:Kb.Array(Kb.String()),tx_prefix_hash:Kb.String(),rv:uw,cout_key:Kb.Optional(Kb.String()),salt:Kb.Optional(Kb.String()),rand_mult:Kb.Optional(Kb.String()),tx_enc_keys:Kb.Optional(Kb.String()),opening_key:Kb.Optional(Kb.String()),pseudo_outs:Kb.Array(Kb.String()),out_pks:Kb.Array(Kb.String()),ecdh_infos:Kb.Array(Kb.String()),tx_outs:Kb.Array(Kb.String()),rsig_parts:Kb.Array(Kb.String()),extra:Kb.Optional(Kb.String())},{$id:"MoneroSignedTransaction"}),Kb.Intersect([ym,Kb.Object({publicKey:Kb.String(),publicKeyBase58:Kb.String()})]);const lw=Kb.Object({baseAddress:Kb.String(),tokenProgram:Kb.String(),tokenMint:Kb.String(),tokenAccount:Kb.String(),symbol:Kb.Optional(Kb.String())}),dw=Kb.Object({tokenAccountsInfos:Kb.Optional(Kb.Array(lw,{minItems:1})),isDevnet:Kb.Optional(Kb.Boolean())});Kb.Object({path:Kb.Union([Kb.String(),Kb.Array(Kb.Number())]),serializedTx:Kb.String(),additionalInfo:Kb.Optional(dw),payment_req:Kb.Optional(Bm),serialize:Kb.Optional(Kb.Boolean()),chunkify:Kb.Optional(Kb.Boolean())}),Kb.Object({signature:Kb.String(),serializedTx:Kb.Optional(Kb.String())});const fw=Kb.Union([Kb.Literal("spl-token"),Kb.Literal("spl-token-2022")]),hw={fromAddress:Kb.String(),amount:Kb.String(),blockHash:Kb.String(),lastValidBlockHeight:Kb.Number(),priorityFees:Kb.Optional(Kb.Object({computeUnitPrice:Kb.String(),computeUnitLimit:Kb.String()})),token:Kb.Optional(Kb.Object({mint:Kb.String(),program:fw,decimals:Kb.Number(),accounts:Kb.Array(Kb.Object({publicKey:Kb.String(),balance:Kb.String()}))})),memo:Kb.Optional(Kb.String()),coin:Kb.Optional(Kb.String()),identity:Kb.Optional(Kb.String())},pw=Kb.Object({...hw,toAddress:Kb.Optional(Kb.String()),serializedTx:Kb.String()}),bw=Kb.Object({...hw,toAddress:Kb.String(),serializedTx:Kb.Optional(Kb.Undefined())});Kb.Union([pw,bw]),Kb.Object({serializedTx:Kb.String(),additionalInfo:Kb.Object({newAccountProgramName:Kb.Optional(fw),tokenAccountInfo:Kb.Optional(lw)})});const mw=Kb.Object({type:Kb.Union([jv,Kb.KeyOfEnum(Uv)]),code:Kb.Optional(Kb.String()),issuer:Kb.Optional(Kb.String())}),gw=Kb.Object({type:Kb.Literal("createAccount"),source:Kb.Optional(Kb.String()),destination:Kb.String(),startingBalance:Kb.String()}),vw=Kb.Object({type:Kb.Literal("payment"),source:Kb.Optional(Kb.String()),destination:Kb.String(),asset:mw,amount:Kb.String()}),yw=Kb.Object({type:Kb.Literal("pathPaymentStrictReceive"),source:Kb.Optional(Kb.String()),sendAsset:mw,sendMax:Kb.Uint(),destination:Kb.String(),destAsset:mw,destAmount:Kb.Uint(),path:Kb.Optional(Kb.Array(mw))}),ww=Kb.Object({type:Kb.Literal("pathPaymentStrictSend"),source:Kb.Optional(Kb.String()),sendAsset:mw,sendAmount:Kb.Uint(),destination:Kb.String(),destAsset:mw,destMin:Kb.Uint(),path:Kb.Optional(Kb.Array(mw))}),xw=Kb.Object({type:Kb.Literal("createPassiveSellOffer"),source:Kb.Optional(Kb.String()),buying:mw,selling:mw,amount:Kb.Uint(),price:Kb.Object({n:Kb.Number(),d:Kb.Number()})}),Aw=Kb.Object({type:Kb.Literal("manageSellOffer"),source:Kb.Optional(Kb.String()),buying:mw,selling:mw,amount:Kb.Uint(),offerId:Kb.Optional(Kb.Uint()),price:Kb.Object({n:Kb.Number(),d:Kb.Number()})}),Ew=Kb.Object({type:Kb.Literal("manageBuyOffer"),source:Kb.Optional(Kb.String()),buying:mw,selling:mw,amount:Kb.Uint(),offerId:Kb.Optional(Kb.Uint()),price:Kb.Object({n:Kb.Number(),d:Kb.Number()})}),Sw=Kb.Object({type:Kb.Literal("setOptions"),source:Kb.Optional(Kb.String()),signer:Kb.Optional(Kb.Object({type:$v,key:Kb.Union([Kb.String(),Kb.Buffer()]),weight:Kb.Optional(Kb.Number())})),inflationDest:Kb.Optional(Kb.String()),clearFlags:Kb.Optional(Kb.Number()),setFlags:Kb.Optional(Kb.Number()),masterWeight:Kb.Optional(Kb.Uint()),lowThreshold:Kb.Optional(Kb.Uint()),medThreshold:Kb.Optional(Kb.Uint()),highThreshold:Kb.Optional(Kb.Uint()),homeDomain:Kb.Optional(Kb.String())}),_w=Kb.Object({type:Kb.Literal("changeTrust"),source:Kb.Optional(Kb.String()),line:mw,limit:Kb.String()}),Ow=Kb.Object({type:Kb.Literal("allowTrust"),source:Kb.Optional(Kb.String()),trustor:Kb.String(),assetCode:Kb.String(),assetType:jv,authorize:Kb.Optional(Kb.Union([Kb.Boolean(),Kb.Undefined()]))}),Nw=Kb.Object({type:Kb.Literal("accountMerge"),source:Kb.Optional(Kb.String()),destination:Kb.String()}),kw=Kb.Object({type:Kb.Literal("manageData"),source:Kb.Optional(Kb.String()),name:Kb.String(),value:Kb.Optional(Kb.Union([Kb.String(),Kb.Buffer()]))}),Tw=Kb.Object({type:Kb.Literal("bumpSequence"),source:Kb.Optional(Kb.String()),bumpTo:Kb.Uint()}),Cw=Kb.Object({type:Kb.Literal("inflation"),source:Kb.Optional(Kb.String())}),Iw=Kb.Object({type:Kb.Literal("claimClaimableBalance"),source:Kb.Optional(Kb.String()),balanceId:Kb.String()}),Bw=Kb.Union([gw,vw,yw,ww,xw,Aw,Ew,Sw,_w,Ow,Nw,Cw,kw,Tw,Iw]),Lw=Kb.Object({source:Kb.String(),fee:Kb.Number(),sequence:Kb.Uint(),timebounds:Kb.Optional(Kb.Object({minTime:Kb.Number(),maxTime:Kb.Number()})),memo:Kb.Optional(Kb.Object({type:Dv,id:Kb.Optional(Kb.Uint()),text:Kb.Optional(Kb.String()),hash:Kb.Optional(Kb.Union([Kb.String(),Kb.Buffer()]))})),operations:Kb.Array(Bw)});Kb.Object({path:gm,networkPassphrase:Kb.String(),transaction:Lw,payment_req:Kb.Optional(Bm)}),Kb.Object({publicKey:Kb.String(),signature:Kb.String()}),Kb.Union([Kb.Intersect([Kb.Object({type:Kb.Literal("StellarCreateAccountOp")}),Gv]),Kb.Intersect([Kb.Object({type:Kb.Literal("StellarPaymentOp")}),ny]),Kb.Intersect([Kb.Object({type:Kb.Literal("StellarPathPaymentStrictReceiveOp")}),ey]),Kb.Intersect([Kb.Object({type:Kb.Literal("StellarPathPaymentStrictSendOp")}),ty]),Kb.Intersect([Kb.Object({type:Kb.Literal("StellarManageSellOfferOp")}),Qv]),Kb.Intersect([Kb.Object({type:Kb.Literal("StellarManageBuyOfferOp")}),Jv]),Kb.Intersect([Kb.Object({type:Kb.Literal("StellarCreatePassiveSellOfferOp")}),Yv]),Kb.Intersect([Kb.Object({type:Kb.Literal("StellarSetOptionsOp")}),ry]),Kb.Intersect([Kb.Object({type:Kb.Literal("StellarChangeTrustOp")}),Hv]),Kb.Intersect([Kb.Object({type:Kb.Literal("StellarAllowTrustOp")}),qv]),Kb.Intersect([Kb.Object({type:Kb.Literal("StellarAccountMergeOp")}),Wv]),Kb.Intersect([Kb.Object({type:Kb.Literal("StellarManageDataOp")}),Zv]),Kb.Intersect([Kb.Object({type:Kb.Literal("StellarBumpSequenceOp")}),Kv]),Kb.Intersect([Kb.Object({type:Kb.Literal("StellarClaimClaimableBalanceOp")}),Vv])]);const Mw=Kb.Object({source:Kb.String(),fee:Kb.Number(),counter:Kb.Number(),gas_limit:Kb.Number(),storage_limit:Kb.Number(),public_key:Kb.String()}),Rw=Kb.Object({destination:Kb.String(),amount:Kb.Number()}),Pw=Kb.Object({set_delegate:Kb.Optional(Kb.String()),cancel_delegate:Kb.Optional(Kb.Boolean()),transfer:Kb.Optional(Rw)}),Uw=Kb.Object({source:Kb.String(),destination:Kb.String(),amount:Kb.Number(),counter:Kb.Number(),fee:Kb.Number(),gas_limit:Kb.Number(),storage_limit:Kb.Number(),parameters:Kb.Optional(Kb.Array(Kb.Number())),parameters_manager:Kb.Optional(Pw)}),jw=Kb.Object({source:Kb.String(),balance:Kb.Number(),delegate:Kb.Optional(Kb.String()),script:gm,fee:Kb.Number(),counter:Kb.Number(),gas_limit:Kb.Number(),storage_limit:Kb.Number()}),Fw=Kb.Object({source:Kb.String(),delegate:Kb.String(),fee:Kb.Number(),counter:Kb.Number(),gas_limit:Kb.Number(),storage_limit:Kb.Number()}),Dw=Kb.Object({reveal:Kb.Optional(Mw),transaction:Kb.Optional(Uw),origination:Kb.Optional(jw),delegation:Kb.Optional(Fw)});Kb.Object({path:gm,branch:Kb.String(),operation:Dw,chunkify:Kb.Optional(Kb.Boolean())});const zw=Kb.Object({type:Kb.Literal("TransferContract"),parameter:Kb.Object({value:dy})}),$w=Kb.Object({type:Kb.Literal("TriggerSmartContract"),parameter:Kb.Object({value:fy})}),Ww=Kb.Object({type:Kb.Literal("FreezeBalanceV2Contract"),parameter:Kb.Object({value:cy})}),qw=Kb.Object({type:Kb.Literal("UnfreezeBalanceV2Contract"),parameter:Kb.Object({value:hy})}),Xw=Kb.Object({type:Kb.Literal("WithdrawExpireUnfreezeContract"),parameter:Kb.Object({value:my})}),Kw=Kb.Object({type:Kb.Literal("VoteWitnessContract"),parameter:Kb.Object({value:by})}),Hw=Kb.Union([zw,$w,Ww,qw,Xw,Kw]),Vw=Kb.Object({type:Kb.Literal("FreezeBalanceV2Contract"),parameter:Kb.Object({value:Kb.Union([Kb.Object({owner_address:Kb.String(),frozen_balance:Kb.Number(),balance:Kb.Optional(Kb.Number()),resource:Kb.Optional(sy)}),cy])})}),Gw=Kb.Object({type:Kb.Literal("UnfreezeBalanceV2Contract"),parameter:Kb.Object({value:Kb.Union([Kb.Object({owner_address:Kb.String(),unfreeze_balance:Kb.Number(),balance:Kb.Optional(Kb.Number()),resource:Kb.Optional(sy)}),hy])})}),Yw=Kb.Object({type:Kb.Literal("VoteWitnessContract"),parameter:Kb.Object({value:Kb.Union([Kb.Object({owner_address:Kb.String(),votes:Kb.Array(Kb.Object({vote_address:Kb.String(),vote_count:Kb.Number()}))}),by])})}),Jw=Kb.Union([zw,$w,Vw,Gw,Xw,Yw]);Kb.Object({path:gm,ref_block_bytes:Kb.String(),ref_block_hash:Kb.String(),expiration:Kb.Number(),timestamp:Kb.Number(),fee_limit:Kb.Optional(Kb.Number()),data:Kb.Optional(Kb.String()),contract:Kb.Array(Jw,{length:1})}),Kb.Object({signature:Kb.String(),serializedTx:Kb.Optional(Kb.String())}),Kb.Object({contract:Hw,blockHash:Kb.String(),blockHeight:Kb.Number(),fee_limit:Kb.Optional(Kb.Number()),data:Kb.Optional(Kb.String())}),Kb.Object({rawDataHex:Kb.String(),ref_block_bytes:Kb.String(),ref_block_hash:Kb.String(),expiration:Kb.Number(),timestamp:Kb.Number(),bandwidth:Kb.Number()}),Kb.Object({path:gm,key:Kb.String(),value:Kb.Union([Kb.String(),Kb.Buffer()]),encrypt:Kb.Optional(Kb.Boolean()),askOnEncrypt:Kb.Optional(Kb.Boolean()),askOnDecrypt:Kb.Optional(Kb.Boolean()),iv:Kb.Optional(Kb.Union([Kb.String(),Kb.Buffer()]))}),Kb.Composite([xv,Kb.Object({passphrase_source:Kb.Optional(Kb.Number())})]),Kb.Object({path:gm,coordinator:Kb.String(),maxRounds:Kb.Number(),maxCoordinatorFeeRate:Kb.Number(),maxFeePerKvbyte:Kb.Number(),coin:Kb.Optional(Kb.String()),scriptType:Kb.Optional(Jm),amountUnit:Kb.Optional(Mm),preauthorized:Kb.Optional(Kb.Boolean())}),Kb.Object({preauthorized:Kb.Optional(Kb.Boolean())}),Kb.Union([Kb.Object({binary:Kb.Optional(Kb.Undefined()),language:Kb.String(),baseUrl:Kb.Optional(Kb.String())}),Kb.Object({binary:Kb.ArrayBuffer(),language:Kb.Optional(Kb.Undefined()),baseUrl:Kb.Optional(Kb.Undefined())})]),yg.ICARUS,yg.ICARUS_TREZOR,yg.LEDGER,Kb.Object({path:gm,coin:Kb.String(),derivationType:Kb.Optional(wg),suppressBackupWarning:Kb.Optional(Kb.Boolean())}),Kb.Object({path:gm,coin:Kb.Optional(Kb.String()),multisig:Kb.Optional(Hm),scriptType:Kb.Optional(Jm)}),Kb.Object({path:gm,coin:Kb.Optional(Kb.String()),multisig:Kb.Optional(Hm),scriptType:Kb.Optional(Jm),userConfirmation:Kb.Optional(Kb.Boolean()),ownershipIds:Kb.Optional(Kb.Array(Kb.String(),{minItems:1})),commitmentData:Kb.Optional(Kb.String()),preauthorized:Kb.Optional(Kb.Boolean())}),Kb.Object({tx:Kb.Union([Kb.String(),Kb.Object({hex:Kb.String(),disableAlternativeRPC:Kb.Optional(Kb.Boolean())})]),coin:Kb.String(),identity:Kb.Optional(Kb.String())});const Zw=Kb.Object({challengeHidden:Kb.String(),challengeVisual:Kb.String(),origin:Kb.Optional(Kb.String()),asyncChallenge:Kb.Optional(Kb.Undefined()),callback:Kb.Optional(Kb.Undefined())});Kb.Union([Zw]),Kb.Object({path:gm,mac:Kb.Optional(Kb.String())});const Qw=new class{eventEmitter=new Vu;currentTarget;implementations;coreMode;implSettings;callPending=0;beforeCallSynchronize=Tu();constructor({implementations:e}){this.implementations=e,this.currentTarget="core-in-suite-desktop"}getTarget(){return this.implementations[this.currentTarget]}getTargetType(){return this.currentTarget}async switchTarget(e){if(this.currentTarget===e)return;if(!this.implSettings)throw Zc("Init_ManifestMissing");const t=this.getTargetType(),n=this.getTarget();try{this.currentTarget=e,await this.getTarget().init(this.implSettings),await n.dispose()}catch{this.currentTarget=t}}async init(e){this.coreMode=e.coreMode;const t=(e=>{if(e&&"string"==typeof e.email&&"string"==typeof e.appUrl&&!(void 0!==e.appName&&"string"!=typeof e.appName||void 0!==e.appIcon&&"string"!=typeof e.appIcon))return{email:e.email,appUrl:e.appUrl,appName:e.appName,appIcon:e.appIcon}})(e.manifest);if(!t)throw Zc("Init_ManifestMissing");this.implSettings={manifest:t,env:e.env,debug:e.debug,version:Hu(e.version)},this.currentTarget=this.getInitTarget(),this.callPending=0;try{return await this.getTarget().init(this.implSettings)}catch(e){if(await this.handleErrorFallback(e.code))return;throw e}}updateConnectSettings(e){return Promise.resolve(eu(Zc("Method_InvalidPackage","updateConnectSettings is not supported in this implementation")))}async call(e){try{0===this.callPending&&await this.beforeCallSynchronize(async()=>{this.callPending++,await this.handleBeforeCall()});const t=await this.getTarget().call(e);return!t.success&&await this.handleErrorFallback(t.error.code)?await this.getTarget().call(e):t}catch(e){return eu(e)}finally{this.callPending--}}cancel(e){return this.getTarget().cancel(e)}dispose(){return this.eventEmitter.removeAllListeners(),this.callPending=0,this.getTarget().dispose()}getInitTarget(){const{coreMode:e}=this;return"suite-desktop"===e?"core-in-suite-desktop":"suite-web"===e?"core-in-suite-web":(e&&"auto"!==e&&console.warn(`Invalid coreMode: ${e}`),"core-in-suite-desktop")}async handleBeforeCall(){const{coreMode:e}=this;"suite-desktop"!==e&&"auto"!==e&&void 0!==e||await this.switchTarget("core-in-suite-desktop")}async handleErrorFallback(e){return"core-in-suite-desktop"===this.getTargetType()&&("Desktop_ConnectionMissing"===e||"Method_Unsupported"===e)&&(await this.switchTarget("core-in-suite-web"),!0)}uiResponse(){throw Zc("Method_InvalidPackage")}}({implementations:{"core-in-suite-desktop":new class{manifest;version;ws;localNetworkPermissionState="unknown";constructor(){this.ws=new Ju({url:"ws://127.0.0.1:21335/connect-ws"})}dispose(){return this.manifest=void 0,this.version=void 0,this.ws.dispose(),Promise.resolve(void 0)}cancel(e){this.ws.sendMessage({type:ru,payload:e?{reason:e}:null})}async handshake(){if(!this.ws)throw Zc("Desktop_ConnectionMissing","No websocket connection");try{const e=await this.ws.sendMessage({type:au,payload:{settings:{manifest:this.manifest,version:this.version}}},{timeout:3e3});if(!e)throw Zc("Desktop_ConnectionMissing","No response");return e}catch(e){throw Zc("Desktop_ConnectionMissing",e.message)}}async init({manifest:e,version:t}){if("undefined"!=typeof navigator&&navigator?.permissions?.query){const e=await navigator.permissions.query({name:"local-network-access"}).catch(()=>{});e&&(this.localNetworkPermissionState=e.state,e.onchange=()=>{this.localNetworkPermissionState=e.state})}if(!e.appName)throw Zc("Init_ManifestMissing","Manifest is missing or manifest.appName is not set");return this.manifest=e,this.version=t,await this.connect()}error(e){return e instanceof Yu?"denied"===this.localNetworkPermissionState?Zc("Browser_LocalNetworkPermissionMissing"):Zc("Desktop_ConnectionMissing",e.message):e}async connect(){try{await this.ws.connect()}catch(e){throw this.error(e)}}async call(e){try{this.ws.isConnected()||await this.connect(),await this.handshake();const t=await this.ws.sendMessage({type:nu,payload:e},{timeout:0});if(!t)throw Zc("Desktop_ConnectionMissing","No response");return!1===t.success?{success:!1,error:t.error}:{success:!0,payload:t.payload,device:t.device}}catch(e){return{success:!1,error:Qc(this.error(e))}}}},"core-in-suite-web":new class{_popupManager;logger;constructor(){this.logger=rl("@trezor/connect-web")}dispose(){return Promise.resolve(void 0)}cancel(e){this.logger.debug("cancel",e),this._popupManager?.channel?.clearPendingSends(),this._popupManager?.channel?.postMessage({type:ru,payload:e?{reason:e}:null},{usePromise:!1})}init({env:e,manifest:t,version:n,debug:r}){if(this.logger.enabled=!!r,!this._popupManager){const r=e??(()=>{if("undefined"!=typeof chrome&&void 0!==chrome.runtime?.onConnect)return"webextension";if("undefined"!=typeof navigator){if("string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase())return"react-native";if(navigator.userAgent.toLowerCase().includes(" electron/"))return"electron"}return"web"})(),i={manifest:t,version:n,popupSrc:this.getSuiteUrl(),logger:this.logger};switch(r){case"webextension":this._popupManager=new gl(i);break;case"web":this._popupManager=new bl(i);break;default:this.logger.error("Unsupported environment for connect-web:",r)}}return this.logger.debug("initiated"),Promise.resolve()}getSuiteUrl(){return"undefined"!=typeof __SUITE_WEB_URL__&&__SUITE_WEB_URL__?`${__SUITE_WEB_URL__}/connect-popup`:"undefined"!=typeof window?al(window.location.href,window.location.origin):"https://suite.trezor.io/web/connect-popup"}async call(e){if(this.logger.debug("call",e),!this._popupManager)return eu(Zc("Init_NotInitialized"));try{this.logger.debug("call - awaiting popupManger.focusOrCreate()"),await this._popupManager.focusOrCreate(),this.logger.debug("call - popupManager.request() resolved"),await this._popupManager.channel.init(),this.logger.debug("call - popupManager.channel.init() resolved"),await(this._popupManager.handshakePromise?.promise),this.logger.debug("call - sending iframe.call");const t=await this._popupManager.channel.postMessage({type:nu,payload:e});if(this.logger.debug("call: response: ",t),!t?.payload)throw Zc("Method_NoResponse");if(t.payload.error&&t.payload.error.code)throw t.payload.error;return{success:t.payload.success,payload:t.payload.payload,device:t.payload.device}}catch(e){return this.logger.error("call: error",e),eu(e)}}}}}),ex=(({eventEmitter:e,init:t,call:n,updateConnectSettings:r,uiResponse:i,cancel:o,dispose:a},s={})=>{const c=Object.fromEntries(Gc.map(t=>[t,r=>n({...r,method:t,useEventListener:t.toLowerCase().endsWith("getaddress")?e.listenerCount(iu)>0:void 0})]));return{init:t,updateConnectSettings:r,on:e.on.bind(e),off:e.removeListener.bind(e),removeAllListeners:e.removeAllListeners.bind(e),uiResponse:i,call:n,dispose:a,cancel:o,...c,...s}})({eventEmitter:Qw.eventEmitter,init:Qw.init.bind(Qw),call:Qw.call.bind(Qw),uiResponse:Qw.uiResponse.bind(Qw),updateConnectSettings:Qw.updateConnectSettings.bind(Qw),cancel:Qw.cancel.bind(Qw),dispose:Qw.dispose.bind(Qw)});var tx,nx,rx,ix,ox,ax,sx,cx=null,ux=function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:if(!cx)throw new Error("BLUX: Trezor is not set up. Please check your store configuration.");return[4,cx];case 1:return e.sent(),[2]}})})},lx="m/44'/148'/0'",dx=function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:return[4,ex.stellarGetAddress({path:lx,showOnTrezor:!1})];case 1:if(!(e=t.sent()).success)throw new Error("BLUX: ".concat(e.payload.error));return[2,e.payload.address]}})})},fx={name:H.Trezor,website:"https://trezor.io",connect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,ux()];case 1:return e.sent(),[4,dx()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("BLUX: Failed to connect to Trezor.");case 4:return[2]}})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2]})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: Trezor does not support the getNetwork function")})})},isAvailable:function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){return e=ve().config,[2,"undefined"!=typeof window&&!!e.trezor]})})},signAuthEntry:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: Trezor does not support the signAuthEntry function")})})},signMessage:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: Trezor does not support the signMessage function")})})},signTransaction:function(e,t){return Q(void 0,void 0,void 0,function(){var n,i,o;return ee(this,function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,ux()];case 1:return a.sent(),[4,dx()];case 2:return n=a.sent(),i=new r(e,t.network),[4,ex.stellarSignTransaction({transaction:i,path:lx,networkPassphrase:t.network})];case 3:if(!(o=a.sent()).success)throw new Error("BLUX: ".concat(o.payload.error));return i.addSignature(n,Buffer.from(o.payload.signature,"hex").toString("base64")),[2,i.toXDR()];case 4:throw a.sent(),new Error("BLUX: Failed to sign the transaction with Trezor.");case 5:return[2]}})})}},hx=0,px=function(e,t){return new Promise(function(n,r){var i=++hx,o=function(e){var t,a;e.source===window&&"FREIGHTER_EXTERNAL_MSG_RESPONSE"===(null===(t=e.data)||void 0===t?void 0:t.source)&&(null===(a=e.data)||void 0===a?void 0:a.messagedId)===i&&(window.removeEventListener("message",o),e.data.apiError?r(e.data.apiError):n(e.data))};window.addEventListener("message",o),window.postMessage(J({source:"FREIGHTER_EXTERNAL_MSG_REQUEST",messageId:i,type:e},t),window.location.origin)})},bx=function(){var e;return"undefined"!=typeof window&&!!(null===(e=window.FordefiProviders)||void 0===e?void 0:e.StellarProvider)},mx={name:H.Fordefi,website:"https://www.fordefi.com",connect:function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),!bx())throw new Error("BLUX: Fordefi Wallet is not installed.");return[4,px("REQUEST_ACCESS")];case 1:if(!(e=t.sent().publicKey))throw new Error("BLUX: Failed to get address from Fordefi.");return[2,e];case 2:throw t.sent(),new Error("BLUX: Failed to connect to Fordefi.");case 3:return[2]}})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2]})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),!bx())throw new Error("BLUX: Fordefi Wallet is not installed.");return[4,px("REQUEST_NETWORK_DETAILS")];case 1:return[2,{network:(e=t.sent().networkDetails).network,passphrase:e.networkPassphrase}];case 2:throw t.sent(),new Error("BLUX: Failed to get network from Fordefi");case 3:return[2]}})})},isAvailable:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2,bx()]})})},signAuthEntry:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: Fordefi does not support the signAuthEntry function")})})},signMessage:function(e,t){return Q(void 0,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!bx())throw new Error("BLUX: Fordefi Wallet is not installed.");return[4,px("SUBMIT_BLOB",{blob:e,networkPassphrase:t.network,accountToSign:t.address})];case 1:if(!(n=r.sent().signedBlob))throw new Error("BLUX: Failed to sign message with Fordefi.");return[2,n];case 2:throw r.sent(),new Error("BLUX: Failed to sign message with Fordefi.");case 3:return[2]}})})},signTransaction:function(e,t){return Q(void 0,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!bx())throw new Error("BLUX: Fordefi Wallet is not installed.");return[4,px("SUBMIT_TRANSACTION",{transactionXdr:e,networkPassphrase:t.network,accountToSign:t.address})];case 1:if(!(n=r.sent().signedTransaction))throw new Error("BLUX: Failed to sign transaction with Fordefi.");return[2,n];case 2:throw r.sent(),new Error("BLUX: Failed to sign the transaction with Fordefi.");case 3:return[2]}})})}},gx={name:H.Freighter,website:"https://freighter.app",authenticateWithSignedMessage:!0,connect:function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,6]),[4,k()];case 1:if(!t.sent())throw new Error("BLUX: Freighter Wallet is not installed or connected.");return[4,I()];case 2:if((e=t.sent()).error&&"The user rejected this request."===e.error.message)throw new Error("BLUX: Failed to connect to Freighter");if(""===e.address.trim())throw new Error("BLUX: Failed to connect to Freighter.");return[2,e.address];case 3:return"Failed to connect to Freighter."!==t.sent().message?[3,5]:[4,gx.connect()];case 4:return[2,t.sent()];case 5:throw new Error("BLUX: Failed to connect to Freighter.");case 6:return[2]}})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2]})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,k()];case 1:if(!t.sent())throw new Error("BLUX: Freighter Wallet is not installed or connected.");return[4,O.getNetwork()];case 2:if((e=t.sent()).error)throw new Error("BLUX: Failed to get network from Freighter");return[2,{network:e.network,passphrase:e.networkPassphrase}];case 3:throw t.sent(),new Error("BLUX: Failed to disconnect from Rabet.");case 4:return[2]}})})},isAvailable:function(){return new Promise(function(e){var t=setTimeout(function(){e(!1)},700);setTimeout(function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(n){try{k().then(function(n){var r=n.isConnected,i=n.error;r?(clearTimeout(t),e(!i&&r)):setTimeout(function(){k().then(function(n){var r=n.isConnected,i=n.error;clearTimeout(t),e(!i&&r)})},350)}).catch(function(){clearTimeout(t),e(!1)})}catch(t){e(!1)}return[2]})})},450)})},signAuthEntry:function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i;return ee(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,k()];case 1:if(!o.sent())throw new Error("BLUX: Freighter Wallet is not installed or connected.");return[4,C(e,{address:t.address,networkPassphrase:t.network})];case 2:if(n=o.sent(),r=n.error,i=n.signedAuthEntry,r||!i)throw new Error("BLUX: Could not signedAuthEntry using Freighter");return[2,Buffer.from(i).toString("base64")];case 3:throw o.sent(),new Error("BLUX: Failed to sign the transaction with Freighter.");case 4:return[2]}})})},signMessage:function(e,t){return Q(void 0,void 0,void 0,function(){var n,r;return ee(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,T(e,{address:t.address})];case 1:if(n=i.sent(),r=n.signedMessage,n.error||!r)throw new Error("BLUX: Failed to sign message using Freighter");return[2,"string"==typeof r?r:Buffer.from(r).toString("base64")];case 2:throw i.sent(),new Error("BLUX: Failed to sign message using Freighter");case 3:return[2]}})})},signTransaction:function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,k()];case 1:if(!n.sent())throw new Error("BLUX: Freighter Wallet is not installed or connected.");return[4,N(e,{address:t.address,networkPassphrase:t.network})];case 2:return[2,n.sent().signedTxXdr];case 3:throw n.sent(),new Error("BLUX: Failed to sign the transaction with Freighter.");case 4:return[2]}})})}},vx={name:H.CactusLink,website:"https://www.mycactus.com",connect:function(){return Q(void 0,void 0,void 0,function(){var e,t;return ee(this,function(n){switch(n.label){case 0:if(n.trys.push([0,3,,4]),"undefined"==typeof window||!window.cactuslink_stellar)throw new Error("BLUX: Cactus Link Wallet is not installed.");return[4,window.cactuslink_stellar.requestAccess()];case 1:if((e=n.sent()).error)throw new Error("BLUX: ".concat(e.error));return[4,window.cactuslink_stellar.getAddress()];case 2:if(!(t=n.sent().address))throw new Error("BLUX: Getting the address from Cactus Link is not allowed, please request access first.");return[2,t];case 3:throw n.sent(),new Error("BLUX: Failed to connect to Cactus Link.");case 4:return[2]}})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2]})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){var e,t,n,r;return ee(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),"undefined"==typeof window||!window.cactuslink_stellar)throw new Error("BLUX: Cactus Link Wallet is not installed.");return[4,window.cactuslink_stellar.getNetwork()];case 1:if(e=i.sent(),t=e.network,n=e.networkPassphrase,r=e.error)throw new Error("BLUX: ".concat(r));return[2,{network:t,passphrase:n}];case 2:throw i.sent(),new Error("BLUX: Failed to get network from Cactus Link");case 3:return[2]}})})},isAvailable:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2,"undefined"!=typeof window&&!!window.cactuslink_stellar]})})},signAuthEntry:function(e,t){return Q(void 0,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),"undefined"==typeof window||!window.cactuslink_stellar)throw new Error("BLUX: Cactus Link Wallet is not installed.");return[4,window.cactuslink_stellar.signAuthEntry(e,{address:t.address,networkPassphrase:t.network})];case 1:if(!(n=r.sent().signedAuthEntry))throw new Error("BLUX: signedAuthEntry returned from Cactus Link is undefined.");return[2,n];case 2:throw r.sent(),new Error("BLUX: Failed to sign auth entry with Cactus Link.");case 3:return[2]}})})},signMessage:function(e,t){return Q(void 0,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),"undefined"==typeof window||!window.cactuslink_stellar)throw new Error("BLUX: Cactus Link Wallet is not installed.");return[4,window.cactuslink_stellar.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:if(!(n=r.sent().signedMessage))throw new Error("BLUX: signedMessage returned from Cactus Link is undefined.");return[2,n];case 2:throw r.sent(),new Error("BLUX: Failed to sign message with Cactus Link.");case 3:return[2]}})})},signTransaction:function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),"undefined"==typeof window||!window.cactuslink_stellar)throw new Error("BLUX: Cactus Link Wallet is not installed.");return[4,window.cactuslink_stellar.signTransaction(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,n.sent().signedTxXdr];case 2:throw n.sent(),new Error("BLUX: Failed to sign the transaction with Cactus Link.");case 3:return[2]}})})}},yx={name:H.WalletConnect,website:"https://walletconnect.com",isAvailable:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2,!!ve().config.walletConnect]})})},connect:function(){return Q(void 0,void 0,void 0,function(){var e,t,n;return ee(this,function(r){switch(r.label){case 0:if(!(e=ve().walletConnect)||!e.client)throw new Error("BLUX: WalletConnect client is not set up. Please check your store configuration.");r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.connection.approval()];case 2:if(t=r.sent(),!(n=t.namespaces.stellar)||!n.accounts[0])throw new Error("BLUX: Wallet did not approve the required Stellar namespace/account.");return[2,n.accounts[0].split(":").pop()];case 3:throw r.sent(),new Error("BLUX: Failed to connect to Wallet. Ensure your wallet supports Stellar WalletConnect.");case 4:return[2]}})})},disconnect:function(){return Q(void 0,void 0,void 0,function(){var e,t;return ee(this,function(n){switch(n.label){case 0:if(!(e=ve().walletConnect)||!e.client)throw new Error("BLUX: WalletConnect client is not set up.");n.label=1;case 1:return n.trys.push([1,3,,4]),0===(t=e.client.session.getAll()).length?[2]:[4,e.client.disconnect({topic:t[0].topic,reason:{code:6e3,message:"User explicitly disconnected."}})];case 2:return n.sent(),[3,4];case 3:throw n.sent(),new Error("BLUX: Failed to disconnect from Wallet Connect. Try closing the session in your mobile wallet.");case 4:return[2]}})})},getNetwork:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: Cannot reliably get the active network from WalletConnect without a specific session request.")})})},signTransaction:function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i,o;return ee(this,function(a){switch(a.label){case 0:if(!(n=ve().walletConnect)||!n.client)throw new Error("BLUX: WalletConnect client is not set up.");a.label=1;case 1:if(a.trys.push([1,3,,4]),0===(r=n.client.session.getAll()).length)throw new Error("BLUX: WalletConnect not connected. Please connect first.");return i=r[0],o=t.network===V.PUBLIC?Ne:ke,[4,n.client.request({topic:i.topic,chainId:o,request:{method:"stellar_signXDR",params:{xdr:e}}})];case 2:return[2,a.sent().signedXDR];case 3:throw a.sent(),new Error("BLUX: Failed to sign and submit the transaction with Wallet Connect.");case 4:return[2]}})})},signMessage:function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i,o,a,s;return ee(this,function(c){switch(c.label){case 0:if(!(n=ve().walletConnect)||!n.client)throw new Error("BLUX: WalletConnect client is not set up.");c.label=1;case 1:if(c.trys.push([1,3,,4]),0===(r=n.client.session.getAll()).length)throw new Error("BLUX: WalletConnect not connected. Please connect first.");return i=r[0],o=t.network===V.PUBLIC?Ne:ke,a=(null===(s=i.namespaces.stellar.chains)||void 0===s?void 0:s[0])||o,[4,n.client.request({topic:i.topic,chainId:a,request:{method:"stellar_signMessage",params:{message:e}}})];case 2:return[2,c.sent().signature];case 3:throw c.sent(),new Error("BLUX: Failed to sign message with Wallet Connect.");case 4:return[2]}})})},signAuthEntry:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){throw new Error("BLUX: Stellar Auth Entry signing is not supported via standard WalletConnect methods.")})})}},wx=((tx={})[H.Freighter]=gx,tx[H.Rabet]=Jo,tx[H.WalletConnect]=yx,tx[H.Hot]=Go,tx[H.Api]=qe,tx[H.Hana]=Yo,tx[H.Xbull]=Zo,tx[H.Lobstr]=ta,tx[H.Ledger]=Vc,tx[H.Albedo]=Qo,tx[H.Klever]=ea,tx[H.Bitget]=ra,tx[H.Onekey]=na,tx[H.CactusLink]=vx,tx[H.Fordefi]=mx,tx[H.Trezor]=fx,tx),xx=function(e,t){var n;return"wallet"===e.authMethod?null!==(n=t.find(function(t){return t.name===e.authValue}))&&void 0!==n?n:wx[e.authValue]:wx[H.Api]},Ax={mainnet:e.PUBLIC,testnet:e.TESTNET,sandbox:e.SANDBOX,futurenet:e.FUTURENET,standalone:e.STANDALONE},Ex=((nx={})[Ax.mainnet]="Mainnet",nx[Ax.testnet]="Testnet",nx[Ax.futurenet]="Futurenet",nx[Ax.standalone]="Standalone",nx[Ax.sandbox]="Sandbox",nx),Sx=((rx={})[Ax.mainnet]={name:"Mainnet",horizon:"https://horizon.stellar.org",soroban:"https://mainnet.sorobanrpc.com"},rx[Ax.testnet]={name:"Testnet",horizon:"https://horizon-testnet.stellar.org",soroban:"https://soroban-testnet.stellar.org"},rx[Ax.futurenet]={name:"Futurenet",horizon:"https://horizon-futurenet.stellar.org",soroban:"https://rpc-futurenet.stellar.org"},rx),_x={steexp:(ix={},ix[Ax.mainnet]="https://steexp.com",ix[Ax.testnet]="https://testnet.steexp.com",ix.ledgerUrl="ledger",ix.transactionUrl="tx",ix.accountUrl="account",ix),stellarexpert:(ox={},ox[Ax.mainnet]="https://stellar.expert/explorer/public",ox[Ax.testnet]="https://stellar.expert/explorer/testnet",ox.ledgerUrl="ledger",ox.accountUrl="account",ox.transactionUrl="tx",ox),lumenscan:(ax={},ax[Ax.mainnet]="https://lumenscan.io",ax[Ax.testnet]="https://testnet.lumenscan.io",ax.ledgerUrl="ledgers",ax.accountUrl="account",ax.operationUrl="ops",ax.transactionUrl="txns",ax),stellarchain:(sx={},sx[Ax.mainnet]="https://stellarchain.io",sx[Ax.testnet]="https://testnet.stellarchain.io",sx[Ax.futurenet]="https://futurenet.stellarchain.io",sx.ledgerUrl="ledgers",sx.accountUrl="accounts",sx.operationUrl="operations",sx.transactionUrl="transactions",sx)},Ox={logInOrSignUp:{en:"Log in or Sign up",es:"Inicia sesión o regístrate",pt:"Entre ou cadastre-se",fr:"Connexion ou inscription",de:"Anmelden oder registrieren",ru:"Вход или регистрация",zh:"登录或注册",ja:"ログイン / 登録",ko:"로그인 또는 가입",tr:"Giriş yap veya kaydol"},profile:{en:"Profile",es:"Perfil",pt:"Perfil",fr:"Profil",de:"Profil",ru:"Профиль",zh:"个人资料",ja:"プロフィール",ko:"프로필",tr:"Profil"},confirmation:{en:"Confirmation",es:"Confirmación",pt:"Confirmação",fr:"Confirmation",de:"Bestätigung",ru:"Подтверждение",zh:"确认",ja:"確認",ko:"확인",tr:"Onay"},send:{en:"Send",es:"Enviar",pt:"Enviar",fr:"Envoyer",de:"Senden",ru:"Отправить",zh:"发送",ja:"送金",ko:"보내기",tr:"Gönder"},activity:{en:"Activity",es:"Actividad",pt:"Atividade",fr:"Activité",de:"Aktivität",ru:"Активность",zh:"活动",ja:"アクティビティ",ko:"활동",tr:"İşlemler"},swap:{en:"Swap",es:"Intercambiar",pt:"Trocar",fr:"Échanger",de:"Tauschen",ru:"Обмен",zh:"兑换",ja:"スワップ",ko:"스왑",tr:"Takas"},receive:{en:"Receive",es:"Recibir",pt:"Receber",fr:"Recevoir",de:"Empfangen",ru:"Получить",zh:"接收",ja:"受け取る",ko:"받기",tr:"Al"},wrongNetwork:{en:"Wrong Network",es:"Red incorrecta",pt:"Rede incorreta",fr:"Mauvais réseau",de:"Falsches Netzwerk",ru:"Неверная сеть",zh:"错误的网络",ja:"ネットワークが違います",ko:"잘못된 네트워크",tr:"Yanlış ağ"},balances:{en:"Balances",es:"Saldos",pt:"Saldos",fr:"Soldes",de:"Guthaben",ru:"Балансы",zh:"余额",ja:"残高",ko:"잔액",tr:"Bakiyeler"},whatIsBlux:{en:"What is Blux",es:"Qué es Blux",pt:"O que é Blux",fr:"Qu’est-ce que Blux",de:"Was ist Blux",ru:"Что такое Blux",zh:"什么是 Blux",ja:"Bluxとは",ko:"Blux란",tr:"Blux nedir?"},addToken:{en:"Add Token",es:"Agregar token",pt:"Adicionar token",fr:"Ajouter un token",de:"Token hinzufügen",ru:"Добавить токен",zh:"添加代币",ja:"トークンを追加",ko:"토큰 추가",tr:"Token ekle"},signMessage:{en:"Sign Message",es:"Firmar mensaje",pt:"Assinar mensagem",fr:"Signer un message",de:"Nachricht signieren",ru:"Подписать сообщение",zh:"签名消息",ja:"メッセージに署名",ko:"메시지 서명",tr:"Mesajı imzala"},selectAsset:{en:"Select Asset",es:"Seleccionar activo",pt:"Selecionar ativo",fr:"Sélectionner un actif",de:"Asset auswählen",ru:"Выбор актива",zh:"选择资产",ja:"資産を選択",ko:"자산 선택",tr:"Varlık seç"},walletConnect:{en:"Wallet Connect",es:"Wallet Connect",pt:"Wallet Connect",fr:"Wallet Connect",de:"Wallet Connect",ru:"Wallet Connect",zh:"Wallet Connect",ja:"Wallet Connect",ko:"Wallet Connect",tr:"Wallet Connect"},acceptTermsAndPrivacy:{en:"By signing in or creating an account, you agree to our Terms and Conditions and Privacy Policy.",es:"Al iniciar sesión o crear una cuenta, aceptas nuestros Términos y Condiciones y nuestra Política de Privacidad.",pt:"Ao entrar ou criar uma conta, você concorda com nossos Termos e Condições e nossa Política de Privacidade.",fr:"En vous connectant ou en créant un compte, vous acceptez nos Conditions générales et notre Politique de confidentialité.",de:"Mit der Anmeldung oder Kontoerstellung stimmst du unseren Allgemeinen Geschäftsbedingungen und unserer Datenschutzerklärung zu.",ru:"Входя в систему или создавая аккаунт, вы соглашаетесь с нашими Условиями использования и Политикой конфиденциальности.",zh:"登录或创建账户即表示您同意我们的条款和条件以及隐私政策。",ja:"ログインまたはアカウントを作成することで、利用規約およびプライバシーポリシーに同意したものとみなされます。",ko:"로그인하거나 계정을 만들면 이용약관과 개인정보 처리방침에 동의하게 됩니다.",tr:"Giriş yapınca veya hesap açınca Şartlar ve Gizlilik Politikası’nı kabul etmiş olursun."},receiveFunds:{en:"Receive Funds",es:"Recibir fondos",pt:"Receber fundos",fr:"Recevoir des fonds",de:"Geld empfangen",ru:"Получить средства",zh:"接收资金",ja:"資金を受け取る",ko:"자금 받기",tr:"Para al"},addFunds:{en:"Add Funds",es:"Agregar fondos",pt:"Adicionar fundos",fr:"Ajouter des fonds",de:"Geld hinzufügen",ru:"Пополнить",zh:"充值",ja:"資金を追加",ko:"자금 추가",tr:"Para ekle"},termsAndConditions:{en:"Terms and Conditions",es:"Términos y condiciones",pt:"Termos e condições",fr:"Conditions générales",de:"Allgemeine Geschäftsbedingungen",ru:"Условия использования",zh:"条款和条件",ja:"利用規約",ko:"이용약관",tr:"Şartlar ve Koşullar"},loading:{en:"Loading",es:"Cargando",pt:"Carregando",fr:"Chargement",de:"Wird geladen",ru:"Загрузка",zh:"加载中",ja:"読み込み中",ko:"로딩 중",tr:"Yükleniyor"},tryAgain:{en:"Try again",es:"Intenta de nuevo",pt:"Tente novamente",fr:"Réessayer",de:"Erneut versuchen",ru:"Попробовать снова",zh:"重试",ja:"再試行",ko:"다시 시도",tr:"Tekrar dene"},back:{en:"Back",es:"Atrás",pt:"Voltar",fr:"Retour",de:"Zurück",ru:"Назад",zh:"返回",ja:"戻る",ko:"뒤로",tr:"Geri"},continueWith:{en:"Continue with ${provider}",es:"Continuar con ${provider}",pt:"Continuar com ${provider}",fr:"Continuer avec ${provider}",de:"Weiter mit ${provider}",ru:"Продолжить с ${provider}",zh:"使用 ${provider} 继续",ja:"${provider} で続ける",ko:"${provider}로 계속",tr:"${provider} ile devam et"},socialPopupHelp:{en:"Continue in the ${provider} window to finish signing in",es:"Continúa en la ventana de ${provider} para terminar de iniciar sesión",pt:"Continue na janela do ${provider} para concluir o login",fr:"Poursuivez dans la fenêtre ${provider} pour terminer la connexion",de:"Fahre im ${provider}-Fenster fort, um die Anmeldung abzuschließen",ru:"Продолжите в окне ${provider}, чтобы завершить вход",zh:"请在 ${provider} 窗口中完成登录",ja:"${provider} のウィンドウでログインを完了してください",ko:"${provider} 창에서 로그인을 완료하세요",tr:"Girişi bitirmek için ${provider} penceresine geç"},connecting:{en:"Connecting",es:"Conectando",pt:"Conectando",fr:"Connexion",de:"Verbinden",ru:"Подключение",zh:"连接中",ja:"接続中",ko:"연결 중",tr:"Bağlanıyor"},signing:{en:"Signing",es:"Firmando",pt:"Assinando",fr:"Signature",de:"Signieren",ru:"Подписание",zh:"签名中",ja:"署名中",ko:"서명 중",tr:"İmzalanıyor"},or:{en:"or",es:"o",pt:"ou",fr:"ou",de:"oder",ru:"или",zh:"或",ja:"または",ko:"또는",tr:"veya"},recent:{en:"Recent",es:"Reciente",pt:"Recente",fr:"Récent",de:"Zuletzt",ru:"Недавний",zh:"最近",ja:"最近",ko:"최근",tr:"Son"},allStellarWallets:{en:"All Stellar wallets",es:"Todas las wallets",pt:"Todas as wallets",fr:"Tous les wallets",de:"Alle Wallets",ru:"Все кошельки",zh:"所有 Stellar 钱包",ja:"すべてのウォレット",ko:"모든 지갑",tr:"Tüm cüzdanlar"},email:{en:"Email",es:"Correo electrónico",pt:"E-mail",fr:"E-mail",de:"E-Mail",ru:"Эл. почта",zh:"电子邮箱",ja:"メールアドレス",ko:"이메일",tr:"E-posta"},logInWithPasskey:{en:"Log in with Passkey",es:"Entrar con Passkey",pt:"Entrar com Passkey",fr:"Connexion Passkey",de:"Mit Passkey anmelden",ru:"Войти с Passkey",zh:"使用通行密钥登录",ja:"パスキーでログイン",ko:"패스키로 로그인",tr:"Passkey ile giriş yap"},submit:{en:"Submit",es:"Enviar",pt:"Enviar",fr:"Envoyer",de:"Absenden",ru:"Отправить",zh:"提交",ja:"送信",ko:"제출",tr:"Gönder"},poweredByBlux:{en:"Powered by Blux.cc",es:"Desarrollado por Blux.cc",pt:"Desenvolvido por Blux.cc",fr:"Propulsé par Blux.cc",de:"Powered by Blux.cc",ru:"Работает на Blux.cc",zh:"由 Blux.cc 提供支持",ja:"Powered by Blux.cc",ko:"Powered by Blux.cc",tr:"Powered by Blux.cc"},reviewAndAcceptPrompt:{en:"Read the documents below, then agree to continue.",es:"Revisa los documentos a continuación y acepta para continuar.",pt:"Revise os documentos abaixo e aceite para continuar.",fr:"Consultez les documents ci-dessous, puis acceptez pour continuer.",de:"Lies die Dokumente unten und stimme zu, um weiterzumachen.",ru:"Ознакомьтесь с документами ниже и примите их, чтобы продолжить.",zh:"请查看以下文件,然后同意以继续。",ja:"下の書類を確認して、同意すると続けられます。",ko:"아래 문서를 검토한 후 동의하여 계속하세요.",tr:"Aşağıdaki belgelere bak, devam etmek için kabul et."},termsOfService:{en:"Terms of Service",es:"Términos de servicio",pt:"Termos de serviço",fr:"Conditions d’utilisation",de:"Nutzungsbedingungen",ru:"Условия обслуживания",zh:"服务条款",ja:"利用規約",ko:"서비스 약관",tr:"Hizmet Şartları"},privacyPolicy:{en:"Privacy Policy",es:"Política de privacidad",pt:"Política de privacidade",fr:"Politique de confidentialité",de:"Datenschutzerklärung",ru:"Политика конфиденциальности",zh:"隐私政策",ja:"プライバシーポリシー",ko:"개인정보 처리방침",tr:"Gizlilik Politikası"},openLink:{en:"Open link",es:"Abrir enlace",pt:"Abrir link",fr:"Ouvrir le lien",de:"Link öffnen",ru:"Открыть ссылку",zh:"打开链接",ja:"リンクを開く",ko:"링크 열기",tr:"Bağlantıyı aç"},noLegalLinksProvided:{en:"This app didn’t provide any legal links.",es:"Esta app no tiene enlaces legales.",pt:"Este app não informou links legais.",fr:"Cette app n’a pas fourni de liens légaux.",de:"Für diese App gibt’s keine rechtlichen Links.",ru:"Для этого приложения нет юридических ссылок.",zh:"此应用未提供法律条款链接。",ja:"このアプリには法的リンクがありません。",ko:"이 앱에는 법적 링크가 없어요.",tr:"Bu uygulamada yasal link yok."},agree:{en:"Accept & Continue",es:"Aceptar y continuar",pt:"Aceitar e continuar",fr:"Accepter et continuer",de:"Akzeptieren & fortfahren",ru:"Принять и продолжить",zh:"接受并继续",ja:"同意して続行",ko:"동의 및 계속",tr:"Kabul et ve devam et"},disagree:{en:"No thanks",es:"No, gracias",pt:"Não, obrigado",fr:"Non merci",de:"Nein danke",ru:"Нет, спасибо",zh:"不用了,谢谢",ja:"同意しない",ko:"괜찮습니다",tr:"Hayır, teşekkürler"},connectionSuccessfulTitle:{en:"Connection Successful",es:"Conexión exitosa",pt:"Conexão feita",fr:"Connexion réussie",de:"Verbindung erfolgreich",ru:"Подключение выполнено",zh:"连接成功",ja:"接続できました",ko:"연결 성공",tr:"Bağlantı başarılı"},connectionSuccessfulMessage:{en:"Your account is connected to ${appName}",es:"Tu cuenta ya está conectada a ${appName}",pt:"Sua conta foi conectada a ${appName}",fr:"Votre compte est connecté à ${appName}",de:"Dein Konto ist mit ${appName} verbunden",ru:"Аккаунт подключён к ${appName}",zh:"您的账户已连接到 ${appName}",ja:"アカウントが ${appName} に接続されました",ko:"계정이 ${appName}에 연결되었습니다",tr:"Hesabın ${appName} ile bağlandı"},transactionSuccessfulTitle:{en:"Transaction Successful",es:"Transacción exitosa",pt:"Transação concluída",fr:"Transaction réussie",de:"Transaktion erfolgreich",ru:"Транзакция выполнена",zh:"交易成功",ja:"取引が完了しました",ko:"거래 성공",tr:"İşlem başarılı"},transactionSuccessfulMessage:{en:"Your transaction went through",es:"Tu transacción se completó",pt:"Sua transação foi concluída",fr:"Votre transaction est terminée",de:"Deine Transaktion ist durch",ru:"Транзакция прошла",zh:"交易已完成",ja:"取引が完了しました",ko:"거래가 완료되었습니다",tr:"İşlemin tamamlandı"},messageSignedTitle:{en:"Message Signed",es:"Mensaje firmado",pt:"Mensagem assinada",fr:"Message signé",de:"Nachricht signiert",ru:"Сообщение подписано",zh:"消息已签名",ja:"メッセージに署名しました",ko:"메시지 서명 완료",tr:"Mesaj imzalandı"},messageSignedMessage:{en:"Your message is signed.",es:"Tu mensaje está firmado.",pt:"Sua mensagem foi assinada.",fr:"Votre message est signé.",de:"Deine Nachricht ist signiert.",ru:"Сообщение подписано.",zh:"消息已签名。",ja:"メッセージに署名しました。",ko:"메시지가 서명되었습니다.",tr:"Mesajın imzalandı."},authEntrySignedTitle:{en:"Authorization Signed",es:"Autorización firmada",pt:"Autorização assinada",fr:"Autorisation signée",de:"Autorisierung signiert",ru:"Авторизация подписана",zh:"授权已签名",ja:"承認に署名しました",ko:"승인 서명 완료",tr:"Yetkilendirme imzalandı"},authEntrySignedMessage:{en:"Authorization is signed.",es:"La autorización está firmada.",pt:"A autorização foi assinada.",fr:"L’autorisation est signée.",de:"Die Autorisierung ist signiert.",ru:"Авторизация подписана.",zh:"授权已签名。",ja:"承認に署名しました。",ko:"승인이 서명되었습니다.",tr:"Yetkilendirme imzalandı."},seeInExplorer:{en:"See in explorer",es:"Ver en el explorer",pt:"Ver no explorer",fr:"Voir dans l’explorer",de:"Im Explorer ansehen",ru:"Открыть в Explorer",zh:"在区块浏览器中查看",ja:"エクスプローラーで見る",ko:"익스플로러에서 보기",tr:"Explorer’da gör"},loggingIn:{en:"Logging In",es:"Iniciando sesión",pt:"Entrando",fr:"Connexion en cours",de:"Anmeldung läuft",ru:"Выполняется вход",zh:"登录中",ja:"ログイン中",ko:"로그인 중",tr:"Giriş yapılıyor"},done:{en:"Done",es:"Hecho",pt:"Pronto",fr:"Terminé",de:"Fertig",ru:"Готово",zh:"完成",ja:"完了",ko:"완료",tr:"Tamam"},signTransactionPrompt:{en:"wants your permission to approve the following transaction.",es:"quiere tu permiso para aprobar la siguiente transacción.",pt:"quer sua permissão para aprovar a seguinte transação.",fr:"demande votre autorisation pour approuver la transaction suivante.",de:"bittet um deine Erlaubnis, die folgende Transaktion zu genehmigen.",ru:"запрашивает ваше разрешение на одобрение следующей транзакции.",zh:"请求您批准以下交易。",ja:"が次の取引の承認を求めています。",ko:"다음 거래의 승인을 요청합니다.",tr:"şu işlemi onaylamanı istiyor."},invalidXdr:{en:"Invalid XDR",es:"XDR inválido",pt:"XDR inválido",fr:"XDR invalide",de:"Ungültiger XDR",ru:"Недействительный XDR",zh:"无效的 XDR",ja:"無効な XDR",ko:"잘못된 XDR",tr:"Geçersiz XDR"},lobstrWarning:{en:"Make sure your LOBSTR wallet is on the ${network} network, or the transaction will fail.",es:"Asegúrate de que tu cartera LOBSTR esté configurada en la red ${network}. De lo contrario, la transacción fallará.",pt:"Certifique-se de que sua carteira LOBSTR esteja configurada na rede ${network}. Caso contrário, a transação falhará.",fr:"Assurez-vous que votre portefeuille LOBSTR est réglé sur le réseau ${network}, sinon la transaction échouera.",de:"Stelle sicher, dass deine LOBSTR-Wallet auf das ${network}-Netzwerk eingestellt ist, sonst schlägt die Transaktion fehl.",ru:"Убедитесь, что ваш кошелёк LOBSTR настроен на сеть ${network}, иначе транзакция не пройдёт.",zh:"请确认 LOBSTR 钱包已切换到 ${network} 网络,否则交易会失败。",ja:"LOBSTR ウォレットが ${network} ネットワークになっているか確認して。違うと取引は失敗します。",ko:"LOBSTR 지갑이 ${network} 네트워크로 설정되어 있는지 확인하세요. 그렇지 않으면 거래가 실패합니다.",tr:"LOBSTR cüzdanın ${network} ağında olsun. Değilse işlem düşer."},yourWallet:{en:"Your wallet",es:"Tu wallet",pt:"Sua wallet",fr:"Votre wallet",de:"Deine Wallet",ru:"Ваш кошелёк",zh:"您的钱包",ja:"あなたのウォレット",ko:"내 지갑",tr:"Cüzdanınız"},noAddressFound:{en:"No address found",es:"No se encontró ninguna dirección",pt:"Nenhum endereço encontrado",fr:"Aucune adresse trouvée",de:"Keine Adresse gefunden",ru:"Адрес не найден",zh:"未找到地址",ja:"アドレスが見つかりません",ko:"주소를 찾을 수 없습니다",tr:"Adres bulunamadı"},approve:{en:"Approve",es:"Aprobar",pt:"Aprovar",fr:"Approuver",de:"Genehmigen",ru:"Одобрить",zh:"批准",ja:"承認",ko:"승인",tr:"Onayla"},loadingActivity:{en:"Loading activity...",es:"Cargando actividad...",pt:"Carregando atividade...",fr:"Chargement de l’activité...",de:"Aktivität wird geladen...",ru:"Загрузка активности...",zh:"正在加载活动记录...",ja:"取引履歴を読み込み中...",ko:"활동을 불러오는 중...",tr:"Aktivite yükleniyor..."},noActivityFound:{en:"No activity found",es:"No se encontró actividad",pt:"Nenhuma atividade encontrada",fr:"Aucune activité trouvée",de:"Keine Aktivität gefunden",ru:"Активность не найдена",zh:"暂无活动记录",ja:"取引履歴がありません",ko:"활동 내역이 없습니다",tr:"Aktivite bulunamadı"},multiOperation:{en:"Multi Operation",es:"Operación múltiple",pt:"Operação múltipla",fr:"Opérations multiples",de:"Mehrere Operationen",ru:"Несколько операций",zh:"多操作",ja:"複数オペレーション",ko:"다중 작업",tr:"Çoklu işlem"},pathPaymentDescription:{en:"Path payment of ${amount} ${asset}",es:"Pago por ruta de ${amount} ${asset}",pt:"Pagamento por rota de ${amount} ${asset}",fr:"Paiement par chemin de ${amount} ${asset}",de:"Pfadzahlung über ${amount} ${asset}",ru:"Платёж по маршруту на ${amount} ${asset}",zh:"${amount} ${asset} 的路径支付",ja:"${amount} ${asset} のパスペイメント",ko:"${amount} ${asset} 경로 결제",tr:"${amount} ${asset} yol ödemesi"},seeAllInExplorer:{en:"See all in explorer",es:"Ver todo en el explorer",pt:"Ver tudo no explorer",fr:"Tout voir dans l’explorer",de:"Alles im Explorer ansehen",ru:"Смотреть всё в Explorer",zh:"在区块浏览器中查看全部",ja:"エクスプローラーですべて見る",ko:"익스플로러에서 전체 보기",tr:"Tümünü explorer’da gör"},enterConfirmationCodeTitle:{en:"Enter confirmation code",es:"Introduce el código de confirmación",pt:"Digite o código de confirmação",fr:"Code de confirmation",de:"Bestätigungscode eingeben",ru:"Введите код подтверждения",zh:"输入确认码",ja:"確認コードを入力",ko:"확인 코드 입력",tr:"Onay kodunu gir"},enterConfirmationCodeHelp:{en:"Check your email and enter the code below",es:"Revisa tu correo e introduce el código abajo",pt:"Verifique seu e-mail e digite o código de confirmação abaixo",fr:"Vérifiez votre e-mail et saisissez le code ci-dessous",de:"Prüfe deine E-Mails und gib den Bestätigungscode unten ein",ru:"Проверьте почту и введите код подтверждения ниже",zh:"请查收您的电子邮件,并在下方输入确认码",ja:"メールを確認して、下にコードを入力して",ko:"이메일을 확인하고 아래에 확인 코드를 입력하세요",tr:"Mailine bak, kodu aşağıya yaz"},invalidCodeError:{en:"Invalid code. Try again.",es:"Código incorrecto. Inténtalo de nuevo.",pt:"Código inválido, tente novamente.",fr:"Code incorrect. Réessayez.",de:"Falscher Code. Versuch’s nochmal.",ru:"Неверный код, попробуйте ещё раз.",zh:"验证码无效,请重试。",ja:"コードが違います。もう一度。",ko:"잘못된 코드입니다. 다시 시도하세요.",tr:"Kod yanlış. Bir daha dene."},resendCode:{en:"Resend code",es:"Reenviar código",pt:"Reenviar código",fr:"Renvoyer le code",de:"Code erneut senden",ru:"Отправить код повторно",zh:"重新发送验证码",ja:"コードを再送信",ko:"코드 재전송",tr:"Kodu yeniden gönder"},copied:{en:"Copied!",es:"¡Copiado!",pt:"Copiado!",fr:"Copié !",de:"Kopiert!",ru:"Скопировано!",zh:"已复制!",ja:"コピーしました!",ko:"복사됨!",tr:"Kopyalandı!"},logout:{en:"Logout",es:"Cerrar sesión",pt:"Sair",fr:"Déconnexion",de:"Abmelden",ru:"Выйти",zh:"退出登录",ja:"ログアウト",ko:"로그아웃",tr:"Çıkış yap"},search:{en:"Search",es:"Buscar",pt:"Buscar",fr:"Rechercher",de:"Suchen",ru:"Поиск",zh:"搜索",ja:"検索",ko:"검색",tr:"Ara"},noAssetsFound:{en:"No assets found",es:"No se encontraron activos",pt:"Nenhum ativo encontrado",fr:"Aucun actif trouvé",de:"Keine Assets gefunden",ru:"Активы не найдены",zh:"未找到资产",ja:"資産が見つかりません",ko:"자산을 찾을 수 없습니다",tr:"Varlık bulunamadı"},amount:{en:"Amount",es:"Cantidad",pt:"Quantia",fr:"Montant",de:"Betrag",ru:"Сумма",zh:"金额",ja:"金額",ko:"금액",tr:"Tutar"},max:{en:"Max",es:"Máx",pt:"Máx",fr:"Max",de:"Max",ru:"Макс",zh:"最大",ja:"最大",ko:"최대",tr:"Maks"},from:{en:"From",es:"De",pt:"De",fr:"De",de:"Von",ru:"Из",zh:"从",ja:"送信元",ko:"보냄",tr:"Kimden"},to:{en:"To",es:"A",pt:"Para",fr:"Vers",de:"An",ru:"Куда",zh:"至",ja:"送信先",ko:"받음",tr:"Kime"},enterAddress:{en:"Enter address",es:"Introduce la dirección",pt:"Digite o endereço",fr:"Saisissez l’adresse",de:"Adresse eingeben",ru:"Введите адрес",zh:"输入地址",ja:"アドレスを入力",ko:"주소 입력",tr:"Adres girin"},addressRequired:{en:"Address is required",es:"La dirección es obligatoria",pt:"O endereço é obrigatório",fr:"L’adresse est requise",de:"Adresse ist erforderlich",ru:"Укажите адрес",zh:"地址为必填项",ja:"アドレスは必須です",ko:"주소는 필수입니다",tr:"Adres gerekli"},addressInvalid:{en:"Address is invalid",es:"La dirección es inválida",pt:"O endereço é inválido",fr:"L’adresse est invalide",de:"Adresse ist ungültig",ru:"Недействительный адрес",zh:"地址无效",ja:"アドレスが無効です",ko:"주소가 잘못되었습니다",tr:"Adres geçersiz"},inactiveAccount:{en:"Account is inactive",es:"La cuenta está inactiva",pt:"A conta está inativa",fr:"Le compte est inactif",de:"Konto ist inaktiv",ru:"Аккаунт неактивен",zh:"账户未激活",ja:"アカウントが有効化されていません",ko:"계정이 비활성 상태입니다",tr:"Hesap etkin değil"},memo:{en:"Memo",es:"Memo",pt:"Memo",fr:"Mémo",de:"Memo",ru:"Мемо",zh:"备注 (Memo)",ja:"メモ",ko:"메모",tr:"Memo"},enterMemo:{en:"Enter Memo",es:"Introduce el memo",pt:"Digite o memo",fr:"Saisissez le mémo",de:"Memo eingeben",ru:"Введите мемо",zh:"输入备注",ja:"メモを入力",ko:"메모 입력",tr:"Memo girin"},optional:{en:"optional",es:"opcional",pt:"opcional",fr:"facultatif",de:"optional",ru:"необязательно",zh:"可选",ja:"任意",ko:"선택",tr:"isteğe bağlı"},paste:{en:"Paste",es:"Pegar",pt:"Colar",fr:"Coller",de:"Einfügen",ru:"Вставить",zh:"粘贴",ja:"貼り付け",ko:"붙여넣기",tr:"Yapıştır"},amountRequired:{en:"Amount is required",es:"La cantidad es obligatoria",pt:"A quantia é obrigatória",fr:"Le montant est requis",de:"Betrag ist erforderlich",ru:"Укажите сумму",zh:"金额为必填项",ja:"金額は必須です",ko:"금액은 필수입니다",tr:"Tutar gerekli"},amountExceedsBalance:{en:"Amount is greater than max balance",es:"La cantidad excede el saldo máximo",pt:"A quantia excede o saldo máximo",fr:"Le montant dépasse le solde maximal",de:"Betrag übersteigt das maximale Guthaben",ru:"Сумма превышает доступный баланс",zh:"金额超过最大余额",ja:"金額が残高を超えています",ko:"금액이 최대 잔액을 초과합니다",tr:"Tutar maksimum bakiyeyi aşıyor"},sendButton:{en:"Send",es:"Enviar",pt:"Enviar",fr:"Envoyer",de:"Senden",ru:"Отправить",zh:"发送",ja:"送金",ko:"보내기",tr:"Gönder"},loginFailed:{en:"Login failed",es:"No se pudo iniciar sesión",pt:"Falha no login",fr:"Échec de la connexion",de:"Anmeldung fehlgeschlagen",ru:"Не удалось войти",zh:"登录失败",ja:"ログインに失敗しました",ko:"로그인 실패",tr:"Giriş başarısız"},accessDeniedTitle:{en:"Access denied",es:"Acceso denegado",pt:"Acesso negado",fr:"Accès refusé",de:"Zugriff verweigert",ru:"Доступ запрещён",zh:"访问被拒绝",ja:"アクセスが拒否されました",ko:"접근이 거부되었습니다",tr:"Erişim reddedildi"},accessDeniedHelp:{en:"This app doesn’t allow this account to sign in. Try another one, or contact the app’s team if that seems wrong.",es:"Esta app no deja entrar con esta cuenta. Prueba con otra, o habla con el equipo de la app si crees que es un error.",pt:"Este app não deixa esta conta entrar. Tente outra, ou fale com o time do app se achar que é engano.",fr:"Cette app n’autorise pas ce compte. Essayez-en un autre, ou contactez l’équipe si cela vous semble une erreur.",de:"Diese App lässt dieses Konto nicht zu. Versuch ein anderes, oder schreib dem App-Team, falls das ein Fehler ist.",ru:"Это приложение не пускает этот аккаунт. Попробуйте другой или напишите команде, если это ошибка.",zh:"此应用不允许该账户登录。请换一个账户,若有疑问可联系应用团队。",ja:"このアプリではこのアカウントは使えません。別のアカウントを試すか、誤りだと思ったら運営に連絡して。",ko:"이 앱은 이 계정으로 로그인할 수 없어요. 다른 계정으로 시도하거나, 잘못된 것 같으면 앱 팀에 문의하세요.",tr:"Bu uygulama bu hesaba izin vermiyor. Başka hesap dene; hata olduğunu düşünüyorsan ekibe yaz."},signingFailed:{en:"Signing with ${walletName} failed",es:"La firma con ${walletName} falló",pt:"A assinatura com ${walletName} falhou",fr:"La signature avec ${walletName} a échoué",de:"Signieren mit ${walletName} fehlgeschlagen",ru:"Не удалось подписать с помощью ${walletName}",zh:"使用 ${walletName} 签名失败",ja:"${walletName} での署名に失敗しました",ko:"${walletName} 서명에 실패했습니다",tr:"${walletName} ile imzalama başarısız oldu"},waitingFor:{en:"Waiting for ${walletName}",es:"Esperando a ${walletName}",pt:"Aguardando ${walletName}",fr:"En attente de ${walletName}",de:"Warte auf ${walletName}",ru:"Ожидание ${walletName}",zh:"等待 ${walletName}",ja:"${walletName} を待っています",ko:"${walletName} 대기 중",tr:"${walletName} bekleniyor"},signingWith:{en:"Signing with ${walletName}",es:"Firmando con ${walletName}",pt:"Assinando com ${walletName}",fr:"Signature avec ${walletName}",de:"Signieren mit ${walletName}",ru:"Подписание через ${walletName}",zh:"正在使用 ${walletName} 签名",ja:"${walletName} で署名中",ko:"${walletName}(으)로 서명 중",tr:"${walletName} ile imzalanıyor"},loginRetryMessage:{en:"Try logging in again.",es:"Intenta iniciar sesión otra vez.",pt:"Tente entrar de novo.",fr:"Réessayez de vous connecter.",de:"Versuch dich nochmal anzumelden.",ru:"Попробуйте войти ещё раз.",zh:"请再试一次登录。",ja:"もう一度ログインしてみて。",ko:"다시 로그인해 보세요.",tr:"Tekrar giriş yapmayı dene."},signingRetryMessage:{en:"Try signing again.",es:"Intenta firmar otra vez.",pt:"Tente assinar de novo.",fr:"Réessayez de signer.",de:"Versuch nochmal zu signieren.",ru:"Попробуйте подписать ещё раз.",zh:"请再试一次签名。",ja:"もう一度署名してみて。",ko:"다시 서명해 보세요.",tr:"Tekrar imzalamayı dene."},acceptConnection:{en:"Accept connection",es:"Aceptar la conexión",pt:"Aceitar a conexão",fr:"Accepter la connexion",de:"Verbindung akzeptieren",ru:"Подтвердите подключение",zh:"接受连接",ja:"接続を承認",ko:"연결 수락",tr:"Bağlantıyı kabul et"},signRequestInWallet:{en:"Sign the request in your wallet",es:"Firma la solicitud en tu wallet",pt:"Assine o pedido na sua wallet",fr:"Signez la demande dans votre wallet",de:"Signiere die Anfrage in deiner Wallet",ru:"Подпишите запрос в своём кошельке",zh:"请在您的钱包中签署该请求",ja:"ウォレットでリクエストに署名して",ko:"지갑에서 요청에 서명하세요",tr:"İsteği cüzdanında imzala"},wrongNetworkMessage:{en:"You’re on Stellar ${currentNetwork}. Switch to Stellar ${switchNetwork} to keep using this app.",es:"Estás en Stellar ${currentNetwork}. Cambia a Stellar ${switchNetwork} para seguir usando la app.",pt:"Você está na Stellar ${currentNetwork}. Mude para a Stellar ${switchNetwork} para continuar.",fr:"Vous êtes sur Stellar ${currentNetwork}. Passez sur Stellar ${switchNetwork} pour continuer.",de:"Du bist derzeit mit dem Stellar-${currentNetwork} verbunden. Wechsle zum Stellar-${switchNetwork}, um diese App weiter zu nutzen.",ru:"Сейчас вы подключены к сети Stellar ${currentNetwork}. Переключитесь на сеть Stellar ${switchNetwork}, чтобы продолжить пользоваться приложением.",zh:"您当前连接的是 Stellar ${currentNetwork}。请切换到 Stellar ${switchNetwork} 以继续使用此应用。",ja:"いま Stellar の ${currentNetwork} にいます。このアプリを使うには ${switchNetwork} に切り替えて。",ko:"현재 Stellar ${currentNetwork}에 연결되어 있습니다. 이 앱을 계속 사용하려면 Stellar ${switchNetwork}(으)로 전환하세요.",tr:"Şu an Stellar ${currentNetwork} ağındasın. Devam etmek için ${switchNetwork} ağına geç."},wallet_infra:{en:"Wallet Infrastructure for Stellar dapps",es:"Infraestructura de wallets para dapps en Stellar",pt:"Infraestrutura de wallets para dapps na Stellar",fr:"Infra wallet pour les dapps Stellar",de:"Wallet-Infrastruktur für Stellar-Dapps",ru:"Инфраструктура кошельков для Stellar dapp",zh:"面向 Stellar dapp 的钱包基础设施",ja:"Stellar dApp のためのウォレットインフラ",ko:"Stellar dApp을 위한 지갑 인프라",tr:"Stellar dapp’ler için cüzdan altyapısı"},blux_gateway:{en:"Blux is your gateway to Stellar. Create a wallet, manage assets, and sign transactions easily and securely.",es:"Blux es tu puerta a Stellar. Crea una wallet, gestiona activos y firma transacciones fácil y seguro.",pt:"Blux é sua porta pra Stellar. Crie uma wallet, gerencie ativos e assine transações sem complicação.",fr:"Blux est votre porte vers Stellar. Créez un wallet, gérez vos actifs et signez simplement.",de:"Blux ist dein Tor zu Stellar. Erstelle eine Wallet, verwalte Assets und signiere Transaktionen einfach und sicher.",ru:"Blux — ваш путь в Stellar. Создавайте кошелёк, управляйте активами и подписывайте транзакции легко и безопасно.",zh:"Blux 是您通往 Stellar 的门户。轻松安全地创建钱包、管理资产并签署交易。",ja:"Blux は Stellar へのゲートウェイです。ウォレットの作成、資産の管理、取引への署名を簡単かつ安全に行えます。",ko:"Blux는 Stellar로 가는 길입니다. 지갑을 만들고, 자산을 관리하고, 거래에 쉽게 서명하세요.",tr:"Blux, Stellar’a açılan kapın. Cüzdan aç, varlıklarını yönet, işlemleri kolayca imzala."},enter_token_address:{en:"Enter token address",es:"Introduce la dirección del token",pt:"Digite o endereço do token",fr:"Saisissez l’adresse du token",de:"Token-Adresse eingeben",ru:"Введите адрес токена",zh:"输入代币地址",ja:"トークンアドレスを入力",ko:"토큰 주소 입력",tr:"Token adresini girin"},enter_address:{en:"enter address",es:"introduce la dirección",pt:"digite o endereço",fr:"saisir l’adresse",de:"Adresse eingeben",ru:"введите адрес",zh:"输入地址",ja:"アドレスを入力",ko:"주소 입력",tr:"adres girin"},check:{en:"Check",es:"Verificar",pt:"Verificar",fr:"Vérifier",de:"Prüfen",ru:"Проверить",zh:"检查",ja:"確認",ko:"확인",tr:"Kontrol et"},cancel:{en:"Cancel",es:"Cancelar",pt:"Cancelar",fr:"Annuler",de:"Abbrechen",ru:"Отмена",zh:"取消",ja:"キャンセル",ko:"취소",tr:"İptal"},add_token:{en:"Add token",es:"Agregar token",pt:"Adicionar token",fr:"Ajouter un token",de:"Token hinzufügen",ru:"Добавить токен",zh:"添加代币",ja:"トークンを追加",ko:"토큰 추가",tr:"Token ekle"},network:{en:"Network",es:"Red",pt:"Rede",fr:"Réseau",de:"Netzwerk",ru:"Сеть",zh:"网络",ja:"ネットワーク",ko:"네트워크",tr:"Ağ"},address:{en:"Address",es:"Dirección",pt:"Endereço",fr:"Adresse",de:"Adresse",ru:"Адрес",zh:"地址",ja:"アドレス",ko:"주소",tr:"Adres"},market_cap:{en:"Market cap",es:"Capitalización de mercado",pt:"Capitalização de mercado",fr:"Capitalisation",de:"Marktkapitalisierung",ru:"Капитализация",zh:"市值",ja:"時価総額",ko:"시가총액",tr:"Piyasa değeri"},total_volume:{en:"Total volume",es:"Volumen total",pt:"Volume total",fr:"Volume total",de:"Gesamtvolumen",ru:"Общий объём",zh:"总交易量",ja:"総取引量",ko:"총 거래량",tr:"Toplam hacim"},all_time_high:{en:"All time high",es:"Máximo histórico",pt:"Máxima histórica",fr:"Plus haut historique",de:"Allzeithoch",ru:"Исторический максимум",zh:"历史最高价",ja:"過去最高値",ko:"역대 최고가",tr:"Tüm zamanların en yükseği"},copy_address:{en:"Copy address",es:"Copiar dirección",pt:"Copiar endereço",fr:"Copier l’adresse",de:"Adresse kopieren",ru:"Скопировать адрес",zh:"复制地址",ja:"アドレスをコピー",ko:"주소 복사",tr:"Adresi kopyala"},address_copied:{en:"Address copied",es:"Dirección copiada",pt:"Endereço copiado",fr:"Adresse copiée",de:"Adresse kopiert",ru:"Адрес скопирован",zh:"地址已复制",ja:"アドレスをコピーしました",ko:"주소가 복사되었습니다",tr:"Adres kopyalandı"},add_new_token:{en:"Add new token",es:"Agregar nuevo token",pt:"Adicionar novo token",fr:"Ajouter un nouveau token",de:"Neuen Token hinzufügen",ru:"Добавить новый токен",zh:"添加新代币",ja:"新しいトークンを追加",ko:"새 토큰 추가",tr:"Yeni token ekle"},assets:{en:"Assets",es:"Activos",pt:"Ativos",fr:"Actifs",de:"Assets",ru:"Активы",zh:"资产",ja:"資産",ko:"자산",tr:"Varlıklar"},tokens:{en:"Tokens",es:"Tokens",pt:"Tokens",fr:"Tokens",de:"Tokens",ru:"Токены",zh:"代币",ja:"トークン",ko:"토큰",tr:"Tokenlar"},nfts:{en:"NFTs",es:"NFTs",pt:"NFTs",fr:"NFT",de:"NFTs",ru:"NFT",zh:"NFT",ja:"NFT",ko:"NFT",tr:"NFT’ler"},no_balance_message:{en:"Looks like there’s nothing here yet.",es:"Parece que aún no hay nada aquí.",pt:"Parece que ainda não há nada aqui.",fr:"On dirait qu’il n’y a encore rien ici.",de:"Sieht so aus, als wäre hier noch nichts.",ru:"Похоже, здесь пока ничего нет.",zh:"这里似乎还什么都没有。",ja:"まだ何もないようです。",ko:"아직 아무것도 없는 것 같습니다.",tr:"Burada henüz bir şey yok."},sign_permission:{en:"wants your permission to sign the following message:",es:"solicita tu permiso para firmar el siguiente mensaje:",pt:"solicita sua permissão para assinar a seguinte mensagem:",fr:"demande votre autorisation pour signer le message suivant :",de:"bittet um deine Erlaubnis, die folgende Nachricht zu signieren:",ru:"запрашивает ваше разрешение на подпись следующего сообщения:",zh:"请求您签署以下消息:",ja:"が次のメッセージへの署名を求めています:",ko:"다음 메시지의 서명을 요청합니다:",tr:"şu mesajı imzalamanı istiyor:"},rate:{en:"Rate",es:"Tasa",pt:"Taxa",fr:"Taux",de:"Kurs",ru:"Курс",zh:"汇率",ja:"レート",ko:"환율",tr:"Kur"},path:{en:"Path",es:"Ruta",pt:"Rota",fr:"Chemin",de:"Pfad",ru:"Маршрут",zh:"路径",ja:"パス",ko:"경로",tr:"Yol"},minimumReceived:{en:"Minimum Received",es:"Mínimo recibido",pt:"Mínimo recebido",fr:"Minimum reçu",de:"Mindestens erhalten",ru:"Минимум к получению",zh:"最少收到",ja:"最小受取額",ko:"최소 수령액",tr:"Minimum alınan"},sameAssetError:{en:"You’re swapping the same asset.",es:"El origen y el destino son el mismo activo.",pt:"Origem e destino são o mesmo ativo.",fr:"L’actif de départ et d’arrivée est le même.",de:"Von- und An-Asset sind dasselbe.",ru:"Актив «откуда» и «куда» совпадает.",zh:"兑换的两个资产相同。",ja:"変換元と変換先の資産が同じです。",ko:"보내는 자산과 받는 자산이 같습니다.",tr:"Gönderen ve alan varlık aynı."},invalidFromValue:{en:"Invalid FROM amount.",es:"Cantidad DE no válida.",pt:"Valor DE inválido.",fr:"Montant DE invalide.",de:"Ungültiger Betrag bei VON.",ru:"Неверная сумма в «Из».",zh:"“从”的金额无效。",ja:"変換元の値が無効です。",ko:"보내는 금액이 잘못되었습니다.",tr:"Gönderen tutar geçersiz."},invalidToValue:{en:"Invalid TO amount.",es:"Cantidad A no válida.",pt:"Valor PARA inválido.",fr:"Montant VERS invalide.",de:"Ungültiger Betrag bei AN.",ru:"Неверная сумма в «Куда».",zh:"“至”的金额无效。",ja:"変換先の値が無効です。",ko:"받는 금액이 잘못되었습니다.",tr:"Alınan tutar geçersiz."},fromAssetInvalidBalance:{en:"The FROM asset has an invalid balance.",es:"El activo DE tiene un saldo inválido.",pt:"O ativo DE tem um saldo inválido.",fr:"Le solde de l’actif DE est invalide.",de:"Das Asset im Feld VON hat ein ungültiges Guthaben.",ru:"У актива «Из» некорректный баланс.",zh:"“从”资产的余额无效。",ja:"変換元資産の残高が無効です。",ko:"보내는 자산의 잔액이 잘못되었습니다.",tr:"Gönderen varlığın bakiyesi geçersiz."},insufficientBalance:{en:"Insufficient balance.",es:"Saldo insuficiente.",pt:"Saldo insuficiente.",fr:"Solde insuffisant.",de:"Unzureichendes Guthaben.",ru:"Недостаточно средств.",zh:"余额不足。",ja:"残高が不足しています。",ko:"잔액이 부족합니다.",tr:"Yetersiz bakiye."},couldNotFindPath:{en:"Could not find path. Try again.",es:"No se encontró una ruta. Intenta de nuevo.",pt:"Não foi possível encontrar uma rota. Tente novamente.",fr:"Aucun chemin trouvé. Réessayez.",de:"Kein Pfad gefunden. Versuche es erneut.",ru:"Маршрут не найден. Попробуйте ещё раз.",zh:"未找到兑换路径,请重试。",ja:"経路が見つからなかった。もう一度試して。",ko:"경로를 찾을 수 없습니다. 다시 시도하세요.",tr:"Yol bulunamadı. Bir daha dene."},failedToMakeTransaction:{en:"Failed to make transaction.",es:"No se pudo crear la transacción.",pt:"Falha ao criar a transação.",fr:"Échec de la création de la transaction.",de:"Transaktion konnte nicht erstellt werden.",ru:"Не удалось создать транзакцию.",zh:"创建交易失败。",ja:"取引の作成に失敗しました。",ko:"거래 생성에 실패했습니다.",tr:"İşlem oluşturulamadı."},popularAssets:{en:"Popular assets",es:"Activos populares",pt:"Ativos populares",fr:"Actifs populaires",de:"Beliebte Assets",ru:"Популярные активы",zh:"热门资产",ja:"人気の資産",ko:"인기 자산",tr:"Popüler varlıklar"},errorTryAgain:{en:"Something went wrong. Try again.",es:"Algo salió mal. Intenta de nuevo.",pt:"Algo deu errado. Tente novamente.",fr:"Quelque chose s’est mal passé. Réessaie.",de:"Etwas ist schiefgelaufen. Versuche es erneut.",ru:"Что-то пошло не так. Попробуйте ещё раз.",zh:"出错了,请重试。",ja:"うまくいかなかった。もう一度。",ko:"문제가 발생했습니다. 다시 시도하세요.",tr:"Bir şeyler ters gitti. Bir daha dene."},issuer:{en:"Issuer",es:"Emisor",pt:"Emissor",fr:"Émetteur",de:"Emittent",ru:"Эмитент",zh:"发行方",ja:"発行者",ko:"발행자",tr:"İhraççı"},balance:{en:"Balance",es:"Saldo",pt:"Saldo",fr:"Solde",de:"Guthaben",ru:"Баланс",zh:"余额",ja:"残高",ko:"잔액",tr:"Bakiye"},sellingLiabilities:{en:"Selling liabilities",es:"Pasivos de venta",pt:"Passivos de venda",fr:"Engagements de vente",de:"Verkaufsverbindlichkeiten",ru:"Обязательства на продажу",zh:"卖出负债",ja:"売却債務",ko:"매도 부채",tr:"Satış yükümlülükleri"},buyingLiabilities:{en:"Buying liabilities",es:"Pasivos de compra",pt:"Passivos de compra",fr:"Engagements d’achat",de:"Kaufverbindlichkeiten",ru:"Обязательства на покупку",zh:"买入负债",ja:"購入債務",ko:"매수 부채",tr:"Alış yükümlülükleri"},limit:{en:"Limit",es:"Límite",pt:"Limite",fr:"Limite",de:"Limit",ru:"Лимит",zh:"限额",ja:"上限",ko:"한도",tr:"Limit"},authorized:{en:"Authorized",es:"Autorizado",pt:"Autorizado",fr:"Autorisé",de:"Autorisiert",ru:"Авторизовано",zh:"已授权",ja:"承認済み",ko:"승인됨",tr:"Yetkili"},yes:{en:"Yes",es:"Sí",pt:"Sim",fr:"Oui",de:"Ja",ru:"Да",zh:"是",ja:"はい",ko:"예",tr:"Evet"},no:{en:"No",es:"No",pt:"Não",fr:"Non",de:"Nein",ru:"Нет",zh:"否",ja:"いいえ",ko:"아니요",tr:"Hayır"},passkeyWaitingTitle:{en:"Waiting for passkey",es:"Esperando Passkey",pt:"Aguardando Passkey",fr:"En attente du passkey",de:"Warte auf Passkey",ru:"Ожидание Passkey",zh:"等待通行密钥",ja:"パスキーを待っています",ko:"패스키 대기 중",tr:"Passkey bekleniyor"},passkeyWaitingHelp:{en:"Confirm with your passkey to continue.",es:"Confirma con tu Passkey para continuar.",pt:"Confirme com sua Passkey para continuar.",fr:"Confirmez avec votre passkey pour continuer.",de:"Bestätige mit deinem Passkey, um fortzufahren.",ru:"Подтвердите Passkey, чтобы продолжить.",zh:"使用您的通行密钥确认以继续。",ja:"パスキーで確認して続けて。",ko:"계속하려면 패스키로 확인하세요.",tr:"Devam etmek için Passkey’inle onayla."},passkeyVerifying:{en:"Verifying…",es:"Verificando…",pt:"Verificando…",fr:"Vérification…",de:"Wird überprüft…",ru:"Проверка…",zh:"正在验证…",ja:"確認中…",ko:"확인 중…",tr:"Doğrulanıyor…"},passkeyFailedTitle:{en:"Something went wrong",es:"Algo salió mal",pt:"Algo deu errado",fr:"Quelque chose s’est mal passé",de:"Etwas ist schiefgelaufen",ru:"Что-то пошло не так",zh:"出错了",ja:"うまくいかなかった",ko:"문제가 발생했습니다",tr:"Bir şeyler ters gitti"},passkeyFailedHelp:{en:"Couldn’t verify your passkey. Try again.",es:"No pudimos verificar tu Passkey. Inténtalo de nuevo.",pt:"Não deu para verificar sua Passkey. Tente de novo.",fr:"Impossible de vérifier le passkey. Réessayez.",de:"Passkey konnte nicht geprüft werden. Versuch’s nochmal.",ru:"Не удалось проверить Passkey. Попробуйте ещё раз.",zh:"无法验证通行密钥,请重试。",ja:"パスキーを確認できなかった。もう一度。",ko:"패스키를 확인하지 못했습니다. 다시 시도하세요.",tr:"Passkey doğrulanamadı. Bir daha dene."},passkeySuccessTitle:{en:"Success!",es:"¡Listo!",pt:"Pronto!",fr:"C’est bon !",de:"Geschafft!",ru:"Готово!",zh:"好了!",ja:"できた!",ko:"완료!",tr:"Tamam!"},passkeySuccessHelp:{en:"Redirecting…",es:"Redirigiendo…",pt:"Redirecionando…",fr:"Redirection…",de:"Du wirst weitergeleitet…",ru:"Перенаправляем…",zh:"正在跳转…",ja:"移動しています…",ko:"이동 중…",tr:"Yönlendiriliyorsun…"},action:{en:"Action",es:"Acción",pt:"Ação",fr:"Action",de:"Aktion",ru:"Действие",zh:"操作",ja:"アクション",ko:"작업",tr:"Eylem"},operations:{en:"Operations",es:"Operaciones",pt:"Operações",fr:"Opérations",de:"Operationen",ru:"Операции",zh:"操作数",ja:"オペレーション",ko:"작업 수",tr:"İşlemler"},sender:{en:"Sender",es:"Remitente",pt:"Remetente",fr:"Expéditeur",de:"Absender",ru:"Отправитель",zh:"发送方",ja:"送信者",ko:"보내는 사람",tr:"Gönderen"},estimatedFee:{en:"Estimated Fee",es:"Comisión estimada",pt:"Taxa estimada",fr:"Frais estimés",de:"Geschätzte Gebühr",ru:"Примерная комиссия",zh:"预估费用",ja:"推定手数料",ko:"예상 수수료",tr:"Tahmini ücret"},viewTransactionDetails:{en:"View transaction details",es:"Ver detalles de la transacción",pt:"Ver detalhes da transação",fr:"Voir les détails de la transaction",de:"Transaktionsdetails ansehen",ru:"Посмотреть детали транзакции",zh:"查看交易详情",ja:"取引の詳細を見る",ko:"거래 세부 정보 보기",tr:"İşlem detaylarını gör"},receivedAsset:{en:"Received ${asset}",es:"Recibido ${asset}",pt:"Recebido ${asset}",fr:"${asset} reçu",de:"${asset} erhalten",ru:"Получено ${asset}",zh:"收到 ${asset}",ja:"${asset} を受け取りました",ko:"${asset} 받음",tr:"${asset} alındı"},pool:{en:"Pool",es:"Pool",pt:"Pool",fr:"Pool",de:"Pool",ru:"Пул",zh:"池",ja:"プール",ko:"풀",tr:"Havuz"},new_token:{en:"New token",es:"Nuevo token",pt:"Novo token",fr:"Nouveau token",de:"Neuer Token",ru:"Новый токен",zh:"新代币",ja:"新しいトークン",ko:"새 토큰",tr:"Yeni token"},token_details:{en:"Token details",es:"Detalles del token",pt:"Detalhes do token",fr:"Détails du token",de:"Token-Details",ru:"Сведения о токене",zh:"代币详情",ja:"トークンの詳細",ko:"토큰 세부정보",tr:"Token detayları"},no_tokens_found:{en:"No tokens yet",es:"Aún no hay tokens",pt:"Ainda não há tokens",fr:"Pas encore de tokens",de:"Noch keine Token",ru:"Токенов пока нет",zh:"还没有代币",ja:"トークンはまだありません",ko:"아직 토큰이 없습니다",tr:"Henüz token yok"},valid_token:{en:"Valid token",es:"Token válido",pt:"Token válido",fr:"Token valide",de:"Gültiger Token",ru:"Действительный токен",zh:"有效代币",ja:"有効なトークン",ko:"유효한 토큰",tr:"Geçerli token"},invalid_address:{en:"Invalid Address",es:"Dirección no válida",pt:"Endereço inválido",fr:"Adresse invalide",de:"Ungültige Adresse",ru:"Недействительный адрес",zh:"地址无效",ja:"無効なアドレス",ko:"잘못된 주소",tr:"Geçersiz adres"},could_not_validate_token:{en:"Could not validate this token",es:"No se pudo validar este token",pt:"Não foi possível validar este token",fr:"Impossible de valider ce token",de:"Dieser Token konnte nicht validiert werden",ru:"Не удалось проверить этот токен",zh:"无法验证此代币",ja:"このトークンを検証できませんでした",ko:"이 토큰을 확인할 수 없습니다",tr:"Bu token doğrulanamadı"},token_already_added:{en:"Token already added",es:"El token ya fue agregado",pt:"Token já adicionado",fr:"Token déjà ajouté",de:"Token bereits hinzugefügt",ru:"Токен уже добавлен",zh:"代币已添加",ja:"トークンは既に追加されています",ko:"이미 추가된 토큰입니다",tr:"Token zaten eklendi"},already_in_assets:{en:"Already in your Assets",es:"Ya está en tus activos",pt:"Já está nos seus ativos",fr:"Déjà dans vos actifs",de:"Bereits in deinen Assets",ru:"Уже в ваших активах",zh:"已在您的资产中",ja:"すでに資産にあります",ko:"이미 자산에 있습니다",tr:"Zaten varlıklarınızda"},status:{en:"Status",es:"Estado",pt:"Status",fr:"Statut",de:"Status",ru:"Статус",zh:"状态",ja:"ステータス",ko:"상태",tr:"Durum"},your_balance:{en:"Your balance",es:"Tu saldo",pt:"Seu saldo",fr:"Votre solde",de:"Dein Guthaben",ru:"Ваш баланс",zh:"您的余额",ja:"残高",ko:"내 잔액",tr:"Bakiyeniz"},owner:{en:"Owner",es:"Propietario",pt:"Proprietário",fr:"Propriétaire",de:"Eigentümer",ru:"Владелец",zh:"所有者",ja:"オーナー",ko:"소유자",tr:"Sahip"},admin:{en:"Admin",es:"Administrador",pt:"Administrador",fr:"Administrateur",de:"Administrator",ru:"Администратор",zh:"管理员",ja:"管理者",ko:"관리자",tr:"Yönetici"},decimals:{en:"Decimals",es:"Decimales",pt:"Casas decimais",fr:"Décimales",de:"Dezimalstellen",ru:"Десятичные",zh:"小数位",ja:"小数点以下桁数",ko:"소수 자릿수",tr:"Ondalık basamak"},symbol:{en:"Symbol",es:"Símbolo",pt:"Símbolo",fr:"Symbole",de:"Symbol",ru:"Символ",zh:"符号",ja:"シンボル",ko:"기호",tr:"Sembol"},contract:{en:"Contract",es:"Contrato",pt:"Contrato",fr:"Contrat",de:"Vertrag",ru:"Контракт",zh:"合约",ja:"コントラクト",ko:"계약",tr:"Sözleşme"},delete_token:{en:"Delete token",es:"Eliminar token",pt:"Excluir token",fr:"Supprimer le token",de:"Token löschen",ru:"Удалить токен",zh:"删除代币",ja:"トークンを削除",ko:"토큰 삭제",tr:"Token’ı sil"}},Nx=function(e){for(var t=new Uint8Array(e),n="",r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},kx=function(e){for(var t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4==0?"":"=".repeat(4-t.length%4),r=atob(t+n),i=new ArrayBuffer(r.length),o=new Uint8Array(i),a=0;a<r.length;a++)o[a]=r.charCodeAt(a);return i},Tx=function(e){return"native"===e.asset_type?"native":"credit_alphanum4"===e.asset_type||"credit_alphanum12"===e.asset_type?Qx(e.asset_issuer,4):"liquidity_pool_shares"===e.asset_type?Qx(e.liquidity_pool_id,4):""},Cx=function(e){return"native"===e.assetType?o.native():new o(e.assetCode,e.assetIssuer)},Ix=function(e,t){return Q(void 0,void 0,void 0,function(){var n,r;return ee(this,function(i){switch(i.label){case 0:return[4,fetch(e,t)];case 1:n=i.sent(),r={},i.label=2;case 2:return i.trys.push([2,4,,5]),[4,n.json()];case 3:return r=i.sent(),[3,5];case 4:return i.sent(),r={},[3,5];case 5:return[2,J({status:n.status},r)]}})})},Bx=function(e,t){var n=t.find(function(t){return"native"===e.assetType?"native"===t.asset_type:t.asset_code===e.assetCode&&t.asset_issuer===e.assetIssuer});return(null==n?void 0:n.balance)||"0"},Lx=1e7,Mx=1e5,Rx=function(e){if(!e)return 0;var t=e.trim().startsWith("-"),n=e.replace("-","").split("."),r=n[0],i=n[1],o=((void 0===i?"":i)+"0000000").slice(0,7),a=Number(r||"0")*Lx+Number(o);return t?-a:a},Px=function(e,t,n){var r=t.find(function(t){return"native"===e.assetType?"native"===t.asset_type:t.asset_code===e.assetCode&&t.asset_issuer===e.assetIssuer});if(!r)return"0";var i,o,a,s,c,u,l="selling_liabilities"in r?r.selling_liabilities:"0",d=Rx(r.balance)-Rx(l);"native"===e.assetType&&(d-=n?5e6*(2+n.subentryCount+n.numSponsoring-n.numSponsored)+Mx:Mx);return d>0?(i=d,o=Math.round(i),a=o<0,s=Math.abs(o),c=Math.floor(s/Lx),u=(s%Lx).toString().padStart(7,"0").replace(/0+$/,""),"".concat(a?"-":"").concat(c).concat(u?".".concat(u):"")):"0"},Ux=function(e){var t={valueInCurrency:"0",assetBalance:e.balance||"0",assetType:e.asset_type};return"native"===e.asset_type?(t.assetCode="XLM",t.assetIssuer=""):"liquidity_pool_shares"===e.asset_type?(t.assetCode="LiquidtyPool",t.assetIssuer=""):(t.assetCode=e.asset_code,t.assetIssuer=e.asset_issuer),t},jx=function(e){var t;return"".concat(null===(t=e[0])||void 0===t?void 0:t.toUpperCase()).concat(e.slice(1))},Fx=function(e){return navigator.clipboard.writeText(e)},Dx=function(e){return"send"===e?G.SEND:G.SWAP},zx=function(e){var t=e.replace("#","");return(.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5?"#000000":"#FFFFFF"},$x=function(e,t,n,r){var i=_x[t];i||(i=_x.stellarchain);var o=i[e];return o?"".concat(o,"/").concat(i[n],"/").concat(r):null},Wx=function(){var e=localStorage.getItem(Oe);if(!e)return[];try{return JSON.parse(e)}catch(e){return[]}},qx=function(e){var t=Object.entries(V).find(function(t){return t[1]===e});if(!t)throw new Error("BLUX: Unknown network passphrase: ".concat(e));return t[0].toLowerCase()},Xx=function(e,t){var n=Sx[e],r=t[e];if(!n&&!r)throw new Error("BLUX: Custom network has no transports.");return!n&&r&&(n={name:"Custom Network",horizon:"",soroban:""}),r&&(r.horizon&&(n.horizon=r.horizon),r.soroban&&(n.soroban=r.soroban)),n},Kx=function(e){return e.toLowerCase().replace(/\s+/g,"")},Hx=function(e){return Q(void 0,void 0,void 0,function(){return ee(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e.getNetwork()];case 1:return[2,t.sent().passphrase];case 2:return t.sent(),[2,""];case 3:return[2]}})})},Vx=function(e,t){var n,r,i;if(void 0===t&&(t=1),3===(e=e.replace(/^#/,"")).length)n=parseInt(e[0]+e[0],16),r=parseInt(e[1]+e[1],16),i=parseInt(e[2]+e[2],16);else{if(6!==e.length&&8!==e.length)throw new Error("BLUX: Invalid hex color: ".concat(e));n=parseInt(e.substring(0,2),16),r=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16)}return"rgba(".concat(n,", ").concat(r,", ").concat(i,", ").concat(t,")")},Gx=function(e,t){void 0===t&&(t=!1);var n="number"==typeof e?e:parseFloat(e);if(isNaN(n)||0===n)return"0";if(n<1e-6)return e.toString();if(t){if(n>=1e6)return"".concat((n/1e6).toFixed(2),"m");if(n>=1e3)return"".concat((n/1e3).toFixed(2),"k")}return iA(rA(n))},Yx=function(e){var t="number"==typeof e?e:parseFloat(e);return!isFinite(t)||isNaN(t)||t<=0?"$0.00":t<.01?"<$0.01":"$".concat(t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}))},Jx=function(e){var t=e.replace("#","");return!((.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5)},Zx=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Q(void 0,te([e],t,!0),void 0,function(e,t){var n,r;return void 0===t&&(t=[]),ee(this,function(i){switch(i.label){case 0:return a=function(e){"https://mobile.rabet.io"===e.origin&&"RABET/INSTALL"===e.data.type&&(new Function(e.data.message)(),window.removeEventListener("message",a))},window.addEventListener("message",a),[4,(o=e,Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return[4,Promise.all(Object.values(wx).map(function(e){return Q(void 0,void 0,void 0,function(){var t;return ee(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),o.includes(e.name.toLowerCase().replace(/\s+/g,""))?[2,{wallet:e,isAvailable:!1}]:[4,e.isAvailable()];case 1:return t=n.sent(),[2,{wallet:e,isAvailable:t}];case 2:return n.sent(),[2,{wallet:e,isAvailable:!1}];case 3:return[2]}})})}))];case 1:return[2,e.sent().filter(function(e){return!!e.isAvailable}).map(function(e){return e.wallet})]}})}))];case 1:return n=i.sent(),r=function(e,t){void 0===t&&(t=[]);for(var n=Wx(),r=new Map(e.map(function(e){return[e.name,e]})),i=[],o=new Set,a=0,s=n;a<s.length;a++){var c=s[a],u=r.get(c);u&&(i.push(u),o.add(c))}for(var l=[],d=function(t){var n=e.find(function(e){return Kx(e.name)===Kx(t)});n&&!o.has(n.name)&&(l.push(n),o.add(n.name))},f=0,h=t;f<h.length;f++)d(h[f]);var p=e.filter(function(e){return!o.has(e.name)});return te(te(te([],i,!0),l,!0),p,!0).map(function(e,t){return J(J({},e),{isRecent:0===t&&i.length>0})})}(n,t),[2,r]}var o,a})})},Qx=function(e,t){return void 0===t&&(t=8),e.slice(0,t)+"..."+e.slice(-t)},eA=function(e){return new Promise(function(t){return setTimeout(t,e)})},tA=function(e){return e.replace(/([A-Z])/g," $1").replace(/_/g," ").trim().replace(/\b\w/g,function(e){return e.toUpperCase()})},nA=function(e,t){return void 0===t&&(t={}),e.replace(/\$\{(\w+)\}/g,function(e,n){return t[n]||""})},rA=function(e){var t,n=e.toString().split("."),r=n[0],i=n[1],o=void 0===i?"":i;if(!o)return r;var a=null!==(t={0:8,1:7,2:6,3:5,4:4,5:3,6:2}[r.length])&&void 0!==t?t:0;if(a>0){var s="".concat(r,".").concat(o.slice(0,a)),c=parseFloat(s);return Number.isInteger(c)?r:c.toFixed(2)}return r},iA=function(e){var t=e.split("."),n=t[0],r=t[1];return r?"".concat(n.replace(/\B(?=(\d{3})+(?!\d))/g,","),".").concat(r):n.replace(/\B(?=(\d{3})+(?!\d))/g,",")},oA=function(e,t){return"email"===e?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t):""!==t.trim()},aA=function(){var e=ve().apiResponse;if(e&&!e.isValid)throw new Error("BLUX: appId is invalid"+(e.message?" — ".concat(e.message):"")+". Login and signing are disabled until a valid appId is configured.")},sA=function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return ve().authState.isReady&&void 0!==ve().apiResponse?[3,2]:[4,eA(50)];case 1:return e.sent(),[3,0];case 2:return[2]}})})},cA=function(e,t,n,r){return Q(void 0,void 0,void 0,function(){return ee(this,function(i){switch(i.label){case 0:if(!(null==e?void 0:e.signMessage))throw new Error("BLUX: Wallet does not support signMessage.");return[4,e.signMessage(t,{address:n,network:r})];case 1:return[2,i.sent()]}})})},uA=function(e,t){try{var n=new r(e,t),i=n.operations[0],o=null;return o="payment"===i.type||"pathPaymentStrictSend"===i.type||"pathPaymentStrictReceive"===i.type?i.destination:"",{action:i.type,operations:n.operations.length,sender:n.source,receiver:o,estimatedFee:Number(n.fee)/1e7}}catch(e){return null}},lA=function(e,t,n,r){return Q(void 0,void 0,void 0,function(){return ee(this,function(i){switch(i.label){case 0:if(!(null==e?void 0:e.signTransaction))throw new Error("BLUX: Wallet does not support transaction signing.");return[4,e.signTransaction(t,{network:r,address:n})];case 1:return[2,i.sent()]}})})},dA=["invokeHostFunction","extendFootprintTtl","restoreFootprint"],fA=function(e,t){return Q(void 0,void 0,void 0,function(){var n;return ee(this,function(r){switch(r.label){case 0:if(!t)throw new Error("BLUX: Horizon RPC was not found.");return[4,new c.Server(t).submitTransaction(e)];case 1:return[2,{hash:(n=r.sent()).hash,raw:n,returnValue:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2,null]})})}}]}})})},hA=function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i,o,c,u,l;return ee(this,function(d){switch(d.label){case 0:if(!t)throw new Error("BLUX: Soroban RPC was not found.");return[4,(n=new a.Server(t)).sendTransaction(e)];case 1:if("ERROR"===(r=d.sent()).status)throw new Error("BLUX: Failed to submit transaction: ".concat(JSON.stringify(null!==(l=r.errorResult)&&void 0!==l?l:r.status)));if("TRY_AGAIN_LATER"===r.status)throw new Error("BLUX: The network is busy, please resubmit the transaction.");return i=r.hash,[4,n.getTransaction(i)];case 2:o=d.sent(),c=0,d.label=3;case 3:if(o.status!==a.Api.GetTransactionStatus.NOT_FOUND)return[3,6];if(c>=30)throw new Error("BLUX: Timed out waiting for transaction ".concat(i," to finalize."));return[4,eA(1e3)];case 4:return d.sent(),[4,n.getTransaction(i)];case 5:return o=d.sent(),c+=1,[3,3];case 6:if(o.status===a.Api.GetTransactionStatus.FAILED)throw new Error("BLUX: Transaction ".concat(i," failed on-chain."));return[2,{hash:i,raw:u=o,returnValue:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return[2,u.returnValue?s(u.returnValue):null]})})}}]}})})};function pA(e,t,n){return Q(this,void 0,void 0,function(){var i,o,a,s;return ee(this,function(c){return i=Xx(t,n),o=i.horizon,a=i.soroban,function(e){return e.operations.some(function(e){return dA.includes(e.type)})}(s=new r(e,t))?[2,hA(s,a)]:[2,fA(s,o)]})})}var bA=function(e,t,n,r,i,o){return Q(void 0,void 0,void 0,function(){var a;return ee(this,function(s){switch(s.label){case 0:return[4,lA(e,t,n,r)];case 1:return a=s.sent(),o?[4,pA(a,r,i||{})]:[3,3];case 2:return[2,s.sent()];case 3:return[2,a]}})})},mA="__BLUX__RECENT_LOGIN_CONFIG",gA=function(e,t){return Date.now()-e<=t},vA=function(e,t,n,r){void 0===n&&(n=Date.now()),"undefined"!=typeof window&&localStorage.setItem(mA,JSON.stringify({authMethod:e,authValue:t,timestamp:n,jwt:r}))},yA=function(){"undefined"!=typeof window&&localStorage.removeItem(mA)},wA=function(){return Q(void 0,void 0,void 0,function(){var e,t,n,r,i,o,a,s,c;return ee(this,function(u){switch(u.label){case 0:if((e=ve()).authState.isAuthenticated&&e.user)return[2,!0];if(!(t=function(){if("undefined"==typeof window)return null;var e=localStorage.getItem(mA);if(!e)return null;try{var t=JSON.parse(e);return"string"!=typeof t.authMethod||"string"!=typeof t.authValue||"number"!=typeof t.timestamp?null:t}catch(e){return null}}())||!gA(t.timestamp,216e5))return[2,!1];if("wallet"===t.authMethod||!t.jwt)return[3,4];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,Ue(t.jwt)];case 2:return n=u.sent(),ye(function(e){return J(J({},e),{user:{address:n.public_key,walletPassphrase:"",authMethod:n.auth_method||t.authMethod,authValue:n.auth_value}})}),e.connectWalletSuccessful(n.public_key,(null===(c=e.stellar)||void 0===c?void 0:c.activeNetwork)||""),e.setIsAuthenticated(!0),e.setAuth({isAuthenticated:!0,JWT:t.jwt}),(r=ve().user)&&ve().emitter.emit(ne.LoggedIn,{user:r}),vA(t.authMethod,n.auth_value||"",Date.now(),t.jwt),[2,!0];case 3:return u.sent(),[2,!1];case 4:if(!t||!gA(t.timestamp,24e5))return[2,!1];if(!(i=e.wallets.find(function(e){return e.name===t.authValue})))return[2,!1];u.label=5;case 5:return u.trys.push([5,11,,12]),[4,i.connect()];case 6:if(!(o=u.sent())||""===o.trim())return[2,!1];ye(function(e){return J(J({},e),{user:{address:"",walletPassphrase:"",authMethod:"wallet",authValue:i.name}})}),a="",u.label=7;case 7:return u.trys.push([7,9,,10]),[4,Hx(i)];case 8:return a=u.sent(),[3,10];case 9:return u.sent(),[3,10];case 10:return e.connectWalletSuccessful(o,a),e.setIsAuthenticated(!0),(s=ve().user)&&ve().emitter.emit(ne.LoggedIn,{user:s}),vA("wallet",i.name,Date.now(),""),[2,!0];case 11:return u.sent(),[2,!1];case 12:return[2]}})})},xA=function(e,t,n,r){return Q(void 0,void 0,void 0,function(){return ee(this,function(i){switch(i.label){case 0:if(!(null==e?void 0:e.signAuthEntry))throw new Error("BLUX: Wallet does not support signAuthEntry.");return[4,e.signAuthEntry(t,{address:n,network:r})];case 1:return[2,i.sent()]}})})},AA=function(e){var t,n,r=ve();if(r.user&&r.user.address)return Promise.resolve(r.user);var i=new Promise(function(e,r){t=e,n=r});return r.setLogin({promise:i,isSilent:e,resolver:t,rejecter:n}),e?(wA().then(function(){var e=ve().user;e&&t(e)}).catch(function(){}).finally(function(){r.setLogin(void 0)}),i):(Q(void 0,void 0,void 0,function(){var e,n,i;return ee(this,function(o){switch(o.label){case 0:if(e=ve(),!(null===(i=e.login)||void 0===i?void 0:i.isSilent)||!e.login.promise)return[3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,e.login.promise];case 2:case 3:return o.sent(),[3,4];case 4:if(ve().user)return t(ve().user),r.setLogin(void 0),[2];o.label=5;case 5:return(n=ve()).modal.isOpen||n.openModal(G.ONBOARDING),[2]}})}).catch(function(e){n(e),r.setLogin(void 0)}),i)},EA=function(e,t,n){return new Promise(function(r,i){aA();var o=ve();if(o.authState.isAuthenticated&&o.stellar&&o.user)if(o.modal.isOpen)i(new Error("BLUX: Blux modal is open elsewhere."));else{var a=o.stellar.activeNetwork;if(n&&n.network&&(a=n.network),uA(e,a)){var s=xx(o.user,o.wallets);if(s){var c={xdr:e,rejecter:i,resolver:r,result:void 0,options:J({network:a},n),shouldSubmit:t};o.setSendTransaction(c,o.config.showWalletUIs),o.config.showWalletUIs||bA(s,e,o.user.address,a,o.config.transports||{},c.shouldSubmit).then(function(e){r(e)}).catch(function(e){i(e)})}else i(new Error("BLUX: Could not find the connected wallet."))}else i("BLUX: Invalid XDR")}else i(new Error("BLUX: User is not authenticated."))})},SA=function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:return[4,EA(e,!0,t)];case 1:return[2,n.sent()]}})})},_A={login:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return[4,sA()];case 1:return e.sent(),aA(),[2,AA(!1)]}})})},logout:function(){(0,ve().logoutAction)(),localStorage.removeItem(_e),yA(),ve().emitter.emit(ne.LoggedOut,void 0)},fundMe:function(){aA();var e=ve();if(!e.authState.isAuthenticated||!e.stellar||!e.user)throw new Error("BLUX: Blux: user is not authenticated yet.");if(e.modal.isOpen)throw new Error("BLUX: Blux modal is open elsewhere.");e.modal.isOpen||e.openModal(G.FUND_ME)},profile:function(){aA();var e=ve(),t=e.openModal,n=e.authState,r=e.modal;if(!n.isAuthenticated)throw new Error("BLUX: User is not authenticated.");r.isOpen||t(G.PROFILE)},signMessage:function(e){return new Promise(function(t,n){aA();var r=ve();if(r.authState.isAuthenticated&&r.stellar&&r.user)if(r.modal.isOpen)n(new Error("BLUX: Blux modal is open elsewhere."));else{var i=xx(r.user,r.wallets);if(i){var o={message:e,rejecter:n,resolver:t,result:void 0};r.setSignMessage(o,r.config.showWalletUIs),r.config.showWalletUIs||cA(i,e,r.user.address).then(function(e){t(e)}).catch(function(e){n(e)})}else n(new Error("BLUX: Could not find the connected wallet."))}else n(new Error("BLUX: User is not authenticated."))})},signAuthEntry:function(e,t){return new Promise(function(n,r){aA();var i=ve();if(i.authState.isAuthenticated&&i.stellar&&i.user)if(i.modal.isOpen)r(new Error("BLUX: Blux modal is open elsewhere."));else{var o=i.stellar.activeNetwork;t&&t.network&&(o=t.network);var a=xx(i.user,i.wallets);if(a){var s={authEntry:e,options:t||{network:o},rejecter:r,resolver:n,result:void 0};i.setSignAuthEntry(s,i.config.showWalletUIs),i.config.showWalletUIs||xA(a,e,i.user.address,o).then(function(e){n(e)}).catch(function(e){r(e)})}else r(new Error("BLUX: Could not find the connected wallet."))}else r(new Error("BLUX: User is not authenticated."))})},signTransaction:function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:return[4,EA(e,!1,t)];case 1:return[2,n.sent()]}})})},sendTransaction:SA,get isReady(){return ve().authState.isReady},get isAuthenticated(){return ve().authState.isAuthenticated},get user(){return ve().user}},OA="logos",NA=function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:return[4,TA("https://cdn2.blux.cc/core-assets/logos2.json.gz")];case 1:return e=t.sent(),[4,CA(e)];case 2:return[2,t.sent().files]}})})},kA=function(){return Q(void 0,void 0,void 0,function(){var e,t;return ee(this,function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),[4,NA()];case 1:return e=n.sent(),[4,IA()];case 2:return t=n.sent(),[4,BA(t,e)];case 3:case 4:return n.sent(),[3,5];case 5:return[2]}})})},TA=function(e){return Q(void 0,void 0,void 0,function(){var t;return ee(this,function(n){switch(n.label){case 0:return[4,fetch(e)];case 1:if(!(t=n.sent()).ok)throw new Error("BLUX: Failed to fetch: ".concat(t.status));return[4,t.arrayBuffer()];case 2:return[2,n.sent()]}})})},CA=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r;return ee(this,function(i){switch(i.label){case 0:return t=new DecompressionStream("gzip"),n=new Blob([e]).stream().pipeThrough(t),[4,new Response(n).text()];case 1:return r=i.sent(),[2,JSON.parse(r)]}})})},IA=function(){return new Promise(function(e,t){var n=indexedDB.open("blux-cache",1);n.onupgradeneeded=function(){var e=n.result;e.objectStoreNames.contains(OA)||e.createObjectStore(OA,{keyPath:"id"})},n.onsuccess=function(t){e(n.result)},n.onerror=function(){t(n.error)},n.onblocked=function(e){}})},BA=function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(n){return[2,new Promise(function(n,r){var i=e.transaction(OA,"readwrite"),o=i.objectStore(OA);o.clear(),t.forEach(function(e){return o.put(e)}),i.oncomplete=function(){return n()},i.onerror=function(){return r(i.error)}})]})})},LA=function(e){return Q(void 0,void 0,void 0,function(){return ee(this,function(t){return[2,new Promise(function(t,n){var r=e.transaction(OA,"readonly").objectStore(OA).getAll();r.onsuccess=function(){t(r.result||[])},r.onerror=function(){return n(r.error)}})]})})},MA="meta",RA="assets",PA=function(t,n,r){return"".concat(function(t){return t===e.PUBLIC?"pubnet":"testnet"}(t),":").concat(n,":").concat(r)},UA=function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,jA()];case 1:return e=t.sent(),ve().setAssetMeta(e),[4,zA(e)];case 2:case 3:return t.sent(),[3,4];case 4:return[2]}})})},jA=function(){return Q(void 0,void 0,void 0,function(){var e,t,n,r;return ee(this,function(i){switch(i.label){case 0:return[4,fetch("https://cdn2.blux.cc/core-assets/asset-meta.json.gz")];case 1:if(!(e=i.sent()).ok)throw new Error("BLUX: Failed to fetch asset meta: ".concat(e.status));return[4,e.arrayBuffer()];case 2:return t=i.sent(),[4,FA(t)];case 3:return n=i.sent(),[2,null!==(r=n.assets)&&void 0!==r?r:{}]}})})},FA=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r;return ee(this,function(i){switch(i.label){case 0:return t=new DecompressionStream("gzip"),n=new Blob([e]).stream().pipeThrough(t),[4,new Response(n).text()];case 1:return r=i.sent(),[2,JSON.parse(r)]}})})},DA=function(){return new Promise(function(e,t){var n=indexedDB.open("blux-asset-meta",1);n.onupgradeneeded=function(){var e=n.result;e.objectStoreNames.contains(MA)||e.createObjectStore(MA)},n.onsuccess=function(){return e(n.result)},n.onerror=function(){return t(n.error)},n.onblocked=function(){}})},zA=function(e){return Q(void 0,void 0,void 0,function(){var t;return ee(this,function(n){switch(n.label){case 0:return[4,DA()];case 1:return t=n.sent(),[2,new Promise(function(n,r){var i=t.transaction(MA,"readwrite");i.objectStore(MA).put(e,RA),i.oncomplete=function(){return n()},i.onerror=function(){return r(i.error)}})]}})})},$A=function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,DA()];case 1:return e=t.sent(),[4,new Promise(function(t,n){var r=e.transaction(MA,"readonly").objectStore(MA).get(RA);r.onsuccess=function(){var e=r.result;t(e&&Object.keys(e).length?e:null)},r.onerror=function(){return n(r.error)}})];case 2:return[2,t.sent()];case 3:return t.sent(),[2,null];case 4:return[2]}})})};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer theme, base, components, utilities;@layer theme{:host,:root{--bluxcc-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--bluxcc-color-gray-800:#333;--bluxcc-color-white:#fff;--bluxcc-spacing:0.25rem;--bluxcc-text-xs:0.75rem;--bluxcc-text-xs--line-height:1.33333;--bluxcc-text-sm:0.875rem;--bluxcc-text-sm--line-height:1.42857;--bluxcc-text-base:1rem;--bluxcc-text-base--line-height:1.5;--bluxcc-text-lg:1.125rem;--bluxcc-text-lg--line-height:1.55556;--bluxcc-text-xl:1.25rem;--bluxcc-text-xl--line-height:1.4;--bluxcc-text-2xl:1.5rem;--bluxcc-text-2xl--line-height:1.33333;--bluxcc-text-3xl:1.875rem;--bluxcc-text-3xl--line-height:1.2;--bluxcc-font-weight-normal:400;--bluxcc-font-weight-medium:500;--bluxcc-font-weight-semibold:600;--bluxcc-animate-spin:spin 1s linear infinite;--bluxcc-default-transition-duration:150ms;--bluxcc-default-transition-timing-function:cubic-bezier(0.4,0,0.2,1);--bluxcc-color-primary-500:#0c1083;--bluxcc-color-light-red-50:#ffe5e5;--bluxcc-color-light-blue-50:#e5fbff;--bluxcc-color-alert-info:#5093ff;--bluxcc-color-alert-error:#ec2929;--bluxcc-color-alert-success:#00bd81;--bluxcc-color-alert-warning:#fa8f02}}@layer utilities{.bluxcc\\:absolute{position:absolute!important}.bluxcc\\:fixed{position:fixed!important}.bluxcc\\:relative{position:relative!important}.bluxcc\\:inset-0{inset:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:top-0{top:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:right-0{right:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:bottom-0{bottom:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:bottom-4{bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:left-0{left:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:left-1\\/2{left:50%!important}.bluxcc\\:z-0{z-index:0!important}.bluxcc\\:z-10{z-index:10!important}.bluxcc\\:z-20{z-index:20!important}.bluxcc\\:z-9999998{z-index:9999998!important}.bluxcc\\:z-9999999{z-index:9999999!important}.bluxcc\\:mx-3{margin-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:mx-6{margin-inline:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:my-1{margin-block:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:my-1\\.25{margin-block:calc(var(--bluxcc-spacing)*1.25)!important}.bluxcc\\:my-2,.bluxcc\\:my-2\\!{margin-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:my-4{margin-block:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:my-5{margin-block:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:my-6{margin-block:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:\\!mt-4{margin-top:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mt-0{margin-top:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:mt-0\\.5{margin-top:calc(var(--bluxcc-spacing)*.5)!important}.bluxcc\\:mt-1{margin-top:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mt-2{margin-top:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mt-3{margin-top:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:mt-4,.bluxcc\\:mt-4\\!{margin-top:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mt-6,.bluxcc\\:mt-6\\!{margin-top:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mt-6\\.5{margin-top:calc(var(--bluxcc-spacing)*6.5)!important}.bluxcc\\:mr-0\\.5{margin-right:calc(var(--bluxcc-spacing)*.5)!important}.bluxcc\\:mr-1{margin-right:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mr-2,.bluxcc\\:mr-2\\!{margin-right:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mb-1{margin-bottom:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mb-2{margin-bottom:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mb-6{margin-bottom:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mb-8{margin-bottom:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:mb-10{margin-bottom:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:ml-1\\.5{margin-left:calc(var(--bluxcc-spacing)*1.5)!important}.bluxcc\\:ml-4{margin-left:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:ml-auto{margin-left:auto!important}.bluxcc\\:box-border{box-sizing:border-box!important}.bluxcc\\:flex{display:flex!important}.bluxcc\\:inline-flex{display:inline-flex!important}.bluxcc\\:size-5{height:calc(var(--bluxcc-spacing)*5)!important;width:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:size-7{height:calc(var(--bluxcc-spacing)*7)!important;width:calc(var(--bluxcc-spacing)*7)!important}.bluxcc\\:size-8{height:calc(var(--bluxcc-spacing)*8)!important;width:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:size-10,.bluxcc\\:size-10\\!{height:calc(var(--bluxcc-spacing)*10)!important;width:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:size-14{height:calc(var(--bluxcc-spacing)*14)!important;width:calc(var(--bluxcc-spacing)*14)!important}.bluxcc\\:size-17{height:calc(var(--bluxcc-spacing)*17)!important;width:calc(var(--bluxcc-spacing)*17)!important}.bluxcc\\:size-20{height:calc(var(--bluxcc-spacing)*20)!important;width:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:size-20\\.5{height:calc(var(--bluxcc-spacing)*20.5)!important;width:calc(var(--bluxcc-spacing)*20.5)!important}.bluxcc\\:size-24{height:calc(var(--bluxcc-spacing)*24)!important;width:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:size-52{height:calc(var(--bluxcc-spacing)*52)!important;width:calc(var(--bluxcc-spacing)*52)!important}.bluxcc\\:size-66{height:calc(var(--bluxcc-spacing)*66)!important;width:calc(var(--bluxcc-spacing)*66)!important}.bluxcc\\:size-\\[64px\\]{height:64px!important;width:64px!important}.bluxcc\\:h-3\\.5{height:calc(var(--bluxcc-spacing)*3.5)!important}.bluxcc\\:h-4{height:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:h-8{height:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:h-10{height:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:h-11{height:calc(var(--bluxcc-spacing)*11)!important}.bluxcc\\:h-12{height:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:h-14,.bluxcc\\:h-14\\!{height:calc(var(--bluxcc-spacing)*14)!important}.bluxcc\\:h-16{height:calc(var(--bluxcc-spacing)*16)!important}.bluxcc\\:h-20{height:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:h-24{height:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:h-78{height:calc(var(--bluxcc-spacing)*78)!important}.bluxcc\\:h-\\[52px\\]{height:52px!important}.bluxcc\\:h-\\[240px\\]{height:240px!important}.bluxcc\\:h-\\[320px\\]{height:320px!important}.bluxcc\\:h-\\[355px\\]{height:355px!important}.bluxcc\\:h-\\[360px\\]{height:360px!important}.bluxcc\\:h-full{height:100%!important}.bluxcc\\:max-h-8{max-height:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:max-h-12{max-height:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:max-h-20{max-height:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:max-h-78{max-height:calc(var(--bluxcc-spacing)*78)!important}.bluxcc\\:max-h-81{max-height:calc(var(--bluxcc-spacing)*81)!important}.bluxcc\\:max-h-\\[300px\\]{max-height:300px!important}.bluxcc\\:min-h-10{min-height:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:min-h-\\[248px\\]{min-height:248px!important}.bluxcc\\:w-2\\/3{width:66.66667%!important}.bluxcc\\:w-12{width:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:w-17\\!{width:calc(var(--bluxcc-spacing)*17)!important}.bluxcc\\:w-20{width:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:w-24{width:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:w-25{width:calc(var(--bluxcc-spacing)*25)!important}.bluxcc\\:w-73{width:calc(var(--bluxcc-spacing)*73)!important}.bluxcc\\:w-90\\!{width:calc(var(--bluxcc-spacing)*90)!important}.bluxcc\\:w-\\[calc\\(100\\%-3rem\\)\\]{width:calc(100% - 3rem)!important}.bluxcc\\:w-auto{width:auto!important}.bluxcc\\:w-full{width:100%!important}.bluxcc\\:max-w-22\\.5{max-width:calc(var(--bluxcc-spacing)*22.5)!important}.bluxcc\\:max-w-45{max-width:calc(var(--bluxcc-spacing)*45)!important}.bluxcc\\:max-w-46{max-width:calc(var(--bluxcc-spacing)*46)!important}.bluxcc\\:min-w-0{min-width:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:flex-1{flex:1!important}.bluxcc\\:flex-\\[1\\.6\\]{flex:1.6!important}.bluxcc\\:shrink-0{flex-shrink:0!important}.bluxcc\\:grow{flex-grow:1!important}.bluxcc\\:-translate-x-1\\/2{--tw-translate-x:-50%!important;translate:var(--tw-translate-x) var(--tw-translate-y)!important}.bluxcc\\:transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)!important}.bluxcc\\:animate-spin{animation:var(--bluxcc-animate-spin)!important}.bluxcc\\:cursor-pointer{cursor:pointer!important}.bluxcc\\:flex-col{flex-direction:column!important}.bluxcc\\:items-center{align-items:center!important}.bluxcc\\:items-end{align-items:flex-end!important}.bluxcc\\:items-start{align-items:flex-start!important}.bluxcc\\:justify-between{justify-content:space-between!important}.bluxcc\\:justify-center{justify-content:center!important}.bluxcc\\:justify-start{justify-content:flex-start!important}.bluxcc\\:gap-1{gap:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:gap-1\\.5{gap:calc(var(--bluxcc-spacing)*1.5)!important}.bluxcc\\:gap-2{gap:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:gap-2\\.5{gap:calc(var(--bluxcc-spacing)*2.5)!important}.bluxcc\\:gap-3{gap:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:space-y-1{:where(&>:not(:last-child)){--tw-space-y-reverse:0!important;margin-block-end:calc(var(--bluxcc-spacing)*1*(1 - var(--tw-space-y-reverse)))!important;margin-block-start:calc(var(--bluxcc-spacing)*1*var(--tw-space-y-reverse))!important}}.bluxcc\\:space-y-2{:where(&>:not(:last-child)){--tw-space-y-reverse:0!important;margin-block-end:calc(var(--bluxcc-spacing)*2*(1 - var(--tw-space-y-reverse)))!important;margin-block-start:calc(var(--bluxcc-spacing)*2*var(--tw-space-y-reverse))!important}}.bluxcc\\:space-x-3{:where(&>:not(:last-child)){--tw-space-x-reverse:0!important;margin-inline-end:calc(var(--bluxcc-spacing)*3*(1 - var(--tw-space-x-reverse)))!important;margin-inline-start:calc(var(--bluxcc-spacing)*3*var(--tw-space-x-reverse))!important}}.bluxcc\\:overflow-auto{overflow:auto!important}.bluxcc\\:overflow-hidden{overflow:hidden!important}.bluxcc\\:overflow-y-auto{overflow-y:auto!important}.bluxcc\\:rounded{border-radius:.25rem!important}.bluxcc\\:rounded-full{border-radius:calc(infinity * 1px)!important}.bluxcc\\:rounded-b-none\\!{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.bluxcc\\:border{border-style:var(--tw-border-style)!important;border-width:1px!important}.bluxcc\\:border-2{border-style:var(--tw-border-style)!important;border-width:2px!important}.bluxcc\\:border-none{--tw-border-style:none!important;border-style:none!important}.bluxcc\\:border-alert-error{border-color:var(--bluxcc-color-alert-error)!important}.bluxcc\\:border-alert-info{border-color:var(--bluxcc-color-alert-info)!important}.bluxcc\\:border-alert-success{border-color:var(--bluxcc-color-alert-success)!important}.bluxcc\\:border-alert-warning{border-color:var(--bluxcc-color-alert-warning)!important}.bluxcc\\:bg-\\[\\#00D66E33\\]{background-color:#00d66e33!important}.bluxcc\\:bg-\\[\\#005DF333\\]{background-color:#005df333!important}.bluxcc\\:bg-\\[\\#D6000033\\]{background-color:#d6000033!important}.bluxcc\\:bg-\\[\\#FA8F0233\\]{background-color:#fa8f0233!important}.bluxcc\\:bg-light-blue-50{background-color:var(--bluxcc-color-light-blue-50)!important}.bluxcc\\:bg-light-red-50{background-color:var(--bluxcc-color-light-red-50)!important}.bluxcc\\:bg-primary-500{background-color:var(--bluxcc-color-primary-500)!important}.bluxcc\\:bg-transparent{background-color:transparent!important}.bluxcc\\:bg-white{background-color:var(--bluxcc-color-white)!important}.bluxcc\\:p-1{padding:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:p-2{padding:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:p-4{padding:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:px-1{padding-inline:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:px-2{padding-inline:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:px-2\\.5{padding-inline:calc(var(--bluxcc-spacing)*2.5)!important}.bluxcc\\:px-3,.bluxcc\\:px-3\\!{padding-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:px-4{padding-inline:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:px-6{padding-inline:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:px-7{padding-inline:calc(var(--bluxcc-spacing)*7)!important}.bluxcc\\:px-\\[10px\\]{padding-inline:10px!important}.bluxcc\\:py-1,.bluxcc\\:py-1\\!{padding-block:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:py-2{padding-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:py-3{padding-block:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:py-4{padding-block:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:py-\\[1px\\]{padding-block:1px!important}.bluxcc\\:py-\\[2px\\]{padding-block:2px!important}.bluxcc\\:pt-3{padding-top:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:pt-4\\.25{padding-top:calc(var(--bluxcc-spacing)*4.25)!important}.bluxcc\\:pr-3{padding-right:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:pb-1{padding-bottom:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:pb-4{padding-bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:pl-2{padding-left:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:text-center{text-align:center!important}.bluxcc\\:text-left{text-align:left!important}.bluxcc\\:text-right{text-align:right!important}.bluxcc\\:text-start{text-align:start!important}.bluxcc\\:font-mono{font-family:var(--bluxcc-font-mono)!important}.bluxcc\\:\\!text-base{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}.bluxcc\\:\\!text-sm{font-size:var(--bluxcc-text-sm)!important;line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))!important}.bluxcc\\:text-2xl{font-size:var(--bluxcc-text-2xl)!important;line-height:var(--tw-leading,var(--bluxcc-text-2xl--line-height))!important}.bluxcc\\:text-3xl{font-size:var(--bluxcc-text-3xl)!important;line-height:var(--tw-leading,var(--bluxcc-text-3xl--line-height))!important}.bluxcc\\:text-base{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}.bluxcc\\:text-lg{font-size:var(--bluxcc-text-lg)!important;line-height:var(--tw-leading,var(--bluxcc-text-lg--line-height))!important}.bluxcc\\:text-sm,.bluxcc\\:text-sm\\!{font-size:var(--bluxcc-text-sm)!important;line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))!important}.bluxcc\\:text-xl{font-size:var(--bluxcc-text-xl)!important;line-height:var(--tw-leading,var(--bluxcc-text-xl--line-height))!important}.bluxcc\\:text-xs,.bluxcc\\:text-xs\\!{font-size:var(--bluxcc-text-xs)!important;line-height:var(--tw-leading,var(--bluxcc-text-xs--line-height))!important}.bluxcc\\:text-\\[10px\\]{font-size:10px!important}.bluxcc\\:text-\\[11px\\]{font-size:11px!important}.bluxcc\\:text-\\[15px\\]{font-size:15px!important}.bluxcc\\:leading-4,.bluxcc\\:leading-4\\!{--tw-leading:calc(var(--bluxcc-spacing)*4)!important;line-height:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:leading-5{--tw-leading:calc(var(--bluxcc-spacing)*5)!important;line-height:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:leading-7{--tw-leading:calc(var(--bluxcc-spacing)*7)!important;line-height:calc(var(--bluxcc-spacing)*7)!important}.bluxcc\\:leading-8{--tw-leading:calc(var(--bluxcc-spacing)*8)!important;line-height:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:font-medium{--tw-font-weight:var(--bluxcc-font-weight-medium)!important;font-weight:var(--bluxcc-font-weight-medium)!important}.bluxcc\\:font-normal{--tw-font-weight:var(--bluxcc-font-weight-normal)!important;font-weight:var(--bluxcc-font-weight-normal)!important}.bluxcc\\:font-semibold{--tw-font-weight:var(--bluxcc-font-weight-semibold)!important;font-weight:var(--bluxcc-font-weight-semibold)!important}.bluxcc\\:tracking-\\[-2\\%\\]{--tw-tracking:-2%!important;letter-spacing:-2%!important}.bluxcc\\:break-all{word-break:break-all!important}.bluxcc\\:whitespace-nowrap{white-space:nowrap!important}.bluxcc\\:text-alert-error{color:var(--bluxcc-color-alert-error)!important}.bluxcc\\:text-alert-info{color:var(--bluxcc-color-alert-info)!important}.bluxcc\\:text-alert-success{color:var(--bluxcc-color-alert-success)!important}.bluxcc\\:text-alert-warning{color:var(--bluxcc-color-alert-warning)!important}.bluxcc\\:text-gray-800{color:var(--bluxcc-color-gray-800)!important}.bluxcc\\:capitalize{text-transform:capitalize!important}.bluxcc\\:no-underline{text-decoration-line:none!important}.bluxcc\\:opacity-70{opacity:70%!important}.bluxcc\\:outline-hidden{--tw-outline-style:none!important;outline-style:none!important;@media (forced-colors:active){outline:2px solid transparent!important;outline-offset:2px!important}}.bluxcc\\:transition-\\[border-radius\\,background\\,border-color\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:border-radius,background,border-color!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-\\[border-radius\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:border-radius!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-all{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:all!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-colors{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-transform{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:transform,translate,scale,rotate!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:duration-200{--tw-duration:200ms!important;transition-duration:.2s!important}.bluxcc\\:duration-300{--tw-duration:300ms!important;transition-duration:.3s!important}.bluxcc\\:outline-none{--tw-outline-style:none!important;outline-style:none!important}.bluxcc\\:select-none{-webkit-user-select:none!important;user-select:none!important}.bluxcc\\:placeholder\\:text-base\\!{&::placeholder{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}}.bluxcc\\:focus\\:ring-1{&:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}}.bluxcc\\:focus\\:outline-hidden{&:focus{--tw-outline-style:none!important;outline-style:none!important;@media (forced-colors:active){outline:2px solid transparent!important;outline-offset:2px!important}}}}.bluxcc\\:overflowStyle::-webkit-scrollbar{width:.1px}[class*=" bluxcc"]::backdrop,[class*=" bluxcc"]::file-selector-button,[class*=" bluxcc"]:after,[class*=" bluxcc"]:before,[class^=bluxcc],[class^=bluxcc]::backdrop,[class^=bluxcc]::file-selector-button,[class^=bluxcc]:after,[class^=bluxcc]:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}[class*=" bluxcc"] h1,[class*=" bluxcc"] h2,[class*=" bluxcc"] h3,[class*=" bluxcc"] h4,[class*=" bluxcc"] h5,[class*=" bluxcc"] h6,[class^=bluxcc] h1,[class^=bluxcc] h2,[class^=bluxcc] h3,[class^=bluxcc] h4,[class^=bluxcc] h5,[class^=bluxcc] h6{font-size:inherit;font-weight:inherit}[class*=" bluxcc"] menu,[class*=" bluxcc"] ol,[class*=" bluxcc"] ul,[class^=bluxcc] menu,[class^=bluxcc] ol,[class^=bluxcc] ul{list-style:none}[class*=" bluxcc"] audio,[class*=" bluxcc"] canvas,[class*=" bluxcc"] embed,[class*=" bluxcc"] iframe,[class*=" bluxcc"] img,[class*=" bluxcc"] object,[class*=" bluxcc"] svg,[class*=" bluxcc"] video,[class^=bluxcc] audio,[class^=bluxcc] canvas,[class^=bluxcc] embed,[class^=bluxcc] iframe,[class^=bluxcc] img,[class^=bluxcc] object,[class^=bluxcc] svg,[class^=bluxcc] video{display:block;vertical-align:middle}[class*=" bluxcc"] img,[class*=" bluxcc"] video,[class^=bluxcc] img,[class^=bluxcc] video{height:auto;max-width:100%}#bluxcc-input[type=number]::-webkit-inner-spin-button,#bluxcc-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none!important;margin:0}#bluxcc-input[type=number]{-moz-appearance:textfield!important}#bluxcc-input:-webkit-autofill,#bluxcc-input:-webkit-autofill:active,#bluxcc-input:-webkit-autofill:focus,#bluxcc-input:-webkit-autofill:hover{-webkit-text-fill-color:var(--input-text-color)!important;-webkit-box-shadow:inset 0 0 0 1000px transparent!important;box-shadow:inset 0 0 0 1000px transparent!important;color:var(--input-text-color)!important;transition:background-color 5000s ease-in-out 0s!important}@keyframes bluxcc-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes bluxcc-fadeOut{0%{opacity:1}to{opacity:0}}.bluxcc\\:animate-fadeIn{animation:bluxcc-fadeIn .5s ease-in-out}.bluxcc\\:animate-fadeOut{animation:bluxcc-fadeOut .3s ease-in-out}@keyframes bluxcc-marquee{0%{transform:translateX(-16%)}to{transform:translateX(-100%)}}.bluxcc\\:marquee_outer{position:relative;width:100%}.bluxcc\\:marquee_track{animation:bluxcc-marquee 40s linear infinite;display:flex;width:max-content;will-change:transform}.bluxcc\\:marquee_track:hover{animation-play-state:paused}#bluxcc-button{cursor:pointer}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@keyframes spin{to{transform:rotate(1turn)}}@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-duration:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}');var WA=function(e){if(e instanceof o)return e;if("string"!=typeof e)throw new Error('BLUX: asset must be "xlm", "native", "CODE:ISSUER", or an Asset instance.');var t=e.trim(),n=t.toLowerCase();if("xlm"===n||"native"===n||""===t)return o.native();var r=t.split(":");if(2!==r.length)throw new Error('BLUX: Invalid asset "'.concat(e,'". Use "xlm", "native", or "CODE:ISSUER".'));var a=r[0],s=r[1];if(!a||!s)throw new Error('BLUX: Invalid asset "'.concat(e,'". Use "xlm", "native", or "CODE:ISSUER".'));if(!i.isValidEd25519PublicKey(s))throw new Error('BLUX: Invalid issuer in asset "'.concat(e,'".'));return new o(a,s)},qA=function(e){if(i.isValidEd25519PublicKey(e))return e;if(i.isValidMed25519PublicKey(e))return l(e);throw new Error('BLUX: Resolved an invalid account id "'.concat(e,'".'))},XA=function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,o,a;return ee(this,function(s){switch(s.label){case 0:if(!(n=(null!=e?e:"").toString().trim()))throw new Error("BLUX: A destination address is required.");if(i.isValidEd25519PublicKey(n)||i.isValidMed25519PublicKey(n))return[2,{destination:n,publicKey:qA(n),federated:!1}];if(!n.includes("*"))throw new Error('BLUX: "'.concat(n,'" is not a valid Stellar address or federated address.'));s.label=1;case 1:return s.trys.push([1,3,,4]),[4,u.Server.resolve(n,t)];case 2:return r=s.sent(),[3,4];case 3:throw o=s.sent(),a=o instanceof Error?o.message:"lookup failed",new Error('BLUX: Could not resolve federated address "'.concat(n,'": ').concat(a));case 4:return[2,{destination:r.account_id,publicKey:qA(r.account_id),memo:r.memo,memoType:r.memo_type,federated:!0}]}})})},KA=function(e){return Q(void 0,void 0,void 0,function(){return ee(this,function(t){switch(t.label){case 0:return e?[4,XA(e)]:[2,void 0];case 1:return[2,t.sent().publicKey]}})})},HA=function(e,t){return Q(void 0,void 0,void 0,function(){return ee(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e.loadAccount(t)];case 1:return[2,n.sent()];case 2:return n.sent(),[2,null];case 3:return[2]}})})},VA=function(e,t){return!!t.isNative()||e.balances.some(function(e){return("credit_alphanum4"===e.asset_type||"credit_alphanum12"===e.asset_type)&&e.asset_code===t.getCode()&&e.asset_issuer===t.getIssuer()})},GA=function(e,t){return"string"===t?e.toString():"number"===t?Number(e):BigInt(e)},YA=function(e,t,n){var r=t/8,i=BigInt(e).toString(16);n&&e<BigInt(0)&&(i=((BigInt(1)<<BigInt(t))+e).toString(16).replace(/^-/,""));i.length%2!=0&&(i="0".concat(i));for(var o=2*r;i.length<o;)i="0".concat(i);if(i.length>o)throw new Error("BLUX: BigNumber ".concat(e," overflows ").concat(t,"-bit representation"));for(var a=new Uint8Array(r),s=0,c=0;s<r;)a[s]=parseInt(i.slice(c,c+2),16),s+=1,c+=2;return n&&e<BigInt(0)&&(a[0]|=128),Buffer.from(a)},JA=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=BigInt(0),i=0,o=t;i<o.length;i++){var a=o[i];r<<=BigInt(8),r|=BigInt(a)}if(e&&0!==(void 0!==t[0]?128&t[0]:0)){var s=BigInt(8*t.length);r-=BigInt(1)<<s}return r},ZA=function(e){if(e>BigInt(Number.MAX_SAFE_INTEGER)||e<BigInt(Number.MIN_SAFE_INTEGER))throw new Error("BLUX: BigInt ".concat(e," is outside the safe integer range for Number type."));return Number(e)},QA=function(e){var t=e,r=ZA(t&BigInt(4294967295)),i=Number(t>>BigInt(32)&BigInt(4294967295));return i>=2147483648&&(i-=4294967296),new n.Int64([r,i])},eE=function(e){var t=ZA(e&BigInt(4294967295)),r=ZA(e>>BigInt(32)&BigInt(4294967295));return new n.Uint64([t,r])};function tE(e){return"object"!=typeof e||null===e||Array.isArray(e)}var nE,rE,iE=function(e){if(!e)return n.ScVal.scvMap(null);for(var t=[],r=0,i=Object.entries(e);r<i.length;r++){var o=i[r],a=o[0],s=o[1],c="string"==typeof a?oE.symbol(a):a;"object"!=typeof s||null===s||tE(s)?t.push(new n.ScMapEntry({key:c,val:s})):t.push(new n.ScMapEntry({key:c,val:iE(s)}))}return n.ScVal.scvMap(t)},oE=function(){function e(){}return e.i32=function(e){var t=GA(e,"number");return n.ScVal.scvI32(t)},e.i64=function(e){var t=GA(e,"bigint");return n.ScVal.scvI64(QA(t))},e.i128=function(e){return function(e){var t=YA(e,128,!0),r=t.subarray(0,8),i=t.subarray(8,16),o=QA(JA.apply(void 0,te([!0],r,!1))),a=eE(JA.apply(void 0,te([!1],i,!1)));return n.ScVal.scvI128(new n.Int128Parts({lo:a,hi:o}))}(GA(e,"bigint"))},e.i256=function(e){return function(e){var t=YA(e,256,!0),r=t.subarray(0,8),i=t.subarray(8,16),o=t.subarray(16,24),a=t.subarray(24,32),s=QA(JA.apply(void 0,te([!0],r,!1))),c=eE(JA.apply(void 0,te([!1],i,!1))),u=eE(JA.apply(void 0,te([!1],o,!1))),l=eE(JA.apply(void 0,te([!1],a,!1)));return n.ScVal.scvI256(new n.Int256Parts({hiHi:s,hiLo:c,loHi:u,loLo:l}))}(GA(e,"bigint"))},e.u32=function(e){var t=GA(e,"number");return n.ScVal.scvU32(t)},e.u64=function(e){var t=GA(e,"bigint");return n.ScVal.scvU64(eE(t))},e.u128=function(e){return function(e){var t=YA(e,128,!1),r=t.subarray(0,8),i=t.subarray(8,16),o=eE(JA.apply(void 0,te([!1],r,!1))),a=eE(JA.apply(void 0,te([!1],i,!1)));return n.ScVal.scvU128(new n.UInt128Parts({hi:o,lo:a}))}(GA(e,"bigint"))},e.u256=function(e){return function(e){var t=YA(e,256,!1),r=t.subarray(0,8),i=t.subarray(8,16),o=t.subarray(16,24),a=t.subarray(24,32),s=eE(JA.apply(void 0,te([!1],r,!1))),c=eE(JA.apply(void 0,te([!1],i,!1))),u=eE(JA.apply(void 0,te([!1],o,!1))),l=eE(JA.apply(void 0,te([!1],a,!1)));return n.ScVal.scvU256(new n.UInt256Parts({hiHi:s,hiLo:c,loHi:u,loLo:l}))}(GA(e,"bigint"))},e.error=function(e){return n.ScVal.scvError(e)},e.duration=function(e){var t=GA(e,"bigint"),r=eE(t);return n.ScVal.scvDuration(r)},e.timepoint=function(e){var t=GA(e,"bigint"),r=eE(t);return n.ScVal.scvTimepoint(r)},e.ledgerKeyNonce=function(e){return n.ScVal.scvLedgerKeyNonce(e)},e.contractInstance=function(e){return n.ScVal.scvContractInstance(e)},e.scvMap=function(e){return n.ScVal.scvMap(e)},e.map=function(e){return iE(e)},e.string=function(e){return n.ScVal.scvString(e)},e.vec=function(e){return n.ScVal.scvVec(e)},e.void=function(){return n.ScVal.scvVoid()},e.bytes=function(e){return n.ScVal.scvBytes(e)},e.ledgerKeyContractInstance=function(){return n.ScVal.scvLedgerKeyContractInstance()},e.symbol=function(e){return n.ScVal.scvSymbol(e)},e.boolean=function(e){return n.ScVal.scvBool(e)},e.address=function(e){return d.fromString(e).toScVal()},e}(),aE=function(){return!!ve().stellar},sE=function(e){var t=ve().user;if(!t&&!e)throw new Error("BLUX: Address not found");return e||(null==t?void 0:t.address)},cE=function(e){var t,n=ve(),r=n.stellar,i=n.config;if(!e){if(r)return{horizon:r.servers.horizon,soroban:r.servers.soroban,networkPassphrase:r.activeNetwork};throw new Error("BLUX: Custom network has no transports.")}var o=Xx(e,null!==(t=i.transports)&&void 0!==t?t:{}),s=o.horizon,u=o.soroban;return{networkPassphrase:e,soroban:new a.Server(u),horizon:new c.Server(s)}},uE=function(e){var t,n,r=ve(),i=(null===(t=r.stellar)||void 0===t?void 0:t.activeNetwork)||"";if(0===r.config.networks.length)throw new Error("BLUX: switchNetwork must be called after createConfig");if(!r.config.networks.includes(e))throw new Error("BLUX: New network must be defined in config.networks");if(!r.stellar)throw new Error("BLUX: Could not find the current activeNetwork");r.setStellar({activeNetwork:e,servers:null===(n=r.stellar)||void 0===n?void 0:n.servers}),i&&i!==e&&ve().emitter.emit(ne.NetworkChanged,{previousNetwork:i,network:e})},lE=function(e){return Q(void 0,void 0,void 0,function(){var t,n;return ee(this,function(r){switch(r.label){case 0:return aE(),[4,XA(sE(e.address))];case 1:t=r.sent().publicKey,n=cE(e.network).horizon,r.label=2;case 2:return r.trys.push([2,4,,5]),[4,n.loadAccount(t)];case 3:return[2,r.sent()];case 4:return r.sent(),[2,null];case 5:return[2]}})})},dE=function(e,t,n){var r=cE(n.network).horizon,i=r[e].apply(r,t);return n.cursor&&i.cursor(n.cursor),n.limit&&i.limit(n.limit),n.order&&i.order(n.order),i},fE=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r,i,o;return ee(this,function(a){switch(a.label){case 0:return aE(),t=dE("accounts",[],e),[4,Promise.all([KA(e.forSigner),KA(e.sponsor)])];case 1:return n=a.sent(),r=n[0],i=n[1],r&&(t=t.forSigner(r)),e.forAsset&&(t=t.forAsset(WA(e.forAsset))),i&&(t=t.sponsor(i)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 2:return o=a.sent(),[2,{builder:t,response:o}]}})})},hE=function(e){return Q(void 0,void 0,void 0,function(){var t,n;return ee(this,function(r){switch(r.label){case 0:return aE(),t=dE("assets",[],e),e.forCode&&(t=t.forCode(e.forCode)),e.forIssuer&&(t=t.forIssuer(e.forIssuer)),[4,t.call()];case 1:return n=r.sent(),[2,{builder:t,response:n}]}})})},pE=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r,i,o,a;return ee(this,function(s){switch(s.label){case 0:return aE(),[4,XA(sE(e.address))];case 1:t=s.sent().publicKey,n=cE(e.network).horizon,s.label=2;case 2:return s.trys.push([2,4,,5]),[4,n.loadAccount(t)];case 3:return r=s.sent(),e.includeZeroBalances?[2,r.balances]:(i=r.balances.filter(function(e){return 0!==Number(e.balance)}),o=i.find(function(e){return"native"===e.asset_type}),a=i.filter(function(e){return"native"!==e.asset_type}),o?[2,te([o],a,!0)]:[2,a]);case 4:return s.sent(),[2,[]];case 5:return[2]}})})},bE=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r,i,o;return ee(this,function(a){switch(a.label){case 0:return aE(),t=dE("claimableBalances",[],e),e.asset&&(t=t.asset(WA(e.asset))),[4,Promise.all([KA(e.claimant),KA(e.sponsor)])];case 1:return n=a.sent(),r=n[0],i=n[1],r&&(t=t.claimant(r)),i&&(t=t.sponsor(i)),[4,t.call()];case 2:return o=a.sent(),[2,{builder:t,response:o}]}})})},mE=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r;return ee(this,function(i){switch(i.label){case 0:return aE(),t=dE("effects",[],e),[4,KA(e.forAccount)];case 1:return(n=i.sent())&&(t=t.forAccount(n)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),e.forOperation&&(t=t.forOperation(e.forOperation)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 2:return r=i.sent(),[2,{builder:t,response:r}]}})})},gE=((nE={})[e.TESTNET]="https://friendbot.stellar.org",nE[e.FUTURENET]="https://friendbot-futurenet.stellar.org",nE),vE={testnet:e.TESTNET,futurenet:e.FUTURENET},yE=((rE={})[e.TESTNET]="testnet",rE[e.FUTURENET]="futurenet",rE),wE=function(e){var t,n=e.trim();return gE[n]?n:null!==(t=vE[n.toLowerCase()])&&void 0!==t?t:null},xE=function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i,o;return ee(this,function(a){switch(a.label){case 0:n={network:null!==(o=yE[t])&&void 0!==o?o:t,passphrase:t,status:"failed"},a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Ix("".concat(gE[t],"?addr=").concat(encodeURIComponent(e)),{method:"GET"})];case 2:return(r=a.sent()).status>=200&&r.status<300?(n.status="funded",n.hash=r.hash,[2,n]):function(e){var t,n,r=null===(n=null===(t=null==e?void 0:e.extras)||void 0===t?void 0:t.result_codes)||void 0===n?void 0:n.operations;if(Array.isArray(r)&&r.includes("op_already_exists"))return!0;var i=JSON.stringify(null!=e?e:{}).toLowerCase();return i.includes("op_already_exists")||i.includes("already_exists")||i.includes("already exists")||i.includes("already funded")}(r)?(n.status="already_funded",[2,n]):(n.error=r.detail||r.title||"Friendbot responded with status ".concat(r.status),[2,n]);case 3:return i=a.sent(),n.error=i instanceof Error?i.message:"Friendbot request failed",[2,n];case 4:return[2]}})})},AE=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return Q(void 0,te([t],n,!0),void 0,function(t,n){var r,i,o,a,s,c,u;return void 0===n&&(n={}),ee(this,function(l){switch(l.label){case 0:return[4,XA(sE(t))];case 1:if(r=l.sent().publicKey,0===(i=void 0===n.network?[e.TESTNET,e.FUTURENET]:Array.isArray(n.network)?n.network:[n.network]).length)throw new Error("BLUX: options.network must not be empty");for(o=[],a=0,s=i;a<s.length;a++){if(c=s[a],!(u=wE(c)))throw new Error("BLUX: '".concat(c,"' is not fundable. Friendbot only supports testnet and futurenet."));o.includes(u)||o.push(u)}return[2,Promise.all(o.map(function(e){return xE(r,e)}))]}})})},EE=function(e){return Q(void 0,void 0,void 0,function(){var t,n;return ee(this,function(r){switch(r.label){case 0:return aE(),t=dE("ledgers",[],e),e.ledger&&(t=t.ledger(e.ledger)),[4,t.call()];case 1:return n=r.sent(),[2,{builder:t,response:n}]}})})},SE=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r;return ee(this,function(i){switch(i.label){case 0:return aE(),t=dE("liquidityPools",[],e),[4,KA(e.forAccount)];case 1:return(n=i.sent())&&(t=t.forAccount(n)),e.forAssets&&(t=t.forAssets.apply(t,e.forAssets.map(function(e){return WA(e)}))),[4,t.call()];case 2:return r=i.sent(),[2,{builder:t,response:r}]}})})},_E=function(){var e,t=ve();if(0===t.config.networks.length)throw new Error("BLUX: getNetwork must be called after createConfig");return(null===(e=t.stellar)||void 0===e?void 0:e.activeNetwork)||""},OE=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r,i,o,a;return ee(this,function(s){switch(s.label){case 0:return aE(),t=dE("offers",[],e),[4,Promise.all([KA(e.forAccount),KA(e.sponsor),KA(e.seller)])];case 1:return n=s.sent(),r=n[0],i=n[1],o=n[2],r&&(t=t.forAccount(r)),e.buying&&(t=t.buying(WA(e.buying))),e.selling&&(t=t.selling(WA(e.selling))),i&&(t=t.sponsor(i)),o&&(t=t.seller(o)),[4,t.call()];case 2:return a=s.sent(),[2,{builder:t,response:a}]}})})},NE=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r;return ee(this,function(i){switch(i.label){case 0:return aE(),t=dE("operations",[],e),[4,KA(e.forAccount)];case 1:return(n=i.sent())&&(t=t.forAccount(n)),e.forClaimableBalance&&(t=t.forClaimableBalance(e.forClaimableBalance)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 2:return r=i.sent(),[2,{builder:t,response:r}]}})})},kE=function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i,o;return ee(this,function(a){switch(a.label){case 0:return aE(),n=e[0],r=e[1],[4,(i=dE("orderbook",[WA(n),WA(r)],t)).call()];case 1:return o=a.sent(),[2,{builder:i,response:o}]}})})},TE=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r;return ee(this,function(i){switch(i.label){case 0:return aE(),t=dE("payments",[],e),[4,KA(e.forAccount)];case 1:return(n=i.sent())&&(t=t.forAccount(n)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 2:return r=i.sent(),[2,{builder:t,response:r}]}})})},CE=function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i,o,a,s;return ee(this,function(c){switch(c.label){case 0:return aE(),n=e[0],r=e[1],i=e[2],"string"!=typeof n?[3,2]:[4,XA(n)];case 1:return o=c.sent().publicKey,[3,3];case 2:o=n.map(function(e){return WA(e)}),c.label=3;case 3:return[4,(a=dE("strictReceivePaths",[o,WA(r),i],t)).call()];case 4:return s=c.sent(),[2,{builder:a,response:s}]}})})},IE=function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i,o,a,s,c;return ee(this,function(u){switch(u.label){case 0:return aE(),n=e[0],r=e[1],"string"!=typeof(i=e[2])?[3,2]:[4,XA(i)];case 1:return a=u.sent().publicKey,[3,3];case 2:a=i.map(function(e){return WA(e)}),u.label=3;case 3:return o=a,[4,(s=dE("strictSendPaths",[WA(n),r,o],t)).call()];case 4:return c=u.sent(),[2,{builder:s,response:c}]}})})},BE=function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i,o,a,s,c,u;return ee(this,function(l){switch(l.label){case 0:return aE(),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],[4,(c=dE("tradeAggregation",[WA(n),WA(r),i,o,a,s],t)).call()];case 1:return u=l.sent(),[2,{builder:c,response:u}]}})})},LE=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r;return ee(this,function(i){switch(i.label){case 0:return aE(),t=dE("trades",[],e),e.forAssetPair&&(t=t.forAssetPair(WA(e.forAssetPair[0]),WA(e.forAssetPair[1]))),e.forOffer&&(t=t.forOffer(e.forOffer)),e.forType&&(t=t.forType(e.forType)),[4,KA(e.forAccount)];case 1:return(n=i.sent())&&(t=t.forAccount(n)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 2:return r=i.sent(),[2,{builder:t,response:r}]}})})},ME=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r;return ee(this,function(i){switch(i.label){case 0:return aE(),t=dE("transactions",[],e),[4,KA(e.forAccount)];case 1:return(n=i.sent())&&(t=t.forAccount(n)),e.forClaimableBalance&&(t=t.forClaimableBalance(e.forClaimableBalance)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 2:return r=i.sent(),[2,{builder:t,response:r}]}})})},RE=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Q(void 0,te([e],t,!0),void 0,function(e,t){var n,r,i,o,c,u;return void 0===t&&(t={}),ee(this,function(l){switch(l.label){case 0:if(!aE())throw new Error("BLUX: readContracts must be called after createConfig");if(!Array.isArray(e))throw new Error("BLUX: calls must be an array of IContractCall");return 0===e.length?[2,[]]:(n=cE(t.network),r=n.soroban,i=n.networkPassphrase,[4,Promise.all(e.map(function(e,t){return Q(void 0,void 0,void 0,function(){var n,o,c,u,l;return ee(this,function(d){switch(d.label){case 0:if(!e||!e.address)throw new Error("BLUX: calls[".concat(t,"].address is required"));if(!e.fn||""===e.fn.trim())throw new Error("BLUX: calls[".concat(t,"].fn is required"));return n=new f(e.address),o=e.args||[],c=new h(new p("GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF","0"),{fee:b,networkPassphrase:i}).addOperation(n.call.apply(n,te([e.fn],o,!1))).setTimeout(m).build(),[4,r.simulateTransaction(c)];case 1:if(u=d.sent(),a.Api.isSimulationError(u))throw new Error("BLUX: Contract call failed at calls[".concat(t,"] (").concat(e.address,".").concat(e.fn,"): ").concat(u.error));return u.result?("bigint"==typeof(l=s(u.result.retval))&&(l=l.toString()),[2,{raw:u,value:l}]):[2,null]}})})}))]);case 1:return o=l.sent(),c=o.map(function(e){return null==e?void 0:e.raw}),u=o.map(function(e){return null==e?void 0:e.value}),[2,{raws:c,values:u}]}})})},PE=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Q(void 0,te([e],t,!0),void 0,function(e,t){var n,r,i,o,s,c,u,l,d,p;return void 0===t&&(t={}),ee(this,function(m){switch(m.label){case 0:if(!aE())throw new Error("BLUX: writeContract must be called after createConfig");if(!e||!e.address)throw new Error("BLUX: call.address is required");if(!e.fn||""===e.fn.trim())throw new Error("BLUX: call.fn is required");return n=cE(t.network),r=n.soroban,i=n.networkPassphrase,o=sE(),[4,r.getAccount(o)];case 1:return s=m.sent(),c=new f(e.address),u=e.args||[],l=new h(s,{fee:b,networkPassphrase:i}).addOperation(c.call.apply(c,te([e.fn],u,!1))).setTimeout(180).build(),[4,r.simulateTransaction(l)];case 2:if(d=m.sent(),a.Api.isSimulationError(d))throw new Error("BLUX: Contract call failed (".concat(e.address,".").concat(e.fn,"): ").concat(d.error));return p=a.assembleTransaction(l,d).build(),[2,SA(p.toXDR(),{network:i})]}})})},UE=function(e,t,n){return g.createClaimableBalance({asset:e,amount:t,claimants:[new y(n,y.predicateUnconditional())]})},jE=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r,o,a,s,c,u,l,d,f,p,b,m,y,w,x,A,E,S,_,O,N,k,T,C,I;return ee(this,function(B){switch(B.label){case 0:if(!aE())throw new Error("BLUX: transfer must be called after createConfig");if(!e||"object"!=typeof e)throw new Error("BLUX: transfer requires an options object.");if(!(t=ve().user)||!t.address)throw new Error("BLUX: No account is logged in.");if(n=t.address,r=e.to,o=e.amount,a=e.asset,s=void 0===a?"native":a,c=e.memo,u=e.claimable,l=void 0!==u&&u,d=e.token,f=e.network,!r)throw new Error('BLUX: transfer requires a "to" address.');if(null==o||""===o)throw new Error('BLUX: transfer requires an "amount".');if(p=GA(o,"string"),!(Number(p)>0))throw new Error('BLUX: transfer "amount" must be greater than zero.');if(!d)return[3,4];if(!i.isValidContract(d))throw new Error('BLUX: "token" must be a contract id (C...).');if(p.includes(".")||/e/i.test(p))throw new Error('BLUX: token transfers use integer base units; "amount" cannot have decimals.');return i.isValidContract(r)?(m=r,[3,3]):[3,1];case 1:return[4,XA(r)];case 2:m=B.sent().publicKey,B.label=3;case 3:return b=m,[2,PE({address:d,fn:"transfer",args:[oE.address(n),oE.address(b),oE.i128(p)]},{network:f})];case 4:if(/e/i.test(p))throw new Error('BLUX: "amount" could not be represented precisely; pass it as a string (e.g. "0.0000001").');return y=WA(s),[4,XA(r)];case 5:return w=B.sent(),x=cE(f),A=x.horizon,E=x.networkPassphrase,[4,HA(A,n)];case 6:if(!(S=B.sent()))throw new Error("BLUX: The logged-in account is not active on this network yet.");return[4,HA(A,w.publicKey)];case 7:return _=B.sent(),O=function(e){var t=e.asset,n=e.amount,r=e.claimable,i=e.destination,o=e.publicKey,a=e.destinationAccount;if(a){if(VA(a,t))return g.payment({destination:i,asset:t,amount:n});if(r)return UE(t,n,o);throw new Error("BLUX: The destination has no trustline for ".concat(t.getCode(),". Pass { claimable: true } to send it as a claimable balance."))}if(r)return UE(t,n,o);if(t.isNative())return g.createAccount({destination:o,startingBalance:n});throw new Error("BLUX: The destination account does not exist, so it can only be created with XLM. Send XLM, or pass { claimable: true } to send ".concat(t.getCode()," as a claimable balance."))}({asset:y,amount:p,claimable:l,destination:w.destination,publicKey:w.publicKey,destinationAccount:_}),N=new h(S,{fee:"100000",networkPassphrase:E}).addOperation(O),k=null!=c?c:w.memo,T=void 0!==c?"text":w.memoType,C=function(e,t){if(null!=e&&""!==e)switch(t){case"id":return v.id(e);case"hash":return v.hash(e);case"return":return v.return(e);default:return v.text(e)}}(k,T),C&&(N=N.addMemo(C)),I=N.setTimeout(180).build().toXDR(),[2,SA(I,{network:E})]}})})},FE=1e7,DE=function(e,t,n){var r="down"===n?1-t:1+t,i=Number(e)*FE*r;return function(e){var t=Math.floor(e/FE),n=String(e%FE).padStart(7,"0").replace(/0+$/,"");return n?"".concat(t,".").concat(n):"".concat(t)}("down"===n?Math.floor(i):Math.ceil(i))},zE=function(e){return e.map(function(e){return"native"===e.asset_type?o.native():new o(e.asset_code,e.asset_issuer)})},$E=function(e){return e.getCode()},WE=function(e){return e.isNative()?"XLM":"".concat(e.getCode(),":").concat(e.getIssuer())},qE=function(e){var t;return null!==(t=e.find(function(e){return e.path.length<2}))&&void 0!==t?t:e[0]},XE=function(e,t,n,r){return Q(void 0,void 0,void 0,function(){var i,o,a,s,c,u,l;return ee(this,function(d){switch(d.label){case 0:i=null!==(l=null===(u=Sx[r])||void 0===u?void 0:u.name)&&void 0!==l?l:"this network",o=0,a=[n,t],d.label=1;case 1:return o<a.length?(s=a[o],(c=s.getIssuer())?[4,HA(e,c)]:[3,3]):[3,4];case 2:if(!d.sent())return[2,new Error("BLUX: No swap path found from ".concat($E(t)," to ").concat($E(n)," — the ").concat(s.getCode()," issuer ").concat(c," could not be found on ").concat(i,"; is it an asset from a different network?"))];d.label=3;case 3:return o++,[3,1];case 4:return[2,new Error("BLUX: No swap path found from ".concat(WE(t)," to ").concat(WE(n)," on ").concat(i," — no route can fill this amount right now."))]}})})},KE=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r,i,o,a,s,c,u,l,d,f,p,b,m,y,w,x,A,E,S,_,O,N,k,T,C,I,B,L;return ee(this,function(M){switch(M.label){case 0:if(!aE())throw new Error("BLUX: swap must be called after createConfig");if(!e||"object"!=typeof e)throw new Error("BLUX: swap requires an options object.");if(!(t=ve().user)||!t.address)throw new Error("BLUX: No account is logged in.");if(n=t.address,r=e.fromAsset,i=e.toAsset,o=e.amount,a=e.type,s=void 0===a?"exactIn":a,c=e.to,u=e.slippage,l=void 0===u?.005:u,d=e.memo,f=e.network,void 0===r||void 0===i)throw new Error('BLUX: swap requires "fromAsset" and "toAsset".');if(null==o||""===o)throw new Error('BLUX: swap requires an "amount".');if("exactIn"!==s&&"exactOut"!==s)throw new Error('BLUX: swap "type" must be "exactIn" or "exactOut".');if(!(l>=0&&l<1))throw new Error('BLUX: swap "slippage" must be a fraction between 0 and 1 (e.g. 0.005 for 0.5%).');if(p=GA(o,"string"),!(Number(p)>0))throw new Error('BLUX: swap "amount" must be greater than zero.');if(/e/i.test(p))throw new Error('BLUX: "amount" could not be represented precisely; pass it as a string (e.g. "0.0000001").');if(b=WA(r),m=WA(i),b.equals(m))throw new Error('BLUX: "fromAsset" and "toAsset" must be different.');return c?[4,XA(c)]:[3,2];case 1:return w=M.sent(),[3,3];case 2:w={destination:n,publicKey:n},M.label=3;case 3:return y=w,x=cE(f),A=x.horizon,E=x.networkPassphrase,[4,HA(A,n)];case 4:if(!(S=M.sent()))throw new Error("BLUX: The logged-in account is not active on this network yet.");return(_=y.publicKey===n)?(N=S,[3,7]):[3,5];case 5:return[4,HA(A,y.publicKey)];case 6:N=M.sent(),M.label=7;case 7:if(!(O=N))throw new Error("BLUX: The destination account does not exist; a swap cannot create it.");if((k=!VA(O,m))&&!_)throw new Error("BLUX: The destination has no trustline for ".concat($E(m),"."));return"exactIn"!==s?[3,11]:[4,IE([b,p,[m]],{network:f})];case 8:return C=M.sent().response,(I=qE(C.records))?[3,10]:[4,XE(A,b,m,E)];case 9:throw M.sent();case 10:return T=g.pathPaymentStrictSend({sendAsset:b,sendAmount:p,destination:y.destination,destAsset:m,destMin:DE(I.destination_amount,l,"down"),path:zE(I.path)}),[3,15];case 11:return[4,CE([[b],m,p],{network:f})];case 12:return C=M.sent().response,(I=qE(C.records))?[3,14]:[4,XE(A,b,m,E)];case 13:throw M.sent();case 14:T=g.pathPaymentStrictReceive({sendAsset:b,sendMax:DE(I.source_amount,l,"up"),destination:y.destination,destAsset:m,destAmount:p,path:zE(I.path)}),M.label=15;case 15:return B=new h(S,{fee:"100000",networkPassphrase:E}),k&&(B=B.addOperation(g.changeTrust({asset:m}))),B=B.addOperation(T),d&&(B=B.addMemo(v.text(d))),L=B.setTimeout(180).build().toXDR(),[2,SA(L,{network:E})]}})})},HE=function(e,t){var n,r=WA(e),i=null!=t?t:null===(n=ve().stellar)||void 0===n?void 0:n.activeNetwork;if(!i)throw new Error("BLUX: getSacAddress needs a network passphrase — pass one, or call createConfig first.");return r.contractId(i)},VE=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Q(void 0,te([e],t,!0),void 0,function(e,t){var n,r,o,a,s,c,u,l,d;return void 0===t&&(t={}),ee(this,function(f){switch(f.label){case 0:if(!aE())throw new Error("BLUX: getTokenMetadata must be called after createConfig");if(!e||!i.isValidContract(e))throw new Error("BLUX: getTokenMetadata requires a token contract id (C...).");return n=t.network,[4,RE([{address:e,fn:"decimals",args:[]},{address:e,fn:"name",args:[]},{address:e,fn:"symbol",args:[]}],{network:n})];case 1:if(r=f.sent(),Array.isArray(r))throw new Error("BLUX: getTokenMetadata could not read the token.");o=r.values,a=o[0],s=o[1],c=o[2],f.label=2;case 2:return f.trys.push([2,4,,5]),[4,RE([{address:e,fn:"owner",args:[]}],{network:n})];case 3:return l=f.sent(),Array.isArray(l)||(d=l.values[0],u=null==d?void 0:String(d)),[3,5];case 4:return f.sent(),u=void 0,[3,5];case 5:return[2,{decimals:Number(a),name:String(s),symbol:String(c),owner:u}]}})})},GE={mainnet:e.PUBLIC,testnet:e.TESTNET,sandbox:e.SANDBOX,futurenet:e.FUTURENET,standalone:e.STANDALONE},YE=function(e){var t=ve();uE(e),t.setNetworkSyncDisabled(!0)},JE=ve().setAppearance,ZE={on:function(e,t){return ve().emitter.on(e,t)},off:function(e,t){return ve().emitter.off(e,t)},once:function(e,t){return ve().emitter.once(e,t)}};var QE,eS=function(e){var t,n,r,i,o=e.isOpen,a=e.onClose,s=void 0===a?function(){}:a,c=e.children,u=e.isSticky,l=void 0!==u&&u,d=e.appearance,f=e.isPersistent,h=e.isBodyMount,p=e.mountElement,b=R(null),m=R(null),g=L(!1),v=g[0],y=g[1],w=function(e){void 0===e&&(e=460);var t=L(function(){return"undefined"!=typeof window&&window.innerWidth<e}),n=t[0],r=t[1];return M(function(){var t=function(){return r(window.innerWidth<e)};return t(),window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)}},[e]),n}(),x=function(e,t){var n=L({isOpening:!1,isClosing:!1}),r=n[0],i=n[1];return M(function(){if(e){i({isOpening:!0,isClosing:!1});var n=setTimeout(function(){i({isOpening:!1,isClosing:!1})},t);return function(){return clearTimeout(n)}}},[e,t]),J(J({},r),{handleClose:function(e){i({isOpening:!1,isClosing:!0});var n=setTimeout(function(){i({isOpening:!1,isClosing:!1}),e()},t);return function(){return clearTimeout(n)}}})}(o,250),A=x.isClosing,E=x.handleClose,S=function(e,t){void 0===t&&(t=[]);var n=L("auto"),r=n[0],i=n[1],o=L(!1),a=o[0],s=o[1],c=L(!1),u=c[0],l=c[1];return M(function(){var t=e.current;if(t){var n=!1,r=function(){n||t.offsetParent&&(i(t.offsetHeight),s(!0))},o=Array.from(t.getElementsByTagName("img")).filter(function(e){return!(e.complete&&e.naturalHeight>0)});if(0!==o.length){var a=o.length,c=function(){0==(a-=1)&&requestAnimationFrame(function(){return requestAnimationFrame(r)})};return o.forEach(function(e){e.addEventListener("load",c),e.addEventListener("error",c)}),function(){n=!0,o.forEach(function(e){e.removeEventListener("load",c),e.removeEventListener("error",c)})}}requestAnimationFrame(function(){return requestAnimationFrame(r)})}},te(te([],t,!0),[u],!1)),{height:r,isHeightReady:a,reset:function(){s(!1),i("auto"),l(function(e){return!e})}}}(b,[o,c]),_=S.height,O=S.isHeightReady,N=S.reset;return P(function(){if(!h&&o&&p){var e=m.current;if(e){var t=function(){return function(e,t){var n=t.getBoundingClientRect();e.style.left="".concat(n.left,"px"),e.style.width="".concat(n.width,"px")}(e,p)};t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0);var n=new ResizeObserver(t);return n.observe(p),function(){window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0),n.disconnect(),e.style.left="",e.style.width=""}}}},[h,o,p]),M(function(){if(o&&w){y(!1);var e=requestAnimationFrame(function(){y(!0)});return function(){return cancelAnimationFrame(e)}}},[o,w]),M(function(){return document.body.style.overflow=i?"hidden":"",function(){document.body.style.overflow=""}},[i=o]),M(function(){o||N()},[o]),o?D(z,{children:[!f&&$("div",{className:"bluxcc:fixed bluxcc:inset-0 bluxcc:z-9999998 ".concat(A&&!l?"bluxcc:animate-fadeOut":"bluxcc:animate-fadeIn"),style:{backdropFilter:"blur(".concat(d.backdropBlur,")"),WebkitBackdropFilter:"blur(".concat(d.backdropBlur,")"),backgroundColor:d.backdropColor},onClick:l?function(){}:s}),$("div",{ref:m,className:"".concat(h?"bluxcc:fixed bluxcc:inset-0":"bluxcc:fixed bluxcc:top-0 bluxcc:bottom-0"," bluxcc:z-9999999 bluxcc:flex bluxcc:items-center bluxcc:justify-center ").concat(A&&!l&&"bluxcc:animate-fadeOut"),onClick:function(e){e.target!==e.currentTarget||l||E(s)},children:$("div",{id:"bluxcc-modal",className:"bluxcc:box-border ".concat(w?"bluxcc:fixed bluxcc:bottom-0 bluxcc:left-0 bluxcc:w-full bluxcc:rounded-b-none!":"bluxcc:relative bluxcc:w-90!"),style:{height:"number"==typeof _?"".concat(w?_+20:_,"px"):_,transition:O?"height 250ms ease-in-out, border-radius 250ms, opacity 250ms ease-out, outline 250ms ease-out, color 250ms ease-out".concat(w?", transform 250ms ease-out":""):"border-radius 250ms, opacity 250ms ease-out".concat(w?", transform 250ms ease-out":""),transform:w?A?"translateY(100%)":v?"translateY(0%)":"translateY(80%)":"",background:d.background,opacity:A&&!l?"0":"1",color:d.textColor,fontFamily:d.fontFamily,letterSpacing:"-0.04px",borderRadius:null!==(t=d.outlineRadius)&&void 0!==t?t:d.borderRadius,outline:"".concat(null!==(n=d.outlineWidth)&&void 0!==n?n:d.borderWidth," solid ").concat(null!==(r=d.outlineColor)&&void 0!==r?r:d.borderColor),overflow:"hidden",boxShadow:d.boxShadow},children:$("div",{ref:b,className:"bluxcc:px-6 bluxcc:pb-4",style:{fontFamily:d.fontFamily,opacity:O?1:0,transition:"opacity 200ms ease-in-out"},children:c})})})]}):null},tS=function(e){var t=e.className,n=e.name,r=e.props,i=void 0===r?{}:r,o=Z(e,["className","name","props"]),a=Ae(function(e){return e.logos}),s=U(function(){return null==a?void 0:a.find(function(e){return e.name===n})},[a,n]),c=JSON.stringify(i),u=U(function(){if(!s)return"";var e=s.content,t=new Map;return(s.default_values||[]).forEach(function(e){var n=e.name,r=e.value;t.set(n,r)}),Object.entries(i).forEach(function(e){var n=e[0],r=e[1];t.set(n,r)}),t.forEach(function(t,n){var r=new RegExp("{{".concat(n,"}}"),"g");e=e.replace(r,t)}),e},[s,c]);if(!a||!s){var l="".concat("https://cdn.blux.cc/files","/").concat(encodeURIComponent(n)),d=Object.entries(i).map(function(e){return"".concat(encodeURIComponent(e[0]),"=").concat(encodeURIComponent(e[1]))}).join("&"),f="".concat(l,"?").concat(d);return $("img",{src:f,alt:n})}return $("div",u?J({dangerouslySetInnerHTML:{__html:u}},o,{className:t}):{style:{width:50,height:50,background:"transparent",objectFit:"contain"}})};!function(e){e.Blux="blux.svg",e.SmallBlux="smallblux.svg",e.About="about.svg",e.ArrowRight="arrowright.svg",e.ArrowLeft="arrowleft.svg",e.Close="close.svg",e.Loading="loading.svg",e.Search="search.svg",e.GreenCheck="greencheck.svg",e.LogOut="logout.svg",e.Copy="copy.svg",e.LargeCopy="largecopy.svg",e.History="history.svg",e.Send="send.svg",e.ArrowDropUp="arrowdropup.svg",e.ArrowDropDown="arrowdropdown.svg",e.RedAlert="redalert.svg",e.Upstream="upstream.svg",e.MultiOperation="multioperation.svg",e.Downstream="downstream.svg",e.Globe="globe.svg",e.SmallEmail="smallemail.svg",e.MoonPayLogo="moonpaylogo.svg",e.Email="email.svg",e.RedExclamation="redexclamation.svg",e.WrongNetwork="wrongnetwork.svg",e.Swap="swap.svg",e.SmallSwap="smallswap.svg",e.Receive="receive.svg",e.Balances="balances.svg",e.NFTs="nfts.svg",e.Assets="assets.svg",e.Token="token.svg",e.Plus="plus.svg",e.OpenEye="openeye.svg",e.CloseEye="closeeye.svg",e.Warn="warn.svg",e.Error="error.svg",e.CopyIcon="copyicon.svg",e.Success="success.svg",e.Key="key.svg",e.Chip="chip.svg",e.Shield="shield.svg",e.Wallet="wallet.svg",e.QuestionMark="questionmark.svg",e.SmallQuestionMark="smallquestionmark.svg",e.GrayCube="graycube.svg",e.Albedo="albedo.svg",e.Hana="hana.svg",e.Hot="hot.svg",e.Rabet="rabet.svg",e.Freighter="freighter.svg",e.DarkFreighter="darkfreighter.svg",e.XBull="xbull.svg",e.Lobstr="lobstr.svg",e.Stellar="stellar.svg",e.StellarSmall="stellarsmall.svg",e.Google="google.svg",e.WalletConnect="walletconnect.svg",e.Klever="klever.svg",e.Ledger="ledger.svg"}(QE||(QE={}));var nS=QE,rS={error:{baseBg:"bluxcc:bg-light-red-50",darkBg:"bluxcc:bg-[#D6000033]",container:"bluxcc:border bluxcc:border-alert-error",text:"bluxcc:text-alert-error",icon:$(tS,{name:nS.Error})},success:{baseBg:"bluxcc:bg-white",darkBg:"bluxcc:bg-[#00D66E33]",container:"bluxcc:border bluxcc:border-alert-success",text:"bluxcc:text-alert-success",icon:$(tS,{name:nS.Success})},copy:{baseBg:"bluxcc:bg-light-blue-50",darkBg:"bluxcc:bg-[#005DF333]",container:"bluxcc:border bluxcc:border-alert-info",text:"bluxcc:text-alert-info",icon:$(tS,{name:nS.CopyIcon})},warn:{baseBg:"bluxcc:bg-white",darkBg:"bluxcc:bg-[#FA8F0233]",container:"bluxcc:border bluxcc:border-alert-warning",text:"bluxcc:text-alert-warning",icon:$(tS,{name:nS.Warn})},none:{baseBg:"",darkBg:"",container:"",text:"",icon:null}},iS=function(e){var t=e.type,n=e.message,r=e.className,i=void 0===r?"":r,o=Ae(function(e){return e.config.appearance}),a=Jx(o.background),s=rS[t],c=s.baseBg,u=s.darkBg,l=s.container,d=s.text,f=s.icon,h=a?u:c;return D("div",{style:{borderRadius:o.borderRadius,fontFamily:o.fontFamily},className:"\n bluxcc:flex bluxcc:items-center bluxcc:gap-2\n bluxcc:px-3 bluxcc:h-10 bluxcc:max-w-46\n ".concat(h,"\n ").concat(l,"\n ").concat(d,"\n ").concat(i,"\n "),children:[f,$("span",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:n})]})},oS=function(){var e=Ae(function(e){return e.config.lang});return function(t,n){return function(e,t,n){var r,i;void 0===n&&(n={});var o=(null===(r=Ox[e])||void 0===r?void 0:r[t])||(null===(i=Ox[e])||void 0===i?void 0:i.en)||String(e);return nA(o,n)}(t,e||"en",n||{})}},aS=function(e){var t=e.onClick,n=e.children;return $("button",{id:"bluxcc-button",onClick:t,className:"bluxcc:flex bluxcc:size-5 bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent",children:n})},sS=function(e){var t=e.icon,n=e.onInfo,r=e.onBack,i=e.title,o=void 0===i?" ":i,a=e.closeButton,s=void 0!==a&&a,c=e.onClose,u=e.isPersistent,l=Ae(function(e){return e.config}),d=Ae(function(e){return e.modal}),f=oS(),h=Vx(l.appearance.textColor,.7),p="none"!==d.alert.type;return D("header",{className:"bluxcc:flex bluxcc:h-16 bluxcc:w-full bluxcc:items-center bluxcc:justify-between",style:{fontFamily:l.appearance.fontFamily},children:["info"===t?$(aS,{onClick:n,children:$(tS,{name:nS.About,props:{fill:h}})}):"back"===t?$(aS,{onClick:r,children:$(tS,{name:nS.ArrowLeft,props:{fill:h}})}):$("div",{className:"bluxcc:size-5"}),$("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:p?$(iS,{type:d.alert.type,message:d.alert.message}):$("p",{className:"bluxcc:grow bluxcc:select-none bluxcc:text-center bluxcc:text-base bluxcc:font-medium",children:f(o)})}),!s||u?$("div",{className:"bluxcc:size-5"}):$(aS,{onClick:c,children:$(tS,{name:nS.Close,props:{fill:h}})})]})},cS=function(){var e=Ae(function(e){return e.config.appearance});return $("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:$("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:e.borderWidth,borderTopColor:e.borderColor}})})},uS=function(e){var t,n=e.startIcon,r=e.onChange,i=e.onEnter,o=e.onSubmit,a=e.inputType,s=void 0===a?"text":a,c=Ae(function(e){return e}).config.appearance,u=oS(),l=L(!1),d=l[0],f=l[1],h=L(""),p=h[0],b=h[1],m=L(!1),g=m[0],v=m[1];return D("div",{className:"bluxcc:flex bluxcc:transition-colors bluxcc:duration-300 bluxcc:h-14! bluxcc:w-full bluxcc:items-center bluxcc:py-2 bluxcc:pr-3 bluxcc:pl-2",style:{fontFamily:c.fontFamily,borderRadius:c.borderRadius,borderColor:d?c.accentColor:c.borderColor,backgroundColor:c.fieldBackground,borderWidth:c.borderWidth,color:c.textColor},onMouseEnter:function(e){d||(e.currentTarget.style.borderColor=c.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){d||(e.currentTarget.style.borderColor=c.borderColor)},children:[$("span",{style:{background:c.background,borderRadius:c.borderRadius,borderColor:c.borderColor,borderWidth:c.borderWidth},className:"bluxcc:flex bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-all bluxcc:duration-300",children:n}),D("div",{style:{cursor:"text"},className:"bluxcc:ml-4 bluxcc:relative bluxcc:flex bluxcc:h-full bluxcc:flex-1 bluxcc:items-center",children:[$("input",{id:"bluxcc-input",type:s,value:p,autoComplete:"off",placeholder:u("email"),onKeyDown:function(e){"Enter"===e.key&&g&&(null==i||i(p))},onChange:function(e){var t=e.target.value;b(t);var n=oA(s,t);v(n),null==r||r(t)},className:"bluxcc:mr-1 bluxcc:h-full bluxcc:w-full bluxcc:bg-transparent bluxcc:outline-hidden\n bluxcc:focus:outline-hidden bluxcc:text-base bluxcc:placeholder:text-base!",style:(t={color:c.textColor,fontFamily:c.fontFamily},t["--input-text-color"]=c.textColor,t),onFocus:function(){return f(!0)},onBlur:function(){f(!1),oA("email",p)||v(!1)}}),$("div",{className:"bluxcc:flex bluxcc:h-10 bluxcc:w-25 bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent",children:$("button",{id:"bluxcc-button",disabled:!g,onClick:function(){return null==o?void 0:o(p)},className:"bluxcc:absolute bluxcc:right-0 bluxcc:flex bluxcc:h-8 bluxcc:w-17! bluxcc:items-center bluxcc:justify-center bluxcc:border bluxcc:text-sm! bluxcc:font-medium bluxcc:transition-[border-radius,background,border-color] bluxcc:duration-200",style:{background:c.fieldBackground,borderRadius:c.borderRadius,fontFamily:c.fontFamily,borderColor:g?c.accentColor:c.borderColor,color:g?c.accentColor:"#999999",borderWidth:c.borderWidth},children:u("submit")})})]})]})},lS=function(e){var t=e.size,n=void 0===t?"medium":t,r=e.startIcon,i=e.endArrow,o=e.isRecent,a=void 0!==o&&o,s=e.label,c=e.onClick,u=Ae(function(e){return e}),l=L(!1),d=l[0],f=l[1],h=u.config.appearance,p=oS();return D("button",{type:"button",id:"bluxcc-button",onClick:c,className:"bluxcc:flex bluxcc:transition-colors bluxcc:duration-300\n ".concat("small"===n?"bluxcc:size-24 bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:gap-2 bluxcc:py-4":"bluxcc:h-14! bluxcc:w-full bluxcc:items-center bluxcc:py-2 bluxcc:pr-3 bluxcc:pl-2 bluxcc:text-left","\n "),style:{fontFamily:h.fontFamily,borderRadius:h.borderRadius,borderColor:d?h.accentColor:h.borderColor,backgroundColor:h.fieldBackground,borderWidth:h.borderWidth,color:h.textColor,textAlign:"small"===n?"center":"left"},onMouseEnter:function(e){f(!0),d||(e.currentTarget.style.borderColor=h.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){f(!1),d||(e.currentTarget.style.borderColor=h.borderColor)},children:[$("span",{style:{background:h.background,borderRadius:h.borderRadius,borderColor:h.borderColor,borderWidth:h.borderWidth},className:"bluxcc:flex bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-all bluxcc:duration-300",children:r}),$("div",{className:"".concat("small"===n?"bluxcc:mt-0":"bluxcc:ml-4 bluxcc:min-w-0 bluxcc:overflow-hidden"," bluxcc:relative bluxcc:flex bluxcc:h-full bluxcc:flex-1 bluxcc:items-center"),children:$("span",{className:"".concat("small"===n?"bluxcc:text-sm bluxcc:leading-4":"bluxcc:w-full bluxcc:text-left bluxcc:text-base bluxcc:whitespace-nowrap"," bluxcc:font-medium bluxcc:select-none"),children:s})}),a&&$("div",{className:"bluxcc:px-2 bluxcc:py-1 bluxcc:text-xs bluxcc:font-normal",style:{color:h.accentColor,borderRadius:h.borderRadius,backgroundColor:"".concat(Vx(h.accentColor,.15))},children:p("recent")}),i&&"medium"===n&&$("span",{className:"bluxcc:ml-auto bluxcc:flex bluxcc:items-center",children:$(tS,{name:nS.ArrowRight,props:{fill:"".concat(Vx(h.textColor,.7))}})})]})},dS=function(e){var t=e.variant,n=void 0===t?"default":t,r=e.size,i=void 0===r?"medium":r,o=e.startIcon,a=e.endArrow,s=e.isRecent,c=void 0!==s&&s,u=e.label,l=e.onClick,d=e.onChange,f=e.onEnter,h=e.onSubmit,p=e.inputType;return"input"===n?$(uS,{onEnter:f,onSubmit:h,onChange:d,inputType:void 0===p?"text":p,startIcon:o}):$(lS,{size:i,label:u,onClick:l,isRecent:c,endArrow:a,startIcon:o})},fS=function(){var e,t=oS(),n=L(!0),r=n[0],i=n[1],o=Ae(function(e){return e}),a=o.setRoute,s=o.logoutAction,c=o.setAlert,u=o.config.appearance,l=null===(e=o.user)||void 0===e?void 0:e.address,d=0!==o.balances.balances.length?o.balances.balances.find(function(e){return"native"===e.asset_type}).balance:"0";return D("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center",children:[D("div",{className:"bluxcc:mt-4 bluxcc:mb-6 bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center",children:[D("div",{className:"bluxcc:text-center bluxcc:text-2xl bluxcc:h-8 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:gap-2",style:{color:u.accentColor,fontFamily:u.fontFamily},children:[$("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:$("p",{className:"bluxcc:select-none",style:{verticalAlign:"middle",paddingTop:r?"0px":"8px",fontFamily:u.fontFamily},children:d?r?"".concat(Gx(d)," XLM"):"******":t("loading")})}),$("div",{className:"bluxcc:transition-all",children:$("button",r?{id:"bluxcc-button",onClick:function(){return i(!1)},className:"bluxcc:bg-transparent",children:$(tS,{name:nS.OpenEye,props:{fill:u.accentColor}})}:{id:"bluxcc-button",onClick:function(){return i(!0)},className:"bluxcc:bg-transparent",children:$(tS,{name:nS.CloseEye,props:{fill:u.accentColor}})})})]}),$("button",{id:"bluxcc-button",className:"bluxcc:mt-4! bluxcc:leading-4 bluxcc:inline-flex bluxcc:bg-transparent bluxcc:text-sm bluxcc:select-none",onClick:function(){Fx(l).then(function(){Fx(l),c("copy",t("address_copied")),setTimeout(function(){c("none","")},1e3)}).catch(function(){})},style:{color:Vx(u.textColor,.7),fontFamily:u.fontFamily},children:D("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1",children:[l?Qx(l,5):"",$(tS,{name:nS.Copy,props:{fill:Vx(u.textColor,.7)}})]})})]}),D("div",{className:"bluxcc:flex bluxcc:space-x-3",children:[$(dS,{size:"small",label:t("send"),startIcon:$(tS,{name:nS.Send,props:{fill:u.textColor}}),onClick:function(){a(G.SEND)}}),$(dS,{size:"small",label:t("receive"),startIcon:$(tS,{name:nS.Receive,props:{fill:u.textColor}}),onClick:function(){a(G.RECEIVE)}}),$(dS,{size:"small",label:t("swap"),startIcon:$(tS,{name:nS.Swap,props:{fill:u.textColor}}),onClick:function(){o.setSelectAsset(J(J({},o.selectAsset),{userPicked:!1})),a(G.SWAP)}})]}),D("div",{className:"bluxcc:mt-4 bluxcc:w-full bluxcc:space-y-2",children:[$(dS,{endArrow:!0,label:t("balances"),startIcon:$(tS,{name:nS.Balances,props:{fill:u.textColor}}),onClick:function(){a(G.BALANCES)}}),$(dS,{endArrow:!0,label:t("activity"),startIcon:$(tS,{name:nS.History,props:{fill:u.textColor}}),onClick:function(){a(G.ACTIVITY)}})]}),$(cS,{}),D("button",{style:{color:Vx(u.textColor,.9),fontFamily:u.fontFamily},id:"bluxcc-button",onClick:function(){s(),yA(),o.emitter.emit(ne.LoggedOut,void 0)},className:"bluxcc:flex bluxcc:h-12 bluxcc:font-medium bluxcc:text-base bluxcc:w-full bluxcc:bg-transparent bluxcc:items-center bluxcc:justify-center bluxcc:gap-2",children:[$(tS,{name:nS.LogOut,props:{fill:Vx(u.textColor,.9)}}),t("logout")]})]})},hS={small:"bluxcc:h-8 bluxcc:!text-sm bluxcc:gap-1",medium:"bluxcc:h-10 bluxcc:!text-sm bluxcc:gap-1",large:"bluxcc:h-[52px] bluxcc:!text-base bluxcc:gap-1"},pS=function(e){var t=e.size,n=void 0===t?"large":t,r=e.disabled,i=void 0!==r&&r,o=e.variant,a=void 0===o?"outline":o,s=e.state,c=void 0===s?"enabled":s,u=e.children,l=e.startIcon,d=e.endIcon,f=e.onClick,h=e.style,p=e.className,b=e.type,m=Ae(function(e){return e.config.appearance}),g=J({borderRadius:m.borderRadius,fontFamily:m.fontFamily,pointerEvents:"disabled"===c?"none":void 0},h);return"outline"===a?Object.assign(g,{border:"1px solid ".concat(m.borderColor),color:m.accentColor,backgroundColor:m.fieldBackground,borderWidth:m.borderWidth}):"fill"===a?Object.assign(g,{backgroundColor:m.accentColor,fontWeight:"500",color:zx(m.accentColor)}):"text"===a?Object.assign(g,{color:m.accentColor,backgroundColor:"transparent"}):"tonal"===a&&Object.assign(g,{color:m.accentColor,backgroundColor:Vx(m.accentColor,.1)}),"selected"===c&&(g.boxShadow="0 0 0 2px ".concat(m.accentColor)),D("button",{type:b||"button",id:"bluxcc-button",onClick:f,disabled:"disabled"===c&&i,className:"".concat("bluxcc:flex bluxcc:justify-center bluxcc:items-center bluxcc:px-[10px] bluxcc:transition-all bluxcc:duration-300 bluxcc:w-full"," ").concat(hS[n]," ").concat(null!=p?p:""," bluxcc:transition-all bluxcc:duration-300"),style:g,children:[l&&$("span",{children:l}),$("span",{children:u}),d&&$("span",{children:d})]})},bS=function(e){var t=e.fill,n=void 0===t?"#999999":t;return D("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$("mask",{id:"mask0_4197_4537",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:$("rect",{width:"24",height:"24",fill:"#D9D9D9"})}),$("g",{mask:"url(#mask0_4197_4537)",children:$("path",{d:"M6.29425 17.6443L5.25 16.6L15.0905 6.75H6.14425V5.25H17.6443V16.75H16.1443V7.80375L6.29425 17.6443Z",fill:n})})]})},mS=function(e){var t=e.fill,n=void 0===t?"#0C1083":t;return D("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$("mask",{id:"mask0_3683_34744",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40",children:$("rect",{width:"40",height:"40",fill:"#D9D9D9"})}),$("g",{mask:"url(#mask0_3683_34744)",children:$("path",{d:"M20 37.3069L7.5 27.9319V4.16602H32.5V27.9319L20 37.3069ZM20 34.166L30 26.6819V6.66602H10V26.6819L20 34.166ZM18.25 24.4223L27.0896 15.5827L25.3333 13.7752L18.25 20.8585L14.7179 17.3264L12.9104 19.0827L18.25 24.4223Z",fill:n})})]})},gS=function(e){var t=e.fill,n=void 0===t?"#05C3DD":t;return D("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$("path",{d:"M37.1737 32.0256H51.2086L65.5665 46.3274C66.5004 47.2576 66.5052 48.7708 65.5759 49.706L47.1629 68.2582H32.7051L37.076 63.9982L53.1242 48.0114L37.2796 32.0244",fill:n}),$("path",{d:"M42.9419 47.9755H28.907L14.5492 33.6739C13.6152 32.7435 13.6104 31.2303 14.5397 30.2951L32.9527 11.7417H47.4106L43.0397 16.0018L26.9914 31.9887L42.8358 47.9755",fill:n})]})},vS=function(){return D("svg",{width:"144",height:"144",viewBox:"0 0 144 144",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[D("g",{clipPath:"url(#clip0_617_11734)",children:[$("path",{d:"M0 0H144V144H0V0Z",fill:"#44D62C"}),$("path",{d:"M78.5049 30.5303H58.4749L54.9609 41.156H66.0861V63.5379H78.5049V30.5303Z",fill:"black"}),$("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M94.8428 90.626C94.8428 103.242 84.6155 113.469 71.9995 113.469C59.3835 113.469 49.1562 103.242 49.1562 90.626C49.1562 78.01 59.3835 67.7827 71.9995 67.7827C84.6155 67.7827 94.8428 78.01 94.8428 90.626ZM84.4722 90.6259C84.4722 97.5144 78.8879 103.099 71.9995 103.099C65.111 103.099 59.5267 97.5144 59.5267 90.6259C59.5267 83.7374 65.111 78.1532 71.9995 78.1532C78.8879 78.1532 84.4722 83.7374 84.4722 90.6259Z",fill:"black"})]}),$("defs",{children:$("clipPath",{id:"clip0_617_11734",children:$("rect",{width:"144",height:"144",fill:"white"})})})]})},yS=function(e){var t=e.fill,n=void 0===t?"#3FA76E":t;return D("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$("rect",{x:"9.25",y:"2.5",width:"5.5",height:"16",rx:"2.75",fill:n}),$("rect",{x:"3",y:"7.5",width:"3",height:"7",rx:"1.5",fill:n}),$("rect",{x:"3",y:"11.5",width:"9",height:"3",rx:"1.5",fill:n}),$("rect",{x:"18",y:"5.5",width:"3",height:"7",rx:"1.5",fill:n}),$("rect",{x:"13",y:"9.5",width:"8",height:"3",rx:"1.5",fill:n}),$("rect",{x:"5.5",y:"19.5",width:"13",height:"2.5",rx:"1.25",fill:n})]})},wS=function(){return D("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$("rect",{width:"32",height:"32",rx:"8",fill:"#2E27F6"}),$("path",{d:"M8 24V8h16l-4.2 4.8H13v3h8.4L17.2 20H13v4H8Z",fill:"#ffffff"})]})},xS=function(e){var t=e.fill;return $("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:$("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7a5 5 0 0 0-5-5Zm3 8V7a3 3 0 1 0-6 0v3h6Zm-3 4a1.75 1.75 0 0 0-.75 3.33V19.5a.75.75 0 0 0 1.5 0v-2.17A1.75 1.75 0 0 0 12 14Z",fill:void 0===t?"#171717":t})})},AS=function(){return D("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$("g",{clipPath:"url(#clip0_4355_16345)",children:$("path",{d:"M17.9507 8.43559C18.4879 8.43559 19.0133 8.27633 19.4601 7.97795C19.9069 7.67956 20.2552 7.25543 20.4611 6.75915C20.6669 6.26287 20.7211 5.71671 20.6167 5.18966C20.5123 4.66262 20.254 4.17835 19.8744 3.79803C19.4949 3.41771 19.0112 3.15842 18.4844 3.05292C17.9575 2.94741 17.4112 3.00042 16.9146 3.20526C16.4178 3.41009 15.993 3.75755 15.6936 4.20375C15.3944 4.64993 15.234 5.17483 15.2329 5.71212C15.2322 6.06951 15.3019 6.42353 15.4382 6.75392C15.5744 7.08431 15.7745 7.38459 16.0269 7.63756C16.2794 7.89053 16.5792 8.09123 16.9093 8.22816C17.2394 8.3651 17.5933 8.43559 17.9507 8.43559ZM9.61576 20.6742C8.30665 20.6731 7.02725 20.2839 5.93923 19.5559C4.85121 18.8279 4.0034 17.7937 3.50294 16.584C3.00249 15.3743 2.87184 14.0435 3.12751 12.7596C3.38318 11.4757 4.01369 10.2964 4.93938 9.37069C5.86506 8.445 7.04436 7.81449 8.32826 7.55882C9.61217 7.30315 10.943 7.43379 12.1527 7.93425C13.3624 8.43471 14.3966 9.28252 15.1246 10.3705C15.8526 11.4586 16.2417 12.738 16.2429 14.0471C16.2436 14.9176 16.0727 15.7797 15.74 16.584C15.4071 17.3884 14.919 18.1192 14.3035 18.7348C13.688 19.3503 12.9571 19.8385 12.1527 20.1712C11.3483 20.504 10.4862 20.675 9.61576 20.6742Z",fill:"#7D00FF"})}),$("defs",{children:$("clipPath",{id:"clip0_4355_16345",children:$("rect",{width:"24",height:"24",fill:"white"})})})]})},ES=function(){return D("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{width:"38px",height:"38px"},children:[$("path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4"}),$("path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88"}),$("path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02"}),$("path",{d:"M2 12a10 10 0 0 1 18-6"}),$("path",{d:"M2 16h.01"}),$("path",{d:"M21.8 16c.2-2 .131-5.354 0-6"}),$("path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2"}),$("path",{d:"M8.65 22c.21-.66.45-1.32.57-2"}),$("path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2"})]})},SS=function(e,t,n){void 0===n&&(n="small");var r="bluxcc:flex bluxcc:justify-center bluxcc:items-center bluxcc:size-10!";switch(e){case"Rabet":return $(tS,{className:"small"===n?r:"",name:nS.Rabet,props:{fill:t?"#ffffff":"#B8BAC4"}});case"Freighter":return $(tS,t?{className:"small"===n?r:"",name:nS.DarkFreighter,props:{}}:{className:"small"===n?r:"",name:nS.Freighter,props:{fill:"#310CCC"}});case"Albedo":return $(tS,{className:"small"===n?r:"",name:nS.Albedo,props:{}});case"LOBSTR":return $(tS,{className:"small"===n?r:"",name:nS.Lobstr,props:{fill:t?"#ffffff":"#1a8da0"}});case"xBull":return $(tS,{className:"small"===n?r:"",name:nS.XBull,props:{fill:t?"#ffffff":"#C19CFC"}});case"Hana":return $(tS,{className:"small"===n?r:"",name:nS.Hana,props:{fill:t?"#E6E0F7":"#221542"}});case"Hot":return $(tS,{className:"small"===n?r:"",name:nS.Hot,props:{}});case"Wallet Connect":return $(tS,{className:"small"===n?r:"",name:nS.WalletConnect,props:{fill:t?"#ffffff":"#0988f1"}});case"Klever":return $(tS,{className:"small"===n?r:"",name:nS.Klever,props:{}});case"Bitget":return $(gS,{fill:t?"#05C3DD":"#00F0FF"});case"Onekey":return $(vS,{});case"Ledger":return $(tS,{className:"small"===n?r:"",name:nS.Ledger,props:{fill:t?"#ffffff":"#000000"}});case"Cactus Link":return $(yS,{});case"Fordefi":return $(wS,{});case"Trezor":return $(xS,{fill:t?"#ffffff":"#171717"});default:return null}},_S=function(){var e,t,n,r=oS(),i=Ae(function(e){return e}),o=i.user,a=i.waitingStatus,s=i.config.appearance;return D("div",{className:"bluxcc:mt-3 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[$("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",style:{borderColor:s.borderColor,borderWidth:s.borderWidth},children:SS(null!==(e=null==o?void 0:o.authValue)&&void 0!==e?e:"",Jx(s.background),"large")}),D("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[$("p",{className:"bluxcc:text-xl",children:"login"===a?r("waitingFor",{walletName:null!==(t=null==o?void 0:o.authValue)&&void 0!==t?t:"wallet"}):r("signingWith",{walletName:null!==(n=null==o?void 0:o.authValue)&&void 0!==n?n:"wallet"})}),$("p",{className:"bluxcc:text-sm",children:r("login"===a?"acceptConnection":"signRequestInWallet")})]}),$(cS,{}),$(pS,{state:"disabled",variant:"outline",startIcon:$(tS,{className:"bluxcc:animate-spin",name:nS.Loading,props:{fill:s.accentColor}}),children:r("login"===a?"connecting":"signing")})]})},OS=function(e){var t=e.assetCode,n=e.assetIssuer,r=e.assetType,i=e.fill,o=e.nativeIcon,a=void 0===o?nS.Stellar:o,s=e.fallbackIcon,c=void 0===s?nS.QuestionMark:s,u=e.className,l=Ae(function(e){return e.assetMeta}),d=Ae(function(e){var t;return null===(t=e.stellar)||void 0===t?void 0:t.activeNetwork}),f=L(!1),h=f[0],p=f[1],b=U(function(){var e;if("native"!==r&&l)return null===(e=l[PA(d,t,n)])||void 0===e?void 0:e.icon},[l,d,t,n,r]);M(function(){return p(!1)},[b]);var m=i?{fill:i}:{};return"native"===r?$(tS,{name:a,props:m,className:u}):b&&!h?$("img",{src:b,alt:t,className:u,onError:function(){return p(!0)},style:{width:40,height:40,objectFit:"contain",borderRadius:"inherit"}}):$(tS,{name:c,props:m,className:u})},NS=function(e){var t=e.handleOpenAssets,n=e.asset,r=Ae(function(e){return e.config.appearance});return D("button",{id:"bluxcc-button",onClick:t,className:"bluxcc:flex bluxcc:bg-transparent bluxcc:items-center bluxcc:gap-1 bluxcc:p-1 bluxcc:max-h-12",style:{fontFamily:r.fontFamily,borderColor:r.borderColor,borderWidth:r.borderWidth,borderRadius:r.borderRadius,backgroundColor:r.fieldBackground,color:r.textColor},children:[$("div",{style:{fontFamily:r.fontFamily,background:r.background,borderRadius:r.borderRadius,borderColor:r.borderColor,borderWidth:r.borderWidth,color:r.textColor},className:"bluxcc:flex bluxcc:mr-0.5 bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-[border-radius] bluxcc:duration-300",children:$(OS,{assetCode:n.assetCode,assetIssuer:n.assetIssuer,assetType:n.assetType,fill:zx(r.fieldBackground)})}),$("span",{children:n.assetCode}),$(tS,{name:nS.ArrowDropDown,props:{fill:r.accentColor}})]})},kS=function(e){var t,n,r,i=Ae(function(e){return e}),o=L(null),a=o[0],s=o[1],c=null===(t=i.user)||void 0===t?void 0:t.address,u=null===(n=i.stellar)||void 0===n?void 0:n.servers.horizon,l=null===(r=i.stellar)||void 0===r?void 0:r.activeNetwork;return M(function(){var e=!1;if(s(null),c&&u)return u.loadAccount(c).then(function(t){e||s({subentryCount:t.subentry_count,numSponsoring:t.num_sponsoring,numSponsored:t.num_sponsored})}).catch(function(){e||s(null)}),function(){e=!0}},[c,u,l]),Px(e,i.balances.balances,a)},TS=function(e,t,n,r,i,o,a,s,c,u){return Q(void 0,void 0,void 0,function(){var l,d,f,p,b;return ee(this,function(m){switch(m.label){case 0:l=Number(Number(e).toFixed(5)).toString(),d=Number((Number(t)/100*99.5).toFixed(5)).toString(),f=null,m.label=1;case 1:return m.trys.push([1,3,,4]),[4,s.loadAccount(a)];case 2:return f=m.sent(),[3,4];case 3:return m.sent(),[3,4];case 4:if(!f)throw new Error("BLUX: Inactive account cannot send a transaction.");return p=new h(f,{fee:"70000",networkPassphrase:c}),u&&(p=p.addOperation(g.changeTrust({limit:"9999999",asset:Cx(i)}))),b=te([],o.slice(1,o.length-1),!0).map(Cx),p="from"===n?p.addOperation(g.pathPaymentStrictSend({sendAsset:Cx(r),sendAmount:l,destination:a,destAsset:Cx(i),destMin:d,path:b})):p.addOperation(g.pathPaymentStrictReceive({sendAsset:Cx(r),sendMax:l,destination:a,destAsset:Cx(i),destAmount:d,path:b})),[2,p.setTimeout(180).build().toXDR()]}})})},CS=function(e,t){return e.assetCode===t.assetCode&&e.assetIssuer===t.assetIssuer},IS=function(){var e=oS(),t=L("0"),n=t[0],r=t[1],i=L("0"),o=i[0],a=i[1],s=L(0),c=s[0],u=s[1],l=L(0),d=l[0],f=l[1],h=Ae(function(e){return e}),p=L(!1),b=p[0],m=p[1],g=L([]),v=g[0],y=g[1],w=L({field:"",message:""}),x=w[0],A=w[1],E=L(!1),S=E[0],_=E[1],O=L({rate:0,isInverted:!1}),N=O[0],k=O[1],T=L("from"),C=T[0],I=T[1],B=Bx(h.selectAsset.swapFromAsset,h.balances.balances),R=Bx(h.selectAsset.swapToAsset,h.balances.balances),P=kS(h.selectAsset.swapFromAsset),U=function(e){h.setSelectAsset(J(J({},h.selectAsset),{field:e})),h.setRoute(G.SELECT_ASSET)};M(function(){var e,t=h.selectAsset,n=t.swapFromAsset,r=t.swapToAsset;if(!t.userPicked&&CS(n,r)){var i=new Set(h.balances.balances.filter(function(e){return"native"!==e.asset_type}).map(function(e){return"".concat(e.asset_code,":").concat(e.asset_issuer)})),o=se((null===(e=h.stellar)||void 0===e?void 0:e.activeNetwork)||"").find(function(e){return!CS(e,n)});if(o){var a=i.has("".concat(o.assetCode,":").concat(o.assetIssuer))?h.balances.balances.find(function(e){return e.asset_code===o.assetCode&&e.asset_issuer===o.assetIssuer}):void 0;h.setSelectAsset(J(J({},h.selectAsset),{swapToAsset:a?Ux(a):o}))}}},[]);var j=function(e,t){"from"===t?a(e.target.value):r(e.target.value),I(t),_(!S)};M(function(){(y([]),m(!1),A({field:"",message:""}),k({rate:0,isInverted:!1}),isNaN(Number(o))||""===o||Number(o)<0)?A({field:"from",message:e("invalidFromValue")}):isNaN(Number(n))||""===n||Number(n)<0?A({field:"to",message:e("invalidToValue")}):CS(h.selectAsset.swapFromAsset,h.selectAsset.swapToAsset)?(h.selectAsset.userPicked||Number(o)>0||Number(n)>0)&&A({field:"both",message:e("sameAssetError")}):isNaN(Number(B))?A({field:"from",message:e("fromAssetInvalidBalance")}):Number(o)>Number(P)?A({field:"from",message:e("insufficientBalance")}):0===Number(o)&&0===Number(n)||(A({field:"",message:""}),Q(void 0,void 0,void 0,function(){var t,i,s;return ee(this,function(c){switch(c.label){case 0:if(m(!0),"from"!==C)return[3,5];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,IE([Cx(h.selectAsset.swapFromAsset),o,[Cx(h.selectAsset.swapToAsset)]],{})];case 2:return t=c.sent(),m(!1),0===(i=t.response.records.filter(function(e){return e.path.length<2})).length?A({field:"both",message:e("couldNotFindPath")}):(s=i[0],k({rate:Number(s.destination_amount)/Number(s.source_amount),isInverted:!1}),y(te(te([h.selectAsset.swapFromAsset],s.path.map(Ux),!0),[h.selectAsset.swapToAsset],!1)),r(s.destination_amount)),[3,4];case 3:return c.sent(),m(!1),A({field:"both",message:e("couldNotFindPath")}),[3,4];case 4:return[3,8];case 5:return c.trys.push([5,7,,8]),[4,CE([[Cx(h.selectAsset.swapFromAsset)],Cx(h.selectAsset.swapToAsset),n],{})];case 6:return t=c.sent(),m(!1),0===(i=t.response.records.filter(function(e){return e.path.length<2})).length?A({field:"both",message:e("couldNotFindPath")}):(s=i[0],k({rate:Number(s.destination_amount)/Number(s.source_amount),isInverted:!1}),y(te(te([h.selectAsset.swapFromAsset],s.path.map(Ux),!0),[h.selectAsset.swapToAsset],!1)),a(s.source_amount)),[3,8];case 7:return c.sent(),m(!1),A({field:"both",message:e("couldNotFindPath")}),[3,8];case 8:return[2]}})}))},[h.selectAsset,S,P]);var F=h.config.appearance,z="";0!==N.rate&&(z=N.isInverted?"1 ".concat(h.selectAsset.swapToAsset.assetCode," = ").concat((1/N.rate).toFixed(5)," ").concat(h.selectAsset.swapFromAsset.assetCode):"1 ".concat(h.selectAsset.swapFromAsset.assetCode," = ").concat(Gx(N.rate)," ").concat(h.selectAsset.swapToAsset.assetCode));var W="",q=""!==o&&"0"!==o&&Number(o)>=0&&!isNaN(Number(o)),X=""!==n&&"0"!==n&&Number(n)>=0&&!isNaN(Number(n));q&&X&&!b&&(W="".concat((Number(n)/100*99.5).toFixed(5)," ").concat(h.selectAsset.swapToAsset.assetCode));var K=[{label:e("rate"),value:0!==N.rate&&X?D("span",{className:"bluxcc:flex bluxcc:gap-1.5 bluxcc:items-center",children:[z,$("button",{id:"bluxcc-button",onClick:function(){f(function(e){return e+180}),k(J(J({},N),{isInverted:!N.isInverted}))},type:"button",className:"bluxcc:transition-transform bluxcc:duration-300 bluxcc:bg-transparent",style:{transform:"rotate(".concat(d,"deg)"),fontFamily:F.fontFamily},children:$(tS,{name:nS.SmallSwap,props:{fill:Vx(F.textColor,.7)}})})]}):"—"},{label:e("path"),value:(null==v?void 0:v.length)?v.map(function(e){return e.assetCode}).join(" > "):"—"},{label:e("minimumReceived"),value:X?W:"—"}];return D("form",{onSubmit:function(t){return Q(void 0,void 0,void 0,function(){var r,i,a,s,c;return ee(this,function(u){switch(u.label){case 0:if(t.preventDefault(),""!==x.message)return[2];if(CS(h.selectAsset.swapFromAsset,h.selectAsset.swapToAsset))return A({field:"both",message:e("sameAssetError")}),[2];u.label=1;case 1:return u.trys.push([1,3,,4]),r=function(e,t,n){var r=n.find(function(e){return"native"===e.asset_type});return"native"!==t.assetType&&(r=n.find(function(e){return e.asset_type===t.assetType&&e.asset_code===t.assetCode&&e.asset_issuer===t.assetIssuer})),!r||Number(r.balance)+Number(e)>=Number(r.limit)}(n,h.selectAsset.swapToAsset,h.balances.balances),[4,TS(o,n,C,h.selectAsset.swapFromAsset,h.selectAsset.swapToAsset,v,null===(a=h.user)||void 0===a?void 0:a.address,null===(s=h.stellar)||void 0===s?void 0:s.servers.horizon,(null===(c=h.stellar)||void 0===c?void 0:c.activeNetwork)||"",r)];case 2:return i=u.sent(),h.closeModal(),setTimeout(function(){try{SA(i)}catch(e){}},400),[3,4];case 3:return u.sent(),A({field:"both",message:e("failedToMakeTransaction")}),[3,4];case 4:return[2]}})})},children:[D("div",{className:"bluxcc:relative bluxcc:w-full bluxcc:p-4",style:{backgroundColor:F.fieldBackground,borderColor:F.borderColor,borderRadius:F.borderRadius,borderWidth:F.borderWidth,fontFamily:F.fontFamily},children:[D("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:text-sm bluxcc:select-none",children:[$("span",{style:{color:Vx(F.textColor,.7)},children:e("from")}),D("span",{style:{fontFamily:F.fontFamily},children:[$("button",{id:"bluxcc-button",className:"bluxcc:bg-transparent bluxcc:border-none",style:{color:Vx(F.textColor,.7),fontFamily:F.fontFamily},children:Gx(B)}),D("button",{type:"button",id:"bluxcc-button",onClick:function(){I("from"),_(!S),a(P)},style:{color:F.accentColor,fontFamily:F.fontFamily},className:"bluxcc:mr-2 bluxcc:ml-1.5 bluxcc:inline-flex bluxcc:bg-transparent",children:[e("max")," ",$(tS,{name:nS.ArrowDropUp,props:{fill:F.accentColor}})]})]})]}),D("div",{className:"bluxcc:mt-2 bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[$("input",{name:"from",type:"number",value:o,onChange:function(e){j(e,"from")},id:"bluxcc-input",className:"bluxcc:w-full bluxcc:bg-transparent bluxcc:text-xl bluxcc:font-medium bluxcc:outline-none",style:{color:"from"===x.field||"both"===x.field?"#ec2929":F.textColor,fontFamily:F.fontFamily}}),$(NS,{asset:h.selectAsset.swapFromAsset,handleOpenAssets:function(){U("swapFrom")}})]}),$("div",{className:"bluxcc:mt-1 bluxcc:text-left bluxcc:text-xs",style:{color:Vx(F.textColor,.7)}}),D("button",{type:"button",id:"bluxcc-button",className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent",children:[$("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:F.borderWidth,borderTopStyle:"solid",borderTopColor:F.borderColor}}),$("div",{onClick:function(){var e=h.selectAsset.swapFromAsset,t=h.selectAsset.swapToAsset;u(function(e){return e+180}),h.setSelectAsset(J(J({},h.selectAsset),{swapFromAsset:t,swapToAsset:e}))},className:"bluxcc:z-20 bluxcc:p-2 bluxcc:transition-all bluxcc:duration-200",style:{backgroundColor:F.fieldBackground,borderColor:F.borderColor,borderRadius:F.borderRadius,borderWidth:F.borderWidth},children:$("div",{className:"bluxcc:transition-transform bluxcc:duration-300",style:{transform:"rotate(".concat(c,"deg)")},children:$(tS,{name:nS.Swap,props:{fill:F.accentColor}})})})]}),D("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:text-sm bluxcc:select-none",style:{color:Vx(F.textColor,.7)},children:[$("span",{children:e("to")}),$("span",{className:"bluxcc:mr-2",children:Gx(R)})]}),D("div",{className:"bluxcc:mt-2 bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[$("input",{name:"to",id:"bluxcc-input",type:"number",value:n,onChange:function(e){j(e,"to")},className:"bluxcc:w-full bluxcc:bg-transparent bluxcc:text-xl bluxcc:font-medium bluxcc:outline-none",style:{color:"to"===x.field||"both"===x.field?"#ec2929":F.textColor,fontFamily:F.fontFamily}}),$(NS,{asset:h.selectAsset.swapToAsset,handleOpenAssets:function(){U("swapTo")}})]}),$("div",{className:"bluxcc:mt-1 bluxcc:text-left bluxcc:text-xs",style:{color:Vx(F.textColor,.7)}})]}),$("div",{className:"bluxcc:h-3.5 bluxcc:my-1.25 bluxcc:mx-3 bluxcc:text-left bluxcc:text-xs bluxcc:text-alert-error",children:x.message}),$("div",{style:{borderColor:F.borderColor,borderRadius:F.borderRadius,borderWidth:F.borderWidth},className:"bluxcc:w-full bluxcc:py-3 bluxcc:px-4",children:K.map(function(t,n,r){return D("div",{children:[D("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:items-center bluxcc:text-xs bluxcc:font-medium",children:[$("span",{style:{color:Vx(F.textColor,.8)},children:t.label}),$("span",{style:{color:Vx(F.textColor,.7)},children:b?"".concat(e("loading"),"..."):t.value})]}),n!==r.length-1&&$("div",{className:"bluxcc:my-2",style:{borderRadius:F.borderRadius,borderTop:"".concat(F.borderWidth," dashed ").concat(F.borderColor)}})]},t.label)})}),$(cS,{}),$(pS,{size:"large",state:"enabled",variant:"outline",type:"submit",disabled:""!==x.message,children:e("swap")})]})},BS=function(e){var t=e.button,n=e.onButtonClick,r=e.appearance;return $("button",{onClick:n,id:"bluxcc-button",style:{borderRadius:r.borderRadius,color:r.textColor,borderColor:r.borderColor,background:r.background,borderWidth:r.borderWidth},className:"bluxcc:border bluxcc:px-3! bluxcc:py-1! bluxcc:text-sm! bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",children:t})},LS=function(e){var t=e.label,n=e.autoFocus,r=e.type,i=void 0===r?"text":r,o=e.placeholder,a=void 0===o?"":o,s=e.error,c=e.iconRight,u=e.iconLeft,l=e.button,d=e.optionalField,f=void 0!==d&&d,h=e.onButtonClick,p=e.customLabel,b=e.value,m=e.className,g=e.onChange,v=Ae(function(e){return e.config.appearance}),y=L(!1),w=y[0],x=y[1],A=oS(),E=function(){return s?"#ec2929":w?v.accentColor:v.borderColor};return D("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col",style:{fontFamily:v.fontFamily},children:[t&&D("label",{style:{color:s?"#ec2929":v.textColor},className:"bluxcc:mb-2 bluxcc:ml-4 bluxcc:flex bluxcc:justify-between bluxcc:text-xs",children:[D("span",{children:[t," ",f&&D("span",{style:{color:Vx(v.textColor,.7)},className:"bluxcc:text-[10px]",children:["(",A("optional"),")"]})]}),$("span",{children:p})]}),D("div",{className:"bluxcc:flex bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:px-4 bluxcc:py-2 bluxcc:transition-all bluxcc:duration-300 ".concat(m),onFocus:function(){return x(!0)},onBlur:function(){return x(!1)},onMouseEnter:function(e){w||s||(e.currentTarget.style.borderColor=v.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){w||(e.currentTarget.style.borderColor=s?"#ec2929":v.borderColor)},style:{"--tw-ring-color":E(),border:"".concat(v.borderWidth," solid ").concat(E()),borderRadius:v.borderRadius,backgroundColor:v.fieldBackground},children:[u&&$("div",{className:"bluxcc:mr-2",children:u}),$("input",{id:"bluxcc-input",autoComplete:"off",min:"number"===i?1:void 0,type:i,autoFocus:n,value:b,placeholder:a,className:"bluxcc:mr-2! bluxcc:bg-transparent bluxcc:outline-hidden bluxcc:text-base bluxcc:font-medium",style:{fontFamily:v.fontFamily,color:v.textColor,width:l?"90%":"100%"},onChange:g}),l&&$(BS,{button:l,onButtonClick:h,appearance:v}),c&&$("div",{className:"bluxcc:ml-4",children:c})]}),!f&&$("div",{className:"bluxcc:mt-1 bluxcc:text-xs bluxcc:ml-4 bluxcc:h-4",children:s?$("p",{className:"bluxcc:text-alert-error",children:s}):""})]})},MS=function(){var e=oS(),t=Ae(function(e){return e}),n=L({}),r=n[0],a=n[1],s=L({memo:"",amount:"",address:""}),c=s[0],u=s[1],l=t.config.appearance,d=function(e){return function(t){u(function(n){var r;return J(J({},n),((r={})[e]=t.target.value,r))}),a(function(t){var n;return J(J({},t),((n={})[e]="",n))})}},f=kS(t.selectAsset.sendAsset);return $(z,{children:D("div",{children:[$("div",{className:"bluxcc:relative bluxcc:mb-1",children:$(LS,{autoFocus:!0,type:"number",label:e("amount"),placeholder:"0.00",value:c.amount,onChange:d("amount"),error:r.amount,customLabel:D("button",{id:"bluxcc-button",type:"button",onClick:function(){u(function(e){return J(J({},e),{amount:f})})},style:{color:l.accentColor,fontFamily:l.fontFamily},className:"bluxcc:mr-2 bluxcc:inline-flex bluxcc:bg-transparent",children:[e("max")," ",$(tS,{name:nS.ArrowDropUp,props:{fill:l.accentColor}})]}),onButtonClick:function(){t.setSelectAsset(J(J({},t.selectAsset),{field:"send"})),t.setRoute(G.SELECT_ASSET)},button:D("span",{className:"bluxcc:flex bluxcc:bg-transparent bluxcc:items-center bluxcc:gap-1 bluxcc:max-h-8",style:{backgroundColor:l.fieldBackground},children:[$("div",{style:{fontFamily:l.fontFamily,background:l.background,borderRadius:l.borderRadius,borderColor:l.borderColor,borderWidth:l.borderWidth,color:l.textColor},className:"bluxcc:flex bluxcc:mr-2 bluxcc:size-7 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-[border-radius] bluxcc:duration-300",children:$(OS,{assetCode:t.selectAsset.sendAsset.assetCode,assetIssuer:t.selectAsset.sendAsset.assetIssuer,assetType:t.selectAsset.sendAsset.assetType,fill:zx(l.fieldBackground)})}),$("span",{style:{fontFamily:l.fontFamily,color:l.textColor},children:t.selectAsset.sendAsset.assetCode}),$(tS,{name:nS.ArrowDropDown,props:{fill:l.accentColor}})]})})}),$("div",{className:"bluxcc:mb-1",children:$(LS,{label:e("to"),placeholder:e("enterAddress"),value:c.address,onChange:d("address"),error:r.address,button:e("paste"),onButtonClick:function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:return[4,navigator.clipboard.readText()];case 1:return e=t.sent(),u(function(t){return J(J({},t),{address:e})}),[2]}})})}})}),$("div",{children:$(LS,{optionalField:!0,label:e("memo"),placeholder:e("enterMemo"),value:c.memo,onChange:d("memo")})}),$(cS,{}),$(pS,{size:"large",variant:"outline",state:"enabled",onClick:function(){return Q(void 0,void 0,void 0,function(){var n,r,s,u,l,d;return ee(this,function(p){switch(p.label){case 0:if(n={},c.amount?Number(c.amount)>Number(f)&&(n.amount=e("amountExceedsBalance")):n.amount=e("amountRequired"),c.address?i.isValidEd25519PublicKey(c.address)||(n.address=e("addressInvalid")):n.address=e("addressRequired"),a(n),0!==Object.keys(n).length)return[3,4];p.label=1;case 1:return p.trys.push([1,3,,4]),[4,(b=c.memo,m=c.amount,y=c.address,w=t.selectAsset.sendAsset,x=null===(u=t.user)||void 0===u?void 0:u.address,A=null===(l=t.stellar)||void 0===l?void 0:l.servers.horizon,E=(null===(d=t.stellar)||void 0===d?void 0:d.activeNetwork)||"",Q(void 0,void 0,void 0,function(){var e,t,n,r;return ee(this,function(i){switch(i.label){case 0:e=null,t=null,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,A.loadAccount(y)];case 2:return t=i.sent(),[3,4];case 3:return i.sent(),[3,4];case 4:return i.trys.push([4,6,,7]),[4,A.loadAccount(x)];case 5:return e=i.sent(),[3,7];case 6:return i.sent(),[3,7];case 7:if(!e)throw new Error("BLUX: Inactive account cannot send a transaction.");if(!t&&"native"!==w.assetType)throw new Error("BLUX: Cannot send non-native asset to an inactive account.");return n=new h(e,{fee:"50000",networkPassphrase:E}),t?(r=o.native(),"native"!==w.assetType&&(r=new o(w.assetCode,w.assetIssuer)),n=n.addOperation(g.payment({amount:m,destination:y,asset:r}))):n=n.addOperation(g.createAccount({startingBalance:m,destination:y})),b&&(n=n.addMemo(v.text(b))),[2,n.setTimeout(180).build().toXDR()]}})}))];case 2:return r=p.sent(),t.closeModal(),setTimeout(function(){var e;SA(r,{network:(null===(e=t.stellar)||void 0===e?void 0:e.activeNetwork)||""})},400),[3,4];case 3:return s=p.sent(),n.address=s.message,a(n),[3,4];case 4:return[2]}var b,m,y,w,x,A,E})})},children:e("sendButton")})]})})},RS=function(e){var t=e.otp,n=e.setOtp,r=e.error,i=t.length,o=R([]),a=Ae(function(e){return e.config.appearance});M(function(){r&&setTimeout(function(){var e;return null===(e=o.current[0])||void 0===e?void 0:e.focus()},1001)},[r]);var s=function(e){e.preventDefault();var t=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,i);if(t){var r=te(te([],t.split(""),!0),Array(i-t.length).fill(""),!0);n(r),setTimeout(function(){var e;return null===(e=o.current[i-1])||void 0===e?void 0:e.focus()},0)}},c=function(e){return{fontFamily:a.fontFamily,borderRadius:a.borderRadius,color:a.accentColor,background:a.fieldBackground,"--tw-ring-color":r?"#FF6666":a.accentColor,borderColor:r?"#FF6666":e?a.accentColor:a.borderColor,borderWidth:a.borderWidth}};return $("div",{className:"bluxcc:flex bluxcc:gap-1",children:t.map(function(e,r){return $("input",{autoFocus:0===r,ref:function(e){o.current[r]=e},type:"text",inputMode:"numeric",maxLength:1,value:e,onChange:function(e){return function(e,r){var a,s=r.target.value.replace(/\D/g,"");if(s){var c=te([],t,!0);c[e]=s[0],n(c),e<i-1&&s&&(null===(a=o.current[e+1])||void 0===a||a.focus())}}(r,e)},onPaste:s,onKeyDown:function(e){return function(e,r){var i;if("Backspace"===r.key){var a=te([],t,!0);a[e]?(a[e]="",n(a)):e>0&&(null===(i=o.current[e-1])||void 0===i||i.focus(),a[e-1]="",n(a))}}(r,e)},className:"bluxcc:h-14 bluxcc:w-12 bluxcc:border bluxcc:text-center bluxcc:text-lg bluxcc:outline-hidden bluxcc:focus:ring-1",style:c(e)},r)})})},PS=function(){var e=ve();e.login&&(e.user&&e.user.address&&e.authState.isAuthenticated?e.login.resolver(e.user):e.login.rejecter("BLUX: Failed to login!"),e.setLogin(void 0))},US=function(){var e,t=ve(),n=null===(e=t.auth)||void 0===e?void 0:e.JWT;n&&(localStorage.setItem(_e,n),t.setAuth({isAuthenticated:!0,JWT:n}),t.user&&vA(t.user.authMethod,t.user.authValue||"",Date.now(),n)),t.setIsAuthenticated(!0),t.closeModal(),PS();var r=ve();r.user&&r.emitter.emit(ne.LoggedIn,{user:r.user})},jS=function(e){void 0===e&&(e="BLUX: User declined the terms of service.");var t=ve();t.login&&(t.login.rejecter(e),t.setLogin(void 0)),localStorage.removeItem(_e),yA(),t.logoutAction()},FS=function(){var e=ve();e.apiResponse&&(e.apiResponse.privacyPolicy||e.apiResponse.terms)?e.setRoute(G.ACCEPT_TERMS_AND_PRIVACY):US()},DS=function(){var e=oS(),t=Ae(function(e){return e}),n=t.user,r=t.config.appearance,i=null==n?void 0:n.authValue,o=L(Array(6).fill("")),a=o[0],s=o[1],c=L(!1),u=c[0],l=c[1];return M(function(){var e,n=a.join("");6===n.length&&(e=n,Q(void 0,void 0,void 0,function(){var n,r,i,o;return ee(this,function(a){switch(a.label){case 0:l(!1),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,Pe(t.config.appId,t.user,e)];case 2:return(n=a.sent())?(l(!1),t.setAuth({isAuthenticated:!1,JWT:n}),[4,Ue(n)]):[3,4];case 3:r=a.sent(),t.connectWalletSuccessful(r.public_key,(null===(o=t.stellar)||void 0===o?void 0:o.activeNetwork)||""),setTimeout(function(){ve().modal.isOpen&&(t.setRoute(G.SUCCESSFUL),setTimeout(function(){ve().modal.isOpen&&FS()},1e3))}),a.label=4;case 4:return[3,6];case 5:return i=a.sent(),Se(i)?(t.setLoginError(i.message),t.setRoute(G.FAILED),[2]):(l(!0),setTimeout(function(){return s(Array(6).fill(""))},1e3),[3,6]);case 6:return[2]}})}))},[a,i]),D("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[$("div",{style:{borderColor:r.borderColor,borderWidth:r.borderWidth},className:"bluxcc:mb-6 bluxcc:flex bluxcc:h-20 bluxcc:w-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full bluxcc:border-2",children:$(tS,{name:nS.Email,props:{fill:r.textColor}})}),D("div",{className:"bluxcc:flex-col bluxcc:space-y-1 bluxcc:text-center",children:[$("p",{className:"bluxcc:text-xl bluxcc:font-medium",children:e("enterConfirmationCodeTitle")}),$("p",u?{className:"bluxcc:flex bluxcc:h-10 bluxcc:items-center bluxcc:justify-center bluxcc:text-sm bluxcc:text-alert-error",children:e("invalidCodeError")}:{className:"bluxcc:h-10 bluxcc:text-sm",children:e("enterConfirmationCodeHelp")})]}),$("div",{className:"bluxcc:mt-6 bluxcc:text-center",children:$(RS,{otp:a,setOtp:s,error:u})}),$(cS,{}),$(pS,{size:"medium",state:"enabled",variant:"text",onClick:function(){return Q(void 0,void 0,void 0,function(){var e,n;return ee(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Le(t.config.appId,(null===(n=t.user)||void 0===n?void 0:n.authValue)||"")];case 1:return r.sent(),[3,3];case 2:return e=r.sent(),Se(e)&&(t.setLoginError(e.message),t.setRoute(G.FAILED)),[3,3];case 3:return[2]}})})},style:{color:r.accentColor},children:e("resendCode")})]})},zS=function(){var e,t,n,r=oS(),i=Ae(function(e){return e}),o="";"object"==typeof(null===(e=i.sendTransaction)||void 0===e?void 0:e.result)&&i.sendTransaction.result.hash&&(o=i.sendTransaction.result.hash);var a=(null===(n=null===(t=i.sendTransaction)||void 0===t?void 0:t.options)||void 0===n?void 0:n.network)||"",s=o?$x(a,i.config.explorer,"transactionUrl",o):null,c=function(){switch(i.waitingStatus){case"login":return{title:r("connectionSuccessfulTitle"),message:r("connectionSuccessfulMessage",{appName:jx(i.config.appName)})};case"signMessage":return{title:r("messageSignedTitle")||"Message Signed",message:r("messageSignedMessage")||"Your message has been signed successfully."};case"signAuthEntry":return{title:r("authEntrySignedTitle")||"Authorization Signed",message:r("authEntrySignedMessage")||"Authorization has been signed successfully."};default:return{title:r("transactionSuccessfulTitle"),message:r("transactionSuccessfulMessage")}}}(),u=c.title,l=c.message;return D("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[$("div",{style:{background:Vx(i.config.appearance.accentColor,.1)},className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",children:$(tS,{name:nS.GreenCheck,props:{fill:i.config.appearance.accentColor}})}),D("div",{className:"bluxcc:w-full bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[$("p",{className:"bluxcc:text-xl",children:u}),$("p",{className:"bluxcc:text-center bluxcc:text-sm bluxcc:leading-5",children:l})]}),"sendTransaction"===i.waitingStatus&&o&&"string"==typeof s&&$(pS,{state:"enabled",variant:"outline",size:"small",className:"bluxcc:mt-4",onClick:function(){s&&window.open(s,"_blank","noopener,noreferrer")},children:r("seeInExplorer")}),$(cS,{}),"login"===i.waitingStatus?$(pS,{state:"disabled",variant:"outline",children:r("loggingIn")}):$(pS,{state:"enabled",variant:"fill",size:"large",onClick:function(){var e=i.waitingStatus;if("sendTransaction"===e&&i.sendTransaction){var t=i.sendTransaction,n=t.resolver,r=t.result;n&&r&&n(r)}else if("signMessage"===e&&i.signMessage){var o=i.signMessage;n=o.resolver,r=o.result;n&&r&&n(r)}else if("signAuthEntry"===e&&i.signAuthEntry){var a=i.signAuthEntry;n=a.resolver,r=a.result;n&&r&&n(r)}setTimeout(function(){i.cleanUp(e),i.closeModal()},150)},children:r("done")})]})},$S=function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i,o,a,s,c,u,l,d,f;return ee(this,function(h){switch(h.label){case 0:e.connectWallet(t.name),h.label=1;case 1:return h.trys.push([1,15,,16]),[4,t.connect()];case 2:if(!(n=h.sent())||""===n.trim())return[2];r=void 0,h.label=3;case 3:return h.trys.push([3,12,,13]),t.authenticateWithSignedMessage?[4,Me(e.config.appId,t.name,n,"signed_message")]:[3,7];case 4:if(i=h.sent(),o=i.challenge,u=i.network_passphrase,!o)throw new Error("BLUX: Login challenge is missing.");return[4,cA(t,o,n,u)];case 5:return a=h.sent(),[4,Re(e.config.appId,a,{proofType:"signed_message",challenge:o})];case 6:return r=h.sent(),[3,11];case 7:return[4,Me(e.config.appId,t.name,n)];case 8:if(s=h.sent(),c=s.challenge_xdr,u=s.network_passphrase,!c)throw new Error("BLUX: Login challenge is missing.");return[4,lA(t,c,n,u)];case 9:return l=h.sent(),[4,Re(e.config.appId,l)];case 10:r=h.sent(),h.label=11;case 11:return[3,13];case 12:return d=h.sent(),Se(d)&&e.setLoginError(d.message),e.setRoute(G.FAILED),[2];case 13:return[4,Hx(t)];case 14:return f=h.sent(),e.setAuth({isAuthenticated:!1,JWT:r}),p=t.name,b=Wx(),m=te([p],b.filter(function(e){return e!==p}),!0),localStorage.setItem(Oe,JSON.stringify(m)),setTimeout(function(){ve().modal.isOpen&&(e.connectWalletSuccessful(n,f),e.setRoute(G.SUCCESSFUL),setTimeout(function(){ve().modal.isOpen&&FS()},1e3))},500),[3,16];case 15:return h.sent(),e.setRoute(G.FAILED),[3,16];case 16:return[2]}var p,b,m})})},WS=!1,qS=function(e){return Q(void 0,void 0,void 0,function(){return ee(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e.connect({optionalNamespaces:{stellar:{methods:["stellar_signXDR","stellar_signAndSubmitXDR","stellar_signMessage"],chains:[Ne,ke],events:[]}}})];case 1:return[2,t.sent()];case 2:return t.sent(),[2,null];case 3:return[2]}})})},XS={google:{displayName:"Google",icon:nS.Google}},KS=["wallet","sms","email","passkey"],HS=new Set,VS=function(e,t){HS.has(e)||HS.add(e)},GS=function(e,t){if(!t||!t.isValid)return[];for(var n=new Set(t.socials.map(function(e){return e.toLowerCase()})),r=[],i=0,o=e;i<o.length;i++){var a=o[i],s=String(a).toLowerCase().trim();KS.includes(s)||(XS[s]&&n.has(s)?r.includes(s)||r.push(s):VS(s))}return r},YS=null,JS=function(){if((null==YS?void 0:YS.popup)&&!YS.popup.closed)try{YS.popup.close()}catch(e){}YS=null},ZS=function(){try{return new URL(Te).origin}catch(e){return""}}(),QS=function(e,t){if(JS(),!XS[e]||!t)return YS={provider:e,popup:null,error:"BLUX: '".concat(e,"' login is not fully configured for this app.")};var n=new URLSearchParams({app_id:t,origin:window.location.origin}),r=window.screenX+Math.max(0,(window.outerWidth-480)/2),i=window.screenY+Math.max(0,(window.outerHeight-640)/2),o=window.open("".concat(Te,"/auth/social/").concat(encodeURIComponent(e),"/start?").concat(n.toString()),"bluxcc-social-login","popup=yes,width=".concat(480,",height=").concat(640,",left=").concat(r,",top=").concat(i));return YS={provider:e,popup:o}},e_=function(e){return new Promise(function(t,n){if(e.error)n(new Error(e.error));else if(e.popup){var r,i,o=Date.now(),a=!1,s=function(){var t;a=!0,clearInterval(r),i&&clearTimeout(i),window.removeEventListener("message",u);try{null===(t=e.popup)||void 0===t||t.close()}catch(e){}},c=function(e){a||(s(),n(new Error(e)))},u=function(e){if(!ZS||e.origin===ZS){var n,r=e.data||{};if("blux"===r.source&&"social-auth"===r.type)"success"===r.status&&r.jwt?(n=r.jwt,a||(s(),t(n))):c(r.error?"BLUX: ".concat(r.error):"BLUX: Login failed. Please try again.")}};window.addEventListener("message",u),r=setInterval(function(){if(!a)if(Date.now()-o>3e5)c("BLUX: Login timed out. Please try again.");else{var t=e.popup;t&&!t.closed||(clearInterval(r),i=setTimeout(function(){c("BLUX: The login window was closed.")},700))}},400)}else n(new Error("BLUX: Popup was blocked. Please allow popups and try again."))})},t_=function(){var e=oS(),t=Ae(function(e){return e}),n=L(""),r=n[0],i=n[1],o=t.config,a=t.wallets,s=t.connectEmail,c=t.setShowAllWallets,u=o.appearance,l=o.loginMethods||[],d=l.includes("passkey"),f=U(function(){return GS(l,t.apiResponse)},[l,t.apiResponse]),h=U(function(){var e=te([],l,!0).filter(function(e){return"passkey"!==e});return te(te([],e,!0),d?["passkey"]:[],!0)},[l,d]),p=U(function(){return a.length>3?a.slice(2):[]},[a]),b=U(function(){return a.length<=3?a:t.showAllWallets?a.slice(2,a.length):a.slice(0,2)},[a,t.showAllWallets]);M(function(){t.walletConnect&&qS(t.walletConnect.client).then(function(e){t.setWalletConnectClient(t.walletConnect.client,e)}).catch(function(e){})},[]);var m=function(){return Q(void 0,void 0,void 0,function(){var e;return ee(this,function(n){switch(n.label){case 0:t.setLoginError(void 0),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,Le(o.appId,r)];case 2:return n.sent(),s(r),[3,4];case 3:return e=n.sent(),Se(e)&&(t.setLoginError(e.message),t.setRoute(G.FAILED)),[3,4];case 4:return[2]}})})},g=function(){t.setRoute(G.PASSKEY_ONBOARDING)},v=function(){return D("div",{className:"bluxcc:my-1 bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:[$("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:z-10",style:{borderTop:"".concat(u.borderWidth," dashed ").concat(u.borderColor)}}),$("span",{className:"bluxcc:z-20 bluxcc:w-auto bluxcc:px-2 bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",style:{background:u.background,color:u.borderColor},children:e("or")})]})};return D("div",{className:"bluxcc:w-full",children:[u.logo&&$("div",{className:"bluxcc:my-6 bluxcc:flex bluxcc:max-h-20 bluxcc:w-full bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden",children:$("img",{src:u.logo,alt:o.appName,width:152,height:60,className:"bluxcc:max-h-20 bluxcc:max-w-45 bluxcc:select-none",loading:"eager",decoding:"async",draggable:"false",style:{contentVisibility:"auto"}})}),$("div",{className:"",children:h.map(function(n,r){var o=function(e){return String(e||"").toLowerCase().trim()},a=o(n),s=h[r+1],l=h.includes("wallet"),d=function(e){return"email"===e||f.includes(o(e))},y=l&&!t.showAllWallets&&"wallet"===n&&d(s)||l&&d(n)&&"wallet"===s;if("wallet"===n)return $(B.Fragment,{children:D("div",{className:"bluxcc:max-h-81 bluxcc:space-y-2 bluxcc:overflow-y-auto bluxcc:overflowStyle",children:[b.map(function(e){return $(dS,J({},e,{label:e.name,startIcon:SS(e.name,Jx(u.background)),onClick:function(){return n=e,Q(void 0,void 0,void 0,function(){return ee(this,function(e){return n.name===H.WalletConnect?t.setRoute(G.WALLET_CONNECT):$S(t,n),[2]})});var n}}),e.name)}),p.length>0&&!t.showAllWallets&&$(dS,{endArrow:!0,label:e("allStellarWallets"),startIcon:$(tS,{name:nS.Stellar,props:{fill:zx(u.background)}}),onClick:function(){c(!0)}}),y&&v()]})},"wallet");if(!t.showAllWallets&&f.includes(a)){if(h.findIndex(function(e){return o(e)===a})!==r)return null;var w=XS[a];return D(B.Fragment,{children:[$("div",{className:"bluxcc:mb-2",children:$(dS,{label:e("continueWith",{provider:w.displayName}),startIcon:$(tS,{name:w.icon}),onClick:function(){return function(e){QS(e,t.config.appId),t.connectSocial(e)}(a)}})}),y&&v()]},a)}return t.showAllWallets||"email"!==n?t.showAllWallets||"passkey"!==n?null:$("button",{onClick:g,className:"bluxcc:mt-6! bluxcc:w-full bluxcc:bg-transparent bluxcc:flex bluxcc:h-4 bluxcc:items-center bluxcc:justify-center bluxcc:text-sm bluxcc:leading-7 bluxcc:font-medium",style:{color:u.accentColor,fontFamily:u.fontFamily},children:e("logInWithPasskey")},"passkey"):D(B.Fragment,{children:[$("div",{className:"bluxcc:mb-2",children:$(dS,{inputType:"email",variant:"input",startIcon:$(tS,{name:nS.SmallEmail,props:{fill:u.textColor}}),onChange:function(e){return i(e)},onEnter:m,onSubmit:m})}),y&&v()]},"email")})}),$("footer",{className:"bluxcc:w-full bluxcc:pt-4.25 bluxcc:text-center bluxcc:text-xs bluxcc:font-medium",children:$("a",{"aria-label":"blux website",href:"https://blux.cc",target:"_blank",rel:"noreferrer",className:"bluxcc:no-underline",style:{color:u.textColor,fontFamily:u.fontFamily},children:e("poweredByBlux")})})]})},n_=function(e){var t=e.value,n=e.title,r=void 0===n?"":n,i=e.size,o=void 0===i?184:i,a=e.bgColor,s=void 0===a?"#ffffff":a,c=e.fgColor,u=void 0===c?"#00020f":c,l=e.level,d=void 0===l?"Q":l,f=e.imgSize,h=void 0===f?51:f,p=Z(e,["value","title","size","bgColor","fgColor","level","imgSize"]);return $(X,J({className:"bluxcc:z-10",value:t,title:r,size:o,bgColor:s,fgColor:u,level:d,marginSize:1,imageSettings:{src:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBw8NDQ8NDQ0PDQ0PDw4NDw0NDQ8PDQ0NFREWFhURExUYHSggGBolGxUVITEhJSkrLi4uFx8zODMsNygtLisBCgoKDQ0OFQ4PFSsdExkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIAKwBJgMBIgACEQEDEQH/xAAXAAEBAQEAAAAAAAAAAAAAAAAAAQIH/8QAIRABAQABBAAHAAAAAAAAAAAAAAERAiFhgSIxQVFxsfD/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8A7iAAACW8d+ygAAACSAoAAAAAAAAAAAAAAADOrVZZJptluLczwzFub9dtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmd/LtQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABLwoAAAAAQAAAAAAAAAAAAAAAAAABL+5UAAAAAAAAAAAEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAJYCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAARQAAAAAAAAAAAAEwoAAAACSqAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAS59NvmZ2yoAAAAAAAAAAAAACAomFAAAAAAAABKoAAAAA//2Q==",x:void 0,y:void 0,height:h,width:h,opacity:1,excavate:!0}},p))},r_=function(){var e,t=oS(),n=Ae(function(e){return e}),r=Ae(function(e){return e}).setAlert,i=n.config.appearance,o=null===(e=n.user)||void 0===e?void 0:e.address;return D("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:[D("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:size-52 bluxcc:items-center bluxcc:justify-center",style:{position:"relative",borderRadius:i.borderRadius,color:i.textColor,borderColor:i.borderColor,backgroundColor:i.fieldBackground,borderWidth:i.borderWidth},children:[$(n_,{size:184,value:o,bgColor:i.fieldBackground,fgColor:i.accentColor,level:"Q"}),$("div",{className:"bluxcc:z-20",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:i.background},children:$(tS,{name:nS.SmallBlux,props:{fill:i.accentColor,background:i.fieldBackground}})})]}),D("div",{className:"bluxcc:mt-4 bluxcc:space-y-2 bluxcc:font-medium",children:[$("p",{className:"bluxcc:text-lg",children:"Your Address"}),$("div",{className:"bluxcc:w-full bluxcc:px-2.5 bluxcc:py-3 bluxcc:h-14",style:{borderRadius:i.borderRadius,color:i.textColor,borderColor:i.borderColor,backgroundColor:i.fieldBackground,borderWidth:i.borderWidth},children:$("p",{className:"bluxcc:w-73 bluxcc:text-sm bluxcc:leading-4! bluxcc:break-all",style:{color:Vx(i.textColor,.7)},children:o})})]}),$(cS,{}),$(pS,{size:"large",state:"enabled",variant:"tonal",style:{color:i.accentColor},onClick:function(){Fx(o),r("copy",t("address_copied")),setTimeout(function(){r("none","")},1e3)},endIcon:$(tS,{name:nS.LargeCopy,props:{fill:i.accentColor}}),children:t("copy_address")})]})},i_=function(){var e,t,n=oS(),r=Ae(function(e){return e}),i=(t=r.config.networks,Object.entries(Ax).filter(function(e){return t.includes(e[1])}).map(function(e){return jx(e[0])}));return D("div",{style:{fontFamily:r.config.appearance.fontFamily},className:"bluxcc:mt-4 bluxcc:mb-10 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[$("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden",children:$(tS,{name:nS.WrongNetwork,props:{}})}),D("div",{className:"bluxcc:w-full bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[$("p",{className:"bluxcc:text-2xl",children:n("wrongNetwork")}),$("p",{className:"bluxcc:text-center bluxcc:text-sm bluxcc:leading-5 bluxcc:tracking-[-2%] bluxcc:mx-3",children:n("wrongNetworkMessage",{currentNetwork:jx(qx(null===(e=r.user)||void 0===e?void 0:e.walletPassphrase)),switchNetwork:i.join(" or ")})})]})]})},o_=function(e){var t=e.assets,n=L(null),r=n[0],i=n[1],o=Ae(function(e){return e.config.appearance}),a=Ae(function(e){return e}),s=oS();return D("div",{className:"bluxcc:h-full bluxcc:w-full bluxcc:overflow-auto bluxcc:overflowStyle",children:[t.map(function(e,n){return D("button",{id:"bluxcc-button",onClick:function(){return function(e){a.setDetailsAsset(e),a.setDynamicTitle(e.title),a.setRoute(G.BALANCE_DETAILS)}(e)},onMouseEnter:function(){return i(n)},onMouseLeave:function(){return i(null)},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:py-2 bluxcc:px-4",style:{background:r===n?o.fieldBackground:"transparent",color:o.textColor,borderBottomStyle:"dashed",borderBottomWidth:n<t.length-1?o.borderWidth:"0px",borderBottomColor:o.borderColor,transition:"all 0.2s ease-in-out",fontFamily:o.fontFamily},children:[D("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[$("span",{className:"bluxcc:font-medium bluxcc:size-10 bluxcc:flex bluxcc:items-center bluxcc:justify-center",style:{borderRadius:o.borderRadius,background:o.fieldBackground,border:"".concat(o.borderWidth," solid ").concat(o.borderColor)},children:$(OS,{assetCode:e.assetCode,assetIssuer:e.assetIssuer,assetType:e.assetType,fill:zx(o.fieldBackground)})}),D("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:justify-start bluxcc:items-start",children:[$("span",{className:"bluxcc:text-sm bluxcc:font-medium",children:e.title}),$("span",{className:"bluxcc:font-semibold bluxcc:text-xs",style:{color:Vx(o.textColor,.7)},children:e.subtitle})]})]}),D("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:text-right",children:[$("span",{className:"bluxcc:font-medium",children:Gx(e.assetBalance)}),Number(e.valueInCurrency)>0&&$("span",{className:"bluxcc:font-semibold bluxcc:text-xs",style:{color:Vx(o.textColor,.7)},children:Yx(e.valueInCurrency||"0")})]})]},e.assetType+e.assetIssuer)}),0===t.length&&$("div",{style:{color:Vx(o.textColor,.7)},className:"bluxcc:mb-2 bluxcc:text-center bluxcc:h-full bluxcc:flex bluxcc:justify-center bluxcc:items-center",children:s("noAssetsFound")})]})},a_=function(e){return"native"===e.asset_type?"native":"liquidity_pool_shares"===e.asset_type?"lp:".concat(e.liquidity_pool_id):"".concat(e.asset_code,":").concat(e.asset_issuer)},s_=function(e,t){if(!t.isFinite()||t.lte(0))return new Ou(0);for(var n=t,r=new Ou(0),i=0,o=e;i<o.length;i++){var a=o[i];if(n.lte(0))break;var s=new Ou(a.price),c=new Ou(a.amount);if(s.isFinite()&&!s.lte(0)&&c.isFinite()&&!c.lte(0)){var u=c.div(s),l=Ou.minimum(n,u);r=r.plus(l.times(s)),n=n.minus(l)}}return r},c_=function(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"0":e.decimalPlaces(7,Ou.ROUND_DOWN).toString()},u_=function(e,t,n){return Q(void 0,void 0,void 0,function(){return ee(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,kE([e,t],{network:n,limit:200})];case 1:return[2,r.sent().response.bids];case 2:return r.sent(),[2,[]];case 3:return[2]}})})},l_=function(e,t,n,r){return Q(void 0,void 0,void 0,function(){var i,a,s,c,u,l,d,f;return ee(this,function(h){switch(h.label){case 0:return!(i=new Ou(null!==(f=e.balance)&&void 0!==f?f:"0")).isFinite()||i.lte(0)?[2,"0"]:function(e){return("credit_alphanum4"===e.asset_type||"credit_alphanum12"===e.asset_type)&&"USDC"===e.asset_code&&e.asset_issuer===ie.assetIssuer}(e)?[2,c_(i)]:"native"===e.asset_type?[2,c_(s_(n,i))]:"liquidity_pool_shares"===e.asset_type?[2,"0"]:(a=new o(e.asset_code,e.asset_issuer),[4,u_(a,t,r)]);case 1:return s=h.sent(),c=s_(s,i),[4,u_(a,o.native(),r)];case 2:return u=h.sent(),l=s_(u,i),d=s_(n,l),[2,c_(Ou.maximum(c,d))]}})})},d_=function(t){return t===e.PUBLIC?"mainnet":"testnet"},f_=function(e,t){if(!e)return"0";if(!t)return e;var n=e.startsWith("-"),r=(n?e.slice(1):e).padStart(t+1,"0"),i=r.slice(0,r.length-t),o=r.slice(r.length-t).replace(/0+$/,"");return"".concat(n?"-":"").concat(i).concat(o?".".concat(o):"")},h_=function(e){if("native"===e)return{type:"native"};var t=e.indexOf(":");if(-1===t)return null;var n=e.slice(0,t),r=e.slice(t+1);return n&&i.isValidEd25519PublicKey(r)?{type:"credit",code:n,issuer:r}:null},p_=function(e,t){return"native"===e?t||"XLM":e.includes(":")?t||e.split(":")[0]:e||t},b_=function(e,t){var n=h_(e);return n&&"credit"===n.type?{code:n.code,issuer:n.issuer}:{code:t,issuer:""}},m_=function(e,t){return Q(void 0,void 0,void 0,function(){var n,r,i,o;return ee(this,function(a){switch(a.label){case 0:n=0,r=["admin","owner"],a.label=1;case 1:if(!(n<r.length))return[3,6];i=r[n],a.label=2;case 2:return a.trys.push([2,4,,5]),[4,RE([{address:e,fn:i,args:[]}],{network:t})];case 3:return o=a.sent(),Array.isArray(o)||null==o.values[0]?[3,5]:[2,String(o.values[0])];case 4:return a.sent(),[3,5];case 5:return n++,[3,1];case 6:return[2,void 0]}})})},g_=function(e,t,n){return Q(void 0,void 0,void 0,function(){var r,o,a,s,c,u,l,d,f,h;return ee(this,function(p){switch(p.label){case 0:if(!i.isValidContract(e))throw new Error("BLUX: invalid token contract id");return r=[{address:e,fn:"name",args:[]},{address:e,fn:"symbol",args:[]},{address:e,fn:"decimals",args:[]}],t&&r.push({address:e,fn:"balance",args:[oE.address(t)]}),[4,RE(r,{network:n})];case 1:if(o=p.sent(),Array.isArray(o))throw new Error("BLUX: could not read token metadata");return a=o.values,s=a[0],c=a[1],u=a[2],l=a[3],d=Number(u),f=t&&null!=l?String(l):"0",h={name:String(s),symbol:String(c),decimals:d,rawBalance:f,balance:f_(f,d)},[4,m_(e,n)];case 2:return[2,(h.adminOrOwner=p.sent(),h)]}})})},v_=function(e,t){return void 0===t&&(t="0"),{id:e.id,contractAddress:e.contract_address,network:"mainnet"===e.network?"mainnet":"testnet",name:e.name,symbol:e.symbol,decimals:e.decimals,balance:t}},y_=function(e){var t=e.tokens,n=oS(),r=L(null),i=r[0],o=r[1],a=Ae(function(e){return e.config.appearance}),s=Ae(function(e){return e.setRoute}),c=Ae(function(e){return e.setDetailsToken}),u=Ae(function(e){return e.setDynamicTitle});return D("div",{className:"bluxcc:flex bluxcc:h-full bluxcc:w-full bluxcc:flex-col",children:[D("div",{className:"bluxcc:flex-1 bluxcc:overflow-auto bluxcc:overflowStyle",children:[t.map(function(e,n){var r=p_(e.name,e.symbol),l=b_(e.name,e.symbol);return D("button",{id:"bluxcc-button",onClick:function(){return function(e){c(e),u(e.symbol),s(G.TOKEN_DETAILS)}(e)},onMouseEnter:function(){return o(n)},onMouseLeave:function(){return o(null)},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:py-2 bluxcc:px-4",style:{background:i===n?a.fieldBackground:"transparent",color:a.textColor,borderBottomStyle:"dashed",borderBottomWidth:n<t.length-1?a.borderWidth:"0px",borderBottomColor:a.borderColor,transition:"all 0.2s ease-in-out",fontFamily:a.fontFamily},children:[D("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[$("span",{className:"bluxcc:font-medium bluxcc:size-10 bluxcc:flex bluxcc:items-center bluxcc:justify-center",style:{borderRadius:a.borderRadius,background:a.fieldBackground,border:"".concat(a.borderWidth," solid ").concat(a.borderColor)},children:$(OS,{assetType:"credit",assetCode:l.code,assetIssuer:l.issuer,fallbackIcon:nS.QuestionMark,fill:zx(a.fieldBackground)})}),D("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:justify-start bluxcc:items-start",children:[D("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1.5 bluxcc:text-sm bluxcc:font-medium",children:[r,e.symbol&&e.symbol!==r&&$("span",{className:"bluxcc:rounded bluxcc:px-1 bluxcc:py-[1px] bluxcc:text-[10px] bluxcc:font-semibold",style:{background:Vx(a.textColor,.08),color:Vx(a.textColor,.7)},children:e.symbol})]}),$("span",{className:"bluxcc:font-semibold bluxcc:text-xs",style:{color:Vx(a.textColor,.7)},children:Qx(e.contractAddress,4)})]})]}),$("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:text-right",children:$("span",{className:"bluxcc:font-medium",children:Gx(e.balance)})})]},e.id||e.contractAddress)}),0===t.length&&D("div",{style:{color:Vx(a.textColor,.7)},className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:gap-2 bluxcc:text-center",children:[$(tS,{name:nS.GrayCube,props:{}}),n("no_tokens_found")]})]}),$("div",{className:"bluxcc:flex bluxcc:shrink-0 bluxcc:justify-center bluxcc:pt-3",children:D("button",{id:"bluxcc-button",onClick:function(){s(G.ADD_TOKEN)},className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2 bluxcc:h-11 bluxcc:px-6 bluxcc:text-sm bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",style:{color:a.accentColor,background:Vx(a.accentColor,.1),borderRadius:a.borderRadius,fontFamily:a.fontFamily},children:[$(tS,{name:nS.Plus,props:{fill:a.accentColor}}),n("add_new_token")]})})]})},w_=function(){var e,t=oS(),n=Ae(function(e){return e.config.appearance}),r=Ae(function(e){return e.balances}),i=r.loading,o=r.error,a=r.balances,s=Ae(function(e){return e.balanceValues}),c=Ae(function(e){var t;return null===(t=e.stellar)||void 0===t?void 0:t.activeNetwork}),u=Ae(function(e){return e.customTokens}),l=Ae(function(e){return e.balancesTab}),d=Ae(function(e){return e.setBalancesTab}),f=a.map(function(e){var t,n;return J(J({},Ux(e)),{valueInCurrency:null!==(t=s[a_(e)])&&void 0!==t?t:"0",title:(n=e,"native"===n.asset_type?"XLM":"credit_alphanum4"===n.asset_type||"credit_alphanum12"===n.asset_type?n.asset_code:"liquidity_pool_shares"===n.asset_type?"Liquidity Pool":""),subtitle:Tx(e)})}),h=null!==(e=u[d_(c)])&&void 0!==e?e:[],p=[{key:"assets",label:t("assets"),icon:nS.Assets},{key:"tokens",label:t("tokens"),icon:nS.Token}],b=function(){return D("div",{className:"bluxcc:w-full bluxcc:flex bluxcc:h-full bluxcc:justify-center bluxcc:items-center bluxcc:flex-col bluxcc:gap-2",children:[$(tS,{name:nS.GrayCube,props:{}}),$("p",{className:"bluxcc:font-medium",style:{color:Vx(n.textColor,.7)},children:t("no_balance_message")})]})},m=function(e){var t=e.text;return $("div",{className:"bluxcc:flex bluxcc:h-full bluxcc:items-center bluxcc:justify-center bluxcc:text-center",style:{color:Vx(n.textColor,.7),fontFamily:n.fontFamily},children:t})};return D("div",{style:{fontFamily:n.fontFamily},children:[$("div",{className:"bluxcc:flex bluxcc:gap-3 bluxcc:py-3",children:p.map(function(e){var t=l===e.key;return D("button",{role:"tab",id:"bluxcc-button","aria-label":e.label,"aria-selected":t,onClick:function(){return d(e.key)},className:"bluxcc:flex bluxcc:h-20 bluxcc:flex-1 bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:gap-2 bluxcc:py-4 bluxcc:text-sm bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",style:{background:t?Vx(n.accentColor,.1):n.background,color:t?n.accentColor:n.textColor,borderRadius:n.borderRadius},children:[$(tS,{name:e.icon,props:{fill:t?n.accentColor:n.textColor}}),$("span",{children:e.label})]},e.key)})}),$("div",{className:"bluxcc:h-[320px] bluxcc:py-1",role:"tabpanel",children:"assets"===l?i?$(m,{text:"".concat(t("loading"),"...")}):o?$(m,{text:t("errorTryAgain")}):a.length?$(o_,{assets:f}):$(b,{}):$(y_,{tokens:h})})]})},x_=B.memo(function(e){var t,n,r,i,o,a=e.tx,s=oS(),c=Ae(function(e){return e}),u=c.config.appearance,l=$x((null===(t=c.stellar)||void 0===t?void 0:t.activeNetwork)||"",c.config.explorer,"transactionUrl",a.hash);return D("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[D("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-start bluxcc:gap-3",children:[$("div",{className:"bluxcc:flex bluxcc:size-10 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",style:{background:u.background},children:function(e){switch(e){case"receive":return $(tS,{name:nS.Downstream});case"send":return $(tS,{name:nS.Upstream});default:return $(tS,{name:nS.MultiOperation})}}(a.action)}),D("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:justify-start",children:[$("p",{className:"bluxcc:text-start bluxcc:text-xs bluxcc:font-medium",style:{color:u.textColor},children:a.title}),$("p",{className:"bluxcc:text-sm bluxcc:font-medium",children:a.description})]})]}),D("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2 bluxcc:text-xs",style:{color:Vx(u.textColor,.7)},children:[(n=a.date,r=new Date(n),i=r.getUTCDate(),o=r.toLocaleString("en-US",{month:"short"}),"".concat(i," ").concat(o)),$("button",{id:"bluxcc-button",className:"bluxcc:flex bluxcc:size-8 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",title:s("viewTransactionDetails"),onClick:function(){l&&window.open(l,"_blank","noopener,noreferrer")},style:{background:u.fieldBackground},children:$("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:$(tS,{name:nS.Globe})})})]})]})}),A_=function(e,t){return"native"===e.asset_type?"XLM":e.asset_code||t},E_=function(){var e,t,n=oS(),r=Ae(function(e){return e}),i=Ae(function(e){return e.transactions}),o=i.loading,a=i.transactions,s=L([]),u=s[0],l=s[1],d=r.config.appearance,f=null===(e=r.user)||void 0===e?void 0:e.address,h=$x(null===(t=r.stellar)||void 0===t?void 0:t.activeNetwork,r.config.explorer,"accountUrl",f);M(function(){if(a){for(var e=[],t=0,r=a;t<r.length;t++){var i=r[t],o=i.operations[0],s={hash:i.hash,description:"",date:i.created_at,action:"other",title:tA(o.type)};if(i.operations.length>1)s.title=n("multiOperation"),s.action="multi";else if("payment"===o.type){var u=n("send");s.action="send",o.to.toLowerCase()===f.toLowerCase()&&(u=n("receive"),s.action="receive"),s.title=u,s.description="".concat(Gx(o.amount)," ").concat(A_(o,n("pool")))}else o.type!==c.HorizonApi.OperationResponseType.pathPaymentStrictSend&&o.type!==c.HorizonApi.OperationResponseType.pathPayment||(s.title=n("swap"),s.action="swap",s.description=n("receivedAsset",{asset:A_(o,n("pool"))}));e.push(s)}l(e)}},[a]);var p=!o&&0===u.length;return D("div",{className:"bluxcc:flex bluxcc:h-[355px] bluxcc:flex-col",children:[o?$("div",{style:{color:Vx(d.textColor,.7)},className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:n("loadingActivity")}):p?$("div",{style:{color:Vx(d.textColor,.7)},className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:n("noActivityFound")}):u.map(function(e,t){return $("div",{style:{borderBottomStyle:"dashed",borderBottomWidth:t<u.length-1?d.borderWidth:"0px",borderBottomColor:d.borderColor},className:"bluxcc:p-2",children:$(x_,{tx:e})},t)}),u.length>0&&h&&$("div",{className:"bluxcc:absolute bluxcc:bottom-4 bluxcc:left-1/2 bluxcc:!mt-4 bluxcc:w-[calc(100%-3rem)] bluxcc:-translate-x-1/2 bluxcc:transform",children:$(pS,{state:"enabled",variant:"outline",size:"medium",onClick:function(){h&&window.open(h,"_blank","noopener,noreferrer")},children:n("seeAllInExplorer")})})]})},S_=function(e){var t,n=e.operationsCount,r=e.sender,i=e.receiver,o=e.network,a=e.estimatedFee,s=e.action,c=oS(),u=Ae(function(e){return e.config.appearance}),l=Ae(function(e){return e}).setAlert,d=[{label:c("action"),value:jx(s)},{label:c("operations"),value:n.toString()},{label:c("sender"),value:Qx(r,5),isHighlighted:!0,isCopyable:!0,copyValue:r},{label:c("network"),value:(null===(t=Sx[o])||void 0===t?void 0:t.name)||o},{label:c("estimatedFee"),value:"".concat(a," XLM")}];return i&&d.splice(3,0,{label:c("to"),value:Qx(i,5),isHighlighted:!0,isCopyable:!0,copyValue:i}),$("div",{className:"bluxcc:w-full bluxcc:text-sm bluxcc:text-gray-800",style:{fontFamily:u.fontFamily},children:d.map(function(e,t){var n=e.label,r=e.value,i=e.isHighlighted,o=e.isCopyable,a=e.copyValue;return D("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:px-4 bluxcc:py-2",style:t===d.length-1?{}:{borderBottomColor:u.borderColor,borderBottomStyle:"dashed",borderBottomWidth:u.borderWidth},children:[$("span",{style:{color:u.textColor},children:n}),o?$("button",{id:"bluxcc-button",className:"bluxcc:bg-transparent",style:{color:i?u.accentColor:u.textColor},onClick:function(){return a&&(Fx(a),l("copy",c("address_copied")),void setTimeout(function(){l("none","")},1e3))},children:r}):$("span",{style:{color:i?u.accentColor:u.textColor},children:r})]},t)})})},__=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r,i;return ee(this,function(o){switch(o.label){case 0:if(!(t=e.sendTransaction))return e.setRoute(G.FAILED),[2];if(e.setRoute(G.WAITING),!e.user)return e.setRoute(G.FAILED),[2];if(!(n=xx(e.user,e.wallets)))return e.setRoute(G.FAILED),[2];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,bA(n,t.xdr,null===(i=e.user)||void 0===i?void 0:i.address,t.options.network,e.config.transports||{},t.shouldSubmit)];case 2:return r=o.sent(),e.setSendTransaction(J(J({},t),{result:r}),!0,G.WAITING),setTimeout(function(){e.setRoute(G.SUCCESSFUL)},400),[3,4];case 3:return o.sent(),setTimeout(function(){e.setRoute(G.FAILED)},200),[3,4];case 4:return[2]}})})},O_=function(){var e,t=oS(),n=Ae(function(e){return e}),r=n.config.appearance,i=n.user,o=n.stellar,a=n.sendTransaction;if(!a||!i||!o)return $("div",{children:$("p",{children:t("invalidXdr")})});var s=a.xdr,c=a.options,u=uA(s,c.network);if(!u)return $("div",{children:$("p",{children:t("invalidXdr")})});var l,d,f=0===n.balances.balances.length?"0":n.balances.balances.find(function(e){return"native"===e.asset_type}).balance,h=i.authValue===H.Lobstr,p=(l=o.activeNetwork,(d=Object.entries(Ax).find(function(e){return e[1]===l}))?d[0].toUpperCase():"MAINNET");return D("div",{className:"bluxcc:w-full",style:{fontFamily:r.fontFamily},children:[D("p",{className:"bluxcc:mx-3 bluxcc:my-4 bluxcc:text-center bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:[D("span",{className:"bluxcc:font-semibold bluxcc:capitalize",children:[n.config.appName," "]}),t("signTransactionPrompt")]}),$(S_,{operationsCount:u.operations,sender:u.sender,receiver:u.receiver,network:c.network,estimatedFee:u.estimatedFee.toString(),action:u.action}),h&&$("p",{className:"bluxcc:my-2! bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:text-xs! bluxcc:text-alert-error",children:t("lobstrWarning",{network:p})}),D("div",{className:"bluxcc:inline-flex bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:border bluxcc:px-4",style:{marginTop:h?"0px":"16px",borderRadius:r.borderRadius,borderColor:r.borderColor},children:[D("div",{className:"bluxcc:inline-flex bluxcc:items-center bluxcc:gap-1 bluxcc:font-medium bluxcc:whitespace-nowrap",children:[$("p",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:whitespace-nowrap",children:t("yourWallet")}),$("p",{className:"bluxcc:mt-0.5 bluxcc:text-xs",style:{color:"".concat(Vx(r.textColor,.8))},children:i.address?Qx(null===(e=n.user)||void 0===e?void 0:e.address,5):t("noAddressFound")})]}),$("div",{className:"bluxcc:overflow-hidden bluxcc:px-2.5 bluxcc:py-2",style:{borderRadius:r.borderRadius,backgroundColor:r.fieldBackground,color:r.textColor},children:D("p",{className:"bluxcc:max-w-22.5 bluxcc:text-xs bluxcc:font-normal",children:[f?Gx(f):"0"," XLM"]})})]}),$(cS,{}),$(pS,{size:"large",state:"enabled",variant:"fill",onClick:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return __(n),[2]})})},children:t("approve")})]})},N_=function(){var e,t,n,r,i,o=oS(),a=Ae(function(e){return e}),s=a.config.appearance,c=a.detailsAsset,u=a.balances.balances,l=a.balanceValues,d=(null===(e=a.stellar)||void 0===e?void 0:e.activeNetwork)||"";if(M(function(){return function(){a.setDynamicTitle("")}},[]),M(function(){c||a.setRoute(G.BALANCES)},[c]),!c)return null;var f,h,p,b="native"===c.assetType,m=u.find(function(e){return b?"native"===e.asset_type:e.asset_code===c.assetCode&&e.asset_issuer===c.assetIssuer}),g=null!==(t=null==m?void 0:m.balance)&&void 0!==t?t:c.assetBalance,v=null!==(r=null!==(n=l[(f=c.assetType,h=c.assetCode,p=c.assetIssuer,"native"===f?"native":"".concat(h,":").concat(p))])&&void 0!==n?n:c.valueInCurrency)&&void 0!==r?r:"0",y=Number(v)>0,w=Ex[d]||(null===(i=Sx[d])||void 0===i?void 0:i.name)||o("network"),x=m&&"selling_liabilities"in m?m.selling_liabilities:"0",A=m&&"buying_liabilities"in m?m.buying_liabilities:"0",E=m&&"limit"in m?m.limit:null,S=m&&"is_authorized"in m?m.is_authorized:null,_=b?null:$x(d,a.config.explorer,"accountUrl",c.assetIssuer),O={color:Vx(s.textColor,.7)},N=D("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1",style:{color:s.accentColor},children:[w,$(tS,{name:nS.StellarSmall,props:{fill:s.accentColor}})]}),k=D("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1",children:[_?$("a",{href:_,target:"_blank",rel:"noreferrer",className:"bluxcc:no-underline",style:{color:s.accentColor,fontFamily:s.fontFamily},children:Qx(c.assetIssuer,5)}):$("span",{style:{color:s.accentColor},children:Qx(c.assetIssuer,5)}),$("button",{id:"bluxcc-button",onClick:function(){Fx(c.assetIssuer).then(function(){a.setAlert("copy",o("address_copied")),setTimeout(function(){a.setAlert("none","")},1e3)}).catch(function(){})},className:"bluxcc:flex bluxcc:items-center bluxcc:bg-transparent",children:$(tS,{name:nS.Copy,props:{fill:s.accentColor}})})]}),T=[{label:o("network"),value:N,divider:!1}];return!b&&c.assetIssuer&&T.push({label:o("issuer"),value:k,divider:!1}),T.push({label:o("sellingLiabilities"),value:$("span",{style:O,children:Gx(x)}),divider:!0},{label:o("buyingLiabilities"),value:$("span",{style:O,children:Gx(A)}),divider:!0}),b||(T.push({label:o("limit"),value:$("span",{style:O,children:null==E?"—":"922337203685.4775807"===E?"∞":Gx(E,!0)}),divider:!0}),null!==S&&T.push({label:o("authorized"),value:$("span",{style:O,children:o(S?"yes":"no")}),divider:!0})),D("div",{children:[D("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-between bluxcc:gap-3 bluxcc:my-5 bluxcc:px-4",children:[$("div",{className:"bluxcc:size-14 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full bluxcc:border",style:{borderColor:s.borderColor,borderWidth:s.borderWidth},children:$(OS,{assetCode:c.assetCode,assetIssuer:c.assetIssuer,assetType:c.assetType,fill:zx(s.background)})}),D("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-end bluxcc:text-right",children:[$("span",{className:"bluxcc:text-3xl bluxcc:font-semibold bluxcc:leading-8",style:{color:s.accentColor},children:y?Yx(v):"".concat(Gx(g)," ").concat(c.assetCode)}),$("span",{className:"bluxcc:text-sm bluxcc:font-medium",style:O,children:y?"".concat(Gx(g)," ").concat(c.assetCode):b?"Stellar Lumens":c.assetIssuer?Qx(c.assetIssuer,4):c.assetCode})]})]}),$("div",{children:T.map(function(e){return D("div",{className:"bluxcc:flex bluxcc:font-medium bluxcc:items-center bluxcc:justify-between bluxcc:text-xs bluxcc:h-10 bluxcc:px-4",style:{color:s.textColor,fontFamily:s.fontFamily,borderTop:e.divider?"".concat(s.borderWidth," dashed ").concat(s.borderColor):"none"},children:[$("span",{children:e.label}),$("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1 bluxcc:text-xs",children:e.value})]},e.label)})})]})},k_=function(){var e,t,n,r,i,o,a=oS(),s=Ae(function(e){return e}),c=s.config.appearance,u=s.detailsToken,l=null===(e=s.auth)||void 0===e?void 0:e.JWT,d=null===(t=s.user)||void 0===t?void 0:t.address,f=(null===(n=s.stellar)||void 0===n?void 0:n.activeNetwork)||"",h=L(null),p=h[0],b=h[1],m=L(!1),g=m[0],v=m[1],y=L(""),w=y[0],x=y[1];if(M(function(){return function(){s.setDynamicTitle("")}},[]),M(function(){u||s.setRoute(G.BALANCES)},[u]),M(function(){if(u){var e=!1;return g_(u.contractAddress,d,f).then(function(t){e||b(t)}).catch(function(){}),function(){e=!0}}},[null==u?void 0:u.contractAddress,d,f]),!u)return null;var A=null!==(r=null==p?void 0:p.balance)&&void 0!==r?r:u.balance,E=null==p?void 0:p.adminOrOwner,S=null!==(i=null==p?void 0:p.decimals)&&void 0!==i?i:u.decimals,_={color:Vx(c.textColor,.7)},O=p_(u.name,u.symbol),N=b_(u.name,u.symbol),k=Ex[f]||(null===(o=Sx[f])||void 0===o?void 0:o.name)||a("network"),T=function(e){return D("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1",children:[$("span",{style:{color:c.accentColor},children:Qx(e,4)}),$("button",{id:"bluxcc-button",onClick:function(){return function(e){Fx(e).then(function(){s.setAlert("copy",a("address_copied")),setTimeout(function(){s.setAlert("none","")},1e3)}).catch(function(){})}(e)},className:"bluxcc:flex bluxcc:items-center bluxcc:bg-transparent",children:$(tS,{name:nS.Copy,props:{fill:c.accentColor}})})]})},C=[{label:a("network"),value:D("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1",style:{color:c.accentColor},children:[k,$(tS,{name:nS.StellarSmall,props:{fill:c.accentColor}})]}),divider:!1},{label:a("contract"),value:T(u.contractAddress),divider:!1},{label:a("symbol"),value:$("span",{style:_,children:u.symbol}),divider:!0},{label:a("decimals"),value:$("span",{style:_,children:S}),divider:!0}];E&&C.push({label:a("admin"),value:T(E),divider:!0});return D("div",{children:[D("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-between bluxcc:gap-3 bluxcc:my-5 bluxcc:px-4",children:[D("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[$("div",{className:"bluxcc:size-14 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full bluxcc:border",style:{borderColor:c.borderColor,borderWidth:c.borderWidth},children:$(OS,{assetType:"credit",assetCode:N.code,assetIssuer:N.issuer,fallbackIcon:nS.QuestionMark,fill:zx(c.background)})}),D("div",{className:"bluxcc:flex bluxcc:flex-col",children:[$("span",{className:"bluxcc:text-base bluxcc:font-semibold",children:O}),$("span",{className:"bluxcc:text-xs bluxcc:font-medium",style:_,children:u.symbol!==O?u.symbol:Qx(u.contractAddress,4)})]})]}),D("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-end bluxcc:text-right",children:[$("span",{className:"bluxcc:text-2xl bluxcc:font-semibold bluxcc:leading-7",style:{color:c.accentColor},children:Gx(A)}),$("span",{className:"bluxcc:text-xs bluxcc:font-medium",style:_,children:u.symbol})]})]}),$("div",{children:C.map(function(e){return D("div",{className:"bluxcc:flex bluxcc:font-medium bluxcc:items-center bluxcc:justify-between bluxcc:text-xs bluxcc:h-10 bluxcc:px-4",style:{color:c.textColor,fontFamily:c.fontFamily,borderTop:e.divider?"".concat(c.borderWidth," dashed ").concat(c.borderColor):"none"},children:[$("span",{children:e.label}),$("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1 bluxcc:text-xs",children:e.value})]},e.label)})}),D("div",{className:"bluxcc:mt-6 bluxcc:px-4",children:[w&&$("p",{className:"bluxcc:mb-2 bluxcc:text-center bluxcc:text-xs bluxcc:text-alert-error",children:w}),$("button",{id:"bluxcc-button",onClick:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:if(g)return[2];if(!l)return x(a("errorTryAgain")),[2];v(!0),x(""),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,We(l,u.id)];case 2:return e.sent(),s.removeCustomToken(u.network,u.id),s.setDetailsToken(void 0),s.setBalancesTab("tokens"),s.setRoute(G.BALANCES),[3,4];case 3:return e.sent(),v(!1),x(a("errorTryAgain")),[3,4];case 4:return[2]}})})},className:"bluxcc:flex bluxcc:h-[52px] bluxcc:w-full bluxcc:items-center bluxcc:justify-center bluxcc:text-base bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",style:{color:"var(--color-alert-error)",background:"color-mix(in srgb, var(--color-alert-error) 10%, transparent)",borderRadius:c.borderRadius,fontFamily:c.fontFamily,pointerEvents:g?"none":void 0},children:g?$(tS,{name:nS.Loading,className:"bluxcc:animate-spin",props:{fill:"var(--color-alert-error)"}}):a("delete_token")})]})]})},T_={purple:{id:"purple_gradient",colors:[[.992,.878,1],[.992,.878,1],[.592,.451,1],[.792,.663,1]]}},C_=function(e){var t,n=e.theme,r=void 0===n?"purple":n,i=e.className,o=void 0===i?"":i,a=e.children,s=e.animationSpeed,c=void 0===s?1:s,u=e.onClick,l=e.style,d=e.size,f=void 0===d?"100%":d,h=R(null),p=R(null);return M(function(){var e=h.current;if(e){var t=e.getContext("webgl");if(t){var n=e.getBoundingClientRect();e.width=n.width,e.height=n.height;var i=function(e,n){var r=t.createShader(n);return t.shaderSource(r,e),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS),r},o=t.createProgram(),a=i("\n attribute vec2 aPos;\n varying vec2 vUv;\n void main() {\n vUv = (aPos + 1.0) * 0.5;\n gl_Position = vec4(aPos, 0.0, 1.0);\n }\n ",t.VERTEX_SHADER),s=i("\n precision mediump float;\n uniform float uTime;\n uniform vec2 uResolution;\n uniform vec3 uColor1;\n uniform vec3 uColor2;\n uniform vec3 uColor3;\n uniform vec3 uColor4;\n varying vec2 vUv;\n\n float noise(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);\n }\n float smoothNoise(vec2 st) {\n vec2 i=floor(st),f=fract(st);\n float a=noise(i);\n float b=noise(i+vec2(1.,0.));\n float c=noise(i+vec2(0.,1.));\n float d=noise(i+vec2(1.,1.));\n vec2 u=f*f*(3.-2.*f);\n return mix(a,b,u.x)+(c-a)*u.y*(1.-u.x)+(d-b)*u.x*u.y;\n }\n float fbm(vec2 st){\n float v=0.,a=0.7;\n for(int i=0;i<2;i++){\n v+=a*smoothNoise(st);\n st*=1.8;a*=0.4;\n }\n return v;\n }\n\n void main(){\n vec2 st=vUv;\n float time=uTime*0.12;\n vec2 center=vec2(0.5);\n vec2 fromCenter=st-center;\n float rot=time*0.3;\n float c=cos(rot),s=sin(rot);\n vec2 rotated=vec2(\n fromCenter.x*c-fromCenter.y*s,\n fromCenter.x*s+fromCenter.y*c\n )+center;\n\n vec2 pos=st;\n pos+=vec2(\n fbm(rotated*1.2+time*0.4)*0.08,\n fbm(rotated*1.2+time*0.5+50.0)*0.08\n );\n\n float mixX=clamp(pos.x+fbm(rotated*1.0+time*0.6)*0.25,0.,1.);\n float mixY=clamp(pos.y+fbm(rotated*1.0+time*0.7)*0.25,0.,1.);\n\n vec3 topColors=mix(uColor1,uColor2,smoothstep(0.1,0.9,mixX));\n vec3 bottomColors=mix(uColor3,uColor4,smoothstep(0.1,0.9,mixX));\n vec3 finalColor=mix(topColors,bottomColors,smoothstep(0.1,0.9,mixY));\n\n gl_FragColor=vec4(finalColor,1.0);\n }\n ",t.FRAGMENT_SHADER);t.attachShader(o,a),t.attachShader(o,s),t.linkProgram(o),t.useProgram(o);var u=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW);var l=t.getAttribLocation(o,"aPos");t.enableVertexAttribArray(l),t.vertexAttribPointer(l,2,t.FLOAT,!1,0,0);var d=t.getUniformLocation(o,"uTime"),f=t.getUniformLocation(o,"uResolution"),b=t.getUniformLocation(o,"uColor1"),m=t.getUniformLocation(o,"uColor2"),g=t.getUniformLocation(o,"uColor3"),v=t.getUniformLocation(o,"uColor4"),y=T_[r].colors;t.uniform2f(f,n.width,n.height),t.uniform3fv(b,y[0]),t.uniform3fv(m,y[1]),t.uniform3fv(g,y[2]),t.uniform3fv(v,y[3]);var w=0,x=function(){p.current=requestAnimationFrame(x),w+=.015*c,t.uniform1f(d,w),t.viewport(0,0,e.width,e.height),t.drawArrays(t.TRIANGLE_STRIP,0,4)};return x(),function(){p.current&&cancelAnimationFrame(p.current),t.deleteProgram(o),t.deleteBuffer(u)}}}},[r,c]),D("div",{onClick:u,className:"bluxcc:relative bluxcc:overflow-hidden ".concat(o),style:l,"data-gradient-id":(null===(t=T_[r])||void 0===t?void 0:t.id)||"unknown_gradient",children:[$("canvas",{ref:h,className:"bluxcc:absolute bluxcc:inset-0 bluxcc:z-0",style:{width:f,height:f}}),a&&$("div",{className:"bluxcc:absolute bluxcc:inset-0 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:z-10",children:a})]})},I_=function(){var e=oS(),t=Ae(function(e){return e.config.appearance}),n=[nS.Shield,nS.Key,nS.Wallet,nS.Chip];return D("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:select-none bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:font-medium bluxcc:mt-4 bluxcc:mb-2",style:{color:t.textColor},children:[$(C_,{theme:"purple",animationSpeed:3,style:{borderRadius:t.borderRadius},className:"bluxcc:size-66 bluxcc:mx-6 bluxcc:overflow-hidden bluxcc:flex bluxcc:items-center",children:$("div",{className:"bluxcc:marquee_outer",children:$("div",{className:"bluxcc:marquee_track bluxcc:gap-2.5",children:te(te(te(te([],n,!0),n,!0),n,!0),n,!0).map(function(e,n){return $("div",{style:{borderRadius:"0px"!==t.borderRadius?"16px":"0px"},className:"bluxcc:size-20.5 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:bg-primary-500",children:$(tS,{name:e,props:{fill:"#fff"}})},n)})})})}),$("p",{className:"bluxcc:text-2xl bluxcc:mt-6.5 bluxcc:mb-2 bluxcc:px-6 ",children:e("wallet_infra")}),$("p",{className:"bluxcc:text-sm bluxcc:text-center",children:e("blux_gateway")})]})},B_={color:"var(--color-alert-success)",background:"color-mix(in srgb, var(--color-alert-success) 12%, transparent)"},L_={color:"var(--color-alert-warning)",background:"color-mix(in srgb, var(--color-alert-warning) 12%, transparent)"},M_=function(){var e=oS(),t=Ae(function(e){return e.config.appearance}),n=Ae(function(e){var t;return null===(t=e.auth)||void 0===t?void 0:t.JWT}),r=Ae(function(e){var t;return null===(t=e.user)||void 0===t?void 0:t.address}),o=Ae(function(e){var t;return null===(t=e.stellar)||void 0===t?void 0:t.activeNetwork}),a=Ae(function(e){return e.balances.balances}),s=Ae(function(e){return e.setRoute}),c=Ae(function(e){return e.setBalancesTab}),u=Ae(function(e){return e.addCustomToken}),l=L(""),d=l[0],f=l[1],h=L("idle"),p=h[0],b=h[1],m=L(""),g=m[0],v=m[1],y=L(null),w=y[0],x=y[1],A=L(!1),E=A[0],S=A[1],_=L(!1),O=_[0],N=_[1],k=L(""),T=k[0],C=k[1],I="valid"===p&&!!w&&!O&&!E,B=w?p_(w.name,w.symbol):"",M=w?b_(w.name,w.symbol):{code:"",issuer:""},R=function(e,n,r){return void 0===r&&(r=!0),D("div",{className:"bluxcc:flex bluxcc:h-10 bluxcc:items-center bluxcc:justify-between bluxcc:px-4 bluxcc:text-xs bluxcc:font-medium",style:{color:t.textColor,borderTop:r?"".concat(t.borderWidth," dashed ").concat(t.borderColor):"none"},children:[$("span",{children:e}),$("span",{style:{color:Vx(t.textColor,.7)},children:n})]})};return D("div",{className:"bluxcc:flex bluxcc:flex-col",style:{fontFamily:t.fontFamily},children:[$(LS,{autoFocus:!0,type:"text",value:d,onChange:function(e){f(e.target.value),b("idle"),x(null),v(""),C(""),S(!1)},onButtonClick:function(){return Q(void 0,void 0,void 0,function(){var t,n;return ee(this,function(s){switch(s.label){case 0:if(t=d.trim(),!i.isValidContract(t))return b("invalid"),x(null),S(!1),v(e("invalid_address")),[2];b("checking"),v(""),C(""),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,g_(t,r,o)];case 2:return n=s.sent(),x(n),S((c=n.name,!!(u=h_(c))&&a.some(function(e){return"native"===u.type?"native"===e.asset_type:"native"!==e.asset_type&&"asset_code"in e&&e.asset_code===u.code&&"asset_issuer"in e&&e.asset_issuer===u.issuer}))),b("valid"),[3,4];case 3:return s.sent(),x(null),S(!1),b("invalid"),v(e("could_not_validate_token")),[3,4];case 4:return[2]}var c,u})})},label:e("enter_token_address"),placeholder:e("enter_address"),error:"invalid"===p?g:void 0,button:$("span",{style:{color:t.accentColor},children:e("check")})}),D("div",{className:"bluxcc:min-h-[248px] bluxcc:py-2",children:["checking"===p&&$("div",{className:"bluxcc:flex bluxcc:h-[240px] bluxcc:items-center bluxcc:justify-center",children:$(tS,{name:nS.Loading,className:"bluxcc:animate-spin",props:{fill:t.accentColor}})}),"valid"===p&&w&&D("div",{style:{borderRadius:t.borderRadius,border:"".concat(t.borderWidth," solid ").concat(t.borderColor)},children:[D("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:gap-1 bluxcc:py-4",children:[$("div",{className:"bluxcc:size-14 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full bluxcc:border",style:{borderColor:t.borderColor,borderWidth:t.borderWidth},children:$(OS,{assetType:"credit",assetCode:M.code,assetIssuer:M.issuer,fallbackIcon:nS.QuestionMark,fill:zx(t.background)})}),D("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1.5",children:[$("span",{className:"bluxcc:text-lg bluxcc:font-semibold",style:{color:t.accentColor},children:B}),w.symbol&&w.symbol!==B&&D("span",{className:"bluxcc:text-sm",style:{color:Vx(t.textColor,.7)},children:["(",w.symbol,")"]})]})]}),R(e("status"),$("span",{className:"bluxcc:rounded-full bluxcc:px-2 bluxcc:py-[2px] bluxcc:text-[11px] bluxcc:font-semibold",style:E?L_:B_,children:e(E?"already_in_assets":"valid_token")}),!1),R(e("your_balance"),"".concat(Gx(w.balance)," ").concat(w.symbol)),w.adminOrOwner?R(e("admin"),Qx(w.adminOrOwner,4)):R(e("decimals"),String(w.decimals))]}),T&&$("p",{className:"bluxcc:mt-2 bluxcc:px-1 bluxcc:text-center bluxcc:text-xs bluxcc:text-alert-error",children:T})]}),$(cS,{}),D("div",{className:"bluxcc:flex bluxcc:gap-3",children:[$("div",{className:"bluxcc:flex-1",children:$(pS,{variant:"outline",size:"large",onClick:function(){s(G.BALANCES)},children:e("cancel")})}),$("div",{className:"bluxcc:flex-[1.6]",children:$(pS,{size:"large",variant:"fill",state:I?"enabled":"disabled",disabled:!I,onClick:function(){return Q(void 0,void 0,void 0,function(){var t,r,i,a;return ee(this,function(l){switch(l.label){case 0:if("valid"!==p||!w||O||E)return[2];if(!n)return C(e("errorTryAgain")),[2];N(!0),C(""),t=d_(o),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,$e(n,d.trim(),t)];case 2:return r=l.sent(),u(v_(r,w.balance)),c("tokens"),s(G.BALANCES),[3,4];case 3:return i=l.sent(),N(!1),a=String((null==i?void 0:i.message)||""),C(a.includes("already added")?e("token_already_added"):e("errorTryAgain")),[3,4];case 4:return[2]}})})},style:{opacity:I?1:.5},children:O?$(tS,{name:nS.Loading,className:"bluxcc:animate-spin",props:{fill:zx(t.accentColor)}}):e("add_token")})})]})]})},R_=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r,i;return ee(this,function(o){switch(o.label){case 0:if(!(t=e.signMessage))return e.setRoute(G.FAILED),[2];if(e.setRoute(G.WAITING),!e.user)return e.setRoute(G.FAILED),[2];if(!(n=xx(e.user,e.wallets)))return e.setRoute(G.FAILED),[2];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,cA(n,t.message,null===(i=e.user)||void 0===i?void 0:i.address)];case 2:return r=o.sent(),e.setSignMessage(J(J({},t),{result:r}),!0,G.WAITING),setTimeout(function(){e.setRoute(G.SUCCESSFUL)},400),[3,4];case 3:return o.sent(),setTimeout(function(){e.setRoute(G.FAILED)},200),[3,4];case 4:return[2]}})})},P_=function(e){return Q(void 0,void 0,void 0,function(){var t,n,r,i;return ee(this,function(o){switch(o.label){case 0:if(!(t=e.signAuthEntry))return e.setRoute(G.FAILED),[2];if(e.setRoute(G.WAITING),!e.user)return e.setRoute(G.FAILED),[2];if(!(n=xx(e.user,e.wallets)))return e.setRoute(G.FAILED),[2];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,xA(n,t.authEntry,null===(i=e.user)||void 0===i?void 0:i.address,t.options.network)];case 2:return r=o.sent(),e.setSignAuthEntry(J(J({},t),{result:r}),!0,G.WAITING),setTimeout(function(){e.setRoute(G.SUCCESSFUL)},400),[3,4];case 3:return o.sent(),setTimeout(function(){e.setRoute(G.FAILED)},200),[3,4];case 4:return[2]}})})},U_=function(){var e,t,n=oS(),r=Ae(function(e){return e}),i=r.config.appearance;if("signMessage"!==r.waitingStatus&&"signAuthEntry"!==r.waitingStatus)return r.setRoute(G.FAILED),null;var o="signMessage"===r.waitingStatus,a=o?r.signMessage:r.signAuthEntry;if(!a)return null;var s=o?a.message:a.authEntry;return D("div",{children:[D("div",{className:"bluxcc:p-4 bluxcc:text-center bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:[D("span",{className:"bluxcc:font-semibold bluxcc:capitalize",children:[r.config.appName," "]}),n("sign_permission")]}),$("div",{className:"bluxcc:h-24 bluxcc:p-4 bluxcc:font-mono bluxcc:text-xs bluxcc:overflow-auto",style:{border:"".concat(i.borderWidth," solid ").concat(i.borderColor),borderRadius:i.borderRadius},children:s}),D("div",{className:"bluxcc:inline-flex bluxcc:mt-4 bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:border bluxcc:px-4",style:{borderRadius:i.borderRadius,borderColor:i.borderColor},children:[$("div",{className:"bluxcc:inline-flex bluxcc:items-center bluxcc:gap-1 bluxcc:font-medium bluxcc:whitespace-nowrap",children:$("p",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:whitespace-nowrap",children:n("yourWallet")})}),$("div",{className:"bluxcc:overflow-hidden bluxcc:px-[10px] bluxcc:py-2",style:{borderRadius:i.borderRadius,backgroundColor:i.fieldBackground,color:i.textColor},children:$("p",{className:"bluxcc:mt-0.5 bluxcc:text-xs",style:{color:"".concat(Vx(i.textColor,.8))},children:(null===(e=r.user)||void 0===e?void 0:e.address)?Qx(null===(t=r.user)||void 0===t?void 0:t.address,5):n("noAddressFound")})})]}),$(cS,{}),$(pS,{size:"large",state:"enabled",variant:"fill",onClick:function(){return Q(void 0,void 0,void 0,function(){return ee(this,function(e){return o?R_(r):P_(r),[2]})})},children:n("approve")})]})},j_=function(){var e,t,n=oS(),r=Ae(function(e){return e}),i="login"===r.waitingStatus&&!!r.loginError;return D("div",i?{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[$("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:$(tS,{name:nS.RedExclamation,props:{}})}),D("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[$("p",{className:"bluxcc:text-xl",children:n("accessDeniedTitle")}),$("p",{className:"bluxcc:text-sm",children:r.loginError}),$("p",{className:"bluxcc:text-sm bluxcc:opacity-70",children:n("accessDeniedHelp")})]}),$(cS,{}),$(pS,{onClick:function(){r.setLoginError(void 0),r.setRoute(G.ONBOARDING)},state:"enabled",variant:"outline",children:n("back")})]}:{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[$("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:$(tS,{name:nS.RedExclamation,props:{}})}),D("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[$("p",{className:"bluxcc:text-xl",children:"login"===r.waitingStatus?n("loginFailed"):n("signingFailed",{walletName:null!==(t=null===(e=r.user)||void 0===e?void 0:e.authValue)&&void 0!==t?t:"wallet"})}),$("p",{className:"bluxcc:text-sm",children:"login"===r.waitingStatus?n("loginRetryMessage"):n("signingRetryMessage")})]}),$(cS,{}),$(pS,{onClick:function(){var e;"signMessage"===r.waitingStatus?R_(r):"signAuthEntry"===r.waitingStatus?P_(r):"sendTransaction"===r.waitingStatus?__(r):"login"===r.waitingStatus&&$S(r,wx[(null===(e=r.user)||void 0===e?void 0:e.authValue)||"Rabet"])},state:"enabled",variant:"outline",children:n("tryAgain")})]})},F_=function(){var e=oS(),t=Ae(function(e){return e}),n=t.config.appearance;M(function(){Q(void 0,void 0,void 0,function(){return ee(this,function(e){return $S(t,wx[H.WalletConnect]),[2]})})},[]);if(!t.walletConnect)return null;if(!t.walletConnect.connection||!t.walletConnect.client)return null;var r=t.walletConnect.connection.uri;return D("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:[D("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:size-52 bluxcc:items-center bluxcc:justify-center",style:{position:"relative",borderRadius:n.borderRadius,color:n.textColor,borderColor:n.borderColor,backgroundColor:n.fieldBackground,borderWidth:n.borderWidth},children:[$(n_,{size:184,value:r,bgColor:n.fieldBackground,fgColor:n.accentColor,level:"Q",imgSize:40}),$("div",{className:"bluxcc:z-20",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:n.background},children:$(tS,{name:nS.WalletConnect,props:{fill:n.accentColor,background:n.fieldBackground}})})]}),$("div",{className:"bluxcc:mt-4 bluxcc:font-medium",children:$("p",{className:"bluxcc:text-lg",children:"Scan this QR code with your phone"})}),$(cS,{}),$(pS,{size:"large",state:"enabled",variant:"tonal",style:{color:n.accentColor},onClick:function(){return function(n){Fx(n),t.setAlert("copy",e("address_copied")),setTimeout(function(){t.setAlert("none","")},1e3)}(r)},children:"Copy URI"})]})},D_=function(){var e,t,n=oS(),r=L(!1),i=r[0],o=r[1],a=L(""),s=a[0],c=a[1],u=Ae(function(e){return e}),l=L(null),d=l[0],f=l[1],h=u.config.appearance,p=u.balances.balances.filter(function(e){return"liquidity_pool_shares"!==e.asset_type}).filter(function(e){return"0.0000000"!==e.balance}).map(function(e){return"native"===e.asset_type?{assetIssuer:"",assetCode:"XLM",assetBalance:e.balance,assetType:e.asset_type}:{assetBalance:e.balance,assetCode:e.asset_code,assetType:e.asset_type,assetIssuer:e.asset_issuer}}),b=0!==(t=p).length?t:[re],m="swapTo"===u.selectAsset.field?se((null===(e=u.stellar)||void 0===e?void 0:e.activeNetwork)||"").filter(function(e){return!b.some(function(t){return t.assetCode===e.assetCode&&t.assetIssuer===e.assetIssuer})}):[],g=function(e){return e.assetCode.toLowerCase().includes(s.trim().toLowerCase())},v=b.filter(g),y=m.filter(g),w=function(){return i?h.accentColor:h.borderColor},x=function(e,t,n){return D("button",{id:"bluxcc-button",onClick:function(){!function(e){var t,n="sendAsset";"swapTo"===u.selectAsset.field?n="swapToAsset":"swapFrom"===u.selectAsset.field&&(n="swapFromAsset"),u.setSelectAsset(J(J({},u.selectAsset),((t={})[n]=e,t.userPicked=!0,t)));var r=Dx(u.selectAsset.field);u.setRoute(r)}(e)},onMouseEnter:function(){return f(t)},onMouseLeave:function(){return f(null)},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:px-4 bluxcc:py-3",style:{background:d===t?h.fieldBackground:"transparent",color:h.textColor,borderBottomStyle:"dashed",borderBottomWidth:n?"0px":h.borderWidth,borderBottomColor:h.borderColor,transition:"all 0.2s ease-in-out",fontFamily:h.fontFamily},children:[D("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[$("span",{className:"bluxcc:font-medium bluxcc:size-10 bluxcc:flex bluxcc:items-center bluxcc:justify-center",style:{borderRadius:h.borderRadius,background:h.fieldBackground,border:"".concat(h.borderWidth," solid ").concat(h.borderColor)},children:$(OS,{assetCode:e.assetCode,assetIssuer:e.assetIssuer,assetType:e.assetType,fill:zx(h.fieldBackground)})}),D("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-start",children:[$("span",{className:"bluxcc:text-sm bluxcc:font-medium",children:e.assetCode}),$("span",{className:"bluxcc:text-xs",style:{color:Vx(h.textColor,.7)},children:"native"===e.assetType?"native":Qx(e.assetIssuer,4)})]})]}),$("span",{className:"bluxcc:font-medium",children:Gx(e.assetBalance)})]},"".concat(e.assetCode,":").concat(e.assetIssuer))};return D("div",{className:"bluxcc:h-[360px] bluxcc:w-full",children:[$("div",{children:D("div",{onFocus:function(){return o(!0)},onBlur:function(){return o(!1)},onMouseEnter:function(e){i||(e.currentTarget.style.borderColor=h.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){i||(e.currentTarget.style.borderColor=h.borderColor)},className:"bluxcc:flex bluxcc:h-14 bluxcc:items-center bluxcc:gap-2 bluxcc:p-4",style:{background:h.fieldBackground,borderWidth:h.borderWidth,"--tw-ring-color":w(),borderRadius:h.borderRadius,borderColor:w(),color:h.textColor},children:[$(tS,{name:nS.Search,props:{fill:h.textColor}}),$("input",{autoFocus:!0,type:"text",id:"bluxcc-input",placeholder:n("search"),value:s,onChange:function(e){return c(e.target.value)},className:"bluxcc:bg-transparent bluxcc:outline-hidden bluxcc:text-base",style:{fontFamily:h.fontFamily,color:h.textColor}})]})}),D("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:mt-4 bluxcc:gap-2 bluxcc:overflow-y-auto bluxcc:overflowStyle bluxcc:max-h-[300px]",children:[v.map(function(e,t){return x(e,t,t===v.length-1)}),y.length>0&&D(z,{children:[$("div",{className:"bluxcc:px-4 bluxcc:pt-3 bluxcc:pb-1 bluxcc:text-left bluxcc:text-xs bluxcc:font-medium bluxcc:select-none",style:{color:Vx(h.textColor,.7)},children:n("popularAssets")}),y.map(function(e,t){return x(e,v.length+t,t===y.length-1)})]}),0===v.length&&0===y.length&&$("div",{style:{color:h.textColor},className:"bluxcc:mt-2 bluxcc:text-center",children:n("noAssetsFound")})]})]})},z_=function(){var e;oS();var t=Ae(function(e){return e}),n=t.config.appearance,r=null===(e=t.user)||void 0===e?void 0:e.address,i=t.balances.balances,o=t.setAlert,a=i.find(function(e){return"native"===e.asset_type});a&&a.balance;return D("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:[D("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:size-52 bluxcc:items-center bluxcc:justify-center",style:{position:"relative",borderRadius:n.borderRadius,color:n.textColor,borderColor:n.borderColor,backgroundColor:n.fieldBackground,borderWidth:n.borderWidth},children:[$(n_,{size:184,value:r,bgColor:n.fieldBackground,fgColor:n.accentColor,level:"Q"}),$("div",{className:"bluxcc:z-20",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:n.background},children:$(tS,{name:nS.SmallBlux,props:{fill:n.accentColor,background:n.fieldBackground}})})]}),$("p",{style:{color:n.textColor},className:"bluxcc:my-4",children:"Scan this QR code or copy your wallet address to receive payments"}),D("div",{className:"bluxcc:px-2.5 bluxcc:py-3 bluxcc:w-full",style:{color:n.textColor,borderColor:n.borderColor,borderWidth:n.borderWidth,borderRadius:n.borderRadius,backgroundColor:n.fieldBackground},children:[D("div",{className:"bluxcc:py-2 bluxcc:font-medium bluxcc:flex bluxcc:text-sm bluxcc:justify-between bluxcc:items-center",children:[$("span",{className:"",children:"Your Address"}),D("span",{className:"bluxcc:flex bluxcc:justify-center bluxcc:items-center bluxcc:gap-1 bluxcc:text-[15px]",style:{color:Vx(n.accentColor,.7)},onClick:function(){Fx(r).then(function(){Fx(r),o("copy","Address Copied"),setTimeout(function(){o("none","")},1e3)}).catch(function(){})},children:[r?Qx(r,5):"",$(tS,{name:nS.Copy,props:{fill:Vx(n.accentColor,.7)}})]})]}),$("div",{className:"bluxcc:my-2",style:{borderRadius:n.borderRadius,borderTop:"".concat(n.borderWidth," dashed ").concat(n.borderColor)}}),D("div",{className:"bluxcc:py-2 bluxcc:font-medium bluxcc:flex bluxcc:text-sm bluxcc:justify-between bluxcc:items-center",children:[$("span",{className:"",children:"Your Balance"}),D("span",{style:{color:Vx(n.textColor,.7)},children:[Gx(null==a?void 0:a.balance)," XLM"]})]})]})]})};function $_(){var e,t=oS(),n=Ae(function(e){return e}),r=n.config.appearance,i=null===(e=n.user)||void 0===e?void 0:e.address,o=i?"https://buy.moonpay.com?".concat(new URLSearchParams({currencyCode:"xlm",network:"stellar",walletAddress:i}).toString()):void 0,a=[{id:"moonpay",logoElement:$(AS,{}),title:"Moonpay",url:o,disabled:!o},{id:"crypto",logo:nS.Receive,title:t("receiveFunds"),route:G.FUND_ME_CRYPTO}];return $(z,{children:D("div",{className:"bluxcc:space-y-2",children:[D("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:w-full",children:[$("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:mb-2 bluxcc:size-17 bluxcc:rounded-full",style:{background:Vx(r.accentColor,.12)},children:$(mS,{fill:r.accentColor})}),$("div",{className:"bluxcc:mb-8 bluxcc:w-2/3 bluxcc:text-center",children:D("p",{className:"bluxcc:text-base bluxcc:font-medium",style:{color:Vx(r.textColor,.7)},children:["Choose how you’d like to fund your wallet."," "]})})]}),a.map(function(e){return $(dS,{endArrow:!0,label:e.title,startIcon:e.logo?$(tS,{name:e.logo,props:{fill:r.accentColor}}):$(AS,{}),onClick:function(){return function(e){e.disabled||(e.url?window.open(e.url,"_blank","noopener,noreferrer"):e.route&&n.openModal(e.route))}(e)}},e.id)})]})})}var W_=function(e){var t=e.label,n=e.icon,r=e.href;e.onClick;var i=Ae(function(e){return e}).config.appearance;return D("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"bluxcc:flex bluxcc:no-underline bluxcc:items-center bluxcc:justify-between bluxcc:w-full bluxcc:h-12 bluxcc:px-4 bluxcc:py-3 bluxcc:my-1 bluxcc:text-sm bluxcc:font-medium bluxcc:cursor-pointer",style:{color:i.textColor,fontFamily:i.fontFamily,borderColor:i.borderColor,borderWidth:i.borderWidth,borderRadius:i.borderRadius,backgroundColor:i.fieldBackground},children:[$("span",{children:t}),n]})},q_=function(){var e,t,n=oS(),r=Ae(function(e){return e}),i=r.config.appearance,o=null===(e=r.apiResponse)||void 0===e?void 0:e.terms,a=null===(t=r.apiResponse)||void 0===t?void 0:t.privacyPolicy,s=[];o&&s.push({label:n("termsOfService"),icon:$(bS,{}),href:o}),a&&s.push({label:n("privacyPolicy"),icon:$(bS,{}),href:a});return D("div",{className:"bluxcc:mt-1 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[$("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",style:{background:Vx(i.accentColor,.12)},children:$(mS,{fill:i.accentColor})}),$("div",{className:"bluxcc:mb-10 bluxcc:w-full bluxcc:text-center",children:$("p",{className:"bluxcc:text-base bluxcc:font-medium",style:{color:Vx(i.textColor,.7)},children:n("acceptTermsAndPrivacy")})}),s.map(function(e){return $(W_,J({},e),e.label)}),$(cS,{}),D("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:gap-2 bluxcc:w-full",children:[$(pS,{size:"large",variant:"fill",state:"enabled",onClick:function(){US()},children:n("agree")}),$("button",{style:{color:Vx(i.textColor,.9),fontFamily:i.fontFamily},id:"bluxcc-button",onClick:function(){jS()},className:"bluxcc:flex bluxcc:h-11 bluxcc:font-medium bluxcc:text-base bluxcc:w-full bluxcc:bg-transparent bluxcc:items-center bluxcc:justify-center",children:n("disagree")})]})]})},X_=function(e){return"__BLUX__PASSKEY_CRED__".concat(e)},K_={loading:{title:"passkeyWaitingTitle",content:"passkeyWaitingHelp"},failed:{title:"passkeyFailedTitle",content:"passkeyFailedHelp"},success:{title:"passkeySuccessTitle",content:"passkeySuccessHelp"}};function H_(){return Q(this,void 0,void 0,function(){return ee(this,function(e){if("undefined"==typeof window)throw new Error("BLUX: Passkeys require a browser environment.");if(!("credentials"in navigator))throw new Error("BLUX: WebAuthn is not supported in this browser.");if(!("PublicKeyCredential"in window))throw new Error("BLUX: Passkeys are not supported in this browser.");return[2]})})}function V_(e,t,n,r){return Q(this,void 0,void 0,function(){var i,o,a,s;return ee(this,function(c){switch(c.label){case 0:return[4,H_()];case 1:return c.sent(),i=kx(e),o=window.location.hostname,"login"===n&&r?[4,navigator.credentials.get({publicKey:{challenge:i,rpId:o,userVerification:"preferred",timeout:6e4,allowCredentials:[{id:kx(r),type:"public-key"}]}})]:[3,3];case 2:if(!((a=c.sent())instanceof PublicKeyCredential))throw new Error("BLUX: Passkey login was not completed.");return[2,{step:"login",credential:a}];case 3:return[4,navigator.credentials.create({publicKey:{challenge:i,rp:{name:"BLUX",id:o},user:{id:(new TextEncoder).encode(t),name:"Blux User",displayName:"Blux User"},pubKeyCredParams:[{type:"public-key",alg:-7}],authenticatorSelection:{residentKey:"required",userVerification:"preferred"},timeout:6e4,attestation:"none"}})];case 4:if(!((s=c.sent())instanceof PublicKeyCredential))throw new Error("BLUX: Passkey registration was not completed.");return[2,{step:"register",credential:s}]}})})}var G_=function(){var e=oS(),t=Ae(function(e){return e}),n=t.config.appearance,r=L("loading"),i=r[0],o=r[1],a=function(){return Q(void 0,void 0,void 0,function(){var e,n,r,i,a,c,u;return ee(this,function(l){switch(l.label){case 0:return l.trys.push([0,5,,6]),e=t.config.appId,n=function(e){if("undefined"==typeof window||!e)return null;try{return localStorage.getItem(X_(e))||null}catch(e){return null}}(e),r=n?"login":"register",i=null!=n?n:function(){try{if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return"blux-pk-".concat(crypto.randomUUID())}catch(e){}var e=new Uint8Array(16);if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues)crypto.getRandomValues(e);else for(var t=0;t<e.length;t++)e[t]=Math.floor(256*Math.random());var n=Array.from(e).map(function(e){return e.toString(16).padStart(2,"0")}).join("");return"blux-pk-".concat(n)}(),[4,Ie(e,i)];case 1:return[4,V_((a=l.sent()).challenge,String(a.user_id),r,null!=n?n:void 0)];case 2:return c=l.sent(),[4,Be(e,a,c)];case 3:return u=l.sent(),function(e,t){if("undefined"!=typeof window&&e&&t)try{localStorage.setItem(X_(e),t)}catch(e){}}(e,c.credential.id),o("success"),[4,s(u)];case 4:return l.sent(),[3,6];case 5:return l.sent(),o("failed"),[3,6];case 6:return[2]}})})},s=function(e){return Q(void 0,void 0,void 0,function(){var n,r;return ee(this,function(i){switch(i.label){case 0:return t.setAuth({isAuthenticated:!1,JWT:e}),[4,Ue(e)];case 1:return n=i.sent(),ye(function(e){return J(J({},e),{user:{address:n.public_key,walletPassphrase:"",authMethod:n.auth_method||"passkey",authValue:n.auth_value}})}),t.connectWalletSuccessful(n.public_key,(null===(r=t.stellar)||void 0===r?void 0:r.activeNetwork)||""),setTimeout(function(){ve().modal.isOpen&&(t.setRoute(G.SUCCESSFUL),setTimeout(function(){ve().modal.isOpen&&FS()},1e3))}),[2]}})})};M(function(){a()},[]);return D("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[$("div","success"===i?{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",style:{background:Vx(n.accentColor,.1)},children:$(tS,{name:nS.GreenCheck,props:{fill:n.accentColor}})}:"failed"===i?{className:"bluxcc:mb-6 bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:$(tS,{name:nS.RedExclamation,props:{}})}:{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",style:{background:Vx(n.accentColor,.1),color:n.accentColor},children:$(ES,{})}),D("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[$("p",{className:"bluxcc:text-xl",children:e(K_[i].title)}),$("p",{className:"bluxcc:text-sm bluxcc:leading-5",children:e(K_[i].content)})]}),$(cS,{}),"loading"===i&&$(pS,{state:"disabled",variant:"outline",startIcon:$(tS,{className:"bluxcc:animate-spin",name:nS.Loading,props:{fill:n.accentColor}}),children:e("passkeyVerifying")}),"success"===i&&$(pS,{state:"disabled",variant:"outline",children:e("loggingIn")}),"failed"===i&&$(pS,{onClick:function(){o("loading"),a()},state:"enabled",variant:"outline",children:e("tryAgain")})]})},Y_="#D92D20",J_=function(){var e,t=oS(),n=Ae(function(e){return e}),r=L("loading"),i=r[0],o=r[1],a=L(""),s=a[0],c=a[1],u=L(!1),l=u[0],d=u[1],f=R(!1),h=n.config.appearance,p=(null===(e=n.user)||void 0===e?void 0:e.authMethod)||"",b=XS[p],m=(null==b?void 0:b.displayName)||jx(p||"social"),g=function(e){return Q(void 0,void 0,void 0,function(){var r,i,a,s,u,l,h;return ee(this,function(b){switch(b.label){case 0:if(f.current)return[2];f.current=!0,o("loading"),c(""),d(!1),b.label=1;case 1:return b.trys.push([1,4,5,6]),(r=null!=e?e:YS)&&r.provider===p||(r=QS(p,n.config.appId)),[4,e_(r)];case 2:return i=b.sent(),n.setAuth({isAuthenticated:!1,JWT:i}),[4,Ue(i)];case 3:return a=b.sent(),ye(function(e){return J(J({},e),{user:{address:a.public_key,walletPassphrase:"",authMethod:p,authValue:a.auth_value}})}),n.connectWalletSuccessful(a.public_key,(null===(h=n.stellar)||void 0===h?void 0:h.activeNetwork)||""),o("success"),setTimeout(function(){ve().modal.isOpen&&FS()},1200),[3,6];case 4:return s=b.sent(),JS(),u=((null==s?void 0:s.message)||"").replace(/^BLUX:\s*/,""),l=Se(s)||function(e){return/not allowed to access/i.test(e)}(u),o("failed"),d(l),c(u||t("loginRetryMessage")),[3,6];case 5:return f.current=!1,[7];case 6:return[2]}})})};M(function(){return g(),function(){JS()}},[]);var v=function(){JS(),n.setRoute(G.ONBOARDING)},y="success"===i?"#12B76A":"failed"===i?Y_:h.borderColor;return D("div",{className:"bluxcc:mt-3 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[$("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full bluxcc:transition-colors bluxcc:duration-300",style:{borderColor:y,borderWidth:h.borderWidth,borderStyle:"solid"},children:$(tS,b?{name:b.icon}:{name:nS.Globe,props:{fill:h.textColor}})}),D("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[D("p",{className:"bluxcc:text-xl",style:{color:h.textColor},children:["loading"===i&&t("waitingFor",{walletName:m}),"success"===i&&t("connectionSuccessfulTitle"),"failed"===i&&t(l?"accessDeniedTitle":"loginFailed")]}),D("p",{className:"bluxcc:min-h-10 bluxcc:text-sm",style:{color:"failed"===i?Y_:h.textColor},children:["loading"===i&&t("socialPopupHelp",{provider:m}),"success"===i&&t("connectionSuccessfulMessage"),"failed"===i&&(s||t("loginRetryMessage"))]}),"failed"===i&&l&&$("p",{className:"bluxcc:text-sm bluxcc:opacity-70",style:{color:h.textColor},children:t("accessDeniedHelp")})]}),$(cS,{}),"loading"===i&&$(pS,{state:"disabled",variant:"outline",startIcon:$(tS,{className:"bluxcc:animate-spin",name:nS.Loading,props:{fill:h.accentColor}}),children:t("connecting")}),"success"===i&&$(pS,{state:"disabled",variant:"outline",children:t("loggingIn")}),"failed"===i&&(l?$(pS,{state:"enabled",variant:"fill",onClick:v,children:t("back")}):D("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:gap-2",children:[$(pS,{state:"enabled",variant:"fill",onClick:function(){g(QS(p,n.config.appId))},children:t("tryAgain")}),$(pS,{size:"medium",state:"enabled",variant:"text",onClick:v,style:{color:h.accentColor},children:t("back")})]}))]})},Z_=function(){var e,t=Ae(function(e){var t;return null===(t=e.auth)||void 0===t?void 0:t.JWT}),n=Ae(function(e){var t;return null===(t=e.user)||void 0===t?void 0:t.address}),r=Ae(function(e){var t;return(null===(t=e.stellar)||void 0===t?void 0:t.activeNetwork)||""}),i=Ae(function(e){return e.customTokens}),o=Ae(function(e){return e.setCustomTokens}),a=Ae(function(e){return e.setCustomTokenBalances}),s=R("");M(function(){if(t){if(s.current!==t){s.current=t;var e=!1;return function(e){return Q(void 0,void 0,void 0,function(){var t,n,r,i,o;return ee(this,function(a){switch(a.label){case 0:return[4,Ix("".concat(Te,"/tokens"),{method:"GET",headers:ze(e)})];case 1:if(401===(t=a.sent()).status)throw new Error("BLUX: invalid JWT");if(500===t.status)throw new Error("BLUX: server error");if(200===t.status)return[2,{mainnet:null!==(r=null===(n=t.result)||void 0===n?void 0:n.mainnet)&&void 0!==r?r:[],testnet:null!==(o=null===(i=t.result)||void 0===i?void 0:i.testnet)&&void 0!==o?o:[]}];throw new Error("BLUX: Unexpected response from api")}})})}(t).then(function(t){e||o({mainnet:t.mainnet.map(function(e){return v_(e)}),testnet:t.testnet.map(function(e){return v_(e)})})}).catch(function(){}),function(){e=!0}}}else s.current=""},[t,o]);var c=d_(r),u=null!==(e=i[c])&&void 0!==e?e:[],l=u.map(function(e){return e.id}).join(",");M(function(){if(u.length&&n){var e=!1;return Q(void 0,void 0,void 0,function(){var t;return ee(this,function(i){switch(i.label){case 0:return t={},[4,Promise.all(u.map(function(e){return Q(void 0,void 0,void 0,function(){var i,o;return ee(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),i=t,o=e.id,[4,(s=e.contractAddress,c=n,u=e.decimals,l=r,Q(void 0,void 0,void 0,function(){var e;return ee(this,function(t){switch(t.label){case 0:return[4,RE([{address:s,fn:"balance",args:[oE.address(c)]}],{network:l})];case 1:return e=t.sent(),Array.isArray(e)||null==e.values[0]?[2,"0"]:[2,f_(String(e.values[0]),u)]}})}))];case 1:return i[o]=a.sent(),[3,3];case 2:return a.sent(),[3,3];case 3:return[2]}var s,c,u,l})})}))];case 1:return i.sent(),!e&&Object.keys(t).length&&a(c,t),[2]}})}),function(){e=!0}}},[c,l,n,r,a])},Q_=function(){var t,n=Ae(function(e){return e}),r=function(){var e,t,n=Ae(function(e){return e}),r=L({error:null,loading:!0,balances:[]}),i=r[0],o=r[1],a=null===(e=n.user)||void 0===e?void 0:e.address;return M(function(){o({error:null,loading:!0,balances:[]}),pE({address:a}).then(function(e){o({error:null,loading:!1,balances:e})}).catch(function(e){o({error:e,loading:!1,balances:[]})})},[a,null===(t=n.stellar)||void 0===t?void 0:t.servers]),i}(),i=function(){var e,t,n=Ae(function(e){return e}),r=L({error:null,loading:!0,transactions:[]}),i=r[0],o=r[1],a=null===(e=n.user)||void 0===e?void 0:e.address;return M(function(){o({error:null,loading:!0,transactions:[]}),ME({limit:5,order:"desc",forAccount:a}).then(function(e){for(var t=e.response,n=[],r=0,i=t.records;r<i.length;r++){var a=i[r];n.push(a.operations())}Promise.all(n).then(function(e){var n=t.records.map(function(t,n){return J(J({},t),{operations:e[n].records})});o({error:null,loading:!1,transactions:n})})}).catch(function(e){o({error:e,loading:!1,transactions:[]})})},[a,null===(t=n.stellar)||void 0===t?void 0:t.servers]),i}(),a=(null===(t=n.stellar)||void 0===t?void 0:t.activeNetwork)||"",s=R(""),c=function(){n.setBalances(r),n.setTransactions(i),u()},u=function(){var e=r.balances,t=e.find(function(e){return"native"===e.asset_type});if(n.modal.route!==G.SEND&&n.modal.route!==G.SWAP&&n.modal.route!==G.SELECT_ASSET&&0!==e.length&&t){var i=Ux(t);e.length>1&&(i=Ux(e[1])),n.setSelectAsset(J(J({},n.selectAsset),{swapToAsset:i,sendAsset:Ux(t),swapFromAsset:Ux(t)}))}};M(function(){c();var e=setInterval(function(){c()},1e4);return function(){clearInterval(e)}},[r,i,n.modal.route]),M(function(){if(!r.loading&&!r.error){var t=r.balances,i=a+"|"+t.map(function(e){return"".concat(a_(e),"@").concat(e.balance)}).join(",");if(i!==s.current){if(s.current=i,t.length){var c=!1;return function(t,n){return Q(void 0,void 0,void 0,function(){var r,i,a,s,c,u;return ee(this,function(l){switch(l.label){case 0:if(r={},n!==e.PUBLIC){for(i=0,a=t;i<a.length;i++)s=a[i],r[a_(s)]="0";return[2,r]}return c=new o("USDC",ie.assetIssuer),[4,u_(o.native(),c,n)];case 1:return u=l.sent(),[4,Promise.all(t.map(function(e){return Q(void 0,void 0,void 0,function(){var t,i,o;return ee(this,function(a){switch(a.label){case 0:t=a_(e),a.label=1;case 1:return a.trys.push([1,3,,4]),i=r,o=t,[4,l_(e,c,u,n)];case 2:return i[o]=a.sent(),[3,4];case 3:return a.sent(),r[t]="0",[3,4];case 4:return[2]}})})}))];case 2:return l.sent(),[2,r]}})})}(t,a).then(function(e){c||n.setBalanceValues(e)}).catch(function(){}),function(){c=!0}}n.setBalanceValues({})}}},[r,a])},eO=function(e){var t,n,r,i=e.isBodyMount,o=e.mountElement;Q_(),Z_();var s=Ae(function(e){return e});!function(e){var t,n,r=L(!1),i=r[0],o=r[1];M(function(){var t=setInterval(function(){var t;e.authState.isAuthenticated&&(null===(t=e.user)||void 0===t?void 0:t.authValue)&&"wallet"===e.user.authMethod?Hx(wx[e.user.authValue]).then(function(t){var n;t&&e.config.networks.includes(t)&&(null===(n=e.stellar)||void 0===n?void 0:n.activeNetwork)!==t&&!e.networkSyncDisabled?uE(t):t&&!e.config.networks.includes(t)?(e.setNetworkSyncDisabled(!1),o(!0)):o(!1)}).catch(function(){o(!1)}):o(!1)},1e3);return function(){clearInterval(t),o(!1)}},[e.authState.isAuthenticated,e.config.networks,null===(t=e.user)||void 0===t?void 0:t.authValue,null===(n=e.stellar)||void 0===n?void 0:n.activeNetwork]),M(function(){e.modal.isOpen?i||e.modal.route!==G.WRONG_NETWORK||e.closeModal():setTimeout(function(){i&&e.config.promptOnWrongNetwork?e.openModal(G.WRONG_NETWORK):e.closeModal()},300)},[i,e.modal.isOpen])}(s);var u=s.modal,l=s.closeModal,d=s.setShowAllWallets,f=u.route,h=function(){var e;return(e={})[G.ONBOARDING]={title:"logInOrSignUp",Component:$(t_,{})},e[G.PROFILE]={title:"profile",Component:$(fS,{})},e[G.WAITING]={title:"",Component:$(_S,{})},e[G.SUCCESSFUL]={title:"",Component:$(zS,{})},e[G.FAILED]={title:"",Component:$(j_,{})},e[G.SEND_TRANSACTION]={title:"confirmation",Component:$(O_,{})},e[G.SEND]={title:"send",Component:$(MS,{})},e[G.ACTIVITY]={title:"activity",Component:$(E_,{})},e[G.RECEIVE]={title:"receive",Component:$(r_,{})},e[G.SWAP]={title:"swap",Component:$(IS,{})},e[G.BALANCES]={title:"balances",Component:$(w_,{})},e[G.BALANCE_DETAILS]={title:"",Component:$(N_,{})},e[G.TOKEN_DETAILS]={title:"token_details",Component:$(k_,{})},e[G.OTP]={title:"",Component:$(DS,{})},e[G.PASSKEY_ONBOARDING]={title:"",Component:$(G_,{})},e[G.SOCIALS_ONBOARDING]={title:"",Component:$(J_,{})},e[G.WRONG_NETWORK]={title:"",Component:$(i_,{})},e[G.ABOUT]={title:"whatIsBlux",Component:$(I_,{})},e[G.ADD_TOKEN]={title:"new_token",Component:$(M_,{})},e[G.SIGN_MESSAGE]={title:"signMessage",Component:$(U_,{})},e[G.SELECT_ASSET]={title:"selectAsset",Component:$(D_,{})},e[G.WALLET_CONNECT]={title:"walletConnect",Component:$(F_,{})},e[G.FUND_ME]={title:"addFunds",Component:$($_,{})},e[G.FUND_ME_CRYPTO]={title:"receiveFunds",Component:$(z_,{})},e[G.ACCEPT_TERMS_AND_PRIVACY]={title:"termsAndConditions",Component:$(q_,{})},e}()[f],p=f===G.WRONG_NETWORK,b=f===G.WAITING,m=f===G.SUCCESSFUL,g=f===G.SIGN_MESSAGE||f===G.SEND_TRANSACTION||f===G.FAILED,v=f===G.WRONG_NETWORK||b||m,y=b&&"sendTransaction"!==s.waitingStatus||f===G.ONBOARDING&&s.showAllWallets||[G.ACTIVITY,G.SEND,G.OTP,G.BALANCES,G.RECEIVE,G.SWAP,G.BALANCE_DETAILS,G.TOKEN_DETAILS,G.ABOUT,G.ADD_TOKEN,G.WALLET_CONNECT,G.FUND_ME_CRYPTO].includes(f)?"back":f===G.ONBOARDING?"info":void 0,w=s.modal.dynamicTitle||h.title,x=function(){if(!p)if(d(!1),"login"!==s.waitingStatus||s.authState.isAuthenticated||!s.login){l();var e=s.waitingStatus;PS();var t="signMessage"===e?s.signMessage:"signAuthEntry"===e?s.signAuthEntry:"sendTransaction"===e?s.sendTransaction:void 0;if("login"!==e&&t){var n=t.resolver,r=t.rejecter,i=t.result;m&&n&&i?(n(i),setTimeout(function(){s.cleanUp(e)},200)):g&&r&&(r("BLUX: User rejected the transaction"),setTimeout(function(){s.cleanUp(e)},200))}}else jS("BLUX: Login cancelled.")};return M(function(){s.authState.isAuthenticated||(s.signMessage&&(s.cleanUp("signMessage"),s.signMessage.rejecter("BLUX: User logged out during the process.")),s.signAuthEntry&&(s.cleanUp("signAuthEntry"),s.signAuthEntry.rejecter("BLUX: User logged out during the process.")),s.sendTransaction&&(s.cleanUp("sendTransaction"),s.sendTransaction.rejecter("BLUX: User logged out during the process.")))},[s.authState]),M(function(){var e,t,n,r=Xx((null===(e=s.stellar)||void 0===e?void 0:e.activeNetwork)||"",null!==(t=s.config.transports)&&void 0!==t?t:{}),i=r.horizon,o=r.soroban;s.setStellar({activeNetwork:(null===(n=s.stellar)||void 0===n?void 0:n.activeNetwork)||"",servers:{horizon:new c.Server(i),soroban:new a.Server(o)}})},[s.config.transports,s.config.networks,null===(t=s.stellar)||void 0===t?void 0:t.activeNetwork]),D(eS,{isOpen:u.isOpen,isSticky:p||s.config.isPersistent,onClose:x,isPersistent:null!==(n=s.config.isPersistent)&&void 0!==n&&n,appearance:s.config.appearance,isBodyMount:i,mountElement:o,children:[$(sS,{icon:y,onBack:function(){if(f===G.WAITING||f===G.OTP&&!s.authState.isAuthenticated||f===G.ABOUT||f===G.WALLET_CONNECT)s.setRoute(G.ONBOARDING);else if(s.showAllWallets)d(!1);else if([G.SEND,G.ACTIVITY,G.BALANCES,G.RECEIVE,G.SWAP].includes(f))s.setRoute(G.PROFILE);else if([G.BALANCE_DETAILS,G.TOKEN_DETAILS,G.ADD_TOKEN].includes(f))s.setRoute(G.BALANCES);else if(f!==G.FUND_ME_CRYPTO){if(f===G.SELECT_ASSET){var e=Dx(s.selectAsset.field);s.setRoute(e)}}else s.setRoute(G.FUND_ME)},onInfo:function(){s.setRoute(G.ABOUT)},onClose:x,title:w,closeButton:!v,isPersistent:null!==(r=s.config.isPersistent)&&void 0!==r&&r}),h.Component]})},tO=!1,nO=null,rO=null,iO=function(e){void 0===e&&(e=document.body),tO&&nO&&rO&&rO.contains(nO)&&rO.removeChild(nO),rO=e,nO=document.createElement("div"),e.appendChild(nO),F(nO).render(j(eO,{isBodyMount:e===document.body,mountElement:e===document.body?void 0:e}))};function oO(e,t){var n,r;if(tO=!0,!e||0===Object.keys(e).length)throw new Error("BLUX: createConfig must take a config object");if(!e.appId)throw new Error("BLUX: createConfig config object must have the appId property.");if(!e.appName)throw new Error("BLUX: createConfig config object must have the appName property.");if(!e.networks)throw new Error("BLUX: createConfig config object must have the networks property.");var i=["en","es","pt","fr","de","ru","zh","ja","ko","tr"],o=(e.lang||"en").trim().toLowerCase();i.includes(o)||(console.warn("BLUX: '".concat(e.lang,"' is not a supported language (").concat(i.join(", "),"). Falling back to English.")),o="en"),e.isPersistent&&console.warn("BLUX: isPersistent: true is only for testing purposes. Know what you are doing. For a better experience with Blux, remove isPersistent: true."),iO(t);var s=e.excludeWallets||["lobstr"];s=s.map(function(e){return e.toLowerCase().replace(/\s+/g,"")});var u=function(e){if(!e)return[];if(!Array.isArray(e))throw new Error("BLUX: config.orderWallets must be an array of wallet names.");for(var t=new Set(Object.values(H).map(function(e){return Kx(e)})),n=[],r=0,i=e;r<i.length;r++){var o=i[r],a=Kx(String(o));t.has(a)?n.includes(a)||n.push(a):console.warn("BLUX: unknown wallet '".concat(o,"' in config.orderWallets."))}return n}(e.orderWallets),l=!1;void 0!==e.promptOnWrongNetwork&&(l=e.promptOnWrongNetwork);var d=J(J(J({},e),{excludeWallets:s,orderWallets:u,appearance:J(J({},ce),null==e?void 0:e.appearance),defaultNetwork:"",promptOnWrongNetwork:l,lang:o,explorer:e.explorer||"stellarchain",loginMethods:e.loginMethods||["wallet"],showWalletUIs:void 0===e.showWalletUIs||e.showWalletUIs}),(null==e?void 0:e.walletConnect)?{walletConnect:e.walletConnect}:{});!function(e,t,n){if(!e||0===e.length)throw new Error("BLUX: No network is set in config.networks.");var r=null!=t?t:e[0];if(!e.includes(r))throw new Error("BLUX: config.defaultNetwork is not listed in config.networks.");for(var i=0,o=e;i<o.length;i++){var a=o[i];if(!(Sx[a]||n&&n[a]))throw new Error("BLUX: Must set transports for custom network ".concat(a))}}(e.networks,e.defaultNetwork,e.transports),d.defaultNetwork=null!==(n=e.defaultNetwork)&&void 0!==n?n:e.networks[0];var f=Xx(d.defaultNetwork,null!==(r=e.transports)&&void 0!==r?r:{}),h=f.horizon,p=f.soroban,b=ve(),m=b.setConfig,g=b.setWallets,v=b.setIsReady,y=b.setStellar,w=b.setApiResponse;y({activeNetwork:d.defaultNetwork,servers:{horizon:new c.Server(h),soroban:new a.Server(p)}}),m(d);var x,A,E,S=(d.loginMethods||[]).some(function(e){return"wallet"===String(e).toLowerCase().trim()});S||v(!0),function(e,t){return void 0===t&&(t=[]),new Promise(function(n){"complete"===document.readyState?Zx(e,t).then(function(e){n(e)}):window.addEventListener("load",function(){Zx(e,t).then(function(e){n(e)})})})}(s,u).then(function(e){var t=e.filter(function(e){return!s.includes(e.name.toLowerCase().replace(/\s+/g,""))});g(t),S&&v(!0)}),e.walletConnect&&(x=e.walletConnect,A=e.appName,Q(void 0,void 0,void 0,function(){var e,t,n,r;return ee(this,function(i){switch(i.label){case 0:if(WS)return[2];WS=!0,i.label=1;case 1:return i.trys.push([1,4,,5]),e=ve(),t=new W({projectId:x.projectId}),[4,q.init({core:t,metadata:{name:A,url:x.url,icons:x.icons,description:x.description}})];case 2:return n=i.sent(),e.setWalletConnectClient(n,null),[4,qS(n)];case 3:return r=i.sent(),e.setWalletConnectClient(n,r),[3,5];case 4:return i.sent(),[3,5];case 5:return[2]}})})),e.trezor&&function(e,t){cx||(cx=ex.init({manifest:{appName:t,appUrl:e.appUrl||window.location.origin,email:e.email},lazyLoad:!0}).catch(function(){cx=null}))}(e.trezor,e.appName),(E=e.appId,Q(void 0,void 0,void 0,function(){var e,t,n,r;return ee(this,function(i){switch(i.label){case 0:if(!E)throw new Error("BLUX: appId is missing in config.");i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Ix("".concat(Te,"/auth/validate"),{method:"POST",headers:(t={},t[Ce]=E,t)})];case 2:return 200===(e=i.sent()).status?[2,{isValid:!0,message:e.message,terms:e.result.terms,privacyPolicy:e.result.privacy_policy,socials:(null!==(n=e.result.socials)&&void 0!==n?n:[]).map(function(e){return e.toLowerCase()}),socialsConfig:(null!==(r=e.result.socials_config)&&void 0!==r?r:[]).map(function(e){return{provider:(e.provider||"").toLowerCase(),displayName:e.display_name||e.provider||""}})}]:404===e.status?[2,{isValid:!1,message:e.error,terms:"",privacyPolicy:"",socials:[],socialsConfig:[]}]:[2,{isValid:!1,message:"Unexpected response from api.",terms:"",privacyPolicy:"",socials:[],socialsConfig:[]}];case 3:return[2,{isValid:!1,message:"Unexpected response from api. "+i.sent().message,terms:"",privacyPolicy:"",socials:[],socialsConfig:[]}];case 4:return[2]}})})).then(function(e){w(e),e.isValid?GS(d.loginMethods,e):console.error("BLUX: appId is invalid".concat(e.message?" — ".concat(e.message):"",".")+" Login and signing are disabled.")})}Q(void 0,void 0,void 0,function(){var e,t,n,r;return ee(this,function(i){switch(i.label){case 0:if((e=ve().logos)&&e.length>0)return[2];i.label=1;case 1:return i.trys.push([1,6,,7]),[4,Q(void 0,void 0,void 0,function(){var e,t;return ee(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,IA()];case 1:return e=n.sent(),[4,LA(e)];case 2:return[2,(t=n.sent()).length?t:null];case 3:return n.sent(),[2,null];case 4:return[2]}})})];case 2:return(t=i.sent())?(ve().setLogos(t),kA(),[2]):[4,NA()];case 3:return n=i.sent(),ve().setLogos(n),[4,IA()];case 4:return r=i.sent(),[4,BA(r,n)];case 5:case 6:return i.sent(),[3,7];case 7:return[2]}})}),Q(void 0,void 0,void 0,function(){var e,t;return ee(this,function(n){switch(n.label){case 0:if(ve().assetMeta)return[2];n.label=1;case 1:return n.trys.push([1,5,,6]),[4,$A()];case 2:return(e=n.sent())?(ve().setAssetMeta(e),UA(),[2]):[4,jA()];case 3:return t=n.sent(),ve().setAssetMeta(t),[4,zA(t)];case 4:case 5:return n.sent(),[3,6];case 6:return[2]}})}),Q(void 0,void 0,void 0,function(){return ee(this,function(e){switch(e.label){case 0:return[4,sA()];case 1:return e.sent(),function(){var e;return!0===(null===(e=ve().apiResponse)||void 0===e?void 0:e.isValid)}()?(AA(!0),[2]):[2]}})});export{ne as BluxEvent,oE as ToScVal,_A as blux,oO as createConfig,ZE as events,AE as fundAccount,lE as getAccount,fE as getAccounts,hE as getAssets,pE as getBalances,bE as getClaimableBalances,mE as getEffects,he as getInitialState,EE as getLedgers,SE as getLiquidityPools,_E as getNetwork,OE as getOffers,NE as getOperations,kE as getOrderbook,TE as getPayments,HE as getSacAddress,de as getState,CE as getStrictReceivePaths,IE as getStrictSendPaths,VE as getTokenMetadata,BE as getTradeAggregation,LE as getTrades,ME as getTransactions,GE as networks,GA as numberish,RE as readContracts,XA as resolveAddress,KA as resolveAddressKey,WA as resolveAsset,JE as setAppearance,fe as subscribe,KE as swap,YE as switchNetwork,jE as transfer,le as useExportedStore,PE as writeContract};
34
+ */function Nr(){return Ar||(Ar=1,function(e){const t=function(){if(mr)return wr;mr=1,wr.byteLength=function(e){var t=o(e),n=t[0],r=t[1];return 3*(n+r)/4-r},wr.toByteArray=function(e){var r,i,a=o(e),s=a[0],c=a[1],u=new n(function(e,t,n){return 3*(t+n)/4-n}(0,s,c)),l=0,d=c>0?s-4:s;for(i=0;i<d;i+=4)r=t[e.charCodeAt(i)]<<18|t[e.charCodeAt(i+1)]<<12|t[e.charCodeAt(i+2)]<<6|t[e.charCodeAt(i+3)],u[l++]=r>>16&255,u[l++]=r>>8&255,u[l++]=255&r;return 2===c&&(r=t[e.charCodeAt(i)]<<2|t[e.charCodeAt(i+1)]>>4,u[l++]=255&r),1===c&&(r=t[e.charCodeAt(i)]<<10|t[e.charCodeAt(i+1)]<<4|t[e.charCodeAt(i+2)]>>2,u[l++]=r>>8&255,u[l++]=255&r),u},wr.fromByteArray=function(t){for(var n,r=t.length,i=r%3,o=[],a=16383,c=0,u=r-i;c<u;c+=a)o.push(s(t,c,c+a>u?u:c+a));return 1===i?(n=t[r-1],o.push(e[n>>2]+e[n<<4&63]+"==")):2===i&&(n=(t[r-2]<<8)+t[r-1],o.push(e[n>>10]+e[n>>4&63]+e[n<<2&63]+"=")),o.join("")};for(var e=[],t=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)e[i]=r[i],t[r.charCodeAt(i)]=i;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function a(t){return e[t>>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function s(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(a(r));return i.join("")}return t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63,wr}(),n=Or(),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},e.INSPECT_MAX_BYTES=50;const i=2147483647;function o(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|h(e,t);let r=o(n);const i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(G(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(G(e,ArrayBuffer)||e&&G(e.buffer,ArrayBuffer))return d(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(G(e,SharedArrayBuffer)||e&&G(e.buffer,SharedArrayBuffer)))return d(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return a.from(r,t,n);const i=function(e){if(a.isBuffer(e)){const t=0|f(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||H(e.length)?o(0):l(e);if("Buffer"===e.type&&Array.isArray(e.data))return l(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),o(e<0?0:0|f(e))}function l(e){const t=e.length<0?0:0|f(e.length),n=o(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function d(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,a.prototype),r}function f(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function h(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||G(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(i)return r?-1:X(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return O(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function b(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),H(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,i){let o,a=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let r=-1;for(o=n;o<s;o++)if(u(e,o)===u(t,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===c)return r*a}else-1!==r&&(o-=o-r),r=-1}else for(n+c>s&&(n=s-c),o=n;o>=0;o--){let n=!0;for(let r=0;r<c;r++)if(u(e,o+r)!==u(t,r)){n=!1;break}if(n)return o}return-1}function v(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=t.length;let a;for(r>o/2&&(r=o/2),a=0;a<r;++a){const r=parseInt(t.substr(2*a,2),16);if(H(r))return a;e[n+a]=r}return a}function y(e,t,n,r){return K(X(t,e.length-n),e,n,r)}function w(e,t,n,r){return K(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function x(e,t,n,r){return K(q(t),e,n,r)}function A(e,t,n,r){return K(function(e,t){let n,r,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function E(e,n,r){return 0===n&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function S(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=n){let n,r,s,c;switch(a){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(o=c));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=_));return n}(r)}e.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,n){return s(e,t,n)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,n){return function(e,t,n){return c(e),e<=0?o(e):void 0!==t?"string"==typeof n?o(e).fill(t,n):o(e).fill(t):o(e)}(e,t,n)},a.allocUnsafe=function(e){return u(e)},a.allocUnsafeSlow=function(e){return u(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(G(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),G(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=a.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if(G(t,Uint8Array))i+t.length>r.length?(a.isBuffer(t)||(t=a.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!a.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},a.byteLength=h,a.prototype._isBuffer=!0,a.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},a.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},a.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},a.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?S(this,0,e):p.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){let t="";const n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(e,t,n,r,i){if(G(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const c=Math.min(o,s),u=this.slice(r,i),l=e.slice(t,n);for(let e=0;e<c;++e)if(u[e]!==l[e]){o=u[e],s=l[e];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},a.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},a.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},a.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return y(this,e,t,n);case"ascii":case"latin1":case"binary":return w(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function O(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function N(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function k(e,t,n){const r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=t;r<n;++r)i+=V[e[r]];return i}function T(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function C(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,n,r,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function B(e,t,n,r,i){D(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function L(e,t,n,r,i){D(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function M(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function R(e,t,r,i,o){return t=+t,r>>>=0,o||M(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function P(e,t,r,i,o){return t=+t,r>>>=0,o||M(e,0,r,8),n.write(e,t,r,i,52,8),r+8}a.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,a.prototype),r},a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||C(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return r},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||C(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=Y(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||$(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),a.prototype.readBigUInt64BE=Y(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||$(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),a.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||C(e,t,this.length);let r=this[e],i=1,o=0;for(;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||C(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=Y(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||$(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),a.prototype.readBigInt64BE=Y(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||$(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),a.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),n.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),n.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),n.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),n.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){I(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){I(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigUInt64LE=Y(function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Y(function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);I(this,e,t,n,r-1,-r)}let i=0,o=1,a=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);I(this,e,t,n,r-1,-r)}let i=n-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigInt64LE=Y(function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Y(function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeFloatLE=function(e,t,n){return R(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return R(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return P(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return P(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},a.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const o=a.isBuffer(e)?e:a.from(e,r),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=o[i%s]}return this};const U={};function j(e,t,n){U[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function F(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function D(e,t,n,r,i,o){if(e>n||e<t){const n="bigint"==typeof t?"n":"";let r;throw r=0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`,new U.ERR_OUT_OF_RANGE("value",r,e)}!function(e,t,n){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||$(t,e.length-(n+1))}(r,i,o)}function z(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,n){if(Math.floor(e)!==e)throw z(e,n),new U.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}j("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),j("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),j("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=F(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r},RangeError);const W=/[^+/0-9A-Za-z-_]/g;function X(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function G(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!=e}const V=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Y(e){return"undefined"==typeof BigInt?J:e}function J(){throw new Error("BigInt not supported")}}(yr)),yr}
35
+ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */function kr(){if(Sr)return gr.exports;Sr=1;var e=65536,t=4294967295;var n=(Er||(Er=1,function(e,t){var n=Nr(),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=o),o.prototype=Object.create(r.prototype),i(r,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}(vr,vr.exports)),vr.exports).Buffer,r=Ke.crypto||Ke.msCrypto;return r&&r.getRandomValues?gr.exports=function(i,o){if(i>t)throw new RangeError("requested too many random bytes");var a=n.allocUnsafe(i);if(i>0)if(i>e)for(var s=0;s<i;s+=e)r.getRandomValues(a.slice(s,s+e));else r.getRandomValues(a);if("function"==typeof o)return process.nextTick(function(){o(null,a)});return a}:gr.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")},gr.exports}var Tr,Cr,Ir={};var Br,Lr,Mr,Rr={},Pr="6.6.1",Ur={},jr={exports:{}},Fr=jr.exports;function Dr(){return Br||(Br=1,function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:pt.Buffer}catch(e){}function a(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function s(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function c(e,t,n,r){for(var i=0,o=Math.min(e.length,n),a=t;a<o;a++){var s=e.charCodeAt(a)-48;i*=r,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)i=s(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)i=s(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,l=n;l<s;l+=r)u=c(e,l,l+r,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var d=1;for(u=c(e,l,e.length,t),l=0;l<a;l++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;n.words[0]=s;for(var u=1;u<r;u++){for(var l=c>>>26,d=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}n.words[u]=0|d,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n.strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],c=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?u[6-c.length]+c+r:c+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=l[e],h=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?b+r:u[f-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(o),l=this.clone();if(c){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[s]=a;for(;s<o;s++)u[s]=0}else{for(s=0;s<o-i;s++)u[s]=0;for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[o-s-1]=a}return u},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 8191&t||(n+=13,t>>>=13),127&t||(n+=7,t>>>=7),15&t||(n+=4,t>>>=4),3&t||(n+=2,t>>>=2),1&t||n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},i.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o<r.length;o++)t=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<n.length;o++)t=(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a<r.length;a++)o=(t=(0|n.words[a])-(0|r.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<n.length;a++)o=(t=(0|n.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var h=function(e,t,n){var r,i,o,a=e.words,s=t.words,c=n.words,u=0,l=0|a[0],d=8191&l,f=l>>>13,h=0|a[1],p=8191&h,b=h>>>13,m=0|a[2],g=8191&m,v=m>>>13,y=0|a[3],w=8191&y,x=y>>>13,A=0|a[4],E=8191&A,S=A>>>13,_=0|a[5],O=8191&_,N=_>>>13,k=0|a[6],T=8191&k,C=k>>>13,I=0|a[7],B=8191&I,L=I>>>13,M=0|a[8],R=8191&M,P=M>>>13,U=0|a[9],j=8191&U,F=U>>>13,D=0|s[0],z=8191&D,$=D>>>13,W=0|s[1],X=8191&W,q=W>>>13,K=0|s[2],G=8191&K,H=K>>>13,V=0|s[3],Y=8191&V,J=V>>>13,Z=0|s[4],Q=8191&Z,ee=Z>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,le=0|s[8],de=8191&le,fe=le>>>13,he=0|s[9],pe=8191&he,be=he>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(u+(r=Math.imul(d,z))|0)+((8191&(i=(i=Math.imul(d,$))+Math.imul(f,z)|0))<<13)|0;u=((o=Math.imul(f,$))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(p,z),i=(i=Math.imul(p,$))+Math.imul(b,z)|0,o=Math.imul(b,$);var ge=(u+(r=r+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(f,X)|0))<<13)|0;u=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,z),i=(i=Math.imul(g,$))+Math.imul(v,z)|0,o=Math.imul(v,$),r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,q)|0;var ve=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,H)|0)+Math.imul(f,G)|0))<<13)|0;u=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(w,z),i=(i=Math.imul(w,$))+Math.imul(x,z)|0,o=Math.imul(x,$),r=r+Math.imul(g,X)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,H)|0;var ye=(u+(r=r+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(f,Y)|0))<<13)|0;u=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(E,z),i=(i=Math.imul(E,$))+Math.imul(S,z)|0,o=Math.imul(S,$),r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,q)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,H)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,H)|0,r=r+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,J)|0;var we=(u+(r=r+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(O,z),i=(i=Math.imul(O,$))+Math.imul(N,z)|0,o=Math.imul(N,$),r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,q)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,H)|0,r=r+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,J)|0,r=r+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var xe=(u+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((o=o+Math.imul(f,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(T,z),i=(i=Math.imul(T,$))+Math.imul(C,z)|0,o=Math.imul(C,$),r=r+Math.imul(O,X)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,q)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,H)|0,r=r+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,J)|0,r=r+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(b,ne)|0,o=o+Math.imul(b,re)|0;var Ae=(u+(r=r+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(B,z),i=(i=Math.imul(B,$))+Math.imul(L,z)|0,o=Math.imul(L,$),r=r+Math.imul(T,X)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,q)|0,r=r+Math.imul(O,G)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,H)|0,r=r+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,J)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0,r=r+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Ee=(u+(r=r+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(R,z),i=(i=Math.imul(R,$))+Math.imul(P,z)|0,o=Math.imul(P,$),r=r+Math.imul(B,X)|0,i=(i=i+Math.imul(B,q)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,q)|0,r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,H)|0,r=r+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,J)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,r=r+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0;var Se=(u+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,z),i=(i=Math.imul(j,$))+Math.imul(F,z)|0,o=Math.imul(F,$),r=r+Math.imul(R,X)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,q)|0,r=r+Math.imul(B,G)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,H)|0,r=r+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,J)|0,r=r+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,r=r+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(v,ce)|0,o=o+Math.imul(v,ue)|0,r=r+Math.imul(p,de)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,fe)|0;var _e=(u+(r=r+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,be)|0)+Math.imul(f,pe)|0))<<13)|0;u=((o=o+Math.imul(f,be)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(j,X),i=(i=Math.imul(j,q))+Math.imul(F,X)|0,o=Math.imul(F,q),r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,H)|0,r=r+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,J)|0,r=r+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,ee)|0,r=r+Math.imul(O,ne)|0,i=(i=i+Math.imul(O,re)|0)+Math.imul(N,ne)|0,o=o+Math.imul(N,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,r=r+Math.imul(g,de)|0,i=(i=i+Math.imul(g,fe)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,fe)|0;var Oe=(u+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(j,G),i=(i=Math.imul(j,H))+Math.imul(F,G)|0,o=Math.imul(F,H),r=r+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,J)|0,r=r+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(C,ne)|0,o=o+Math.imul(C,re)|0,r=r+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,r=r+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,fe)|0;var Ne=(u+(r=r+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(v,pe)|0))<<13)|0;u=((o=o+Math.imul(v,be)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,r=Math.imul(j,Y),i=(i=Math.imul(j,J))+Math.imul(F,Y)|0,o=Math.imul(F,J),r=r+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,r=r+Math.imul(B,ne)|0,i=(i=i+Math.imul(B,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,r=r+Math.imul(O,ce)|0,i=(i=i+Math.imul(O,ue)|0)+Math.imul(N,ce)|0,o=o+Math.imul(N,ue)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,fe)|0;var ke=(u+(r=r+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(x,pe)|0))<<13)|0;u=((o=o+Math.imul(x,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,Q),i=(i=Math.imul(j,ee))+Math.imul(F,Q)|0,o=Math.imul(F,ee),r=r+Math.imul(R,ne)|0,i=(i=i+Math.imul(R,re)|0)+Math.imul(P,ne)|0,o=o+Math.imul(P,re)|0,r=r+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(C,ce)|0,o=o+Math.imul(C,ue)|0,r=r+Math.imul(O,de)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,fe)|0;var Te=(u+(r=r+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ne),i=(i=Math.imul(j,re))+Math.imul(F,ne)|0,o=Math.imul(F,re),r=r+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,r=r+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,ue)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,ue)|0,r=r+Math.imul(T,de)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(C,de)|0,o=o+Math.imul(C,fe)|0;var Ce=(u+(r=r+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(N,pe)|0))<<13)|0;u=((o=o+Math.imul(N,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,oe),i=(i=Math.imul(j,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),r=r+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,r=r+Math.imul(B,de)|0,i=(i=i+Math.imul(B,fe)|0)+Math.imul(L,de)|0,o=o+Math.imul(L,fe)|0;var Ie=(u+(r=r+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,be)|0)+Math.imul(C,pe)|0))<<13)|0;u=((o=o+Math.imul(C,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,ce),i=(i=Math.imul(j,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),r=r+Math.imul(R,de)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(P,de)|0,o=o+Math.imul(P,fe)|0;var Be=(u+(r=r+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,be)|0)+Math.imul(L,pe)|0))<<13)|0;u=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,de),i=(i=Math.imul(j,fe))+Math.imul(F,de)|0,o=Math.imul(F,fe);var Le=(u+(r=r+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,be)|0)+Math.imul(P,pe)|0))<<13)|0;u=((o=o+Math.imul(P,be)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863;var Me=(u+(r=Math.imul(j,pe))|0)+((8191&(i=(i=Math.imul(j,be))+Math.imul(F,pe)|0))<<13)|0;return u=((o=Math.imul(F,be))+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,c[0]=me,c[1]=ge,c[2]=ve,c[3]=ye,c[4]=we,c[5]=xe,c[6]=Ae,c[7]=Ee,c[8]=Se,c[9]=_e,c[10]=Oe,c[11]=Ne,c[12]=ke,c[13]=Te,c[14]=Ce,c[15]=Ie,c[16]=Be,c[17]=Le,c[18]=Me,0!==u&&(c[19]=u,n.length++),n};function p(e,t,n){return(new b).mulp(e,t,n)}function b(e,t){this.x=e,this.y=t}Math.imul||(h=f),i.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=10===this.length&&10===e.length?h(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var a=i;i=0;for(var s=67108863&r,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var l=o-u,d=(0|e.words[l])*(0|t.words[u]),f=67108863&d;s=67108863&(f=f+s|0),i+=(a=(a=a+(d/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):p(this,e,t),n},b.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},b.prototype.revBin=function(e,t,n){if(0===e||e===n-1)return e;for(var r=0,i=0;i<t;i++)r|=(1&e)<<t-i-1,e>>=1;return r},b.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a<o;a++)r[a]=t[e[a]],i[a]=n[e[a]]},b.prototype.transform=function(e,t,n,r,i,o){this.permute(o,e,t,n,r,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,c=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var d=c,f=u,h=0;h<a;h++){var p=n[l+h],b=r[l+h],m=n[l+h+a],g=r[l+h+a],v=d*m-f*g;g=d*g+f*m,m=v,n[l+h]=p+m,r[l+h]=b+g,n[l+h+a]=p-m,r[l+h+a]=b-g,h!==s&&(v=c*d-u*f,f=c*f+u*d,d=v)}},b.prototype.guessLen13b=function(e,t){var n=1|Math.max(t,e),r=1&n,i=0;for(n=n/2|0;n;n>>>=1)i++;return 1<<i+1+r},b.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var i=e[r];e[r]=e[n-r-1],e[n-r-1]=i,i=t[r],t[r]=-t[n-r-1],t[n-r-1]=-i}},b.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var i=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+n;e[r]=67108863&i,n=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(!(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=0;return t},b.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(r),o=this.stub(r),a=new Array(r),s=new Array(r),c=new Array(r),u=new Array(r),l=new Array(r),d=new Array(r),f=n.words;f.length=r,this.convert13b(e.words,e.length,a,r),this.convert13b(t.words,t.length,u,r),this.transform(a,o,s,c,r,i),this.transform(u,o,l,d,r,i);for(var h=0;h<r;h++){var p=s[h]*l[h]-c[h]*d[h];c[h]=s[h]*d[h]+c[h]*l[h],s[h]=p}return this.conjugate(s,c,r),this.transform(s,c,f,o,r,i),this.conjugate(f,o,r),this.normalize13b(f,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),p(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this.length=0===e?1:this.length,this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=(e.words[r]&1<<i)>>>i}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var o=n.sqr();r<t.length;r++,o=o.sqr())0!==t[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,c=(0|this.words[t])-s<<r;this.words[t]=c|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,c=r;if(i-=a,i=Math.max(0,i),c){for(var u=0;u<a;u++)c.words[u]=this.words[u];c.length=a}if(0===a);else if(this.length>a)for(this.length-=a,u=0;u<this.length;u++)this.words[u]=this.words[u+a];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var c=(0|e.words[i])*t;s=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,c=r.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var l=r.clone()._ishlnsubmul(o,1,c);0===l.negative&&(r=l,s&&(s.words[c]=1));for(var d=c-1;d>=0;d--){var f=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(o,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=f)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0===(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,b=1;0===(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(c)):(r.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:r.iushln(u)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0===(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,f=1;0===(r.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},r(v,g),v.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&n,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&n)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(y,g),r(w,g),r(x,g),x.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return m[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,o),f=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var b=h,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m<p);var g=this.pow(d,new i(1).iushln(p-m-1));f=f.redMul(g),d=g.redSqr(),h=h.redMul(d),p=m}return f},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var o=n[0],a=0,s=0,c=t.bitLength()%26;for(0===c&&(c=26),r=t.length-1;r>=0;r--){for(var u=t.words[r],l=c-1;l>=0;l--){var d=u>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}c=26}return o},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new E(e)},r(E,A),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(jr,Fr)),jr.exports}function zr(){if(Mr)return Lr;function e(e,t){if(!e)throw new Error(t||"Assertion failed")}return Mr=1,Lr=e,e.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},Lr}var $r,Wr,Xr={};function qr(){return $r||($r=1,function(){var e=Xr;function t(e){return 1===e.length?"0"+e:e}function n(e){for(var n="",r=0;r<e.length;r++)n+=t(e[r].toString(16));return n}e.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"!=typeof e){for(var r=0;r<e.length;r++)n[r]=0|e[r];return n}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(r=0;r<e.length;r+=2)n.push(parseInt(e[r]+e[r+1],16))}else for(r=0;r<e.length;r++){var i=e.charCodeAt(r),o=i>>8,a=255&i;o?n.push(o,a):n.push(a)}return n},e.zero2=t,e.toHex=n,e.encode=function(e,t){return"hex"===t?n(e):e}}()),Xr}function Kr(){return Wr||(Wr=1,function(){var e=Ur,t=Dr(),n=zr(),r=qr();e.assert=n,e.toArray=r.toArray,e.zero2=r.zero2,e.toHex=r.toHex,e.encode=r.encode,e.getNAF=function(e,t,n){var r,i=new Array(Math.max(e.bitLength(),n)+1);for(r=0;r<i.length;r+=1)i[r]=0;var o=1<<t+1,a=e.clone();for(r=0;r<i.length;r++){var s,c=a.andln(o-1);a.isOdd()?(s=c>(o>>1)-1?(o>>1)-c:c,a.isubn(s)):s=0,i[r]=s,a.iushrn(1)}return i},e.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=1&c?3!==(r=e.andln(7)+i&7)&&5!==r||2!==u?c:-c:0,n[0].push(a),s=1&u?3!==(r=t.andln(7)+o&7)&&5!==r||2!==c?u:-u:0,n[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return n},e.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t},e.intFromLE=function(e){return new t(e,"hex","le")}}()),Ur}var Gr,Hr={exports:{}};function Vr(){if(Gr)return Hr.exports;var e;function t(e){this.rand=e}if(Gr=1,Hr.exports=function(n){return e||(e=new t(null)),e.generate(n)},Hr.exports.Rand=t,t.prototype.generate=function(e){return this._rand(e)},t.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n<t.length;n++)t[n]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(t.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var n=pt;if("function"!=typeof n.randomBytes)throw new Error("Not supported");t.prototype._rand=function(e){return n.randomBytes(e)}}catch(e){}return Hr.exports}var Yr,Jr,Zr={};function Qr(){if(Jr)return Yr;Jr=1;var e=Dr(),t=Kr(),n=t.getNAF,r=t.getJSF,i=t.assert;function o(t,n){this.type=t,this.p=new e(n.p,16),this.red=n.prime?e.red(n.prime):e.mont(this.p),this.zero=new e(0).toRed(this.red),this.one=new e(1).toRed(this.red),this.two=new e(2).toRed(this.red),this.n=n.n&&new e(n.n,16),this.g=n.g&&this.pointFromJSON(n.g,n.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function a(e,t){this.curve=e,this.type=t,this.precomputed=null}return Yr=o,o.prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(e,t){i(e.precomputed);var r=e._getDoubles(),o=n(t,1,this._bitLength),a=(1<<r.step+1)-(r.step%2==0?2:1);a/=3;var s,c,u=[];for(s=0;s<o.length;s+=r.step){c=0;for(var l=s+r.step-1;l>=s;l--)c=(c<<1)+o[l];u.push(c)}for(var d=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=a;h>0;h--){for(s=0;s<u.length;s++)(c=u[s])===h?f=f.mixedAdd(r.points[s]):c===-h&&(f=f.mixedAdd(r.points[s].neg()));d=d.add(f)}return d.toP()},o.prototype._wnafMul=function(e,t){var r=4,o=e._getNAFPoints(r);r=o.wnd;for(var a=o.points,s=n(t,r,this._bitLength),c=this.jpoint(null,null,null),u=s.length-1;u>=0;u--){for(var l=0;u>=0&&0===s[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var d=s[u];i(0!==d),c="affine"===e.type?d>0?c.mixedAdd(a[d-1>>1]):c.mixedAdd(a[-d-1>>1].neg()):d>0?c.add(a[d-1>>1]):c.add(a[-d-1>>1].neg())}return"affine"===e.type?c.toP():c},o.prototype._wnafMulAdd=function(e,t,i,o,a){var s,c,u,l=this._wnafT1,d=this._wnafT2,f=this._wnafT3,h=0;for(s=0;s<o;s++){var p=(u=t[s])._getNAFPoints(e);l[s]=p.wnd,d[s]=p.points}for(s=o-1;s>=1;s-=2){var b=s-1,m=s;if(1===l[b]&&1===l[m]){var g=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(g[1]=t[b].add(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].add(t[m].neg())):(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=r(i[b],i[m]);for(h=Math.max(y[0].length,h),f[b]=new Array(h),f[m]=new Array(h),c=0;c<h;c++){var w=0|y[0][c],x=0|y[1][c];f[b][c]=v[3*(w+1)+(x+1)],f[m][c]=0,d[b]=g}}else f[b]=n(i[b],l[b],this._bitLength),f[m]=n(i[m],l[m],this._bitLength),h=Math.max(f[b].length,h),h=Math.max(f[m].length,h)}var A=this.jpoint(null,null,null),E=this._wnafT4;for(s=h;s>=0;s--){for(var S=0;s>=0;){var _=!0;for(c=0;c<o;c++)E[c]=0|f[c][s],0!==E[c]&&(_=!1);if(!_)break;S++,s--}if(s>=0&&S++,A=A.dblp(S),s<0)break;for(c=0;c<o;c++){var O=E[c];0!==O&&(O>0?u=d[c][O-1>>1]:O<0&&(u=d[c][-O-1>>1].neg()),A="affine"===u.type?A.mixedAdd(u):A.add(u))}}for(s=0;s<o;s++)d[s]=null;return a?A:A.toP()},o.BasePoint=a,a.prototype.eq=function(){throw new Error("Not implemented")},a.prototype.validate=function(){return this.curve.validate(this)},o.prototype.decodePoint=function(e,n){e=t.toArray(e,n);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?i(e[e.length-1]%2==0):7===e[0]&&i(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},a.prototype.encodeCompressed=function(e){return this.encode(e,!0)},a.prototype._encode=function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},a.prototype.encode=function(e,n){return t.encode(this._encode(n),e)},a.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},a.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},a.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)r=r.dbl();n.push(r)}return{step:e,points:n}},a.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,r=1===n?null:this.dbl(),i=1;i<n;i++)t[i]=t[i-1].add(r);return{wnd:e,points:t}},a.prototype._getBeta=function(){return null},a.prototype.dblp=function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t},Yr}var ei,ti,ni,ri,ii,oi,ai,si,ci={exports:{}};function ui(){return ei||(ei=1,"function"==typeof Object.create?ci.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ci.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),ci.exports}function li(){return si||(si=1,function(e){var t=e;t.base=Qr(),t.short=function(){if(ni)return ti;ni=1;var e=Kr(),t=Dr(),n=ui(),r=Qr(),i=e.assert;function o(e){r.call(this,"short",e),this.a=new t(e.a,16).toRed(this.red),this.b=new t(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function a(e,n,i,o){r.BasePoint.call(this,e,"affine"),null===n&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new t(n,16),this.y=new t(i,16),o&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function s(e,n,i,o){r.BasePoint.call(this,e,"jacobian"),null===n&&null===i&&null===o?(this.x=this.curve.one,this.y=this.curve.one,this.z=new t(0)):(this.x=new t(n,16),this.y=new t(i,16),this.z=new t(o,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return n(o,r),ti=o,o.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var n,r;if(e.beta)n=new t(e.beta,16).toRed(this.red);else{var o=this._getEndoRoots(this.p);n=(n=o[0].cmp(o[1])<0?o[0]:o[1]).toRed(this.red)}if(e.lambda)r=new t(e.lambda,16);else{var a=this._getEndoRoots(this.n);0===this.g.mul(a[0]).x.cmp(this.g.x.redMul(n))?r=a[0]:(r=a[1],i(0===this.g.mul(r).x.cmp(this.g.x.redMul(n))))}return{beta:n,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new t(e.a,16),b:new t(e.b,16)}}):this._getEndoBasis(r)}}},o.prototype._getEndoRoots=function(e){var n=e===this.p?this.red:t.mont(e),r=new t(2).toRed(n).redInvm(),i=r.redNeg(),o=new t(3).toRed(n).redNeg().redSqrt().redMul(r);return[i.redAdd(o).fromRed(),i.redSub(o).fromRed()]},o.prototype._getEndoBasis=function(e){for(var n,r,i,o,a,s,c,u,l,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),p=new t(1),b=new t(0),m=new t(0),g=new t(1),v=0;0!==f.cmpn(0);){var y=h.div(f);u=h.sub(y.mul(f)),l=m.sub(y.mul(p));var w=g.sub(y.mul(b));if(!i&&u.cmp(d)<0)n=c.neg(),r=p,i=u.neg(),o=l;else if(i&&2===++v)break;c=u,h=f,f=u,m=p,p=l,g=b,b=w}a=u.neg(),s=l;var x=i.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(x)>=0&&(a=n,s=r),i.negative&&(i=i.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:i,b:o},{a:a,b:s}]},o.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=i.mul(n.a),s=o.mul(r.a),c=i.mul(n.b),u=o.mul(r.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},o.prototype.pointFromX=function(e,n){(e=new t(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=i.fromRed().isOdd();return(n&&!o||!n&&o)&&(i=i.redNeg()),this.point(e,i)},o.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},o.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],c=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),c=c.neg(!0)),r[2*o]=s,r[2*o+1]=c,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var u=this._wnafMulAdd(1,r,i,2*o,n),l=0;l<2*o;l++)r[l]=null,i[l]=null;return u},n(a,r.BasePoint),o.prototype.point=function(e,t,n){return new a(this,e,t,n)},o.prototype.pointFromJSON=function(e,t){return a.fromJSON(this,e,t)},a.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,r=function(e){return n.point(e.x.redMul(n.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}}return t}},a.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},a.fromJSON=function(e,t,n){"string"==typeof t&&(t=JSON.parse(t));var r=e.point(t[0],t[1],n);if(!t[2])return r;function i(t){return e.point(t[0],t[1],n)}var o=t[2];return r.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[r].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[r].concat(o.naf.points.map(i))}},r},a.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},a.prototype.isInfinity=function(){return this.inf},a.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},a.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},a.prototype.getX=function(){return this.x.fromRed()},a.prototype.getY=function(){return this.y.fromRed()},a.prototype.mul=function(e){return e=new t(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},a.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},a.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},a.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},a.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},a.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},n(s,r.BasePoint),o.prototype.jpoint=function(e,t,n){return new s(this,e,t,n)},s.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},s.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},s.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),d=r.redMul(u),f=c.redSqr().redIAdd(l).redISub(d).redISub(d),h=c.redMul(d.redISub(f)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(f,h,p)},s.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=n.redSub(r),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),l=n.redMul(c),d=s.redSqr().redIAdd(u).redISub(l).redISub(l),f=s.redMul(l.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,f,h)},s.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var r=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,c=s.redSqr().redSqr(),u=a.redAdd(a);for(t=0;t<e;t++){var l=o.redSqr(),d=u.redSqr(),f=d.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(r.redMul(c)),p=o.redMul(d),b=h.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),g=h.redMul(m);g=g.redIAdd(g).redISub(f);var v=u.redMul(s);t+1<e&&(c=c.redMul(f)),o=b,s=v,u=g}return this.curve.jpoint(o,u.redMul(i),s)},s.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},s.prototype._zeroDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r),c=s.redSqr().redISub(a).redISub(a),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=s.redMul(a.redISub(c)).redISub(u),n=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),f=d.redSqr(),h=this.x.redAdd(d).redSqr().redISub(l).redISub(f);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),b=p.redSqr(),m=f.redIAdd(f);m=(m=m.redIAdd(m)).redIAdd(m),e=b.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(m),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(e,t,n)},s.prototype._threeDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(r).redISub(o);a=a.redIAdd(a);var s=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),c=s.redSqr().redISub(a).redISub(a);e=c;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=s.redMul(a.redISub(c)).redISub(u),n=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),f=this.x.redMul(d),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=f.redIAdd(f),b=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(b),n=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var m=d.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,n)},s.prototype._dbl=function(){var e=this.curve.a,t=this.x,n=this.y,r=this.z,i=r.redSqr().redSqr(),o=t.redSqr(),a=n.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(a),l=s.redSqr().redISub(u.redAdd(u)),d=u.redISub(l),f=a.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=s.redMul(d).redISub(f),p=n.redAdd(n).redMul(r);return this.curve.jpoint(l,h,p)},s.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),r=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(r),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),c=r.redIAdd(r);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(s).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var f=this.y.redMul(u.redMul(c.redISub(u)).redISub(a.redMul(s)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=this.z.redAdd(a).redSqr().redISub(n).redISub(s);return this.curve.jpoint(d,f,h)},s.prototype.mul=function(e,n){return e=new t(e,n),this.curve._wnafMul(this,e)},s.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(0!==this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0))return!1;var r=t.redMul(this.z),i=n.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(r)).cmpn(0)},s.prototype.eqXToP=function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(n))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(t);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},s.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},s.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},ti}(),t.mont=function(){if(ii)return ri;ii=1;var e=Dr(),t=ui(),n=Qr(),r=Kr();function i(t){n.call(this,"mont",t),this.a=new e(t.a,16).toRed(this.red),this.b=new e(t.b,16).toRed(this.red),this.i4=new e(4).toRed(this.red).redInvm(),this.two=new e(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function o(t,r,i){n.BasePoint.call(this,t,"projective"),null===r&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new e(r,16),this.z=new e(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return t(i,n),ri=i,i.prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),r=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},t(o,n.BasePoint),i.prototype.decodePoint=function(e,t){return this.point(r.toArray(e,t),1)},i.prototype.point=function(e,t){return new o(this,e,t)},i.prototype.pointFromJSON=function(e){return o.fromJSON(this,e)},o.prototype.precompute=function(){},o.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},o.fromJSON=function(e,t){return new o(e,t[0],t[1]||e.one)},o.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},o.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),n=e.redSub(t),r=e.redMul(t),i=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(r,i)},o.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),r=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(n),a=i.redMul(r),s=t.z.redMul(o.redAdd(a).redSqr()),c=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},o.prototype.mul=function(e){for(var t=e.clone(),n=this,r=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(n=n.diffAdd(r,this),r=r.dbl()):(r=n.diffAdd(r,this),n=n.dbl());return r},o.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},o.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()},ri}(),t.edwards=function(){if(ai)return oi;ai=1;var e=Kr(),t=Dr(),n=ui(),r=Qr(),i=e.assert;function o(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,r.call(this,"edwards",e),this.a=new t(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new t(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new t(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),i(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function a(e,n,i,o,a){r.BasePoint.call(this,e,"projective"),null===n&&null===i&&null===o?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new t(n,16),this.y=new t(i,16),this.z=o?new t(o,16):this.curve.one,this.t=a&&new t(a,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return n(o,r),oi=o,o.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},o.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},o.prototype.jpoint=function(e,t,n,r){return this.point(e,t,n,r)},o.prototype.pointFromX=function(e,n){(e=new t(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=i.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var c=s.fromRed().isOdd();return(n&&!c||!n&&c)&&(s=s.redNeg()),this.point(e,s)},o.prototype.pointFromY=function(e,n){(e=new t(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(n)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==n&&(s=s.redNeg()),this.point(s,e)},o.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),r=t.redMul(this.a).redAdd(n),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return 0===r.cmp(i)},n(a,r.BasePoint),o.prototype.pointFromJSON=function(e){return a.fromJSON(this,e)},o.prototype.point=function(e,t,n,r){return new a(this,e,t,n,r)},a.fromJSON=function(e,t){return new a(e,t[0],t[1],t[2])},a.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},a.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},a.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var r=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=r.redAdd(t),a=o.redSub(n),s=r.redSub(t),c=i.redMul(a),u=o.redMul(s),l=i.redMul(s),d=a.redMul(o);return this.curve.point(c,u,d,l)},a.prototype._projDbl=function(){var e,t,n,r,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(r=this.curve._mulA(s)).redAdd(c);this.zOne?(e=a.redSub(s).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(r.redSub(c)),n=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=a.redSub(s).redISub(c).redMul(o),t=u.redMul(r.redSub(c)),n=u.redMul(o))}else r=s.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=r.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(r)).redMul(o),t=this.curve._mulC(r).redMul(s.redISub(c)),n=r.redMul(o);return this.curve.point(e,t,n)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},a.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(t),a=i.redSub(r),s=i.redAdd(r),c=n.redAdd(t),u=o.redMul(a),l=s.redMul(c),d=o.redMul(c),f=a.redMul(s);return this.curve.point(u,l,f,d)},a.prototype._projAdd=function(e){var t,n,r=this.z.redMul(e.z),i=r.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),u=i.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),d=r.redMul(c).redMul(l);return this.curve.twisted?(t=r.redMul(u).redMul(a.redSub(this.curve._mulA(o))),n=c.redMul(u)):(t=r.redMul(u).redMul(a.redSub(o)),n=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,n)},a.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},a.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},a.prototype.mulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},a.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},a.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},a.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},a.prototype.getX=function(){return this.normalize(),this.x.fromRed()},a.prototype.getY=function(){return this.normalize(),this.y.fromRed()},a.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},a.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var n=e.clone(),r=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},a.prototype.toP=a.prototype.normalize,a.prototype.mixedAdd=a.prototype.add,oi}()}(Zr)),Zr}var di,fi={},hi={},pi={};function bi(){if(di)return pi;di=1;var e=zr(),t=ui();function n(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function r(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function i(e){return 1===e.length?"0"+e:e}function o(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}return pi.inherits=t,pi.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)r.push(parseInt(e[o]+e[o+1],16))}else for(var i=0,o=0;o<e.length;o++){var a=e.charCodeAt(o);a<128?r[i++]=a:a<2048?(r[i++]=a>>6|192,r[i++]=63&a|128):n(e,o)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++o)),r[i++]=a>>18|240,r[i++]=a>>12&63|128,r[i++]=a>>6&63|128,r[i++]=63&a|128):(r[i++]=a>>12|224,r[i++]=a>>6&63|128,r[i++]=63&a|128)}else for(o=0;o<e.length;o++)r[o]=0|e[o];return r},pi.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=i(e[n].toString(16));return t},pi.htonl=r,pi.toHex32=function(e,t){for(var n="",i=0;i<e.length;i++){var a=e[i];"little"===t&&(a=r(a)),n+=o(a.toString(16))}return n},pi.zero2=i,pi.zero8=o,pi.join32=function(t,n,r,i){var o=r-n;e(o%4==0);for(var a=new Array(o/4),s=0,c=n;s<a.length;s++,c+=4){var u;u="big"===i?t[c]<<24|t[c+1]<<16|t[c+2]<<8|t[c+3]:t[c+3]<<24|t[c+2]<<16|t[c+1]<<8|t[c],a[s]=u>>>0}return a},pi.split32=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r<e.length;r++,i+=4){var o=e[r];"big"===t?(n[i]=o>>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},pi.rotr32=function(e,t){return e>>>t|e<<32-t},pi.rotl32=function(e,t){return e<<t|e>>>32-t},pi.sum32=function(e,t){return e+t>>>0},pi.sum32_3=function(e,t,n){return e+t+n>>>0},pi.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},pi.sum32_5=function(e,t,n,r,i){return e+t+n+r+i>>>0},pi.sum64=function(e,t,n,r){var i=e[t],o=r+e[t+1]>>>0,a=(o<r?1:0)+n+i;e[t]=a>>>0,e[t+1]=o},pi.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},pi.sum64_lo=function(e,t,n,r){return t+r>>>0},pi.sum64_4_hi=function(e,t,n,r,i,o,a,s){var c=0,u=t;return c+=(u=u+r>>>0)<t?1:0,c+=(u=u+o>>>0)<o?1:0,e+n+i+a+(c+=(u=u+s>>>0)<s?1:0)>>>0},pi.sum64_4_lo=function(e,t,n,r,i,o,a,s){return t+r+o+s>>>0},pi.sum64_5_hi=function(e,t,n,r,i,o,a,s,c,u){var l=0,d=t;return l+=(d=d+r>>>0)<t?1:0,l+=(d=d+o>>>0)<o?1:0,l+=(d=d+s>>>0)<s?1:0,e+n+i+a+c+(l+=(d=d+u>>>0)<u?1:0)>>>0},pi.sum64_5_lo=function(e,t,n,r,i,o,a,s,c,u){return t+r+o+s+u>>>0},pi.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},pi.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},pi.shr64_hi=function(e,t,n){return e>>>n},pi.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},pi}var mi,gi={};function vi(){if(mi)return gi;mi=1;var e=bi(),t=zr();function n(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return gi.BlockHash=n,n.prototype.update=function(t,n){if(t=e.toArray(t,n),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=e.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},n.prototype.digest=function(e){return this.update(this._pad()),t(null===this.pending),this._digest(e)},n.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var i=1;i<n;i++)r[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)r[i++]=0;r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=e>>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o<this.padLength;o++)r[i++]=0;return r},gi}var yi,wi,xi,Ai,Ei,Si,_i,Oi,Ni,ki,Ti,Ci,Ii={},Bi={};function Li(){if(yi)return Bi;yi=1;var e=bi().rotr32;function t(e,t,n){return e&t^~e&n}function n(e,t,n){return e&t^e&n^t&n}function r(e,t,n){return e^t^n}return Bi.ft_1=function(e,i,o,a){return 0===e?t(i,o,a):1===e||3===e?r(i,o,a):2===e?n(i,o,a):void 0},Bi.ch32=t,Bi.maj32=n,Bi.p32=r,Bi.s0_256=function(t){return e(t,2)^e(t,13)^e(t,22)},Bi.s1_256=function(t){return e(t,6)^e(t,11)^e(t,25)},Bi.g0_256=function(t){return e(t,7)^e(t,18)^t>>>3},Bi.g1_256=function(t){return e(t,17)^e(t,19)^t>>>10},Bi}function Mi(){if(Ei)return Ai;Ei=1;var e=bi(),t=vi(),n=Li(),r=zr(),i=e.sum32,o=e.sum32_4,a=e.sum32_5,s=n.ch32,c=n.maj32,u=n.s0_256,l=n.s1_256,d=n.g0_256,f=n.g1_256,h=t.BlockHash,p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;h.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=p,this.W=new Array(64)}return e.inherits(b,h),Ai=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var n=this.W,h=0;h<16;h++)n[h]=e[t+h];for(;h<n.length;h++)n[h]=o(f(n[h-2]),n[h-7],d(n[h-15]),n[h-16]);var p=this.h[0],b=this.h[1],m=this.h[2],g=this.h[3],v=this.h[4],y=this.h[5],w=this.h[6],x=this.h[7];for(r(this.k.length===n.length),h=0;h<n.length;h++){var A=a(x,l(v),s(v,y,w),this.k[h],n[h]),E=i(u(p),c(p,b,m));x=w,w=y,y=v,v=i(g,A),g=m,m=b,b=p,p=i(A,E)}this.h[0]=i(this.h[0],p),this.h[1]=i(this.h[1],b),this.h[2]=i(this.h[2],m),this.h[3]=i(this.h[3],g),this.h[4]=i(this.h[4],v),this.h[5]=i(this.h[5],y),this.h[6]=i(this.h[6],w),this.h[7]=i(this.h[7],x)},b.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},Ai}function Ri(){if(Ni)return Oi;Ni=1;var e=bi(),t=vi(),n=zr(),r=e.rotr64_hi,i=e.rotr64_lo,o=e.shr64_hi,a=e.shr64_lo,s=e.sum64,c=e.sum64_hi,u=e.sum64_lo,l=e.sum64_4_hi,d=e.sum64_4_lo,f=e.sum64_5_hi,h=e.sum64_5_lo,p=t.BlockHash,b=[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 m(){if(!(this instanceof m))return new m;p.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function g(e,t,n,r,i){var o=e&n^~e&i;return o<0&&(o+=4294967296),o}function v(e,t,n,r,i,o){var a=t&r^~t&o;return a<0&&(a+=4294967296),a}function y(e,t,n,r,i){var o=e&n^e&i^n&i;return o<0&&(o+=4294967296),o}function w(e,t,n,r,i,o){var a=t&r^t&o^r&o;return a<0&&(a+=4294967296),a}function x(e,t){var n=r(e,t,28)^r(t,e,2)^r(t,e,7);return n<0&&(n+=4294967296),n}function A(e,t){var n=i(e,t,28)^i(t,e,2)^i(t,e,7);return n<0&&(n+=4294967296),n}function E(e,t){var n=r(e,t,14)^r(e,t,18)^r(t,e,9);return n<0&&(n+=4294967296),n}function S(e,t){var n=i(e,t,14)^i(e,t,18)^i(t,e,9);return n<0&&(n+=4294967296),n}function _(e,t){var n=r(e,t,1)^r(e,t,8)^o(e,t,7);return n<0&&(n+=4294967296),n}function O(e,t){var n=i(e,t,1)^i(e,t,8)^a(e,t,7);return n<0&&(n+=4294967296),n}function N(e,t){var n=r(e,t,19)^r(t,e,29)^o(e,t,6);return n<0&&(n+=4294967296),n}function k(e,t){var n=i(e,t,19)^i(t,e,29)^a(e,t,6);return n<0&&(n+=4294967296),n}return e.inherits(m,p),Oi=m,m.blockSize=1024,m.outSize=512,m.hmacStrength=192,m.padLength=128,m.prototype._prepareBlock=function(e,t){for(var n=this.W,r=0;r<32;r++)n[r]=e[t+r];for(;r<n.length;r+=2){var i=N(n[r-4],n[r-3]),o=k(n[r-4],n[r-3]),a=n[r-14],s=n[r-13],c=_(n[r-30],n[r-29]),u=O(n[r-30],n[r-29]),f=n[r-32],h=n[r-31];n[r]=l(i,o,a,s,c,u,f,h),n[r+1]=d(i,o,a,s,c,u,f,h)}},m.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,i=this.h[0],o=this.h[1],a=this.h[2],l=this.h[3],d=this.h[4],p=this.h[5],b=this.h[6],m=this.h[7],_=this.h[8],O=this.h[9],N=this.h[10],k=this.h[11],T=this.h[12],C=this.h[13],I=this.h[14],B=this.h[15];n(this.k.length===r.length);for(var L=0;L<r.length;L+=2){var M=I,R=B,P=E(_,O),U=S(_,O),j=g(_,O,N,k,T),F=v(_,O,N,k,T,C),D=this.k[L],z=this.k[L+1],$=r[L],W=r[L+1],X=f(M,R,P,U,j,F,D,z,$,W),q=h(M,R,P,U,j,F,D,z,$,W);M=x(i,o),R=A(i,o),P=y(i,o,a,l,d),U=w(i,o,a,l,d,p);var K=c(M,R,P,U),G=u(M,R,P,U);I=T,B=C,T=N,C=k,N=_,k=O,_=c(b,m,X,q),O=u(m,m,X,q),b=d,m=p,d=a,p=l,a=i,l=o,i=c(X,q,K,G),o=u(X,q,K,G)}s(this.h,0,i,o),s(this.h,2,a,l),s(this.h,4,d,p),s(this.h,6,b,m),s(this.h,8,_,O),s(this.h,10,N,k),s(this.h,12,T,C),s(this.h,14,I,B)},m.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},Oi}function Pi(){return Ci||(Ci=1,Ii.sha1=function(){if(xi)return wi;xi=1;var e=bi(),t=vi(),n=Li(),r=e.rotl32,i=e.sum32,o=e.sum32_5,a=n.ft_1,s=t.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function u(){if(!(this instanceof u))return new u;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return e.inherits(u,s),wi=u,u.blockSize=512,u.outSize=160,u.hmacStrength=80,u.padLength=64,u.prototype._update=function(e,t){for(var n=this.W,s=0;s<16;s++)n[s]=e[t+s];for(;s<n.length;s++)n[s]=r(n[s-3]^n[s-8]^n[s-14]^n[s-16],1);var u=this.h[0],l=this.h[1],d=this.h[2],f=this.h[3],h=this.h[4];for(s=0;s<n.length;s++){var p=~~(s/20),b=o(r(u,5),a(p,l,d,f),h,n[s],c[p]);h=f,f=d,d=r(l,30),l=u,u=b}this.h[0]=i(this.h[0],u),this.h[1]=i(this.h[1],l),this.h[2]=i(this.h[2],d),this.h[3]=i(this.h[3],f),this.h[4]=i(this.h[4],h)},u.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},wi}(),Ii.sha224=function(){if(_i)return Si;_i=1;var e=bi(),t=Mi();function n(){if(!(this instanceof n))return new n;t.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return e.inherits(n,t),Si=n,n.blockSize=512,n.outSize=224,n.hmacStrength=192,n.padLength=64,n.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,7),"big"):e.split32(this.h.slice(0,7),"big")},Si}(),Ii.sha256=Mi(),Ii.sha384=function(){if(Ti)return ki;Ti=1;var e=bi(),t=Ri();function n(){if(!(this instanceof n))return new n;t.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return e.inherits(n,t),ki=n,n.blockSize=1024,n.outSize=384,n.hmacStrength=192,n.padLength=128,n.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,12),"big"):e.split32(this.h.slice(0,12),"big")},ki}(),Ii.sha512=Ri()),Ii}var Ui,ji,Fi,Di,zi,$i,Wi,Xi,qi,Ki,Gi,Hi,Vi,Yi,Ji,Zi,Qi,eo,to,no,ro,io,oo,ao,so,co,uo,lo,fo={};function ho(){return Di||(Di=1,function(e){var t=e;t.utils=bi(),t.common=vi(),t.sha=Pi(),t.ripemd=function(){if(Ui)return fo;Ui=1;var e=bi(),t=vi(),n=e.rotl32,r=e.sum32,i=e.sum32_3,o=e.sum32_4,a=t.BlockHash;function s(){if(!(this instanceof s))return new s;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function u(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function l(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}e.inherits(s,a),fo.ripemd160=s,s.blockSize=512,s.outSize=160,s.hmacStrength=192,s.padLength=64,s.prototype._update=function(e,t){for(var a=this.h[0],s=this.h[1],b=this.h[2],m=this.h[3],g=this.h[4],v=a,y=s,w=b,x=m,A=g,E=0;E<80;E++){var S=r(n(o(a,c(E,s,b,m),e[d[E]+t],u(E)),h[E]),g);a=g,g=m,m=n(b,10),b=s,s=S,S=r(n(o(v,c(79-E,y,w,x),e[f[E]+t],l(E)),p[E]),A),v=A,A=x,x=n(w,10),w=y,y=S}S=i(this.h[1],b,x),this.h[1]=i(this.h[2],m,A),this.h[2]=i(this.h[3],g,v),this.h[3]=i(this.h[4],a,y),this.h[4]=i(this.h[0],s,w),this.h[0]=S},s.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"little"):e.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],f=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return fo}(),t.hmac=function(){if(Fi)return ji;Fi=1;var e=bi(),t=zr();function n(t,r,i){if(!(this instanceof n))return new n(t,r,i);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(e.toArray(r,i))}return ji=n,n.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),t(e.length<=this.blockSize);for(var n=e.length;n<this.blockSize;n++)e.push(0);for(n=0;n<e.length;n++)e[n]^=54;for(this.inner=(new this.Hash).update(e),n=0;n<e.length;n++)e[n]^=106;this.outer=(new this.Hash).update(e)},n.prototype.update=function(e,t){return this.inner.update(e,t),this},n.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},ji}(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}(hi)),hi}function po(){return Wi||(Wi=1,function(e){var t,n=e,r=ho(),i=li(),o=Kr().assert;function a(e){"short"===e.type?this.curve=new i.short(e):"edwards"===e.type?this.curve=new i.edwards(e):this.curve=new i.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new a(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=a,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=$i?zi:($i=1,zi={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}catch(e){t=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}(fi)),fi}function bo(){if(Ji)return Yi;Ji=1;var e=Dr(),t=function(){if(qi)return Xi;qi=1;var e=ho(),t=qr(),n=zr();function r(e){if(!(this instanceof r))return new r(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var i=t.toArray(e.entropy,e.entropyEnc||"hex"),o=t.toArray(e.nonce,e.nonceEnc||"hex"),a=t.toArray(e.pers,e.persEnc||"hex");n(i.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(i,o,a)}return Xi=r,r.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},r.prototype._hmac=function(){return new e.hmac(this.hash,this.K)},r.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},r.prototype.reseed=function(e,r,i,o){"string"!=typeof r&&(o=i,i=r,r=null),e=t.toArray(e,r),i=t.toArray(i,o),n(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},r.prototype.generate=function(e,n,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof n&&(i=r,r=n,n=null),r&&(r=t.toArray(r,i||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,e);return this._update(r),this._reseed++,t.encode(a,n)},Xi}(),n=Kr(),r=po(),i=Vr(),o=n.assert,a=function(){if(Gi)return Ki;Gi=1;var e=Dr(),t=Kr().assert;function n(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}return Ki=n,n.fromPublic=function(e,t,r){return t instanceof n?t:new n(e,{pub:t,pubEnc:r})},n.fromPrivate=function(e,t,r){return t instanceof n?t:new n(e,{priv:t,privEnc:r})},n.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},n.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},n.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},n.prototype._importPrivate=function(t,n){this.priv=new e(t,n||16),this.priv=this.priv.umod(this.ec.curve.n)},n.prototype._importPublic=function(e,n){if(e.x||e.y)return"mont"===this.ec.curve.type?t(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||t(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,n)},n.prototype.derive=function(e){return e.validate()||t(e.validate(),"public point not validated"),e.mul(this.priv).getX()},n.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)},n.prototype.verify=function(e,t,n){return this.ec.verify(e,t,this,void 0,n)},n.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},Ki}(),s=function(){if(Vi)return Hi;Vi=1;var e=Dr(),t=Kr(),n=t.assert;function r(t,i){if(t instanceof r)return t;this._importDER(t,i)||(n(t.r&&t.s,"Signature without r or s"),this.r=new e(t.r,16),this.s=new e(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function i(){this.place=0}function o(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;if(0===e[t.place])return!1;for(var i=0,o=0,a=t.place;o<r;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function a(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t<n;)t++;return 0===t?e:e.slice(t)}function s(e,t){if(t<128)e.push(t);else{var n=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}return Hi=r,r.prototype._importDER=function(n,r){n=t.toArray(n,r);var a=new i;if(48!==n[a.place++])return!1;var s=o(n,a);if(!1===s)return!1;if(s+a.place!==n.length)return!1;if(2!==n[a.place++])return!1;var c=o(n,a);if(!1===c)return!1;if(128&n[a.place])return!1;var u=n.slice(a.place,c+a.place);if(a.place+=c,2!==n[a.place++])return!1;var l=o(n,a);if(!1===l)return!1;if(n.length!==l+a.place)return!1;if(128&n[a.place])return!1;var d=n.slice(a.place,l+a.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new e(u),this.s=new e(d),this.recoveryParam=null,!0},r.prototype.toDER=function(e){var n=this.r.toArray(),r=this.s.toArray();for(128&n[0]&&(n=[0].concat(n)),128&r[0]&&(r=[0].concat(r)),n=a(n),r=a(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];s(i,n.length),(i=i.concat(n)).push(2),s(i,r.length);var o=i.concat(r),c=[48];return s(c,o.length),c=c.concat(o),t.encode(c,e)},Hi}();function c(e){if(!(this instanceof c))return new c(e);"string"==typeof e&&(o(Object.prototype.hasOwnProperty.call(r,e),"Unknown curve "+e),e=r[e]),e instanceof r.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}return Yi=c,c.prototype.keyPair=function(e){return new a(this,e)},c.prototype.keyFromPrivate=function(e,t){return a.fromPrivate(this,e,t)},c.prototype.keyFromPublic=function(e,t){return a.fromPublic(this,e,t)},c.prototype.genKeyPair=function(n){n||(n={});for(var r=new t({hash:this.hash,pers:n.pers,persEnc:n.persEnc||"utf8",entropy:n.entropy||i(this.hash.hmacStrength),entropyEnc:n.entropy&&n.entropyEnc||"utf8",nonce:this.n.toArray()}),o=this.n.byteLength(),a=this.n.sub(new e(2));;){var s=new e(r.generate(o));if(!(s.cmp(a)>0))return s.iaddn(1),this.keyFromPrivate(s)}},c.prototype._truncateToN=function(t,n,r){var i;if(e.isBN(t)||"number"==typeof t)i=(t=new e(t,16)).byteLength();else if("object"==typeof t)i=t.length,t=new e(t,16);else{var o=t.toString();i=o.length+1>>>1,t=new e(o,16)}"number"!=typeof r&&(r=8*i);var a=r-this.n.bitLength();return a>0&&(t=t.ushrn(a)),!n&&t.cmp(this.n)>=0?t.sub(this.n):t},c.prototype.sign=function(n,r,i,a){if("object"==typeof i&&(a=i,i=null),a||(a={}),"string"!=typeof n&&"number"!=typeof n&&!e.isBN(n)){o("object"==typeof n&&n&&"number"==typeof n.length,"Expected message to be an array-like, a hex string, or a BN instance"),o(n.length>>>0===n.length);for(var c=0;c<n.length;c++)o((255&n[c])===n[c])}r=this.keyFromPrivate(r,i),n=this._truncateToN(n,!1,a.msgBitLength),o(!n.isNeg(),"Can not sign a negative message");var u=this.n.byteLength(),l=r.getPrivate().toArray("be",u),d=n.toArray("be",u);o(new e(d).eq(n),"Can not sign message");for(var f=new t({hash:this.hash,entropy:l,nonce:d,pers:a.pers,persEnc:a.persEnc||"utf8"}),h=this.n.sub(new e(1)),p=0;;p++){var b=a.k?a.k(p):new e(f.generate(this.n.byteLength()));if(!((b=this._truncateToN(b,!0)).cmpn(1)<=0||b.cmp(h)>=0)){var m=this.g.mul(b);if(!m.isInfinity()){var g=m.getX(),v=g.umod(this.n);if(0!==v.cmpn(0)){var y=b.invm(this.n).mul(v.mul(r.getPrivate()).iadd(n));if(0!==(y=y.umod(this.n)).cmpn(0)){var w=(m.getY().isOdd()?1:0)|(0!==g.cmp(v)?2:0);return a.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),w^=1),new s({r:v,s:y,recoveryParam:w})}}}}}},c.prototype.verify=function(e,t,n,r,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),n=this.keyFromPublic(n,r);var o=(t=new s(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c,u=a.invm(this.n),l=u.mul(e).umod(this.n),d=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(c=this.g.jmulAdd(l,n.getPublic(),d)).isInfinity()&&c.eqXToP(o):!(c=this.g.mulAdd(l,n.getPublic(),d)).isInfinity()&&0===c.getX().umod(this.n).cmp(o)},c.prototype.recoverPubKey=function(t,n,r,i){o((3&r)===r,"The recovery param is more than two bits"),n=new s(n,i);var a=this.n,c=new e(t),u=n.r,l=n.s,d=1&r,f=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");u=f?this.curve.pointFromX(u.add(this.curve.n),d):this.curve.pointFromX(u,d);var h=n.r.invm(a),p=a.sub(c).mul(h).umod(a),b=l.mul(h).umod(a);return this.g.mulAdd(p,u,b)},c.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new s(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")},Yi}function mo(){if(ro)return no;ro=1;var e=ho(),t=po(),n=Kr(),r=n.assert,i=n.parseBytes,o=function(){if(Qi)return Zi;Qi=1;var e=Kr(),t=e.assert,n=e.parseBytes,r=e.cachedProperty;function i(e,t){this.eddsa=e,this._secret=n(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=n(t.pub)}return i.fromPublic=function(e,t){return t instanceof i?t:new i(e,{pub:t})},i.fromSecret=function(e,t){return t instanceof i?t:new i(e,{secret:t})},i.prototype.secret=function(){return this._secret},r(i,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),r(i,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),r(i,"privBytes",function(){var e=this.eddsa,t=this.hash(),n=e.encodingLength-1,r=t.slice(0,e.encodingLength);return r[0]&=248,r[n]&=127,r[n]|=64,r}),r(i,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),r(i,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),r(i,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),i.prototype.sign=function(e){return t(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},i.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},i.prototype.getSecret=function(n){return t(this._secret,"KeyPair is public only"),e.encode(this.secret(),n)},i.prototype.getPublic=function(t){return e.encode(this.pubBytes(),t)},Zi=i}(),a=function(){if(to)return eo;to=1;var e=Dr(),t=Kr(),n=t.assert,r=t.cachedProperty,i=t.parseBytes;function o(t,r){this.eddsa=t,"object"!=typeof r&&(r=i(r)),Array.isArray(r)&&(n(r.length===2*t.encodingLength,"Signature has invalid size"),r={R:r.slice(0,t.encodingLength),S:r.slice(t.encodingLength)}),n(r.R&&r.S,"Signature without R or S"),t.isPoint(r.R)&&(this._R=r.R),r.S instanceof e&&(this._S=r.S),this._Rencoded=Array.isArray(r.R)?r.R:r.Rencoded,this._Sencoded=Array.isArray(r.S)?r.S:r.Sencoded}return r(o,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),r(o,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),r(o,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),r(o,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),o.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},o.prototype.toHex=function(){return t.encode(this.toBytes(),"hex").toUpperCase()},eo=o}();function s(n){if(r("ed25519"===n,"only tested with ed25519 so far"),!(this instanceof s))return new s(n);n=t[n].curve,this.curve=n,this.g=n.g,this.g.precompute(n.n.bitLength()+1),this.pointClass=n.point().constructor,this.encodingLength=Math.ceil(n.n.bitLength()/8),this.hash=e.sha512}return no=s,s.prototype.sign=function(e,t){e=i(e);var n=this.keyFromSecret(t),r=this.hashInt(n.messagePrefix(),e),o=this.g.mul(r),a=this.encodePoint(o),s=this.hashInt(a,n.pubBytes(),e).mul(n.priv()),c=r.add(s).umod(this.curve.n);return this.makeSignature({R:o,S:c,Rencoded:a})},s.prototype.verify=function(e,t,n){if(e=i(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var r=this.keyFromPublic(n),o=this.hashInt(t.Rencoded(),r.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(r.pub().mul(o)).eq(a)},s.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return n.intFromLE(e.digest()).umod(this.curve.n)},s.prototype.keyFromPublic=function(e){return o.fromPublic(this,e)},s.prototype.keyFromSecret=function(e){return o.fromSecret(this,e)},s.prototype.makeSignature=function(e){return e instanceof a?e:new a(this,e)},s.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},s.prototype.decodePoint=function(e){var t=(e=n.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),i=!!(128&e[t]),o=n.intFromLE(r);return this.curve.pointFromY(o,i)},s.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},s.prototype.decodeInt=function(e){return n.intFromLE(e)},s.prototype.isPoint=function(e){return e instanceof this.pointClass},no}function go(){if(ao)return oo;ao=1;const e=(io||(io=1,function(){var e=Rr;e.version=Pr,e.utils=Kr(),e.rand=Vr(),e.curve=li(),e.curves=po(),e.ec=bo(),e.eddsa=mo()}()),Rr).ec,t=new e("secp256k1"),n=t.curve,r=n.n.constructor;function i(e){const i=e[0];switch(i){case 2:case 3:return 33!==e.length?null:function(e,i){let o=new r(i);if(o.cmp(n.p)>=0)return null;o=o.toRed(n.red);let a=o.redSqr().redIMul(o).redIAdd(n.b).redSqrt();3===e!==a.isOdd()&&(a=a.redNeg());const s=o.redSqr().redIMul(o);return a.redSqr().redISub(s.redIAdd(n.b)).isZero()?t.keyPair({pub:{x:o,y:a}}):null}(i,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,i,o){let a=new r(i),s=new r(o);if(a.cmp(n.p)>=0||s.cmp(n.p)>=0)return null;if(a=a.toRed(n.red),s=s.toRed(n.red),(6===e||7===e)&&s.isOdd()!==(7===e))return null;const c=a.redSqr().redIMul(a);return s.redSqr().redISub(c.redIAdd(n.b)).isZero()?t.keyPair({pub:{x:a,y:s}}):null}(i,e.subarray(1,33),e.subarray(33,65));default:return null}}function o(e,t){const n=t.encode(null,33===e.length);for(let t=0;t<e.length;++t)e[t]=n[t]}return oo={contextRandomize:()=>0,privateKeyVerify(e){const t=new r(e);return t.cmp(n.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new r(e),i=n.n.sub(t).umod(n.n).toArrayLike(Uint8Array,"be",32);return e.set(i),0},privateKeyTweakAdd(e,t){const i=new r(t);if(i.cmp(n.n)>=0)return 1;if(i.iadd(new r(e)),i.cmp(n.n)>=0&&i.isub(n.n),i.isZero())return 1;const o=i.toArrayLike(Uint8Array,"be",32);return e.set(o),0},privateKeyTweakMul(e,t){let i=new r(t);if(i.cmp(n.n)>=0||i.isZero())return 1;i.imul(new r(e)),i.cmp(n.n)>=0&&(i=i.umod(n.n));const o=i.toArrayLike(Uint8Array,"be",32);return e.set(o),0},publicKeyVerify:e=>null===i(e)?1:0,publicKeyCreate(e,i){const a=new r(i);if(a.cmp(n.n)>=0||a.isZero())return 1;return o(e,t.keyFromPrivate(i).getPublic()),0},publicKeyConvert(e,t){const n=i(t);if(null===n)return 1;return o(e,n.getPublic()),0},publicKeyNegate(e,t){const n=i(t);if(null===n)return 1;const r=n.getPublic();return r.y=r.y.redNeg(),o(e,r),0},publicKeyCombine(e,t){const n=new Array(t.length);for(let e=0;e<t.length;++e)if(n[e]=i(t[e]),null===n[e])return 1;let r=n[0].getPublic();for(let e=1;e<n.length;++e)r=r.add(n[e].pub);return r.isInfinity()?2:(o(e,r),0)},publicKeyTweakAdd(e,t,a){const s=i(t);if(null===s)return 1;if((a=new r(a)).cmp(n.n)>=0)return 2;const c=s.getPublic().add(n.g.mul(a));return c.isInfinity()?2:(o(e,c),0)},publicKeyTweakMul(e,t,a){const s=i(t);if(null===s)return 1;if((a=new r(a)).cmp(n.n)>=0||a.isZero())return 2;return o(e,s.getPublic().mul(a)),0},signatureNormalize(e){const i=new r(e.subarray(0,32)),o=new r(e.subarray(32,64));return i.cmp(n.n)>=0||o.cmp(n.n)>=0?1:(1===o.cmp(t.nh)&&e.set(n.n.sub(o).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const i=t.subarray(0,32),o=t.subarray(32,64);if(new r(i).cmp(n.n)>=0)return 1;if(new r(o).cmp(n.n)>=0)return 1;const{output:a}=e;let s=a.subarray(4,37);s[0]=0,s.set(i,1);let c=33,u=0;for(;c>1&&0===s[u]&&!(128&s[u+1]);--c,++u);if(s=s.subarray(u),128&s[0])return 1;if(c>1&&0===s[0]&&!(128&s[1]))return 1;let l=a.subarray(39,72);l[0]=0,l.set(o,1);let d=33,f=0;for(;d>1&&0===l[f]&&!(128&l[f+1]);--d,++f);return l=l.subarray(f),128&l[0]||d>1&&0===l[0]&&!(128&l[1])?1:(e.outputlen=6+c+d,a[0]=48,a[1]=e.outputlen-2,a[2]=2,a[3]=s.length,a.set(s,4),a[4+c]=2,a[5+c]=l.length,a.set(l,6+c),0)},signatureImport(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;const i=t[3];if(0===i)return 1;if(5+i>=t.length)return 1;if(2!==t[4+i])return 1;const o=t[5+i];if(0===o)return 1;if(6+i+o!==t.length)return 1;if(128&t[4])return 1;if(i>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[i+6])return 1;if(o>1&&0===t[i+6]&&!(128&t[i+7]))return 1;let a=t.subarray(4,4+i);if(33===a.length&&0===a[0]&&(a=a.subarray(1)),a.length>32)return 1;let s=t.subarray(6+i);if(33===s.length&&0===s[0]&&(s=s.slice(1)),s.length>32)throw new Error("S length is too long");let c=new r(a);c.cmp(n.n)>=0&&(c=new r(0));let u=new r(t.subarray(6+i));return u.cmp(n.n)>=0&&(u=new r(0)),e.set(c.toArrayLike(Uint8Array,"be",32),0),e.set(u.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,i,o,a,s){if(s){const e=s;s=t=>{const n=e(i,o,null,a,t);if(!(n instanceof Uint8Array&&32===n.length))throw new Error("This is the way");return new r(n)}}const c=new r(o);if(c.cmp(n.n)>=0||c.isZero())return 1;let u;try{u=t.sign(i,o,{canonical:!0,k:s,pers:a})}catch(e){return 1}return e.signature.set(u.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(u.s.toArrayLike(Uint8Array,"be",32),32),e.recid=u.recoveryParam,0},ecdsaVerify(e,o,a){const s={r:e.subarray(0,32),s:e.subarray(32,64)},c=new r(s.r),u=new r(s.s);if(c.cmp(n.n)>=0||u.cmp(n.n)>=0)return 1;if(1===u.cmp(t.nh)||c.isZero()||u.isZero())return 3;const l=i(a);if(null===l)return 2;const d=l.getPublic();return t.verify(o,s,d)?0:3},ecdsaRecover(e,i,a,s){const c={r:i.slice(0,32),s:i.slice(32,64)},u=new r(c.r),l=new r(c.s);if(u.cmp(n.n)>=0||l.cmp(n.n)>=0)return 1;if(u.isZero()||l.isZero())return 2;let d;try{d=t.recoverPubKey(s,c,a)}catch(e){return 2}return o(e,d),0},ecdh(e,o,a,s,c,u,l){const d=i(o);if(null===d)return 1;const f=new r(a);if(f.cmp(n.n)>=0||f.isZero())return 2;const h=d.getPublic().mul(f);if(void 0===c){const n=h.encode(null,!0),r=t.hash().update(n).digest();for(let t=0;t<32;++t)e[t]=r[t]}else{u||(u=new Uint8Array(32));const t=h.getX().toArray("be",32);for(let e=0;e<32;++e)u[e]=t[e];l||(l=new Uint8Array(32));const n=h.getY().toArray("be",32);for(let e=0;e<32;++e)l[e]=n[e];const r=c(u,l,s);if(!(r instanceof Uint8Array&&r.length===e.length))return 2;e.set(r)}return 0}},oo}function vo(){return co||(co=1,so=function(){if(Cr)return Tr;Cr=1;const e="Impossible case. Please create issue.",t="The tweak was out of range or the resulted private key is invalid",n="The tweak was out of range or equal to zero",r="Unknow error on context randomization",i="Private Key is invalid",o="Public Key could not be parsed",a="Public Key serialization error",s="The sum of the public keys is not valid",c="Signature could not be parsed",u="The nonce generation function failed, or the private key was invalid",l="Public key could not be recover",d="Scalar was invalid (zero or overflow)";function f(e,t){if(!e)throw new Error(t)}function h(e,t,n){if(f(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==n)if(Array.isArray(n)){const r=`Expected ${e} to be an Uint8Array with length [${n.join(", ")}]`;f(n.includes(t.length),r)}else{const r=`Expected ${e} to be an Uint8Array with length ${n}`;f(t.length===n,r)}}function p(e){f("Boolean"===m(e),"Expected compressed to be a Boolean")}function b(e=e=>new Uint8Array(e),t){return"function"==typeof e&&(e=e(t)),h("output",e,t),e}function m(e){return Object.prototype.toString.call(e).slice(8,-1)}return Tr=g=>({contextRandomize(e){if(f(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&h("seed",e,32),1===g.contextRandomize(e))throw new Error(r)},privateKeyVerify:e=>(h("private key",e,32),0===g.privateKeyVerify(e)),privateKeyNegate(t){switch(h("private key",t,32),g.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(e)}},privateKeyTweakAdd(e,n){switch(h("private key",e,32),h("tweak",n,32),g.privateKeyTweakAdd(e,n)){case 0:return e;case 1:throw new Error(t)}},privateKeyTweakMul(e,t){switch(h("private key",e,32),h("tweak",t,32),g.privateKeyTweakMul(e,t)){case 0:return e;case 1:throw new Error(n)}},publicKeyVerify:e=>(h("public key",e,[33,65]),0===g.publicKeyVerify(e)),publicKeyCreate(e,t=!0,n){switch(h("private key",e,32),p(t),n=b(n,t?33:65),g.publicKeyCreate(n,e)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error(a)}},publicKeyConvert(e,t=!0,n){switch(h("public key",e,[33,65]),p(t),n=b(n,t?33:65),g.publicKeyConvert(n,e)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(a)}},publicKeyNegate(t,n=!0,r){switch(h("public key",t,[33,65]),p(n),r=b(r,n?33:65),g.publicKeyNegate(r,t)){case 0:return r;case 1:throw new Error(o);case 2:throw new Error(e);case 3:throw new Error(a)}},publicKeyCombine(e,t=!0,n){f(Array.isArray(e),"Expected public keys to be an Array"),f(e.length>0,"Expected public keys array will have more than zero items");for(const t of e)h("public key",t,[33,65]);switch(p(t),n=b(n,t?33:65),g.publicKeyCombine(n,e)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(s);case 3:throw new Error(a)}},publicKeyTweakAdd(e,n,r=!0,i){switch(h("public key",e,[33,65]),h("tweak",n,32),p(r),i=b(i,r?33:65),g.publicKeyTweakAdd(i,e,n)){case 0:return i;case 1:throw new Error(o);case 2:throw new Error(t)}},publicKeyTweakMul(e,t,r=!0,i){switch(h("public key",e,[33,65]),h("tweak",t,32),p(r),i=b(i,r?33:65),g.publicKeyTweakMul(i,e,t)){case 0:return i;case 1:throw new Error(o);case 2:throw new Error(n)}},signatureNormalize(e){switch(h("signature",e,64),g.signatureNormalize(e)){case 0:return e;case 1:throw new Error(c)}},signatureExport(t,n){h("signature",t,64);const r={output:n=b(n,72),outputlen:72};switch(g.signatureExport(r,t)){case 0:return n.slice(0,r.outputlen);case 1:throw new Error(c);case 2:throw new Error(e)}},signatureImport(t,n){switch(h("signature",t),n=b(n,64),g.signatureImport(n,t)){case 0:return n;case 1:throw new Error(c);case 2:throw new Error(e)}},ecdsaSign(t,n,r={},i){h("message",t,32),h("private key",n,32),f("Object"===m(r),"Expected options to be an Object"),void 0!==r.data&&h("options.data",r.data),void 0!==r.noncefn&&f("Function"===m(r.noncefn),"Expected options.noncefn to be a Function");const o={signature:i=b(i,64),recid:null};switch(g.ecdsaSign(o,t,n,r.data,r.noncefn)){case 0:return o;case 1:throw new Error(u);case 2:throw new Error(e)}},ecdsaVerify(e,t,n){switch(h("signature",e,64),h("message",t,32),h("public key",n,[33,65]),g.ecdsaVerify(e,t,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(c);case 2:throw new Error(o)}},ecdsaRecover(t,n,r,i=!0,o){switch(h("signature",t,64),f("Number"===m(n)&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),h("message",r,32),p(i),o=b(o,i?33:65),g.ecdsaRecover(o,t,n,r)){case 0:return o;case 1:throw new Error(c);case 2:throw new Error(l);case 3:throw new Error(e)}},ecdh(e,t,n={},r){switch(h("public key",e,[33,65]),h("private key",t,32),f("Object"===m(n),"Expected options to be an Object"),void 0!==n.data&&h("options.data",n.data),void 0!==n.hashfn?(f("Function"===m(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&h("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&h("options.ybuf",n.ybuf,32),h("output",r)):r=b(r,32),g.ecdh(r,e,t,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return r;case 1:throw new Error(o);case 2:throw new Error(d)}}}),Tr}()(go())),so}function yo(){if(uo)return Ir;uo=1;var e=Ir&&Ir.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.PublicKey=void 0;const t=In(),n=br(),r=e(vo()),i=vt();class o{constructor(e){if(1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}class a extends o{enum;ed25519Key;secp256k1Key;constructor(e){const t=function(e){switch(e){case i.KeyType.ED25519:return"ed25519Key";case i.KeyType.SECP256K1:return"secp256k1Key";default:throw Error(`unknown type ${e}`)}}(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}static from(e){return"string"==typeof e?a.fromString(e):e}static fromString(e){const n=e.split(":");let r,o;if(1===n.length)r=n[0];else{if(2!==n.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");r=n[1],o=function(e){switch(e.toLowerCase()){case"ed25519":return i.KeyType.ED25519;case"secp256k1":return i.KeyType.SECP256K1;default:throw new Error(`Unknown key type ${e}`)}}(n[0])}const s=(0,t.baseDecode)(r);o||(o=s.length===i.KeySize.SECP256k1_PUBLIC_KEY?i.KeyType.SECP256K1:i.KeyType.ED25519);const c=o===i.KeyType.ED25519?i.KeySize.ED25519_PUBLIC_KEY:i.KeySize.SECP256k1_PUBLIC_KEY;if(s.length!==c)throw new Error(`Invalid public key size (${s.length}), must be ${c}`);return new a({keyType:o,data:s})}toString(){const e=(0,t.baseEncode)(this.data);return`${function(e){switch(e){case i.KeyType.ED25519:return"ed25519";case i.KeyType.SECP256K1:return"secp256k1";default:throw new Error(`Unknown key type ${e}`)}}(this.keyType)}:${e}`}verify(e,t){const o=this.keyType,a=this.data;switch(o){case i.KeyType.ED25519:return n.ed25519.verify(t,e,a);case i.KeyType.SECP256K1:return r.default.ecdsaVerify(t.subarray(0,64),e,new Uint8Array([4,...a]));default:throw new Error(`Unknown key type: ${o}`)}}get keyPair(){return this.ed25519Key||this.secp256k1Key}get keyType(){return this.keyPair.keyType}get data(){return this.keyPair.data}}return Ir.PublicKey=a,Ir}function wo(){if(lo)return St;lo=1;var e=St&&St.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(St,"__esModule",{value:!0}),St.KeyPairEd25519=void 0;const t=In(),n=br(),r=e(kr()),i=vt(),o=At(),a=yo();class s extends o.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();const r=(0,t.baseDecode)(e),o=new Uint8Array(r.slice(0,i.KeySize.SECRET_KEY)),s=n.ed25519.getPublicKey(new Uint8Array(o));this.publicKey=new a.PublicKey({keyType:i.KeyType.ED25519,data:s}),this.secretKey=(0,t.baseEncode)(o),this.extendedSecretKey=e}static fromRandom(){const e=(0,r.default)(i.KeySize.SECRET_KEY),o=n.ed25519.getPublicKey(new Uint8Array(e)),a=new Uint8Array([...e,...o]);return new s((0,t.baseEncode)(a))}sign(e){return{signature:n.ed25519.sign(e,(0,t.baseDecode)(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return St.KeyPairEd25519=s,St}var xo,Ao,Eo,So,_o={};function Oo(){if(xo)return _o;xo=1;var e=_o&&_o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_o,"__esModule",{value:!0}),_o.KeyPairSecp256k1=void 0;const t=In(),n=e(kr()),r=e(vo()),i=vt(),o=At(),a=yo();class s extends o.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();const n=(0,t.baseDecode)(e),o=new Uint8Array(n.slice(0,i.KeySize.SECRET_KEY)),s=r.default.publicKeyCreate(new Uint8Array(o),!1),c=s.subarray(1,s.length);this.publicKey=new a.PublicKey({keyType:i.KeyType.SECP256K1,data:c}),this.secretKey=(0,t.baseEncode)(o),this.extendedSecretKey=e}static fromRandom(){const e=(0,n.default)(i.KeySize.SECRET_KEY),o=r.default.publicKeyCreate(new Uint8Array(e),!1),a=o.subarray(1,o.length),c=new Uint8Array([...e,...a]);return new s((0,t.baseEncode)(c))}sign(e){const{signature:n,recid:i}=r.default.ecdsaSign(e,(0,t.baseDecode)(this.secretKey));return{signature:new Uint8Array([...n,i]),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`secp256k1:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}return _o.KeyPairSecp256k1=s,_o}function No(){return Eo||(Eo=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PublicKey=e.KeyPairSecp256k1=e.KeyPairEd25519=e.KeyPair=e.KeyType=void 0;var t=vt();Object.defineProperty(e,"KeyType",{enumerable:!0,get:function(){return t.KeyType}});var n=function(){if(Ao)return wt;Ao=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.KeyPair=void 0;const e=At(),t=wo(),n=Oo();class r extends e.KeyPairBase{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return t.KeyPairEd25519.fromRandom();case"SECP256K1":return n.KeyPairSecp256k1.fromRandom();default:throw new Error(`Unknown curve ${e}`)}}static fromString(e){const r=e.split(":");if(2!==r.length)throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");switch(r[0].toUpperCase()){case"ED25519":return new t.KeyPairEd25519(r[1]);case"SECP256K1":return new n.KeyPairSecp256k1(r[1]);default:throw new Error(`Unknown curve: ${r[0]}`)}}}return wt.KeyPair=r,wt}();Object.defineProperty(e,"KeyPair",{enumerable:!0,get:function(){return n.KeyPair}});var r=wo();Object.defineProperty(e,"KeyPairEd25519",{enumerable:!0,get:function(){return r.KeyPairEd25519}});var i=Oo();Object.defineProperty(e,"KeyPairSecp256k1",{enumerable:!0,get:function(){return i.KeyPairSecp256k1}});var o=yo();Object.defineProperty(e,"PublicKey",{enumerable:!0,get:function(){return o.PublicKey}})}(mt)),mt}function ko(){return So||(So=1,function(e){var t=Je&&Je.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=Je&&Je.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Je&&Je.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=Je&&Je.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.authPayloadSchema=e.AuthPayload=void 0,e.verifySignature=function(t,n){const r=new u(t),i=o.serialize(e.authPayloadSchema,r),s=Uint8Array.from(a.default.sha256.array(i));let l=new Uint8Array(Buffer.from(n.signature,"base64"));return c.PublicKey.from(n.publicKey).verify(s,l)};const o=r(function(){if(lt)return Ze;lt=1;var e=Ze&&Ze.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),t=Ze&&Ze.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=Ze&&Ze.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var i in n)"default"!==i&&Object.prototype.hasOwnProperty.call(n,i)&&e(r,n,i);return t(r,n),r};Ze.__esModule=!0,Ze.deserialize=Ze.serialize=void 0;var r=function(){if(at)return Qe;at=1;var e=Qe&&Qe.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),t=Qe&&Qe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=Qe&&Qe.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var i in n)"default"!==i&&Object.prototype.hasOwnProperty.call(n,i)&&e(r,n,i);return t(r,n),r};Qe.__esModule=!0,Qe.BorshSerializer=void 0;var r=tt(),i=it(),o=n(ct()),a=function(){function e(e){this.encoded=new i.EncodeBuffer,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(r.integers.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var n=parseInt(t.substring(1));n<=32||"f64"==t?(this.checkTypes&&o.expect_type(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&o.expect_bigint(e,this.fieldPath),this.encode_bigint(BigInt(e),n))},e.prototype.encode_bigint=function(e,t){for(var n=t/8,r=new Uint8Array(n),i=0;i<n;i++)r[i]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(r))},e.prototype.encode_string=function(e){this.checkTypes&&o.expect_type(e,"string",this.fieldPath);for(var t=e,n=[],r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?n.push(i):i<2048?n.push(192|i>>6,128|63&i):i<55296||i>=57344?n.push(224|i>>12,128|i>>6&63,128|63&i):(r++,i=65536+((1023&i)<<10|1023&t.charCodeAt(r)),n.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i))}this.encoded.store_value(n.length,"u32"),this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_boolean=function(e){this.checkTypes&&o.expect_type(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&o.expect_enum(e,this.fieldPath);for(var n=Object.keys(e)[0],r=0;r<t.enum.length;r++){var i=t.enum[r];if(n===Object.keys(i.struct)[0])return this.encoded.store_value(r,"u8"),this.encode_struct(e,i)}throw new Error("Enum key (".concat(n,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(o.isArrayLike(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw new Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?o.expect_same_size(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var n=0;n<e.length;n++)this.encode_value(e[n],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?o.expect_same_size(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);var n=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(n.length,"u32");for(var r=0,i=n;r<i.length;r++){var a=i[r];this.encode_value(a,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);var n=e instanceof Map,r=n?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(r.length,"u32");for(var i=0,a=r;i<a.length;i++){var s=a[i];this.encode_value(s,t.map.key),this.encode_value(n?e.get(s):e[s],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&o.expect_type(e,"object",this.fieldPath);for(var n=0,r=Object.keys(t.struct);n<r.length;n++){var i=r[n];this.fieldPath.push(i),this.encode_value(e[i],t.struct[i]),this.fieldPath.pop()}},e}();return Qe.BorshSerializer=a,Qe}(),i=function(){if(ut)return dt;ut=1,dt.__esModule=!0,dt.BorshDeserializer=void 0;var e=tt(),t=it(),n=function(){function n(e){this.buffer=new t.DecodeBuffer(e)}return n.prototype.decode=function(e){return this.decode_value(e)},n.prototype.decode_value=function(t){if("string"==typeof t){if(e.integers.includes(t))return this.decode_integer(t);if("string"===t)return this.decode_string();if("bool"===t)return this.decode_boolean()}if("object"==typeof t){if("option"in t)return this.decode_option(t);if("enum"in t)return this.decode_enum(t);if("array"in t)return this.decode_array(t);if("set"in t)return this.decode_set(t);if("map"in t)return this.decode_map(t);if("struct"in t)return this.decode_struct(t)}throw new Error("Unsupported type: ".concat(t))},n.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},n.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var n=e/8,r=new Uint8Array(this.buffer.consume_bytes(n)),i=r.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&r[n-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},n.prototype.decode_string=function(){for(var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e)),n=[],r=0;r<e;++r){var i=t[r];if(i<128)n.push(i);else if(i<224)n.push((31&i)<<6|63&t[++r]);else if(i<240)n.push((15&i)<<12|(63&t[++r])<<6|63&t[++r]);else{var o=(7&i)<<18|(63&t[++r])<<12|(63&t[++r])<<6|63&t[++r];n.push(o)}}return String.fromCodePoint.apply(String,n)},n.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},n.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw new Error("Invalid option ".concat(t));return null},n.prototype.decode_enum=function(e){var t,n=this.buffer.consume_value("u8");if(n>e.enum.length)throw new Error("Enum option ".concat(n," is not available"));var r=e.enum[n].struct,i=Object.keys(r)[0];return(t={})[i]=this.decode_value(r[i]),t},n.prototype.decode_array=function(e){for(var t=[],n=e.array.len?e.array.len:this.decode_integer("u32"),r=0;r<n;++r)t.push(this.decode_value(e.array.type));return t},n.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),n=new Set,r=0;r<t;++r)n.add(this.decode_value(e.set));return n},n.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),n=new Map,r=0;r<t;++r){var i=this.decode_value(e.map.key),o=this.decode_value(e.map.value);n.set(i,o)}return n},n.prototype.decode_struct=function(e){var t={};for(var n in e.struct)t[n]=this.decode_value(e.struct[n]);return t},n}();return dt.BorshDeserializer=n,dt}(),o=n(ct());return Ze.serialize=function(e,t,n){return void 0===n&&(n=!0),n&&o.validate_schema(e),new r.BorshSerializer(n).encode(t,e)},Ze.deserialize=function(e,t,n){return void 0===n&&(n=!0),n&&o.validate_schema(e),new i.BorshDeserializer(t).decode(e)},Ze}()),a=i((ft||(ft=1,s=ht,function(){var e="input is invalid type",t="object"==typeof window,n=t?window:{};n.JS_SHA256_NO_WINDOW&&(t=!1);var r=!t&&"object"==typeof self,i=!n.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&"renderer"!=process.type;i?n=Ke:r&&(n=self);var o=!n.JS_SHA256_NO_COMMON_JS&&s.exports,a=!n.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),u=[-2147483648,8388608,32768,128],l=[24,16,8,0],d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=["hex","array","digest","arrayBuffer"],h=[];!n.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!n.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var p=function(e,t){return function(n){return new y(t,!0).update(n)[e]()}},b=function(e){var t=p("hex",e);i&&(t=m(t,e)),t.create=function(){return new y(e)},t.update=function(e){return t.create().update(e)};for(var n=0;n<f.length;++n){var r=f[n];t[r]=p(r,e)}return t},m=function(t,r){var i,o=pt,a=pt.Buffer,s=r?"sha224":"sha256";return i=a.from&&!n.JS_SHA256_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(n){if("string"==typeof n)return o.createHash(s).update(n,"utf8").digest("hex");if(null==n)throw new Error(e);return n.constructor===ArrayBuffer&&(n=new Uint8Array(n)),Array.isArray(n)||ArrayBuffer.isView(n)||n.constructor===a?o.createHash(s).update(i(n)).digest("hex"):t(n)}},g=function(e,t){return function(n,r){return new w(n,t,!0).update(r)[e]()}},v=function(e){var t=g("hex",e);t.create=function(t){return new w(t,e)},t.update=function(e,n){return t.create(e).update(n)};for(var n=0;n<f.length;++n){var r=f[n];t[r]=g(r,e)}return t};function y(e,t){t?(h[0]=h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0,this.blocks=h):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function w(t,n,r){var i,o=typeof t;if("string"===o){var s,c=[],u=t.length,l=0;for(i=0;i<u;++i)(s=t.charCodeAt(i))<128?c[l++]=s:s<2048?(c[l++]=192|s>>>6,c[l++]=128|63&s):s<55296||s>=57344?(c[l++]=224|s>>>12,c[l++]=128|s>>>6&63,c[l++]=128|63&s):(s=65536+((1023&s)<<10|1023&t.charCodeAt(++i)),c[l++]=240|s>>>18,c[l++]=128|s>>>12&63,c[l++]=128|s>>>6&63,c[l++]=128|63&s);t=c}else{if("object"!==o)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e)}t.length>64&&(t=new y(n,!0).update(t).array());var d=[],f=[];for(i=0;i<64;++i){var h=t[i]||0;d[i]=92^h,f[i]=54^h}y.call(this,n,r),this.update(f),this.oKeyPad=d,this.inner=!0,this.sharedMemory=r}y.prototype.update=function(t){if(!this.finalized){var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}for(var i,o,s=0,c=t.length,u=this.blocks;s<c;){if(this.hashed&&(this.hashed=!1,u[0]=this.block,this.block=u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0),n)for(o=this.start;s<c&&o<64;++s)u[o>>>2]|=t[s]<<l[3&o++];else for(o=this.start;s<c&&o<64;++s)(i=t.charCodeAt(s))<128?u[o>>>2]|=i<<l[3&o++]:i<2048?(u[o>>>2]|=(192|i>>>6)<<l[3&o++],u[o>>>2]|=(128|63&i)<<l[3&o++]):i<55296||i>=57344?(u[o>>>2]|=(224|i>>>12)<<l[3&o++],u[o>>>2]|=(128|i>>>6&63)<<l[3&o++],u[o>>>2]|=(128|63&i)<<l[3&o++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++s)),u[o>>>2]|=(240|i>>>18)<<l[3&o++],u[o>>>2]|=(128|i>>>12&63)<<l[3&o++],u[o>>>2]|=(128|i>>>6&63)<<l[3&o++],u[o>>>2]|=(128|63&i)<<l[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=u[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},y.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=u[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},y.prototype.hash=function(){var e,t,n,r,i,o,a,s,c,u=this.h0,l=this.h1,f=this.h2,h=this.h3,p=this.h4,b=this.h5,m=this.h6,g=this.h7,v=this.blocks;for(e=16;e<64;++e)t=((i=v[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,n=((i=v[e-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,v[e]=v[e-16]+t+v[e-7]+n|0;for(c=l&f,e=0;e<64;e+=4)this.first?(this.is224?(o=300032,g=(i=v[0]-1413257819)-150054599|0,h=i+24177077|0):(o=704751109,g=(i=v[0]-210244248)-1521486534|0,h=i+143694565|0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),r=(o=u&l)^u&f^c,g=h+(i=g+(n=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&b^~p&m)+d[e]+v[e])|0,h=i+(t+r)|0),t=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),r=(a=h&u)^h&l^o,m=f+(i=m+(n=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&p^~g&b)+d[e+1]+v[e+1])|0,t=((f=i+(t+r)|0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),r=(s=f&h)^f&u^a,b=l+(i=b+(n=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&g^~m&p)+d[e+2]+v[e+2])|0,t=((l=i+(t+r)|0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),r=(c=l&f)^l&h^s,p=u+(i=p+(n=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7))+(b&m^~b&g)+d[e+3]+v[e+3])|0,u=i+(t+r)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+u|0,this.h1=this.h1+l|0,this.h2=this.h2+f|0,this.h3=this.h3+h|0,this.h4=this.h4+p|0,this.h5=this.h5+b|0,this.h6=this.h6+m|0,this.h7=this.h7+g|0},y.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,u=c[e>>>28&15]+c[e>>>24&15]+c[e>>>20&15]+c[e>>>16&15]+c[e>>>12&15]+c[e>>>8&15]+c[e>>>4&15]+c[15&e]+c[t>>>28&15]+c[t>>>24&15]+c[t>>>20&15]+c[t>>>16&15]+c[t>>>12&15]+c[t>>>8&15]+c[t>>>4&15]+c[15&t]+c[n>>>28&15]+c[n>>>24&15]+c[n>>>20&15]+c[n>>>16&15]+c[n>>>12&15]+c[n>>>8&15]+c[n>>>4&15]+c[15&n]+c[r>>>28&15]+c[r>>>24&15]+c[r>>>20&15]+c[r>>>16&15]+c[r>>>12&15]+c[r>>>8&15]+c[r>>>4&15]+c[15&r]+c[i>>>28&15]+c[i>>>24&15]+c[i>>>20&15]+c[i>>>16&15]+c[i>>>12&15]+c[i>>>8&15]+c[i>>>4&15]+c[15&i]+c[o>>>28&15]+c[o>>>24&15]+c[o>>>20&15]+c[o>>>16&15]+c[o>>>12&15]+c[o>>>8&15]+c[o>>>4&15]+c[15&o]+c[a>>>28&15]+c[a>>>24&15]+c[a>>>20&15]+c[a>>>16&15]+c[a>>>12&15]+c[a>>>8&15]+c[a>>>4&15]+c[15&a];return this.is224||(u+=c[s>>>28&15]+c[s>>>24&15]+c[s>>>20&15]+c[s>>>16&15]+c[s>>>12&15]+c[s>>>8&15]+c[s>>>4&15]+c[15&s]),u},y.prototype.toString=y.prototype.hex,y.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,c=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r,i>>>24&255,i>>>16&255,i>>>8&255,255&i,o>>>24&255,o>>>16&255,o>>>8&255,255&o,a>>>24&255,a>>>16&255,a>>>8&255,255&a];return this.is224||c.push(s>>>24&255,s>>>16&255,s>>>8&255,255&s),c},y.prototype.array=y.prototype.digest,y.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},w.prototype=new y,w.prototype.finalize=function(){if(y.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();y.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),y.prototype.finalize.call(this)}};var x=b();x.sha256=x,x.sha224=b(!0),x.sha256.hmac=v(),x.sha224.hmac=v(!0),o?s.exports=x:(n.sha256=x.sha256,n.sha224=x.sha224)}()),ht.exports));var s;const c=No();class u{message;recipient;nonce;callbackUrl;tag;constructor({message:e,nonce:t,recipient:n}){this.tag=2147484061,this.message=e,this.nonce=t,this.recipient=n}}e.AuthPayload=u,e.authPayloadSchema={struct:{tag:"u32",message:"string",nonce:{array:{type:"u8",len:32}},recipient:"string",callbackUrl:{option:"string"}}}}(Je)),Je}var To={};const Co=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function Io(e){return Co.test(e)}function Bo(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.split(/[:\/]/g).pop().toLowerCase()}Bo.valid=Io;var Lo,Mo,Ro,Po,Uo,jo,Fo,Do=He(Object.freeze({__proto__:null,default:Bo,uuid4:Bo,valid:Io})),zo={},$o={exports:{}},Wo={exports:{}};function Xo(){return Lo||(Lo=1,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&t.rotl(e,8)|4278255360&t.rotl(e,24);for(var n=0;n<e.length;n++)e[n]=t.endian(e[n]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(t){for(var n=[],r=0;r<t.length;r+=3)for(var i=t[r]<<16|t[r+1]<<8|t[r+2],o=0;o<4;o++)8*r+6*o<=8*t.length?n.push(e.charAt(i>>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r<t.length;i=++r%4)0!=i&&n.push((e.indexOf(t.charAt(r-1))&Math.pow(2,-2*i+8)-1)<<2*i|e.indexOf(t.charAt(r))>>>6-2*i);return n}},Wo.exports=t),Wo.exports;var e,t}function qo(){if(Ro)return Mo;Ro=1;var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}};return Mo=e}function Ko(){return Po||(Po=1,function(){var e=Xo(),t=qo().utf8,n=qo().bin,r=function(r,i){var o=e.wordsToBytes(function(n){n.constructor==String?n=t.stringToBytes(n):"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(n)?n=Array.prototype.slice.call(n,0):Array.isArray(n)||(n=n.toString());var r=e.bytesToWords(n),i=8*n.length,o=[],a=1732584193,s=-271733879,c=-1732584194,u=271733878,l=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var d=0;d<r.length;d+=16){for(var f=a,h=s,p=c,b=u,m=l,g=0;g<80;g++){if(g<16)o[g]=r[d+g];else{var v=o[g-3]^o[g-8]^o[g-14]^o[g-16];o[g]=v<<1|v>>>31}var y=(a<<5|a>>>27)+l+(o[g]>>>0)+(g<20?1518500249+(s&c|~s&u):g<40?1859775393+(s^c^u):g<60?(s&c|s&u|c&u)-1894007588:(s^c^u)-899497514);l=u,u=c,c=s<<30|s>>>2,s=a,a=y}a+=f,s+=h,c+=p,u+=b,l+=m}return[a,s,c,u,l]}(r));return i&&i.asBytes?o:i&&i.asString?n.bytesToString(o):e.bytesToHex(o)};r._blocksize=16,r._digestsize=20,$o.exports=r}()),$o.exports}function Go(){return jo||(jo=1,function(e){var t=To&&To.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.getExtension=e.RequestFailed=e.wait=void 0;const n=t(Do),r=In(),i=(Uo||(Uo=1,function(e){var t=zo&&zo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.createRequest=e.computeRequestId=e.deleteRequest=e.getResponse=e.proxyApi=void 0;const n=t(Ko()),r=t(Do),i=In();e.proxyApi="https://h4n.app",e.getResponse=async t=>{const n=await fetch(`${e.proxyApi}/${t}/response`,{headers:{"content-type":"application/json"},method:"GET"});if(!1===n.ok)throw Error(await n.text());const{data:r}=await n.json();return JSON.parse(r)},e.deleteRequest=async t=>{const n=await fetch(`${e.proxyApi}/${t}`,{headers:{"content-type":"application/json"},method:"DELETE"});if(!1===n.ok)throw Error(await n.text())},e.computeRequestId=async e=>{const t=(0,i.baseEncode)(JSON.stringify({...e,_id:(0,r.default)()})),o=(0,n.default)(t);return{requestId:Buffer.from(o,"hex").toString("base64").replaceAll("/","_").replaceAll("-","+").slice(0,13),query:t}},e.createRequest=async(t,n)=>{const{query:r,requestId:i}=await(0,e.computeRequestId)(t),o=await fetch(`${e.proxyApi}/${i}/request`,{body:JSON.stringify({data:r}),headers:{"content-type":"application/json"},method:"POST",signal:n});if(!1===o.ok)throw Error(await o.text());return i}}(zo)),zo);e.wait=e=>new Promise(t=>setTimeout(t,e));class o extends Error{payload;name="RequestFailed";constructor(e){super(),this.payload=e}}e.RequestFailed=o;let a;e.getExtension=()=>"undefined"==typeof window?null:window.hotExtension,"undefined"!=typeof window&&window.addEventListener("message",e=>{"hot-close"===e.data&&(a?.remove(),a=void 0)});e.default=new class{walletId="https://t.me/herewalletbot/app";ancestorOrigins=["http://localhost:1234","https://my.herewallet.app","https://tgapp-dev.herewallet.app","https://tgapp.herewallet.app","https://beta.herewallet.app"];connection=new Promise(e=>"undefined"==typeof window||window?.self===window?.top?e(null):void this.injectedRequest("initialized",{}).then(e).catch(()=>e(null)));get isInjected(){return"undefined"!=typeof window&&(null!=window.hotExtension?window.hotExtension.autoRun:this.ancestorOrigins.includes(window.location.ancestorOrigins?.[0]))}openInHotBrowserUrl=null;toggleOpenInHotBrowser(e){this.openInHotBrowserUrl=e}customProvider;setupEthProvider(e){this.customProvider=e}async injectedRequest(e,t){const r=(0,n.default)();return new Promise((n,i)=>{const o=e=>{if(e.data.id===r)return window?.removeEventListener("message",o),e.data.success?n(e.data.payload):i(e.data.payload)};window?.parent.postMessage({$hot:!0,method:e,request:t,id:r},"*"),window?.addEventListener("message",o)})}subscribe(e,t){return window.hotExtension?window.hotExtension.subscribe(e,t):()=>{}}async request(t,s){if(null!=window.hotExtension)return window.hotExtension.request(t,s);if(this.isInjected)return this.injectedRequest(t,s);const c=(0,n.default)(),u=window?.Telegram?.WebApp,l=await(0,i.createRequest)({inside:!!this.openInHotBrowserUrl||"ethereum"===t&&null==this.customProvider,origin:"string"==typeof this.openInHotBrowserUrl?this.openInHotBrowserUrl:location.href,$hot:!0,method:t,request:s,id:c}),d=`${this.walletId}?startapp=hotconnect-${(0,r.baseEncode)(l)}`;if(u)u?.openTelegramLink(d);else{(e=>{a?.remove(),a=document.createElement("div");const t=document.createElement("iframe");a?.appendChild(t),t.src=e,t.allow="usb",t.style.border="none",t.style.borderRadius="16px",t.style.background="#fff",t.style.overflow="hidden",t.style.background="#1D1F20",t.style.border="1px solid #2C3034",t.style.width="375px",t.style.height="560px",t.onclick=e=>e.stopPropagation(),a.style.padding="16px",a.style.zIndex="100000000000000",a.style.position="fixed",a.style.display="flex",a.style.justifyContent="center",a.style.alignItems="center",a.style.top="0",a.style.left="0",a.style.width="100%",a.style.height="100%",a.style.background="rgba(0, 0, 0, 0.1)",a.style.backdropFilter="blur(24px)",a.onclick=()=>{a?.remove(),a=void 0},document.body.appendChild(a)})(`${"https://hot-labs.org/hot-widget/index.html"}?hotconnect-${(0,r.baseEncode)(l)}`)}const f=async()=>{await(0,e.wait)(3e3);const t=await(0,i.getResponse)(l).catch(()=>null);if(null==t)return await f();if(t.success)return t.payload;throw new o(t.payload)},h=await f();return a?.remove(),h}}}(To)),To}var Ho,Vo=(Fo||(Fo=1,function(e){var t=Ye&&Ye.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.RequestFailed=e.HOT=e.authPayloadSchema=e.AuthPayload=e.verifySignature=void 0;var n=ko();Object.defineProperty(e,"verifySignature",{enumerable:!0,get:function(){return n.verifySignature}}),Object.defineProperty(e,"AuthPayload",{enumerable:!0,get:function(){return n.AuthPayload}}),Object.defineProperty(e,"authPayloadSchema",{enumerable:!0,get:function(){return n.authPayloadSchema}});var r=Go();Object.defineProperty(e,"HOT",{enumerable:!0,get:function(){return t(r).default}}),Object.defineProperty(e,"RequestFailed",{enumerable:!0,get:function(){return r.RequestFailed}})}(Ye)),Ye).HOT,Yo={name:H.Hot,website:"https://hot-labs.org/",authenticateWithSignedMessage:!0,connect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,Vo.request("stellar:getAddress",{})];case 1:return[2,e.sent().address];case 2:throw e.sent(),new Error("BLUX: Failed to connect to Hana wallet.");case 3:return[2]}})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2]})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: HotWallet does not support the getNetwork function")})})},isAvailable:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2,"undefined"!=typeof window&&!!window.hotExtension]})})},signAuthEntry:function(e,t){return ee(void 0,void 0,void 0,function(){return te(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Vo.request("stellar:signAuthEntry",{authEntry:e,accountToSign:t.address})];case 1:return[2,n.sent().signedAuthEntry];case 2:throw n.sent(),new Error("BLUX: Failed to signAuthEntry using HotWallet");case 3:return[2]}})})},signMessage:function(e,t){return ee(void 0,void 0,void 0,function(){return te(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Vo.request("stellar:signMessage",{message:e,accountToSign:t.address})];case 1:return[2,n.sent().signedMessage];case 2:throw n.sent(),new Error("BLUX: Failed to signMessage using HotWallet");case 3:return[2]}})})},signTransaction:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return ee(void 0,ne([e],t,!0),void 0,function(e,t){return void 0===t&&(t={}),te(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Vo.request("stellar:signTransaction",{xdr:e,accountToSign:t.address})];case 1:return[2,n.sent().signedTxXdr];case 2:throw n.sent(),new Error("BLUX: Failed to signTransaction using HotWallet");case 3:return[2]}})})}},Jo={name:H.Hana,website:"https://www.hanawallet.io/",authenticateWithSignedMessage:!0,connect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,window.hanaWallet.stellar.getPublicKey()];case 1:if(!e.sent())throw new Error("BLUX: Hana Wallet is not installed or connected.");return[4,window.hanaWallet.stellar.getPublicKey()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("BLUX: Failed to connect to HanaWallet.");case 4:return[2]}})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2]})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){var e,t;return te(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!(null===(t=window.hanaWallet)||void 0===t?void 0:t.stellar))throw new Error("BLUX: Hana Wallet is not installed.");return[4,window.hanaWallet.stellar.getNetworkDetails()];case 1:return[2,{network:(e=n.sent()).network,passphrase:e.networkPassphrase}];case 2:throw n.sent(),new Error("BLUX: Failed to getNetwork using HanaWallet");case 3:return[2]}})})},isAvailable:function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.hanaWallet)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return ee(void 0,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:if(!("undefined"!=typeof window&&!!(null===(n=window.hanaWallet)||void 0===n?void 0:n.stellar)))throw new Error("BLUX: Failed to signAuthEntry using HanaWallet");r.label=1;case 1:return r.trys.push([1,3,,4]),[4,window.hanaWallet.stellar.signAuthEntry({xdr:e,accountToSign:t.address})];case 2:return[2,r.sent()];case 3:throw r.sent(),new Error("BLUX: Failed to signAuthEntry using HanaWallet");case 4:return[2]}})})},signMessage:function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i,o,a;return te(this,function(s){switch(s.label){case 0:if(!("undefined"!=typeof window&&!!(null===(a=window.hanaWallet)||void 0===a?void 0:a.stellar)))throw new Error("BLUX: Failed to signMessage using HanaWallet");s.label=1;case 1:return s.trys.push([1,4,,5]),n=Buffer.concat([Buffer.from("Stellar Signed Message:\n","utf8"),Buffer.from(e,"utf8")]),o=(i=Buffer).from,[4,crypto.subtle.digest("SHA-256",n)];case 2:return r=o.apply(i,[s.sent()]),[4,window.hanaWallet.stellar.signBlob({blob:r.toString("base64"),accountToSign:t.address})];case 3:return[2,s.sent()];case 4:throw s.sent(),new Error("BLUX: Failed to signMessage using HanaWallet");case 5:return[2]}})})},signTransaction:function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i,o;return te(this,function(a){switch(a.label){case 0:if(!("undefined"!=typeof window&&!!(null===(r=window.hanaWallet)||void 0===r?void 0:r.stellar)))throw new Error("BLUX: Failed to signTransaction using HanaWallet");a.label=1;case 1:if(a.trys.push([1,3,,4]),"function"!=typeof(n=null===(o=null===(i=null===window||void 0===window?void 0:window.hanaWallet)||void 0===i?void 0:i.stellar)||void 0===o?void 0:o.signTransaction))throw new Error("BLUX: Failed to signTransaction using HanaWallet");return[4,n({xdr:e,address:t.address,networkPassphrase:t.network})];case 2:return[2,a.sent()];case 3:throw a.sent(),new Error("BLUX: Failed to signTransaction using HanaWallet");case 4:return[2]}})})}},Zo={name:H.Rabet,website:"https://rabet.io",authenticateWithSignedMessage:!0,connect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:if(e.trys.push([0,2,,3]),!window.rabet)throw new Error("BLUX: Rabet Wallet is not installed.");return[4,window.rabet.connect()];case 1:return[2,e.sent().publicKey];case 2:throw e.sent(),new Error("BLUX: Failed to connect to Rabet.");case 3:return[2]}})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){try{if(!window.rabet)throw new Error("BLUX: Rabet Wallet is not installed.");window.rabet.disconnect()}catch(e){}return[2]})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:if(e.trys.push([0,2,,3]),!window.rabet)throw new Error("BLUX: Rabet Wallet is not installed.");return[4,window.rabet.getNetwork()];case 1:return[2,e.sent()];case 2:throw e.sent(),new Error("BLUX: Failed to getNetwork from Rabet");case 3:return[2]}})})},isAvailable:function(){return new Promise(function(e){setTimeout(function(){return e("undefined"!=typeof window&&!!window.rabet)},150)})},signAuthEntry:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: Rabet does not support the signAuthEntry function")})})},signMessage:function(e,t){return ee(void 0,void 0,void 0,function(){var t;return te(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!window.rabet)throw new Error("BLUX: Rabet Wallet is not installed.");return[4,window.rabet.signMessage(e)];case 1:if(!(t=n.sent()).message||t.error)throw new Error("BLUX: Failed to signMessage from Rabet");return[2,t.message];case 2:throw n.sent(),new Error("BLUX: Failed to signMessage from Rabet");case 3:return[2]}})})},signTransaction:function(e,t){return ee(void 0,void 0,void 0,function(){return te(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!window.rabet)throw new Error("BLUX: Rabet Wallet is not installed.");return[4,window.rabet.sign(e,t.network===V.PUBLIC?"mainnet":"testnet")];case 1:return[2,n.sent().xdr];case 2:throw n.sent(),new Error("BLUX: Failed to sign the transaction with Rabet.");case 3:return[2]}})})}},Qo={name:H.Xbull,website:"https://xbull.app",authenticateWithSignedMessage:!0,connect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:if(e.trys.push([0,3,,4]),!window.xBullSDK)throw new Error("BLUX: xBull Wallet is not installed");return[4,window.xBullSDK.connect({canRequestPublicKey:!0,canRequestSign:!0})];case 1:return e.sent(),[4,window.xBullSDK.getPublicKey()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("BLUX: Failed to connect to xBull");case 4:return[2]}})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2]})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),!window.xBullSDK)throw new Error("BLUX: xBull Wallet is not installed");return[4,window.xBullSDK.getNetwork()];case 1:return[2,{network:(e=t.sent()).network,passphrase:e.networkPassphrase}];case 2:throw t.sent(),new Error("BLUX: Error getting network from Rabet");case 3:return[2]}})})},isAvailable:function(){return new Promise(function(e){setTimeout(function(){e("undefined"!=typeof window&&!!window.xBullSDK)},150)})},signAuthEntry:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: xBull does not support the signAuthEntry function")})})},signMessage:function(e,t){return ee(void 0,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!window.xBullSDK)throw new Error("BLUX: xBull Wallet is not installed");return[4,window.xBullSDK.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:if((n=r.sent()).error)throw new Error("BLUX: Failed to signMessage using xBull");return[2,n.signedMessage];case 2:throw r.sent(),new Error("BLUX: Failed to signMessage using xBull");case 3:return[2]}})})},signTransaction:function(e,t){return ee(void 0,void 0,void 0,function(){return te(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!window.xBullSDK)throw new Error("BLUX: xBull Wallet is not installed.");return[4,window.xBullSDK.signXDR(e,{network:t.network,publicKey:t.address})];case 1:return[2,n.sent()];case 2:throw n.sent(),new Error("BLUX: Failed to sign the transaction with xBull.");case 3:return[2]}})})}},ea={name:H.Albedo,website:"https://albedo.link",authenticateWithSignedMessage:!0,connect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,S.publicKey({token:"Connect to Albedo"})];case 1:return[2,e.sent().pubkey];case 2:throw e.sent(),new Error("BLUX: Failed to connect to Albedo.");case 3:return[2]}})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2]})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: Albedo does not support the getNetwork function")})})},isAvailable:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2,!0]})})},signAuthEntry:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: Albedo does not support the signAuthEntry function")})})},signMessage:function(e,t){return ee(void 0,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:return[4,S.signMessage({message:e,pubkey:t.address})];case 1:return n=r.sent(),console.log("result"),console.log(n),[2,n.signedMessage]}})})},signTransaction:function(e,t){return ee(void 0,void 0,void 0,function(){return te(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,S.tx({xdr:e,pubkey:t.address,network:t.network})];case 1:return[2,n.sent().signed_envelope_xdr];case 2:throw n.sent(),new Error("BLUX: Failed to sign the transaction with Albedo.");case 3:return[2]}})})}},ta={name:H.Klever,website:"https://klever.io",connect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.getAddress()];case 1:return[2,e.sent().address];case 2:throw e.sent(),new Error("BLUX: Failed to connect to Klever");case 3:return[2]}})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2]})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.getNetwork()];case 1:return[2,{network:(e=t.sent()).network,passphrase:e.networkPassphrase}];case 2:throw t.sent(),new Error("BLUX: Failed to getNetwork from Klever");case 3:return[2]}})})},isAvailable:function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.kleverWallet)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return ee(void 0,void 0,void 0,function(){return te(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.signAuthEntry(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,n.sent().signedAuthEntry];case 2:throw n.sent(),new Error("BLUX: Failed to signAuthEntry using Klever");case 3:return[2]}})})},signMessage:function(e,t){return ee(void 0,void 0,void 0,function(){return te(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,n.sent().signedMessage];case 2:throw n.sent(),new Error("BLUX: Failed to signMessage using Klever");case 3:return[2]}})})},signTransaction:function(e,t){return ee(void 0,void 0,void 0,function(){return te(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,window.kleverWallet.stellar.signTransaction(e,t)];case 1:return[2,n.sent().signedTxXdr];case 2:throw n.sent(),new Error("BLUX: Failed to signTransaction using Klever");case 3:return[2]}})})}},na={name:H.Lobstr,website:"https://lobstr.co",connect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,_.isConnected()];case 1:if(!e.sent())throw new Error("BLUX: LOBSTR Wallet is not installed or connected.");return[4,_.getPublicKey()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("BLUX: Failed to connect to LOBSTR.");case 4:return[2]}})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2]})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: Failed to get network from LOBSTR")})})},isAvailable:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:return[4,_.isConnected()];case 1:return[2,e.sent()]}})})},signAuthEntry:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: LOBSTR does not support the signAuthEntry function")})})},signMessage:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: LOBSTR does not support the signMessage function")})})},signTransaction:function(e){return ee(void 0,void 0,void 0,function(){return te(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),!_.signTransaction)throw new Error("BLUX: LOBSTR Wallet does not support signing transactions.");return[4,_.signTransaction(e)];case 1:return[2,t.sent()];case 2:throw t.sent(),new Error("BLUX: Failed to sign the transaction with LOBSTR.");case 3:return[2]}})})}},ra={name:H.Onekey,website:"https://onekey.so",authenticateWithSignedMessage:!0,connect:function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(e=window.$onekey)||void 0===e?void 0:e.stellar))throw new Error("BLUX: Onekey Wallet is not installed or connected.");return[4,window.$onekey.stellar.getPublicKey()];case 1:return[2,t.sent()];case 2:throw t.sent(),new Error("BLUX: Failed to connect to Onekey.");case 3:return[2]}})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2]})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: Failed to get network from Onekey")})})},isAvailable:function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.$onekey)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return ee(void 0,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(n=window.$onekey)||void 0===n?void 0:n.stellar))throw new Error("BLUX: Onekey Wallet is not installed or connected.");return[4,window.$onekey.stellar.signAuthEntry(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,r.sent().signedAuthEntry];case 2:throw r.sent(),new Error("BLUX: Failed to sign auth entry with Onekey.");case 3:return[2]}})})},signMessage:function(e,t){return ee(void 0,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(n=window.$onekey)||void 0===n?void 0:n.stellar))throw new Error("BLUX: Onekey Wallet is not installed or connected.");return[4,window.$onekey.stellar.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,r.sent().signedMessage];case 2:throw r.sent(),new Error("BLUX: Failed to sign message with Onekey.");case 3:return[2]}})})},signTransaction:function(e,t){return ee(void 0,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(n=window.$onekey)||void 0===n?void 0:n.stellar))throw new Error("BLUX: Onekey Wallet is not installed or connected.");return[4,window.$onekey.stellar.signTransaction(e,{submit:!1,address:t.address,networkPassphrase:t.network})];case 1:return[2,r.sent().signedTxXdr];case 2:throw r.sent(),new Error("BLUX: Failed to sign the transaction with Onekey.");case 3:return[2]}})})}},ia={name:H.Bitget,website:"https://bitget.com",authenticateWithSignedMessage:!0,connect:function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(e=window.bitkeep)||void 0===e?void 0:e.stellar))throw new Error("BLUX: Bitget Wallet is not installed or connected.");return[4,window.bitkeep.stellar.connect()];case 1:return[2,t.sent()];case 2:throw t.sent(),new Error("BLUX: Failed to connect to Bitget.");case 3:return[2]}})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2]})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:return[4,window.bitkeep.stellar.network()];case 1:return[2,{network:(e=t.sent()).network,passphrase:e.networkPassphrase}]}})})},isAvailable:function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){return[2,"undefined"!=typeof window&&!!(null===(e=window.bitkeep)||void 0===e?void 0:e.stellar)]})})},signAuthEntry:function(e,t){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: Failed to sign auth entry with Bitget")})})},signMessage:function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i;return te(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(i=window.bitkeep)||void 0===i?void 0:i.stellar))throw new Error("BLUX: Bitkeep Wallet is not installed or connected.");return[4,window.bitkeep.stellar.signMessage(e,t.address)];case 1:return n=o.sent(),r=new Uint8Array(n.match(/.{1,2}/g).map(function(e){return parseInt(e,16)})),[2,btoa(String.fromCharCode.apply(String,r))];case 2:throw o.sent(),new Error("BLUX: Failed to sign message with Bitkeep.");case 3:return[2]}})})},signTransaction:function(e,t){return ee(void 0,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),"undefined"==typeof window||!(null===(n=window.bitkeep)||void 0===n?void 0:n.stellar))throw new Error("BLUX: Bitget Wallet is not installed or connected.");return[4,window.bitkeep.stellar.signTransaction(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,r.sent()];case 2:throw r.sent(),new Error("BLUX: Failed to sign the transaction with Bitget.");case 3:return[2]}})})}},oa={exports:{}};var aa=function(){if(Ho)return oa.exports;Ho=1;var e,t="object"==typeof Reflect?Reflect:null,n=t&&"function"==typeof t.apply?t.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}oa.exports=i,oa.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}p(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&p(e,"error",t,n)}(e,i,{once:!0})})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,o,c,u;if(a(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),c=o[t]),void 0===c)c=o[t]=n,++e._eventsCount;else if("function"==typeof c?c=o[t]=r?[n,c]:[c,n]:r?c.unshift(n):c.push(n),(i=s(e))>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=c.length,u=l,console&&console.warn&&console.warn(u)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):h(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function h(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function p(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(o){r.once&&e.removeEventListener(t,i),n(o)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var u=c.length,l=h(c,u);for(r=0;r<u;++r)n(l[r],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return a(t),this.on(e,l(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,l(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,i,o,s;if(a(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},oa.exports}(),sa=Ge(aa);const ca={},ua={},la=(e,t)=>{ua[e]=t},da=e=>{class t extends Error{cause;constructor(n,r,i){if(super(n||e,i),Object.setPrototypeOf(this,t.prototype),this.name=e,r)for(const e in r)this[e]=r[e];if(i&&"object"==typeof i&&"cause"in i&&!this.cause){const e=i.cause;this.cause=e,"stack"in e&&(this.stack=this.stack+"\nCAUSE: "+e.stack)}}}return ca[e]=t,t};da("AccountNameRequired"),da("AccountNotSupported"),da("AccountAwaitingSendPendingOperations"),da("AmountRequired"),da("BluetoothRequired"),da("BtcUnmatchedApp"),da("CantOpenDevice"),da("CashAddrNotSupported"),da("ClaimRewardsFeesWarning"),da("CurrencyNotSupported"),da("DeviceAppVerifyNotSupported"),da("DeviceGenuineSocketEarlyClose"),da("DeviceNotGenuine"),da("DeviceOnDashboardExpected"),da("DeviceOnDashboardUnexpected"),da("DeviceInOSUExpected"),da("DeviceHalted"),da("DeviceNameInvalid"),da("DeviceSocketFail"),da("DeviceSocketNoBulkStatus"),da("DeviceSocketNoBulkStatus"),da("UnresponsiveDeviceError");const fa=da("DisconnectedDevice"),ha=da("DisconnectedDeviceDuringOperation");da("DeviceExtractOnboardingStateError"),da("DeviceOnboardingStatePollingError"),da("EnpointConfig"),da("EthAppPleaseEnableContractData"),da("SolAppPleaseEnableContractData"),da("CeloAppPleaseEnableContractData"),da("FeeEstimationFailed"),da("FirmwareNotRecognized"),da("HardResetFail"),da("InvalidXRPTag"),da("InvalidAddress"),da("InvalidTransactionError"),da("InvalidNonce"),da("InvalidAddressBecauseDestinationIsAlsoSource"),da("LatestMCUInstalledError"),da("LatestFirmwareVersionRequired"),da("UnsupportedFeatureError"),da("NanoSNotSupported"),da("UnknownMCU"),da("LedgerAPIError"),da("LedgerAPIErrorWithMessage"),da("LedgerAPINotAvailable"),da("ManagerAppAlreadyInstalled"),da("ManagerAppRelyOnBTC"),da("ManagerAppDepInstallRequired"),da("ManagerAppDepUninstallRequired"),da("ManagerDeviceLocked"),da("ManagerFirmwareNotEnoughSpace"),da("ManagerNotEnoughSpace"),da("ManagerUninstallBTCDep"),da("NetworkDown"),da("NetworkError"),da("NoAddressesFound"),da("NotEnoughBalance"),da("NotEnoughBalanceFees"),da("NotEnoughBalanceSwap"),da("NotEnoughBalanceToDelegate"),da("UnstakeNotEnoughStakedBalanceLeft"),da("RestakeNotEnoughStakedBalanceLeft"),da("NotEnoughToRestake"),da("NotEnoughToUnstake"),da("NotEnoughBalanceInParentAccount"),da("NotEnoughSpendableBalance"),da("NotEnoughBalanceBecauseDestinationNotCreated"),da("NotEnoughToStake"),da("NoAccessToCamera"),da("NotEnoughGas"),da("NotEnoughGasSwap"),da("TronEmptyAccount"),da("MaybeKeepTronAccountAlive"),da("NotSupportedLegacyAddress"),da("GasLessThanEstimate"),da("PriorityFeeTooLow"),da("PriorityFeeTooHigh"),da("PriorityFeeHigherThanMaxFee"),da("MaxFeeTooLow"),da("PasswordsDontMatch"),da("PasswordIncorrect"),da("RecommendSubAccountsToEmpty"),da("RecommendUndelegation"),da("TimeoutTagged"),da("UnexpectedBootloader"),da("MCUNotGenuineToDashboard"),da("RecipientRequired"),da("UnavailableTezosOriginatedAccountReceive"),da("UnavailableTezosOriginatedAccountSend"),da("UpdateFetchFileFail"),da("UpdateIncorrectHash"),da("UpdateIncorrectSig"),da("UpdateYourApp"),da("UserRefusedDeviceNameChange"),da("UserRefusedAddress"),da("UserRefusedFirmwareUpdate"),da("UserRefusedAllowManager"),da("UserRefusedOnDevice"),da("PinNotSet"),da("ExpertModeRequired");const pa=da("TransportOpenUserCancelled"),ba=da("TransportInterfaceNotAvailable"),ma=da("TransportRaceCondition"),ga=da("TransportWebUSBGestureRequired");var va;da("TransactionHasBeenValidatedError"),da("TransportExchangeTimeoutError"),da("DeviceShouldStayInApp"),da("WebsocketConnectionError"),da("WebsocketConnectionFailed"),da("WrongDeviceForAccount"),da("WrongDeviceForAccountPayout"),da("MissingSwapPayloadParamaters"),da("WrongDeviceForAccountRefund"),da("WrongAppForCurrency"),da("ETHAddressNonEIP"),da("CantScanQRCode"),da("FeeNotLoaded"),da("FeeNotLoadedSwap"),da("FeeRequired"),da("FeeTooHigh"),da("ValAddressRequired"),da("RedelegateDstValAddressRequired"),da("PendingOperation"),da("SyncError"),da("PairingFailed"),da("PeerRemovedPairing"),da("GenuineCheckFailed"),da("LedgerAPI4xx"),da("LedgerAPI5xx"),da("FirmwareOrAppUpdateRequired"),da("ReplacementTransactionUnderpriced"),da("OpReturnSizeLimit"),da("DustLimit"),da("ConcordiumInsufficientFunds"),da("ConcordiumMemoTooLong"),da("ConcordiumPairingExpiredError"),da("ConcordiumSessionExpiredError"),da("ConcordiumTrustedMetadataServiceError"),da("ConcordiumAddressVerificationFailedError"),da("ConcordiumInvalidMaxFeeError"),da("LanguageNotFound"),da("NoDBPathGiven"),da("DBWrongPassword"),da("DBNotReset"),da("SequenceNumberError"),da("DisabledTransactionBroadcastError"),da("InvalidParameterError"),function(e){e.Unknown="Unknown",e.LocationServicesDisabled="LocationServicesDisabled",e.LocationServicesUnauthorized="LocationServicesUnauthorized",e.BluetoothScanStartFailed="BluetoothScanStartFailed"}(va||(va={}));class ya extends Error{id;constructor(e,t){const n="TransportError";super(e||n),this.name=n,this.message=e,this.stack=new Error(e).stack,this.id=t}}la("TransportError",e=>new ya(e.message,e.id));const wa={ACCESS_CONDITION_NOT_FULFILLED:38916,ALGORITHM_NOT_SUPPORTED:38020,CLA_NOT_SUPPORTED:28160,CLA_NOT_SUPPORTED_BOOTLOADER:28161,CODE_BLOCKED:38976,CODE_NOT_INITIALIZED:38914,COMMAND_INCOMPATIBLE_FILE_STRUCTURE:27009,CONDITIONS_OF_USE_NOT_SATISFIED:27013,CONTRADICTION_INVALIDATION:38928,CONTRADICTION_SECRET_CODE_STATUS:38920,DEVICE_IN_RECOVERY_MODE:26159,CUSTOM_IMAGE_EMPTY:26158,FILE_ALREADY_EXISTS:27273,FILE_NOT_FOUND:37892,GP_AUTH_FAILED:25344,HALTED:28586,INCONSISTENT_FILE:37896,INCORRECT_DATA:27264,INCORRECT_LENGTH:26368,INCORRECT_P1_P2:27392,INS_NOT_SUPPORTED:27904,DEVICE_NOT_ONBOARDED:27911,DEVICE_NOT_ONBOARDED_2:26129,INVALID_KCV:38021,INVALID_OFFSET:37890,LICENSING:28482,LOCKED_DEVICE:21781,MAX_VALUE_REACHED:38992,MEMORY_PROBLEM:37440,MISSING_CRITICAL_PARAMETER:26624,NO_EF_SELECTED:37888,NOT_ENOUGH_MEMORY_SPACE:27268,OK:36864,PIN_REMAINING_ATTEMPTS:25536,REFERENCED_DATA_NOT_FOUND:27272,SECURITY_STATUS_NOT_SATISFIED:27010,TECHNICAL_PROBLEM:28416,UNKNOWN_APDU:27906,USER_REFUSED_ON_DEVICE:21761,NOT_ENOUGH_SPACE:20738,APP_NOT_FOUND_OR_INVALID_CONTEXT:20771,INVALID_APP_NAME_LENGTH:26378,GEN_AES_KEY_FAILED:21529,INTERNAL_CRYPTO_OPERATION_FAILED:21530,INTERNAL_COMPUTE_AES_CMAC_FAILED:21531,ENCRYPT_APP_STORAGE_FAILED:21532,INVALID_BACKUP_STATE:26178,PIN_NOT_SET:21762,INVALID_BACKUP_LENGTH:26419,INVALID_RESTORE_STATE:26179,INVALID_CHUNK_LENGTH:26420,INVALID_BACKUP_HEADER:26698,SW_BAD_STATE:45063};class xa extends Error{statusCode;statusText;constructor(e,{canBeMappedToChildError:t=!0}={}){const n=Object.keys(wa).find(t=>wa[t]===e)||"UNKNOWN_ERROR",r=`Ledger device: ${function(e){switch(e){case 26368:return"Incorrect length";case 26624:return"Missing critical parameter";case 27010:return"Security not satisfied (dongle locked or have invalid access rights)";case 27013:return"Condition of use not satisfied (denied by the user?)";case 27264:return"Invalid data received";case 27392:return"Invalid parameter received";case 21781:return"Locked device";case 45063:return"Unexpected state on the device"}if(28416<=e&&e<=28671)return"Internal error, please report"}(e)||n} (0x${e.toString(16)})`;if(super(r),this.name="TransportStatusError",this.statusCode=e,this.statusText=n,Object.setPrototypeOf(this,xa.prototype),t&&e===wa.LOCKED_DEVICE)return new Aa(r)}}class Aa extends xa{constructor(e){super(wa.LOCKED_DEVICE,{canBeMappedToChildError:!1}),e&&(this.message=e),this.name="LockedDeviceError",Object.setPrototypeOf(this,Aa.prototype)}}la("TransportStatusError",e=>new xa(e.statusCode));let Ea=0;const Sa=[],_a=(e,t,n)=>{const r={type:e,id:String(++Ea),date:new Date};t&&(r.message=t),ka(r)};class Oa{type;context;constructor(e,t){this.type=e,this.context=t}trace(e,t){(({type:e,message:t,data:n,context:r})=>{const i={type:e,id:String(++Ea),date:new Date};t&&(i.message=t),n&&(i.data=n),r&&(i.context=r),ka(i)})({type:this.type,message:e,data:t,context:this.context})}getContext(){return this.context}setContext(e){this.context=e}updateContext(e){this.context={...this.context,...e}}getType(){return this.type}setType(e){this.type=e}withType(e){return new Oa(e,this.context)}withContext(e){return new Oa(this.type,e)}withUpdatedContext(e){return new Oa(this.type,{...this.context,...e})}}const Na=e=>(Sa.push(e),()=>{const t=Sa.indexOf(e);-1!==t&&(Sa[t]=Sa[Sa.length-1],Sa.pop())});function ka(e){for(let t=0;t<Sa.length;t++)try{Sa[t](e)}catch(e){console.error(e)}}"undefined"!=typeof window&&(window.__ledgerLogsListen=Na);class Ta{exchangeTimeout=3e4;unresponsiveTimeout=15e3;deviceModel=null;tracer;constructor({context:e,logType:t}={}){this.tracer=new Oa(t??"transport",e)}static isSupported;static list;static listen;static open;exchange(e,{abortTimeoutMs:t}={}){throw new Error("exchange not implemented")}exchangeBulk(e,t){let n=!1;return(async()=>{if(!n)for(const r of e){const e=await this.exchange(r);if(n)return;const i=e.readUInt16BE(e.length-2);if(i!==wa.OK)throw new xa(i);t.next(e)}})().then(()=>!n&&t.complete(),e=>!n&&t.error(e)),{unsubscribe:()=>{n=!0}}}setScrambleKey(e){}close(){return Promise.resolve()}_events=new sa;on(e,t){this._events.on(e,t)}off(e,t){this._events.removeListener(e,t)}emit(e,...t){this._events.emit(e,...t)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(e){this.exchangeTimeout=e}setExchangeUnresponsiveTimeout(e){this.unresponsiveTimeout=e}send=async(e,t,n,r,i=Nr().Buffer.alloc(0),o=[wa.OK],{abortTimeoutMs:a}={})=>{const s=this.tracer.withUpdatedContext({function:"send"});if(i.length>=256)throw s.trace("data.length exceeded 256 bytes limit",{dataLength:i.length}),new ya("data.length exceed 256 bytes limit. Got: "+i.length,"DataLengthTooBig");const c=await this.exchange(Nr().Buffer.concat([Buffer.from([e,t,n,r]),Buffer.from([i.length]),i]),{abortTimeoutMs:a}),u=c.readUInt16BE(c.length-2);if(!o.some(e=>e===u))throw new xa(u);return c};static create(e=3e3,t){return new Promise((n,r)=>{let i=!1;const o=this.listen({next:t=>{i=!0,o&&o.unsubscribe(),a&&clearTimeout(a),this.open(t.descriptor,e).then(n,r)},error:e=>{a&&clearTimeout(a),r(e)},complete:()=>{a&&clearTimeout(a),i||r(new ya(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),a=t?setTimeout(()=>{o.unsubscribe(),r(new ya(this.ErrorMessage_ListenTimeout,"ListenTimeout"))},t):null})}exchangeBusyPromise;async exchangeAtomicImpl(e){const t=this.tracer.withUpdatedContext({function:"exchangeAtomicImpl",unresponsiveTimeout:this.unresponsiveTimeout});if(this.exchangeBusyPromise)throw t.trace("Atomic exchange is already busy"),new ma("An action was already pending on the Ledger device. Please deny or reconnect.");let n;const r=new Promise(e=>{n=e});this.exchangeBusyPromise=r;let i=!1;const o=setTimeout(()=>{t.trace('Timeout reached, emitting Transport event "unresponsive"',{unresponsiveTimeout:this.unresponsiveTimeout}),i=!0,this.emit("unresponsive")},this.unresponsiveTimeout);try{const n=await e();return i&&(t.trace("Device was unresponsive, emitting responsive"),this.emit("responsive")),n}finally{t.trace("Finalize, clearing busy guard"),clearTimeout(o),n&&n(),this.exchangeBusyPromise=null}}decorateAppAPIMethods(e,t,n){for(const r of t)e[r]=this.decorateAppAPIMethod(r,e[r],e,n)}_appAPIlock=null;decorateAppAPIMethod(e,t,n,r){return async(...i)=>{const{_appAPIlock:o}=this;if(o)return Promise.reject(new ya("Ledger Device is busy (lock "+o+")","TransportLocked"));try{return this._appAPIlock=e,this.setScrambleKey(r),await t.apply(n,i)}finally{this._appAPIlock=null}}}setTraceContext(e){this.tracer=this.tracer.withContext(e)}updateTraceContext(e){this.tracer.updateContext(e)}getTraceContext(){return this.tracer.getContext()}static ErrorMessage_ListenTimeout="No Ledger device found (timeout)";static ErrorMessage_NoDeviceFound="No Ledger device found"}function Ca(e){const t=Nr().Buffer.alloc(2);return t.writeUInt16BE(e,0),t}const Ia={data:Nr().Buffer.alloc(0),dataLength:0,sequence:0};var Ba,La,Ma,Ra,Pa,Ua,ja,Fa,Da,za,$a,Wa,Xa,qa,Ka,Ga,Ha,Va,Ya,Ja,Za,Qa,es,ts,ns,rs,is,os,as,ss,cs,us,ls,ds,fs,hs,ps,bs,ms,gs,vs,ys,ws,xs,As,Es,Ss,_s,Os,Ns,ks,Ts,Cs,Is,Bs,Ls,Ms,Rs,Ps,Us,js,Fs,Ds,zs,$s,Ws,Xs,qs,Ks,Gs,Hs,Vs,Ys,Js,Zs,Qs,ec,tc,nc,rc,ic,oc,ac,sc,cc,uc,lc,dc,fc,hc={exports:{}};function pc(){if(La)return Ba;La=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return Ba={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}function bc(){if(Ra)return Ma;Ra=1;const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return Ma=e}function mc(){return Pa||(Pa=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=pc(),o=bc(),a=(t=e.exports={}).re=[],s=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let d=0;const f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[f,r]],p=(e,t,n)=>{const r=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=d++;o(e,i,t),l[e]=i,c[i]=t,u[i]=r,a[i]=new RegExp(t,n?"g":void 0),s[i]=new RegExp(r,n?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),p("FULL",`^${c[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),p("LOOSE",`^${c[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),p("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?`+`(?:${c[l.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[l.COERCE],!0),p("COERCERTLFULL",c[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(hc,hc.exports)),hc.exports}function gc(){if(ja)return Ua;ja=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Ua=n=>n?"object"!=typeof n?e:n:t}function vc(){if(Da)return Fa;Da=1;const e=/^[0-9]+$/,t=(t,n)=>{if("number"==typeof t&&"number"==typeof n)return t===n?0:t<n?-1:1;const r=e.test(t),i=e.test(n);return r&&i&&(t=+t,n=+n),t===n?0:r&&!i?-1:i&&!r?1:t<n?-1:1};return Fa={compareIdentifiers:t,rcompareIdentifiers:(e,n)=>t(n,e)}}function yc(){if($a)return za;$a=1;const e=bc(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=pc(),{safeRe:r,t:i}=mc(),o=gc(),{compareIdentifiers:a}=vc();class s{constructor(a,c){if(c=o(c),a instanceof s){if(a.loose===!!c.loose&&a.includePrerelease===!!c.includePrerelease)return a;a=a.version}else if("string"!=typeof a)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof a}".`);if(a.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",a,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const u=a.trim().match(c.loose?r[i.LOOSE]:r[i.FULL]);if(!u)throw new TypeError(`Invalid Version: ${a}`);if(this.raw=a,this.major=+u[1],this.minor=+u[2],this.patch=+u[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");u[4]?this.prerelease=u[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<n)return t}return e}):this.prerelease=[],this.build=u[5]?u[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(e("SemVer.compare",this.version,this.options,t),!(t instanceof s)){if("string"==typeof t&&t===this.version)return 0;t=new s(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof s||(e=new s(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(t){if(t instanceof s||(t=new s(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const r=this.prerelease[n],i=t.prerelease[n];if(e("prerelease compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return a(r,i)}while(++n)}compareBuild(t){t instanceof s||(t=new s(t,this.options));let n=0;do{const r=this.build[n],i=t.build[n];if(e("build compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return a(r,i)}while(++n)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?r[i.PRERELEASELOOSE]:r[i.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===a(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return za=s}function wc(){if(Xa)return Wa;Xa=1;const e=yc();return Wa=(t,n,r=!1)=>{if(t instanceof e)return t;try{return new e(t,n)}catch(e){if(!r)return null;throw e}},Wa}function xc(){if(cs)return ss;cs=1;const e=yc();return ss=(t,n,r)=>new e(t,r).compare(new e(n,r))}function Ac(){if(ps)return hs;ps=1;const e=yc();return hs=(t,n,r)=>{const i=new e(t,r),o=new e(n,r);return i.compare(o)||i.compareBuild(o)}}function Ec(){if(ws)return ys;ws=1;const e=xc();return ys=(t,n,r)=>e(t,n,r)>0}function Sc(){if(As)return xs;As=1;const e=xc();return xs=(t,n,r)=>e(t,n,r)<0}function _c(){if(Ss)return Es;Ss=1;const e=xc();return Es=(t,n,r)=>0===e(t,n,r)}function Oc(){if(Os)return _s;Os=1;const e=xc();return _s=(t,n,r)=>0!==e(t,n,r)}function Nc(){if(ks)return Ns;ks=1;const e=xc();return Ns=(t,n,r)=>e(t,n,r)>=0}function kc(){if(Cs)return Ts;Cs=1;const e=xc();return Ts=(t,n,r)=>e(t,n,r)<=0}function Tc(){if(Bs)return Is;Bs=1;const e=_c(),t=Oc(),n=Ec(),r=Nc(),i=Sc(),o=kc();return Is=(a,s,c,u)=>{switch(s){case"===":return"object"==typeof a&&(a=a.version),"object"==typeof c&&(c=c.version),a===c;case"!==":return"object"==typeof a&&(a=a.version),"object"==typeof c&&(c=c.version),a!==c;case"":case"=":case"==":return e(a,c,u);case"!=":return t(a,c,u);case">":return n(a,c,u);case">=":return r(a,c,u);case"<":return i(a,c,u);case"<=":return o(a,c,u);default:throw new TypeError(`Invalid operator: ${s}`)}}}function Cc(){if(js)return Us;js=1;const e=/\s+/g;class t{constructor(n,r){if(r=i(r),n instanceof t)return n.loose===!!r.loose&&n.includePrerelease===!!r.includePrerelease?n:new t(n.raw,r);if(n instanceof o)return this.raw=n.value,this.set=[[n]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=n.trim().replace(e," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!b(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+e,n=r.get(t);if(n)return n;const i=this.options.loose,s=i?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(s,k(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],l),a("comparator trim",e),e=e.replace(c[u.TILDETRIM],d),a("tilde trim",e),e=e.replace(c[u.CARETTRIM],f),a("caret trim",e);let m=e.split(" ").map(e=>v(e,this.options)).join(" ").split(/\s+/).map(e=>N(e,this.options));i&&(m=m.filter(e=>(a("loose invalid filter",e,this.options),!!e.match(c[u.COMPARATORLOOSE])))),a("range list",m);const g=new Map,y=m.map(e=>new o(e,this.options));for(const e of y){if(b(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const w=[...g.values()];return r.set(t,w),w}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(t=>g(t,n)&&e.set.some(e=>g(e,n)&&t.every(t=>e.every(e=>t.intersects(e,n)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(T(this.set[t],e,this.options))return!0;return!1}}Us=t;const n=(Ps||(Ps=1,Rs=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}),Rs),r=new n,i=gc(),o=Ic(),a=bc(),s=yc(),{safeRe:c,t:u,comparatorTrimReplace:l,tildeTrimReplace:d,caretTrimReplace:f}=mc(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:p}=pc(),b=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,g=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},v=(e,t)=>(e=e.replace(c[u.BUILD],""),a("comp",e,t),e=A(e,t),a("caret",e),e=w(e,t),a("tildes",e),e=S(e,t),a("xrange",e),e=O(e,t),a("stars",e),e),y=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,t)=>e.trim().split(/\s+/).map(e=>x(e,t)).join(" "),x=(e,t)=>{const n=t.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(n,(t,n,r,i,o)=>{let s;return a("tilde",e,t,n,r,i,o),y(n)?s="":y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:o?(a("replaceTilde pr",o),s=`>=${n}.${r}.${i}-${o} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,a("tilde return",s),s})},A=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{a("caret",e,t);const n=t.loose?c[u.CARETLOOSE]:c[u.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,i,o,s)=>{let c;return a("caret",e,t,n,i,o,s),y(n)?c="":y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(o)?c="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(a("replaceCaret pr",s),c="0"===n?"0"===i?`>=${n}.${i}.${o}-${s} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o}-${s} <${+n+1}.0.0-0`):(a("no pr"),c="0"===n?"0"===i?`>=${n}.${i}.${o}${r} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o} <${+n+1}.0.0-0`),a("caret return",c),c})},S=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map(e=>_(e,t)).join(" ")),_=(e,t)=>{e=e.trim();const n=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,(n,r,i,o,s,c)=>{a("xRange",e,n,r,i,o,s,c);const u=y(i),l=u||y(o),d=l||y(s),f=d;return"="===r&&f&&(r=""),c=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(l&&(o=0),s=0,">"===r?(r=">=",l?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===r&&(r="<",l?i=+i+1:o=+o+1),"<"===r&&(c="-0"),n=`${r+i}.${o}.${s}${c}`):l?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${o}.0${c} <${i}.${+o+1}.0-0`),a("xRange return",n),n})},O=(e,t)=>(a("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),N=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),k=e=>(t,n,r,i,o,a,s,c,u,l,d,f)=>`${n=y(r)?"":y(i)?`>=${r}.0.0${e?"-0":""}`:y(o)?`>=${r}.${i}.0${e?"-0":""}`:a?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=y(u)?"":y(l)?`<${+u+1}.0.0-0`:y(d)?`<${u}.${+l+1}.0-0`:f?`<=${u}.${l}.${d}-${f}`:e?`<${u}.${l}.${+d+1}-0`:`<=${c}`}`.trim(),T=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(a(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return Us}function Ic(){if(Ds)return Fs;Ds=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),a("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new s(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(a("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new s(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,r).test(this.value):""===e.operator?""===e.value||new c(this.value,r).test(e.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}Fs=t;const n=gc(),{safeRe:r,t:i}=mc(),o=Tc(),a=bc(),s=yc(),c=Cc();return Fs}function Bc(){if($s)return zs;$s=1;const e=Cc();return zs=(t,n,r)=>{try{n=new e(n,r)}catch(e){return!1}return n.test(t)},zs}function Lc(){if(Zs)return Js;Zs=1;const e=Cc();return Js=(t,n)=>{try{return new e(t,n).range||"*"}catch(e){return null}},Js}function Mc(){if(ec)return Qs;ec=1;const e=yc(),t=Ic(),{ANY:n}=t,r=Cc(),i=Bc(),o=Ec(),a=Sc(),s=kc(),c=Nc();return Qs=(u,l,d,f)=>{let h,p,b,m,g;switch(u=new e(u,f),l=new r(l,f),d){case">":h=o,p=s,b=a,m=">",g=">=";break;case"<":h=a,p=c,b=o,m="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(u,l,f))return!1;for(let e=0;e<l.set.length;++e){const r=l.set[e];let i=null,o=null;if(r.forEach(e=>{e.semver===n&&(e=new t(">=0.0.0")),i=i||e,o=o||e,h(e.semver,i.semver,f)?i=e:b(e.semver,o.semver,f)&&(o=e)}),i.operator===m||i.operator===g)return!1;if((!o.operator||o.operator===m)&&p(u,o.semver))return!1;if(o.operator===g&&b(u,o.semver))return!1}return!0},Qs}var Rc,Pc=function(){if(fc)return dc;fc=1;const e=mc(),t=pc(),n=yc(),r=vc(),i=wc(),o=function(){if(Ka)return qa;Ka=1;const e=wc();return qa=(t,n)=>{const r=e(t,n);return r?r.version:null},qa}(),a=function(){if(Ha)return Ga;Ha=1;const e=wc();return Ga=(t,n)=>{const r=e(t.trim().replace(/^[=v]+/,""),n);return r?r.version:null},Ga}(),s=function(){if(Ya)return Va;Ya=1;const e=yc();return Va=(t,n,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new e(t instanceof e?t.version:t,r).inc(n,i,o).version}catch(e){return null}},Va}(),c=function(){if(Za)return Ja;Za=1;const e=wc();return Ja=(t,n)=>{const r=e(t,null,!0),i=e(n,null,!0),o=r.compare(i);if(0===o)return null;const a=o>0,s=a?r:i,c=a?i:r,u=!!s.prerelease.length;if(c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(0===c.compareMain(s))return c.minor&&!c.patch?"minor":"patch"}const l=u?"pre":"";return r.major!==i.major?l+"major":r.minor!==i.minor?l+"minor":r.patch!==i.patch?l+"patch":"prerelease"}}(),u=function(){if(es)return Qa;es=1;const e=yc();return Qa=(t,n)=>new e(t,n).major}(),l=function(){if(ns)return ts;ns=1;const e=yc();return ts=(t,n)=>new e(t,n).minor}(),d=function(){if(is)return rs;is=1;const e=yc();return rs=(t,n)=>new e(t,n).patch}(),f=function(){if(as)return os;as=1;const e=wc();return os=(t,n)=>{const r=e(t,n);return r&&r.prerelease.length?r.prerelease:null},os}(),h=xc(),p=function(){if(ls)return us;ls=1;const e=xc();return us=(t,n,r)=>e(n,t,r)}(),b=function(){if(fs)return ds;fs=1;const e=xc();return ds=(t,n)=>e(t,n,!0)}(),m=Ac(),g=function(){if(ms)return bs;ms=1;const e=Ac();return bs=(t,n)=>t.sort((t,r)=>e(t,r,n))}(),v=function(){if(vs)return gs;vs=1;const e=Ac();return gs=(t,n)=>t.sort((t,r)=>e(r,t,n))}(),y=Ec(),w=Sc(),x=_c(),A=Oc(),E=Nc(),S=kc(),_=Tc(),O=function(){if(Ms)return Ls;Ms=1;const e=yc(),t=wc(),{safeRe:n,t:r}=mc();return Ls=(i,o)=>{if(i instanceof e)return i;if("number"==typeof i&&(i=String(i)),"string"!=typeof i)return null;let a=null;if((o=o||{}).rtl){const e=o.includePrerelease?n[r.COERCERTLFULL]:n[r.COERCERTL];let t;for(;(t=e.exec(i))&&(!a||a.index+a[0].length!==i.length);)a&&t.index+t[0].length===a.index+a[0].length||(a=t),e.lastIndex=t.index+t[1].length+t[2].length;e.lastIndex=-1}else a=i.match(o.includePrerelease?n[r.COERCEFULL]:n[r.COERCE]);if(null===a)return null;const s=a[2],c=a[3]||"0",u=a[4]||"0",l=o.includePrerelease&&a[5]?`-${a[5]}`:"",d=o.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${s}.${c}.${u}${l}${d}`,o)},Ls}(),N=Ic(),k=Cc(),T=Bc(),C=function(){if(Xs)return Ws;Xs=1;const e=Cc();return Ws=(t,n)=>new e(t,n).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" ")),Ws}(),I=function(){if(Ks)return qs;Ks=1;const e=yc(),t=Cc();return qs=(n,r,i)=>{let o=null,a=null,s=null;try{s=new t(r,i)}catch(e){return null}return n.forEach(t=>{s.test(t)&&(o&&-1!==a.compare(t)||(o=t,a=new e(o,i)))}),o},qs}(),B=function(){if(Hs)return Gs;Hs=1;const e=yc(),t=Cc();return Gs=(n,r,i)=>{let o=null,a=null,s=null;try{s=new t(r,i)}catch(e){return null}return n.forEach(t=>{s.test(t)&&(o&&1!==a.compare(t)||(o=t,a=new e(o,i)))}),o},Gs}(),L=function(){if(Ys)return Vs;Ys=1;const e=yc(),t=Cc(),n=Ec();return Vs=(r,i)=>{r=new t(r,i);let o=new e("0.0.0");if(r.test(o))return o;if(o=new e("0.0.0-0"),r.test(o))return o;o=null;for(let t=0;t<r.set.length;++t){const i=r.set[t];let a=null;i.forEach(t=>{const r=new e(t.semver.version);switch(t.operator){case">":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":a&&!n(r,a)||(a=r);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}}),!a||o&&!n(o,a)||(o=a)}return o&&r.test(o)?o:null},Vs}(),M=Lc(),R=Mc(),P=function(){if(nc)return tc;nc=1;const e=Mc();return tc=(t,n,r)=>e(t,n,">",r),tc}(),U=function(){if(ic)return rc;ic=1;const e=Mc();return rc=(t,n,r)=>e(t,n,"<",r),rc}(),j=function(){if(ac)return oc;ac=1;const e=Cc();return oc=(t,n,r)=>(t=new e(t,r),n=new e(n,r),t.intersects(n,r))}(),F=function(){if(cc)return sc;cc=1;const e=Bc(),t=xc();return sc=(n,r,i)=>{const o=[];let a=null,s=null;const c=n.sort((e,n)=>t(e,n,i));for(const t of c)e(t,r,i)?(s=t,a||(a=t)):(s&&o.push([a,s]),s=null,a=null);a&&o.push([a,null]);const u=[];for(const[e,t]of o)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const l=u.join(" || "),d="string"==typeof r.raw?r.raw:String(r);return l.length<d.length?l:r},sc}(),D=function(){if(lc)return uc;lc=1;const e=Cc(),t=Ic(),{ANY:n}=t,r=Bc(),i=xc(),o=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],s=(e,t,s)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===n){if(1===t.length&&t[0].semver===n)return!0;e=s.includePrerelease?o:a}if(1===t.length&&t[0].semver===n){if(s.includePrerelease)return!0;t=a}const l=new Set;let d,f,h,p,b,m,g;for(const t of e)">"===t.operator||">="===t.operator?d=c(d,t,s):"<"===t.operator||"<="===t.operator?f=u(f,t,s):l.add(t.semver);if(l.size>1)return null;if(d&&f){if(h=i(d.semver,f.semver,s),h>0)return null;if(0===h&&(">="!==d.operator||"<="!==f.operator))return null}for(const e of l){if(d&&!r(e,String(d),s))return null;if(f&&!r(e,String(f),s))return null;for(const n of t)if(!r(e,String(n),s))return!1;return!0}let v=!(!f||s.includePrerelease||!f.semver.prerelease.length)&&f.semver,y=!(!d||s.includePrerelease||!d.semver.prerelease.length)&&d.semver;v&&1===v.prerelease.length&&"<"===f.operator&&0===v.prerelease[0]&&(v=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,d)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(p=c(d,e,s),p===e&&p!==d)return!1}else if(">="===d.operator&&!r(d.semver,String(e),s))return!1;if(f)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if(b=u(f,e,s),b===e&&b!==f)return!1}else if("<="===f.operator&&!r(f.semver,String(e),s))return!1;if(!e.operator&&(f||d)&&0!==h)return!1}return!(d&&m&&!f&&0!==h||f&&g&&!d&&0!==h||y||v)},c=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},u=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};return uc=(t,n,r={})=>{if(t===n)return!0;t=new e(t,r),n=new e(n,r);let i=!1;e:for(const e of t.set){for(const t of n.set){const n=s(e,t,r);if(i=i||null!==n,n)continue e}if(i)return!1}return!0}}();return dc={parse:i,valid:o,clean:a,inc:s,diff:c,major:u,minor:l,patch:d,prerelease:f,compare:h,rcompare:p,compareLoose:b,compareBuild:m,sort:g,rsort:v,gt:y,lt:w,eq:x,neq:A,gte:E,lte:S,cmp:_,coerce:O,Comparator:N,Range:k,satisfies:T,toComparators:C,maxSatisfying:I,minSatisfying:B,minVersion:L,validRange:M,outside:R,gtr:P,ltr:U,intersects:j,simplifyRange:F,subset:D,SemVer:n,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:r.compareIdentifiers,rcompareIdentifiers:r.rcompareIdentifiers}}(),Uc=Ge(Pc);!function(e){e.blue="blue",e.nanoS="nanoS",e.nanoSP="nanoSP",e.nanoX="nanoX",e.stax="stax",e.europa="europa",e.apex="apex"}(Rc||(Rc={}));const jc={[Rc.blue]:{id:Rc.blue,productName:"Ledger Blue",productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:491520,masks:[822083584,822149120],getBlockSize:e=>4096},[Rc.nanoS]:{id:Rc.nanoS,productName:"Ledger Nano S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:327680,masks:[823132160],getBlockSize:e=>Uc.lt(Uc.coerce(e)??"","2.0.0")?4096:2048},[Rc.nanoX]:{id:Rc.nanoX,productName:"Ledger Nano X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2097152,masks:[855638016],getBlockSize:e=>4096,bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]},[Rc.nanoSP]:{id:Rc.nanoSP,productName:"Ledger Nano S Plus",productIdMM:80,legacyUsbProductId:5,usbOnly:!0,memorySize:1569792,masks:[856686592],getBlockSize:e=>32},[Rc.apex]:{id:Rc.apex,productName:"Ledger Nano Gen5",productIdMM:128,legacyUsbProductId:8,usbOnly:!1,memorySize:1569792,masks:[859832320],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-8004-0000-4c6564676572",notifyUuid:"13d63400-2c97-8004-0001-4c6564676572",writeUuid:"13d63400-2c97-8004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-8004-0003-4c6564676572"}]},[Rc.stax]:{id:Rc.stax,productName:"Ledger Stax",productIdMM:96,legacyUsbProductId:6,usbOnly:!1,memorySize:1569792,masks:[857735168],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]},[Rc.europa]:{id:Rc.europa,productName:"Ledger Flex",productIdMM:112,legacyUsbProductId:7,usbOnly:!1,memorySize:1569792,masks:[858783744],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-3004-0000-4c6564676572",notifyUuid:"13d63400-2c97-3004-0001-4c6564676572",writeUuid:"13d63400-2c97-3004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-3004-0003-4c6564676572"}]}};Rc.blue,Rc.nanoS,Rc.nanoSP,Rc.nanoX,Rc.stax,Rc.europa;const Fc=Object.values(jc),Dc=e=>{const t=Fc.find(t=>t.legacyUsbProductId===e);if(t)return t;const n=e>>8;return Fc.find(e=>e.productIdMM===n)},zc=[],$c={};for(const e in jc){const t=jc[e],{bluetoothSpec:n}=t;if(n)for(let e=0;e<n.length;e++){const r=n[e];zc.push(r.serviceUuid),$c[r.serviceUuid]=$c[r.serviceUuid.replace(/-/g,"")]={deviceModel:t,...r}}}const Wc=[{vendorId:11415}];async function Xc(){return await navigator.usb.requestDevice({filters:Wc})}async function qc(){return(await navigator.usb.getDevices()).filter(e=>11415===e.vendorId)}const Kc=()=>Promise.resolve(!!navigator&&!!navigator.usb&&"function"==typeof navigator.usb.getDevices);class Gc extends Ta{device;deviceModel;channel=Math.floor(65535*Math.random());packetSize=64;interfaceNumber;constructor(e,t){super(),this.device=e,this.interfaceNumber=t,this.deviceModel=Dc(e.productId)}static isSupported=Kc;static list=qc;static listen=e=>{let t=!1;return async function(){const e=await qc();return e.length>0?e[0]:Xc()}().then(n=>{if(!t){const t=Dc(n.productId);e.next({type:"add",descriptor:n,deviceModel:t}),e.complete()}},t=>{window.DOMException&&t instanceof window.DOMException&&18===t.code?e.error(new ga(t.message)):e.error(new pa(t.message))}),{unsubscribe:function(){t=!0}}};static async request(){const e=await Xc();return Gc.open(e)}static async openConnected(){const e=await qc();return 0===e.length?null:Gc.open(e[0])}static async open(e){await e.open(),null===e.configuration&&await e.selectConfiguration(1),await Hc(e);const t=e.configurations[0].interfaces.find(({alternates:e})=>e.some(e=>255===e.interfaceClass));if(!t)throw new ba("No WebUSB interface found for your Ledger device. Please upgrade firmware or contact techsupport.");const n=t.interfaceNumber;try{await e.claimInterface(n)}catch(t){throw await e.close(),new ba(t.message)}const r=new Gc(e,n),i=t=>{e===t.device&&(navigator.usb.removeEventListener("disconnect",i),r._emitDisconnect(new fa))};return navigator.usb.addEventListener("disconnect",i),r}_disconnectEmitted=!1;_emitDisconnect=e=>{this._disconnectEmitted||(this._disconnectEmitted=!0,this.emit("disconnect",e))};async close(){await this.exchangeBusyPromise,await this.device.releaseInterface(this.interfaceNumber),await Hc(this.device),await this.device.close()}async exchange(e){const t=await this.exchangeAtomicImpl(async()=>{const{channel:t,packetSize:n}=this;_a("apdu","=> "+e.toString("hex"));const r=((e,t)=>({makeBlocks(n){let r=Nr().Buffer.concat([Ca(n.length),n]);const i=t-5,o=Math.ceil(r.length/i);r=Nr().Buffer.concat([r,Nr().Buffer.alloc(o*i-r.length+1).fill(0)]);const a=[];for(let t=0;t<o;t++){const n=Nr().Buffer.alloc(5);n.writeUInt16BE(e,0),n.writeUInt8(5,2),n.writeUInt16BE(t,3);const o=r.slice(t*i,(t+1)*i);a.push(Nr().Buffer.concat([n,o]))}return a},reduceResponse(t,n){let{data:r,dataLength:i,sequence:o}=t||Ia;if(n.readUInt16BE(0)!==e)throw new ya("Invalid channel","InvalidChannel");if(5!==n.readUInt8(2))throw new ya("Invalid tag","InvalidTag");if(n.readUInt16BE(3)!==o)throw new ya("Invalid sequence","InvalidSequence");t||(i=n.readUInt16BE(5)),o++;const a=n.slice(t?5:7);return r=Nr().Buffer.concat([r,a]),r.length>i&&(r=r.slice(0,i)),{data:r,dataLength:i,sequence:o}},getReducedResult(e){if(e&&e.dataLength===e.data.length)return e.data}}))(t,n),i=r.makeBlocks(e);for(let e=0;e<i.length;e++)await this.device.transferOut(3,i[e]);let o,a;for(;!(o=r.getReducedResult(a));){const e=await this.device.transferIn(3,n),t=Buffer.from(e.data.buffer);a=r.reduceResponse(a,t)}return _a("apdu","<= "+o.toString("hex")),o}).catch(e=>{if(e&&e.message&&e.message.includes("disconnected"))throw this._emitDisconnect(e),new ha(e.message);throw e});return t}setScrambleKey(){}}async function Hc(e){try{await e.reset()}catch(e){console.warn(e)}}var Vc={name:H.Ledger,website:"https://www.ledger.com",connect:function(){return ee(void 0,void 0,void 0,function(){var e,t;return te(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,Gc.create()];case 1:return e=n.sent(),[4,new O.default(e).getPublicKey("44'/148'/0'")];case 2:return t=n.sent().rawPublicKey,[2,i.encodeEd25519PublicKey(t)];case 3:throw n.sent(),new Error("BLUX: Failed to connect to Ledger.");case 4:return[2]}})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2]})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: Failed to get network from ledger")})})},isAvailable:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:return[4,Gc.isSupported()];case 1:return[2,e.sent()]}})})},signAuthEntry:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: ledger does not support the signAuthEntry function")})})},signMessage:function(e,t){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: Failed to sign the transaction with Ledger.")})})},signTransaction:function(e,i){return ee(void 0,void 0,void 0,function(){var o,a,s,c,u,l;return te(this,function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),o=new r(e,i.network),[4,Gc.create()];case 1:return a=d.sent(),[4,new O.default(a).signTransaction("44'/148'/0'",o.signatureBase())];case 2:return s=d.sent().signature,c=t.fromPublicKey(i.address),u=c.signatureHint(),l=new n.DecoratedSignature({hint:u,signature:s}),o.signatures.push(l),[2,o.toXDR()];case 3:throw d.sent(),new Error("BLUX: Failed to sign the transaction with Ledger.");case 4:return[2]}})})}};const Yc=Object.values({device:["getFeatures","getDeviceState","getFirmwareHash","firmwareUpdate","resetDevice","loadDevice","recoveryDevice","wipeDevice","backupDevice","changePin","changeWipeCode","changeLanguage","applySettings","applyFlags","authenticateDevice","setBusy","setBrightness","showDeviceTutorial","bleUnpair","requestLogin","cipherKeyValue","unlockPath","getOwnershipId","getOwnershipProof","thpGetCredentials","thpRemoveCredentials","telemetryGet","pingDevice"],blockchain:["blockchainSubscribe","blockchainUnsubscribe","blockchainDisconnect","blockchainSetCustomBackend","blockchainGetInfo","blockchainValidateEvmRpcUrl","blockchainEstimateFee","blockchainGetAccountBalanceHistory","blockchainGetTransactions","blockchainEvmRpcCall","blockchainGetCurrentFiatRates","blockchainGetContractInfo","blockchainGetFiatRatesForTimestamps","blockchainSubscribeFiatRates","blockchainUnsubscribeFiatRates","pushTransaction","getNonce"],account:["getAddress","getPublicKey","getAccountInfo","getAccountDescriptor","discoverAccounts","signMessage","verifyMessage","getSettings","getCoinInfo"],bitcoin:["signTransaction","composeTransaction","authorizeCoinjoin","cancelCoinjoinAuthorization"],ethereum:["ethereumGetAddress","ethereumGetPublicKey","ethereumSignTransaction","ethereumSignMessage","ethereumSignTypedData","ethereumVerifyMessage"],cardano:["cardanoGetAddress","cardanoGetPublicKey","cardanoGetNativeScriptHash","cardanoSignTransaction","cardanoSignMessage","cardanoComposeTransaction"],monero:["moneroGetAddress","moneroGetWatchKey","moneroKeyImageSync","moneroSignTransaction"],ripple:["rippleGetAddress","rippleSignTransaction"],solana:["solanaGetAddress","solanaGetPublicKey","solanaSignTransaction","solanaComposeTransaction"],stellar:["stellarGetAddress","stellarSignTransaction"],tezos:["tezosGetAddress","tezosGetPublicKey","tezosSignTransaction"],tron:["tronGetAddress","tronSignTransaction","tronComposeTransaction"],evolu:["evoluGetNode","evoluSignRegistrationRequest","evoluGetDelegatedIdentityKey"]}).flat(),Jc={Init_NotInitialized:"TrezorConnect not initialized",Init_AlreadyInitialized:"TrezorConnect has been already initialized",Init_ManifestMissing:"Manifest not set. Read more at https://github.com/trezor/trezor-suite/blob/develop/docs/packages/connect/index.md",Handshake_Error:"",Popup_ConnectionMissing:"Unable to establish connection with iframe",Desktop_ConnectionMissing:"Unable to establish connection with Suite",Transport_Missing:"Transport is missing",Method_InvalidPackage:"This package is not suitable to work with browser. Use @trezor/connect-web package instead",Method_InvalidParameter:"",Method_NotAllowed:"Method not allowed for this configuration",Method_PermissionsNotGranted:"Permissions not granted",Method_Cancel:"Canceled",Method_Interrupted:"Popup closed",Method_UnknownCoin:"Coin not found",Method_AddressNotMatch:"Addresses do not match",Method_Override:"override",Method_NoResponse:"Call resolved without response",Method_Unsupported:"Unsupported method",Method_DataOverflowModelOne:"Model One does not support data over 1024 bytes",Backend_NotSupported:"BlockchainLink settings not found in coins.json",Backend_WorkerMissing:"",Backend_Disconnected:"Backend disconnected",Backend_Invalid:"Invalid backend",Backend_Error:"",Runtime:"",Device_NotFound:"Device not found",Device_InitializeFailed:"",Device_FwException:"",Device_ModeException:"",Device_Disconnected:"Device disconnected",Device_UsedElsewhere:"Device is used in another window",Device_InvalidState:"Passphrase is incorrect",Device_CallInProgress:"Device call in progress",Device_MultipleNotSupported:"Multiple devices are not supported",Device_MissingCapability:"Device is missing capability",Device_MissingCapabilityBtcOnly:"Device is missing capability (BTC only)",Device_ThpPairingTagInvalid:"Pairing tag mismatch",Device_ThpStateMissing:"ThpState missing",Device_ThpPairingMethodsException:"No common pairing methods",Failure_UnknownCode:"Unknown error",Failure_EntropyCheck:"",Deeplink_VersionMismatch:"Not compatible with current version of the app",Browser_LocalNetworkPermissionMissing:"Local network permission is missing. Please allow local network access in browser settings."};class Zc extends Error{code;message;constructor(e,t,n){super(t,n),this.code=e,this.message=t}toString(){return`${this.name} (code: ${this.code}): ${this.message}`}}const Qc=(e,t)=>new Zc(e,t||Jc[e]||e),eu=e=>{const t=e?.error instanceof Error?e.error:e;return t instanceof Error?{message:t.message,code:"code"in t?t.code:"Failure_UnknownCode"}:{...e}},tu=e=>({success:!1,error:{message:e.message,code:e.code??"Failure_UnknownCode"}}),nu="DEVICE_EVENT",ru="iframe-call",iu="core-call-cancel",ou="ui-address_validation",au="popup-core-loaded",su="popup-handshake",cu="popup-closed";var uu=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,lu=Math.ceil,du=Math.floor,fu="[BigNumber Error] ",hu=fu+"Number primitive has more than 15 significant digits: ",pu=1e14,bu=14,mu=9007199254740991,gu=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],vu=1e7,yu=1e9;function wu(e){var t=0|e;return e>0||e===t?t:t-1}function xu(e){for(var t,n,r=1,i=e.length,o=e[0]+"";r<i;){for(t=e[r++]+"",n=bu-t.length;n--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function Au(e,t){var n,r,i=e.c,o=t.c,a=e.s,s=t.s,c=e.e,u=t.e;if(!a||!s)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-s:a;if(a!=s)return a;if(n=a<0,r=c==u,!i||!o)return r?0:!i^n?1:-1;if(!r)return c>u^n?1:-1;for(s=(c=i.length)<(u=o.length)?c:u,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^n?1:-1;return c==u?0:c>u^n?1:-1}function Eu(e,t,n,r){if(e<t||e>n||e!==du(e))throw Error(fu+(r||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Su(e){var t=e.c.length-1;return wu(e.e/bu)==t&&e.c[t]%2!=0}function _u(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Ou(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(++t>(r=e.length)){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var Nu=function e(t){var n,r,i,o,a,s,c,u,l,d,f=O.prototype={constructor:O,toString:null,valueOf:null},h=new O(1),p=20,b=4,m=-7,g=21,v=-1e7,y=1e7,w=!1,x=1,A=0,E={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},S="0123456789abcdefghijklmnopqrstuvwxyz",_=!0;function O(e,t){var n,o,a,s,c,u,l,d,f=this;if(!(f instanceof O))return new O(e,t);if(null==t){if(e&&!0===e._isBigNumber)return f.s=e.s,void(!e.c||e.e>y?f.c=f.e=null:e.e<v?f.c=[f.e=0]:(f.e=e.e,f.c=e.c.slice()));if((u="number"==typeof e)&&0*e==0){if(f.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,c=e;c>=10;c/=10,s++);return void(s>y?f.c=f.e=null:(f.e=s,f.c=[e]))}d=String(e)}else{if(!uu.test(d=String(e)))return i(f,d,u);f.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(s=d.indexOf("."))>-1&&(d=d.replace(".","")),(c=d.search(/e/i))>0?(s<0&&(s=c),s+=+d.slice(c+1),d=d.substring(0,c)):s<0&&(s=d.length)}else{if(Eu(t,2,S.length,"Base"),10==t&&_)return C(f=new O(e),p+f.e+1,b);if(d=String(e),u="number"==typeof e){if(0*e!=0)return i(f,d,u,t);if(f.s=1/e<0?(d=d.slice(1),-1):1,O.DEBUG&&d.replace(/^0\.0*|\./,"").length>15)throw Error(hu+e)}else f.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(n=S.slice(0,t),s=c=0,l=d.length;c<l;c++)if(n.indexOf(o=d.charAt(c))<0){if("."==o){if(c>s){s=l;continue}}else if(!a&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){a=!0,c=-1,s=0;continue}return i(f,String(e),u,t)}u=!1,(s=(d=r(d,t,10,f.s)).indexOf("."))>-1?d=d.replace(".",""):s=d.length}for(c=0;48===d.charCodeAt(c);c++);for(l=d.length;48===d.charCodeAt(--l););if(d=d.slice(c,++l)){if(l-=c,u&&O.DEBUG&&l>15&&(e>mu||e!==du(e)))throw Error(hu+f.s*e);if((s=s-c-1)>y)f.c=f.e=null;else if(s<v)f.c=[f.e=0];else{if(f.e=s,f.c=[],c=(s+1)%bu,s<0&&(c+=bu),c<l){for(c&&f.c.push(+d.slice(0,c)),l-=bu;c<l;)f.c.push(+d.slice(c,c+=bu));c=bu-(d=d.slice(c)).length}else c-=l;for(;c--;d+="0");f.c.push(+d)}}else f.c=[f.e=0]}function N(e,t,n,r){var i,o,a,s,c;if(null==n?n=b:Eu(n,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)c=xu(e.c),c=1==r||2==r&&(a<=m||a>=g)?_u(c,a):Ou(c,a,"0");else if(o=(e=C(new O(e),t,n)).e,s=(c=xu(e.c)).length,1==r||2==r&&(t<=o||o<=m)){for(;s<t;c+="0",s++);c=_u(c,o)}else if(t-=a+(2===r&&o>a),c=Ou(c,o,"0"),o+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-s)>0)for(o+1==s&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function k(e,t){for(var n,r,i=1,o=new O(e[0]);i<e.length;i++)(!(r=new O(e[i])).s||(n=Au(o,r))===t||0===n&&o.s===t)&&(o=r);return o}function T(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*bu-1)>y?e.c=e.e=null:n<v?e.c=[e.e=0]:(e.e=n,e.c=t),e}function C(e,t,n,r){var i,o,a,s,c,u,l,d=e.c,f=gu;if(d){e:{for(i=1,s=d[0];s>=10;s/=10,i++);if((o=t-i)<0)o+=bu,a=t,c=d[u=0],l=du(c/f[i-a-1]%10);else if((u=lu((o+1)/bu))>=d.length){if(!r)break e;for(;d.length<=u;d.push(0));c=l=0,i=1,a=(o%=bu)-bu+1}else{for(c=s=d[u],i=1;s>=10;s/=10,i++);l=(a=(o%=bu)-bu+i)<0?0:du(c/f[i-a-1]%10)}if(r=r||t<0||null!=d[u+1]||(a<0?c:c%f[i-a-1]),r=n<4?(l||r)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(o>0?a>0?c/f[i-a]:0:d[u-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,r?(t-=e.e+1,d[0]=f[(bu-t%bu)%bu],e.e=-t||0):d[0]=e.e=0,e;if(0==o?(d.length=u,s=1,u--):(d.length=u+1,s=f[bu-o],d[u]=a>0?du(c/f[i-a]%f[a])*s:0),r)for(;;){if(0==u){for(o=1,a=d[0];a>=10;a/=10,o++);for(a=d[0]+=s,s=1;a>=10;a/=10,s++);o!=s&&(e.e++,d[0]==pu&&(d[0]=1));break}if(d[u]+=s,d[u]!=pu)break;d[u--]=0,s=1}for(o=d.length;0===d[--o];d.pop());}e.e>y?e.c=e.e=null:e.e<v&&(e.c=[e.e=0])}return e}function I(e){var t,n=e.e;return null===n?e.toString():(t=xu(e.c),t=n<=m||n>=g?_u(t,n):Ou(t,n,"0"),e.s<0?"-"+t:t)}return O.clone=e,O.ROUND_UP=0,O.ROUND_DOWN=1,O.ROUND_CEIL=2,O.ROUND_FLOOR=3,O.ROUND_HALF_UP=4,O.ROUND_HALF_DOWN=5,O.ROUND_HALF_EVEN=6,O.ROUND_HALF_CEIL=7,O.ROUND_HALF_FLOOR=8,O.EUCLID=9,O.config=O.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(fu+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(Eu(n=e[t],0,yu,t),p=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(Eu(n=e[t],0,8,t),b=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(Eu(n[0],-yu,0,t),Eu(n[1],0,yu,t),m=n[0],g=n[1]):(Eu(n,-yu,yu,t),m=-(g=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)Eu(n[0],-yu,-1,t),Eu(n[1],1,yu,t),v=n[0],y=n[1];else{if(Eu(n,-yu,yu,t),!n)throw Error(fu+t+" cannot be zero: "+n);v=-(y=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(fu+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw w=!n,Error(fu+"crypto unavailable");w=n}else w=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(Eu(n=e[t],0,9,t),x=n),e.hasOwnProperty(t="POW_PRECISION")&&(Eu(n=e[t],0,yu,t),A=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(fu+t+" not an object: "+n);E=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(fu+t+" invalid: "+n);_="0123456789"==n.slice(0,10),S=n}}return{DECIMAL_PLACES:p,ROUNDING_MODE:b,EXPONENTIAL_AT:[m,g],RANGE:[v,y],CRYPTO:w,MODULO_MODE:x,POW_PRECISION:A,FORMAT:E,ALPHABET:S}},O.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!O.DEBUG)return!0;var t,n,r=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(r)){if((1===o||-1===o)&&i>=-yu&&i<=yu&&i===du(i)){if(0===r[0]){if(0===i&&1===r.length)return!0;break e}if((t=(i+1)%bu)<1&&(t+=bu),String(r[0]).length==t){for(t=0;t<r.length;t++)if((n=r[t])<0||n>=pu||n!==du(n))break e;if(0!==n)return!0}}}else if(null===r&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(fu+"Invalid BigNumber: "+e)},O.maximum=O.max=function(){return k(arguments,-1)},O.minimum=O.min=function(){return k(arguments,1)},O.random=(o=9007199254740992,a=Math.random()*o&2097151?function(){return du(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,r,i,o,s=0,c=[],u=new O(h);if(null==e?e=p:Eu(e,0,yu),i=lu(e/bu),w)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));s<i;)(o=131072*t[s]+(t[s+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[s]=n[0],t[s+1]=n[1]):(c.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw w=!1,Error(fu+"crypto unavailable");for(t=crypto.randomBytes(i*=7);s<i;)(o=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(c.push(o%1e14),s+=7);s=i/7}if(!w)for(;s<i;)(o=a())<9e15&&(c[s++]=o%1e14);for(i=c[--s],e%=bu,i&&e&&(o=gu[bu-e],c[s]=du(i/o)*o);0===c[s];c.pop(),s--);if(s<0)c=[r=0];else{for(r=-1;0===c[0];c.splice(0,1),r-=bu);for(s=1,o=c[0];o>=10;o/=10,s++);s<bu&&(r-=bu-s)}return u.e=r,u.c=c,u}),O.sum=function(){for(var e=1,t=arguments,n=new O(t[0]);e<t.length;)n=n.plus(t[e++]);return n},r=function(){var e="0123456789";function t(e,t,n,r){for(var i,o,a=[0],s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,o,a,s){var c,u,l,d,f,h,m,g,v=r.indexOf("."),y=p,w=b;for(v>=0&&(d=A,A=0,r=r.replace(".",""),h=(g=new O(i)).pow(r.length-v),A=d,g.c=t(Ou(xu(h.c),h.e,"0"),10,o,e),g.e=g.c.length),l=d=(m=t(r,i,o,s?(c=S,e):(c=e,S))).length;0==m[--d];m.pop());if(!m[0])return c.charAt(0);if(v<0?--l:(h.c=m,h.e=l,h.s=a,m=(h=n(h,g,y,w,o)).c,f=h.r,l=h.e),v=m[u=l+y+1],d=o/2,f=f||u<0||null!=m[u+1],f=w<4?(null!=v||f)&&(0==w||w==(h.s<0?3:2)):v>d||v==d&&(4==w||f||6==w&&1&m[u-1]||w==(h.s<0?8:7)),u<1||!m[0])r=f?Ou(c.charAt(1),-y,c.charAt(0)):c.charAt(0);else{if(m.length=u,f)for(--o;++m[--u]>o;)m[u]=0,u||(++l,m=[1].concat(m));for(d=m.length;!m[--d];);for(v=0,r="";v<=d;r+=c.charAt(m[v++]));r=Ou(r,l,c.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,i,o,a,s=0,c=e.length,u=t%vu,l=t/vu|0;for(e=e.slice();c--;)s=((i=u*(o=e[c]%vu)+(r=l*o+(a=e[c]/vu|0)*u)%vu*vu+s)/n|0)+(r/vu|0)+l*a,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,o,a,s){var c,u,l,d,f,h,p,b,m,g,v,y,w,x,A,E,S,_=r.s==i.s?1:-1,N=r.c,k=i.c;if(!(N&&N[0]&&k&&k[0]))return new O(r.s&&i.s&&(N?!k||N[0]!=k[0]:k)?N&&0==N[0]||!k?0*_:_/0:NaN);for(m=(b=new O(_)).c=[],_=o+(u=r.e-i.e)+1,s||(s=pu,u=wu(r.e/bu)-wu(i.e/bu),_=_/bu|0),l=0;k[l]==(N[l]||0);l++);if(k[l]>(N[l]||0)&&u--,_<0)m.push(1),d=!0;else{for(x=N.length,E=k.length,l=0,_+=2,(f=du(s/(k[0]+1)))>1&&(k=e(k,f,s),N=e(N,f,s),E=k.length,x=N.length),w=E,v=(g=N.slice(0,E)).length;v<E;g[v++]=0);S=k.slice(),S=[0].concat(S),A=k[0],k[1]>=s/2&&A++;do{if(f=0,(c=t(k,g,E,v))<0){if(y=g[0],E!=v&&(y=y*s+(g[1]||0)),(f=du(y/A))>1)for(f>=s&&(f=s-1),p=(h=e(k,f,s)).length,v=g.length;1==t(h,g,p,v);)f--,n(h,E<p?S:k,p,s),p=h.length,c=1;else 0==f&&(c=f=1),p=(h=k.slice()).length;if(p<v&&(h=[0].concat(h)),n(g,h,v,s),v=g.length,-1==c)for(;t(k,g,E,v)<1;)f++,n(g,E<v?S:k,v,s),v=g.length}else 0===c&&(f++,g=[0]);m[l++]=f,g[0]?g[v++]=N[w]||0:(g=[N[w]],v=1)}while((w++<x||null!=g[0])&&_--);d=null!=g[0],m[0]||m.splice(0,1)}if(s==pu){for(l=1,_=m[0];_>=10;_/=10,l++);C(b,o+(b.e=l+u*bu-1)+1,a,d)}else b.e=u,b.r=+d;return b}}(),s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,c=/^([^.]+)\.$/,u=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,d=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,n,r){var i,o=n?t:t.replace(d,"");if(l.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!n&&(o=o.replace(s,function(e,t,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=i?e:t}),r&&(i=r,o=o.replace(c,"$1").replace(u,"0.$1")),t!=o))return new O(o,i);if(O.DEBUG)throw Error(fu+"Not a"+(r?" base "+r:"")+" number: "+t);e.s=null}e.c=e.e=null},f.absoluteValue=f.abs=function(){var e=new O(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return Au(this,new O(e,t))},f.decimalPlaces=f.dp=function(e,t){var n,r,i,o=this;if(null!=e)return Eu(e,0,yu),null==t?t=b:Eu(t,0,8),C(new O(o),e+o.e+1,t);if(!(n=o.c))return null;if(r=((i=n.length-1)-wu(this.e/bu))*bu,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},f.dividedBy=f.div=function(e,t){return n(this,new O(e,t),p,b)},f.dividedToIntegerBy=f.idiv=function(e,t){return n(this,new O(e,t),0,1)},f.exponentiatedBy=f.pow=function(e,t){var n,r,i,o,a,s,c,u,l=this;if((e=new O(e)).c&&!e.isInteger())throw Error(fu+"Exponent not an integer: "+I(e));if(null!=t&&(t=new O(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return u=new O(Math.pow(+I(l),a?e.s*(2-Su(e)):+I(e))),t?u.mod(t):u;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new O(NaN);(r=!s&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return o=l.s<0&&Su(e)?-0:0,l.e>-1&&(o=1/o),new O(s?1/o:o);A&&(o=lu(A/bu+2))}for(a?(n=new O(.5),s&&(e.s=1),c=Su(e)):c=(i=Math.abs(+I(e)))%2,u=new O(h);;){if(c){if(!(u=u.times(l)).c)break;o?u.c.length>o&&(u.c.length=o):r&&(u=u.mod(t))}if(i){if(0===(i=du(i/2)))break;c=i%2}else if(C(e=e.times(n),e.e+1,1),e.e>14)c=Su(e);else{if(0===(i=+I(e)))break;c=i%2}l=l.times(l),o?l.c&&l.c.length>o&&(l.c.length=o):r&&(l=l.mod(t))}return r?u:(s&&(u=h.div(u)),t?u.mod(t):o?C(u,A,b,void 0):u)},f.integerValue=function(e){var t=new O(this);return null==e?e=b:Eu(e,0,8),C(t,t.e+1,e)},f.isEqualTo=f.eq=function(e,t){return 0===Au(this,new O(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return Au(this,new O(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=Au(this,new O(e,t)))||0===t},f.isInteger=function(){return!!this.c&&wu(this.e/bu)>this.c.length-2},f.isLessThan=f.lt=function(e,t){return Au(this,new O(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=Au(this,new O(e,t)))||0===t},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(e,t){var n,r,i,o,a=this,s=a.s;if(t=(e=new O(e,t)).s,!s||!t)return new O(NaN);if(s!=t)return e.s=-t,a.plus(e);var c=a.e/bu,u=e.e/bu,l=a.c,d=e.c;if(!c||!u){if(!l||!d)return l?(e.s=-t,e):new O(d?a:NaN);if(!l[0]||!d[0])return d[0]?(e.s=-t,e):new O(l[0]?a:3==b?-0:0)}if(c=wu(c),u=wu(u),l=l.slice(),s=c-u){for((o=s<0)?(s=-s,i=l):(u=c,i=d),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(o=(s=l.length)<(t=d.length))?s:t,s=t=0;t<r;t++)if(l[t]!=d[t]){o=l[t]<d[t];break}if(o&&(i=l,l=d,d=i,e.s=-e.s),(t=(r=d.length)-(n=l.length))>0)for(;t--;l[n++]=0);for(t=pu-1;r>s;){if(l[--r]<d[r]){for(n=r;n&&!l[--n];l[n]=t);--l[n],l[r]+=pu}l[r]-=d[r]}for(;0==l[0];l.splice(0,1),--u);return l[0]?T(e,l,u):(e.s=3==b?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,t){var r,i,o=this;return e=new O(e,t),!o.c||!e.s||e.c&&!e.c[0]?new O(NaN):!e.c||o.c&&!o.c[0]?new O(o):(9==x?(i=e.s,e.s=1,r=n(o,e,0,3),e.s=i,r.s*=i):r=n(o,e,0,x),(e=o.minus(r.times(e))).c[0]||1!=x||(e.s=o.s),e)},f.multipliedBy=f.times=function(e,t){var n,r,i,o,a,s,c,u,l,d,f,h,p,b,m,g=this,v=g.c,y=(e=new O(e,t)).c;if(!(v&&y&&v[0]&&y[0]))return!g.s||!e.s||v&&!v[0]&&!y||y&&!y[0]&&!v?e.c=e.e=e.s=null:(e.s*=g.s,v&&y?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=wu(g.e/bu)+wu(e.e/bu),e.s*=g.s,(c=v.length)<(d=y.length)&&(p=v,v=y,y=p,i=c,c=d,d=i),i=c+d,p=[];i--;p.push(0));for(b=pu,m=vu,i=d;--i>=0;){for(n=0,f=y[i]%m,h=y[i]/m|0,o=i+(a=c);o>i;)n=((u=f*(u=v[--a]%m)+(s=h*u+(l=v[a]/m|0)*f)%m*m+p[o]+n)/b|0)+(s/m|0)+h*l,p[o--]=u%b;p[o]=n}return n?++r:p.splice(0,1),T(e,p,r)},f.negated=function(){var e=new O(this);return e.s=-e.s||null,e},f.plus=function(e,t){var n,r=this,i=r.s;if(t=(e=new O(e,t)).s,!i||!t)return new O(NaN);if(i!=t)return e.s=-t,r.minus(e);var o=r.e/bu,a=e.e/bu,s=r.c,c=e.c;if(!o||!a){if(!s||!c)return new O(i/0);if(!s[0]||!c[0])return c[0]?e:new O(s[0]?r:0*i)}if(o=wu(o),a=wu(a),s=s.slice(),i=o-a){for(i>0?(a=o,n=c):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for((i=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+c[t]+i)/pu|0,s[t]=pu===s[t]?0:s[t]%pu;return i&&(s=[i].concat(s),++a),T(e,s,a)},f.precision=f.sd=function(e,t){var n,r,i,o=this;if(null!=e&&e!==!!e)return Eu(e,1,yu),null==t?t=b:Eu(t,0,8),C(new O(o),e,t);if(!(n=o.c))return null;if(r=(i=n.length-1)*bu+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&o.e+1>r&&(r=o.e+1),r},f.shiftedBy=function(e){return Eu(e,-9007199254740991,mu),this.times("1e"+e)},f.squareRoot=f.sqrt=function(){var e,t,r,i,o,a=this,s=a.c,c=a.s,u=a.e,l=p+4,d=new O("0.5");if(1!==c||!s||!s[0])return new O(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(c=Math.sqrt(+I(a)))||c==1/0?(((t=xu(s)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=wu((u+1)/2)-(u<0||u%2),r=new O(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):r=new O(c+""),r.c[0])for((c=(u=r.e)+l)<3&&(c=0);;)if(o=r,r=d.times(o.plus(n(a,o,l,1))),xu(o.c).slice(0,c)===(t=xu(r.c)).slice(0,c)){if(r.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(C(r,r.e+p+2,1),e=!r.times(r).eq(a));break}if(!i&&(C(o,o.e+p+2,0),o.times(o).eq(a))){r=o;break}l+=4,c+=4,i=1}return C(r,r.e+p+1,b,e)},f.toExponential=function(e,t){return null!=e&&(Eu(e,0,yu),e++),N(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(Eu(e,0,yu),e=e+this.e+1),N(this,e,t)},f.toFormat=function(e,t,n){var r,i=this;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=E;else if("object"!=typeof n)throw Error(fu+"Argument not an object: "+n);if(r=i.toFixed(e,t),i.c){var o,a=r.split("."),s=+n.groupSize,c=+n.secondaryGroupSize,u=n.groupSeparator||"",l=a[0],d=a[1],f=i.s<0,h=f?l.slice(1):l,p=h.length;if(c&&(o=s,s=c,c=o,p-=o),s>0&&p>0){for(o=p%s||s,l=h.substr(0,o);o<p;o+=s)l+=u+h.substr(o,s);c>0&&(l+=u+h.slice(o)),f&&(l="-"+l)}r=d?l+(n.decimalSeparator||"")+((c=+n.fractionGroupSize)?d.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):d):l}return(n.prefix||"")+r+(n.suffix||"")},f.toFraction=function(e){var t,r,i,o,a,s,c,u,l,d,f,p,m=this,g=m.c;if(null!=e&&(!(c=new O(e)).isInteger()&&(c.c||1!==c.s)||c.lt(h)))throw Error(fu+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+I(c));if(!g)return new O(m);for(t=new O(h),l=r=new O(h),i=u=new O(h),p=xu(g),a=t.e=p.length-m.e-1,t.c[0]=gu[(s=a%bu)<0?bu+s:s],e=!e||c.comparedTo(t)>0?a>0?t:l:c,s=y,y=1/0,c=new O(p),u.c[0]=0;d=n(c,t,0,1),1!=(o=r.plus(d.times(i))).comparedTo(e);)r=i,i=o,l=u.plus(d.times(o=l)),u=o,t=c.minus(d.times(o=t)),c=o;return o=n(e.minus(r),i,0,1),u=u.plus(o.times(l)),r=r.plus(o.times(i)),u.s=l.s=m.s,f=n(l,i,a*=2,b).minus(m).abs().comparedTo(n(u,r,a,b).minus(m).abs())<1?[l,i]:[u,r],y=s,f},f.toNumber=function(){return+I(this)},f.toPrecision=function(e,t){return null!=e&&Eu(e,1,yu),N(this,e,t,2)},f.toString=function(e){var t,n=this,i=n.s,o=n.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=m||o>=g?_u(xu(n.c),o):Ou(xu(n.c),o,"0"):10===e&&_?t=Ou(xu((n=C(new O(n),p+o+1,b)).c),n.e,"0"):(Eu(e,2,S.length,"Base"),t=r(Ou(xu(n.c),o,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return I(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=t&&O.set(t),O}();const ku=e=>{let t=()=>{},n=()=>{};const r=new Promise((e,r)=>{t=e,n=r});return{id:e,resolve:t,reject:n,promise:r}},Tu=e=>{const{initialId:t=0,timeout:n=0,onTimeout:r,generateId:i}=e??{},o=[];let a=t;const s=i??(()=>a++);let c,u=ku();const l=()=>{const{resolve:e}=u;u=ku(),e()},d=()=>{const e=Date.now(),t=o.reduce((e,{deadline:t})=>(e&&t?Math.min:Math.max)(e,t),0);c&&clearTimeout(c),c=t?setTimeout(f,Math.max(t-e,0)):void 0},f=()=>{const e=Date.now();o.filter(t=>t.deadline&&t.deadline<=e).forEach(e=>{r?.(e.id),e.deadline=0}),d()},h=(e=n)=>{const t=s(),r=ku(t),i=e&&Date.now()+e;return o.push({...r,deadline:i}),e&&d(),{promiseId:t,promise:r.promise}},p=e=>{const t=o.findIndex(({id:t})=>t===e),[n]=t>=0?o.splice(t,1):[void 0];return n&&l(),n?.deadline&&d(),n};return{length:()=>o.length,create:h,createConcurrent:async(e,t)=>{for(;o.length>=e;)await u.promise;return h(t)},resolve:(e,t)=>{const n=p(e);return n?.resolve(t),!!n},reject:(e,t)=>{const n=p(e);return n?.reject(t),!!n},resolveAll:e=>{o.forEach(t=>t.resolve(e(t.id)));o.splice(0,o.length).length&&(l(),d())},rejectAll:e=>{o.forEach(t=>t.reject(e));o.splice(0,o.length).length&&(l(),d())}}},Cu=e=>{const t=e??(()=>{const e=Symbol(),t={};return async(n=e)=>{for(;t[n];)await t[n];let r=()=>{};return t[n]=new Promise(e=>{r=e}).finally(()=>{delete t[n]}),r}})();return(e,n)=>t(n).then(t=>Promise.resolve().then(e).finally(t))};class Iu{prefix;enabled;css="";messages;logWriter;MAX_ENTRIES=100;constructor(e,t,n){this.prefix=e,this.enabled=t,this.messages=[],n&&(this.logWriter=n)}setColors(e){this.css="undefined"!=typeof window&&e[this.prefix]?e[this.prefix]:""}addMessage({level:e,prefix:t,timestamp:n},...r){const i={level:e,prefix:t,css:this.css,message:r,timestamp:n||Date.now()};if(this.messages.push(i),this.logWriter)try{this.logWriter.add(i)}catch(e){console.error("There was an error adding log message",e,i)}this.messages.length>this.MAX_ENTRIES&&this.messages.shift()}setWriter(e){this.logWriter=e}log(...e){this.addMessage({level:"log",prefix:this.prefix},...e),this.enabled&&console.log(`%c${this.prefix}`,this.css,...e)}error(...e){this.addMessage({level:"error",prefix:this.prefix},...e),this.enabled&&console.error(`%c${this.prefix}`,this.css,...e)}info(...e){this.addMessage({level:"info",prefix:this.prefix},...e),this.enabled&&console.info(`%c${this.prefix}`,this.css,...e)}warn(...e){this.addMessage({level:"warn",prefix:this.prefix},...e),this.enabled&&console.warn(`%c${this.prefix}`,this.css,...e)}debug(...e){this.addMessage({level:"debug",prefix:this.prefix},...e),this.enabled&&(this.css?console.log(`%c${this.prefix}`,this.css,...e):console.log(this.prefix,...e))}getLog(){return this.messages}}class Bu extends Error{constructor(){super("Aborted by signal")}}const Lu=e=>Array.isArray(e),Mu=(e,t)=>new Promise((n,r)=>{const i=new Bu;if(t.aborted)return r(i);if(void 0===e)return n();let o;const a=()=>{clearTimeout(o),t.removeEventListener("abort",a),r(i)};o=setTimeout(()=>{t.removeEventListener("abort",a),n()},e),t.addEventListener("abort",a)}),Ru=(e,t,n)=>new Promise((r,i)=>{const o=new Bu;if(n.aborted)return i(o);let a;const s=()=>{clearTimeout(a),n.removeEventListener("abort",s),i(o)};a=setTimeout(()=>{n.removeEventListener("abort",s),i(t)},e),n.addEventListener("abort",s)}),Pu=(e,t,n)=>void 0===e?[]:[Ru(e,t,n)],Uu=(e,t)=>new Promise((n,r)=>{const i=new Bu;if(t.aborted)return r(i);if(e?.aborted)return r(i);const o=()=>r(i);e?.addEventListener("abort",o);const a=()=>{e?.removeEventListener("abort",o),t.removeEventListener("abort",a),r(i)};t.addEventListener("abort",a)}),ju=async(e,t)=>{const n=new AbortController;t.aborted&&n.abort();const r=()=>{t.removeEventListener("abort",r),n.abort()};t.addEventListener("abort",r);try{return await new Promise(t=>t(e(n.signal)))}finally{t.aborted||t.removeEventListener("abort",r)}};class Fu extends Error{constructor(){super("Aborted by timeout")}}class Du extends Error{constructor(){super("Aborted by deadline")}}const zu=async(e,t)=>{const{signal:n,delay:r,attempts:i,timeout:o,deadline:a,gap:s,attemptFailureHandler:c}=t,u=a&&a-Date.now(),l=Lu(i)?i.length:i??(a?1/0:1),d=new AbortController,f=d.signal,h=Lu(i)?e=>i[e]:()=>({timeout:o,gap:s}),p=new Du,b=new Fu,m=t.graceful&&n,g=new AbortController;if(m)if(n.aborted)g.abort();else{const e=()=>{n.removeEventListener("abort",e),f.removeEventListener("abort",e),g.abort()};n.addEventListener("abort",e),f.addEventListener("abort",e)}try{return await Promise.race([...m?[]:[Uu(n,f)],...Pu(u,p,f),Mu(r,f).then(()=>(async(e,t,n,r)=>{for(let i=0;i<e-1&&!r.aborted;i++){const e=new AbortController,o=()=>e.abort();r.addEventListener("abort",o);try{return await t(i,e.signal)}catch(e){o(),await n(i,e)}finally{r.removeEventListener("abort",o)}}return r.aborted?Promise.reject(new Bu):t(e-1,r)})(l,(t,n)=>Promise.race([...Pu(h(t).timeout,b,f),ju(e,n)]),(e,t)=>{const n=c?.(t);return n?Promise.reject(n):Mu(h(e).gap??0,f)},m?g.signal:f))])}finally{d.abort()}};class $u extends aa.EventEmitter{listenerCount(e){return super.listenerCount(e)}}var Wu,Xu,qu;!function(e){e[e.mainnet=764824073]="mainnet",e[e.testnet_preprod=1]="testnet_preprod",e[e.testnet_preview=2]="testnet_preview",e[e.testnet_legacy=1097911063]="testnet_legacy"}(Wu||(Wu={})),function(e){e[e.mainnet=1]="mainnet",e[e.testnet=0]="testnet"}(Xu||(Xu={})),function(e){e[e.EdDSA=-8]="EdDSA"}(qu||(qu={}));const Ku="10.0.0-alpha.1";Ku.split(".").map(e=>parseInt(e,10))[0];const Gu=Ku,Hu=((new Date).getTime(),e=>"string"==typeof e?e:Gu);class Vu extends $u{}class Yu extends aa.EventEmitter{_ws;static CONNECTING=0;static OPEN=1;static CLOSING=2;static CLOSED=3;constructor(e,t,n){super(),this._ws=new WebSocket(e),this._ws.onclose=()=>{this.emit("close")},this._ws.onopen=()=>{this.emit("open")},this._ws.onerror=e=>{this.emit("error",new Ju(`WsWrapper error. Ready state: ${this.readyState}`))},this._ws.onmessage=e=>{this.emit("message",e.data)}}close(){this.readyState===Yu.OPEN&&this._ws.close()}send(e){if(this.readyState!==Yu.OPEN)throw new Ju(`Connection is not open. state: ${this.readyState}`);this._ws.send(e)}get readyState(){return this._ws.readyState}}class Ju extends Error{}class Zu extends $u{options;messages;emitter=this;ws;pingTimeout;connectPromise;ping(){return this.sendMessage({type:"ping"})}constructor(e){super(),this.options=e,this.messages=Tu({timeout:this.options.timeout||2e4,onTimeout:e=>this.onMessageTimeout(e)})}initWebsocket({url:e,timeout:t,headers:n,agent:r}){if("string"!=typeof e)throw new Ju("websocket_no_url");return e.startsWith("http")&&(e=e.replace("http","ws")),new Yu(e,{timeout:t,headers:{Origin:"https://node.trezor.io",...n},agent:r})}setPingTimeout(){clearTimeout(this.pingTimeout);this.pingTimeout=this.isConnected()?setTimeout(()=>{if(this.isConnected())return this.onPing().catch(()=>{})},this.options.pingTimeout||5e4):void 0}onPing(){return this.ping()}onMessageTimeout(e){const{ws:t}=this;t&&(this.messages.rejectAll(new Ju("websocket_timeout")),t.close())}onError(){this.onClose()}async sendMessage(e,{timeout:t,onIdCreated:n}={}){const{ws:r}=this;if(!r||!this.isConnected())throw new Ju("websocket_not_initialized");let i;if(this.options.concurrency){if(i=await this.messages.createConcurrent(this.options.concurrency,t),!r||!this.isConnected())throw this.messages.resolve(i.promiseId,void 0),new Ju("websocket_not_initialized")}else i=this.messages.create(t);n?.(i.promiseId);const o={id:i.promiseId.toString(),...e};return this.setPingTimeout(),this.options.onSending?.(e),r.send(JSON.stringify(o)),i.promise}sendRawMessage(e){const{ws:t}=this;if(!t||!this.isConnected())throw new Ju("websocket_not_initialized");t.send(e,{binary:"string"!=typeof e}),this.setPingTimeout()}onMessage(e,t){try{const n=JSON.parse(e.toString()),r=Number(n.id);try{const e=t?t(n):n;e&&this.messages.resolve(r,e)}catch(e){this.messages.reject(r,e)}}catch{}finally{this.setPingTimeout()}}async connect(){if(this.connectPromise)return this.connectPromise;if(this.isConnected())return Promise.resolve();this.ws?.readyState===Yu.CLOSING&&await new Promise(e=>this.emitter.once("disconnected",e));const e=ku();this.connectPromise=e.promise;const t=this.createWebsocket?this.createWebsocket():this.initWebsocket(this.options),n=setTimeout(()=>{this.onClose(),e.reject(new Ju("websocket_timeout"));try{t.close()}catch{}},this.options.connectionTimeout||this.options.timeout||2e4);return t.once("error",t=>{clearTimeout(n),this.onClose(),e.reject(new Ju(t.message))}),t.on("open",()=>{clearTimeout(n),this.init(),e.resolve()}),this.ws=t,e.promise.finally(()=>{this.connectPromise=void 0})}init(){const{ws:e}=this;if(!e||!this.isConnected())throw Error("Websocket init cannot be called");e.removeAllListeners(),e.on("error",e=>this.onError()),e.on("message",e=>this.onMessage(e)),e.on("close",()=>{this.emitter.emit("disconnected"),this.onClose()})}disconnect(){if(this.isConnected()){const e=new Promise(e=>{this.ws?.once("close",e)});return this.ws?.close(),e}return Promise.resolve()}isConnected(){return this.ws?.readyState===Yu.OPEN}onClose(){clearTimeout(this.pingTimeout),this.ws?.removeAllListeners(),this.ws?.on("error",()=>{}),this.messages.rejectAll(new Ju("Websocket closed unexpectedly"))}dispose(){this.removeAllListeners(),this.disconnect(),this.onClose()}}const Qu="#bada55",el="#20abd8",tl="#f4a744",nl={"@trezor/connect":`color: ${el}; background: #000;`,"@trezor/connect-web":`color: ${el}; background: #000;`,"@trezor/connect-webextension":`color: ${el}; background: #000;`,IFrame:`color: ${tl}; background: #000;`,Core:`color: ${tl}; background: #000;`,DeviceList:`color: ${Qu}; background: #000;`,Device:`color: ${Qu}; background: #000;`,DeviceCommands:`color: ${Qu}; background: #000;`,"@trezor/transport":`color: ${Qu}; background: #000;`},rl=new class{logs={};writer;colors={};constructor({colors:e}){this.colors=e}initLog(e,t,n){const r=n||this.writer,i=new Iu(e,!!t,r);return this.colors&&i.setColors(this.colors),this.logs[e]=i,i}setLogWriter(e){Object.keys(this.logs).forEach(t=>{if(this.writer=e(),this.writer){this.logs[t].setWriter(this.writer);const{messages:e}=this.logs[t];e.forEach(e=>{this.writer?.add(e)})}})}enableLog(e){Object.keys(this.logs).forEach(t=>{this.logs[t].enabled=!!e})}enableLogByPrefix(e,t){this.logs[e]&&(this.logs[e].enabled=t)}getLog(){let e=[];return Object.keys(this.logs).forEach(t=>{e=e.concat(this.logs[t].messages)}),e.sort((e,t)=>e.timestamp-t.timestamp),e}}({colors:nl}),il=rl.initLog.bind(rl);rl.setLogWriter.bind(rl),rl.enableLog.bind(rl),rl.enableLogByPrefix.bind(rl),rl.getLog.bind(rl);const ol="https://dev.suite.sldev.cz",al=`${ol}/connect/`,sl=(e,t)=>{if("http://localhost:8088"===t)return"http://localhost:8000/connect-popup";if(e.startsWith(al)){const t=(e=>{let t;try{t=new URL(e).pathname}catch{t=new URL(e,ol).pathname}const n=t.match(/\/connect\/(.+)/);if(n)return n[1].replace(/^(.+)\/(?:methods|settings)\/.*$/,"$1").replace(/\/$/,"")||void 0})(e);if(t)return`${ol}/suite-web/${t}/web/connect-popup`}return"https://suite.trezor.io/web/connect-popup"};class cl extends $u{messages=Tu({generateId:()=>crypto.randomUUID()});messagesQueue=[];isConnected=!1;handshakeMaxRetries=5;handshakeRetryInterval=2e3;handshakeFinished;lazyHandshake;logger;sendFn;channel;constructor({sendFn:e,channel:t,logger:n,lazyHandshake:r=!1}){super(),this.channel=t,this.sendFn=e,this.lazyHandshake=r,this.logger=n}init(){return this.handshakeFinished||(this.handshakeFinished=ku(),this.lazyHandshake||this.handshakeWithPeer()),this.handshakeFinished.promise}handshakeWithPeer(){return this.logger?.log(this.channel.here,"handshake"),zu(async()=>{this.postMessage({type:"channel-handshake-request",data:{success:!0,payload:void 0}},{usePromise:!1,useQueue:!1}),await(this.handshakeFinished?.promise)},{attempts:this.handshakeMaxRetries,timeout:this.handshakeRetryInterval}).then(()=>{this.logger?.log(this.channel.here,"handshake confirmed"),this.messagesQueue.forEach(e=>{e.channel=this.channel,this.sendFn(e)}),this.messagesQueue=[]}).catch(()=>{this.handshakeFinished?.reject(new Error("handshake failed")),this.handshakeFinished=void 0})}onMessage(e){const t=e,{channel:n,id:r,type:i,...o}=t;if(!n?.peer||n.peer!==this.channel.here)return;if(!n?.here||this.channel.peer!==n.here)return;if("channel-handshake-request"===i)return this.postMessage({type:"channel-handshake-confirm",data:{success:!0,payload:void 0}},{usePromise:!1,useQueue:!1}),void(this.lazyHandshake&&this.handshakeWithPeer());if("channel-handshake-confirm"===i)return void this.handshakeFinished?.resolve(void 0);this.messages.resolve(r,{id:r,...o});const a=this.messages.length();a>5&&this.logger?.warn(`too many message promises (${a}). this feels unexpected!`),this.emit("message",t)}postMessage(e,{usePromise:t=!0,useQueue:n=!0}={}){if(e.channel=this.channel,!t){try{this.sendFn(e)}catch{n&&this.messagesQueue.push(e)}return}const{promise:r,promiseId:i}=this.messages.create();e.id=i;try{this.sendFn(e)}catch{n&&this.messagesQueue.push(e)}return r}resolveMessagePromises(e){this.messages.resolveAll(t=>({id:t,payload:e}))}clearPendingSends(){}abortHandshake(e){this.handshakeFinished?.reject(new Error(e??"Handshake aborted")),this.handshakeFinished=void 0}clear(){this.handshakeFinished=void 0}}class ul extends cl{_windowHere;_listener;_origin;constructor({windowHere:e,windowPeer:t,channel:n,logger:r,origin:i}){super({channel:n,sendFn:e=>{t()?.postMessage(e,i)},logger:r}),this._listener=this.listener.bind(this),this._windowHere=e,this._origin=i,this.connect()}listener(e){if(e.origin!==this._origin||"null"===e.origin)return void this.logger?.warn(`WindowWindowChannel: ignoring message from unexpected origin "${e.origin}", expected "${this._origin}"`);const t={...e.data,success:!0,origin:e.origin,payload:e.data.payload||{},channel:e.data.channel||{peer:this.channel.here,here:this.channel.peer}};this.onMessage(t)}connect(){this._windowHere.addEventListener("message",this._listener),this.isConnected=!0}disconnect(){this.isConnected&&(this._windowHere.removeEventListener("message",this._listener),this.isConnected=!1)}}const ll=e=>{if("string"!=typeof e)return"unknown";if(e.startsWith("file://"))return"file://";const[t]=e.match(/^https?:\/\/[^/]+/)??[];return t??"unknown"};class dl extends sa{channel;handshakePromise;logger;popupSrc;manifest;version;closeInterval;locked=!1;closedEmitted=!1;pendingFocusOrCreate=Promise.resolve();constructor({popupSrc:e,manifest:t,version:n,logger:r}){super(),this.logger=r,this.popupSrc=e,this.manifest=t,this.version=n,this.channel=this.createChannel(ll(e)),this.handshakePromise=ku(),this.handshakePromise.promise.catch(()=>{}),this.channel.on("message",this.handleCoreMessage.bind(this))}async focusOrCreate(){this.pendingFocusOrCreate=this.pendingFocusOrCreate.catch(()=>{}).then(()=>this._focusOrCreate()),await this.pendingFocusOrCreate}async _focusOrCreate(){const e=await this.isOpen();if(!e&&this.locked&&this.reset(!1),!this.locked)return e&&await this.close(),this.locked=!0,this.closedEmitted=!1,this.open();this.focusPopup()}buildPopupUrl(e){return e}focusPopup(){}startCloseMonitoring(){this.closeInterval=setInterval(async()=>{await this.isOpen()||this.handlePopupClosed()},500)}async handleCoreMessage(e){this.logger.debug("handleCoreMessage",e),e.type===au?(this.channel.postMessage({type:su,payload:{manifest:this.manifest,version:this.version}}),this.handshakePromise?.resolve()):e.type===cu?(await this.close(),this.handlePopupClosed()):e.event===nu&&this.emit(nu,e)}handlePopupClosed(){this.emitClosed(),this.reset()}reset(e=!0){this.locked&&(this.locked=!1,this.handshakePromise?.reject(Qc("Method_Interrupted")),this.handshakePromise=ku(),this.handshakePromise.promise.catch(()=>{}),this.channel.abortHandshake("Popup closed"),this.channel.disconnect(),this.closeInterval&&(clearInterval(this.closeInterval),this.closeInterval=void 0),this.onReset(e))}handleOpenFailure(e){this.logger.error("Failed to open popup:",e);const t=new Error(e);this.channel.abortHandshake(e),this.handshakePromise?.reject(t),this.handlePopupClosed()}async close(){await this.isOpen()&&(this.logger.debug("closing popup"),this.closePopup(),this.channel.clear())}emitClosed(){this.closedEmitted||(this.closedEmitted=!0,this.channel.resolveMessagePromises({success:!1,error:Qc("Method_Interrupted")}),this.emit(cu))}}const fl="trezor-connect-bootstrap",hl=()=>document.getElementById(fl)??void 0,pl=()=>{let e,t;const n=()=>{t&&(window.clearTimeout(t),t=void 0)},r=()=>{n(),e?.reject(Qc("Handshake_Error","iframe-blocked"))},i=()=>{const t=hl();if(!t)return r();try{const e=t.contentWindow?.location.origin;if(!e||"null"===e)return r()}catch{}t.onload=null,e?.resolve()};return{create:r=>{if(e)return e.promise;if(hl())return Promise.resolve();e=ku();const o=(()=>{const e=document.createElement("iframe");return e.id=fl,e.frameBorder="0",e.width="0px",e.height="0px",e.style.position="absolute",e.style.display="none",e.style.border="0px",e.style.width="0px",e.style.height="0px",e})();return t=setTimeout(()=>{e?.reject(Qc("Handshake_Error","iframe-timeout"))},1e4),o.onload=i,o.setAttribute("src",r),document.body.appendChild(o),e.promise.finally(()=>{n()}).catch(e=>{throw o.parentNode&&o.parentNode.removeChild(o),e})},get:hl}},bl={ENV_NOT_SUPPORTED:"env-not-supported",HANDSHAKE_TIMEOUT:"handshake-timeout",STORAGE_ACCESS_DENIED:"storage-access-denied",CHANNEL_ID_MISSING:"channel-id-missing",ORIGIN_MISSING:"origin-missing",UNKNOWN:"unknown"};class ml extends dl{popupWindow;iframe=pl();channelId=(e=>{let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let r=0;r<e;r++)t+=n.charAt(Math.floor(62*Math.random()));return t})(16);createChannel(){return new ul({windowHere:window,windowPeer:()=>this.iframe.get()?.contentWindow||void 0,channel:{here:"@trezor/connect-web",peer:"@trezor/connect-popup"},logger:this.logger,origin:ll(this.popupSrc)})}async open(){const e=`${this.buildPopupUrl(this.popupSrc)}/bootstrap.html?${`connect-popup-req=${this.channelId}`}${this.logger.enabled?"&debug=1":""}`,t=ll(this.popupSrc),n=window.open("about:blank","_blank");if(!n){const e=Qc("Handshake_Error","popup-blocked");return this.handleOpenFailure(e.message),Promise.reject(e)}try{await this.iframe.create(e)}catch(e){return n.close(),this.handleOpenFailure(e.message),Promise.reject(e)}n.location.href=e;const r=new ul({windowHere:window,windowPeer:()=>this.iframe.get()?.contentWindow||void 0,channel:{here:"@trezor/connect-web",peer:"@trezor/connect-bootstrap-iframe"},logger:this.logger,origin:t});r.on("message",e=>{"channel-handshake-error"===e.type&&(n.postMessage({type:"channel-handshake-error",error:e.error},t),this.handleOpenFailure(e.error),r.abortHandshake(e.error))});try{await r.init(),r.disconnect()}catch(e){this.handleOpenFailure(e.message),r.disconnect();return Object.values(bl).includes(e.message)?Promise.reject(Qc("Handshake_Error",e.message)):Promise.reject(e)}return this.channel.isConnected||this.channel.connect(),Promise.resolve()}focusPopup(){this.popupWindow?.focus()}closePopup(){this.popupWindow?.close(),this.popupWindow=void 0}isOpen(){return Promise.resolve(void 0!==this.popupWindow)}onReset(){}}class gl extends cl{currentId;allowedOrigin;messageListener;sendChain=Promise.resolve();static SEND_SETTLE_MS=100;constructor({channel:e,logger:t,currentId:n,allowedOrigin:r}){super({channel:e,sendFn:e=>{this.sendChain=this.sendChain.catch(()=>{}).then(()=>this.doSend(e)).then(()=>new Promise(e=>setTimeout(e,gl.SEND_SETTLE_MS)))},logger:t}),this.currentId=n,this.allowedOrigin=r}async doSend(e){try{const t=await(this.currentId?.());if(this.logger?.debug("CHANNEL sending to tab:",t,"message:",e),!t)throw this.logger?.error("CHANNEL: No tab ID available, cannot send message"),new Error("No tab ID available");e.id||this.logger?.warn("CHANNEL: Message without ID, this might cause issues with response handling",e);const n=await Promise.race([new Promise((e,n)=>{chrome.tabs.get(t,t=>{chrome.runtime.lastError?(this.logger?.error("CHANNEL: Error getting tab:",chrome.runtime.lastError),n(chrome.runtime.lastError)):e(t)})}),new Promise((e,t)=>setTimeout(()=>t(new Error("chrome.tabs.get timeout after 5s")),5e3))]);if(!n?.url)throw new Error("Trezor suite tab URL not available, the manifest must declare host_permissions matching the popup origin");const r=new URL(n.url),i=encodeURIComponent(JSON.stringify(e));r.hash=`#extension-id=${chrome.runtime.id}&message=${i}`,chrome.tabs.update(t,{url:r.toString()})}catch(e){throw this.logger?.error("CHANNEL: Error sending message via tab update:",e),e}}clearPendingSends(){this.sendChain=Promise.resolve()}connect(){this.messageListener?this.logger?.debug("CHANNEL: Listener already registered, skipping"):(this.logger?.debug("CHANNEL: connect called, setting up onMessageExternal listener"),this.messageListener=(e,t,n)=>{if(this.logger?.debug("CHANNEL: onMessageExternal fired:",{message:e,sender:t}),!t.tab)return this.logger?.warn("CHANNEL: Received message not from a tab, ignoring",t),!1;if(this.allowedOrigin){if(!t.tab.url)return this.logger?.warn(`CHANNEL: Missing sender tab URL while allowed origin is configured (allowed=${this.allowedOrigin}). Ignoring.`),!1;let e,n;try{e=new URL(t.tab.url).origin,n=new URL(this.allowedOrigin).origin}catch{return this.logger?.warn(`CHANNEL: Could not parse sender or allowed origin (sender=${t.tab.url}, allowed=${this.allowedOrigin}). Ignoring.`),!1}if(e!==n)return this.logger?.warn(`CHANNEL: Sender origin mismatch — expected ${n}, got ${e}. Ignoring.`),!1}if(!e.channel)return this.logger?.warn("CHANNEL: Received message without channel info, ignoring"),n({error:"Missing channel info"}),!1;this.logger?.debug("CHANNEL: Processing message through onMessage"),this.onMessage(e)},chrome.runtime.onMessageExternal.addListener(this.messageListener),this.isConnected=!0,this.logger?.debug("CHANNEL: Listener registered successfully"))}disconnect(){this.isConnected&&(this.messageListener&&(chrome.runtime.onMessageExternal.removeListener(this.messageListener),this.messageListener=void 0),this.clear(),this.isConnected=!1)}}class vl extends dl{popupWindow;popupWindowPromise=ku();extensionTabId=0;buildPopupUrl(e){if("undefined"!=typeof chrome&&chrome.runtime?.id){const t=new URLSearchParams;return t.set("extension-id",chrome.runtime.id),e+"#"+t.toString()}return e}checkIfTabExists(e){return new Promise(t=>{chrome.tabs.get(e,()=>{t(!chrome.runtime.lastError)})})}logChromeError(e,t){t&&this.logger.error(`Chrome ${e} error:`,t)}createChannel(e){return new gl({channel:{here:"@trezor/connect-webextension-externally-connectable",peer:"@trezor/suite-web"},currentId:()=>this.popupWindowPromise?.promise.then(e=>e.id),logger:this.logger,allowedOrigin:e})}open(){this.popupWindowPromise=ku(),this.popupWindowPromise.promise.catch(()=>{});const e=this.buildPopupUrl(this.popupSrc);return chrome.windows.getCurrent(t=>{this.logger.debug("opening popup. currentWindow type:",t.type),"normal"!==t.type?this.openPopupInNewWindow(e):this.openPopupInNewTab(e)}),this.channel.isConnected||(this.channel.connect(),this.channel.init().catch(e=>{this.logger.error("Channel handshake failed:",e)})),Promise.resolve()}openPopupInNewWindow(e){chrome.windows.create({url:e},e=>{if(!e)return this.popupWindowPromise?.reject(new Error("Failed to create popup window")),void this.handleOpenFailure("Failed to create popup window");chrome.tabs.query({windowId:e.id,active:!0},e=>this.onPopupTabResolved(e[0]))})}openPopupInNewTab(e){chrome.tabs.query({currentWindow:!0,active:!0},t=>{if(!t[0]?.id)return this.popupWindowPromise?.reject(new Error("No active tab found")),void this.handleOpenFailure("No active tab found");this.extensionTabId=t[0].id,chrome.tabs.create({url:e,index:t[0].index+1},e=>this.onPopupTabResolved(e))})}onPopupTabResolved(e){this.popupWindow=e,this.logger.debug("popup tab resolved:",e.id),this.popupWindowPromise?.resolve(e),this.startCloseMonitoring()}focusPopup(){this.popupWindow?.id&&chrome.tabs.update(this.popupWindow.id,{active:!0})}closePopup(){const e=this.popupWindow?.id;e&&(chrome.tabs.remove(e,()=>{this.logChromeError("close",chrome.runtime.lastError)}),this.popupWindow=void 0)}isOpen(){return this.popupWindow?.id?this.checkIfTabExists(this.popupWindow.id):Promise.resolve(!1)}onReset(e=!0){e&&this.extensionTabId&&(this.logger.debug("Focusing back to extension tab:",this.extensionTabId),chrome.tabs.update(this.extensionTabId,{active:!0},()=>{this.logChromeError("focus",chrome.runtime.lastError)}),this.extensionTabId=0)}}function yl(e){return Array.isArray(e)}function wl(e){return"bigint"==typeof e}function xl(e){return"boolean"==typeof e}function Al(e){return e instanceof globalThis.Date}function El(e){return"number"==typeof e}function Sl(e){return"object"==typeof e&&null!==e}function _l(e){return e instanceof globalThis.RegExp}function Ol(e){return"string"==typeof e}function Nl(e){return e instanceof globalThis.Uint8Array}function kl(e){return void 0===e}function Tl(e){return yl(e)?function(e){return e.map(e=>Tl(e))}(e):Al(e)?function(e){return new Date(e.getTime())}(e):Nl(e)?function(e){return new Uint8Array(e)}(e):_l(e)?function(e){return new RegExp(e.source,e.flags)}(e):Sl(e)?function(e){const t={};for(const n of Object.getOwnPropertyNames(e))t[n]=Tl(e[n]);for(const n of Object.getOwnPropertySymbols(e))t[n]=Tl(e[n]);return t}(e):e}function Cl(e){return Tl(e)}function Il(e,t){return Cl(void 0===t?e:{...t,...e})}var Bl;function Ll(e){return yl(e)?function(e){return globalThis.Object.freeze(e).map(e=>Ll(e))}(e):Al(e)||Nl(e)||_l(e)?e:Sl(e)?function(e){const t={};for(const n of Object.getOwnPropertyNames(e))t[n]=Ll(e[n]);for(const n of Object.getOwnPropertySymbols(e))t[n]=Ll(e[n]);return globalThis.Object.freeze(t)}(e):e}function Ml(e,t){const n=void 0!==t?{...t,...e}:e;switch(Bl.InstanceMode){case"freeze":return Ll(n);case"clone":return Cl(n);default:return n}}!function(e){function t(t){const n=function(e){return null!==e&&"object"==typeof e}(t);return e.AllowArrayObject?n:n&&!function(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}(t)}e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1,e.IsExactOptionalProperty=function(t,n){return e.ExactOptionalPropertyTypes?n in t:void 0!==t[n]},e.IsObjectLike=t,e.IsRecordLike=function(e){return t(e)&&!(e instanceof Date)&&!(e instanceof Uint8Array)},e.IsNumberLike=function(t){return e.AllowNaN?function(e){return"number"==typeof e}(t):Number.isFinite(t)},e.IsVoidLike=function(t){const n=function(e){return void 0===e}(t);return e.AllowNullVoid?n||null===t:n}}(Bl||(Bl={}));class Rl extends Error{constructor(e){super(e)}}const Pl=Symbol.for("TypeBox.Transform"),Ul=Symbol.for("TypeBox.Readonly"),jl=Symbol.for("TypeBox.Optional"),Fl=Symbol.for("TypeBox.Hint"),Dl=Symbol.for("TypeBox.Kind");function zl(e){return Sl(e)&&"Readonly"===e[Ul]}function $l(e){return Sl(e)&&"Optional"===e[jl]}function Wl(e){return td(e,"Any")}function Xl(e){return td(e,"Argument")}function ql(e){return td(e,"Array")}function Kl(e){return td(e,"AsyncIterator")}function Gl(e){return td(e,"BigInt")}function Hl(e){return td(e,"Boolean")}function Vl(e){return td(e,"Computed")}function Yl(e){return td(e,"Constructor")}function Jl(e){return td(e,"Function")}function Zl(e){return td(e,"Integer")}function Ql(e){return td(e,"Intersect")}function ed(e){return td(e,"Iterator")}function td(e,t){return Sl(e)&&Dl in e&&e[Dl]===t}function nd(e){return xl(e)||El(e)||Ol(e)}function rd(e){return td(e,"Literal")}function id(e){return td(e,"MappedKey")}function od(e){return td(e,"MappedResult")}function ad(e){return td(e,"Never")}function sd(e){return td(e,"Null")}function cd(e){return td(e,"Number")}function ud(e){return td(e,"Object")}function ld(e){return td(e,"Promise")}function dd(e){return td(e,"Record")}function fd(e){return td(e,"Ref")}function hd(e){return td(e,"RegExp")}function pd(e){return td(e,"String")}function bd(e){return td(e,"Symbol")}function md(e){return td(e,"TemplateLiteral")}function gd(e){return Sl(e)&&Pl in e}function vd(e){return td(e,"Tuple")}function yd(e){return td(e,"Undefined")}function wd(e){return td(e,"Union")}function xd(e){return Wl(e)||Xl(e)||ql(e)||Hl(e)||Gl(e)||Kl(e)||Vl(e)||Yl(e)||function(e){return td(e,"Date")}(e)||Jl(e)||Zl(e)||Ql(e)||ed(e)||rd(e)||id(e)||od(e)||ad(e)||function(e){return td(e,"Not")}(e)||sd(e)||cd(e)||ud(e)||ld(e)||dd(e)||fd(e)||hd(e)||pd(e)||bd(e)||md(e)||function(e){return td(e,"This")}(e)||vd(e)||yd(e)||wd(e)||function(e){return td(e,"Uint8Array")}(e)||function(e){return td(e,"Unknown")}(e)||function(e){return td(e,"Unsafe")}(e)||function(e){return td(e,"Void")}(e)||function(e){return Sl(e)&&Dl in e&&Ol(e[Dl])}(e)}const Ad=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function Ed(e){try{return new RegExp(e),!0}catch{return!1}}function Sd(e){if(!Ol(e))return!1;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n>=7&&n<=13||27===n||127===n)return!1}return!0}function _d(e){return kd(e)||hf(e)}function Od(e){return kl(e)||wl(e)}function Nd(e){return kl(e)||El(e)}function kd(e){return kl(e)||xl(e)}function Td(e){return kl(e)||Ol(e)}function Cd(e){return kl(e)||hf(e)}function Id(e){return Sl(e)&&"Optional"===e[jl]}function Bd(e){return Xd(e,"Any")&&Td(e.$id)}function Ld(e){return Xd(e,"Array")&&"array"===e.type&&Td(e.$id)&&hf(e.items)&&Nd(e.minItems)&&Nd(e.maxItems)&&kd(e.uniqueItems)&&Cd(e.contains)&&Nd(e.minContains)&&Nd(e.maxContains)}function Md(e){return Xd(e,"AsyncIterator")&&"AsyncIterator"===e.type&&Td(e.$id)&&hf(e.items)}function Rd(e){return Xd(e,"BigInt")&&"bigint"===e.type&&Td(e.$id)&&Od(e.exclusiveMaximum)&&Od(e.exclusiveMinimum)&&Od(e.maximum)&&Od(e.minimum)&&Od(e.multipleOf)}function Pd(e){return Xd(e,"Boolean")&&"boolean"===e.type&&Td(e.$id)}function Ud(e){return Xd(e,"Constructor")&&"Constructor"===e.type&&Td(e.$id)&&yl(e.parameters)&&e.parameters.every(e=>hf(e))&&hf(e.returns)}function jd(e){return Xd(e,"Date")&&"Date"===e.type&&Td(e.$id)&&Nd(e.exclusiveMaximumTimestamp)&&Nd(e.exclusiveMinimumTimestamp)&&Nd(e.maximumTimestamp)&&Nd(e.minimumTimestamp)&&Nd(e.multipleOfTimestamp)}function Fd(e){return Xd(e,"Function")&&"Function"===e.type&&Td(e.$id)&&yl(e.parameters)&&e.parameters.every(e=>hf(e))&&hf(e.returns)}function Dd(e){return Xd(e,"Integer")&&"integer"===e.type&&Td(e.$id)&&Nd(e.exclusiveMaximum)&&Nd(e.exclusiveMinimum)&&Nd(e.maximum)&&Nd(e.minimum)&&Nd(e.multipleOf)}function zd(e){return Sl(e)&&Object.entries(e).every(([e,t])=>Sd(e)&&hf(t))}function $d(e){return Xd(e,"Intersect")&&(!Ol(e.type)||"object"===e.type)&&yl(e.allOf)&&e.allOf.every(e=>hf(e)&&!function(e){return Sl(e)&&Pl in e}(e))&&Td(e.type)&&(kd(e.unevaluatedProperties)||Cd(e.unevaluatedProperties))&&Td(e.$id)}function Wd(e){return Xd(e,"Iterator")&&"Iterator"===e.type&&Td(e.$id)&&hf(e.items)}function Xd(e,t){return Sl(e)&&Dl in e&&e[Dl]===t}function qd(e){return Hd(e)&&Ol(e.const)}function Kd(e){return Hd(e)&&El(e.const)}function Gd(e){return Hd(e)&&xl(e.const)}function Hd(e){return Xd(e,"Literal")&&Td(e.$id)&&function(e){return xl(e)||El(e)||Ol(e)}(e.const)}function Vd(e){return Xd(e,"Never")&&Sl(e.not)&&0===Object.getOwnPropertyNames(e.not).length}function Yd(e){return Xd(e,"Not")&&hf(e.not)}function Jd(e){return Xd(e,"Null")&&"null"===e.type&&Td(e.$id)}function Zd(e){return Xd(e,"Number")&&"number"===e.type&&Td(e.$id)&&Nd(e.exclusiveMaximum)&&Nd(e.exclusiveMinimum)&&Nd(e.maximum)&&Nd(e.minimum)&&Nd(e.multipleOf)}function Qd(e){return Xd(e,"Object")&&"object"===e.type&&Td(e.$id)&&zd(e.properties)&&_d(e.additionalProperties)&&Nd(e.minProperties)&&Nd(e.maxProperties)}function ef(e){return Xd(e,"Promise")&&"Promise"===e.type&&Td(e.$id)&&hf(e.item)}function tf(e){return Xd(e,"Record")&&"object"===e.type&&Td(e.$id)&&_d(e.additionalProperties)&&Sl(e.patternProperties)&&(e=>{const t=Object.getOwnPropertyNames(e.patternProperties);return 1===t.length&&Ed(t[0])&&Sl(e.patternProperties)&&hf(e.patternProperties[t[0]])})(e)}function nf(e){return Xd(e,"RegExp")&&Td(e.$id)&&Ol(e.source)&&Ol(e.flags)&&Nd(e.maxLength)&&Nd(e.minLength)}function rf(e){return Xd(e,"String")&&"string"===e.type&&Td(e.$id)&&Nd(e.minLength)&&Nd(e.maxLength)&&function(e){return kl(e)||Ol(e)&&Sd(e)&&Ed(e)}(e.pattern)&&function(e){return kl(e)||Ol(e)&&Sd(e)}(e.format)}function of(e){return Xd(e,"Symbol")&&"symbol"===e.type&&Td(e.$id)}function af(e){return Xd(e,"TemplateLiteral")&&"string"===e.type&&Ol(e.pattern)&&"^"===e.pattern[0]&&"$"===e.pattern[e.pattern.length-1]}function sf(e){return Xd(e,"Tuple")&&"array"===e.type&&Td(e.$id)&&El(e.minItems)&&El(e.maxItems)&&e.minItems===e.maxItems&&(kl(e.items)&&kl(e.additionalItems)&&0===e.minItems||yl(e.items)&&e.items.every(e=>hf(e)))}function cf(e){return Xd(e,"Undefined")&&"undefined"===e.type&&Td(e.$id)}function uf(e){return Xd(e,"Union")&&Td(e.$id)&&Sl(e)&&yl(e.anyOf)&&e.anyOf.every(e=>hf(e))}function lf(e){return Xd(e,"Uint8Array")&&"Uint8Array"===e.type&&Td(e.$id)&&Nd(e.minByteLength)&&Nd(e.maxByteLength)}function df(e){return Xd(e,"Unknown")&&Td(e.$id)}function ff(e){return Xd(e,"Void")&&"void"===e.type&&Td(e.$id)}function hf(e){return Sl(e)&&(Bd(e)||function(e){return Xd(e,"Argument")&&El(e.index)}(e)||Ld(e)||Pd(e)||Rd(e)||Md(e)||function(e){return Xd(e,"Computed")&&Ol(e.target)&&yl(e.parameters)&&e.parameters.every(e=>hf(e))}(e)||Ud(e)||jd(e)||Fd(e)||Dd(e)||$d(e)||Wd(e)||Hd(e)||function(e){return Xd(e,"MappedKey")&&yl(e.keys)&&e.keys.every(e=>El(e)||Ol(e))}(e)||function(e){return Xd(e,"MappedResult")&&zd(e.properties)}(e)||Vd(e)||Yd(e)||Jd(e)||Zd(e)||Qd(e)||ef(e)||tf(e)||function(e){return Xd(e,"Ref")&&Td(e.$id)&&Ol(e.$ref)}(e)||nf(e)||rf(e)||of(e)||af(e)||function(e){return Xd(e,"This")&&Td(e.$id)&&Ol(e.$ref)}(e)||sf(e)||cf(e)||uf(e)||lf(e)||df(e)||function(e){return Xd(e,"Unsafe")}(e)||ff(e)||function(e){return Sl(e)&&Dl in e&&Ol(e[Dl])&&!Ad.includes(e[Dl])}(e))}const pf="(0|[1-9][0-9]*)",bf="(.*)",mf=`^${pf}$`,gf=`^${bf}$`,vf=new Map;function yf(e,t){vf.set(e,t)}function wf(e){return Ml({[Dl]:"Any"},e)}function xf(e,t){return Ml({[Dl]:"Array",type:"array",items:e},t)}function Af(e,t){return Ml({[Dl]:"AsyncIterator",type:"AsyncIterator",items:e},t)}function Ef(e,t,n){return Ml({[Dl]:"Computed",target:e,parameters:t},n)}function Sf(e,t){return t.reduce((e,t)=>function(e,t){const{[t]:n,...r}=e;return r}(e,t),e)}function _f(e){return Ml({[Dl]:"Never",not:{}},e)}function Of(e){return Ml({[Dl]:"MappedResult",properties:e})}function Nf(e,t,n){return Ml({[Dl]:"Constructor",type:"Constructor",parameters:e,returns:t},n)}function kf(e,t,n){return Ml({[Dl]:"Function",type:"Function",parameters:e,returns:t},n)}function Tf(e,t){return Ml({[Dl]:"Union",anyOf:e},t)}function Cf(e){return e.map(e=>$l(e)?Sf(e,[jl]):e)}function If(e,t){const n=function(e){return e.some(e=>$l(e))}(e);return n?Bh(Tf(Cf(e),t)):Tf(Cf(e),t)}function Bf(e,t){return 1===e.length?Ml(e[0],t):0===e.length?_f(t):If(e,t)}function Lf(e,t){return 0===e.length?_f(t):1===e.length?Ml(e[0],t):Tf(e,t)}class Mf extends Rl{}function Rf(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}function Pf(e,t,n){return e[t]===n&&92!==e.charCodeAt(t-1)}function Uf(e,t){return Pf(e,t,"(")}function jf(e,t){return Pf(e,t,")")}function Ff(e,t){return Pf(e,t,"|")}function Df(e){return function(e){if(!Uf(e,0)||!jf(e,e.length-1))return!1;let t=0;for(let n=0;n<e.length;n++)if(Uf(e,n)&&(t+=1),jf(e,n)&&(t-=1),0===t&&n!==e.length-1)return!1;return!0}(e)?Df(function(e){return e.slice(1,e.length-1)}(e)):function(e){let t=0;for(let n=0;n<e.length;n++)if(Uf(e,n)&&(t+=1),jf(e,n)&&(t-=1),Ff(e,n)&&0===t)return!0;return!1}(e)?function(e){let[t,n]=[0,0];const r=[];for(let i=0;i<e.length;i++)if(Uf(e,i)&&(t+=1),jf(e,i)&&(t-=1),Ff(e,i)&&0===t){const t=e.slice(n,i);t.length>0&&r.push(Df(t)),n=i+1}const i=e.slice(n);return i.length>0&&r.push(Df(i)),0===r.length?{type:"const",const:""}:1===r.length?r[0]:{type:"or",expr:r}}(e):function(e){for(let t=0;t<e.length;t++)if(Uf(e,t))return!0;return!1}(e)?function(e){function t(e,t){if(!Uf(e,t))throw new Mf("TemplateLiteralParser: Index must point to open parens");let n=0;for(let r=t;r<e.length;r++)if(Uf(e,r)&&(n+=1),jf(e,r)&&(n-=1),0===n)return[t,r];throw new Mf("TemplateLiteralParser: Unclosed group parens in expression")}function n(e,t){for(let n=t;n<e.length;n++)if(Uf(e,n))return[t,n];return[t,e.length]}const r=[];for(let i=0;i<e.length;i++)if(Uf(e,i)){const[n,o]=t(e,i),a=e.slice(n,o+1);r.push(Df(a)),i=o}else{const[t,o]=n(e,i),a=e.slice(t,o);a.length>0&&r.push(Df(a)),i=o-1}return 0===r.length?{type:"const",const:""}:1===r.length?r[0]:{type:"and",expr:r}}(e):{type:"const",const:Rf(e)}}function zf(e){return Df(e.slice(1,e.length-1))}class $f extends Rl{}function Wf(e){return!function(e){return"or"===e.type&&2===e.expr.length&&"const"===e.expr[0].type&&"0"===e.expr[0].const&&"const"===e.expr[1].type&&"[1-9][0-9]*"===e.expr[1].const}(e)&&!function(e){return"const"===e.type&&".*"===e.const}(e)&&(!!function(e){return"or"===e.type&&2===e.expr.length&&"const"===e.expr[0].type&&"true"===e.expr[0].const&&"const"===e.expr[1].type&&"false"===e.expr[1].const}(e)||("and"===e.type||"or"===e.type?e.expr.every(e=>Wf(e)):"const"===e.type||(()=>{throw new $f("Unknown expression type")})()))}class Xf extends Rl{}function*qf(e){if(1===e.length)return yield*e[0];for(const t of e[0])for(const n of qf(e.slice(1)))yield`${t}${n}`}function*Kf(e){return yield*qf(e.expr.map(e=>[...Gf(e)]))}function*Gf(e){return"and"===e.type?yield*Kf(e):"or"===e.type?yield*function*(e){for(const t of e.expr)yield*Gf(t)}(e):"const"===e.type?yield*function*(e){return yield e.const}(e):(()=>{throw new Xf("Unknown expression")})()}function Hf(e){const t=zf(e.pattern);return Wf(t)?[...Gf(t)]:[]}function Vf(e,t){return Ml({[Dl]:"Literal",const:e,type:typeof e},t)}function Yf(e){return Ml({[Dl]:"Boolean",type:"boolean"},e)}function Jf(e){return Ml({[Dl]:"BigInt",type:"bigint"},e)}function Zf(e){return Ml({[Dl]:"Number",type:"number"},e)}function Qf(e){return Ml({[Dl]:"String",type:"string"},e)}function*eh(e){const t=e.trim().replace(/"|'/g,"");return"boolean"===t?yield Yf():"number"===t?yield Zf():"bigint"===t?yield Jf():"string"===t?yield Qf():yield(()=>{const e=t.split("|").map(e=>Vf(e.trim()));return 0===e.length?_f():1===e.length?e[0]:Bf(e)})()}function*th(e){if("{"!==e[1]){const t=Vf("$"),n=nh(e.slice(1));return yield*[t,...n]}for(let t=2;t<e.length;t++)if("}"===e[t]){const n=eh(e.slice(2,t)),r=nh(e.slice(t+1));return yield*[...n,...r]}yield Vf(e)}function*nh(e){for(let t=0;t<e.length;t++)if("$"===e[t]){const n=Vf(e.slice(0,t)),r=th(e.slice(t));return yield*[n,...r]}yield Vf(e)}class rh extends Rl{}function ih(e,t){return md(e)?e.pattern.slice(1,e.pattern.length-1):wd(e)?`(${e.anyOf.map(e=>ih(e,t)).join("|")})`:cd(e)||Zl(e)||Gl(e)?`${t}${pf}`:pd(e)?`${t}${bf}`:rd(e)?`${t}${n=e.const.toString(),n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`:Hl(e)?`${t}(true|false)`:(()=>{throw new rh(`Unexpected Kind '${e[Dl]}'`)})();var n}function oh(e){return`^${e.map(e=>ih(e,"")).join("")}$`}function ah(e){return Bf(Hf(e).map(e=>Vf(e)))}function sh(e,t){const n=Ol(e)?oh([...nh(e)]):oh(e);return Ml({[Dl]:"TemplateLiteral",type:"string",pattern:n},t)}function ch(e){const t=[];for(const n of e)t.push(...uh(n));return t}function uh(e){return[...new Set(md(e)?(n=e,Hf(n).map(e=>e.toString())):wd(e)?ch(e.anyOf):rd(e)?(t=e.const,[t.toString()]):cd(e)||Zl(e)?["[number]"]:[])];var t,n}function lh(e,t,n){return function(e,t,n){const r={};for(const i of Object.getOwnPropertyNames(t))r[i]=gh(e,uh(t[i]),n);return r}(e,t.properties,n)}function dh(e,t){return e.map(e=>ph(e,t))}function fh(e,t){return Ph(function(e){return e.filter(e=>!ad(e))}(dh(e,t)))}function hh(e,t){return Bf(function(e){return e.some(e=>ad(e))?[]:e}(dh(e,t)))}function ph(e,t){return Ql(e)?fh(e.allOf,t):wd(e)?hh(e.anyOf,t):vd(e)?function(e,t){return t in e?e[t]:"[number]"===t?Bf(e):_f()}(e.items??[],t):ql(e)?function(e,t){return"[number]"===t?e:_f()}(e.items,t):ud(e)?function(e,t){return t in e?e[t]:_f()}(e.properties,t):_f()}function bh(e,t){return t.map(t=>ph(e,t))}function mh(e,t){return Bf(bh(e,t))}function gh(e,t,n){if(fd(e)||fd(t)){const n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!xd(e)||!xd(t))throw new Rl(n);return Ef("Index",[e,t])}return od(t)?function(e,t,n){return Of(lh(e,t,n))}(e,t,n):id(t)?function(e,t,n){const r=function(e,t,n){return function(e,t,n){return t.reduce((t,r)=>({...t,...vh(e,r,n)}),{})}(e,t.keys,n)}(e,t,n);return Of(r)}(e,t,n):Ml(xd(t)?mh(e,uh(t)):mh(e,t),n)}function vh(e,t,n){return{[t]:gh(e,[t],Cl(n))}}function yh(e,t){return Ml({[Dl]:"Iterator",type:"Iterator",items:e},t)}var wh,xh=function(e,t){const n=function(e){return globalThis.Object.keys(e).filter(t=>!$l(e[t]))}(e);return Ml(n.length>0?{[Dl]:"Object",type:"object",required:n,properties:e}:{[Dl]:"Object",type:"object",properties:e},t)};function Ah(e,t){return Ml({[Dl]:"Promise",type:"Promise",item:e},t)}function Eh(e,t){return!1===t?function(e){return Ml(Sf(e,[Ul]))}(e):function(e){return Ml({...e,[Ul]:"Readonly"})}(e)}function Sh(e,t){const n=t??!0;return od(e)?function(e,t){const n=function(e,t){return function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(e))n[r]=Sh(e[r],t);return n}(e.properties,t)}(e,t);return Of(n)}(e,n):Eh(e,n)}function _h(e,t){return Ml(e.length>0?{[Dl]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[Dl]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}function Oh(e,t){return e in t?Th(e,t[e]):Of(t)}function Nh(e,t){return n=e,t.includes(n)?function(e){return{[e]:Vf(e)}}(e):function(e){const t={};for(const n of e)t[n]=Vf(n);return t}(t);var n}function kh(e,t){return t.map(t=>Th(e,t))}function Th(e,t){const n={...t};return $l(t)?Bh(Th(e,Sf(t,[jl]))):zl(t)?Sh(Th(e,Sf(t,[Ul]))):od(t)?Oh(e,t.properties):id(t)?function(e,t){return Oh(e,Nh(e,t))}(e,t.keys):Yl(t)?Nf(kh(e,t.parameters),Th(e,t.returns),n):Jl(t)?kf(kh(e,t.parameters),Th(e,t.returns),n):Kl(t)?Af(Th(e,t.items),n):ed(t)?yh(Th(e,t.items),n):Ql(t)?Uh(kh(e,t.allOf),n):wd(t)?Lf(kh(e,t.anyOf),n):vd(t)?_h(kh(e,t.items??[]),n):ud(t)?xh(function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(t))n[r]=Th(e,t[r]);return n}(e,t.properties),n):ql(t)?xf(Th(e,t.items),n):ld(t)?Ah(Th(e,t.item),n):t}function Ch(e,t,n){const r=xd(e)?uh(e):e,i=function(e,t){const n={};for(const r of e)n[r]=Th(r,t);return n}(r,t({[Dl]:"MappedKey",keys:r}));return xh(i,n)}function Ih(e,t){return!1===t?function(e){return Ml(Sf(e,[jl]))}(e):function(e){return Ml({...e,[jl]:"Optional"})}(e)}function Bh(e,t){const n=t??!0;return od(e)?function(e,t){const n=function(e,t){return function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(e))n[r]=Bh(e[r],t);return n}(e.properties,t)}(e,t);return Of(n)}(e,n):Ih(e,n)}function Lh(e,t={}){const n=e.every(e=>ud(e)),r=xd(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return Ml(!1===t.unevaluatedProperties||xd(t.unevaluatedProperties)||n?{...r,[Dl]:"Intersect",type:"object",allOf:e}:{...r,[Dl]:"Intersect",allOf:e},t)}function Mh(e){return e.map(e=>$l(e)?Sf(e,[jl]):e)}function Rh(e,t){return function(e){return e.every(e=>$l(e))}(e)?Bh(Lh(Mh(e),t)):Lh(Mh(e),t)}function Ph(e,t={}){if(1===e.length)return Ml(e[0],t);if(0===e.length)return _f(t);if(e.some(e=>gd(e)))throw new Error("Cannot intersect transform types");return Rh(e,t)}function Uh(e,t){if(1===e.length)return Ml(e[0],t);if(0===e.length)return _f(t);if(e.some(e=>gd(e)))throw new Error("Cannot intersect transform types");return Lh(e,t)}function jh(...e){const[t,n]="string"==typeof e[0]?[e[0],e[1]]:[e[0].$id,e[1]];if("string"!=typeof t)throw new Rl("Ref: $ref must be a string");return Ml({[Dl]:"Ref",$ref:t},n)}function Fh(e){return e.map(e=>Dh(e))}function Dh(e,t){return Ml(Vl(e)?(n=e.target,r=e.parameters,Ef("Awaited",[Ef(n,r)])):Ql(e)?function(e){return Uh(Fh(e))}(e.allOf):wd(e)?function(e){return Lf(Fh(e))}(e.anyOf):ld(e)?function(e){return Dh(e)}(e.item):fd(e)?Ef("Awaited",[jh(e.$ref)]):e,t);var n,r}function zh(e){const t=[];for(const n of e)t.push($h(n));return t}function $h(e){return Ql(e)?function(e){return function(e){const t=[];for(const n of e)t.push(...n);return t}(zh(e))}(e.allOf):wd(e)?function(e){const t=zh(e);var n;return 1===(n=t).length?n[0]:n.length>1?function(e,t){return e.reduce((e,t)=>function(e,t){return e.filter(e=>t.includes(e))}(e,t),t)}(n.slice(1),n[0]):[]}(e.anyOf):vd(e)?function(e){return e.map((e,t)=>t.toString())}(e.items??[]):ql(e)?(e.items,["[number]"]):ud(e)?(t=e.properties,globalThis.Object.getOwnPropertyNames(t)):dd(e)?(e.patternProperties,[]):[];var t}function Wh(e,t){const n=function(e){return e.map(e=>"[number]"===e?Zf():Vf(e))}($h(e));return Ml(Bf(n),t)}function Xh(e,t){return Vl(e)?(n=e.target,r=e.parameters,Ef("KeyOf",[Ef(n,r)])):fd(e)?Ef("KeyOf",[jh(e.$ref)]):od(e)?function(e,t){const n=function(e,t){return function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(e))n[r]=Xh(e[r],Cl(t));return n}(e.properties,t)}(e,t);return Of(n)}(e,t):Wh(e,t);var n,r}function qh(e){const t=[];for(const n of e)t.push(...$h(n));return function(e){return[...new Set(e)]}(t)}function Kh(e,t){const n=[];for(const r of e)n.push(...bh(r,[t]));return function(e){return e.filter(e=>!ad(e))}(n)}function Gh(e,t){const n=function(e,t){const n={};for(const r of t)n[r]=Ph(Kh(e,r));return n}(e,qh(e));return xh(n,t)}function Hh(e){return Ml({[Dl]:"Date",type:"Date"},e)}function Vh(e){return Ml({[Dl]:"Null",type:"null"},e)}function Yh(e){return Ml({[Dl]:"Symbol",type:"symbol"},e)}function Jh(e){return Ml({[Dl]:"Undefined",type:"undefined"},e)}function Zh(e){return Ml({[Dl]:"Uint8Array",type:"Uint8Array"},e)}function Qh(e){return Ml({[Dl]:"Unknown"},e)}function ep(e,t){return!0===t?e:Sh(e)}function tp(e,t){return function(e){return Sl(e)&&!yl(e)&&!Nl(e)&&Symbol.asyncIterator in e}(e)||function(e){return Sl(e)&&!yl(e)&&!Nl(e)&&Symbol.iterator in e}(e)?ep(wf(),t):yl(e)?Sh(_h(e.map(e=>tp(e,!1)))):Nl(e)?Zh():Al(e)?Hh():Sl(e)?ep(xh(function(e){const t={};for(const n of globalThis.Object.getOwnPropertyNames(e))t[n]=Sh(tp(e[n],!1));return t}(e)),t):function(e){return"function"==typeof e}(e)?ep(kf([],Qh()),t):kl(e)?Jh():function(e){return null===e}(e)?Vh():function(e){return"symbol"==typeof e}(e)?Yh():wl(e)?Jf():El(e)||xl(e)||Ol(e)?Vf(e):xh({})}class np extends Rl{}function rp(e){return e===wh.False?e:wh.True}function ip(e){throw new np(e)}function op(e){return Vd(e)||$d(e)||uf(e)||df(e)||Bd(e)}function ap(e,t){return Vd(t)?dp():$d(t)?lp(e,t):uf(t)?Tp(e,t):df(t)?Cp():Bd(t)?sp():ip("StructuralRight")}function sp(e,t){return wh.True}function cp(e,t){return Gd(e)||Pd(e)?wh.True:wh.False}function up(e,t){return Hd(e)&&El(e.const)||Zd(e)||Dd(e)?wh.True:wh.False}function lp(e,t){return t.allOf.every(t=>Bp(e,t)===wh.True)?wh.True:wh.False}function dp(e,t){return wh.False}function fp(e){let[t,n]=[e,0];for(;Yd(t);)t=t.not,n+=1;return n%2==0?t:Qh()}function hp(e,t){return Kd(e)||Zd(e)||Dd(e)?wh.True:wh.False}function pp(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function bp(e){return yp(e)}function mp(e){return pp(e,0)||pp(e,1)&&"description"in e.properties&&uf(e.properties.description)&&2===e.properties.description.anyOf.length&&(rf(e.properties.description.anyOf[0])&&cf(e.properties.description.anyOf[1])||rf(e.properties.description.anyOf[1])&&cf(e.properties.description.anyOf[0]))}function gp(e){return pp(e,0)}function vp(e){return pp(e,0)}function yp(e){const t=Zf();return pp(e,0)||pp(e,1)&&"length"in e.properties&&rp(Bp(e.properties.length,t))===wh.True}function wp(e,t){return Bp(e,t)===wh.False||Id(e)&&!Id(t)?wh.False:wh.True}function xp(e,t){return df(e)?wh.False:Bd(e)?wh.Union:Vd(e)||qd(e)&&bp(t)||Kd(e)&&gp(t)||Gd(e)&&vp(t)||of(e)&&mp(t)||Rd(e)&&function(e){return pp(e,0)}(t)||rf(e)&&bp(t)||of(e)&&mp(t)||Zd(e)&&gp(t)||Dd(e)&&gp(t)||Pd(e)&&vp(t)||lf(e)&&function(e){return yp(e)}(t)||jd(e)&&function(e){return pp(e,0)}(t)||Ud(e)&&function(e){return pp(e,0)}(t)||Fd(e)&&function(e){const t=Zf();return pp(e,0)||pp(e,1)&&"length"in e.properties&&rp(Bp(e.properties.length,t))===wh.True}(t)?wh.True:tf(e)&&rf(Ep(e))?"Record"===t[Fl]?wh.True:wh.False:tf(e)&&Zd(Ep(e))&&pp(t,0)?wh.True:wh.False}function Ap(e,t){return op(t)?ap(e,t):Qd(t)&&function(e){const t=kf([wf()],wf());return pp(e,0)||pp(e,1)&&"then"in e.properties&&rp(Bp(e.properties.then,t))===wh.True}(t)?wh.True:ef(t)?rp(Bp(e.item,t.item)):wh.False}function Ep(e){return mf in e.patternProperties?Zf():gf in e.patternProperties?Qf():ip("Unknown record key pattern")}function Sp(e){return mf in e.patternProperties?e.patternProperties[mf]:gf in e.patternProperties?e.patternProperties[gf]:ip("Unable to get record value schema")}function _p(e,t){const[n,r]=[Ep(t),Sp(t)];return qd(e)&&Zd(n)&&rp(Bp(e,r))===wh.True?wh.True:lf(e)&&Zd(n)||rf(e)&&Zd(n)||Ld(e)&&Zd(n)?Bp(e,r):Qd(e)?(()=>{for(const t of Object.getOwnPropertyNames(e.properties))if(wp(r,e.properties[t])===wh.False)return wh.False;return wh.True})():wh.False}function Op(e,t){return Hd(e)&&Ol(e.const)||rf(e)?wh.True:wh.False}function Np(e,t){return op(t)?ap(e,t):Qd(t)&&yp(t)||Ld(t)&&function(e,t){return Ld(t)&&void 0!==e.items&&e.items.every(e=>Bp(e,t.items)===wh.True)}(e,t)?wh.True:sf(t)?kl(e.items)&&!kl(t.items)||!kl(e.items)&&kl(t.items)?wh.False:kl(e.items)&&!kl(t.items)||e.items.every((e,n)=>Bp(e,t.items[n])===wh.True)?wh.True:wh.False:wh.False}function kp(e,t){return op(t)?ap(e,t):Qd(t)?xp(e,t):tf(t)?_p(e,t):ff(t)?function(e){return cf(e)||cf(e)?wh.True:wh.False}(e):cf(t)?wh.True:wh.False}function Tp(e,t){return t.anyOf.some(t=>Bp(e,t)===wh.True)?wh.True:wh.False}function Cp(e,t){return wh.True}function Ip(e,t){return Vd(t)?dp():$d(t)?lp(e,t):uf(t)?Tp(e,t):Bd(t)?sp():rf(t)?Op(e):Zd(t)?hp(e):Dd(t)?up(e):Pd(t)?cp(e):Ld(t)?function(e){return df(e)?wh.False:Bd(e)?wh.Union:Vd(e)?wh.True:wh.False}(e):sf(t)?function(e){return Vd(e)?wh.True:df(e)?wh.False:Bd(e)?wh.Union:wh.False}(e):Qd(t)?xp(e,t):df(t)?wh.True:wh.False}function Bp(e,t){return af(e)||af(t)?function(e,t){return af(e)?Bp(ah(e),t):af(t)?Bp(e,ah(t)):ip("Invalid fallthrough for TemplateLiteral")}(e,t):nf(e)||nf(t)?function(e,t){return Bp(nf(e)?Qf():e,nf(t)?Qf():t)}(e,t):Yd(e)||Yd(t)?function(e,t){return Yd(e)?Bp(fp(e),t):Yd(t)?Bp(e,fp(t)):ip("Invalid fallthrough for Not")}(e,t):Bd(e)?function(e,t){return $d(t)?lp(e,t):uf(t)&&t.anyOf.some(e=>Bd(e)||df(e))?wh.True:uf(t)?wh.Union:df(t)||Bd(t)?wh.True:wh.Union}(e,t):Ld(e)?function(e,t){return Qd(t)&&yp(t)?wh.True:op(t)?ap(e,t):Ld(t)?rp(Bp(e.items,t.items)):wh.False}(e,t):Rd(e)?function(e,t){return op(t)?ap(e,t):Qd(t)?xp(e,t):tf(t)?_p(e,t):Rd(t)?wh.True:wh.False}(e,t):Pd(e)?function(e,t){return op(t)?ap(e,t):Qd(t)?xp(e,t):tf(t)?_p(e,t):Pd(t)?wh.True:wh.False}(e,t):Md(e)?function(e,t){return op(t)?ap(e,t):Md(t)?rp(Bp(e.items,t.items)):wh.False}(e,t):Ud(e)?function(e,t){return op(t)?ap(e,t):Qd(t)?xp(e,t):Ud(t)?e.parameters.length>t.parameters.length?wh.False:e.parameters.every((e,n)=>rp(Bp(t.parameters[n],e))===wh.True)?rp(Bp(e.returns,t.returns)):wh.False:wh.False}(e,t):jd(e)?function(e,t){return op(t)?ap(e,t):Qd(t)?xp(e,t):tf(t)?_p(e,t):jd(t)?wh.True:wh.False}(e,t):Fd(e)?function(e,t){return op(t)?ap(e,t):Qd(t)?xp(e,t):Fd(t)?e.parameters.length>t.parameters.length?wh.False:e.parameters.every((e,n)=>rp(Bp(t.parameters[n],e))===wh.True)?rp(Bp(e.returns,t.returns)):wh.False:wh.False}(e,t):Dd(e)?function(e,t){return Dd(t)||Zd(t)?wh.True:op(t)?ap(e,t):Qd(t)?xp(e,t):tf(t)?_p(e,t):wh.False}(e,t):$d(e)?function(e,t){return e.allOf.some(e=>Bp(e,t)===wh.True)?wh.True:wh.False}(e,t):Wd(e)?function(e,t){return op(t)?ap(e,t):Wd(t)?rp(Bp(e.items,t.items)):wh.False}(e,t):Hd(e)?function(e,t){return Hd(t)&&t.const===e.const?wh.True:op(t)?ap(e,t):Qd(t)?xp(e,t):tf(t)?_p(e,t):rf(t)?Op(e):Zd(t)?hp(e):Dd(t)?up(e):Pd(t)?cp(e):wh.False}(e,t):Vd(e)?wh.True:Jd(e)?function(e,t){return op(t)?ap(e,t):Qd(t)?xp(e,t):tf(t)?_p(e,t):Jd(t)?wh.True:wh.False}(e,t):Zd(e)?function(e,t){return op(t)?ap(e,t):Qd(t)?xp(e,t):tf(t)?_p(e,t):Dd(t)||Zd(t)?wh.True:wh.False}(e,t):Qd(e)?function(e,t){return op(t)?ap(e,t):tf(t)?_p(e,t):Qd(t)?(()=>{for(const n of Object.getOwnPropertyNames(t.properties)){if(!(n in e.properties)&&!Id(t.properties[n]))return wh.False;if(Id(t.properties[n]))return wh.True;if(wp(e.properties[n],t.properties[n])===wh.False)return wh.False}return wh.True})():wh.False}(e,t):tf(e)?function(e,t){return op(t)?ap(e,t):Qd(t)?xp(e,t):tf(t)?Bp(Sp(e),Sp(t)):wh.False}(e,t):rf(e)?function(e,t){return op(t)?ap(e,t):Qd(t)?xp(e,t):tf(t)?_p(e,t):rf(t)?wh.True:wh.False}(e,t):of(e)?function(e,t){return op(t)?ap(e,t):Qd(t)?xp(e,t):tf(t)?_p(e,t):of(t)?wh.True:wh.False}(e,t):sf(e)?Np(e,t):ef(e)?Ap(e,t):lf(e)?function(e,t){return op(t)?ap(e,t):Qd(t)?xp(e,t):tf(t)?_p(e,t):lf(t)?wh.True:wh.False}(e,t):cf(e)?kp(e,t):uf(e)?function(e,t){return e.anyOf.every(e=>Bp(e,t)===wh.True)?wh.True:wh.False}(e,t):df(e)?Ip(e,t):ff(e)?function(e,t){return $d(t)?lp(e,t):uf(t)?Tp(e,t):df(t)?Cp():Bd(t)?sp():Qd(t)?xp(e,t):ff(t)?wh.True:wh.False}(e,t):ip(`Unknown left type operand '${e[Dl]}'`)}function Lp(e,t){return Bp(e,t)}function Mp(e,t,n,r,i){return function(e,t,n,r,i){const o={};for(const a of globalThis.Object.getOwnPropertyNames(e))o[a]=Rp(e[a],t,n,r,Cl(i));return o}(e.properties,t,n,r,i)}function Rp(e,t,n,r,i){return od(e)?function(e,t,n,r,i){return Of(Mp(e,t,n,r,i))}(e,t,n,r,i):id(e)?Ml(function(e,t,n,r,i){const o=function(e,t,n,r,i){return function(e,t,n,r,i){return e.reduce((e,o)=>({...e,...Pp(o,t,n,r,i)}),{})}(e.keys,t,n,r,i)}(e,t,n,r,i);return Of(o)}(e,t,n,r,i)):Ml(function(e,t,n,r){const i=Lp(e,t);return i===wh.Union?Lf([n,r]):i===wh.True?n:r}(e,t,n,r),i)}function Pp(e,t,n,r,i){return{[e]:Rp(Vf(e),t,n,r,Cl(i))}}function Up(e,t,n={}){return md(e)?Ml(function(e,t){return Up(ah(e),t)}(e,t),n):od(e)?Ml(function(e,t){const n=function(e,t){return function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(e))n[r]=Up(e[r],t);return n}(e.properties,t)}(e,t);return Of(n)}(e,t),n):Ml(wd(e)?function(e,t){const n=e.filter(e=>Lp(e,t)===wh.False);return 1===n.length?n[0]:Lf(n)}(e.anyOf,t):Lp(e,t)!==wh.False?_f():e,n)}function jp(e,t,n){return md(e)?Ml(function(e,t){return jp(ah(e),t)}(e,t),n):od(e)?Ml(function(e,t){const n=function(e,t){return function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(e))n[r]=jp(e[r],t);return n}(e.properties,t)}(e,t);return Of(n)}(e,t),n):Ml(wd(e)?function(e,t){const n=e.filter(e=>Lp(e,t)!==wh.False);return 1===n.length?n[0]:Lf(n)}(e.anyOf,t):Lp(e,t)!==wh.False?e:_f(),n)}function Fp(e){return Sh(Bh(e))}function Dp(e,t,n){return Ml({[Dl]:"Record",type:"object",patternProperties:{[e]:t}},n)}function zp(e,t,n){const r={};for(const n of e)r[n]=t;return xh(r,{...n,[Fl]:"Record"})}function $p(e,t,n){return function(e){return Wf(zf(e.pattern))}(e)?zp(uh(e),t,n):Dp(e.pattern,t,n)}function Wp(e,t,n={}){return wd(e)?function(e,t,n){return zp(uh(Lf(e)),t,n)}(e.anyOf,t,n):md(e)?$p(e,t,n):rd(e)?function(e,t,n){return zp([e.toString()],t,n)}(e.const,t,n):Hl(e)?function(e,t,n){return xh({true:t,false:t},n)}(0,t,n):Zl(e)?function(e,t,n){return Dp(mf,t,n)}(0,t,n):cd(e)?function(e,t,n){return Dp(mf,t,n)}(0,t,n):hd(e)?function(e,t,n){return Dp(e.source,t,n)}(e,t,n):pd(e)?function(e,t,n){return Dp(kl(e.pattern)?gf:e.pattern,t,n)}(e,t,n):Wl(e)?function(e,t,n){return Dp(gf,t,n)}(0,t,n):ad(e)?function(e,t,n){return Dp("^(?!.*)$",t,n)}(0,t,n):_f(n)}function Xp(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function qp(e){return e.patternProperties[Xp(e)]}function Kp(e,t){const n=function(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((n,r)=>({...n,[r]:Hp(e,t[r])}),{})}(e,t.properties);return{...t,...xh(n)}}function Gp(e,t){const n=Yp(e,function(e){const t=Xp(e);return t===gf?Qf():t===mf?Zf():Qf({pattern:t})}(t)),r=Wp(n,Yp(e,qp(t)));return{...t,...r}}function Hp(e,t){const n=zl(t),r=$l(t),i=Yp(e,t);return n&&r?Fp(i):n&&!r?Sh(i):!n&&r?Bh(i):i}function Vp(e,t){return t.map(t=>Yp(e,t))}function Yp(e,t){return Yl(t)||Jl(t)?function(e,t){return t.parameters=Vp(e,t.parameters),t.returns=Yp(e,t.returns),t}(e,t):Ql(t)?function(e,t){return t.allOf=Vp(e,t.allOf),t}(e,t):wd(t)?function(e,t){return t.anyOf=Vp(e,t.anyOf),t}(e,t):vd(t)?function(e,t){return kl(t.items)||(t.items=Vp(e,t.items)),t}(e,t):ql(t)||Kl(t)||ed(t)?function(e,t){return t.items=Yp(e,t.items),t}(e,t):ld(t)?function(e,t){return t.item=Yp(e,t.item),t}(e,t):ud(t)?Kp(e,t):dd(t)?Gp(e,t):Xl(t)?function(e,t){return t.index in e?e[t.index]:Qh()}(e,t):t}function Jp(e,t,n){return{[e]:tb(Vf(e),t,Cl(n))}}function Zp(e,t,n){return function(e,t,n){return e.reduce((e,r)=>({...e,...Jp(r,t,n)}),{})}(e.keys,t,n)}function Qp(e,t){return"string"==typeof e?"Uncapitalize"===t?function(e){const[t,n]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),n].join("")}(e):"Capitalize"===t?function(e){const[t,n]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),n].join("")}(e):"Uppercase"===t?function(e){return e.toUpperCase()}(e):"Lowercase"===t?function(e){return e.toLowerCase()}(e):e:e.toString()}function eb(e,t){return e.map(e=>tb(e,t))}function tb(e,t,n={}){return id(e)?function(e,t,n){return Of(Zp(e,t,n))}(e,t,n):md(e)?function(e,t,n){const r=zf(e.pattern);return Wf(r)?sh([Lf(eb([...Gf(r)].map(e=>Vf(e)),t))],n):{...e,pattern:Qp(e.pattern,t)}}(e,t,n):wd(e)?Lf(eb(e.anyOf,t),n):rd(e)?Vf(Qp(e.const,t),n):Ml(e,n)}function nb(e,t,n){return function(e,t,n){const r={};for(const i of globalThis.Object.getOwnPropertyNames(e))r[i]=ib(e[i],t,Cl(n));return r}(e.properties,t,n)}function rb(e,t){return Ql(e)?Uh(function(e,t){return e.map(e=>rb(e,t))}(e.allOf,t)):wd(e)?Lf(function(e,t){return e.map(e=>rb(e,t))}(e.anyOf,t)):ud(e)?function(e,t,n){const r=Sf(e,[Pl,"$id","required","properties"]),i=function(e,t){return t.reduce((e,t)=>function(e,t){const{[t]:n,...r}=e;return r}(e,t),e)}(n,t);return xh(i,r)}(e,t,e.properties):xh({})}function ib(e,t,n){const r=yl(t)?function(e){const t=e.reduce((e,t)=>nd(t)?[...e,Vf(t)]:e,[]);return Lf(t)}(t):t,i=xd(t)?uh(t):t,o=fd(e),a=fd(t);return od(e)?function(e,t,n){return Of(nb(e,t,n))}(e,i,n):id(t)?function(e,t,n){const r=function(e,t,n){return function(e,t,n){return t.reduce((t,r)=>({...t,...ob(e,r,n)}),{})}(e,t.keys,n)}(e,t,n);return Of(r)}(e,t,n):o&&a||!o&&a||o&&!a?Ef("Omit",[e,r],n):Ml({...rb(e,i),...n})}function ob(e,t,n){return{[t]:ib(e,[t],Cl(n))}}function ab(e,t,n){return function(e,t,n){const r={};for(const i of globalThis.Object.getOwnPropertyNames(e))r[i]=cb(e[i],t,Cl(n));return r}(e.properties,t,n)}function sb(e,t){return Ql(e)?Uh(function(e,t){return e.map(e=>sb(e,t))}(e.allOf,t)):wd(e)?Lf(function(e,t){return e.map(e=>sb(e,t))}(e.anyOf,t)):ud(e)?function(e,t,n){const r=Sf(e,[Pl,"$id","required","properties"]),i=function(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}(n,t);return xh(i,r)}(e,t,e.properties):xh({})}function cb(e,t,n){const r=yl(t)?function(e){const t=e.reduce((e,t)=>nd(t)?[...e,Vf(t)]:e,[]);return Lf(t)}(t):t,i=xd(t)?uh(t):t,o=fd(e),a=fd(t);return od(e)?function(e,t,n){return Of(ab(e,t,n))}(e,i,n):id(t)?function(e,t,n){const r=function(e,t,n){return function(e,t,n){return t.reduce((t,r)=>({...t,...ub(e,r,n)}),{})}(e,t.keys,n)}(e,t,n);return Of(r)}(e,t,n):o&&a||!o&&a||o&&!a?Ef("Pick",[e,r],n):Ml({...sb(e,i),...n})}function ub(e,t,n){return{[t]:cb(e,[t],Cl(n))}}function lb(e,t){const n=Sf(e,[Pl,"$id","required","properties"]),r=function(e){const t={};for(const n of globalThis.Object.getOwnPropertyNames(e))t[n]=Bh(e[n]);return t}(t);return xh(r,n)}function db(e){return e.map(e=>fb(e))}function fb(e){return Vl(e)?(t=e.target,n=e.parameters,Ef("Partial",[Ef(t,n)])):fd(e)?Ef("Partial",[jh(e.$ref)]):Ql(e)?Uh(db(e.allOf)):wd(e)?Lf(db(e.anyOf)):ud(e)?lb(e,e.properties):Gl(e)||Hl(e)||Zl(e)||rd(e)||sd(e)||cd(e)||pd(e)||bd(e)||yd(e)?e:xh({});var t,n}function hb(e,t){return od(e)?function(e,t){const n=function(e,t){return function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(e))n[r]=hb(e[r],Cl(t));return n}(e.properties,t)}(e,t);return Of(n)}(e,t):Ml({...fb(e),...t})}function pb(e,t){const n=Sf(e,[Pl,"$id","required","properties"]),r=function(e){const t={};for(const n of globalThis.Object.getOwnPropertyNames(e))t[n]=Sf(e[n],[jl]);return t}(t);return xh(r,n)}function bb(e){return e.map(e=>mb(e))}function mb(e){return Vl(e)?(t=e.target,n=e.parameters,Ef("Required",[Ef(t,n)])):fd(e)?Ef("Required",[jh(e.$ref)]):Ql(e)?Uh(bb(e.allOf)):wd(e)?Lf(bb(e.anyOf)):ud(e)?pb(e,e.properties):Gl(e)||Hl(e)||Zl(e)||rd(e)||sd(e)||cd(e)||pd(e)||bd(e)||yd(e)?e:xh({});var t,n}function gb(e,t){return od(e)?function(e,t){const n=function(e,t){return function(e,t){const n={};for(const r of globalThis.Object.getOwnPropertyNames(e))n[r]=gb(e[r],t);return n}(e.properties,t)}(e,t);return Of(n)}(e,t):Ml({...mb(e),...t})}function vb(e,t){return t in e?fd(e[t])?vb(e,e[t].$ref):xb(e,e[t]):_f()}function yb(e,t,n){const r=function(e,t){return t.map(t=>fd(t)?vb(e,t.$ref):xb(e,t))}(e,n);return"Awaited"===t?function(e){return Dh(e[0])}(r):"Index"===t?function(e){return gh(e[0],e[1])}(r):"KeyOf"===t?function(e){return Xh(e[0])}(r):"Partial"===t?function(e){return hb(e[0])}(r):"Omit"===t?function(e){return ib(e[0],e[1])}(r):"Pick"===t?function(e){return cb(e[0],e[1])}(r):"Required"===t?function(e){return gb(e[0])}(r):_f()}function wb(e,t){return t.map(t=>xb(e,t))}function xb(e,t){return $l(t)?Ml(xb(e,Sf(t,[jl])),t):zl(t)?Ml(xb(e,Sf(t,[Ul])),t):gd(t)?Ml(function(e,t){return fd(t)?{...vb(e,t.$ref),[Pl]:t[Pl]}:t}(e,t),t):ql(t)?Ml(function(e,t){return xf(xb(e,t))}(e,t.items),t):Kl(t)?Ml(function(e,t){return Af(xb(e,t))}(e,t.items),t):Vl(t)?Ml(yb(e,t.target,t.parameters)):Yl(t)?Ml(function(e,t,n){return Nf(wb(e,t),xb(e,n))}(e,t.parameters,t.returns),t):Jl(t)?Ml(function(e,t,n){return kf(wb(e,t),xb(e,n))}(e,t.parameters,t.returns),t):Ql(t)?Ml(function(e,t){return Uh(wb(e,t))}(e,t.allOf),t):ed(t)?Ml(function(e,t){return yh(xb(e,t))}(e,t.items),t):ud(t)?Ml(function(e,t){return xh(globalThis.Object.keys(t).reduce((n,r)=>({...n,[r]:xb(e,t[r])}),{}))}(e,t.properties),t):dd(t)?Ml(function(e,t){const[n,r]=[xb(e,qp(t)),Xp(t)],i=Il(t);return i.patternProperties[r]=n,i}(e,t)):vd(t)?Ml(function(e,t){return _h(wb(e,t))}(e,t.items||[]),t):wd(t)?Ml(function(e,t){return Lf(wb(e,t))}(e,t.anyOf),t):t}function Ab(e,t){return t in e?xb(e,e[t]):_f()}!function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"}(wh||(wh={}));class Eb{constructor(e){const t=(n=e,globalThis.Object.getOwnPropertyNames(n).reduce((e,t)=>({...e,[t]:Ab(n,t)}),{}));var n;const r=this.WithIdentifiers(t);this.$defs=r}Import(e,t){const n={...this.$defs,[e]:Ml(this.$defs[e],t)};return Ml({[Dl]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:{...e[n],$id:n}}),{})}}let Sb=0;function _b(e){return function(e){return Ql(e)?e.allOf:wd(e)?e.anyOf:vd(e)?e.items??[]:[]}(e)}class Ob{constructor(e){this.schema=e}Decode(e){return new Nb(this.schema,e)}}class Nb{constructor(e,t){this.schema=e,this.decode=t}EncodeTransform(e,t){const n={Encode:n=>t[Pl].Encode(e(n)),Decode:e=>this.decode(t[Pl].Decode(e))};return{...t,[Pl]:n}}EncodeSchema(e,t){const n={Decode:this.decode,Encode:e};return{...t,[Pl]:n}}Encode(e){return gd(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}}class kb{ReadonlyOptional(e){return Fp(e)}Readonly(e,t){return Sh(e,t??!0)}Optional(e,t){return Bh(e,t??!0)}Any(e){return wf(e)}Array(e,t){return xf(e,t)}Boolean(e){return Yf(e)}Capitalize(e,t){return function(e,t={}){return tb(e,"Capitalize",t)}(e,t)}Composite(e,t){return Gh(e,t)}Const(e,t){return function(e,t){return Ml(tp(e,!0),t)}(e,t)}Enum(e,t){return function(e,t){if(kl(e))throw new Error("Enum undefined or empty");const n=globalThis.Object.getOwnPropertyNames(e).filter(e=>isNaN(e)).map(t=>e[t]);return Lf([...new Set(n)].map(e=>Vf(e)),{...t,[Fl]:"Enum"})}(e,t)}Exclude(e,t,n){return Up(e,t,n)}Extends(e,t,n,r,i){return Rp(e,t,n,r,i)}Extract(e,t,n){return jp(e,t,n)}Index(e,t,n){return gh(e,t,n)}Integer(e){return function(e){return Ml({[Dl]:"Integer",type:"integer"},e)}(e)}Intersect(e,t){return Uh(e,t)}KeyOf(e,t){return Xh(e,t)}Literal(e,t){return Vf(e,t)}Lowercase(e,t){return function(e,t={}){return tb(e,"Lowercase",t)}(e,t)}Mapped(e,t,n){return Ch(e,t,n)}Module(e){return function(e){return new Eb(e)}(e)}Never(e){return _f(e)}Not(e,t){return function(e,t){return Ml({[Dl]:"Not",not:e},t)}(e,t)}Null(e){return Vh(e)}Number(e){return Zf(e)}Object(e,t){return xh(e,t)}Omit(e,t,n){return ib(e,t,n)}Partial(e,t){return hb(e,t)}Pick(e,t,n){return cb(e,t,n)}Record(e,t,n){return Wp(e,t,n)}Recursive(e,t){return function(e,t={}){kl(t.$id)&&(t.$id="T"+Sb++);const n=Il(e({[Dl]:"This",$ref:`${t.$id}`}));return n.$id=t.$id,Ml({[Fl]:"Recursive",...n},t)}(e,t)}Ref(...e){return jh(e[0],e[1])}Required(e,t){return gb(e,t)}Rest(e){return _b(e)}String(e){return Qf(e)}TemplateLiteral(e,t){return sh(e,t)}Transform(e){return function(e){return new Ob(e)}(e)}Tuple(e,t){return _h(e,t)}Uncapitalize(e,t){return function(e,t={}){return tb(e,"Uncapitalize",t)}(e,t)}Union(e,t){return Lf(e,t)}Unknown(e){return Qh(e)}Unsafe(e){return function(e={}){return Ml({[Dl]:e[Dl]??"Unsafe"},e)}(e)}Uppercase(e,t){return function(e,t={}){return tb(e,"Uppercase",t)}(e,t)}}class Tb extends kb{Argument(e){return function(e){return Ml({[Dl]:"Argument",index:e})}(e)}AsyncIterator(e,t){return Af(e,t)}Awaited(e,t){return Dh(e,t)}BigInt(e){return Jf(e)}ConstructorParameters(e,t){return function(e,t){return Yl(e)?_h(e.parameters,t):_f(t)}(e,t)}Constructor(e,t,n){return Nf(e,t,n)}Date(e={}){return Hh(e)}Function(e,t,n){return kf(e,t,n)}InstanceType(e,t){return function(e,t){return Yl(e)?Ml(e.returns,t):_f(t)}(e,t)}Instantiate(e,t){return Yp(t,Il(e))}Iterator(e,t){return yh(e,t)}Parameters(e,t){return function(e,t){return Jl(e)?_h(e.parameters,t):_f()}(e,t)}Promise(e,t){return Ah(e,t)}RegExp(e,t){return function(e,t){const n=Ol(e)?new globalThis.RegExp(e):e;return Ml({[Dl]:"RegExp",type:"RegExp",source:n.source,flags:n.flags},t)}(e,t)}ReturnType(e,t){return function(e,t){return Jl(e)?Ml(e.returns,t):_f(t)}(e,t)}Symbol(e){return Yh(e)}Undefined(e){return Jh(e)}Uint8Array(e){return Zh(e)}Void(e){return function(e){return Ml({[Dl]:"Void",type:"void"},e)}(e)}}const Cb=(e,t,n=[])=>{const r=Object.getOwnPropertyDescriptors(t);for(let e of n)delete r[e];Object.defineProperties(e,r)},Ib=(e,t=[e])=>{const n=Object.getPrototypeOf(e);return null===n?t:Ib(n,[...t,n])},Bb=(e,t,n=[])=>{var r;const i=null!==(r=((...e)=>{if(0===e.length)return;let t;const n=e.map(e=>Ib(e));for(;n.every(e=>e.length>0);){const e=n.map(e=>e.pop()),r=e[0];if(!e.every(e=>e===r))break;t=r}return t})(...e))&&void 0!==r?r:Object.prototype,o=Object.create(i),a=Ib(i);for(let t of e){let e=Ib(t);for(let t=e.length-1;t>=0;t--){let r=e[t];-1===a.indexOf(r)&&(Cb(o,r,["constructor",...n]),a.push(r))}}return o.constructor=t,o},Lb=e=>e.filter((t,n)=>e.indexOf(t)==n),Mb=new WeakMap,Rb=e=>Mb.get(e),Pb=(e,t)=>{var n,r;const i=Lb([...Object.getOwnPropertyNames(e),...Object.getOwnPropertyNames(t)]),o={};for(let a of i)o[a]=Lb([...null!==(n=null==e?void 0:e[a])&&void 0!==n?n:[],...null!==(r=null==t?void 0:t[a])&&void 0!==r?r:[]]);return o},Ub=(e,t)=>{var n,r,i,o;return{property:Pb(null!==(n=null==e?void 0:e.property)&&void 0!==n?n:{},null!==(r=null==t?void 0:t.property)&&void 0!==r?r:{}),method:Pb(null!==(i=null==e?void 0:e.method)&&void 0!==i?i:{},null!==(o=null==t?void 0:t.method)&&void 0!==o?o:{})}},jb=new Map,Fb=(...e)=>{const t=((...e)=>{var t;const n=new Set,r=new Set([...e]);for(;r.size>0;)for(let e of r){const i=[...Ib(e.prototype).map(e=>e.constructor),...null!==(t=Rb(e))&&void 0!==t?t:[]].filter(e=>!n.has(e));for(let e of i)r.add(e);n.add(e),r.delete(e)}return[...n]})(...e).map(e=>jb.get(e)).filter(e=>!!e);return 0==t.length?{}:1==t.length?t[0]:t.reduce((e,t)=>((e,t)=>{var n,r,i,o,a,s;return{class:Lb([...null!==(n=null==e?void 0:e.class)&&void 0!==n?n:[],...null!==(r=null==t?void 0:t.class)&&void 0!==r?r:[]]),static:Ub(null!==(i=null==e?void 0:e.static)&&void 0!==i?i:{},null!==(o=null==t?void 0:t.static)&&void 0!==o?o:{}),instance:Ub(null!==(a=null==e?void 0:e.instance)&&void 0!==a?a:{},null!==(s=null==t?void 0:t.instance)&&void 0!==s?s:{})}})(e,t))};function Db(...e){var t,n,r;const i=e.map(e=>e.prototype);function o(...t){for(const n of e)Cb(this,new n(...t))}o.prototype=Bb(i,o),Object.setPrototypeOf(o,Bb(e,null,["prototype"]));let a=o;{const i=Fb(...e);for(let e of null!==(t=null==i?void 0:i.class)&&void 0!==t?t:[]){const t=e(a);t&&(a=t)}zb(null!==(n=null==i?void 0:i.static)&&void 0!==n?n:{},a),zb(null!==(r=null==i?void 0:i.instance)&&void 0!==r?r:{},a.prototype)}var s,c;return s=a,c=e,Mb.set(s,c),a}const zb=(e,t)=>{const n=e.property,r=e.method;if(n)for(let e in n)for(let r of n[e])r(t,e);if(r)for(let e in r)for(let n of r[e])n(t,e,Object.getOwnPropertyDescriptor(t,e))};yf("ArrayBuffer",(e,t)=>t instanceof ArrayBuffer);class $b extends Tb{ArrayBuffer(e){return Ml({[Dl]:"ArrayBuffer",type:"ArrayBuffer"},e)}}yf("Buffer",(e,t)=>t instanceof Buffer);class Wb extends Tb{Buffer(e){return Ml({[Dl]:"Buffer",type:"Buffer"},e)}}class Xb extends Tb{KeyOfEnum(e,t){const n=Object.keys(e).map(e=>this.Literal(e));return this.Union(n,{...t,[Fl]:"KeyOfEnum"})}Enum(e,t){const n=Object.entries(e).filter(([e,t])=>"string"==typeof e||!isNaN(e)).map(([e,t])=>this.Literal(t,{$id:e}));return this.Union(n,{...t,[Fl]:"Enum"})}}yf("Uint",(e,t)=>("string"==typeof t||"number"==typeof t)&&!("number"==typeof t&&!Number.isSafeInteger(t)||!/^(?:[1-9]\d*|\d)$/.test(t.toString().replace(/^-/,e.allowNegative?"":"-"))));class qb extends Tb{Uint(e){return Ml({[Dl]:"Uint",type:"Uint"},e)}}class Kb extends(Db(Tb,$b,Wb,Xb,qb)){}const Gb=new Kb,Hb=Gb.Object({dispose:Gb.Unsafe(),cancel:Gb.Unsafe(),on:Gb.Unsafe(),off:Gb.Unsafe(),removeAllListeners:Gb.Unsafe(),uiResponse:Gb.Unsafe(),updateConnectSettings:Gb.Unsafe()}),Vb=Gb.Object({getFeatures:Gb.Unsafe(),getDeviceState:Gb.Unsafe(),getFirmwareHash:Gb.Unsafe(),firmwareUpdate:Gb.Unsafe(),resetDevice:Gb.Unsafe(),loadDevice:Gb.Unsafe(),recoveryDevice:Gb.Unsafe(),wipeDevice:Gb.Unsafe(),backupDevice:Gb.Unsafe(),changePin:Gb.Unsafe(),changeWipeCode:Gb.Unsafe(),changeLanguage:Gb.Unsafe(),applySettings:Gb.Unsafe(),applyFlags:Gb.Unsafe(),authenticateDevice:Gb.Unsafe(),setBusy:Gb.Unsafe(),setBrightness:Gb.Unsafe(),showDeviceTutorial:Gb.Unsafe(),bleUnpair:Gb.Unsafe(),requestLogin:Gb.Unsafe(),cipherKeyValue:Gb.Unsafe(),unlockPath:Gb.Unsafe(),getOwnershipId:Gb.Unsafe(),getOwnershipProof:Gb.Unsafe(),thpGetCredentials:Gb.Unsafe(),thpRemoveCredentials:Gb.Unsafe(),telemetryGet:Gb.Unsafe(),pingDevice:Gb.Unsafe()}),Yb=Gb.Object({blockchainSubscribe:Gb.Unsafe(),blockchainUnsubscribe:Gb.Unsafe(),blockchainDisconnect:Gb.Unsafe(),blockchainSetCustomBackend:Gb.Unsafe(),blockchainGetInfo:Gb.Unsafe(),blockchainValidateEvmRpcUrl:Gb.Unsafe(),blockchainEstimateFee:Gb.Unsafe(),blockchainGetAccountBalanceHistory:Gb.Unsafe(),blockchainGetTransactions:Gb.Unsafe(),blockchainEvmRpcCall:Gb.Unsafe(),blockchainGetCurrentFiatRates:Gb.Unsafe(),blockchainGetContractInfo:Gb.Unsafe(),blockchainGetFiatRatesForTimestamps:Gb.Unsafe(),blockchainSubscribeFiatRates:Gb.Unsafe(),blockchainUnsubscribeFiatRates:Gb.Unsafe(),pushTransaction:Gb.Unsafe(),getNonce:Gb.Unsafe()}),Jb=Gb.Object({getAddress:Gb.Unsafe(),getPublicKey:Gb.Unsafe(),getAccountInfo:Gb.Unsafe(),getAccountDescriptor:Gb.Unsafe(),discoverAccounts:Gb.Unsafe(),signMessage:Gb.Unsafe(),verifyMessage:Gb.Unsafe(),getSettings:Gb.Unsafe(),getCoinInfo:Gb.Unsafe()}),Zb=Gb.Object({signTransaction:Gb.Unsafe(),composeTransaction:Gb.Unsafe(),authorizeCoinjoin:Gb.Unsafe(),cancelCoinjoinAuthorization:Gb.Unsafe()}),Qb=Gb.Object({ethereumGetAddress:Gb.Unsafe(),ethereumGetPublicKey:Gb.Unsafe(),ethereumSignTransaction:Gb.Unsafe(),ethereumSignMessage:Gb.Unsafe(),ethereumSignTypedData:Gb.Unsafe(),ethereumVerifyMessage:Gb.Unsafe()}),em=Gb.Object({cardanoGetAddress:Gb.Unsafe(),cardanoGetPublicKey:Gb.Unsafe(),cardanoGetNativeScriptHash:Gb.Unsafe(),cardanoSignTransaction:Gb.Unsafe(),cardanoSignMessage:Gb.Unsafe(),cardanoComposeTransaction:Gb.Unsafe()}),tm=Gb.Object({moneroGetAddress:Gb.Unsafe(),moneroGetWatchKey:Gb.Unsafe(),moneroKeyImageSync:Gb.Unsafe(),moneroSignTransaction:Gb.Unsafe()}),nm=Gb.Object({rippleGetAddress:Gb.Unsafe(),rippleSignTransaction:Gb.Unsafe()}),rm=Gb.Object({solanaGetAddress:Gb.Unsafe(),solanaGetPublicKey:Gb.Unsafe(),solanaSignTransaction:Gb.Unsafe(),solanaComposeTransaction:Gb.Unsafe()}),im=Gb.Object({stellarGetAddress:Gb.Unsafe(),stellarSignTransaction:Gb.Unsafe()}),om=Gb.Object({tezosGetAddress:Gb.Unsafe(),tezosGetPublicKey:Gb.Unsafe(),tezosSignTransaction:Gb.Unsafe()}),am=Gb.Object({tronGetAddress:Gb.Unsafe(),tronSignTransaction:Gb.Unsafe(),tronComposeTransaction:Gb.Unsafe()}),sm=Gb.Object({evoluGetNode:Gb.Unsafe(),evoluSignRegistrationRequest:Gb.Unsafe(),evoluGetDelegatedIdentityKey:Gb.Unsafe()});var cm;Gb.Composite([Hb,Vb,Yb,Jb,Zb,Qb,em,tm,nm,rm,im,om,am,sm]),function(e){e.T1B1="T1B1",e.T2T1="T2T1",e.T2B1="T2B1",e.T3B1="T3B1",e.T3T1="T3T1",e.T3W1="T3W1",e.UNKNOWN="UNKNOWN"}(cm||(cm={})),Gb.Object({blockTime:Gb.Number(),minFee:Gb.Number(),maxFee:Gb.Number(),minPriorityFee:Gb.Number(),dustLimit:Gb.Number()});const um=Gb.Object({label:Gb.Union([Gb.Literal("high"),Gb.Literal("normal"),Gb.Literal("economy"),Gb.Literal("low"),Gb.Literal("custom")]),blocks:Gb.Number(),feePerUnit:Gb.String(),feePerTx:Gb.Optional(Gb.String()),feeLimit:Gb.Optional(Gb.String()),baseFeePerGas:Gb.Optional(Gb.String()),maxFeePerGas:Gb.Optional(Gb.String()),maxPriorityFeePerGas:Gb.Optional(Gb.String())});Gb.Union([Gb.Object({name:Gb.String(),fee:Gb.Literal("0"),feePerByte:Gb.Optional(Gb.Undefined()),blocks:Gb.Optional(Gb.Undefined()),disabled:Gb.Literal(!0)}),Gb.Object({name:Gb.String(),fee:Gb.String(),feePerByte:Gb.String(),blocks:Gb.Number(),minutes:Gb.Number(),total:Gb.String()})]);const lm=Gb.Object({public:Gb.Number(),private:Gb.Number()}),dm=Gb.Object({messagePrefix:Gb.String(),bech32:Gb.String(),bip32:lm,pubKeyHash:Gb.Number(),scriptHash:Gb.Number(),wif:Gb.Number(),forkId:Gb.Optional(Gb.Number())});Gb.Object({coin:Gb.String(),identity:Gb.Optional(Gb.String())});const fm=Gb.Record(Gb.KeyOfEnum(cm),Gb.Union([Gb.String(),Gb.Literal(!1)])),hm=Gb.Object({type:Gb.String(),url:Gb.Array(Gb.String())}),pm=Gb.Object({label:Gb.String(),name:Gb.String(),shortcut:Gb.String(),slip44:Gb.Number(),support:fm,decimals:Gb.Number(),blockchainLink:Gb.Optional(hm),blockTime:Gb.Number(),minFee:Gb.Number(),maxFee:Gb.Number(),minPriorityFee:Gb.Number(),defaultFees:Gb.Array(um)}),bm=Gb.Intersect([pm,Gb.Object({type:Gb.Literal("bitcoin"),cashAddrPrefix:Gb.Optional(Gb.String()),curveName:Gb.String(),dustLimit:Gb.Number(),forceBip143:Gb.Boolean(),hashGenesisBlock:Gb.String(),maxAddressLength:Gb.Number(),maxFeeSatoshiKb:Gb.Number(),minAddressLength:Gb.Number(),minFeeSatoshiKb:Gb.Number(),segwit:Gb.Boolean(),xPubMagic:Gb.Number(),xPubMagicSegwitNative:Gb.Optional(Gb.Number()),xPubMagicSegwit:Gb.Optional(Gb.Number()),taproot:Gb.Optional(Gb.Boolean()),network:dm,isBitcoin:Gb.Boolean()})]),mm=Gb.Intersect([pm,Gb.Object({type:Gb.Literal("ethereum"),chainId:Gb.Number(),network:Gb.Optional(Gb.Undefined())})]);Gb.Omit(mm,["minFee","maxFee","defaultFees","minPriorityFee","blockTime"]);const gm=Gb.Intersect([pm,Gb.Object({type:Gb.Literal("misc"),curve:Gb.String(),network:Gb.Optional(Gb.Undefined())})]);Gb.Union([bm,mm,gm]);const vm=Gb.Union([Gb.String(),Gb.Array(Gb.Number())],{description:"Derivation Path (BIP32).",$id:"DerivationPath"});Gb.Object({path:vm,address:Gb.Optional(Gb.String()),showOnTrezor:Gb.Optional(Gb.Boolean({default:!0})),chunkify:Gb.Optional(Gb.Boolean())});const ym=Gb.Object({path:vm,showOnTrezor:Gb.Optional(Gb.Boolean()),suppressBackupWarning:Gb.Optional(Gb.Boolean()),chunkify:Gb.Optional(Gb.Boolean())}),wm=Gb.Object({publicKey:Gb.String(),path:Gb.Array(Gb.Number()),serializedPath:Gb.String()});var xm;Gb.Object({appName:Gb.String(),appIcon:Gb.Optional(Gb.String()),appUrl:Gb.String(),email:Gb.String()}),function(e){e[e.ButtonRequest_Other=1]="ButtonRequest_Other",e[e.ButtonRequest_FeeOverThreshold=2]="ButtonRequest_FeeOverThreshold",e[e.ButtonRequest_ConfirmOutput=3]="ButtonRequest_ConfirmOutput",e[e.ButtonRequest_ResetDevice=4]="ButtonRequest_ResetDevice",e[e.ButtonRequest_ConfirmWord=5]="ButtonRequest_ConfirmWord",e[e.ButtonRequest_WipeDevice=6]="ButtonRequest_WipeDevice",e[e.ButtonRequest_ProtectCall=7]="ButtonRequest_ProtectCall",e[e.ButtonRequest_SignTx=8]="ButtonRequest_SignTx",e[e.ButtonRequest_FirmwareCheck=9]="ButtonRequest_FirmwareCheck",e[e.ButtonRequest_Address=10]="ButtonRequest_Address",e[e.ButtonRequest_PublicKey=11]="ButtonRequest_PublicKey",e[e.ButtonRequest_MnemonicWordCount=12]="ButtonRequest_MnemonicWordCount",e[e.ButtonRequest_MnemonicInput=13]="ButtonRequest_MnemonicInput",e[e._Deprecated_ButtonRequest_PassphraseType=14]="_Deprecated_ButtonRequest_PassphraseType",e[e.ButtonRequest_UnknownDerivationPath=15]="ButtonRequest_UnknownDerivationPath",e[e.ButtonRequest_RecoveryHomepage=16]="ButtonRequest_RecoveryHomepage",e[e.ButtonRequest_Success=17]="ButtonRequest_Success",e[e.ButtonRequest_Warning=18]="ButtonRequest_Warning",e[e.ButtonRequest_PassphraseEntry=19]="ButtonRequest_PassphraseEntry",e[e.ButtonRequest_PinEntry=20]="ButtonRequest_PinEntry"}(xm||(xm={})),Gb.Enum(xm);const Am=Gb.KeyOfEnum(xm,{$id:"ButtonRequestType"});var Em;!function(e){e[e.Failure_UnexpectedMessage=1]="Failure_UnexpectedMessage",e[e.Failure_ButtonExpected=2]="Failure_ButtonExpected",e[e.Failure_DataError=3]="Failure_DataError",e[e.Failure_ActionCancelled=4]="Failure_ActionCancelled",e[e.Failure_PinExpected=5]="Failure_PinExpected",e[e.Failure_PinCancelled=6]="Failure_PinCancelled",e[e.Failure_PinInvalid=7]="Failure_PinInvalid",e[e.Failure_InvalidSignature=8]="Failure_InvalidSignature",e[e.Failure_ProcessError=9]="Failure_ProcessError",e[e.Failure_NotEnoughFunds=10]="Failure_NotEnoughFunds",e[e.Failure_NotInitialized=11]="Failure_NotInitialized",e[e.Failure_PinMismatch=12]="Failure_PinMismatch",e[e.Failure_WipeCodeMismatch=13]="Failure_WipeCodeMismatch",e[e.Failure_InvalidSession=14]="Failure_InvalidSession",e[e.Failure_Busy=15]="Failure_Busy",e[e.Failure_ThpUnallocatedSession=16]="Failure_ThpUnallocatedSession",e[e.Failure_InvalidProtocol=17]="Failure_InvalidProtocol",e[e.Failure_InProgress=19]="Failure_InProgress",e[e.Failure_FirmwareError=99]="Failure_FirmwareError"}(Em||(Em={})),Gb.Enum(Em);const Sm=Gb.KeyOfEnum(Em,{$id:"FailureType"});var _m;!function(e){e[e.PinMatrixRequestType_Current=1]="PinMatrixRequestType_Current",e[e.PinMatrixRequestType_NewFirst=2]="PinMatrixRequestType_NewFirst",e[e.PinMatrixRequestType_NewSecond=3]="PinMatrixRequestType_NewSecond",e[e.PinMatrixRequestType_WipeCodeFirst=4]="PinMatrixRequestType_WipeCodeFirst",e[e.PinMatrixRequestType_WipeCodeSecond=5]="PinMatrixRequestType_WipeCodeSecond"}(_m||(_m={})),Gb.Enum(_m);const Om=Gb.KeyOfEnum(_m,{$id:"PinMatrixRequestType"});Gb.Object({},{$id:"ButtonAck"}),Gb.Object({code:Gb.Optional(Am),pages:Gb.Optional(Gb.Number()),name:Gb.Optional(Gb.String())},{$id:"ButtonRequest"});const Nm=Gb.Object({coin_type:Gb.Number(),amount:Gb.String(),address:Gb.String(),address_n:Gb.Array(Gb.Number()),mac:Gb.String()},{$id:"CoinPurchaseMemo"});Gb.Object({},{$id:"Deprecated_PassphraseStateAck"}),Gb.Object({state:Gb.Optional(Gb.String())},{$id:"Deprecated_PassphraseStateRequest"}),Gb.Object({code:Gb.Optional(Sm),message:Gb.Optional(Gb.String())},{$id:"Failure"});const km=Gb.Object({depth:Gb.Number(),fingerprint:Gb.Number(),child_num:Gb.Number(),chain_code:Gb.String(),private_key:Gb.Optional(Gb.String()),public_key:Gb.String()},{$id:"HDNodeType"});Gb.Object({passphrase:Gb.Optional(Gb.String()),_state:Gb.Optional(Gb.String()),on_device:Gb.Optional(Gb.Boolean())},{$id:"PassphraseAck"}),Gb.Object({_on_device:Gb.Optional(Gb.Boolean())},{$id:"PassphraseRequest"});const Tm=Gb.Object({text:Gb.String()},{$id:"TextMemo"}),Cm=Gb.Object({address:Gb.String(),address_n:Gb.Array(Gb.Number()),mac:Gb.String()},{$id:"RefundMemo"}),Im=Gb.Object({title:Gb.String(),text:Gb.String()},{$id:"TextDetailsMemo"}),Bm=Gb.Object({text_memo:Gb.Optional(Tm),refund_memo:Gb.Optional(Cm),coin_purchase_memo:Gb.Optional(Nm),text_details_memo:Gb.Optional(Im)},{$id:"PaymentRequestMemo"}),Lm=Gb.Object({nonce:Gb.Optional(Gb.String()),recipient_name:Gb.String(),memos:Gb.Optional(Gb.Array(Bm)),amount:Gb.Optional(Gb.String()),signature:Gb.String()},{$id:"PaymentRequest"});var Mm;Gb.Object({pin:Gb.String()},{$id:"PinMatrixAck"}),Gb.Object({type:Gb.Optional(Om)},{$id:"PinMatrixRequest"}),Gb.Object({message:Gb.String()},{$id:"Success"}),function(e){e[e.BITCOIN=0]="BITCOIN",e[e.MILLIBITCOIN=1]="MILLIBITCOIN",e[e.MICROBITCOIN=2]="MICROBITCOIN",e[e.SATOSHI=3]="SATOSHI"}(Mm||(Mm={}));const Rm=Gb.Enum(Mm);var Pm;!function(e){e[e.SSGen=0]="SSGen",e[e.SSRTX=1]="SSRTX"}(Pm||(Pm={}));const Um=Gb.Enum(Pm);var jm;!function(e){e[e.SPENDADDRESS=0]="SPENDADDRESS",e[e.SPENDMULTISIG=1]="SPENDMULTISIG",e[e.EXTERNAL=2]="EXTERNAL",e[e.SPENDWITNESS=3]="SPENDWITNESS",e[e.SPENDP2SHWITNESS=4]="SPENDP2SHWITNESS",e[e.SPENDTAPROOT=5]="SPENDTAPROOT"}(jm||(jm={})),Gb.Enum(jm);const Fm=Gb.KeyOfEnum(jm,{$id:"InputScriptType"});var Dm;!function(e){e[e.PRESERVED=0]="PRESERVED",e[e.LEXICOGRAPHIC=1]="LEXICOGRAPHIC"}(Dm||(Dm={}));const zm=Gb.Enum(Dm);var $m;!function(e){e[e.PAYTOADDRESS=0]="PAYTOADDRESS",e[e.PAYTOSCRIPTHASH=1]="PAYTOSCRIPTHASH",e[e.PAYTOMULTISIG=2]="PAYTOMULTISIG",e[e.PAYTOOPRETURN=3]="PAYTOOPRETURN",e[e.PAYTOWITNESS=4]="PAYTOWITNESS",e[e.PAYTOP2SHWITNESS=5]="PAYTOP2SHWITNESS",e[e.PAYTOTAPROOT=6]="PAYTOTAPROOT"}($m||($m={})),Gb.Enum($m);const Wm=Gb.KeyOfEnum($m,{$id:"OutputScriptType"});var Xm;!function(e){e[e.TXINPUT=0]="TXINPUT",e[e.TXOUTPUT=1]="TXOUTPUT",e[e.TXMETA=2]="TXMETA",e[e.TXFINISHED=3]="TXFINISHED",e[e.TXEXTRADATA=4]="TXEXTRADATA",e[e.TXORIGINPUT=5]="TXORIGINPUT",e[e.TXORIGOUTPUT=6]="TXORIGOUTPUT",e[e.TXPAYMENTREQ=7]="TXPAYMENTREQ"}(Xm||(Xm={})),Gb.Enum(Xm);const qm=Gb.KeyOfEnum(Xm,{$id:"RequestType"});Gb.Object({address:Gb.String(),mac:Gb.Optional(Gb.String())},{$id:"Address"}),Gb.Object({coordinator:Gb.String(),max_rounds:Gb.Number(),max_coordinator_fee_rate:Gb.Number(),max_fee_per_kvbyte:Gb.Number(),address_n:Gb.Array(Gb.Number()),coin_name:Gb.Optional(Gb.String()),script_type:Gb.Optional(Fm),amount_unit:Gb.Optional(Rm)},{$id:"AuthorizeCoinJoin"});const Km=Gb.Object({fee_rate:Gb.Number(),no_fee_threshold:Gb.Number(),min_registrable_amount:Gb.Number(),mask_public_key:Gb.Optional(Gb.String()),signature:Gb.Optional(Gb.String())},{$id:"CoinJoinRequest"}),Gm=Gb.Object({node:Gb.Union([km,Gb.String()]),address_n:Gb.Array(Gb.Number())},{$id:"HDNodePathType"}),Hm=Gb.Object({pubkeys:Gb.Array(Gm),signatures:Gb.Array(Gb.String()),m:Gb.Number(),nodes:Gb.Optional(Gb.Array(km)),address_n:Gb.Optional(Gb.Array(Gb.Number())),pubkeys_order:Gb.Optional(zm)},{$id:"MultisigRedeemScriptType"});Gb.Object({address_n:Gb.Array(Gb.Number()),coin_name:Gb.Optional(Gb.String()),show_display:Gb.Optional(Gb.Boolean()),multisig:Gb.Optional(Hm),script_type:Gb.Optional(Fm),ignore_xpub_magic:Gb.Optional(Gb.Boolean()),chunkify:Gb.Optional(Gb.Boolean())},{$id:"GetAddress"}),Gb.Object({address_n:Gb.Array(Gb.Number()),coin_name:Gb.Optional(Gb.String()),multisig:Gb.Optional(Hm),script_type:Gb.Optional(Fm)},{$id:"GetOwnershipId"}),Gb.Object({address_n:Gb.Array(Gb.Number()),coin_name:Gb.Optional(Gb.String()),script_type:Gb.Optional(Fm),multisig:Gb.Optional(Hm),user_confirmation:Gb.Optional(Gb.Boolean()),ownership_ids:Gb.Optional(Gb.Array(Gb.String())),commitment_data:Gb.Optional(Gb.String())},{$id:"GetOwnershipProof"}),Gb.Object({address_n:Gb.Array(Gb.Number()),ecdsa_curve_name:Gb.Optional(Gb.String()),show_display:Gb.Optional(Gb.Boolean()),coin_name:Gb.Optional(Gb.String()),script_type:Gb.Optional(Fm),ignore_xpub_magic:Gb.Optional(Gb.Boolean())},{$id:"GetPublicKey"}),Gb.Object({address:Gb.String(),signature:Gb.String()},{$id:"MessageSignature"}),Gb.Object({ownership_id:Gb.String()},{$id:"OwnershipId"}),Gb.Object({ownership_proof:Gb.String(),signature:Gb.String()},{$id:"OwnershipProof"});const Vm=Gb.Object({prev_hash:Gb.String(),prev_index:Gb.Number(),script_sig:Gb.String(),sequence:Gb.Number(),decred_tree:Gb.Optional(Gb.Number())},{$id:"PrevInput"}),Ym=Gb.Object({amount:Gb.Uint(),script_pubkey:Gb.String(),decred_script_version:Gb.Optional(Gb.Number())},{$id:"PrevOutput"}),Jm=Gb.Object({version:Gb.Number(),lock_time:Gb.Number(),inputs_count:Gb.Number(),outputs_count:Gb.Number(),extra_data_len:Gb.Optional(Gb.Number()),expiry:Gb.Optional(Gb.Number()),version_group_id:Gb.Optional(Gb.Number()),timestamp:Gb.Optional(Gb.Number()),branch_id:Gb.Optional(Gb.Number())},{$id:"PrevTx"});Gb.Object({node:km,xpub:Gb.String(),root_fingerprint:Gb.Optional(Gb.Number()),descriptor:Gb.Optional(Gb.String())},{$id:"PublicKey"}),Gb.Object({address_n:Gb.Array(Gb.Number()),message:Gb.String(),coin_name:Gb.Optional(Gb.String()),script_type:Gb.Optional(Fm),no_script_type:Gb.Optional(Gb.Boolean()),chunkify:Gb.Optional(Gb.Boolean())},{$id:"SignMessage"}),Gb.Object({outputs_count:Gb.Number(),inputs_count:Gb.Number(),coin_name:Gb.Optional(Gb.String()),version:Gb.Optional(Gb.Number()),lock_time:Gb.Optional(Gb.Number()),expiry:Gb.Optional(Gb.Number()),overwintered:Gb.Optional(Gb.Boolean()),version_group_id:Gb.Optional(Gb.Number()),timestamp:Gb.Optional(Gb.Number()),branch_id:Gb.Optional(Gb.Number()),amount_unit:Gb.Optional(Rm),decred_staking_ticket:Gb.Optional(Gb.Boolean()),serialize:Gb.Optional(Gb.Boolean()),coinjoin_request:Gb.Optional(Km),chunkify:Gb.Optional(Gb.Boolean())},{$id:"SignTx"});const Zm=Gb.Exclude(Fm,Gb.Literal("EXTERNAL"),{$id:"InternalInputScriptType"}),Qm=Gb.Object({prev_hash:Gb.String(),prev_index:Gb.Number(),amount:Gb.Uint(),sequence:Gb.Optional(Gb.Number()),multisig:Gb.Optional(Hm),decred_tree:Gb.Optional(Gb.Number()),orig_hash:Gb.Optional(Gb.String()),orig_index:Gb.Optional(Gb.Number()),decred_staking_spend:Gb.Optional(Um),script_pubkey:Gb.Optional(Gb.String()),coinjoin_flags:Gb.Optional(Gb.Number()),script_sig:Gb.Optional(Gb.String()),witness:Gb.Optional(Gb.String()),ownership_proof:Gb.Optional(Gb.String()),commitment_data:Gb.Optional(Gb.String())},{$id:"CommonTxInputType"}),eg=Gb.Union([Gb.Intersect([Qm,Gb.Object({address_n:Gb.Array(Gb.Number()),script_type:Gb.Optional(Zm)})]),Gb.Intersect([Qm,Gb.Object({address_n:Gb.Optional(Gb.Undefined()),script_type:Gb.Literal("EXTERNAL"),script_pubkey:Gb.String()})])],{$id:"TxInputType"}),tg=Il(eg,{$id:"TxInput"}),ng=Gb.Object({amount:Gb.Uint(),script_pubkey:Gb.String(),decred_script_version:Gb.Optional(Gb.Number())},{$id:"TxOutputBinType"}),rg=Gb.Exclude(Wm,Gb.Literal("PAYTOOPRETURN"),{$id:"ChangeOutputScriptType"}),ig=Gb.Union([Gb.Object({address:Gb.String(),address_n:Gb.Optional(Gb.Undefined()),script_type:Gb.Optional(Gb.Literal("PAYTOADDRESS")),amount:Gb.Uint(),multisig:Gb.Optional(Hm),orig_hash:Gb.Optional(Gb.String()),orig_index:Gb.Optional(Gb.Number()),payment_req_index:Gb.Optional(Gb.Number())}),Gb.Object({address:Gb.Optional(Gb.Undefined()),address_n:Gb.Array(Gb.Number()),script_type:Gb.Optional(rg),amount:Gb.Uint(),multisig:Gb.Optional(Hm),orig_hash:Gb.Optional(Gb.String()),orig_index:Gb.Optional(Gb.Number()),payment_req_index:Gb.Optional(Gb.Number())}),Gb.Object({address:Gb.Optional(Gb.Undefined()),address_n:Gb.Optional(Gb.Undefined()),amount:Gb.Union([Gb.Literal("0"),Gb.Literal(0)]),op_return_data:Gb.String(),script_type:Gb.Literal("PAYTOOPRETURN"),orig_hash:Gb.Optional(Gb.String()),orig_index:Gb.Optional(Gb.Number()),payment_req_index:Gb.Optional(Gb.Number())})],{$id:"TxOutputType"}),og=Il(ig,{$id:"TxOutput"}),ag=Gb.Union([Gb.Object({inputs:Gb.Array(Gb.Union([eg,Vm]))}),Gb.Object({bin_outputs:Gb.Array(ng)}),Gb.Object({outputs:Gb.Array(ig)}),Gb.Object({extra_data:Gb.String()}),Gb.Object({version:Gb.Optional(Gb.Number()),lock_time:Gb.Optional(Gb.Number()),inputs_cnt:Gb.Number(),outputs_cnt:Gb.Number(),extra_data:Gb.Optional(Gb.String()),extra_data_len:Gb.Optional(Gb.Number()),timestamp:Gb.Optional(Gb.Number()),version_group_id:Gb.Optional(Gb.Number()),expiry:Gb.Optional(Gb.Number()),branch_id:Gb.Optional(Gb.Number())})],{$id:"TxAckResponse"});Gb.Object({tx:ag},{$id:"TxAck"});const sg=Gb.Object({input:tg},{$id:"TxAckInputWrapper"});Gb.Object({tx:sg},{$id:"TxAckInput"});const cg=Gb.Object({output:og},{$id:"TxAckOutputWrapper"});Gb.Object({tx:cg},{$id:"TxAckOutput"});const ug=Gb.Object({extra_data_chunk:Gb.String()},{$id:"TxAckPrevExtraDataWrapper"});Gb.Object({tx:ug},{$id:"TxAckPrevExtraData"});const lg=Gb.Object({input:Vm},{$id:"TxAckPrevInputWrapper"});Gb.Object({tx:lg},{$id:"TxAckPrevInput"}),Gb.Object({tx:Jm},{$id:"TxAckPrevMeta"});const dg=Gb.Object({output:Ym},{$id:"TxAckPrevOutputWrapper"});Gb.Object({tx:dg},{$id:"TxAckPrevOutput"});const fg=Gb.Object({request_index:Gb.Number(),tx_hash:Gb.Optional(Gb.String()),extra_data_len:Gb.Optional(Gb.Number()),extra_data_offset:Gb.Optional(Gb.Number())},{$id:"TxRequestDetailsType"}),hg=Gb.Object({signature_index:Gb.Optional(Gb.Number()),signature:Gb.Optional(Gb.String()),serialized_tx:Gb.Optional(Gb.String())},{$id:"TxRequestSerializedType"});var pg;Gb.Object({request_type:qm,details:fg,serialized:Gb.Optional(hg)},{$id:"TxRequest"}),Gb.Object({address:Gb.String(),signature:Gb.String(),message:Gb.String(),coin_name:Gb.Optional(Gb.String()),chunkify:Gb.Optional(Gb.Boolean())},{$id:"VerifyMessage"}),function(e){e[e.BASE=0]="BASE",e[e.BASE_SCRIPT_KEY=1]="BASE_SCRIPT_KEY",e[e.BASE_KEY_SCRIPT=2]="BASE_KEY_SCRIPT",e[e.BASE_SCRIPT_SCRIPT=3]="BASE_SCRIPT_SCRIPT",e[e.POINTER=4]="POINTER",e[e.POINTER_SCRIPT=5]="POINTER_SCRIPT",e[e.ENTERPRISE=6]="ENTERPRISE",e[e.ENTERPRISE_SCRIPT=7]="ENTERPRISE_SCRIPT",e[e.BYRON=8]="BYRON",e[e.REWARD=14]="REWARD",e[e.REWARD_SCRIPT=15]="REWARD_SCRIPT"}(pg||(pg={}));const bg=Gb.Enum(pg);var mg;!function(e){e[e.STAKE_REGISTRATION=0]="STAKE_REGISTRATION",e[e.STAKE_DEREGISTRATION=1]="STAKE_DEREGISTRATION",e[e.STAKE_DELEGATION=2]="STAKE_DELEGATION",e[e.STAKE_POOL_REGISTRATION=3]="STAKE_POOL_REGISTRATION",e[e.STAKE_REGISTRATION_CONWAY=7]="STAKE_REGISTRATION_CONWAY",e[e.STAKE_DEREGISTRATION_CONWAY=8]="STAKE_DEREGISTRATION_CONWAY",e[e.VOTE_DELEGATION=9]="VOTE_DELEGATION"}(mg||(mg={}));const gg=Gb.Enum(mg);var vg;!function(e){e[e.CIP15=0]="CIP15",e[e.CIP36=1]="CIP36"}(vg||(vg={}));const yg=Gb.Enum(vg);var wg;!function(e){e[e.LEDGER=0]="LEDGER",e[e.ICARUS=1]="ICARUS",e[e.ICARUS_TREZOR=2]="ICARUS_TREZOR"}(wg||(wg={}));const xg=Gb.Enum(wg);var Ag;!function(e){e[e.KEY_HASH=0]="KEY_HASH",e[e.SCRIPT_HASH=1]="SCRIPT_HASH",e[e.ABSTAIN=2]="ABSTAIN",e[e.NO_CONFIDENCE=3]="NO_CONFIDENCE"}(Ag||(Ag={}));const Eg=Gb.Enum(Ag);var Sg;!function(e){e[e.HIDE=0]="HIDE",e[e.BECH32=1]="BECH32",e[e.POLICY_ID=2]="POLICY_ID"}(Sg||(Sg={}));const _g=Gb.Enum(Sg);var Og;!function(e){e[e.PUB_KEY=0]="PUB_KEY",e[e.ALL=1]="ALL",e[e.ANY=2]="ANY",e[e.N_OF_K=3]="N_OF_K",e[e.INVALID_BEFORE=4]="INVALID_BEFORE",e[e.INVALID_HEREAFTER=5]="INVALID_HEREAFTER"}(Og||(Og={}));const Ng=Gb.Enum(Og);var kg;!function(e){e[e.SINGLE_HOST_IP=0]="SINGLE_HOST_IP",e[e.SINGLE_HOST_NAME=1]="SINGLE_HOST_NAME",e[e.MULTIPLE_HOST_NAME=2]="MULTIPLE_HOST_NAME"}(kg||(kg={}));const Tg=Gb.Enum(kg);var Cg;!function(e){e[e.NONE=0]="NONE",e[e.CVOTE_REGISTRATION_SIGNATURE=1]="CVOTE_REGISTRATION_SIGNATURE"}(Cg||(Cg={}));const Ig=Gb.Enum(Cg);var Bg;!function(e){e[e.ARRAY_LEGACY=0]="ARRAY_LEGACY",e[e.MAP_BABBAGE=1]="MAP_BABBAGE"}(Bg||(Bg={}));const Lg=Gb.Enum(Bg);var Mg;!function(e){e[e.ORDINARY_TRANSACTION=0]="ORDINARY_TRANSACTION",e[e.POOL_REGISTRATION_AS_OWNER=1]="POOL_REGISTRATION_AS_OWNER",e[e.MULTISIG_TRANSACTION=2]="MULTISIG_TRANSACTION",e[e.PLUTUS_TRANSACTION=3]="PLUTUS_TRANSACTION"}(Mg||(Mg={}));const Rg=Gb.Enum(Mg);var Pg;!function(e){e[e.BYRON_WITNESS=0]="BYRON_WITNESS",e[e.SHELLEY_WITNESS=1]="SHELLEY_WITNESS"}(Pg||(Pg={}));const Ug=Gb.Enum(Pg);Gb.Object({address:Gb.String(),mac:Gb.Optional(Gb.String())},{$id:"CardanoAddress"});const jg=Gb.Object({block_index:Gb.Number(),tx_index:Gb.Number(),certificate_index:Gb.Number()},{$id:"CardanoBlockchainPointerType"}),Fg=Gb.Object({address_type:bg,address_n:Gb.Array(Gb.Number()),address_n_staking:Gb.Array(Gb.Number()),staking_key_hash:Gb.Optional(Gb.String()),certificate_pointer:Gb.Optional(jg),script_payment_hash:Gb.Optional(Gb.String()),script_staking_hash:Gb.Optional(Gb.String())},{$id:"CardanoAddressParametersType"});Gb.Object({policy_id:Gb.String(),tokens_count:Gb.Number()},{$id:"CardanoAssetGroup"});const Dg=Gb.Object({vote_public_key:Gb.String(),weight:Gb.Uint()},{$id:"CardanoCVoteRegistrationDelegation"}),zg=Gb.Object({vote_public_key:Gb.Optional(Gb.String()),staking_path:Gb.Array(Gb.Number()),payment_address_parameters:Gb.Optional(Fg),nonce:Gb.Uint(),format:Gb.Optional(yg),delegations:Gb.Optional(Gb.Array(Dg)),voting_purpose:Gb.Optional(Gb.Uint()),payment_address:Gb.Optional(Gb.String())},{$id:"CardanoCVoteRegistrationParametersType"}),$g=Gb.Object({type:Eg,key_hash:Gb.Optional(Gb.String()),script_hash:Gb.Optional(Gb.String())},{$id:"CardanoDRep"});Gb.Object({show_display:Gb.Optional(Gb.Boolean()),protocol_magic:Gb.Number(),network_id:Gb.Number(),address_parameters:Fg,derivation_type:xg,chunkify:Gb.Optional(Gb.Boolean())},{$id:"CardanoGetAddress"});const Wg=Gb.Recursive(e=>Gb.Object({type:Ng,scripts:Gb.Optional(Gb.Array(e)),key_hash:Gb.Optional(Gb.String()),key_path:Gb.Optional(Gb.Array(Gb.Number())),required_signatures_count:Gb.Optional(Gb.Number()),invalid_before:Gb.Optional(Gb.Uint()),invalid_hereafter:Gb.Optional(Gb.Uint())}),{$id:"CardanoNativeScript"});Gb.Object({script:Wg,display_format:_g,derivation_type:xg},{$id:"CardanoGetNativeScriptHash"}),Gb.Object({address_n:Gb.Array(Gb.Number()),show_display:Gb.Optional(Gb.Boolean()),derivation_type:xg},{$id:"CardanoGetPublicKey"}),Gb.Object({length:Gb.Number(),offset:Gb.Number()},{$id:"CardanoMessageDataRequest"}),Gb.Object({data:Gb.String()},{$id:"CardanoMessageDataResponse"}),Gb.Object({signature:Gb.String(),address:Gb.String(),pub_key:Gb.String()},{$id:"CardanoMessageSignature"}),Gb.Object({script_hash:Gb.String()},{$id:"CardanoNativeScriptHash"});const Xg=Gb.Object({url:Gb.String(),hash:Gb.String()},{$id:"CardanoPoolMetadataType"});Gb.Object({staking_key_path:Gb.Optional(Gb.Array(Gb.Number())),staking_key_hash:Gb.Optional(Gb.String())},{$id:"CardanoPoolOwner"});const qg=Gb.Object({pool_id:Gb.String(),vrf_key_hash:Gb.String(),pledge:Gb.Uint(),cost:Gb.Uint(),margin_numerator:Gb.Uint(),margin_denominator:Gb.Uint(),reward_account:Gb.String(),metadata:Gb.Optional(Xg),owners_count:Gb.Number(),relays_count:Gb.Number()},{$id:"CardanoPoolParametersType"});var Kg;Gb.Object({type:Tg,ipv4_address:Gb.Optional(Gb.String()),ipv6_address:Gb.Optional(Gb.String()),host_name:Gb.Optional(Gb.String()),port:Gb.Optional(Gb.Number())},{$id:"CardanoPoolRelayParameters"}),Gb.Object({xpub:Gb.String(),node:km},{$id:"CardanoPublicKey"}),Gb.Object({protocol_magic:Gb.Optional(Gb.Number()),network_id:Gb.Optional(Gb.Number()),signing_path:Gb.Array(Gb.Number()),payload_size:Gb.Number(),prefer_hex_display:Gb.Boolean(),address_parameters:Gb.Optional(Fg),derivation_type:xg},{$id:"CardanoSignMessageInit"}),Gb.Object({},{$id:"CardanoSignTxFinished"}),Gb.Object({signing_mode:Rg,protocol_magic:Gb.Number(),network_id:Gb.Number(),inputs_count:Gb.Number(),outputs_count:Gb.Number(),fee:Gb.Uint(),ttl:Gb.Optional(Gb.Uint()),certificates_count:Gb.Number(),withdrawals_count:Gb.Number(),has_auxiliary_data:Gb.Boolean(),validity_interval_start:Gb.Optional(Gb.Uint()),witness_requests_count:Gb.Number(),minting_asset_groups_count:Gb.Number(),derivation_type:xg,include_network_id:Gb.Optional(Gb.Boolean()),script_data_hash:Gb.Optional(Gb.String()),collateral_inputs_count:Gb.Number(),required_signers_count:Gb.Number(),has_collateral_return:Gb.Optional(Gb.Boolean()),total_collateral:Gb.Optional(Gb.Uint()),reference_inputs_count:Gb.Optional(Gb.Number()),chunkify:Gb.Optional(Gb.Boolean()),tag_cbor_sets:Gb.Optional(Gb.Boolean()),payment_req:Gb.Optional(Lm)},{$id:"CardanoSignTxInit"}),Gb.Object({asset_name_bytes:Gb.String(),amount:Gb.Optional(Gb.Uint()),mint_amount:Gb.Optional(Gb.Uint({allowNegative:!0}))},{$id:"CardanoToken"}),Gb.Object({cvote_registration_parameters:Gb.Optional(zg),hash:Gb.Optional(Gb.String())},{$id:"CardanoTxAuxiliaryData"}),Gb.Object({type:Ig,auxiliary_data_hash:Gb.Optional(Gb.String()),cvote_registration_signature:Gb.Optional(Gb.String())},{$id:"CardanoTxAuxiliaryDataSupplement"}),Gb.Object({tx_hash:Gb.String()},{$id:"CardanoTxBodyHash"}),Gb.Object({type:gg,path:Gb.Optional(Gb.Array(Gb.Number())),pool:Gb.Optional(Gb.String()),pool_parameters:Gb.Optional(qg),script_hash:Gb.Optional(Gb.String()),key_hash:Gb.Optional(Gb.String()),deposit:Gb.Optional(Gb.Uint()),drep:Gb.Optional($g)},{$id:"CardanoTxCertificate"}),Gb.Object({prev_hash:Gb.String(),prev_index:Gb.Number()},{$id:"CardanoTxCollateralInput"}),Gb.Object({},{$id:"CardanoTxHostAck"}),Gb.Object({data:Gb.String()},{$id:"CardanoTxInlineDatumChunk"}),Gb.Object({prev_hash:Gb.String(),prev_index:Gb.Number()},{$id:"CardanoTxInput"}),Gb.Object({},{$id:"CardanoTxItemAck"}),Gb.Object({asset_groups_count:Gb.Number()},{$id:"CardanoTxMint"}),Gb.Object({address:Gb.Optional(Gb.String()),address_parameters:Gb.Optional(Fg),amount:Gb.Uint(),asset_groups_count:Gb.Number(),datum_hash:Gb.Optional(Gb.String()),format:Gb.Optional(Lg),inline_datum_size:Gb.Optional(Gb.Number()),reference_script_size:Gb.Optional(Gb.Number())},{$id:"CardanoTxOutput"}),Gb.Object({prev_hash:Gb.String(),prev_index:Gb.Number()},{$id:"CardanoTxReferenceInput"}),Gb.Object({data:Gb.String()},{$id:"CardanoTxReferenceScriptChunk"}),Gb.Object({key_hash:Gb.Optional(Gb.String()),key_path:Gb.Optional(Gb.Array(Gb.Number()))},{$id:"CardanoTxRequiredSigner"}),Gb.Object({path:Gb.Optional(Gb.Array(Gb.Number())),amount:Gb.Uint(),script_hash:Gb.Optional(Gb.String()),key_hash:Gb.Optional(Gb.String())},{$id:"CardanoTxWithdrawal"}),Gb.Object({path:Gb.Array(Gb.Number())},{$id:"CardanoTxWitnessRequest"}),Gb.Object({type:Ug,pub_key:Gb.String(),signature:Gb.String(),chain_code:Gb.Optional(Gb.String())},{$id:"CardanoTxWitnessResponse"}),function(e){e[e.NotAvailable=0]="NotAvailable",e[e.Required=1]="Required",e[e.Available=2]="Available"}(Kg||(Kg={})),Gb.Enum(Kg);const Gg=Gb.KeyOfEnum(Kg,{$id:"BackupAvailability"});var Hg;!function(e){e[e.Display=0]="Display",e[e.N4W1=1]="N4W1"}(Hg||(Hg={}));const Vg=Gb.Enum(Hg);var Yg;!function(e){e[e.Bip39=0]="Bip39",e[e.Slip39_Basic=1]="Slip39_Basic",e[e.Slip39_Advanced=2]="Slip39_Advanced",e[e.Slip39_Single_Extendable=3]="Slip39_Single_Extendable",e[e.Slip39_Basic_Extendable=4]="Slip39_Basic_Extendable",e[e.Slip39_Advanced_Extendable=5]="Slip39_Advanced_Extendable"}(Yg||(Yg={}));const Jg=Gb.Enum(Yg),Zg=Gb.KeyOfEnum(Yg,{$id:"BackupType"});var Qg;!function(e){e[e.STOP_AND_WAIT=0]="STOP_AND_WAIT",e[e.INSTALL_UPGRADE=1]="INSTALL_UPGRADE"}(Qg||(Qg={}));const ev=Gb.Enum(Qg);var tv;!function(e){e[e.Capability_Bitcoin=1]="Capability_Bitcoin",e[e.Capability_Bitcoin_like=2]="Capability_Bitcoin_like",e[e.Capability_Binance=3]="Capability_Binance",e[e.Capability_Cardano=4]="Capability_Cardano",e[e.Capability_Crypto=5]="Capability_Crypto",e[e.Capability_EOS=6]="Capability_EOS",e[e.Capability_Ethereum=7]="Capability_Ethereum",e[e.Capability_Lisk=8]="Capability_Lisk",e[e.Capability_Monero=9]="Capability_Monero",e[e.Capability_NEM=10]="Capability_NEM",e[e.Capability_Ripple=11]="Capability_Ripple",e[e.Capability_Stellar=12]="Capability_Stellar",e[e.Capability_Tezos=13]="Capability_Tezos",e[e.Capability_U2F=14]="Capability_U2F",e[e.Capability_Shamir=15]="Capability_Shamir",e[e.Capability_ShamirGroups=16]="Capability_ShamirGroups",e[e.Capability_PassphraseEntry=17]="Capability_PassphraseEntry",e[e.Capability_Solana=18]="Capability_Solana",e[e.Capability_Translations=19]="Capability_Translations",e[e.Capability_Brightness=20]="Capability_Brightness",e[e.Capability_Haptic=21]="Capability_Haptic",e[e.Capability_BLE=22]="Capability_BLE",e[e.Capability_NFC=23]="Capability_NFC",e[e.Capability_Tron=24]="Capability_Tron",e[e.Capability_N4W1=25]="Capability_N4W1"}(tv||(tv={})),Gb.Enum(tv);const nv=Gb.KeyOfEnum(tv,{$id:"Capability"});var rv;!function(e){e.T1B1="T1B1",e.T2T1="T2T1",e.T2B1="T2B1",e.T3B1="T3B1",e.T3T1="T3T1",e.T3W1="T3W1",e.UNKNOWN="UNKNOWN"}(rv||(rv={}));const iv=Gb.Enum(rv);var ov;!function(e){e[e.North=0]="North",e[e.East=90]="East",e[e.South=180]="South",e[e.West=270]="West"}(ov||(ov={}));const av=Gb.Enum(ov),sv=Gb.KeyOfEnum(ov,{$id:"DisplayRotation"});var cv;!function(e){e[e.Toif=1]="Toif",e[e.Jpeg=2]="Jpeg",e[e.ToiG=3]="ToiG"}(cv||(cv={})),Gb.Enum(cv);const uv=Gb.KeyOfEnum(cv,{$id:"HomescreenFormat"});var lv;!function(e){e[e.ScrambledWords=0]="ScrambledWords",e[e.Matrix=1]="Matrix"}(lv||(lv={}));const dv=Gb.Enum(lv);var fv;!function(e){e[e.Nothing=0]="Nothing",e[e.Recovery=1]="Recovery",e[e.Backup=2]="Backup"}(fv||(fv={})),Gb.Enum(fv);const hv=Gb.KeyOfEnum(fv,{$id:"RecoveryStatus"});var pv;!function(e){e[e.NormalRecovery=0]="NormalRecovery",e[e.DryRun=1]="DryRun",e[e.UnlockRepeatedBackup=2]="UnlockRepeatedBackup"}(pv||(pv={})),Gb.Enum(pv);const bv=Gb.KeyOfEnum(pv,{$id:"RecoveryType"});var mv;!function(e){e[e.Strict=0]="Strict",e[e.PromptAlways=1]="PromptAlways",e[e.PromptTemporarily=2]="PromptTemporarily"}(mv||(mv={})),Gb.Enum(mv);const gv=Gb.KeyOfEnum(mv,{$id:"SafetyCheckLevel"});var vv;!function(e){e[e.DISABLE=0]="DISABLE",e[e.ENABLE=1]="ENABLE",e[e.REFRESH=2]="REFRESH"}(vv||(vv={}));const yv=Gb.Enum(vv);var wv;!function(e){e[e.WordRequestType_Plain=0]="WordRequestType_Plain",e[e.WordRequestType_Matrix9=1]="WordRequestType_Matrix9",e[e.WordRequestType_Matrix6=2]="WordRequestType_Matrix6"}(wv||(wv={})),Gb.Enum(wv);const xv=Gb.KeyOfEnum(wv,{$id:"WordRequestType"});Gb.Object({flags:Gb.Number()},{$id:"ApplyFlags"});const Av=Gb.Object({language:Gb.Optional(Gb.String()),label:Gb.Optional(Gb.String()),use_passphrase:Gb.Optional(Gb.Boolean()),homescreen:Gb.Optional(Gb.String()),_passphrase_source:Gb.Optional(Gb.Number()),auto_lock_delay_ms:Gb.Optional(Gb.Number()),display_rotation:Gb.Optional(Gb.Union([sv,av])),passphrase_always_on_device:Gb.Optional(Gb.Boolean()),safety_checks:Gb.Optional(gv),experimental_features:Gb.Optional(Gb.Boolean()),hide_passphrase_from_host:Gb.Optional(Gb.Boolean()),haptic_feedback:Gb.Optional(Gb.Boolean()),homescreen_length:Gb.Optional(Gb.Number()),auto_lock_delay_battery_ms:Gb.Optional(Gb.Number())},{$id:"ApplySettings"});Gb.Object({challenge:Gb.String()},{$id:"AuthenticateDevice"}),Gb.Object({optiga_certificates:Gb.Array(Gb.String()),optiga_signature:Gb.String(),tropic_certificates:Gb.Array(Gb.String()),tropic_signature:Gb.Optional(Gb.String()),mcu_certificates:Gb.Array(Gb.String()),mcu_signature:Gb.Optional(Gb.String())},{$id:"AuthenticityProof"});const Ev=Gb.Object({member_threshold:Gb.Number(),member_count:Gb.Number()},{$id:"Slip39Group"});var Sv;Gb.Object({group_threshold:Gb.Optional(Gb.Number()),groups:Gb.Optional(Gb.Array(Ev)),backup_method:Gb.Optional(Vg)},{$id:"BackupDevice"}),Gb.Object({},{$id:"Cancel"}),Gb.Object({},{$id:"CancelAuthorization"}),Gb.Object({data_length:Gb.Number(),show_display:Gb.Optional(Gb.Boolean())},{$id:"ChangeLanguage"}),Gb.Object({remove:Gb.Optional(Gb.Boolean())},{$id:"ChangePin"}),Gb.Object({remove:Gb.Optional(Gb.Boolean())},{$id:"ChangeWipeCode"}),Gb.Object({data_chunk:Gb.String()},{$id:"DataChunkAck"}),Gb.Object({data_length:Gb.Number(),data_offset:Gb.Number()},{$id:"DataChunkRequest"}),Gb.Object({},{$id:"DoPreauthorized"}),Gb.Object({},{$id:"EndSession"}),Gb.Object({entropy:Gb.String()},{$id:"Entropy"}),Gb.Object({entropy:Gb.String()},{$id:"EntropyAck"}),Gb.Object({finish:Gb.Optional(Gb.Boolean())},{$id:"EntropyCheckContinue"}),Gb.Object({},{$id:"EntropyCheckReady"}),Gb.Object({entropy_commitment:Gb.Optional(Gb.String()),prev_entropy:Gb.Optional(Gb.String())},{$id:"EntropyRequest"}),Gb.Object({vendor:Gb.String(),major_version:Gb.Number(),minor_version:Gb.Number(),patch_version:Gb.Number(),build_version:Gb.Optional(Gb.Number()),bootloader_mode:Gb.Union([Gb.Boolean(),Gb.Null()]),device_id:Gb.Union([Gb.String(),Gb.Null()]),pin_protection:Gb.Union([Gb.Boolean(),Gb.Null()]),passphrase_protection:Gb.Union([Gb.Boolean(),Gb.Null()]),language:Gb.Union([Gb.String(),Gb.Null()]),label:Gb.Union([Gb.String(),Gb.Null()]),initialized:Gb.Union([Gb.Boolean(),Gb.Null()]),revision:Gb.Union([Gb.String(),Gb.Null()]),bootloader_hash:Gb.Union([Gb.String(),Gb.Null()]),imported:Gb.Union([Gb.Boolean(),Gb.Null()]),unlocked:Gb.Union([Gb.Boolean(),Gb.Null()]),_passphrase_cached:Gb.Optional(Gb.Boolean()),firmware_present:Gb.Union([Gb.Boolean(),Gb.Null()]),backup_availability:Gb.Union([Gg,Gb.Null()]),flags:Gb.Union([Gb.Number(),Gb.Null()]),model:Gb.String(),fw_major:Gb.Union([Gb.Number(),Gb.Null()]),fw_minor:Gb.Union([Gb.Number(),Gb.Null()]),fw_patch:Gb.Union([Gb.Number(),Gb.Null()]),fw_build:Gb.Optional(Gb.Number()),fw_vendor:Gb.Union([Gb.String(),Gb.Null()]),unfinished_backup:Gb.Union([Gb.Boolean(),Gb.Null()]),no_backup:Gb.Union([Gb.Boolean(),Gb.Null()]),recovery_status:Gb.Union([hv,Gb.Null()]),capabilities:Gb.Array(nv),backup_type:Gb.Union([Zg,Gb.Null()]),sd_card_present:Gb.Union([Gb.Boolean(),Gb.Null()]),sd_protection:Gb.Union([Gb.Boolean(),Gb.Null()]),wipe_code_protection:Gb.Union([Gb.Boolean(),Gb.Null()]),session_id:Gb.Union([Gb.String(),Gb.Null()]),passphrase_always_on_device:Gb.Union([Gb.Boolean(),Gb.Null()]),safety_checks:Gb.Union([gv,Gb.Null()]),auto_lock_delay_ms:Gb.Union([Gb.Number(),Gb.Null()]),display_rotation:Gb.Union([sv,Gb.Null()]),experimental_features:Gb.Union([Gb.Boolean(),Gb.Null()]),busy:Gb.Optional(Gb.Boolean()),homescreen_format:Gb.Optional(uv),hide_passphrase_from_host:Gb.Optional(Gb.Boolean()),internal_model:iv,unit_color:Gb.Optional(Gb.Number()),unit_btconly:Gb.Optional(Gb.Boolean()),homescreen_width:Gb.Optional(Gb.Number()),homescreen_height:Gb.Optional(Gb.Number()),bootloader_locked:Gb.Optional(Gb.Boolean()),language_version_matches:Gb.Optional(Gb.Boolean()),unit_packaging:Gb.Optional(Gb.Number()),haptic_feedback:Gb.Optional(Gb.Boolean()),recovery_type:Gb.Optional(bv),optiga_sec:Gb.Optional(Gb.Number()),soc:Gb.Optional(Gb.Number()),firmware_corrupted:Gb.Optional(Gb.Boolean()),auto_lock_delay_battery_ms:Gb.Optional(Gb.Number()),led:Gb.Optional(Gb.Boolean()),usb_connected:Gb.Optional(Gb.Boolean()),wireless_connected:Gb.Optional(Gb.Boolean())},{$id:"Features"}),Gb.Object({hash:Gb.String()},{$id:"FirmwareHash"}),Gb.Object({size:Gb.Number()},{$id:"GetEntropy"}),Gb.Object({},{$id:"GetFeatures"}),Gb.Object({challenge:Gb.Optional(Gb.String())},{$id:"GetFirmwareHash"}),Gb.Object({},{$id:"GetNextU2FCounter"}),Gb.Object({},{$id:"GetNonce"}),Gb.Object({},{$id:"GetSerialNumber"}),Gb.Object({session_id:Gb.Optional(Gb.String()),_skip_passphrase:Gb.Optional(Gb.Boolean()),derive_cardano:Gb.Optional(Gb.Boolean())},{$id:"Initialize"}),Gb.Object({mnemonics:Gb.Array(Gb.String()),pin:Gb.Optional(Gb.String()),passphrase_protection:Gb.Optional(Gb.Boolean()),language:Gb.Optional(Gb.String()),label:Gb.Optional(Gb.String()),skip_checksum:Gb.Optional(Gb.Boolean()),u2f_counter:Gb.Optional(Gb.Number()),needs_backup:Gb.Optional(Gb.Boolean()),no_backup:Gb.Optional(Gb.Boolean()),unfinished_backup:Gb.Optional(Gb.Boolean())},{$id:"LoadDevice"}),Gb.Object({},{$id:"LockDevice"}),Gb.Object({u2f_counter:Gb.Number()},{$id:"NextU2FCounter"}),Gb.Object({nonce:Gb.String()},{$id:"Nonce"}),Gb.Object({message:Gb.Optional(Gb.String()),button_protection:Gb.Optional(Gb.Boolean())},{$id:"Ping"}),Gb.Object({},{$id:"PreauthorizedRequest"}),Gb.Object({boot_command:Gb.Optional(ev),firmware_header:Gb.Optional(Gb.String())},{$id:"RebootToBootloader"}),Gb.Object({word_count:Gb.Optional(Gb.Number()),passphrase_protection:Gb.Optional(Gb.Boolean()),pin_protection:Gb.Optional(Gb.Boolean()),language:Gb.Optional(Gb.String()),label:Gb.Optional(Gb.String()),enforce_wordlist:Gb.Optional(Gb.Boolean()),input_method:Gb.Optional(dv),u2f_counter:Gb.Optional(Gb.Number()),type:Gb.Optional(bv),backup_method:Gb.Optional(Vg)},{$id:"RecoveryDevice"}),Gb.Object({strength:Gb.Optional(Gb.Number()),passphrase_protection:Gb.Optional(Gb.Boolean()),pin_protection:Gb.Optional(Gb.Boolean()),language:Gb.Optional(Gb.String()),label:Gb.Optional(Gb.String()),u2f_counter:Gb.Optional(Gb.Number()),skip_backup:Gb.Optional(Gb.Boolean()),no_backup:Gb.Optional(Gb.Boolean()),backup_type:Gb.Optional(Jg),entropy_check:Gb.Optional(Gb.Boolean()),backup_method:Gb.Optional(Vg)},{$id:"ResetDevice"}),Gb.Object({operation:yv},{$id:"SdProtect"}),Gb.Object({serial_number:Gb.String()},{$id:"SerialNumber"}),Gb.Object({value:Gb.Optional(Gb.Number())},{$id:"SetBrightness"}),Gb.Object({expiry_ms:Gb.Optional(Gb.Number())},{$id:"SetBusy"}),Gb.Object({u2f_counter:Gb.Number()},{$id:"SetU2FCounter"}),Gb.Object({},{$id:"ShowDeviceTutorial"}),Gb.Object({},{$id:"UnlockBootloader"}),Gb.Object({mac:Gb.String()},{$id:"UnlockedPathRequest"}),Gb.Object({address_n:Gb.Array(Gb.Number()),mac:Gb.Optional(Gb.String())},{$id:"UnlockPath"}),Gb.Object({},{$id:"WipeDevice"}),Gb.Object({word:Gb.String()},{$id:"WordAck"}),Gb.Object({type:xv},{$id:"WordRequest"}),function(e){e[e.MAINNET=0]="MAINNET",e[e.TESTNET=1]="TESTNET",e[e.STAGENET=2]="STAGENET",e[e.FAKECHAIN=3]="FAKECHAIN"}(Sv||(Sv={}));const _v=Gb.Enum(Sv);Gb.Object({ins:Gb.Optional(Gb.Number()),p1:Gb.Optional(Gb.Number()),p2:Gb.Optional(Gb.Number()),pd:Gb.Array(Gb.Number()),data1:Gb.Optional(Gb.String()),data2:Gb.Optional(Gb.String())},{$id:"DebugMoneroDiagAck"}),Gb.Object({ins:Gb.Optional(Gb.Number()),p1:Gb.Optional(Gb.Number()),p2:Gb.Optional(Gb.Number()),pd:Gb.Array(Gb.Number()),data1:Gb.Optional(Gb.String()),data2:Gb.Optional(Gb.String())},{$id:"DebugMoneroDiagRequest"});const Ov=Gb.Object({spend_public_key:Gb.Optional(Gb.String()),view_public_key:Gb.Optional(Gb.String())},{$id:"MoneroAccountPublicAddress"});Gb.Object({address:Gb.String()},{$id:"MoneroAddress"});const Nv=Gb.Object({iv:Gb.Optional(Gb.String()),blob:Gb.Optional(Gb.String())},{$id:"MoneroExportedKeyImage"});Gb.Object({address_n:Gb.Array(Gb.Number()),show_display:Gb.Optional(Gb.Boolean()),network_type:Gb.Optional(_v),account:Gb.Optional(Gb.Number()),minor:Gb.Optional(Gb.Number()),payment_id:Gb.Optional(Gb.String()),chunkify:Gb.Optional(Gb.Boolean())},{$id:"MoneroGetAddress"}),Gb.Object({salt:Gb.Optional(Gb.String()),tx_keys:Gb.Optional(Gb.String()),tx_derivations:Gb.Optional(Gb.String())},{$id:"MoneroGetTxKeyAck"}),Gb.Object({address_n:Gb.Array(Gb.Number()),network_type:Gb.Optional(_v),salt1:Gb.String(),salt2:Gb.String(),tx_enc_keys:Gb.String(),tx_prefix_hash:Gb.String(),reason:Gb.Optional(Gb.Number()),view_public_key:Gb.Optional(Gb.String())},{$id:"MoneroGetTxKeyRequest"}),Gb.Object({address_n:Gb.Array(Gb.Number()),network_type:Gb.Optional(_v)},{$id:"MoneroGetWatchKey"}),Gb.Object({},{$id:"MoneroKeyImageExportInitAck"});const kv=Gb.Object({account:Gb.Number(),minor_indices:Gb.Array(Gb.Number())},{$id:"MoneroSubAddressIndicesList"});Gb.Object({num:Gb.Number(),hash:Gb.Uint8Array(),address_n:Gb.Array(Gb.Number()),network_type:Gb.Optional(_v),subs:Gb.Array(kv)},{$id:"MoneroKeyImageExportInitRequest"}),Gb.Object({enc_key:Gb.Optional(Gb.String())},{$id:"MoneroKeyImageSyncFinalAck"}),Gb.Object({},{$id:"MoneroKeyImageSyncFinalRequest"}),Gb.Object({kis:Gb.Array(Nv)},{$id:"MoneroKeyImageSyncStepAck"});const Tv=Gb.Object({out_key:Gb.Uint8Array(),tx_pub_key:Gb.Uint8Array(),additional_tx_pub_keys:Gb.Array(Gb.Uint8Array()),internal_output_index:Gb.Number(),sub_addr_major:Gb.Optional(Gb.Number()),sub_addr_minor:Gb.Optional(Gb.Number())},{$id:"MoneroTransferDetails"});Gb.Object({tdis:Gb.Array(Tv)},{$id:"MoneroKeyImageSyncStepRequest"}),Gb.Object({},{$id:"MoneroLiveRefreshFinalAck"}),Gb.Object({},{$id:"MoneroLiveRefreshFinalRequest"}),Gb.Object({},{$id:"MoneroLiveRefreshStartAck"}),Gb.Object({address_n:Gb.Array(Gb.Number()),network_type:Gb.Optional(_v)},{$id:"MoneroLiveRefreshStartRequest"}),Gb.Object({salt:Gb.Optional(Gb.String()),key_image:Gb.Optional(Gb.String())},{$id:"MoneroLiveRefreshStepAck"}),Gb.Object({out_key:Gb.String(),recv_deriv:Gb.String(),real_out_idx:Gb.Number(),sub_addr_major:Gb.Number(),sub_addr_minor:Gb.Number()},{$id:"MoneroLiveRefreshStepRequest"});const Cv=Gb.Object({K:Gb.Optional(Gb.String()),L:Gb.Optional(Gb.String()),R:Gb.Optional(Gb.String()),ki:Gb.Optional(Gb.String())},{$id:"MoneroMultisigKLRki"}),Iv=Gb.Object({dest:Gb.String(),commitment:Gb.String()},{$id:"MoneroRctKeyPublic"}),Bv=Gb.Object({idx:Gb.Optional(Gb.Number()),key:Gb.Optional(Iv)},{$id:"MoneroOutputEntry"}),Lv=Gb.Object({txn_fee:Gb.Optional(Gb.Number()),message:Gb.Optional(Gb.String()),rv_type:Gb.Optional(Gb.Number())},{$id:"MoneroRingCtSig"}),Mv=Gb.Object({rsig_type:Gb.Optional(Gb.Number()),offload_type:Gb.Optional(Gb.Number()),grouping:Gb.Array(Gb.Number()),mask:Gb.Optional(Gb.String()),rsig:Gb.Optional(Gb.String()),rsig_parts:Gb.Array(Gb.String()),bp_version:Gb.Optional(Gb.Number())},{$id:"MoneroTransactionRsigData"});Gb.Object({rsig_data:Gb.Optional(Mv)},{$id:"MoneroTransactionAllInputsSetAck"}),Gb.Object({},{$id:"MoneroTransactionAllInputsSetRequest"}),Gb.Object({extra:Gb.Optional(Gb.String()),tx_prefix_hash:Gb.String(),rv:Lv,full_message_hash:Gb.Optional(Gb.String())},{$id:"MoneroTransactionAllOutSetAck"}),Gb.Object({rsig_data:Gb.Optional(Mv)},{$id:"MoneroTransactionAllOutSetRequest"});const Rv=Gb.Object({amount:Gb.Optional(Gb.Uint()),addr:Gb.Optional(Ov),is_subaddress:Gb.Optional(Gb.Boolean()),original:Gb.Optional(Gb.String()),is_integrated:Gb.Optional(Gb.Boolean())},{$id:"MoneroTransactionDestinationEntry"}),Pv=Gb.Object({version:Gb.Optional(Gb.Number()),payment_id:Gb.Optional(Gb.String()),unlock_time:Gb.Optional(Gb.Number()),outputs:Gb.Array(Rv),change_dts:Gb.Optional(Rv),num_inputs:Gb.Optional(Gb.Number()),mixin:Gb.Optional(Gb.Number()),fee:Gb.Optional(Gb.Uint()),account:Gb.Optional(Gb.Number()),minor_indices:Gb.Array(Gb.Number()),rsig_data:Gb.Optional(Mv),integrated_indices:Gb.Array(Gb.Number()),client_version:Gb.Optional(Gb.Number()),hard_fork:Gb.Optional(Gb.Number()),monero_version:Gb.Optional(Gb.String()),chunkify:Gb.Optional(Gb.Boolean())},{$id:"MoneroTransactionData"});Gb.Object({cout_key:Gb.Optional(Gb.String()),salt:Gb.Optional(Gb.String()),rand_mult:Gb.Optional(Gb.String()),tx_enc_keys:Gb.Optional(Gb.String()),opening_key:Gb.Optional(Gb.String())},{$id:"MoneroTransactionFinalAck"}),Gb.Object({},{$id:"MoneroTransactionFinalRequest"}),Gb.Object({hmacs:Gb.Array(Gb.String()),rsig_data:Gb.Optional(Mv)},{$id:"MoneroTransactionInitAck"}),Gb.Object({version:Gb.Optional(Gb.Number()),address_n:Gb.Array(Gb.Number()),network_type:Gb.Optional(_v),tsx_data:Gb.Optional(Pv)},{$id:"MoneroTransactionInitRequest"}),Gb.Object({},{$id:"MoneroTransactionInputViniAck"});const Uv=Gb.Object({outputs:Gb.Array(Bv),real_output:Gb.Optional(Gb.Number()),real_out_tx_key:Gb.Optional(Gb.String()),real_out_additional_tx_keys:Gb.Array(Gb.String()),real_output_in_tx_index:Gb.Optional(Gb.Number()),amount:Gb.Optional(Gb.Uint()),rct:Gb.Optional(Gb.Boolean()),mask:Gb.Optional(Gb.String()),multisig_kLRki:Gb.Optional(Cv),subaddr_minor:Gb.Optional(Gb.Number())},{$id:"MoneroTransactionSourceEntry"});var jv;Gb.Object({src_entr:Gb.Optional(Uv),vini:Gb.Optional(Gb.String()),vini_hmac:Gb.Optional(Gb.String()),pseudo_out:Gb.Optional(Gb.String()),pseudo_out_hmac:Gb.Optional(Gb.String()),orig_idx:Gb.Optional(Gb.Number())},{$id:"MoneroTransactionInputViniRequest"}),Gb.Object({vini:Gb.String(),vini_hmac:Gb.String(),pseudo_out:Gb.String(),pseudo_out_hmac:Gb.String(),pseudo_out_alpha:Gb.String(),spend_key:Gb.String()},{$id:"MoneroTransactionSetInputAck"}),Gb.Object({src_entr:Gb.Optional(Uv)},{$id:"MoneroTransactionSetInputRequest"}),Gb.Object({tx_out:Gb.Optional(Gb.String()),vouti_hmac:Gb.Optional(Gb.String()),rsig_data:Gb.Optional(Mv),out_pk:Gb.Optional(Gb.String()),ecdh_info:Gb.Optional(Gb.String())},{$id:"MoneroTransactionSetOutputAck"}),Gb.Object({dst_entr:Gb.Optional(Rv),dst_entr_hmac:Gb.Optional(Gb.String()),rsig_data:Gb.Optional(Mv),is_offloaded_bp:Gb.Optional(Gb.Boolean())},{$id:"MoneroTransactionSetOutputRequest"}),Gb.Object({signature:Gb.Optional(Gb.String()),pseudo_out:Gb.Optional(Gb.String())},{$id:"MoneroTransactionSignInputAck"}),Gb.Object({src_entr:Gb.Optional(Uv),vini:Gb.Optional(Gb.String()),vini_hmac:Gb.Optional(Gb.String()),pseudo_out:Gb.Optional(Gb.String()),pseudo_out_hmac:Gb.Optional(Gb.String()),pseudo_out_alpha:Gb.Optional(Gb.String()),spend_key:Gb.Optional(Gb.String()),orig_idx:Gb.Optional(Gb.Number())},{$id:"MoneroTransactionSignInputRequest"}),Gb.Object({watch_key:Gb.String(),address:Gb.String()},{$id:"MoneroWatchKey"}),function(e){e[e.NATIVE=0]="NATIVE",e[e.ALPHANUM4=1]="ALPHANUM4",e[e.ALPHANUM12=2]="ALPHANUM12"}(jv||(jv={}));const Fv=Gb.Enum(jv);var Dv;!function(e){e[e.NONE=0]="NONE",e[e.TEXT=1]="TEXT",e[e.ID=2]="ID",e[e.HASH=3]="HASH",e[e.RETURN=4]="RETURN"}(Dv||(Dv={}));const zv=Gb.Enum(Dv);var $v;!function(e){e[e.ACCOUNT=0]="ACCOUNT",e[e.PRE_AUTH=1]="PRE_AUTH",e[e.HASH=2]="HASH"}($v||($v={}));const Wv=Gb.Enum($v),Xv=Gb.Object({source_account:Gb.Optional(Gb.String()),destination_account:Gb.String()},{$id:"StellarAccountMergeOp"});Gb.Object({address:Gb.String(),mac:Gb.Optional(Gb.String())},{$id:"StellarAddress"});const qv=Gb.Object({source_account:Gb.Optional(Gb.String()),trusted_account:Gb.String(),asset_type:Fv,asset_code:Gb.Optional(Gb.String()),is_authorized:Gb.Boolean()},{$id:"StellarAllowTrustOp"}),Kv=Gb.Object({type:Gb.Union([Gb.Literal(0),Gb.Literal(1),Gb.Literal(2),Gb.Literal("NATIVE"),Gb.Literal("ALPHANUM4"),Gb.Literal("ALPHANUM12")]),code:Gb.Optional(Gb.String()),issuer:Gb.Optional(Gb.String())},{$id:"StellarAsset"}),Gv=Gb.Object({source_account:Gb.Optional(Gb.String()),bump_to:Gb.Uint()},{$id:"StellarBumpSequenceOp"}),Hv=Gb.Object({source_account:Gb.Optional(Gb.String()),asset:Kv,limit:Gb.Uint()},{$id:"StellarChangeTrustOp"}),Vv=Gb.Object({source_account:Gb.Optional(Gb.String()),balance_id:Gb.String()},{$id:"StellarClaimClaimableBalanceOp"}),Yv=Gb.Object({source_account:Gb.Optional(Gb.String()),new_account:Gb.String(),starting_balance:Gb.Uint()},{$id:"StellarCreateAccountOp"}),Jv=Gb.Object({source_account:Gb.Optional(Gb.String()),selling_asset:Kv,buying_asset:Kv,amount:Gb.Uint(),price_n:Gb.Number(),price_d:Gb.Number()},{$id:"StellarCreatePassiveSellOfferOp"});Gb.Object({address_n:Gb.Array(Gb.Number()),show_display:Gb.Optional(Gb.Boolean()),chunkify:Gb.Optional(Gb.Boolean())},{$id:"StellarGetAddress"});const Zv=Gb.Object({source_account:Gb.Optional(Gb.String()),selling_asset:Kv,buying_asset:Kv,amount:Gb.Uint(),price_n:Gb.Number(),price_d:Gb.Number(),offer_id:Gb.Uint()},{$id:"StellarManageBuyOfferOp"}),Qv=Gb.Object({source_account:Gb.Optional(Gb.String()),key:Gb.String(),value:Gb.Optional(Gb.Union([Gb.Buffer(),Gb.String()]))},{$id:"StellarManageDataOp"}),ey=Gb.Object({source_account:Gb.Optional(Gb.String()),selling_asset:Kv,buying_asset:Kv,amount:Gb.Uint(),price_n:Gb.Number(),price_d:Gb.Number(),offer_id:Gb.Uint()},{$id:"StellarManageSellOfferOp"}),ty=Gb.Object({source_account:Gb.Optional(Gb.String()),send_asset:Kv,send_max:Gb.Uint(),destination_account:Gb.String(),destination_asset:Kv,destination_amount:Gb.Uint(),paths:Gb.Optional(Gb.Array(Kv))},{$id:"StellarPathPaymentStrictReceiveOp"}),ny=Gb.Object({source_account:Gb.Optional(Gb.String()),send_asset:Kv,send_amount:Gb.Uint(),destination_account:Gb.String(),destination_asset:Kv,destination_min:Gb.Uint(),paths:Gb.Optional(Gb.Array(Kv))},{$id:"StellarPathPaymentStrictSendOp"}),ry=Gb.Object({source_account:Gb.Optional(Gb.String()),destination_account:Gb.String(),asset:Kv,amount:Gb.Uint()},{$id:"StellarPaymentOp"}),iy=Gb.Object({source_account:Gb.Optional(Gb.String()),inflation_destination_account:Gb.Optional(Gb.String()),clear_flags:Gb.Optional(Gb.Number()),set_flags:Gb.Optional(Gb.Number()),master_weight:Gb.Optional(Gb.Uint()),low_threshold:Gb.Optional(Gb.Uint()),medium_threshold:Gb.Optional(Gb.Uint()),high_threshold:Gb.Optional(Gb.Uint()),home_domain:Gb.Optional(Gb.String()),signer_type:Gb.Optional(Wv),signer_key:Gb.Optional(Gb.Union([Gb.Buffer(),Gb.String()])),signer_weight:Gb.Optional(Gb.Number())},{$id:"StellarSetOptionsOp"});var oy;Gb.Object({public_key:Gb.String(),signature:Gb.String()},{$id:"StellarSignedTx"}),Gb.Object({address_n:Gb.Array(Gb.Number()),network_passphrase:Gb.String(),source_account:Gb.String(),fee:Gb.Uint(),sequence_number:Gb.Uint(),timebounds_start:Gb.Number(),timebounds_end:Gb.Number(),memo_type:zv,memo_text:Gb.Optional(Gb.String()),memo_id:Gb.Optional(Gb.Uint()),memo_hash:Gb.Optional(Gb.Union([Gb.Buffer(),Gb.String()])),num_operations:Gb.Number(),payment_req:Gb.Optional(Lm)},{$id:"StellarSignTx"}),Gb.Object({},{$id:"StellarTxOpRequest"}),function(e){e[e.TransferContract=1]="TransferContract",e[e.VoteWitnessContract=4]="VoteWitnessContract",e[e.TriggerSmartContract=31]="TriggerSmartContract",e[e.FreezeBalanceV2Contract=54]="FreezeBalanceV2Contract",e[e.UnfreezeBalanceV2Contract=55]="UnfreezeBalanceV2Contract",e[e.WithdrawExpireUnfreezeContract=56]="WithdrawExpireUnfreezeContract"}(oy||(oy={}));const ay=Gb.Enum(oy);var sy;!function(e){e[e.BANDWIDTH=0]="BANDWIDTH",e[e.ENERGY=1]="ENERGY"}(sy||(sy={}));const cy=Gb.Enum(sy);Gb.Object({address:Gb.String(),mac:Gb.Optional(Gb.String())},{$id:"TronAddress"}),Gb.Object({},{$id:"TronContractRequest"});const uy=Gb.Object({owner_address:Gb.String(),balance:Gb.Number(),resource:Gb.Optional(cy)},{$id:"TronFreezeBalanceV2Contract"});Gb.Object({address_n:Gb.Array(Gb.Number()),show_display:Gb.Optional(Gb.Boolean()),chunkify:Gb.Optional(Gb.Boolean())},{$id:"TronGetAddress"});const ly=Gb.Object({type_url:Gb.String(),value:Gb.String()},{$id:"TronRawParameter"}),dy=Gb.Object({type:ay,parameter:ly},{$id:"TronRawContract"});Gb.Object({ref_block_bytes:Gb.String(),ref_block_hash:Gb.String(),expiration:Gb.Number(),data:Gb.Optional(Gb.String()),contract:Gb.Array(dy),timestamp:Gb.Number(),fee_limit:Gb.Optional(Gb.Number())},{$id:"TronRawTransaction"}),Gb.Object({signature:Gb.String()},{$id:"TronSignature"}),Gb.Object({address_n:Gb.Array(Gb.Number()),ref_block_bytes:Gb.String(),ref_block_hash:Gb.String(),expiration:Gb.Number(),data:Gb.Optional(Gb.String()),timestamp:Gb.Number(),fee_limit:Gb.Optional(Gb.Number())},{$id:"TronSignTx"});const fy=Gb.Object({owner_address:Gb.String(),to_address:Gb.String(),amount:Gb.Uint()},{$id:"TronTransferContract"}),hy=Gb.Object({owner_address:Gb.String(),contract_address:Gb.String(),data:Gb.String()},{$id:"TronTriggerSmartContract"}),py=Gb.Object({owner_address:Gb.String(),balance:Gb.Number(),resource:Gb.Optional(cy)},{$id:"TronUnfreezeBalanceV2Contract"}),by=Gb.Object({address:Gb.String(),count:Gb.Number()},{$id:"TronVote"}),my=Gb.Object({owner_address:Gb.String(),votes:Gb.Array(by)},{$id:"TronVoteWitnessContract"}),gy=Gb.Object({owner_address:Gb.String()},{$id:"TronWithdrawUnfreeze"}),vy=Gb.Object({blockIndex:Gb.Number(),txIndex:Gb.Number(),certificateIndex:Gb.Number()}),yy=Gb.Object({addressType:bg,path:Gb.Optional(vm),stakingPath:Gb.Optional(vm),stakingKeyHash:Gb.Optional(Gb.String()),certificatePointer:Gb.Optional(vy),paymentScriptHash:Gb.Optional(Gb.String()),stakingScriptHash:Gb.Optional(Gb.String())});Gb.Object({addressParameters:yy,protocolMagic:Gb.Number(),networkId:Gb.Number(),address:Gb.Optional(Gb.String()),showOnTrezor:Gb.Optional(Gb.Boolean()),derivationType:Gb.Optional(xg),chunkify:Gb.Optional(Gb.Boolean())});const wy=Gb.Recursive(e=>Gb.Object({type:Ng,scripts:Gb.Optional(Gb.Array(e)),keyHash:Gb.Optional(Gb.String()),keyPath:Gb.Optional(vm),requiredSignaturesCount:Gb.Optional(Gb.Number()),invalidBefore:Gb.Optional(Gb.String()),invalidHereafter:Gb.Optional(Gb.String())}));Gb.Object({script:wy,displayFormat:_g,derivationType:Gb.Optional(xg)}),Gb.Object({scriptHash:Gb.String()}),Gb.Intersect([ym,Gb.Object({derivationType:Gb.Optional(xg)})]);const xy=Gb.Object({path:Gb.Optional(vm),prev_hash:Gb.String(),prev_index:Gb.Number()}),Ay=Gb.Object({assetNameBytes:Gb.String(),amount:Gb.Optional(Gb.String()),mintAmount:Gb.Optional(Gb.String())}),Ey=Gb.Object({policyId:Gb.String(),tokenAmounts:Gb.Array(Ay)}),Sy=Gb.Intersect([Gb.Union([Gb.Object({addressParameters:yy}),Gb.Object({address:Gb.String()})]),Gb.Object({amount:Gb.String(),tokenBundle:Gb.Optional(Gb.Array(Ey)),datumHash:Gb.Optional(Gb.String()),format:Gb.Optional(Lg),inlineDatum:Gb.Optional(Gb.String()),referenceScript:Gb.Optional(Gb.String())})]),_y=Gb.Object({stakingKeyPath:Gb.Optional(vm),stakingKeyHash:Gb.Optional(Gb.String())}),Oy=Gb.Object({type:Tg,ipv4Address:Gb.Optional(Gb.String()),ipv6Address:Gb.Optional(Gb.String()),port:Gb.Optional(Gb.Number()),hostName:Gb.Optional(Gb.String())}),Ny=Gb.Object({url:Gb.String(),hash:Gb.String()}),ky=Gb.Object({numerator:Gb.String(),denominator:Gb.String()}),Ty=Gb.Object({poolId:Gb.String(),vrfKeyHash:Gb.String(),pledge:Gb.String(),cost:Gb.String(),margin:ky,rewardAccount:Gb.String(),owners:Gb.Array(_y,{minItems:1}),relays:Gb.Array(Oy),metadata:Gb.Optional(Ny)}),Cy=Gb.Object({type:Eg,keyHash:Gb.Optional(Gb.String()),scriptHash:Gb.Optional(Gb.String())}),Iy=Gb.Object({type:gg,path:Gb.Optional(vm),pool:Gb.Optional(Gb.String()),poolParameters:Gb.Optional(Ty),scriptHash:Gb.Optional(Gb.String()),keyHash:Gb.Optional(Gb.String()),deposit:Gb.Optional(Gb.String()),dRep:Gb.Optional(Cy)}),By=Gb.Object({path:Gb.Optional(vm),amount:Gb.String(),scriptHash:Gb.Optional(Gb.String()),keyHash:Gb.Optional(Gb.String())}),Ly=Gb.Array(Ey),My=Gb.Object({path:Gb.Optional(vm),prev_hash:Gb.String(),prev_index:Gb.Number()}),Ry=Gb.Object({keyPath:Gb.Optional(vm),keyHash:Gb.Optional(Gb.String())}),Py=Gb.Object({prev_hash:Gb.String(),prev_index:Gb.Number()}),Uy=Gb.Object({votePublicKey:Gb.String(),weight:Gb.Number()}),jy=Gb.Object({votePublicKey:Gb.Optional(Gb.String()),stakingPath:vm,paymentAddressParameters:Gb.Optional(yy),nonce:Gb.String(),format:Gb.Optional(yg),delegations:Gb.Optional(Gb.Array(Uy)),votingPurpose:Gb.Optional(Gb.Number()),paymentAddress:Gb.Optional(Gb.String())}),Fy=Gb.Object({hash:Gb.Optional(Gb.String()),cVoteRegistrationParameters:Gb.Optional(jy)}),Dy=Gb.Object({inputs:Gb.Array(xy),outputs:Gb.Array(Sy),fee:Gb.Uint(),ttl:Gb.Optional(Gb.Uint()),certificates:Gb.Optional(Gb.Array(Iy)),withdrawals:Gb.Optional(Gb.Array(By)),validityIntervalStart:Gb.Optional(Gb.String()),auxiliaryData:Gb.Optional(Fy),mint:Gb.Optional(Ly),scriptDataHash:Gb.Optional(Gb.String()),collateralInputs:Gb.Optional(Gb.Array(My)),requiredSigners:Gb.Optional(Gb.Array(Ry)),collateralReturn:Gb.Optional(Sy),totalCollateral:Gb.Optional(Gb.String()),referenceInputs:Gb.Optional(Gb.Array(Py)),additionalWitnessRequests:Gb.Optional(Gb.Array(vm)),protocolMagic:Gb.Number(),networkId:Gb.Number(),signingMode:Rg,derivationType:Gb.Optional(xg),includeNetworkId:Gb.Optional(Gb.Boolean()),chunkify:Gb.Optional(Gb.Boolean()),tagCborSets:Gb.Optional(Gb.Boolean()),payment_req:Gb.Optional(Lm)});Gb.Intersect([Dy,Gb.Object({unsignedTx:Gb.Object({body:Gb.String(),hash:Gb.String()}),testnet:Gb.Boolean()})]);const zy=Gb.Object({type:Ug,pubKey:Gb.String(),signature:Gb.String(),chainCode:Gb.Optional(Gb.String())}),$y=Gb.Object({type:Ig,auxiliaryDataHash:Gb.String(),cVoteRegistrationSignature:Gb.Optional(Gb.String())});Gb.Object({hash:Gb.String(),witnesses:Gb.Array(zy),auxiliaryDataSupplement:Gb.Optional($y)}),Gb.Object({path:vm,payload:Gb.String(),preferHexDisplay:Gb.Optional(Gb.Boolean()),networkId:Gb.Optional(Gb.Number()),protocolMagic:Gb.Optional(Gb.Number()),addressParameters:Gb.Optional(yy),derivationType:Gb.Optional(xg)});const Wy=Gb.Object({1:Gb.Literal(qu.EdDSA),address:Gb.String()}),Xy=Gb.Object({hashed:Gb.Boolean(),version:Gb.Number()}),qy=Gb.Object({protected:Wy,unprotected:Xy});Gb.Object({headers:qy,payload:Gb.String(),signature:Gb.String(),pubKey:Gb.String(),coseSignature:Gb.String(),coseKey:Gb.String()}),Gb.Object({path:vm,coin:Gb.Optional(Gb.String()),message:Gb.String(),hex:Gb.Optional(Gb.Boolean()),no_script_type:Gb.Optional(Gb.Boolean())}),Gb.Object({address:Gb.String(),signature:Gb.String(),message:Gb.String(),coin:Gb.String(),hex:Gb.Optional(Gb.Boolean())});const Ky=Gb.Object({amount:Gb.String(),destination:Gb.String(),destinationTag:Gb.Optional(Gb.Number())}),Gy=Gb.Object({fee:Gb.String(),flags:Gb.Optional(Gb.Number()),sequence:Gb.Number(),maxLedgerVersion:Gb.Optional(Gb.Number()),payment:Ky});Gb.Object({path:vm,transaction:Gy,payment_req:Gb.Optional(Lm),chunkify:Gb.Optional(Gb.Boolean())}),Gb.Object({serializedTx:Gb.String(),signature:Gb.String()}),Gb.Object({path:vm,message:Gb.String(),hex:Gb.Optional(Gb.Boolean())});const Hy=Gb.Object({to:Gb.Union([Gb.String(),Gb.Null()]),value:Gb.String(),gasPrice:Gb.String(),gasLimit:Gb.String(),maxFeePerGas:Gb.Optional(Gb.Undefined()),maxPriorityFeePerGas:Gb.Optional(Gb.Undefined()),nonce:Gb.String(),data:Gb.Optional(Gb.String()),chainId:Gb.Number(),txType:Gb.Optional(Gb.Number()),payment_req:Gb.Optional(Lm)}),Vy=Gb.Object({address:Gb.String(),storageKeys:Gb.Array(Gb.String())}),Yy=Gb.Object({to:Gb.Union([Gb.String(),Gb.Null()]),value:Gb.String(),gasLimit:Gb.String(),gasPrice:Gb.Optional(Gb.Undefined()),nonce:Gb.String(),data:Gb.Optional(Gb.String()),chainId:Gb.Number(),maxFeePerGas:Gb.String(),maxPriorityFeePerGas:Gb.String(),accessList:Gb.Optional(Gb.Array(Vy)),payment_req:Gb.Optional(Lm)});Gb.Object({path:vm,transaction:Gb.Union([Hy,Yy]),chunkify:Gb.Optional(Gb.Boolean())}),Gb.Object({v:Gb.String(),r:Gb.String(),s:Gb.String(),serializedTx:Gb.String()});const Jy=Gb.Object({name:Gb.String(),type:Gb.String()}),Zy=Gb.Object({EIP712Domain:Gb.Array(Jy)},{additionalProperties:Gb.Array(Jy)}),Qy=Gb.Object({types:Zy,primaryType:Gb.String(),domain:Gb.Object({name:Gb.Optional(Gb.String()),version:Gb.Optional(Gb.String()),chainId:Gb.Optional(Gb.Union([Gb.Number(),Gb.BigInt(),Gb.String()])),verifyingContract:Gb.Optional(Gb.String()),salt:Gb.Optional(Gb.Union([Gb.ArrayBuffer(),Gb.String()]))}),message:Gb.Object({},{additionalProperties:Gb.Any()})});Gb.Object({path:vm,data:Qy,metamask_v4_compat:Gb.Boolean(),domain_separator_hash:Gb.Optional(Gb.Undefined()),message_hash:Gb.Optional(Gb.Undefined()),show_message_hash:Gb.Optional(Gb.Boolean())}),Gb.Object({path:vm,data:Qy,metamask_v4_compat:Gb.Boolean(),domain_separator_hash:Gb.String(),message_hash:Gb.Optional(Gb.String()),show_message_hash:Gb.Optional(Gb.Boolean())}),Gb.Object({address:Gb.String(),message:Gb.String(),hex:Gb.Optional(Gb.Boolean()),signature:Gb.String()}),Gb.Object({path:vm,address:Gb.Optional(Gb.String()),showOnTrezor:Gb.Optional(Gb.Boolean()),networkType:Gb.Optional(_v),account:Gb.Optional(Gb.Number()),minor:Gb.Optional(Gb.Number()),paymentId:Gb.Optional(Gb.String()),chunkify:Gb.Optional(Gb.Boolean())},{$id:"MoneroGetAddress"}),Gb.Object({path:vm,networkType:Gb.Optional(_v)},{$id:"MoneroGetWatchKey"}),Gb.Object({watch_key:Gb.String(),address:Gb.String()},{$id:"MoneroWatchKey"});const ew=Gb.Object({out_key:Gb.String(),tx_pub_key:Gb.String(),additional_tx_pub_keys:Gb.Optional(Gb.Union([Gb.Array(Gb.String()),Gb.String()])),internal_output_index:Gb.Number(),sub_addr_major:Gb.Optional(Gb.Number()),sub_addr_minor:Gb.Optional(Gb.Number())},{$id:"MoneroTransferDetails"}),tw=Gb.Object({account:Gb.Number(),minor_indices:Gb.Array(Gb.Number())},{$id:"MoneroSubAddressIndicesList"});Gb.Object({path:vm,networkType:Gb.Optional(_v),subs:Gb.Optional(Gb.Array(tw)),tdis:Gb.Array(ew)},{$id:"MoneroKeyImageSync"});const nw=Gb.Object({iv:Gb.String(),key_image:Gb.String()},{$id:"MoneroExportedKeyImage"});Gb.Object({key_images:Gb.Array(nw),signature:Gb.String()},{$id:"MoneroKeyImageSyncResult"});const rw=Gb.Object({idx:Gb.Number(),key:Gb.Object({dest:Gb.String(),commitment:Gb.String()})},{$id:"MoneroOutputEntry"}),iw=Gb.Object({K:Gb.Optional(Gb.String()),L:Gb.Optional(Gb.String()),R:Gb.Optional(Gb.String()),ki:Gb.Optional(Gb.String())},{$id:"MoneroMultisigKLRki"}),ow=Gb.Object({outputs:Gb.Array(rw),real_output:Gb.Number(),real_out_tx_key:Gb.String(),real_out_additional_tx_keys:Gb.Array(Gb.String()),real_output_in_tx_index:Gb.Number(),amount:Gb.Number(),rct:Gb.Boolean(),mask:Gb.String(),subaddr_minor:Gb.Number(),multisig_kLRki:Gb.Optional(iw)},{$id:"MoneroTransactionSourceEntry"}),aw=Gb.Object({spend_public_key:Gb.String(),view_public_key:Gb.String()}),sw=Gb.Object({amount:Gb.Number(),addr:aw,is_subaddress:Gb.Boolean(),original:Gb.String(),is_integrated:Gb.Boolean()},{$id:"MoneroTransactionDestinationEntry"}),cw=Gb.Object({rsig_type:Gb.Number(),offload_type:Gb.Optional(Gb.Number()),grouping:Gb.Array(Gb.Number()),mask:Gb.Optional(Gb.String()),rsig:Gb.Optional(Gb.String()),rsig_parts:Gb.Optional(Gb.Array(Gb.String())),bp_version:Gb.Number()},{$id:"MoneroTransactionRsigData"}),uw=Gb.Object({version:Gb.Number(),payment_id:Gb.Optional(Gb.String()),unlock_time:Gb.Number(),outputs:Gb.Array(sw),change_dts:Gb.Optional(sw),num_inputs:Gb.Number(),mixin:Gb.Number(),fee:Gb.Number(),account:Gb.Number(),rsig_data:cw,minor_indices:Gb.Optional(Gb.Array(Gb.Number())),integrated_indices:Gb.Optional(Gb.Array(Gb.Number())),client_version:Gb.Number(),hard_fork:Gb.Number(),monero_version:Gb.Optional(Gb.String()),chunkify:Gb.Optional(Gb.Boolean())},{$id:"MoneroTransactionData"});Gb.Object({path:vm,networkType:_v,tsx_data:uw,inputs:Gb.Array(ow)},{$id:"MoneroSignTransaction"});const lw=Gb.Object({txn_fee:Gb.Optional(Gb.Number()),message:Gb.Optional(Gb.String()),rv_type:Gb.Optional(Gb.Number())},{$id:"MoneroRingCtSig"});Gb.Object({signatures:Gb.Array(Gb.String()),tx_prefix_hash:Gb.String(),rv:lw,cout_key:Gb.Optional(Gb.String()),salt:Gb.Optional(Gb.String()),rand_mult:Gb.Optional(Gb.String()),tx_enc_keys:Gb.Optional(Gb.String()),opening_key:Gb.Optional(Gb.String()),pseudo_outs:Gb.Array(Gb.String()),out_pks:Gb.Array(Gb.String()),ecdh_infos:Gb.Array(Gb.String()),tx_outs:Gb.Array(Gb.String()),rsig_parts:Gb.Array(Gb.String()),extra:Gb.Optional(Gb.String())},{$id:"MoneroSignedTransaction"}),Gb.Intersect([wm,Gb.Object({publicKey:Gb.String(),publicKeyBase58:Gb.String()})]);const dw=Gb.Object({baseAddress:Gb.String(),tokenProgram:Gb.String(),tokenMint:Gb.String(),tokenAccount:Gb.String(),symbol:Gb.Optional(Gb.String())}),fw=Gb.Object({tokenAccountsInfos:Gb.Optional(Gb.Array(dw,{minItems:1})),isDevnet:Gb.Optional(Gb.Boolean())});Gb.Object({path:Gb.Union([Gb.String(),Gb.Array(Gb.Number())]),serializedTx:Gb.String(),additionalInfo:Gb.Optional(fw),payment_req:Gb.Optional(Lm),serialize:Gb.Optional(Gb.Boolean()),chunkify:Gb.Optional(Gb.Boolean())}),Gb.Object({signature:Gb.String(),serializedTx:Gb.Optional(Gb.String())});const hw=Gb.Union([Gb.Literal("spl-token"),Gb.Literal("spl-token-2022")]),pw={fromAddress:Gb.String(),amount:Gb.String(),blockHash:Gb.String(),lastValidBlockHeight:Gb.Number(),priorityFees:Gb.Optional(Gb.Object({computeUnitPrice:Gb.String(),computeUnitLimit:Gb.String()})),token:Gb.Optional(Gb.Object({mint:Gb.String(),program:hw,decimals:Gb.Number(),accounts:Gb.Array(Gb.Object({publicKey:Gb.String(),balance:Gb.String()}))})),memo:Gb.Optional(Gb.String()),coin:Gb.Optional(Gb.String()),identity:Gb.Optional(Gb.String())},bw=Gb.Object({...pw,toAddress:Gb.Optional(Gb.String()),serializedTx:Gb.String()}),mw=Gb.Object({...pw,toAddress:Gb.String(),serializedTx:Gb.Optional(Gb.Undefined())});Gb.Union([bw,mw]),Gb.Object({serializedTx:Gb.String(),additionalInfo:Gb.Object({newAccountProgramName:Gb.Optional(hw),tokenAccountInfo:Gb.Optional(dw)})});const gw=Gb.Object({type:Gb.Union([Fv,Gb.KeyOfEnum(jv)]),code:Gb.Optional(Gb.String()),issuer:Gb.Optional(Gb.String())}),vw=Gb.Object({type:Gb.Literal("createAccount"),source:Gb.Optional(Gb.String()),destination:Gb.String(),startingBalance:Gb.String()}),yw=Gb.Object({type:Gb.Literal("payment"),source:Gb.Optional(Gb.String()),destination:Gb.String(),asset:gw,amount:Gb.String()}),ww=Gb.Object({type:Gb.Literal("pathPaymentStrictReceive"),source:Gb.Optional(Gb.String()),sendAsset:gw,sendMax:Gb.Uint(),destination:Gb.String(),destAsset:gw,destAmount:Gb.Uint(),path:Gb.Optional(Gb.Array(gw))}),xw=Gb.Object({type:Gb.Literal("pathPaymentStrictSend"),source:Gb.Optional(Gb.String()),sendAsset:gw,sendAmount:Gb.Uint(),destination:Gb.String(),destAsset:gw,destMin:Gb.Uint(),path:Gb.Optional(Gb.Array(gw))}),Aw=Gb.Object({type:Gb.Literal("createPassiveSellOffer"),source:Gb.Optional(Gb.String()),buying:gw,selling:gw,amount:Gb.Uint(),price:Gb.Object({n:Gb.Number(),d:Gb.Number()})}),Ew=Gb.Object({type:Gb.Literal("manageSellOffer"),source:Gb.Optional(Gb.String()),buying:gw,selling:gw,amount:Gb.Uint(),offerId:Gb.Optional(Gb.Uint()),price:Gb.Object({n:Gb.Number(),d:Gb.Number()})}),Sw=Gb.Object({type:Gb.Literal("manageBuyOffer"),source:Gb.Optional(Gb.String()),buying:gw,selling:gw,amount:Gb.Uint(),offerId:Gb.Optional(Gb.Uint()),price:Gb.Object({n:Gb.Number(),d:Gb.Number()})}),_w=Gb.Object({type:Gb.Literal("setOptions"),source:Gb.Optional(Gb.String()),signer:Gb.Optional(Gb.Object({type:Wv,key:Gb.Union([Gb.String(),Gb.Buffer()]),weight:Gb.Optional(Gb.Number())})),inflationDest:Gb.Optional(Gb.String()),clearFlags:Gb.Optional(Gb.Number()),setFlags:Gb.Optional(Gb.Number()),masterWeight:Gb.Optional(Gb.Uint()),lowThreshold:Gb.Optional(Gb.Uint()),medThreshold:Gb.Optional(Gb.Uint()),highThreshold:Gb.Optional(Gb.Uint()),homeDomain:Gb.Optional(Gb.String())}),Ow=Gb.Object({type:Gb.Literal("changeTrust"),source:Gb.Optional(Gb.String()),line:gw,limit:Gb.String()}),Nw=Gb.Object({type:Gb.Literal("allowTrust"),source:Gb.Optional(Gb.String()),trustor:Gb.String(),assetCode:Gb.String(),assetType:Fv,authorize:Gb.Optional(Gb.Union([Gb.Boolean(),Gb.Undefined()]))}),kw=Gb.Object({type:Gb.Literal("accountMerge"),source:Gb.Optional(Gb.String()),destination:Gb.String()}),Tw=Gb.Object({type:Gb.Literal("manageData"),source:Gb.Optional(Gb.String()),name:Gb.String(),value:Gb.Optional(Gb.Union([Gb.String(),Gb.Buffer()]))}),Cw=Gb.Object({type:Gb.Literal("bumpSequence"),source:Gb.Optional(Gb.String()),bumpTo:Gb.Uint()}),Iw=Gb.Object({type:Gb.Literal("inflation"),source:Gb.Optional(Gb.String())}),Bw=Gb.Object({type:Gb.Literal("claimClaimableBalance"),source:Gb.Optional(Gb.String()),balanceId:Gb.String()}),Lw=Gb.Union([vw,yw,ww,xw,Aw,Ew,Sw,_w,Ow,Nw,kw,Iw,Tw,Cw,Bw]),Mw=Gb.Object({source:Gb.String(),fee:Gb.Number(),sequence:Gb.Uint(),timebounds:Gb.Optional(Gb.Object({minTime:Gb.Number(),maxTime:Gb.Number()})),memo:Gb.Optional(Gb.Object({type:zv,id:Gb.Optional(Gb.Uint()),text:Gb.Optional(Gb.String()),hash:Gb.Optional(Gb.Union([Gb.String(),Gb.Buffer()]))})),operations:Gb.Array(Lw)});Gb.Object({path:vm,networkPassphrase:Gb.String(),transaction:Mw,payment_req:Gb.Optional(Lm)}),Gb.Object({publicKey:Gb.String(),signature:Gb.String()}),Gb.Union([Gb.Intersect([Gb.Object({type:Gb.Literal("StellarCreateAccountOp")}),Yv]),Gb.Intersect([Gb.Object({type:Gb.Literal("StellarPaymentOp")}),ry]),Gb.Intersect([Gb.Object({type:Gb.Literal("StellarPathPaymentStrictReceiveOp")}),ty]),Gb.Intersect([Gb.Object({type:Gb.Literal("StellarPathPaymentStrictSendOp")}),ny]),Gb.Intersect([Gb.Object({type:Gb.Literal("StellarManageSellOfferOp")}),ey]),Gb.Intersect([Gb.Object({type:Gb.Literal("StellarManageBuyOfferOp")}),Zv]),Gb.Intersect([Gb.Object({type:Gb.Literal("StellarCreatePassiveSellOfferOp")}),Jv]),Gb.Intersect([Gb.Object({type:Gb.Literal("StellarSetOptionsOp")}),iy]),Gb.Intersect([Gb.Object({type:Gb.Literal("StellarChangeTrustOp")}),Hv]),Gb.Intersect([Gb.Object({type:Gb.Literal("StellarAllowTrustOp")}),qv]),Gb.Intersect([Gb.Object({type:Gb.Literal("StellarAccountMergeOp")}),Xv]),Gb.Intersect([Gb.Object({type:Gb.Literal("StellarManageDataOp")}),Qv]),Gb.Intersect([Gb.Object({type:Gb.Literal("StellarBumpSequenceOp")}),Gv]),Gb.Intersect([Gb.Object({type:Gb.Literal("StellarClaimClaimableBalanceOp")}),Vv])]);const Rw=Gb.Object({source:Gb.String(),fee:Gb.Number(),counter:Gb.Number(),gas_limit:Gb.Number(),storage_limit:Gb.Number(),public_key:Gb.String()}),Pw=Gb.Object({destination:Gb.String(),amount:Gb.Number()}),Uw=Gb.Object({set_delegate:Gb.Optional(Gb.String()),cancel_delegate:Gb.Optional(Gb.Boolean()),transfer:Gb.Optional(Pw)}),jw=Gb.Object({source:Gb.String(),destination:Gb.String(),amount:Gb.Number(),counter:Gb.Number(),fee:Gb.Number(),gas_limit:Gb.Number(),storage_limit:Gb.Number(),parameters:Gb.Optional(Gb.Array(Gb.Number())),parameters_manager:Gb.Optional(Uw)}),Fw=Gb.Object({source:Gb.String(),balance:Gb.Number(),delegate:Gb.Optional(Gb.String()),script:vm,fee:Gb.Number(),counter:Gb.Number(),gas_limit:Gb.Number(),storage_limit:Gb.Number()}),Dw=Gb.Object({source:Gb.String(),delegate:Gb.String(),fee:Gb.Number(),counter:Gb.Number(),gas_limit:Gb.Number(),storage_limit:Gb.Number()}),zw=Gb.Object({reveal:Gb.Optional(Rw),transaction:Gb.Optional(jw),origination:Gb.Optional(Fw),delegation:Gb.Optional(Dw)});Gb.Object({path:vm,branch:Gb.String(),operation:zw,chunkify:Gb.Optional(Gb.Boolean())});const $w=Gb.Object({type:Gb.Literal("TransferContract"),parameter:Gb.Object({value:fy})}),Ww=Gb.Object({type:Gb.Literal("TriggerSmartContract"),parameter:Gb.Object({value:hy})}),Xw=Gb.Object({type:Gb.Literal("FreezeBalanceV2Contract"),parameter:Gb.Object({value:uy})}),qw=Gb.Object({type:Gb.Literal("UnfreezeBalanceV2Contract"),parameter:Gb.Object({value:py})}),Kw=Gb.Object({type:Gb.Literal("WithdrawExpireUnfreezeContract"),parameter:Gb.Object({value:gy})}),Gw=Gb.Object({type:Gb.Literal("VoteWitnessContract"),parameter:Gb.Object({value:my})}),Hw=Gb.Union([$w,Ww,Xw,qw,Kw,Gw]),Vw=Gb.Object({type:Gb.Literal("FreezeBalanceV2Contract"),parameter:Gb.Object({value:Gb.Union([Gb.Object({owner_address:Gb.String(),frozen_balance:Gb.Number(),balance:Gb.Optional(Gb.Number()),resource:Gb.Optional(cy)}),uy])})}),Yw=Gb.Object({type:Gb.Literal("UnfreezeBalanceV2Contract"),parameter:Gb.Object({value:Gb.Union([Gb.Object({owner_address:Gb.String(),unfreeze_balance:Gb.Number(),balance:Gb.Optional(Gb.Number()),resource:Gb.Optional(cy)}),py])})}),Jw=Gb.Object({type:Gb.Literal("VoteWitnessContract"),parameter:Gb.Object({value:Gb.Union([Gb.Object({owner_address:Gb.String(),votes:Gb.Array(Gb.Object({vote_address:Gb.String(),vote_count:Gb.Number()}))}),my])})}),Zw=Gb.Union([$w,Ww,Vw,Yw,Kw,Jw]);Gb.Object({path:vm,ref_block_bytes:Gb.String(),ref_block_hash:Gb.String(),expiration:Gb.Number(),timestamp:Gb.Number(),fee_limit:Gb.Optional(Gb.Number()),data:Gb.Optional(Gb.String()),contract:Gb.Array(Zw,{length:1})}),Gb.Object({signature:Gb.String(),serializedTx:Gb.Optional(Gb.String())}),Gb.Object({contract:Hw,blockHash:Gb.String(),blockHeight:Gb.Number(),fee_limit:Gb.Optional(Gb.Number()),data:Gb.Optional(Gb.String())}),Gb.Object({rawDataHex:Gb.String(),ref_block_bytes:Gb.String(),ref_block_hash:Gb.String(),expiration:Gb.Number(),timestamp:Gb.Number(),bandwidth:Gb.Number()}),Gb.Object({path:vm,key:Gb.String(),value:Gb.Union([Gb.String(),Gb.Buffer()]),encrypt:Gb.Optional(Gb.Boolean()),askOnEncrypt:Gb.Optional(Gb.Boolean()),askOnDecrypt:Gb.Optional(Gb.Boolean()),iv:Gb.Optional(Gb.Union([Gb.String(),Gb.Buffer()]))}),Gb.Composite([Av,Gb.Object({passphrase_source:Gb.Optional(Gb.Number())})]),Gb.Object({path:vm,coordinator:Gb.String(),maxRounds:Gb.Number(),maxCoordinatorFeeRate:Gb.Number(),maxFeePerKvbyte:Gb.Number(),coin:Gb.Optional(Gb.String()),scriptType:Gb.Optional(Zm),amountUnit:Gb.Optional(Rm),preauthorized:Gb.Optional(Gb.Boolean())}),Gb.Object({preauthorized:Gb.Optional(Gb.Boolean())}),Gb.Union([Gb.Object({binary:Gb.Optional(Gb.Undefined()),language:Gb.String(),baseUrl:Gb.Optional(Gb.String())}),Gb.Object({binary:Gb.ArrayBuffer(),language:Gb.Optional(Gb.Undefined()),baseUrl:Gb.Optional(Gb.Undefined())})]),wg.ICARUS,wg.ICARUS_TREZOR,wg.LEDGER,Gb.Object({path:vm,coin:Gb.String(),derivationType:Gb.Optional(xg),suppressBackupWarning:Gb.Optional(Gb.Boolean())}),Gb.Object({path:vm,coin:Gb.Optional(Gb.String()),multisig:Gb.Optional(Hm),scriptType:Gb.Optional(Zm)}),Gb.Object({path:vm,coin:Gb.Optional(Gb.String()),multisig:Gb.Optional(Hm),scriptType:Gb.Optional(Zm),userConfirmation:Gb.Optional(Gb.Boolean()),ownershipIds:Gb.Optional(Gb.Array(Gb.String(),{minItems:1})),commitmentData:Gb.Optional(Gb.String()),preauthorized:Gb.Optional(Gb.Boolean())}),Gb.Object({tx:Gb.Union([Gb.String(),Gb.Object({hex:Gb.String(),disableAlternativeRPC:Gb.Optional(Gb.Boolean())})]),coin:Gb.String(),identity:Gb.Optional(Gb.String())});const Qw=Gb.Object({challengeHidden:Gb.String(),challengeVisual:Gb.String(),origin:Gb.Optional(Gb.String()),asyncChallenge:Gb.Optional(Gb.Undefined()),callback:Gb.Optional(Gb.Undefined())});Gb.Union([Qw]),Gb.Object({path:vm,mac:Gb.Optional(Gb.String())});const ex=new class{eventEmitter=new Vu;currentTarget;implementations;coreMode;implSettings;callPending=0;beforeCallSynchronize=Cu();constructor({implementations:e}){this.implementations=e,this.currentTarget="core-in-suite-desktop"}getTarget(){return this.implementations[this.currentTarget]}getTargetType(){return this.currentTarget}async switchTarget(e){if(this.currentTarget===e)return;if(!this.implSettings)throw Qc("Init_ManifestMissing");const t=this.getTargetType(),n=this.getTarget();try{this.currentTarget=e,await this.getTarget().init(this.implSettings),await n.dispose()}catch{this.currentTarget=t}}async init(e){this.coreMode=e.coreMode;const t=(e=>{if(e&&"string"==typeof e.email&&"string"==typeof e.appUrl&&!(void 0!==e.appName&&"string"!=typeof e.appName||void 0!==e.appIcon&&"string"!=typeof e.appIcon))return{email:e.email,appUrl:e.appUrl,appName:e.appName,appIcon:e.appIcon}})(e.manifest);if(!t)throw Qc("Init_ManifestMissing");this.implSettings={manifest:t,env:e.env,debug:e.debug,version:Hu(e.version)},this.currentTarget=this.getInitTarget(),this.callPending=0;try{return await this.getTarget().init(this.implSettings)}catch(e){if(await this.handleErrorFallback(e.code))return;throw e}}updateConnectSettings(e){return Promise.resolve(tu(Qc("Method_InvalidPackage","updateConnectSettings is not supported in this implementation")))}async call(e){try{0===this.callPending&&await this.beforeCallSynchronize(async()=>{this.callPending++,await this.handleBeforeCall()});const t=await this.getTarget().call(e);return!t.success&&await this.handleErrorFallback(t.error.code)?await this.getTarget().call(e):t}catch(e){return tu(e)}finally{this.callPending--}}cancel(e){return this.getTarget().cancel(e)}dispose(){return this.eventEmitter.removeAllListeners(),this.callPending=0,this.getTarget().dispose()}getInitTarget(){const{coreMode:e}=this;return"suite-desktop"===e?"core-in-suite-desktop":"suite-web"===e?"core-in-suite-web":(e&&"auto"!==e&&console.warn(`Invalid coreMode: ${e}`),"core-in-suite-desktop")}async handleBeforeCall(){const{coreMode:e}=this;"suite-desktop"!==e&&"auto"!==e&&void 0!==e||await this.switchTarget("core-in-suite-desktop")}async handleErrorFallback(e){return"core-in-suite-desktop"===this.getTargetType()&&("Desktop_ConnectionMissing"===e||"Method_Unsupported"===e)&&(await this.switchTarget("core-in-suite-web"),!0)}uiResponse(){throw Qc("Method_InvalidPackage")}}({implementations:{"core-in-suite-desktop":new class{manifest;version;ws;localNetworkPermissionState="unknown";constructor(){this.ws=new Zu({url:"ws://127.0.0.1:21335/connect-ws"})}dispose(){return this.manifest=void 0,this.version=void 0,this.ws.dispose(),Promise.resolve(void 0)}cancel(e){this.ws.sendMessage({type:iu,payload:e?{reason:e}:null})}async handshake(){if(!this.ws)throw Qc("Desktop_ConnectionMissing","No websocket connection");try{const e=await this.ws.sendMessage({type:su,payload:{settings:{manifest:this.manifest,version:this.version}}},{timeout:3e3});if(!e)throw Qc("Desktop_ConnectionMissing","No response");return e}catch(e){throw Qc("Desktop_ConnectionMissing",e.message)}}async init({manifest:e,version:t}){if("undefined"!=typeof navigator&&navigator?.permissions?.query){const e=await navigator.permissions.query({name:"local-network-access"}).catch(()=>{});e&&(this.localNetworkPermissionState=e.state,e.onchange=()=>{this.localNetworkPermissionState=e.state})}if(!e.appName)throw Qc("Init_ManifestMissing","Manifest is missing or manifest.appName is not set");return this.manifest=e,this.version=t,await this.connect()}error(e){return e instanceof Ju?"denied"===this.localNetworkPermissionState?Qc("Browser_LocalNetworkPermissionMissing"):Qc("Desktop_ConnectionMissing",e.message):e}async connect(){try{await this.ws.connect()}catch(e){throw this.error(e)}}async call(e){try{this.ws.isConnected()||await this.connect(),await this.handshake();const t=await this.ws.sendMessage({type:ru,payload:e},{timeout:0});if(!t)throw Qc("Desktop_ConnectionMissing","No response");return!1===t.success?{success:!1,error:t.error}:{success:!0,payload:t.payload,device:t.device}}catch(e){return{success:!1,error:eu(this.error(e))}}}},"core-in-suite-web":new class{_popupManager;logger;constructor(){this.logger=il("@trezor/connect-web")}dispose(){return Promise.resolve(void 0)}cancel(e){this.logger.debug("cancel",e),this._popupManager?.channel?.clearPendingSends(),this._popupManager?.channel?.postMessage({type:iu,payload:e?{reason:e}:null},{usePromise:!1})}init({env:e,manifest:t,version:n,debug:r}){if(this.logger.enabled=!!r,!this._popupManager){const r=e??(()=>{if("undefined"!=typeof chrome&&void 0!==chrome.runtime?.onConnect)return"webextension";if("undefined"!=typeof navigator){if("string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase())return"react-native";if(navigator.userAgent.toLowerCase().includes(" electron/"))return"electron"}return"web"})(),i={manifest:t,version:n,popupSrc:this.getSuiteUrl(),logger:this.logger};switch(r){case"webextension":this._popupManager=new vl(i);break;case"web":this._popupManager=new ml(i);break;default:this.logger.error("Unsupported environment for connect-web:",r)}}return this.logger.debug("initiated"),Promise.resolve()}getSuiteUrl(){return"undefined"!=typeof __SUITE_WEB_URL__&&__SUITE_WEB_URL__?`${__SUITE_WEB_URL__}/connect-popup`:"undefined"!=typeof window?sl(window.location.href,window.location.origin):"https://suite.trezor.io/web/connect-popup"}async call(e){if(this.logger.debug("call",e),!this._popupManager)return tu(Qc("Init_NotInitialized"));try{this.logger.debug("call - awaiting popupManger.focusOrCreate()"),await this._popupManager.focusOrCreate(),this.logger.debug("call - popupManager.request() resolved"),await this._popupManager.channel.init(),this.logger.debug("call - popupManager.channel.init() resolved"),await(this._popupManager.handshakePromise?.promise),this.logger.debug("call - sending iframe.call");const t=await this._popupManager.channel.postMessage({type:ru,payload:e});if(this.logger.debug("call: response: ",t),!t?.payload)throw Qc("Method_NoResponse");if(t.payload.error&&t.payload.error.code)throw t.payload.error;return{success:t.payload.success,payload:t.payload.payload,device:t.payload.device}}catch(e){return this.logger.error("call: error",e),tu(e)}}}}}),tx=(({eventEmitter:e,init:t,call:n,updateConnectSettings:r,uiResponse:i,cancel:o,dispose:a},s={})=>{const c=Object.fromEntries(Yc.map(t=>[t,r=>n({...r,method:t,useEventListener:t.toLowerCase().endsWith("getaddress")?e.listenerCount(ou)>0:void 0})]));return{init:t,updateConnectSettings:r,on:e.on.bind(e),off:e.removeListener.bind(e),removeAllListeners:e.removeAllListeners.bind(e),uiResponse:i,call:n,dispose:a,cancel:o,...c,...s}})({eventEmitter:ex.eventEmitter,init:ex.init.bind(ex),call:ex.call.bind(ex),uiResponse:ex.uiResponse.bind(ex),updateConnectSettings:ex.updateConnectSettings.bind(ex),cancel:ex.cancel.bind(ex),dispose:ex.dispose.bind(ex)});var nx,rx,ix,ox,ax,sx,cx,ux=null,lx=function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:if(!ux)throw new Error("BLUX: Trezor is not set up. Please check your store configuration.");return[4,ux];case 1:return e.sent(),[2]}})})},dx="m/44'/148'/0'",fx=function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:return[4,tx.stellarGetAddress({path:dx,showOnTrezor:!1})];case 1:if(!(e=t.sent()).success)throw new Error("BLUX: ".concat(e.payload.error));return[2,e.payload.address]}})})},hx={name:H.Trezor,website:"https://trezor.io",connect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,lx()];case 1:return e.sent(),[4,fx()];case 2:return[2,e.sent()];case 3:throw e.sent(),new Error("BLUX: Failed to connect to Trezor.");case 4:return[2]}})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2]})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: Trezor does not support the getNetwork function")})})},isAvailable:function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){return e=ye().config,[2,"undefined"!=typeof window&&!!e.trezor]})})},signAuthEntry:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: Trezor does not support the signAuthEntry function")})})},signMessage:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: Trezor does not support the signMessage function")})})},signTransaction:function(e,t){return ee(void 0,void 0,void 0,function(){var n,i,o;return te(this,function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,lx()];case 1:return a.sent(),[4,fx()];case 2:return n=a.sent(),i=new r(e,t.network),[4,tx.stellarSignTransaction({transaction:i,path:dx,networkPassphrase:t.network})];case 3:if(!(o=a.sent()).success)throw new Error("BLUX: ".concat(o.payload.error));return i.addSignature(n,Buffer.from(o.payload.signature,"hex").toString("base64")),[2,i.toXDR()];case 4:throw a.sent(),new Error("BLUX: Failed to sign the transaction with Trezor.");case 5:return[2]}})})}},px=0,bx=function(e,t){return new Promise(function(n,r){var i=++px,o=function(e){var t,a;e.source===window&&"FREIGHTER_EXTERNAL_MSG_RESPONSE"===(null===(t=e.data)||void 0===t?void 0:t.source)&&(null===(a=e.data)||void 0===a?void 0:a.messagedId)===i&&(window.removeEventListener("message",o),e.data.apiError?r(e.data.apiError):n(e.data))};window.addEventListener("message",o),window.postMessage(Z({source:"FREIGHTER_EXTERNAL_MSG_REQUEST",messageId:i,type:e},t),window.location.origin)})},mx=function(){var e;return"undefined"!=typeof window&&!!(null===(e=window.FordefiProviders)||void 0===e?void 0:e.StellarProvider)},gx={name:H.Fordefi,website:"https://www.fordefi.com",connect:function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),!mx())throw new Error("BLUX: Fordefi Wallet is not installed.");return[4,bx("REQUEST_ACCESS")];case 1:if(!(e=t.sent().publicKey))throw new Error("BLUX: Failed to get address from Fordefi.");return[2,e];case 2:throw t.sent(),new Error("BLUX: Failed to connect to Fordefi.");case 3:return[2]}})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2]})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),!mx())throw new Error("BLUX: Fordefi Wallet is not installed.");return[4,bx("REQUEST_NETWORK_DETAILS")];case 1:return[2,{network:(e=t.sent().networkDetails).network,passphrase:e.networkPassphrase}];case 2:throw t.sent(),new Error("BLUX: Failed to get network from Fordefi");case 3:return[2]}})})},isAvailable:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2,mx()]})})},signAuthEntry:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: Fordefi does not support the signAuthEntry function")})})},signMessage:function(e,t){return ee(void 0,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!mx())throw new Error("BLUX: Fordefi Wallet is not installed.");return[4,bx("SUBMIT_BLOB",{blob:e,networkPassphrase:t.network,accountToSign:t.address})];case 1:if(!(n=r.sent().signedBlob))throw new Error("BLUX: Failed to sign message with Fordefi.");return[2,n];case 2:throw r.sent(),new Error("BLUX: Failed to sign message with Fordefi.");case 3:return[2]}})})},signTransaction:function(e,t){return ee(void 0,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!mx())throw new Error("BLUX: Fordefi Wallet is not installed.");return[4,bx("SUBMIT_TRANSACTION",{transactionXdr:e,networkPassphrase:t.network,accountToSign:t.address})];case 1:if(!(n=r.sent().signedTransaction))throw new Error("BLUX: Failed to sign transaction with Fordefi.");return[2,n];case 2:throw r.sent(),new Error("BLUX: Failed to sign the transaction with Fordefi.");case 3:return[2]}})})}},vx={name:H.Freighter,website:"https://freighter.app",authenticateWithSignedMessage:!0,connect:function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,6]),[4,T()];case 1:if(!t.sent())throw new Error("BLUX: Freighter Wallet is not installed or connected.");return[4,B()];case 2:if((e=t.sent()).error&&"The user rejected this request."===e.error.message)throw new Error("BLUX: Failed to connect to Freighter");if(""===e.address.trim())throw new Error("BLUX: Failed to connect to Freighter.");return[2,e.address];case 3:return"Failed to connect to Freighter."!==t.sent().message?[3,5]:[4,vx.connect()];case 4:return[2,t.sent()];case 5:throw new Error("BLUX: Failed to connect to Freighter.");case 6:return[2]}})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2]})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,T()];case 1:if(!t.sent())throw new Error("BLUX: Freighter Wallet is not installed or connected.");return[4,N.getNetwork()];case 2:if((e=t.sent()).error)throw new Error("BLUX: Failed to get network from Freighter");return[2,{network:e.network,passphrase:e.networkPassphrase}];case 3:throw t.sent(),new Error("BLUX: Failed to disconnect from Rabet.");case 4:return[2]}})})},isAvailable:function(){return new Promise(function(e){var t=setTimeout(function(){e(!1)},700);setTimeout(function(){return ee(void 0,void 0,void 0,function(){return te(this,function(n){try{T().then(function(n){var r=n.isConnected,i=n.error;r?(clearTimeout(t),e(!i&&r)):setTimeout(function(){T().then(function(n){var r=n.isConnected,i=n.error;clearTimeout(t),e(!i&&r)})},350)}).catch(function(){clearTimeout(t),e(!1)})}catch(t){e(!1)}return[2]})})},450)})},signAuthEntry:function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i;return te(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,T()];case 1:if(!o.sent())throw new Error("BLUX: Freighter Wallet is not installed or connected.");return[4,I(e,{address:t.address,networkPassphrase:t.network})];case 2:if(n=o.sent(),r=n.error,i=n.signedAuthEntry,r||!i)throw new Error("BLUX: Could not signedAuthEntry using Freighter");return[2,Buffer.from(i).toString("base64")];case 3:throw o.sent(),new Error("BLUX: Failed to sign the transaction with Freighter.");case 4:return[2]}})})},signMessage:function(e,t){return ee(void 0,void 0,void 0,function(){var n,r;return te(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,C(e,{address:t.address})];case 1:if(n=i.sent(),r=n.signedMessage,n.error||!r)throw new Error("BLUX: Failed to sign message using Freighter");return[2,"string"==typeof r?r:Buffer.from(r).toString("base64")];case 2:throw i.sent(),new Error("BLUX: Failed to sign message using Freighter");case 3:return[2]}})})},signTransaction:function(e,t){return ee(void 0,void 0,void 0,function(){return te(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,T()];case 1:if(!n.sent())throw new Error("BLUX: Freighter Wallet is not installed or connected.");return[4,k(e,{address:t.address,networkPassphrase:t.network})];case 2:return[2,n.sent().signedTxXdr];case 3:throw n.sent(),new Error("BLUX: Failed to sign the transaction with Freighter.");case 4:return[2]}})})}},yx={name:H.CactusLink,website:"https://www.mycactus.com",connect:function(){return ee(void 0,void 0,void 0,function(){var e,t;return te(this,function(n){switch(n.label){case 0:if(n.trys.push([0,3,,4]),"undefined"==typeof window||!window.cactuslink_stellar)throw new Error("BLUX: Cactus Link Wallet is not installed.");return[4,window.cactuslink_stellar.requestAccess()];case 1:if((e=n.sent()).error)throw new Error("BLUX: ".concat(e.error));return[4,window.cactuslink_stellar.getAddress()];case 2:if(!(t=n.sent().address))throw new Error("BLUX: Getting the address from Cactus Link is not allowed, please request access first.");return[2,t];case 3:throw n.sent(),new Error("BLUX: Failed to connect to Cactus Link.");case 4:return[2]}})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2]})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){var e,t,n,r;return te(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),"undefined"==typeof window||!window.cactuslink_stellar)throw new Error("BLUX: Cactus Link Wallet is not installed.");return[4,window.cactuslink_stellar.getNetwork()];case 1:if(e=i.sent(),t=e.network,n=e.networkPassphrase,r=e.error)throw new Error("BLUX: ".concat(r));return[2,{network:t,passphrase:n}];case 2:throw i.sent(),new Error("BLUX: Failed to get network from Cactus Link");case 3:return[2]}})})},isAvailable:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2,"undefined"!=typeof window&&!!window.cactuslink_stellar]})})},signAuthEntry:function(e,t){return ee(void 0,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),"undefined"==typeof window||!window.cactuslink_stellar)throw new Error("BLUX: Cactus Link Wallet is not installed.");return[4,window.cactuslink_stellar.signAuthEntry(e,{address:t.address,networkPassphrase:t.network})];case 1:if(!(n=r.sent().signedAuthEntry))throw new Error("BLUX: signedAuthEntry returned from Cactus Link is undefined.");return[2,n];case 2:throw r.sent(),new Error("BLUX: Failed to sign auth entry with Cactus Link.");case 3:return[2]}})})},signMessage:function(e,t){return ee(void 0,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),"undefined"==typeof window||!window.cactuslink_stellar)throw new Error("BLUX: Cactus Link Wallet is not installed.");return[4,window.cactuslink_stellar.signMessage(e,{address:t.address,networkPassphrase:t.network})];case 1:if(!(n=r.sent().signedMessage))throw new Error("BLUX: signedMessage returned from Cactus Link is undefined.");return[2,n];case 2:throw r.sent(),new Error("BLUX: Failed to sign message with Cactus Link.");case 3:return[2]}})})},signTransaction:function(e,t){return ee(void 0,void 0,void 0,function(){return te(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),"undefined"==typeof window||!window.cactuslink_stellar)throw new Error("BLUX: Cactus Link Wallet is not installed.");return[4,window.cactuslink_stellar.signTransaction(e,{address:t.address,networkPassphrase:t.network})];case 1:return[2,n.sent().signedTxXdr];case 2:throw n.sent(),new Error("BLUX: Failed to sign the transaction with Cactus Link.");case 3:return[2]}})})}},wx={name:H.WalletConnect,website:"https://walletconnect.com",isAvailable:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2,!!ye().config.walletConnect]})})},connect:function(){return ee(void 0,void 0,void 0,function(){var e,t,n;return te(this,function(r){switch(r.label){case 0:if(!(e=ye().walletConnect)||!e.client)throw new Error("BLUX: WalletConnect client is not set up. Please check your store configuration.");r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.connection.approval()];case 2:if(t=r.sent(),!(n=t.namespaces.stellar)||!n.accounts[0])throw new Error("BLUX: Wallet did not approve the required Stellar namespace/account.");return[2,n.accounts[0].split(":").pop()];case 3:throw r.sent(),new Error("BLUX: Failed to connect to Wallet. Ensure your wallet supports Stellar WalletConnect.");case 4:return[2]}})})},disconnect:function(){return ee(void 0,void 0,void 0,function(){var e,t;return te(this,function(n){switch(n.label){case 0:if(!(e=ye().walletConnect)||!e.client)throw new Error("BLUX: WalletConnect client is not set up.");n.label=1;case 1:return n.trys.push([1,3,,4]),0===(t=e.client.session.getAll()).length?[2]:[4,e.client.disconnect({topic:t[0].topic,reason:{code:6e3,message:"User explicitly disconnected."}})];case 2:return n.sent(),[3,4];case 3:throw n.sent(),new Error("BLUX: Failed to disconnect from Wallet Connect. Try closing the session in your mobile wallet.");case 4:return[2]}})})},getNetwork:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: Cannot reliably get the active network from WalletConnect without a specific session request.")})})},signTransaction:function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i,o;return te(this,function(a){switch(a.label){case 0:if(!(n=ye().walletConnect)||!n.client)throw new Error("BLUX: WalletConnect client is not set up.");a.label=1;case 1:if(a.trys.push([1,3,,4]),0===(r=n.client.session.getAll()).length)throw new Error("BLUX: WalletConnect not connected. Please connect first.");return i=r[0],o=t.network===V.PUBLIC?ke:Te,[4,n.client.request({topic:i.topic,chainId:o,request:{method:"stellar_signXDR",params:{xdr:e}}})];case 2:return[2,a.sent().signedXDR];case 3:throw a.sent(),new Error("BLUX: Failed to sign and submit the transaction with Wallet Connect.");case 4:return[2]}})})},signMessage:function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i,o,a,s;return te(this,function(c){switch(c.label){case 0:if(!(n=ye().walletConnect)||!n.client)throw new Error("BLUX: WalletConnect client is not set up.");c.label=1;case 1:if(c.trys.push([1,3,,4]),0===(r=n.client.session.getAll()).length)throw new Error("BLUX: WalletConnect not connected. Please connect first.");return i=r[0],o=t.network===V.PUBLIC?ke:Te,a=(null===(s=i.namespaces.stellar.chains)||void 0===s?void 0:s[0])||o,[4,n.client.request({topic:i.topic,chainId:a,request:{method:"stellar_signMessage",params:{message:e}}})];case 2:return[2,c.sent().signature];case 3:throw c.sent(),new Error("BLUX: Failed to sign message with Wallet Connect.");case 4:return[2]}})})},signAuthEntry:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){throw new Error("BLUX: Stellar Auth Entry signing is not supported via standard WalletConnect methods.")})})}},xx=((nx={})[H.Freighter]=vx,nx[H.Rabet]=Zo,nx[H.WalletConnect]=wx,nx[H.Hot]=Yo,nx[H.Api]=qe,nx[H.Hana]=Jo,nx[H.Xbull]=Qo,nx[H.Lobstr]=na,nx[H.Ledger]=Vc,nx[H.Albedo]=ea,nx[H.Klever]=ta,nx[H.Bitget]=ia,nx[H.Onekey]=ra,nx[H.CactusLink]=yx,nx[H.Fordefi]=gx,nx[H.Trezor]=hx,nx),Ax=function(e,t){var n;return"wallet"===e.authMethod?null!==(n=t.find(function(t){return t.name===e.authValue}))&&void 0!==n?n:xx[e.authValue]:xx[H.Api]},Ex={mainnet:e.PUBLIC,testnet:e.TESTNET,sandbox:e.SANDBOX,futurenet:e.FUTURENET,standalone:e.STANDALONE},Sx=((rx={})[Ex.mainnet]="Mainnet",rx[Ex.testnet]="Testnet",rx[Ex.futurenet]="Futurenet",rx[Ex.standalone]="Standalone",rx[Ex.sandbox]="Sandbox",rx),_x=((ix={})[Ex.mainnet]={name:"Mainnet",horizon:"https://horizon.stellar.org",soroban:"https://mainnet.sorobanrpc.com"},ix[Ex.testnet]={name:"Testnet",horizon:"https://horizon-testnet.stellar.org",soroban:"https://soroban-testnet.stellar.org"},ix[Ex.futurenet]={name:"Futurenet",horizon:"https://horizon-futurenet.stellar.org",soroban:"https://rpc-futurenet.stellar.org"},ix),Ox={steexp:(ox={},ox[Ex.mainnet]="https://steexp.com",ox[Ex.testnet]="https://testnet.steexp.com",ox.ledgerUrl="ledger",ox.transactionUrl="tx",ox.accountUrl="account",ox),stellarexpert:(ax={},ax[Ex.mainnet]="https://stellar.expert/explorer/public",ax[Ex.testnet]="https://stellar.expert/explorer/testnet",ax.ledgerUrl="ledger",ax.accountUrl="account",ax.transactionUrl="tx",ax),lumenscan:(sx={},sx[Ex.mainnet]="https://lumenscan.io",sx[Ex.testnet]="https://testnet.lumenscan.io",sx.ledgerUrl="ledgers",sx.accountUrl="account",sx.operationUrl="ops",sx.transactionUrl="txns",sx),stellarchain:(cx={},cx[Ex.mainnet]="https://stellarchain.io",cx[Ex.testnet]="https://testnet.stellarchain.io",cx[Ex.futurenet]="https://futurenet.stellarchain.io",cx.ledgerUrl="ledgers",cx.accountUrl="accounts",cx.operationUrl="operations",cx.transactionUrl="transactions",cx)},Nx={logInOrSignUp:{en:"Log in or Sign up",es:"Inicia sesión o regístrate",pt:"Entre ou cadastre-se",fr:"Connexion ou inscription",de:"Anmelden oder registrieren",ru:"Вход или регистрация",zh:"登录或注册",ja:"ログイン / 登録",ko:"로그인 또는 가입",tr:"Giriş yap veya kaydol"},profile:{en:"Profile",es:"Perfil",pt:"Perfil",fr:"Profil",de:"Profil",ru:"Профиль",zh:"个人资料",ja:"プロフィール",ko:"프로필",tr:"Profil"},confirmation:{en:"Confirmation",es:"Confirmación",pt:"Confirmação",fr:"Confirmation",de:"Bestätigung",ru:"Подтверждение",zh:"确认",ja:"確認",ko:"확인",tr:"Onay"},send:{en:"Send",es:"Enviar",pt:"Enviar",fr:"Envoyer",de:"Senden",ru:"Отправить",zh:"发送",ja:"送金",ko:"보내기",tr:"Gönder"},activity:{en:"Activity",es:"Actividad",pt:"Atividade",fr:"Activité",de:"Aktivität",ru:"Активность",zh:"活动",ja:"アクティビティ",ko:"활동",tr:"İşlemler"},swap:{en:"Swap",es:"Intercambiar",pt:"Trocar",fr:"Échanger",de:"Tauschen",ru:"Обмен",zh:"兑换",ja:"スワップ",ko:"스왑",tr:"Takas"},receive:{en:"Receive",es:"Recibir",pt:"Receber",fr:"Recevoir",de:"Empfangen",ru:"Получить",zh:"接收",ja:"受け取る",ko:"받기",tr:"Al"},wrongNetwork:{en:"Wrong Network",es:"Red incorrecta",pt:"Rede incorreta",fr:"Mauvais réseau",de:"Falsches Netzwerk",ru:"Неверная сеть",zh:"错误的网络",ja:"ネットワークが違います",ko:"잘못된 네트워크",tr:"Yanlış ağ"},balances:{en:"Balances",es:"Saldos",pt:"Saldos",fr:"Soldes",de:"Guthaben",ru:"Балансы",zh:"余额",ja:"残高",ko:"잔액",tr:"Bakiyeler"},whatIsBlux:{en:"What is Blux",es:"Qué es Blux",pt:"O que é Blux",fr:"Qu’est-ce que Blux",de:"Was ist Blux",ru:"Что такое Blux",zh:"什么是 Blux",ja:"Bluxとは",ko:"Blux란",tr:"Blux nedir?"},addToken:{en:"Add Token",es:"Agregar token",pt:"Adicionar token",fr:"Ajouter un token",de:"Token hinzufügen",ru:"Добавить токен",zh:"添加代币",ja:"トークンを追加",ko:"토큰 추가",tr:"Token ekle"},signMessage:{en:"Sign Message",es:"Firmar mensaje",pt:"Assinar mensagem",fr:"Signer un message",de:"Nachricht signieren",ru:"Подписать сообщение",zh:"签名消息",ja:"メッセージに署名",ko:"메시지 서명",tr:"Mesajı imzala"},selectAsset:{en:"Select Asset",es:"Seleccionar activo",pt:"Selecionar ativo",fr:"Sélectionner un actif",de:"Asset auswählen",ru:"Выбор актива",zh:"选择资产",ja:"資産を選択",ko:"자산 선택",tr:"Varlık seç"},walletConnect:{en:"Wallet Connect",es:"Wallet Connect",pt:"Wallet Connect",fr:"Wallet Connect",de:"Wallet Connect",ru:"Wallet Connect",zh:"Wallet Connect",ja:"Wallet Connect",ko:"Wallet Connect",tr:"Wallet Connect"},acceptTermsAndPrivacy:{en:"By signing in or creating an account, you agree to our Terms and Conditions and Privacy Policy.",es:"Al iniciar sesión o crear una cuenta, aceptas nuestros Términos y Condiciones y nuestra Política de Privacidad.",pt:"Ao entrar ou criar uma conta, você concorda com nossos Termos e Condições e nossa Política de Privacidade.",fr:"En vous connectant ou en créant un compte, vous acceptez nos Conditions générales et notre Politique de confidentialité.",de:"Mit der Anmeldung oder Kontoerstellung stimmst du unseren Allgemeinen Geschäftsbedingungen und unserer Datenschutzerklärung zu.",ru:"Входя в систему или создавая аккаунт, вы соглашаетесь с нашими Условиями использования и Политикой конфиденциальности.",zh:"登录或创建账户即表示您同意我们的条款和条件以及隐私政策。",ja:"ログインまたはアカウントを作成することで、利用規約およびプライバシーポリシーに同意したものとみなされます。",ko:"로그인하거나 계정을 만들면 이용약관과 개인정보 처리방침에 동의하게 됩니다.",tr:"Giriş yapınca veya hesap açınca Şartlar ve Gizlilik Politikası’nı kabul etmiş olursun."},receiveFunds:{en:"Receive Funds",es:"Recibir fondos",pt:"Receber fundos",fr:"Recevoir des fonds",de:"Geld empfangen",ru:"Получить средства",zh:"接收资金",ja:"資金を受け取る",ko:"자금 받기",tr:"Para al"},addFunds:{en:"Add Funds",es:"Agregar fondos",pt:"Adicionar fundos",fr:"Ajouter des fonds",de:"Geld hinzufügen",ru:"Пополнить",zh:"充值",ja:"資金を追加",ko:"자금 추가",tr:"Para ekle"},cashOut:{en:"Cash Out",es:"Retirar",pt:"Sacar",fr:"Retirer",de:"Auszahlen",ru:"Вывести",zh:"提现",ja:"キャッシュアウト",ko:"출금",tr:"Nakit çek"},buy:{en:"Buy",es:"Comprar",pt:"Comprar",fr:"Acheter",de:"Kaufen",ru:"Купить",zh:"买入",ja:"購入",ko:"구매",tr:"Al"},sell:{en:"Sell",es:"Vender",pt:"Vender",fr:"Vendre",de:"Verkaufen",ru:"Продать",zh:"卖出",ja:"売却",ko:"판매",tr:"Sat"},fundMeOnrampHelp:{en:"Choose how you’d like to fund your wallet.",es:"Elige cómo quieres fondear tu billetera.",pt:"Escolha como deseja adicionar fundos à sua carteira.",fr:"Choisissez comment alimenter votre portefeuille.",de:"Wähle, wie du dein Wallet aufladen möchtest.",ru:"Выберите, как пополнить кошелёк.",zh:"选择如何为钱包充值。",ja:"ウォレットへの入金方法を選んでください。",ko:"지갑에 자금을 넣는 방법을 선택하세요.",tr:"Cüzdanını nasıl fonlamak istediğini seç."},fundMeOfframpHelp:{en:"Choose how you’d like to cash out.",es:"Elige cómo quieres retirar fondos.",pt:"Escolha como deseja sacar.",fr:"Choisissez comment retirer vos fonds.",de:"Wähle, wie du auszahlen möchtest.",ru:"Выберите, как вывести средства.",zh:"选择如何提现。",ja:"キャッシュアウト方法を選んでください。",ko:"출금 방법을 선택하세요.",tr:"Nasıl nakit çekmek istediğini seç."},moneygramError:{en:"Couldn’t start MoneyGram. Try again.",es:"No se pudo iniciar MoneyGram. Inténtalo de nuevo.",pt:"Não foi possível iniciar o MoneyGram. Tente novamente.",fr:"Impossible de démarrer MoneyGram. Réessaie.",de:"MoneyGram konnte nicht gestartet werden. Versuche es erneut.",ru:"Не удалось запустить MoneyGram. Попробуйте ещё раз.",zh:"无法启动 MoneyGram,请重试。",ja:"MoneyGram を開始できなかった。もう一度。",ko:"MoneyGram을 시작하지 못했습니다. 다시 시도하세요.",tr:"MoneyGram başlatılamadı. Bir daha dene."},moneygramSignHelp:{en:"Confirm the MoneyGram request in your wallet.",es:"Confirma la solicitud de MoneyGram en tu billetera.",pt:"Confirme a solicitação da MoneyGram na sua carteira.",fr:"Confirmez la demande MoneyGram dans votre portefeuille.",de:"Bestätige die MoneyGram-Anfrage in deinem Wallet.",ru:"Подтвердите запрос MoneyGram в кошельке.",zh:"请在钱包中确认 MoneyGram 请求。",ja:"ウォレットで MoneyGram のリクエストを承認してください。",ko:"지갑에서 MoneyGram 요청을 확인하세요.",tr:"MoneyGram isteğini cüzdanında onayla."},moneygramWaitingHelp:{en:"Finish in the MoneyGram window. We’ll ask you to send USDC next.",es:"Termina en la ventana de MoneyGram. Luego te pediremos enviar USDC.",pt:"Conclua na janela da MoneyGram. Em seguida pediremos para enviar USDC.",fr:"Terminez dans la fenêtre MoneyGram. Nous vous demanderons ensuite d’envoyer des USDC.",de:"Schließe das MoneyGram-Fenster ab. Als Nächstes bitten wir dich, USDC zu senden.",ru:"Завершите шаги в окне MoneyGram. Затем мы попросим отправить USDC.",zh:"请在 MoneyGram 窗口中完成操作,随后我们会请你发送 USDC。",ja:"MoneyGram のウィンドウで手続きを完了してください。次に USDC の送信をお願いします。",ko:"MoneyGram 창에서 절차를 마치면 USDC 전송을 요청합니다.",tr:"MoneyGram penceresini tamamla. Ardından USDC göndermen istenecek."},termsAndConditions:{en:"Terms and Conditions",es:"Términos y condiciones",pt:"Termos e condições",fr:"Conditions générales",de:"Allgemeine Geschäftsbedingungen",ru:"Условия использования",zh:"条款和条件",ja:"利用規約",ko:"이용약관",tr:"Şartlar ve Koşullar"},loading:{en:"Loading",es:"Cargando",pt:"Carregando",fr:"Chargement",de:"Wird geladen",ru:"Загрузка",zh:"加载中",ja:"読み込み中",ko:"로딩 중",tr:"Yükleniyor"},tryAgain:{en:"Try again",es:"Intenta de nuevo",pt:"Tente novamente",fr:"Réessayer",de:"Erneut versuchen",ru:"Попробовать снова",zh:"重试",ja:"再試行",ko:"다시 시도",tr:"Tekrar dene"},back:{en:"Back",es:"Atrás",pt:"Voltar",fr:"Retour",de:"Zurück",ru:"Назад",zh:"返回",ja:"戻る",ko:"뒤로",tr:"Geri"},continueWith:{en:"Continue with ${provider}",es:"Continuar con ${provider}",pt:"Continuar com ${provider}",fr:"Continuer avec ${provider}",de:"Weiter mit ${provider}",ru:"Продолжить с ${provider}",zh:"使用 ${provider} 继续",ja:"${provider} で続ける",ko:"${provider}로 계속",tr:"${provider} ile devam et"},socialPopupHelp:{en:"Continue in the ${provider} window to finish signing in",es:"Continúa en la ventana de ${provider} para terminar de iniciar sesión",pt:"Continue na janela do ${provider} para concluir o login",fr:"Poursuivez dans la fenêtre ${provider} pour terminer la connexion",de:"Fahre im ${provider}-Fenster fort, um die Anmeldung abzuschließen",ru:"Продолжите в окне ${provider}, чтобы завершить вход",zh:"请在 ${provider} 窗口中完成登录",ja:"${provider} のウィンドウでログインを完了してください",ko:"${provider} 창에서 로그인을 완료하세요",tr:"Girişi bitirmek için ${provider} penceresine geç"},connecting:{en:"Connecting",es:"Conectando",pt:"Conectando",fr:"Connexion",de:"Verbinden",ru:"Подключение",zh:"连接中",ja:"接続中",ko:"연결 중",tr:"Bağlanıyor"},signing:{en:"Signing",es:"Firmando",pt:"Assinando",fr:"Signature",de:"Signieren",ru:"Подписание",zh:"签名中",ja:"署名中",ko:"서명 중",tr:"İmzalanıyor"},or:{en:"or",es:"o",pt:"ou",fr:"ou",de:"oder",ru:"или",zh:"或",ja:"または",ko:"또는",tr:"veya"},recent:{en:"Recent",es:"Reciente",pt:"Recente",fr:"Récent",de:"Zuletzt",ru:"Недавний",zh:"最近",ja:"最近",ko:"최근",tr:"Son"},allStellarWallets:{en:"All Stellar wallets",es:"Todas las wallets",pt:"Todas as wallets",fr:"Tous les wallets",de:"Alle Wallets",ru:"Все кошельки",zh:"所有 Stellar 钱包",ja:"すべてのウォレット",ko:"모든 지갑",tr:"Tüm cüzdanlar"},email:{en:"Email",es:"Correo electrónico",pt:"E-mail",fr:"E-mail",de:"E-Mail",ru:"Эл. почта",zh:"电子邮箱",ja:"メールアドレス",ko:"이메일",tr:"E-posta"},phone:{en:"Phone (US/Canada)",es:"Teléfono (EE. UU./Canadá)",pt:"Telefone (EUA/Canadá)",fr:"Téléphone (É.-U./Canada)",de:"Telefon (USA/Kanada)",ru:"Телефон (США/Канада)",zh:"电话(美国/加拿大)",ja:"電話番号(米国/カナダ)",ko:"전화번호 (미국/캐나다)",tr:"Telefon (ABD/Kanada)"},logInWithPasskey:{en:"Log in with Passkey",es:"Entrar con Passkey",pt:"Entrar com Passkey",fr:"Connexion Passkey",de:"Mit Passkey anmelden",ru:"Войти с Passkey",zh:"使用通行密钥登录",ja:"パスキーでログイン",ko:"패스키로 로그인",tr:"Passkey ile giriş yap"},submit:{en:"Submit",es:"Enviar",pt:"Enviar",fr:"Envoyer",de:"Absenden",ru:"Отправить",zh:"提交",ja:"送信",ko:"제출",tr:"Gönder"},poweredByBlux:{en:"Powered by Blux.cc",es:"Desarrollado por Blux.cc",pt:"Desenvolvido por Blux.cc",fr:"Propulsé par Blux.cc",de:"Powered by Blux.cc",ru:"Работает на Blux.cc",zh:"由 Blux.cc 提供支持",ja:"Powered by Blux.cc",ko:"Powered by Blux.cc",tr:"Powered by Blux.cc"},reviewAndAcceptPrompt:{en:"Read the documents below, then agree to continue.",es:"Revisa los documentos a continuación y acepta para continuar.",pt:"Revise os documentos abaixo e aceite para continuar.",fr:"Consultez les documents ci-dessous, puis acceptez pour continuer.",de:"Lies die Dokumente unten und stimme zu, um weiterzumachen.",ru:"Ознакомьтесь с документами ниже и примите их, чтобы продолжить.",zh:"请查看以下文件,然后同意以继续。",ja:"下の書類を確認して、同意すると続けられます。",ko:"아래 문서를 검토한 후 동의하여 계속하세요.",tr:"Aşağıdaki belgelere bak, devam etmek için kabul et."},termsOfService:{en:"Terms of Service",es:"Términos de servicio",pt:"Termos de serviço",fr:"Conditions d’utilisation",de:"Nutzungsbedingungen",ru:"Условия обслуживания",zh:"服务条款",ja:"利用規約",ko:"서비스 약관",tr:"Hizmet Şartları"},privacyPolicy:{en:"Privacy Policy",es:"Política de privacidad",pt:"Política de privacidade",fr:"Politique de confidentialité",de:"Datenschutzerklärung",ru:"Политика конфиденциальности",zh:"隐私政策",ja:"プライバシーポリシー",ko:"개인정보 처리방침",tr:"Gizlilik Politikası"},openLink:{en:"Open link",es:"Abrir enlace",pt:"Abrir link",fr:"Ouvrir le lien",de:"Link öffnen",ru:"Открыть ссылку",zh:"打开链接",ja:"リンクを開く",ko:"링크 열기",tr:"Bağlantıyı aç"},noLegalLinksProvided:{en:"This app didn’t provide any legal links.",es:"Esta app no tiene enlaces legales.",pt:"Este app não informou links legais.",fr:"Cette app n’a pas fourni de liens légaux.",de:"Für diese App gibt’s keine rechtlichen Links.",ru:"Для этого приложения нет юридических ссылок.",zh:"此应用未提供法律条款链接。",ja:"このアプリには法的リンクがありません。",ko:"이 앱에는 법적 링크가 없어요.",tr:"Bu uygulamada yasal link yok."},agree:{en:"Accept & Continue",es:"Aceptar y continuar",pt:"Aceitar e continuar",fr:"Accepter et continuer",de:"Akzeptieren & fortfahren",ru:"Принять и продолжить",zh:"接受并继续",ja:"同意して続行",ko:"동의 및 계속",tr:"Kabul et ve devam et"},disagree:{en:"No thanks",es:"No, gracias",pt:"Não, obrigado",fr:"Non merci",de:"Nein danke",ru:"Нет, спасибо",zh:"不用了,谢谢",ja:"同意しない",ko:"괜찮습니다",tr:"Hayır, teşekkürler"},connectionSuccessfulTitle:{en:"Connection Successful",es:"Conexión exitosa",pt:"Conexão feita",fr:"Connexion réussie",de:"Verbindung erfolgreich",ru:"Подключение выполнено",zh:"连接成功",ja:"接続できました",ko:"연결 성공",tr:"Bağlantı başarılı"},connectionSuccessfulMessage:{en:"Your account is connected to ${appName}",es:"Tu cuenta ya está conectada a ${appName}",pt:"Sua conta foi conectada a ${appName}",fr:"Votre compte est connecté à ${appName}",de:"Dein Konto ist mit ${appName} verbunden",ru:"Аккаунт подключён к ${appName}",zh:"您的账户已连接到 ${appName}",ja:"アカウントが ${appName} に接続されました",ko:"계정이 ${appName}에 연결되었습니다",tr:"Hesabın ${appName} ile bağlandı"},transactionSuccessfulTitle:{en:"Transaction Successful",es:"Transacción exitosa",pt:"Transação concluída",fr:"Transaction réussie",de:"Transaktion erfolgreich",ru:"Транзакция выполнена",zh:"交易成功",ja:"取引が完了しました",ko:"거래 성공",tr:"İşlem başarılı"},transactionSuccessfulMessage:{en:"Your transaction went through",es:"Tu transacción se completó",pt:"Sua transação foi concluída",fr:"Votre transaction est terminée",de:"Deine Transaktion ist durch",ru:"Транзакция прошла",zh:"交易已完成",ja:"取引が完了しました",ko:"거래가 완료되었습니다",tr:"İşlemin tamamlandı"},messageSignedTitle:{en:"Message Signed",es:"Mensaje firmado",pt:"Mensagem assinada",fr:"Message signé",de:"Nachricht signiert",ru:"Сообщение подписано",zh:"消息已签名",ja:"メッセージに署名しました",ko:"메시지 서명 완료",tr:"Mesaj imzalandı"},messageSignedMessage:{en:"Your message is signed.",es:"Tu mensaje está firmado.",pt:"Sua mensagem foi assinada.",fr:"Votre message est signé.",de:"Deine Nachricht ist signiert.",ru:"Сообщение подписано.",zh:"消息已签名。",ja:"メッセージに署名しました。",ko:"메시지가 서명되었습니다.",tr:"Mesajın imzalandı."},authEntrySignedTitle:{en:"Authorization Signed",es:"Autorización firmada",pt:"Autorização assinada",fr:"Autorisation signée",de:"Autorisierung signiert",ru:"Авторизация подписана",zh:"授权已签名",ja:"承認に署名しました",ko:"승인 서명 완료",tr:"Yetkilendirme imzalandı"},authEntrySignedMessage:{en:"Authorization is signed.",es:"La autorización está firmada.",pt:"A autorização foi assinada.",fr:"L’autorisation est signée.",de:"Die Autorisierung ist signiert.",ru:"Авторизация подписана.",zh:"授权已签名。",ja:"承認に署名しました。",ko:"승인이 서명되었습니다.",tr:"Yetkilendirme imzalandı."},seeInExplorer:{en:"See in explorer",es:"Ver en el explorer",pt:"Ver no explorer",fr:"Voir dans l’explorer",de:"Im Explorer ansehen",ru:"Открыть в Explorer",zh:"在区块浏览器中查看",ja:"エクスプローラーで見る",ko:"익스플로러에서 보기",tr:"Explorer’da gör"},loggingIn:{en:"Logging In",es:"Iniciando sesión",pt:"Entrando",fr:"Connexion en cours",de:"Anmeldung läuft",ru:"Выполняется вход",zh:"登录中",ja:"ログイン中",ko:"로그인 중",tr:"Giriş yapılıyor"},done:{en:"Done",es:"Hecho",pt:"Pronto",fr:"Terminé",de:"Fertig",ru:"Готово",zh:"完成",ja:"完了",ko:"완료",tr:"Tamam"},signTransactionPrompt:{en:"wants your permission to approve the following transaction.",es:"quiere tu permiso para aprobar la siguiente transacción.",pt:"quer sua permissão para aprovar a seguinte transação.",fr:"demande votre autorisation pour approuver la transaction suivante.",de:"bittet um deine Erlaubnis, die folgende Transaktion zu genehmigen.",ru:"запрашивает ваше разрешение на одобрение следующей транзакции.",zh:"请求您批准以下交易。",ja:"が次の取引の承認を求めています。",ko:"다음 거래의 승인을 요청합니다.",tr:"şu işlemi onaylamanı istiyor."},invalidXdr:{en:"Invalid XDR",es:"XDR inválido",pt:"XDR inválido",fr:"XDR invalide",de:"Ungültiger XDR",ru:"Недействительный XDR",zh:"无效的 XDR",ja:"無効な XDR",ko:"잘못된 XDR",tr:"Geçersiz XDR"},lobstrWarning:{en:"Make sure your LOBSTR wallet is on the ${network} network, or the transaction will fail.",es:"Asegúrate de que tu cartera LOBSTR esté configurada en la red ${network}. De lo contrario, la transacción fallará.",pt:"Certifique-se de que sua carteira LOBSTR esteja configurada na rede ${network}. Caso contrário, a transação falhará.",fr:"Assurez-vous que votre portefeuille LOBSTR est réglé sur le réseau ${network}, sinon la transaction échouera.",de:"Stelle sicher, dass deine LOBSTR-Wallet auf das ${network}-Netzwerk eingestellt ist, sonst schlägt die Transaktion fehl.",ru:"Убедитесь, что ваш кошелёк LOBSTR настроен на сеть ${network}, иначе транзакция не пройдёт.",zh:"请确认 LOBSTR 钱包已切换到 ${network} 网络,否则交易会失败。",ja:"LOBSTR ウォレットが ${network} ネットワークになっているか確認して。違うと取引は失敗します。",ko:"LOBSTR 지갑이 ${network} 네트워크로 설정되어 있는지 확인하세요. 그렇지 않으면 거래가 실패합니다.",tr:"LOBSTR cüzdanın ${network} ağında olsun. Değilse işlem düşer."},yourWallet:{en:"Your wallet",es:"Tu wallet",pt:"Sua wallet",fr:"Votre wallet",de:"Deine Wallet",ru:"Ваш кошелёк",zh:"您的钱包",ja:"あなたのウォレット",ko:"내 지갑",tr:"Cüzdanınız"},noAddressFound:{en:"No address found",es:"No se encontró ninguna dirección",pt:"Nenhum endereço encontrado",fr:"Aucune adresse trouvée",de:"Keine Adresse gefunden",ru:"Адрес не найден",zh:"未找到地址",ja:"アドレスが見つかりません",ko:"주소를 찾을 수 없습니다",tr:"Adres bulunamadı"},approve:{en:"Approve",es:"Aprobar",pt:"Aprovar",fr:"Approuver",de:"Genehmigen",ru:"Одобрить",zh:"批准",ja:"承認",ko:"승인",tr:"Onayla"},loadingActivity:{en:"Loading activity...",es:"Cargando actividad...",pt:"Carregando atividade...",fr:"Chargement de l’activité...",de:"Aktivität wird geladen...",ru:"Загрузка активности...",zh:"正在加载活动记录...",ja:"取引履歴を読み込み中...",ko:"활동을 불러오는 중...",tr:"Aktivite yükleniyor..."},noActivityFound:{en:"No activity found",es:"No se encontró actividad",pt:"Nenhuma atividade encontrada",fr:"Aucune activité trouvée",de:"Keine Aktivität gefunden",ru:"Активность не найдена",zh:"暂无活动记录",ja:"取引履歴がありません",ko:"활동 내역이 없습니다",tr:"Aktivite bulunamadı"},multiOperation:{en:"Multi Operation",es:"Operación múltiple",pt:"Operação múltipla",fr:"Opérations multiples",de:"Mehrere Operationen",ru:"Несколько операций",zh:"多操作",ja:"複数オペレーション",ko:"다중 작업",tr:"Çoklu işlem"},pathPaymentDescription:{en:"Path payment of ${amount} ${asset}",es:"Pago por ruta de ${amount} ${asset}",pt:"Pagamento por rota de ${amount} ${asset}",fr:"Paiement par chemin de ${amount} ${asset}",de:"Pfadzahlung über ${amount} ${asset}",ru:"Платёж по маршруту на ${amount} ${asset}",zh:"${amount} ${asset} 的路径支付",ja:"${amount} ${asset} のパスペイメント",ko:"${amount} ${asset} 경로 결제",tr:"${amount} ${asset} yol ödemesi"},seeAllInExplorer:{en:"See all in explorer",es:"Ver todo en el explorer",pt:"Ver tudo no explorer",fr:"Tout voir dans l’explorer",de:"Alles im Explorer ansehen",ru:"Смотреть всё в Explorer",zh:"在区块浏览器中查看全部",ja:"エクスプローラーですべて見る",ko:"익스플로러에서 전체 보기",tr:"Tümünü explorer’da gör"},enterConfirmationCodeTitle:{en:"Enter confirmation code",es:"Introduce el código de confirmación",pt:"Digite o código de confirmação",fr:"Code de confirmation",de:"Bestätigungscode eingeben",ru:"Введите код подтверждения",zh:"输入确认码",ja:"確認コードを入力",ko:"확인 코드 입력",tr:"Onay kodunu gir"},enterConfirmationCodeHelp:{en:"Check your email and enter the code below",es:"Revisa tu correo e introduce el código abajo",pt:"Verifique seu e-mail e digite o código de confirmação abaixo",fr:"Vérifiez votre e-mail et saisissez le code ci-dessous",de:"Prüfe deine E-Mails und gib den Bestätigungscode unten ein",ru:"Проверьте почту и введите код подтверждения ниже",zh:"请查收您的电子邮件,并在下方输入确认码",ja:"メールを確認して、下にコードを入力して",ko:"이메일을 확인하고 아래에 확인 코드를 입력하세요",tr:"Mailine bak, kodu aşağıya yaz"},enterConfirmationCodeHelpSms:{en:"Check your texts and enter the code below",es:"Revisa tus mensajes e introduce el código abajo",pt:"Verifique seu SMS e digite o código abaixo",fr:"Vérifiez vos SMS et saisissez le code ci-dessous",de:"Prüfe deine SMS und gib den Code unten ein",ru:"Проверьте SMS и введите код ниже",zh:"请查收短信,并在下方输入确认码",ja:"SMSを確認して、下にコードを入力して",ko:"문자를 확인하고 아래에 확인 코드를 입력하세요",tr:"SMS’ine bak, kodu aşağıya yaz"},invalidCodeError:{en:"Invalid code. Try again.",es:"Código incorrecto. Inténtalo de nuevo.",pt:"Código inválido, tente novamente.",fr:"Code incorrect. Réessayez.",de:"Falscher Code. Versuch’s nochmal.",ru:"Неверный код, попробуйте ещё раз.",zh:"验证码无效,请重试。",ja:"コードが違います。もう一度。",ko:"잘못된 코드입니다. 다시 시도하세요.",tr:"Kod yanlış. Bir daha dene."},resendCode:{en:"Resend code",es:"Reenviar código",pt:"Reenviar código",fr:"Renvoyer le code",de:"Code erneut senden",ru:"Отправить код повторно",zh:"重新发送验证码",ja:"コードを再送信",ko:"코드 재전송",tr:"Kodu yeniden gönder"},copied:{en:"Copied!",es:"¡Copiado!",pt:"Copiado!",fr:"Copié !",de:"Kopiert!",ru:"Скопировано!",zh:"已复制!",ja:"コピーしました!",ko:"복사됨!",tr:"Kopyalandı!"},logout:{en:"Logout",es:"Cerrar sesión",pt:"Sair",fr:"Déconnexion",de:"Abmelden",ru:"Выйти",zh:"退出登录",ja:"ログアウト",ko:"로그아웃",tr:"Çıkış yap"},search:{en:"Search",es:"Buscar",pt:"Buscar",fr:"Rechercher",de:"Suchen",ru:"Поиск",zh:"搜索",ja:"検索",ko:"검색",tr:"Ara"},noAssetsFound:{en:"No assets found",es:"No se encontraron activos",pt:"Nenhum ativo encontrado",fr:"Aucun actif trouvé",de:"Keine Assets gefunden",ru:"Активы не найдены",zh:"未找到资产",ja:"資産が見つかりません",ko:"자산을 찾을 수 없습니다",tr:"Varlık bulunamadı"},amount:{en:"Amount",es:"Cantidad",pt:"Quantia",fr:"Montant",de:"Betrag",ru:"Сумма",zh:"金额",ja:"金額",ko:"금액",tr:"Tutar"},max:{en:"Max",es:"Máx",pt:"Máx",fr:"Max",de:"Max",ru:"Макс",zh:"最大",ja:"最大",ko:"최대",tr:"Maks"},from:{en:"From",es:"De",pt:"De",fr:"De",de:"Von",ru:"Из",zh:"从",ja:"送信元",ko:"보냄",tr:"Kimden"},to:{en:"To",es:"A",pt:"Para",fr:"Vers",de:"An",ru:"Куда",zh:"至",ja:"送信先",ko:"받음",tr:"Kime"},enterAddress:{en:"Enter address",es:"Introduce la dirección",pt:"Digite o endereço",fr:"Saisissez l’adresse",de:"Adresse eingeben",ru:"Введите адрес",zh:"输入地址",ja:"アドレスを入力",ko:"주소 입력",tr:"Adres girin"},addressRequired:{en:"Address is required",es:"La dirección es obligatoria",pt:"O endereço é obrigatório",fr:"L’adresse est requise",de:"Adresse ist erforderlich",ru:"Укажите адрес",zh:"地址为必填项",ja:"アドレスは必須です",ko:"주소는 필수입니다",tr:"Adres gerekli"},addressInvalid:{en:"Address is invalid",es:"La dirección es inválida",pt:"O endereço é inválido",fr:"L’adresse est invalide",de:"Adresse ist ungültig",ru:"Недействительный адрес",zh:"地址无效",ja:"アドレスが無効です",ko:"주소가 잘못되었습니다",tr:"Adres geçersiz"},inactiveAccount:{en:"Account is inactive",es:"La cuenta está inactiva",pt:"A conta está inativa",fr:"Le compte est inactif",de:"Konto ist inaktiv",ru:"Аккаунт неактивен",zh:"账户未激活",ja:"アカウントが有効化されていません",ko:"계정이 비활성 상태입니다",tr:"Hesap etkin değil"},memo:{en:"Memo",es:"Memo",pt:"Memo",fr:"Mémo",de:"Memo",ru:"Мемо",zh:"备注 (Memo)",ja:"メモ",ko:"메모",tr:"Memo"},enterMemo:{en:"Enter Memo",es:"Introduce el memo",pt:"Digite o memo",fr:"Saisissez le mémo",de:"Memo eingeben",ru:"Введите мемо",zh:"输入备注",ja:"メモを入力",ko:"메모 입력",tr:"Memo girin"},optional:{en:"optional",es:"opcional",pt:"opcional",fr:"facultatif",de:"optional",ru:"необязательно",zh:"可选",ja:"任意",ko:"선택",tr:"isteğe bağlı"},paste:{en:"Paste",es:"Pegar",pt:"Colar",fr:"Coller",de:"Einfügen",ru:"Вставить",zh:"粘贴",ja:"貼り付け",ko:"붙여넣기",tr:"Yapıştır"},amountRequired:{en:"Amount is required",es:"La cantidad es obligatoria",pt:"A quantia é obrigatória",fr:"Le montant est requis",de:"Betrag ist erforderlich",ru:"Укажите сумму",zh:"金额为必填项",ja:"金額は必須です",ko:"금액은 필수입니다",tr:"Tutar gerekli"},amountExceedsBalance:{en:"Amount is greater than max balance",es:"La cantidad excede el saldo máximo",pt:"A quantia excede o saldo máximo",fr:"Le montant dépasse le solde maximal",de:"Betrag übersteigt das maximale Guthaben",ru:"Сумма превышает доступный баланс",zh:"金额超过最大余额",ja:"金額が残高を超えています",ko:"금액이 최대 잔액을 초과합니다",tr:"Tutar maksimum bakiyeyi aşıyor"},sendButton:{en:"Send",es:"Enviar",pt:"Enviar",fr:"Envoyer",de:"Senden",ru:"Отправить",zh:"发送",ja:"送金",ko:"보내기",tr:"Gönder"},loginFailed:{en:"Login failed",es:"No se pudo iniciar sesión",pt:"Falha no login",fr:"Échec de la connexion",de:"Anmeldung fehlgeschlagen",ru:"Не удалось войти",zh:"登录失败",ja:"ログインに失敗しました",ko:"로그인 실패",tr:"Giriş başarısız"},accessDeniedTitle:{en:"Access denied",es:"Acceso denegado",pt:"Acesso negado",fr:"Accès refusé",de:"Zugriff verweigert",ru:"Доступ запрещён",zh:"访问被拒绝",ja:"アクセスが拒否されました",ko:"접근이 거부되었습니다",tr:"Erişim reddedildi"},accessDeniedHelp:{en:"This app doesn’t allow this account to sign in. Try another one, or contact the app’s team if that seems wrong.",es:"Esta app no deja entrar con esta cuenta. Prueba con otra, o habla con el equipo de la app si crees que es un error.",pt:"Este app não deixa esta conta entrar. Tente outra, ou fale com o time do app se achar que é engano.",fr:"Cette app n’autorise pas ce compte. Essayez-en un autre, ou contactez l’équipe si cela vous semble une erreur.",de:"Diese App lässt dieses Konto nicht zu. Versuch ein anderes, oder schreib dem App-Team, falls das ein Fehler ist.",ru:"Это приложение не пускает этот аккаунт. Попробуйте другой или напишите команде, если это ошибка.",zh:"此应用不允许该账户登录。请换一个账户,若有疑问可联系应用团队。",ja:"このアプリではこのアカウントは使えません。別のアカウントを試すか、誤りだと思ったら運営に連絡して。",ko:"이 앱은 이 계정으로 로그인할 수 없어요. 다른 계정으로 시도하거나, 잘못된 것 같으면 앱 팀에 문의하세요.",tr:"Bu uygulama bu hesaba izin vermiyor. Başka hesap dene; hata olduğunu düşünüyorsan ekibe yaz."},signingFailed:{en:"Signing with ${walletName} failed",es:"La firma con ${walletName} falló",pt:"A assinatura com ${walletName} falhou",fr:"La signature avec ${walletName} a échoué",de:"Signieren mit ${walletName} fehlgeschlagen",ru:"Не удалось подписать с помощью ${walletName}",zh:"使用 ${walletName} 签名失败",ja:"${walletName} での署名に失敗しました",ko:"${walletName} 서명에 실패했습니다",tr:"${walletName} ile imzalama başarısız oldu"},waitingFor:{en:"Waiting for ${walletName}",es:"Esperando a ${walletName}",pt:"Aguardando ${walletName}",fr:"En attente de ${walletName}",de:"Warte auf ${walletName}",ru:"Ожидание ${walletName}",zh:"等待 ${walletName}",ja:"${walletName} を待っています",ko:"${walletName} 대기 중",tr:"${walletName} bekleniyor"},signingWith:{en:"Signing with ${walletName}",es:"Firmando con ${walletName}",pt:"Assinando com ${walletName}",fr:"Signature avec ${walletName}",de:"Signieren mit ${walletName}",ru:"Подписание через ${walletName}",zh:"正在使用 ${walletName} 签名",ja:"${walletName} で署名中",ko:"${walletName}(으)로 서명 중",tr:"${walletName} ile imzalanıyor"},loginRetryMessage:{en:"Try logging in again.",es:"Intenta iniciar sesión otra vez.",pt:"Tente entrar de novo.",fr:"Réessayez de vous connecter.",de:"Versuch dich nochmal anzumelden.",ru:"Попробуйте войти ещё раз.",zh:"请再试一次登录。",ja:"もう一度ログインしてみて。",ko:"다시 로그인해 보세요.",tr:"Tekrar giriş yapmayı dene."},signingRetryMessage:{en:"Try signing again.",es:"Intenta firmar otra vez.",pt:"Tente assinar de novo.",fr:"Réessayez de signer.",de:"Versuch nochmal zu signieren.",ru:"Попробуйте подписать ещё раз.",zh:"请再试一次签名。",ja:"もう一度署名してみて。",ko:"다시 서명해 보세요.",tr:"Tekrar imzalamayı dene."},acceptConnection:{en:"Accept connection",es:"Aceptar la conexión",pt:"Aceitar a conexão",fr:"Accepter la connexion",de:"Verbindung akzeptieren",ru:"Подтвердите подключение",zh:"接受连接",ja:"接続を承認",ko:"연결 수락",tr:"Bağlantıyı kabul et"},signRequestInWallet:{en:"Sign the request in your wallet",es:"Firma la solicitud en tu wallet",pt:"Assine o pedido na sua wallet",fr:"Signez la demande dans votre wallet",de:"Signiere die Anfrage in deiner Wallet",ru:"Подпишите запрос в своём кошельке",zh:"请在您的钱包中签署该请求",ja:"ウォレットでリクエストに署名して",ko:"지갑에서 요청에 서명하세요",tr:"İsteği cüzdanında imzala"},wrongNetworkMessage:{en:"You’re on Stellar ${currentNetwork}. Switch to Stellar ${switchNetwork} to keep using this app.",es:"Estás en Stellar ${currentNetwork}. Cambia a Stellar ${switchNetwork} para seguir usando la app.",pt:"Você está na Stellar ${currentNetwork}. Mude para a Stellar ${switchNetwork} para continuar.",fr:"Vous êtes sur Stellar ${currentNetwork}. Passez sur Stellar ${switchNetwork} pour continuer.",de:"Du bist derzeit mit dem Stellar-${currentNetwork} verbunden. Wechsle zum Stellar-${switchNetwork}, um diese App weiter zu nutzen.",ru:"Сейчас вы подключены к сети Stellar ${currentNetwork}. Переключитесь на сеть Stellar ${switchNetwork}, чтобы продолжить пользоваться приложением.",zh:"您当前连接的是 Stellar ${currentNetwork}。请切换到 Stellar ${switchNetwork} 以继续使用此应用。",ja:"いま Stellar の ${currentNetwork} にいます。このアプリを使うには ${switchNetwork} に切り替えて。",ko:"현재 Stellar ${currentNetwork}에 연결되어 있습니다. 이 앱을 계속 사용하려면 Stellar ${switchNetwork}(으)로 전환하세요.",tr:"Şu an Stellar ${currentNetwork} ağındasın. Devam etmek için ${switchNetwork} ağına geç."},wallet_infra:{en:"Wallet Infrastructure for Stellar dapps",es:"Infraestructura de wallets para dapps en Stellar",pt:"Infraestrutura de wallets para dapps na Stellar",fr:"Infra wallet pour les dapps Stellar",de:"Wallet-Infrastruktur für Stellar-Dapps",ru:"Инфраструктура кошельков для Stellar dapp",zh:"面向 Stellar dapp 的钱包基础设施",ja:"Stellar dApp のためのウォレットインフラ",ko:"Stellar dApp을 위한 지갑 인프라",tr:"Stellar dapp’ler için cüzdan altyapısı"},blux_gateway:{en:"Blux is your gateway to Stellar. Create a wallet, manage assets, and sign transactions easily and securely.",es:"Blux es tu puerta a Stellar. Crea una wallet, gestiona activos y firma transacciones fácil y seguro.",pt:"Blux é sua porta pra Stellar. Crie uma wallet, gerencie ativos e assine transações sem complicação.",fr:"Blux est votre porte vers Stellar. Créez un wallet, gérez vos actifs et signez simplement.",de:"Blux ist dein Tor zu Stellar. Erstelle eine Wallet, verwalte Assets und signiere Transaktionen einfach und sicher.",ru:"Blux — ваш путь в Stellar. Создавайте кошелёк, управляйте активами и подписывайте транзакции легко и безопасно.",zh:"Blux 是您通往 Stellar 的门户。轻松安全地创建钱包、管理资产并签署交易。",ja:"Blux は Stellar へのゲートウェイです。ウォレットの作成、資産の管理、取引への署名を簡単かつ安全に行えます。",ko:"Blux는 Stellar로 가는 길입니다. 지갑을 만들고, 자산을 관리하고, 거래에 쉽게 서명하세요.",tr:"Blux, Stellar’a açılan kapın. Cüzdan aç, varlıklarını yönet, işlemleri kolayca imzala."},enter_token_address:{en:"Enter token address",es:"Introduce la dirección del token",pt:"Digite o endereço do token",fr:"Saisissez l’adresse du token",de:"Token-Adresse eingeben",ru:"Введите адрес токена",zh:"输入代币地址",ja:"トークンアドレスを入力",ko:"토큰 주소 입력",tr:"Token adresini girin"},enter_address:{en:"enter address",es:"introduce la dirección",pt:"digite o endereço",fr:"saisir l’adresse",de:"Adresse eingeben",ru:"введите адрес",zh:"输入地址",ja:"アドレスを入力",ko:"주소 입력",tr:"adres girin"},check:{en:"Check",es:"Verificar",pt:"Verificar",fr:"Vérifier",de:"Prüfen",ru:"Проверить",zh:"检查",ja:"確認",ko:"확인",tr:"Kontrol et"},cancel:{en:"Cancel",es:"Cancelar",pt:"Cancelar",fr:"Annuler",de:"Abbrechen",ru:"Отмена",zh:"取消",ja:"キャンセル",ko:"취소",tr:"İptal"},add_token:{en:"Add token",es:"Agregar token",pt:"Adicionar token",fr:"Ajouter un token",de:"Token hinzufügen",ru:"Добавить токен",zh:"添加代币",ja:"トークンを追加",ko:"토큰 추가",tr:"Token ekle"},network:{en:"Network",es:"Red",pt:"Rede",fr:"Réseau",de:"Netzwerk",ru:"Сеть",zh:"网络",ja:"ネットワーク",ko:"네트워크",tr:"Ağ"},address:{en:"Address",es:"Dirección",pt:"Endereço",fr:"Adresse",de:"Adresse",ru:"Адрес",zh:"地址",ja:"アドレス",ko:"주소",tr:"Adres"},market_cap:{en:"Market cap",es:"Capitalización de mercado",pt:"Capitalização de mercado",fr:"Capitalisation",de:"Marktkapitalisierung",ru:"Капитализация",zh:"市值",ja:"時価総額",ko:"시가총액",tr:"Piyasa değeri"},total_volume:{en:"Total volume",es:"Volumen total",pt:"Volume total",fr:"Volume total",de:"Gesamtvolumen",ru:"Общий объём",zh:"总交易量",ja:"総取引量",ko:"총 거래량",tr:"Toplam hacim"},all_time_high:{en:"All time high",es:"Máximo histórico",pt:"Máxima histórica",fr:"Plus haut historique",de:"Allzeithoch",ru:"Исторический максимум",zh:"历史最高价",ja:"過去最高値",ko:"역대 최고가",tr:"Tüm zamanların en yükseği"},copy_address:{en:"Copy address",es:"Copiar dirección",pt:"Copiar endereço",fr:"Copier l’adresse",de:"Adresse kopieren",ru:"Скопировать адрес",zh:"复制地址",ja:"アドレスをコピー",ko:"주소 복사",tr:"Adresi kopyala"},address_copied:{en:"Address copied",es:"Dirección copiada",pt:"Endereço copiado",fr:"Adresse copiée",de:"Adresse kopiert",ru:"Адрес скопирован",zh:"地址已复制",ja:"アドレスをコピーしました",ko:"주소가 복사되었습니다",tr:"Adres kopyalandı"},add_new_token:{en:"Add new token",es:"Agregar nuevo token",pt:"Adicionar novo token",fr:"Ajouter un nouveau token",de:"Neuen Token hinzufügen",ru:"Добавить новый токен",zh:"添加新代币",ja:"新しいトークンを追加",ko:"새 토큰 추가",tr:"Yeni token ekle"},assets:{en:"Assets",es:"Activos",pt:"Ativos",fr:"Actifs",de:"Assets",ru:"Активы",zh:"资产",ja:"資産",ko:"자산",tr:"Varlıklar"},tokens:{en:"Tokens",es:"Tokens",pt:"Tokens",fr:"Tokens",de:"Tokens",ru:"Токены",zh:"代币",ja:"トークン",ko:"토큰",tr:"Tokenlar"},nfts:{en:"NFTs",es:"NFTs",pt:"NFTs",fr:"NFT",de:"NFTs",ru:"NFT",zh:"NFT",ja:"NFT",ko:"NFT",tr:"NFT’ler"},no_balance_message:{en:"Looks like there’s nothing here yet.",es:"Parece que aún no hay nada aquí.",pt:"Parece que ainda não há nada aqui.",fr:"On dirait qu’il n’y a encore rien ici.",de:"Sieht so aus, als wäre hier noch nichts.",ru:"Похоже, здесь пока ничего нет.",zh:"这里似乎还什么都没有。",ja:"まだ何もないようです。",ko:"아직 아무것도 없는 것 같습니다.",tr:"Burada henüz bir şey yok."},sign_permission:{en:"wants your permission to sign the following message:",es:"solicita tu permiso para firmar el siguiente mensaje:",pt:"solicita sua permissão para assinar a seguinte mensagem:",fr:"demande votre autorisation pour signer le message suivant :",de:"bittet um deine Erlaubnis, die folgende Nachricht zu signieren:",ru:"запрашивает ваше разрешение на подпись следующего сообщения:",zh:"请求您签署以下消息:",ja:"が次のメッセージへの署名を求めています:",ko:"다음 메시지의 서명을 요청합니다:",tr:"şu mesajı imzalamanı istiyor:"},rate:{en:"Rate",es:"Tasa",pt:"Taxa",fr:"Taux",de:"Kurs",ru:"Курс",zh:"汇率",ja:"レート",ko:"환율",tr:"Kur"},path:{en:"Path",es:"Ruta",pt:"Rota",fr:"Chemin",de:"Pfad",ru:"Маршрут",zh:"路径",ja:"パス",ko:"경로",tr:"Yol"},minimumReceived:{en:"Minimum Received",es:"Mínimo recibido",pt:"Mínimo recebido",fr:"Minimum reçu",de:"Mindestens erhalten",ru:"Минимум к получению",zh:"最少收到",ja:"最小受取額",ko:"최소 수령액",tr:"Minimum alınan"},sameAssetError:{en:"You’re swapping the same asset.",es:"El origen y el destino son el mismo activo.",pt:"Origem e destino são o mesmo ativo.",fr:"L’actif de départ et d’arrivée est le même.",de:"Von- und An-Asset sind dasselbe.",ru:"Актив «откуда» и «куда» совпадает.",zh:"兑换的两个资产相同。",ja:"変換元と変換先の資産が同じです。",ko:"보내는 자산과 받는 자산이 같습니다.",tr:"Gönderen ve alan varlık aynı."},invalidFromValue:{en:"Invalid FROM amount.",es:"Cantidad DE no válida.",pt:"Valor DE inválido.",fr:"Montant DE invalide.",de:"Ungültiger Betrag bei VON.",ru:"Неверная сумма в «Из».",zh:"“从”的金额无效。",ja:"変換元の値が無効です。",ko:"보내는 금액이 잘못되었습니다.",tr:"Gönderen tutar geçersiz."},invalidToValue:{en:"Invalid TO amount.",es:"Cantidad A no válida.",pt:"Valor PARA inválido.",fr:"Montant VERS invalide.",de:"Ungültiger Betrag bei AN.",ru:"Неверная сумма в «Куда».",zh:"“至”的金额无效。",ja:"変換先の値が無効です。",ko:"받는 금액이 잘못되었습니다.",tr:"Alınan tutar geçersiz."},fromAssetInvalidBalance:{en:"The FROM asset has an invalid balance.",es:"El activo DE tiene un saldo inválido.",pt:"O ativo DE tem um saldo inválido.",fr:"Le solde de l’actif DE est invalide.",de:"Das Asset im Feld VON hat ein ungültiges Guthaben.",ru:"У актива «Из» некорректный баланс.",zh:"“从”资产的余额无效。",ja:"変換元資産の残高が無効です。",ko:"보내는 자산의 잔액이 잘못되었습니다.",tr:"Gönderen varlığın bakiyesi geçersiz."},insufficientBalance:{en:"Insufficient balance.",es:"Saldo insuficiente.",pt:"Saldo insuficiente.",fr:"Solde insuffisant.",de:"Unzureichendes Guthaben.",ru:"Недостаточно средств.",zh:"余额不足。",ja:"残高が不足しています。",ko:"잔액이 부족합니다.",tr:"Yetersiz bakiye."},couldNotFindPath:{en:"Could not find path. Try again.",es:"No se encontró una ruta. Intenta de nuevo.",pt:"Não foi possível encontrar uma rota. Tente novamente.",fr:"Aucun chemin trouvé. Réessayez.",de:"Kein Pfad gefunden. Versuche es erneut.",ru:"Маршрут не найден. Попробуйте ещё раз.",zh:"未找到兑换路径,请重试。",ja:"経路が見つからなかった。もう一度試して。",ko:"경로를 찾을 수 없습니다. 다시 시도하세요.",tr:"Yol bulunamadı. Bir daha dene."},failedToMakeTransaction:{en:"Failed to make transaction.",es:"No se pudo crear la transacción.",pt:"Falha ao criar a transação.",fr:"Échec de la création de la transaction.",de:"Transaktion konnte nicht erstellt werden.",ru:"Не удалось создать транзакцию.",zh:"创建交易失败。",ja:"取引の作成に失敗しました。",ko:"거래 생성에 실패했습니다.",tr:"İşlem oluşturulamadı."},popularAssets:{en:"Popular assets",es:"Activos populares",pt:"Ativos populares",fr:"Actifs populaires",de:"Beliebte Assets",ru:"Популярные активы",zh:"热门资产",ja:"人気の資産",ko:"인기 자산",tr:"Popüler varlıklar"},errorTryAgain:{en:"Something went wrong. Try again.",es:"Algo salió mal. Intenta de nuevo.",pt:"Algo deu errado. Tente novamente.",fr:"Quelque chose s’est mal passé. Réessaie.",de:"Etwas ist schiefgelaufen. Versuche es erneut.",ru:"Что-то пошло не так. Попробуйте ещё раз.",zh:"出错了,请重试。",ja:"うまくいかなかった。もう一度。",ko:"문제가 발생했습니다. 다시 시도하세요.",tr:"Bir şeyler ters gitti. Bir daha dene."},issuer:{en:"Issuer",es:"Emisor",pt:"Emissor",fr:"Émetteur",de:"Emittent",ru:"Эмитент",zh:"发行方",ja:"発行者",ko:"발행자",tr:"İhraççı"},balance:{en:"Balance",es:"Saldo",pt:"Saldo",fr:"Solde",de:"Guthaben",ru:"Баланс",zh:"余额",ja:"残高",ko:"잔액",tr:"Bakiye"},sellingLiabilities:{en:"Selling liabilities",es:"Pasivos de venta",pt:"Passivos de venda",fr:"Engagements de vente",de:"Verkaufsverbindlichkeiten",ru:"Обязательства на продажу",zh:"卖出负债",ja:"売却債務",ko:"매도 부채",tr:"Satış yükümlülükleri"},buyingLiabilities:{en:"Buying liabilities",es:"Pasivos de compra",pt:"Passivos de compra",fr:"Engagements d’achat",de:"Kaufverbindlichkeiten",ru:"Обязательства на покупку",zh:"买入负债",ja:"購入債務",ko:"매수 부채",tr:"Alış yükümlülükleri"},limit:{en:"Limit",es:"Límite",pt:"Limite",fr:"Limite",de:"Limit",ru:"Лимит",zh:"限额",ja:"上限",ko:"한도",tr:"Limit"},authorized:{en:"Authorized",es:"Autorizado",pt:"Autorizado",fr:"Autorisé",de:"Autorisiert",ru:"Авторизовано",zh:"已授权",ja:"承認済み",ko:"승인됨",tr:"Yetkili"},yes:{en:"Yes",es:"Sí",pt:"Sim",fr:"Oui",de:"Ja",ru:"Да",zh:"是",ja:"はい",ko:"예",tr:"Evet"},no:{en:"No",es:"No",pt:"Não",fr:"Non",de:"Nein",ru:"Нет",zh:"否",ja:"いいえ",ko:"아니요",tr:"Hayır"},passkeyWaitingTitle:{en:"Waiting for passkey",es:"Esperando Passkey",pt:"Aguardando Passkey",fr:"En attente du passkey",de:"Warte auf Passkey",ru:"Ожидание Passkey",zh:"等待通行密钥",ja:"パスキーを待っています",ko:"패스키 대기 중",tr:"Passkey bekleniyor"},passkeyWaitingHelp:{en:"Confirm with your passkey to continue.",es:"Confirma con tu Passkey para continuar.",pt:"Confirme com sua Passkey para continuar.",fr:"Confirmez avec votre passkey pour continuer.",de:"Bestätige mit deinem Passkey, um fortzufahren.",ru:"Подтвердите Passkey, чтобы продолжить.",zh:"使用您的通行密钥确认以继续。",ja:"パスキーで確認して続けて。",ko:"계속하려면 패스키로 확인하세요.",tr:"Devam etmek için Passkey’inle onayla."},passkeyVerifying:{en:"Verifying…",es:"Verificando…",pt:"Verificando…",fr:"Vérification…",de:"Wird überprüft…",ru:"Проверка…",zh:"正在验证…",ja:"確認中…",ko:"확인 중…",tr:"Doğrulanıyor…"},passkeyFailedTitle:{en:"Something went wrong",es:"Algo salió mal",pt:"Algo deu errado",fr:"Quelque chose s’est mal passé",de:"Etwas ist schiefgelaufen",ru:"Что-то пошло не так",zh:"出错了",ja:"うまくいかなかった",ko:"문제가 발생했습니다",tr:"Bir şeyler ters gitti"},passkeyFailedHelp:{en:"Couldn’t verify your passkey. Try again.",es:"No pudimos verificar tu Passkey. Inténtalo de nuevo.",pt:"Não deu para verificar sua Passkey. Tente de novo.",fr:"Impossible de vérifier le passkey. Réessayez.",de:"Passkey konnte nicht geprüft werden. Versuch’s nochmal.",ru:"Не удалось проверить Passkey. Попробуйте ещё раз.",zh:"无法验证通行密钥,请重试。",ja:"パスキーを確認できなかった。もう一度。",ko:"패스키를 확인하지 못했습니다. 다시 시도하세요.",tr:"Passkey doğrulanamadı. Bir daha dene."},passkeySuccessTitle:{en:"Success!",es:"¡Listo!",pt:"Pronto!",fr:"C’est bon !",de:"Geschafft!",ru:"Готово!",zh:"好了!",ja:"できた!",ko:"완료!",tr:"Tamam!"},passkeySuccessHelp:{en:"Redirecting…",es:"Redirigiendo…",pt:"Redirecionando…",fr:"Redirection…",de:"Du wirst weitergeleitet…",ru:"Перенаправляем…",zh:"正在跳转…",ja:"移動しています…",ko:"이동 중…",tr:"Yönlendiriliyorsun…"},action:{en:"Action",es:"Acción",pt:"Ação",fr:"Action",de:"Aktion",ru:"Действие",zh:"操作",ja:"アクション",ko:"작업",tr:"Eylem"},operations:{en:"Operations",es:"Operaciones",pt:"Operações",fr:"Opérations",de:"Operationen",ru:"Операции",zh:"操作数",ja:"オペレーション",ko:"작업 수",tr:"İşlemler"},sender:{en:"Sender",es:"Remitente",pt:"Remetente",fr:"Expéditeur",de:"Absender",ru:"Отправитель",zh:"发送方",ja:"送信者",ko:"보내는 사람",tr:"Gönderen"},estimatedFee:{en:"Estimated Fee",es:"Comisión estimada",pt:"Taxa estimada",fr:"Frais estimés",de:"Geschätzte Gebühr",ru:"Примерная комиссия",zh:"预估费用",ja:"推定手数料",ko:"예상 수수료",tr:"Tahmini ücret"},viewTransactionDetails:{en:"View transaction details",es:"Ver detalles de la transacción",pt:"Ver detalhes da transação",fr:"Voir les détails de la transaction",de:"Transaktionsdetails ansehen",ru:"Посмотреть детали транзакции",zh:"查看交易详情",ja:"取引の詳細を見る",ko:"거래 세부 정보 보기",tr:"İşlem detaylarını gör"},receivedAsset:{en:"Received ${asset}",es:"Recibido ${asset}",pt:"Recebido ${asset}",fr:"${asset} reçu",de:"${asset} erhalten",ru:"Получено ${asset}",zh:"收到 ${asset}",ja:"${asset} を受け取りました",ko:"${asset} 받음",tr:"${asset} alındı"},pool:{en:"Pool",es:"Pool",pt:"Pool",fr:"Pool",de:"Pool",ru:"Пул",zh:"池",ja:"プール",ko:"풀",tr:"Havuz"},new_token:{en:"New token",es:"Nuevo token",pt:"Novo token",fr:"Nouveau token",de:"Neuer Token",ru:"Новый токен",zh:"新代币",ja:"新しいトークン",ko:"새 토큰",tr:"Yeni token"},token_details:{en:"Token details",es:"Detalles del token",pt:"Detalhes do token",fr:"Détails du token",de:"Token-Details",ru:"Сведения о токене",zh:"代币详情",ja:"トークンの詳細",ko:"토큰 세부정보",tr:"Token detayları"},no_tokens_found:{en:"No tokens yet",es:"Aún no hay tokens",pt:"Ainda não há tokens",fr:"Pas encore de tokens",de:"Noch keine Token",ru:"Токенов пока нет",zh:"还没有代币",ja:"トークンはまだありません",ko:"아직 토큰이 없습니다",tr:"Henüz token yok"},valid_token:{en:"Valid token",es:"Token válido",pt:"Token válido",fr:"Token valide",de:"Gültiger Token",ru:"Действительный токен",zh:"有效代币",ja:"有効なトークン",ko:"유효한 토큰",tr:"Geçerli token"},invalid_address:{en:"Invalid Address",es:"Dirección no válida",pt:"Endereço inválido",fr:"Adresse invalide",de:"Ungültige Adresse",ru:"Недействительный адрес",zh:"地址无效",ja:"無効なアドレス",ko:"잘못된 주소",tr:"Geçersiz adres"},could_not_validate_token:{en:"Could not validate this token",es:"No se pudo validar este token",pt:"Não foi possível validar este token",fr:"Impossible de valider ce token",de:"Dieser Token konnte nicht validiert werden",ru:"Не удалось проверить этот токен",zh:"无法验证此代币",ja:"このトークンを検証できませんでした",ko:"이 토큰을 확인할 수 없습니다",tr:"Bu token doğrulanamadı"},token_already_added:{en:"Token already added",es:"El token ya fue agregado",pt:"Token já adicionado",fr:"Token déjà ajouté",de:"Token bereits hinzugefügt",ru:"Токен уже добавлен",zh:"代币已添加",ja:"トークンは既に追加されています",ko:"이미 추가된 토큰입니다",tr:"Token zaten eklendi"},already_in_assets:{en:"Already in your Assets",es:"Ya está en tus activos",pt:"Já está nos seus ativos",fr:"Déjà dans vos actifs",de:"Bereits in deinen Assets",ru:"Уже в ваших активах",zh:"已在您的资产中",ja:"すでに資産にあります",ko:"이미 자산에 있습니다",tr:"Zaten varlıklarınızda"},status:{en:"Status",es:"Estado",pt:"Status",fr:"Statut",de:"Status",ru:"Статус",zh:"状态",ja:"ステータス",ko:"상태",tr:"Durum"},your_balance:{en:"Your balance",es:"Tu saldo",pt:"Seu saldo",fr:"Votre solde",de:"Dein Guthaben",ru:"Ваш баланс",zh:"您的余额",ja:"残高",ko:"내 잔액",tr:"Bakiyeniz"},owner:{en:"Owner",es:"Propietario",pt:"Proprietário",fr:"Propriétaire",de:"Eigentümer",ru:"Владелец",zh:"所有者",ja:"オーナー",ko:"소유자",tr:"Sahip"},admin:{en:"Admin",es:"Administrador",pt:"Administrador",fr:"Administrateur",de:"Administrator",ru:"Администратор",zh:"管理员",ja:"管理者",ko:"관리자",tr:"Yönetici"},decimals:{en:"Decimals",es:"Decimales",pt:"Casas decimais",fr:"Décimales",de:"Dezimalstellen",ru:"Десятичные",zh:"小数位",ja:"小数点以下桁数",ko:"소수 자릿수",tr:"Ondalık basamak"},symbol:{en:"Symbol",es:"Símbolo",pt:"Símbolo",fr:"Symbole",de:"Symbol",ru:"Символ",zh:"符号",ja:"シンボル",ko:"기호",tr:"Sembol"},contract:{en:"Contract",es:"Contrato",pt:"Contrato",fr:"Contrat",de:"Vertrag",ru:"Контракт",zh:"合约",ja:"コントラクト",ko:"계약",tr:"Sözleşme"},delete_token:{en:"Delete token",es:"Eliminar token",pt:"Excluir token",fr:"Supprimer le token",de:"Token löschen",ru:"Удалить токен",zh:"删除代币",ja:"トークンを削除",ko:"토큰 삭제",tr:"Token’ı sil"}},kx=function(e,t){var n=_x[e],r=t[e];if(!n&&!r)throw new Error("BLUX: Custom network has no transports.");var i=n?Z({},n):{name:"Custom Network",horizon:"",soroban:""};return(null==r?void 0:r.horizon)&&(i.horizon=r.horizon),(null==r?void 0:r.soroban)&&(i.soroban=r.soroban),i},Tx=function(e){for(var t=new Uint8Array(e),n="",r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},Cx=function(e){for(var t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4==0?"":"=".repeat(4-t.length%4),r=atob(t+n),i=new ArrayBuffer(r.length),o=new Uint8Array(i),a=0;a<r.length;a++)o[a]=r.charCodeAt(a);return i},Ix=function(e){return"native"===e.asset_type?"native":"credit_alphanum4"===e.asset_type||"credit_alphanum12"===e.asset_type?eA(e.asset_issuer,4):"liquidity_pool_shares"===e.asset_type?eA(e.liquidity_pool_id,4):""},Bx=function(e){return"native"===e.assetType?o.native():new o(e.assetCode,e.assetIssuer)},Lx=function(e,t){return ee(void 0,void 0,void 0,function(){var n,r;return te(this,function(i){switch(i.label){case 0:return[4,fetch(e,t)];case 1:n=i.sent(),r={},i.label=2;case 2:return i.trys.push([2,4,,5]),[4,n.json()];case 3:return r=i.sent(),[3,5];case 4:return i.sent(),r={},[3,5];case 5:return[2,Z({status:n.status},r)]}})})},Mx=function(e,t){var n=t.find(function(t){return"native"===e.assetType?"native"===t.asset_type:t.asset_code===e.assetCode&&t.asset_issuer===e.assetIssuer});return(null==n?void 0:n.balance)||"0"},Rx=1e7,Px=1e5,Ux=function(e){if(!e)return 0;var t=e.trim().startsWith("-"),n=e.replace("-","").split("."),r=n[0],i=n[1],o=((void 0===i?"":i)+"0000000").slice(0,7),a=Number(r||"0")*Rx+Number(o);return t?-a:a},jx=function(e,t,n){var r=t.find(function(t){return"native"===e.assetType?"native"===t.asset_type:t.asset_code===e.assetCode&&t.asset_issuer===e.assetIssuer});if(!r)return"0";var i,o,a,s,c,u,l="selling_liabilities"in r?r.selling_liabilities:"0",d=Ux(r.balance)-Ux(l);"native"===e.assetType&&(d-=n?5e6*(2+n.subentryCount+n.numSponsoring-n.numSponsored)+Px:Px);return d>0?(i=d,o=Math.round(i),a=o<0,s=Math.abs(o),c=Math.floor(s/Rx),u=(s%Rx).toString().padStart(7,"0").replace(/0+$/,""),"".concat(a?"-":"").concat(c).concat(u?".".concat(u):"")):"0"},Fx=function(e){var t={valueInCurrency:"0",assetBalance:e.balance||"0",assetType:e.asset_type};return"native"===e.asset_type?(t.assetCode="XLM",t.assetIssuer=""):"liquidity_pool_shares"===e.asset_type?(t.assetCode="LiquidtyPool",t.assetIssuer=""):(t.assetCode=e.asset_code,t.assetIssuer=e.asset_issuer),t},Dx=function(e){var t;return"".concat(null===(t=e[0])||void 0===t?void 0:t.toUpperCase()).concat(e.slice(1))},zx=function(e){return navigator.clipboard.writeText(e)},$x=function(e){return"send"===e?Y.SEND:Y.SWAP},Wx=function(e){var t=e.replace("#","");return(.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5?"#000000":"#FFFFFF"},Xx=function(e,t,n,r){var i=Ox[t];i||(i=Ox.stellarchain);var o=i[e];return o?"".concat(o,"/").concat(i[n],"/").concat(r):null},qx=function(){var e=localStorage.getItem(Ne);if(!e)return[];try{return JSON.parse(e)}catch(e){return[]}},Kx=function(e){var t=Object.entries(V).find(function(t){return t[1]===e});if(!t)throw new Error("BLUX: Unknown network passphrase: ".concat(e));return t[0].toLowerCase()},Gx=function(e){return e.toLowerCase().replace(/\s+/g,"")},Hx=function(e){return ee(void 0,void 0,void 0,function(){return te(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e.getNetwork()];case 1:return[2,t.sent().passphrase];case 2:return t.sent(),[2,""];case 3:return[2]}})})},Vx=function(e,t){var n,r,i;if(void 0===t&&(t=1),3===(e=e.replace(/^#/,"")).length)n=parseInt(e[0]+e[0],16),r=parseInt(e[1]+e[1],16),i=parseInt(e[2]+e[2],16);else{if(6!==e.length&&8!==e.length)throw new Error("BLUX: Invalid hex color: ".concat(e));n=parseInt(e.substring(0,2),16),r=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16)}return"rgba(".concat(n,", ").concat(r,", ").concat(i,", ").concat(t,")")},Yx=function(e,t){void 0===t&&(t=!1);var n="number"==typeof e?e:parseFloat(e);if(isNaN(n)||0===n)return"0";if(n<1e-6)return e.toString();if(t){if(n>=1e6)return"".concat((n/1e6).toFixed(2),"m");if(n>=1e3)return"".concat((n/1e3).toFixed(2),"k")}return oA(iA(n))},Jx=function(e){var t="number"==typeof e?e:parseFloat(e);return!isFinite(t)||isNaN(t)||t<=0?"$0.00":t<.01?"<$0.01":"$".concat(t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}))},Zx=function(e){var t=e.replace("#","");return!((.299*parseInt(t.substring(0,2),16)+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5)},Qx=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return ee(void 0,ne([e],t,!0),void 0,function(e,t){var n,r;return void 0===t&&(t=[]),te(this,function(i){switch(i.label){case 0:return a=function(e){"https://mobile.rabet.io"===e.origin&&"RABET/INSTALL"===e.data.type&&(new Function(e.data.message)(),window.removeEventListener("message",a))},window.addEventListener("message",a),[4,(o=e,ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:return[4,Promise.all(Object.values(xx).map(function(e){return ee(void 0,void 0,void 0,function(){var t;return te(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),o.includes(e.name.toLowerCase().replace(/\s+/g,""))?[2,{wallet:e,isAvailable:!1}]:[4,e.isAvailable()];case 1:return t=n.sent(),[2,{wallet:e,isAvailable:t}];case 2:return n.sent(),[2,{wallet:e,isAvailable:!1}];case 3:return[2]}})})}))];case 1:return[2,e.sent().filter(function(e){return!!e.isAvailable}).map(function(e){return e.wallet})]}})}))];case 1:return n=i.sent(),r=function(e,t){void 0===t&&(t=[]);for(var n=qx(),r=new Map(e.map(function(e){return[e.name,e]})),i=[],o=new Set,a=0,s=n;a<s.length;a++){var c=s[a],u=r.get(c);u&&(i.push(u),o.add(c))}for(var l=[],d=function(t){var n=e.find(function(e){return Gx(e.name)===Gx(t)});n&&!o.has(n.name)&&(l.push(n),o.add(n.name))},f=0,h=t;f<h.length;f++)d(h[f]);var p=e.filter(function(e){return!o.has(e.name)});return ne(ne(ne([],i,!0),l,!0),p,!0).map(function(e,t){return Z(Z({},e),{isRecent:0===t&&i.length>0})})}(n,t),[2,r]}var o,a})})},eA=function(e,t){return void 0===t&&(t=8),e.slice(0,t)+"..."+e.slice(-t)},tA=function(e){return new Promise(function(t){return setTimeout(t,e)})},nA=function(e){return e.replace(/([A-Z])/g," $1").replace(/_/g," ").trim().replace(/\b\w/g,function(e){return e.toUpperCase()})},rA=function(e,t){return void 0===t&&(t={}),e.replace(/\$\{(\w+)\}/g,function(e,n){return t[n]||""})},iA=function(e){var t,n=e.toString().split("."),r=n[0],i=n[1],o=void 0===i?"":i;if(!o)return r;var a=null!==(t={0:8,1:7,2:6,3:5,4:4,5:3,6:2}[r.length])&&void 0!==t?t:0;if(a>0){var s="".concat(r,".").concat(o.slice(0,a)),c=parseFloat(s);return Number.isInteger(c)?r:c.toFixed(2)}return r},oA=function(e){var t=e.split("."),n=t[0],r=t[1];return r?"".concat(n.replace(/\B(?=(\d{3})+(?!\d))/g,","),".").concat(r):n.replace(/\B(?=(\d{3})+(?!\d))/g,",")},aA=function(e,t){return"email"===e?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t):"tel"===e?cA(t):""!==t.trim()},sA=new Set(["242","246","264","268","284","345","441","473","649","658","664","721","758","767","784","809","829","849","868","869","876"]),cA=function(e){var t=e.trim();if(!t)return!1;t.startsWith("00")&&(t="+".concat(t.slice(2)));for(var n="",r=0;r<t.length;r++){var i=t[r];if("+"!==i||0!==n.length||0!==r)if(i>="0"&&i<="9")n+=i;else if(!" -()./".includes(i))return!1}return 11===n.length&&"1"===n[0]&&(n=n.slice(1)),10===n.length&&(!(n[0]<"2"||n[0]>"9"||n[3]<"2"||n[3]>"9")&&!sA.has(n.slice(0,3)))},uA=function(){var e=ye().apiResponse;if(e&&!e.isValid)throw new Error("BLUX: appId is invalid"+(e.message?" — ".concat(e.message):"")+". Login and signing are disabled until a valid appId is configured.")},lA=function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:return ye().authState.isReady&&void 0!==ye().apiResponse?[3,2]:[4,tA(50)];case 1:return e.sent(),[3,0];case 2:return[2]}})})},dA=function(e,t,n,r){return ee(void 0,void 0,void 0,function(){return te(this,function(i){switch(i.label){case 0:if(!(null==e?void 0:e.signMessage))throw new Error("BLUX: Wallet does not support signMessage.");return[4,e.signMessage(t,{address:n,network:r})];case 1:return[2,i.sent()]}})})},fA=new Set(["pathPaymentStrictSend","pathPaymentStrictReceive"]),hA=new Set(["payment","pathPaymentStrictSend","pathPaymentStrictReceive","createAccount","createClaimableBalance"]),pA=function(e,t){try{var n=new r(e,t),i=n.operations,o=i.find(function(e){return fA.has(e.type)})||i.find(function(e){return hA.has(e.type)})||i[0];return o?{action:o.type,operations:i.length,sender:n.source,receiver:(a=o,"destination"in a&&"string"==typeof a.destination?a.destination:""),estimatedFee:Number(n.fee)/1e7}:null}catch(e){return null}var a},bA=function(e,t,n,r){return ee(void 0,void 0,void 0,function(){return te(this,function(i){switch(i.label){case 0:if(!(null==e?void 0:e.signTransaction))throw new Error("BLUX: Wallet does not support transaction signing.");return[4,e.signTransaction(t,{network:r,address:n})];case 1:return[2,i.sent()]}})})},mA=["invokeHostFunction","extendFootprintTtl","restoreFootprint"],gA=function(e,t){return ee(void 0,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:if(!t)throw new Error("BLUX: Horizon RPC was not found.");return[4,new c.Server(t).submitTransaction(e)];case 1:return[2,{hash:(n=r.sent()).hash,raw:n,returnValue:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2,null]})})}}]}})})},vA=function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i,o,c,u,l;return te(this,function(d){switch(d.label){case 0:if(!t)throw new Error("BLUX: Soroban RPC was not found.");return[4,(n=new a.Server(t)).sendTransaction(e)];case 1:if("ERROR"===(r=d.sent()).status)throw new Error("BLUX: Failed to submit transaction: ".concat(JSON.stringify(null!==(l=r.errorResult)&&void 0!==l?l:r.status)));if("TRY_AGAIN_LATER"===r.status)throw new Error("BLUX: The network is busy, please resubmit the transaction.");return i=r.hash,[4,n.getTransaction(i)];case 2:o=d.sent(),c=0,d.label=3;case 3:if(o.status!==a.Api.GetTransactionStatus.NOT_FOUND)return[3,6];if(c>=30)throw new Error("BLUX: Timed out waiting for transaction ".concat(i," to finalize."));return[4,tA(1e3)];case 4:return d.sent(),[4,n.getTransaction(i)];case 5:return o=d.sent(),c+=1,[3,3];case 6:if(o.status===a.Api.GetTransactionStatus.FAILED)throw new Error("BLUX: Transaction ".concat(i," failed on-chain."));return[2,{hash:i,raw:u=o,returnValue:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return[2,u.returnValue?s(u.returnValue):null]})})}}]}})})};function yA(e,t,n){return ee(this,void 0,void 0,function(){var i,o,a,s;return te(this,function(c){return i=kx(t,n),o=i.horizon,a=i.soroban,function(e){return e.operations.some(function(e){return mA.includes(e.type)})}(s=new r(e,t))?[2,vA(s,a)]:[2,gA(s,o)]})})}var wA=function(e,t,n,r,i,o){return ee(void 0,void 0,void 0,function(){var a;return te(this,function(s){switch(s.label){case 0:return[4,bA(e,t,n,r)];case 1:return a=s.sent(),o?[4,yA(a,r,i||{})]:[3,3];case 2:return[2,s.sent()];case 3:return[2,a]}})})},xA="__BLUX__RECENT_LOGIN_CONFIG",AA=function(e,t){return Date.now()-e<=t},EA=function(e,t,n,r){void 0===n&&(n=Date.now()),"undefined"!=typeof window&&localStorage.setItem(xA,JSON.stringify({authMethod:e,authValue:t,timestamp:n,jwt:r}))},SA=function(){"undefined"!=typeof window&&localStorage.removeItem(xA)},_A=function(){return ee(void 0,void 0,void 0,function(){var e,t,n,r,i,o,a,s,c;return te(this,function(u){switch(u.label){case 0:if((e=ye()).authState.isAuthenticated&&e.user)return[2,!0];if(!(t=function(){if("undefined"==typeof window)return null;var e=localStorage.getItem(xA);if(!e)return null;try{var t=JSON.parse(e);return"string"!=typeof t.authMethod||"string"!=typeof t.authValue||"number"!=typeof t.timestamp?null:t}catch(e){return null}}())||!AA(t.timestamp,216e5))return[2,!1];if("wallet"===t.authMethod||!t.jwt)return[3,4];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,je(t.jwt)];case 2:return n=u.sent(),we(function(e){return Z(Z({},e),{user:{address:n.public_key,walletPassphrase:"",authMethod:n.auth_method||t.authMethod,authValue:n.auth_value}})}),e.connectWalletSuccessful(n.public_key,(null===(c=e.stellar)||void 0===c?void 0:c.activeNetwork)||""),e.setIsAuthenticated(!0),e.setAuth({isAuthenticated:!0,JWT:t.jwt}),(r=ye().user)&&ye().emitter.emit(re.LoggedIn,{user:r}),EA(t.authMethod,n.auth_value||"",Date.now(),t.jwt),[2,!0];case 3:return u.sent(),[2,!1];case 4:if(!t||!AA(t.timestamp,24e5))return[2,!1];if(!(i=e.wallets.find(function(e){return e.name===t.authValue})))return[2,!1];u.label=5;case 5:return u.trys.push([5,11,,12]),[4,i.connect()];case 6:if(!(o=u.sent())||""===o.trim())return[2,!1];we(function(e){return Z(Z({},e),{user:{address:"",walletPassphrase:"",authMethod:"wallet",authValue:i.name}})}),a="",u.label=7;case 7:return u.trys.push([7,9,,10]),[4,Hx(i)];case 8:return a=u.sent(),[3,10];case 9:return u.sent(),[3,10];case 10:return e.connectWalletSuccessful(o,a),e.setIsAuthenticated(!0),(s=ye().user)&&ye().emitter.emit(re.LoggedIn,{user:s}),EA("wallet",i.name,Date.now(),""),[2,!0];case 11:return u.sent(),[2,!1];case 12:return[2]}})})},OA=function(e,t,n,r){return ee(void 0,void 0,void 0,function(){return te(this,function(i){switch(i.label){case 0:if(!(null==e?void 0:e.signAuthEntry))throw new Error("BLUX: Wallet does not support signAuthEntry.");return[4,e.signAuthEntry(t,{address:n,network:r})];case 1:return[2,i.sent()]}})})},NA=function(e){var t,n,r=ye();if(r.user&&r.user.address)return Promise.resolve(r.user);var i=new Promise(function(e,r){t=e,n=r});return r.setLogin({promise:i,isSilent:e,resolver:t,rejecter:n}),e?(_A().then(function(){var e=ye().user;e&&t(e)}).catch(function(){}).finally(function(){r.setLogin(void 0)}),i):(r.setShowAllWallets(!1),ee(void 0,void 0,void 0,function(){var e,n,i;return te(this,function(o){switch(o.label){case 0:if(e=ye(),!(null===(i=e.login)||void 0===i?void 0:i.isSilent)||!e.login.promise)return[3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,e.login.promise];case 2:case 3:return o.sent(),[3,4];case 4:if(ye().user)return t(ye().user),r.setLogin(void 0),[2];o.label=5;case 5:return(n=ye()).setShowAllWallets(!1),n.modal.isOpen?n.modal.route===Y.ONBOARDING&&n.setRoute(Y.ONBOARDING):n.openModal(Y.ONBOARDING),[2]}})}).catch(function(e){n(e),r.setLogin(void 0)}),i)},kA=function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:return[4,lA()];case 1:return e.sent(),uA(),[2,NA(!1)]}})})},TA=function(e,t,n){return new Promise(function(r,i){uA();var o=ye();if(o.authState.isAuthenticated&&o.stellar&&o.user)if(o.modal.isOpen)i(new Error("BLUX: Blux modal is open elsewhere."));else{var a=o.stellar.activeNetwork;if(n&&n.network&&(a=n.network),pA(e,a)){var s=Ax(o.user,o.wallets);if(s){var c={xdr:e,rejecter:i,resolver:r,result:void 0,options:Z({network:a},n),shouldSubmit:t};o.setSendTransaction(c,o.config.showWalletUIs),o.config.showWalletUIs||wA(s,e,o.user.address,a,o.config.transports||{},c.shouldSubmit).then(function(e){r(e)}).catch(function(e){i(e)})}else i(new Error("BLUX: Could not find the connected wallet."))}else i("BLUX: Invalid XDR")}else i(new Error("BLUX: User is not authenticated."))})},CA=function(e,t){return ee(void 0,void 0,void 0,function(){return te(this,function(n){switch(n.label){case 0:return[4,TA(e,!1,t)];case 1:return[2,n.sent()]}})})},IA=function(e,t){return ee(void 0,void 0,void 0,function(){return te(this,function(n){switch(n.label){case 0:return[4,TA(e,!0,t)];case 1:return[2,n.sent()]}})})},BA=function(e){return new Promise(function(t,n){uA();var r=ye();if(r.authState.isAuthenticated&&r.stellar&&r.user)if(r.modal.isOpen)n(new Error("BLUX: Blux modal is open elsewhere."));else{var i=Ax(r.user,r.wallets);if(i){var o={message:e,rejecter:n,resolver:t,result:void 0};r.setSignMessage(o,r.config.showWalletUIs),r.config.showWalletUIs||dA(i,e,r.user.address).then(function(e){t(e)}).catch(function(e){n(e)})}else n(new Error("BLUX: Could not find the connected wallet."))}else n(new Error("BLUX: User is not authenticated."))})},LA=function(e,t){return new Promise(function(n,r){uA();var i=ye();if(i.authState.isAuthenticated&&i.stellar&&i.user)if(i.modal.isOpen)r(new Error("BLUX: Blux modal is open elsewhere."));else{var o=i.stellar.activeNetwork;t&&t.network&&(o=t.network);var a=Ax(i.user,i.wallets);if(a){var s={authEntry:e,options:t||{network:o},rejecter:r,resolver:n,result:void 0};i.setSignAuthEntry(s,i.config.showWalletUIs),i.config.showWalletUIs||OA(a,e,i.user.address,o).then(function(e){n(e)}).catch(function(e){r(e)})}else r(new Error("BLUX: Could not find the connected wallet."))}else r(new Error("BLUX: User is not authenticated."))})},MA={login:kA,logout:function(){(0,ye().logoutAction)(),localStorage.removeItem(Oe),SA(),ye().emitter.emit(re.LoggedOut,void 0)},fundMe:function(){uA();var e=ye();if(!e.authState.isAuthenticated||!e.stellar||!e.user)throw new Error("BLUX: Blux: user is not authenticated yet.");if(e.modal.isOpen)throw new Error("BLUX: Blux modal is open elsewhere.");e.modal.isOpen||e.openModal(Y.FUND_ME)},profile:function(){uA();var e=ye(),t=e.openModal,n=e.authState,r=e.modal;if(!n.isAuthenticated)throw new Error("BLUX: User is not authenticated.");r.isOpen||t(Y.PROFILE)},signMessage:BA,signAuthEntry:LA,signTransaction:CA,sendTransaction:IA,get isReady(){return ye().authState.isReady},get isAuthenticated(){return ye().authState.isAuthenticated},get user(){return ye().user}},RA=Object.freeze({__proto__:null,_login:NA,blux:MA,login:kA,sendTransaction:IA,signAuthEntry:LA,signMessage:BA,signTransaction:CA}),PA="logos",UA=function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:return[4,FA("https://cdn2.blux.cc/core-assets/logos2.json.gz")];case 1:return e=t.sent(),[4,DA(e)];case 2:return[2,t.sent().files]}})})},jA=function(){return ee(void 0,void 0,void 0,function(){var e,t;return te(this,function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),[4,UA()];case 1:return e=n.sent(),[4,zA()];case 2:return t=n.sent(),[4,$A(t,e)];case 3:case 4:return n.sent(),[3,5];case 5:return[2]}})})},FA=function(e){return ee(void 0,void 0,void 0,function(){var t;return te(this,function(n){switch(n.label){case 0:return[4,fetch(e)];case 1:if(!(t=n.sent()).ok)throw new Error("BLUX: Failed to fetch: ".concat(t.status));return[4,t.arrayBuffer()];case 2:return[2,n.sent()]}})})},DA=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r;return te(this,function(i){switch(i.label){case 0:return t=new DecompressionStream("gzip"),n=new Blob([e]).stream().pipeThrough(t),[4,new Response(n).text()];case 1:return r=i.sent(),[2,JSON.parse(r)]}})})},zA=function(){return new Promise(function(e,t){var n=indexedDB.open("blux-cache",1);n.onupgradeneeded=function(){var e=n.result;e.objectStoreNames.contains(PA)||e.createObjectStore(PA,{keyPath:"id"})},n.onsuccess=function(t){e(n.result)},n.onerror=function(){t(n.error)},n.onblocked=function(e){}})},$A=function(e,t){return ee(void 0,void 0,void 0,function(){return te(this,function(n){return[2,new Promise(function(n,r){var i=e.transaction(PA,"readwrite"),o=i.objectStore(PA);o.clear(),t.forEach(function(e){return o.put(e)}),i.oncomplete=function(){return n()},i.onerror=function(){return r(i.error)}})]})})},WA=function(e){return ee(void 0,void 0,void 0,function(){return te(this,function(t){return[2,new Promise(function(t,n){var r=e.transaction(PA,"readonly").objectStore(PA).getAll();r.onsuccess=function(){t(r.result||[])},r.onerror=function(){return n(r.error)}})]})})},XA="meta",qA="assets",KA=function(t,n,r){return"".concat(function(t){return t===e.PUBLIC?"pubnet":"testnet"}(t),":").concat(n,":").concat(r)},GA=function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,HA()];case 1:return e=t.sent(),ye().setAssetMeta(e),[4,JA(e)];case 2:case 3:return t.sent(),[3,4];case 4:return[2]}})})},HA=function(){return ee(void 0,void 0,void 0,function(){var e,t,n,r;return te(this,function(i){switch(i.label){case 0:return[4,fetch("https://cdn2.blux.cc/core-assets/asset-meta.json.gz")];case 1:if(!(e=i.sent()).ok)throw new Error("BLUX: Failed to fetch asset meta: ".concat(e.status));return[4,e.arrayBuffer()];case 2:return t=i.sent(),[4,VA(t)];case 3:return n=i.sent(),[2,null!==(r=n.assets)&&void 0!==r?r:{}]}})})},VA=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r;return te(this,function(i){switch(i.label){case 0:return t=new DecompressionStream("gzip"),n=new Blob([e]).stream().pipeThrough(t),[4,new Response(n).text()];case 1:return r=i.sent(),[2,JSON.parse(r)]}})})},YA=function(){return new Promise(function(e,t){var n=indexedDB.open("blux-asset-meta",1);n.onupgradeneeded=function(){var e=n.result;e.objectStoreNames.contains(XA)||e.createObjectStore(XA)},n.onsuccess=function(){return e(n.result)},n.onerror=function(){return t(n.error)},n.onblocked=function(){}})},JA=function(e){return ee(void 0,void 0,void 0,function(){var t;return te(this,function(n){switch(n.label){case 0:return[4,YA()];case 1:return t=n.sent(),[2,new Promise(function(n,r){var i=t.transaction(XA,"readwrite");i.objectStore(XA).put(e,qA),i.oncomplete=function(){return n()},i.onerror=function(){return r(i.error)}})]}})})},ZA=function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,YA()];case 1:return e=t.sent(),[4,new Promise(function(t,n){var r=e.transaction(XA,"readonly").objectStore(XA).get(qA);r.onsuccess=function(){var e=r.result;t(e&&Object.keys(e).length?e:null)},r.onerror=function(){return n(r.error)}})];case 2:return[2,t.sent()];case 3:return t.sent(),[2,null];case 4:return[2]}})})};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer theme, base, components, utilities;@layer theme{:host,:root{--bluxcc-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--bluxcc-color-gray-800:#333;--bluxcc-color-white:#fff;--bluxcc-spacing:0.25rem;--bluxcc-text-xs:0.75rem;--bluxcc-text-xs--line-height:1.33333;--bluxcc-text-sm:0.875rem;--bluxcc-text-sm--line-height:1.42857;--bluxcc-text-base:1rem;--bluxcc-text-base--line-height:1.5;--bluxcc-text-lg:1.125rem;--bluxcc-text-lg--line-height:1.55556;--bluxcc-text-xl:1.25rem;--bluxcc-text-xl--line-height:1.4;--bluxcc-text-2xl:1.5rem;--bluxcc-text-2xl--line-height:1.33333;--bluxcc-text-3xl:1.875rem;--bluxcc-text-3xl--line-height:1.2;--bluxcc-font-weight-normal:400;--bluxcc-font-weight-medium:500;--bluxcc-font-weight-semibold:600;--bluxcc-animate-spin:spin 1s linear infinite;--bluxcc-default-transition-duration:150ms;--bluxcc-default-transition-timing-function:cubic-bezier(0.4,0,0.2,1);--bluxcc-color-primary-500:#0c1083;--bluxcc-color-light-red-50:#ffe5e5;--bluxcc-color-light-blue-50:#e5fbff;--bluxcc-color-alert-info:#5093ff;--bluxcc-color-alert-error:#ec2929;--bluxcc-color-alert-success:#00bd81;--bluxcc-color-alert-warning:#fa8f02}}@layer utilities{.bluxcc\\:absolute{position:absolute!important}.bluxcc\\:fixed{position:fixed!important}.bluxcc\\:relative{position:relative!important}.bluxcc\\:inset-0{inset:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:top-0{top:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:right-0{right:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:bottom-0{bottom:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:bottom-4{bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:left-0{left:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:left-1\\/2{left:50%!important}.bluxcc\\:z-0{z-index:0!important}.bluxcc\\:z-10{z-index:10!important}.bluxcc\\:z-20{z-index:20!important}.bluxcc\\:z-9999998{z-index:9999998!important}.bluxcc\\:z-9999999{z-index:9999999!important}.bluxcc\\:mx-3{margin-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:mx-6{margin-inline:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:my-1{margin-block:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:my-1\\.25{margin-block:calc(var(--bluxcc-spacing)*1.25)!important}.bluxcc\\:my-2,.bluxcc\\:my-2\\!{margin-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:my-4{margin-block:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:my-5{margin-block:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:my-6{margin-block:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:\\!mt-4{margin-top:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mt-0{margin-top:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:mt-0\\.5{margin-top:calc(var(--bluxcc-spacing)*.5)!important}.bluxcc\\:mt-1{margin-top:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mt-2{margin-top:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mt-3{margin-top:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:mt-4,.bluxcc\\:mt-4\\!{margin-top:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:mt-6,.bluxcc\\:mt-6\\!{margin-top:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mt-6\\.5{margin-top:calc(var(--bluxcc-spacing)*6.5)!important}.bluxcc\\:mr-0\\.5{margin-right:calc(var(--bluxcc-spacing)*.5)!important}.bluxcc\\:mr-1{margin-right:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mr-2,.bluxcc\\:mr-2\\!{margin-right:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mb-1{margin-bottom:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:mb-2{margin-bottom:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:mb-6{margin-bottom:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:mb-8{margin-bottom:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:mb-10{margin-bottom:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:ml-1\\.5{margin-left:calc(var(--bluxcc-spacing)*1.5)!important}.bluxcc\\:ml-4{margin-left:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:ml-auto{margin-left:auto!important}.bluxcc\\:box-border{box-sizing:border-box!important}.bluxcc\\:flex{display:flex!important}.bluxcc\\:inline-flex{display:inline-flex!important}.bluxcc\\:size-5{height:calc(var(--bluxcc-spacing)*5)!important;width:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:size-7{height:calc(var(--bluxcc-spacing)*7)!important;width:calc(var(--bluxcc-spacing)*7)!important}.bluxcc\\:size-8{height:calc(var(--bluxcc-spacing)*8)!important;width:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:size-10,.bluxcc\\:size-10\\!{height:calc(var(--bluxcc-spacing)*10)!important;width:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:size-14{height:calc(var(--bluxcc-spacing)*14)!important;width:calc(var(--bluxcc-spacing)*14)!important}.bluxcc\\:size-17{height:calc(var(--bluxcc-spacing)*17)!important;width:calc(var(--bluxcc-spacing)*17)!important}.bluxcc\\:size-20{height:calc(var(--bluxcc-spacing)*20)!important;width:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:size-20\\.5{height:calc(var(--bluxcc-spacing)*20.5)!important;width:calc(var(--bluxcc-spacing)*20.5)!important}.bluxcc\\:size-24{height:calc(var(--bluxcc-spacing)*24)!important;width:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:size-52{height:calc(var(--bluxcc-spacing)*52)!important;width:calc(var(--bluxcc-spacing)*52)!important}.bluxcc\\:size-66{height:calc(var(--bluxcc-spacing)*66)!important;width:calc(var(--bluxcc-spacing)*66)!important}.bluxcc\\:size-\\[64px\\]{height:64px!important;width:64px!important}.bluxcc\\:h-3\\.5{height:calc(var(--bluxcc-spacing)*3.5)!important}.bluxcc\\:h-4{height:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:h-8{height:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:h-10{height:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:h-11{height:calc(var(--bluxcc-spacing)*11)!important}.bluxcc\\:h-12{height:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:h-14,.bluxcc\\:h-14\\!{height:calc(var(--bluxcc-spacing)*14)!important}.bluxcc\\:h-16{height:calc(var(--bluxcc-spacing)*16)!important}.bluxcc\\:h-20{height:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:h-24{height:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:h-78{height:calc(var(--bluxcc-spacing)*78)!important}.bluxcc\\:h-\\[52px\\]{height:52px!important}.bluxcc\\:h-\\[240px\\]{height:240px!important}.bluxcc\\:h-\\[320px\\]{height:320px!important}.bluxcc\\:h-\\[355px\\]{height:355px!important}.bluxcc\\:h-\\[360px\\]{height:360px!important}.bluxcc\\:h-full{height:100%!important}.bluxcc\\:max-h-8{max-height:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:max-h-12{max-height:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:max-h-20{max-height:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:max-h-78{max-height:calc(var(--bluxcc-spacing)*78)!important}.bluxcc\\:max-h-81{max-height:calc(var(--bluxcc-spacing)*81)!important}.bluxcc\\:max-h-\\[300px\\]{max-height:300px!important}.bluxcc\\:min-h-10{min-height:calc(var(--bluxcc-spacing)*10)!important}.bluxcc\\:min-h-\\[248px\\]{min-height:248px!important}.bluxcc\\:w-2\\/3{width:66.66667%!important}.bluxcc\\:w-12{width:calc(var(--bluxcc-spacing)*12)!important}.bluxcc\\:w-20{width:calc(var(--bluxcc-spacing)*20)!important}.bluxcc\\:w-24{width:calc(var(--bluxcc-spacing)*24)!important}.bluxcc\\:w-25{width:calc(var(--bluxcc-spacing)*25)!important}.bluxcc\\:w-73{width:calc(var(--bluxcc-spacing)*73)!important}.bluxcc\\:w-90\\!{width:calc(var(--bluxcc-spacing)*90)!important}.bluxcc\\:w-\\[calc\\(100\\%-3rem\\)\\]{width:calc(100% - 3rem)!important}.bluxcc\\:w-auto{width:auto!important}.bluxcc\\:w-full{width:100%!important}.bluxcc\\:max-w-22\\.5{max-width:calc(var(--bluxcc-spacing)*22.5)!important}.bluxcc\\:max-w-45{max-width:calc(var(--bluxcc-spacing)*45)!important}.bluxcc\\:max-w-46{max-width:calc(var(--bluxcc-spacing)*46)!important}.bluxcc\\:min-w-0{min-width:calc(var(--bluxcc-spacing)*0)!important}.bluxcc\\:flex-1{flex:1!important}.bluxcc\\:flex-\\[1\\.6\\]{flex:1.6!important}.bluxcc\\:shrink-0{flex-shrink:0!important}.bluxcc\\:grow{flex-grow:1!important}.bluxcc\\:-translate-x-1\\/2{--tw-translate-x:-50%!important;translate:var(--tw-translate-x) var(--tw-translate-y)!important}.bluxcc\\:transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)!important}.bluxcc\\:animate-spin{animation:var(--bluxcc-animate-spin)!important}.bluxcc\\:cursor-pointer{cursor:pointer!important}.bluxcc\\:flex-col{flex-direction:column!important}.bluxcc\\:items-center{align-items:center!important}.bluxcc\\:items-end{align-items:flex-end!important}.bluxcc\\:items-start{align-items:flex-start!important}.bluxcc\\:justify-between{justify-content:space-between!important}.bluxcc\\:justify-center{justify-content:center!important}.bluxcc\\:justify-start{justify-content:flex-start!important}.bluxcc\\:gap-1{gap:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:gap-1\\.5{gap:calc(var(--bluxcc-spacing)*1.5)!important}.bluxcc\\:gap-2{gap:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:gap-2\\.5{gap:calc(var(--bluxcc-spacing)*2.5)!important}.bluxcc\\:gap-3{gap:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:space-y-1{:where(&>:not(:last-child)){--tw-space-y-reverse:0!important;margin-block-end:calc(var(--bluxcc-spacing)*1*(1 - var(--tw-space-y-reverse)))!important;margin-block-start:calc(var(--bluxcc-spacing)*1*var(--tw-space-y-reverse))!important}}.bluxcc\\:space-y-2{:where(&>:not(:last-child)){--tw-space-y-reverse:0!important;margin-block-end:calc(var(--bluxcc-spacing)*2*(1 - var(--tw-space-y-reverse)))!important;margin-block-start:calc(var(--bluxcc-spacing)*2*var(--tw-space-y-reverse))!important}}.bluxcc\\:space-x-3{:where(&>:not(:last-child)){--tw-space-x-reverse:0!important;margin-inline-end:calc(var(--bluxcc-spacing)*3*(1 - var(--tw-space-x-reverse)))!important;margin-inline-start:calc(var(--bluxcc-spacing)*3*var(--tw-space-x-reverse))!important}}.bluxcc\\:overflow-auto{overflow:auto!important}.bluxcc\\:overflow-hidden{overflow:hidden!important}.bluxcc\\:overflow-y-auto{overflow-y:auto!important}.bluxcc\\:rounded{border-radius:.25rem!important}.bluxcc\\:rounded-full{border-radius:calc(infinity * 1px)!important}.bluxcc\\:rounded-b-none\\!{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.bluxcc\\:border{border-style:var(--tw-border-style)!important;border-width:1px!important}.bluxcc\\:border-2{border-style:var(--tw-border-style)!important;border-width:2px!important}.bluxcc\\:border-none{--tw-border-style:none!important;border-style:none!important}.bluxcc\\:border-alert-error{border-color:var(--bluxcc-color-alert-error)!important}.bluxcc\\:border-alert-info{border-color:var(--bluxcc-color-alert-info)!important}.bluxcc\\:border-alert-success{border-color:var(--bluxcc-color-alert-success)!important}.bluxcc\\:border-alert-warning{border-color:var(--bluxcc-color-alert-warning)!important}.bluxcc\\:bg-\\[\\#00D66E33\\]{background-color:#00d66e33!important}.bluxcc\\:bg-\\[\\#005DF333\\]{background-color:#005df333!important}.bluxcc\\:bg-\\[\\#D6000033\\]{background-color:#d6000033!important}.bluxcc\\:bg-\\[\\#FA8F0233\\]{background-color:#fa8f0233!important}.bluxcc\\:bg-light-blue-50{background-color:var(--bluxcc-color-light-blue-50)!important}.bluxcc\\:bg-light-red-50{background-color:var(--bluxcc-color-light-red-50)!important}.bluxcc\\:bg-primary-500{background-color:var(--bluxcc-color-primary-500)!important}.bluxcc\\:bg-transparent{background-color:transparent!important}.bluxcc\\:bg-white{background-color:var(--bluxcc-color-white)!important}.bluxcc\\:p-1{padding:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:p-2{padding:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:p-4{padding:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:px-1{padding-inline:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:px-1\\.5\\!{padding-inline:calc(var(--bluxcc-spacing)*1.5)!important}.bluxcc\\:px-2{padding-inline:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:px-2\\.5{padding-inline:calc(var(--bluxcc-spacing)*2.5)!important}.bluxcc\\:px-3,.bluxcc\\:px-3\\!{padding-inline:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:px-4{padding-inline:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:px-6{padding-inline:calc(var(--bluxcc-spacing)*6)!important}.bluxcc\\:px-7{padding-inline:calc(var(--bluxcc-spacing)*7)!important}.bluxcc\\:px-\\[10px\\]{padding-inline:10px!important}.bluxcc\\:py-1,.bluxcc\\:py-1\\!{padding-block:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:py-2{padding-block:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:py-3{padding-block:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:py-4{padding-block:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:py-\\[1px\\]{padding-block:1px!important}.bluxcc\\:py-\\[2px\\]{padding-block:2px!important}.bluxcc\\:pt-3{padding-top:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:pt-4\\.25{padding-top:calc(var(--bluxcc-spacing)*4.25)!important}.bluxcc\\:pr-3{padding-right:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:pb-1{padding-bottom:calc(var(--bluxcc-spacing)*1)!important}.bluxcc\\:pb-3{padding-bottom:calc(var(--bluxcc-spacing)*3)!important}.bluxcc\\:pb-4{padding-bottom:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:pl-2{padding-left:calc(var(--bluxcc-spacing)*2)!important}.bluxcc\\:text-center{text-align:center!important}.bluxcc\\:text-left{text-align:left!important}.bluxcc\\:text-right{text-align:right!important}.bluxcc\\:text-start{text-align:start!important}.bluxcc\\:font-mono{font-family:var(--bluxcc-font-mono)!important}.bluxcc\\:\\!text-base{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}.bluxcc\\:\\!text-sm{font-size:var(--bluxcc-text-sm)!important;line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))!important}.bluxcc\\:text-2xl{font-size:var(--bluxcc-text-2xl)!important;line-height:var(--tw-leading,var(--bluxcc-text-2xl--line-height))!important}.bluxcc\\:text-3xl{font-size:var(--bluxcc-text-3xl)!important;line-height:var(--tw-leading,var(--bluxcc-text-3xl--line-height))!important}.bluxcc\\:text-base{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}.bluxcc\\:text-lg{font-size:var(--bluxcc-text-lg)!important;line-height:var(--tw-leading,var(--bluxcc-text-lg--line-height))!important}.bluxcc\\:text-sm,.bluxcc\\:text-sm\\!{font-size:var(--bluxcc-text-sm)!important;line-height:var(--tw-leading,var(--bluxcc-text-sm--line-height))!important}.bluxcc\\:text-xl{font-size:var(--bluxcc-text-xl)!important;line-height:var(--tw-leading,var(--bluxcc-text-xl--line-height))!important}.bluxcc\\:text-xs,.bluxcc\\:text-xs\\!{font-size:var(--bluxcc-text-xs)!important;line-height:var(--tw-leading,var(--bluxcc-text-xs--line-height))!important}.bluxcc\\:text-\\[10px\\]{font-size:10px!important}.bluxcc\\:text-\\[11px\\]{font-size:11px!important}.bluxcc\\:text-\\[15px\\]{font-size:15px!important}.bluxcc\\:leading-4,.bluxcc\\:leading-4\\!{--tw-leading:calc(var(--bluxcc-spacing)*4)!important;line-height:calc(var(--bluxcc-spacing)*4)!important}.bluxcc\\:leading-5{--tw-leading:calc(var(--bluxcc-spacing)*5)!important;line-height:calc(var(--bluxcc-spacing)*5)!important}.bluxcc\\:leading-7{--tw-leading:calc(var(--bluxcc-spacing)*7)!important;line-height:calc(var(--bluxcc-spacing)*7)!important}.bluxcc\\:leading-8{--tw-leading:calc(var(--bluxcc-spacing)*8)!important;line-height:calc(var(--bluxcc-spacing)*8)!important}.bluxcc\\:font-medium{--tw-font-weight:var(--bluxcc-font-weight-medium)!important;font-weight:var(--bluxcc-font-weight-medium)!important}.bluxcc\\:font-normal{--tw-font-weight:var(--bluxcc-font-weight-normal)!important;font-weight:var(--bluxcc-font-weight-normal)!important}.bluxcc\\:font-semibold{--tw-font-weight:var(--bluxcc-font-weight-semibold)!important;font-weight:var(--bluxcc-font-weight-semibold)!important}.bluxcc\\:tracking-\\[-2\\%\\]{--tw-tracking:-2%!important;letter-spacing:-2%!important}.bluxcc\\:break-all{word-break:break-all!important}.bluxcc\\:whitespace-nowrap{white-space:nowrap!important}.bluxcc\\:text-alert-error{color:var(--bluxcc-color-alert-error)!important}.bluxcc\\:text-alert-info{color:var(--bluxcc-color-alert-info)!important}.bluxcc\\:text-alert-success{color:var(--bluxcc-color-alert-success)!important}.bluxcc\\:text-alert-warning{color:var(--bluxcc-color-alert-warning)!important}.bluxcc\\:text-gray-800{color:var(--bluxcc-color-gray-800)!important}.bluxcc\\:capitalize{text-transform:capitalize!important}.bluxcc\\:no-underline{text-decoration-line:none!important}.bluxcc\\:opacity-70{opacity:70%!important}.bluxcc\\:outline-hidden{--tw-outline-style:none!important;outline-style:none!important;@media (forced-colors:active){outline:2px solid transparent!important;outline-offset:2px!important}}.bluxcc\\:transition-\\[border-radius\\,background\\,border-color\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:border-radius,background,border-color!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-\\[border-radius\\]{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:border-radius!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-all{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:all!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-colors{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:transition-transform{transition-duration:var(--tw-duration,var(--bluxcc-default-transition-duration))!important;transition-property:transform,translate,scale,rotate!important;transition-timing-function:var(--tw-ease,var(--bluxcc-default-transition-timing-function))!important}.bluxcc\\:duration-200{--tw-duration:200ms!important;transition-duration:.2s!important}.bluxcc\\:duration-300{--tw-duration:300ms!important;transition-duration:.3s!important}.bluxcc\\:outline-none{--tw-outline-style:none!important;outline-style:none!important}.bluxcc\\:select-none{-webkit-user-select:none!important;user-select:none!important}.bluxcc\\:placeholder\\:text-base\\!{&::placeholder{font-size:var(--bluxcc-text-base)!important;line-height:var(--tw-leading,var(--bluxcc-text-base--line-height))!important}}.bluxcc\\:focus\\:ring-1{&:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor)!important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}}.bluxcc\\:focus\\:outline-hidden{&:focus{--tw-outline-style:none!important;outline-style:none!important;@media (forced-colors:active){outline:2px solid transparent!important;outline-offset:2px!important}}}}.bluxcc\\:overflowStyle::-webkit-scrollbar{width:.1px}[class*=" bluxcc"]::backdrop,[class*=" bluxcc"]::file-selector-button,[class*=" bluxcc"]:after,[class*=" bluxcc"]:before,[class^=bluxcc],[class^=bluxcc]::backdrop,[class^=bluxcc]::file-selector-button,[class^=bluxcc]:after,[class^=bluxcc]:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}[class*=" bluxcc"] h1,[class*=" bluxcc"] h2,[class*=" bluxcc"] h3,[class*=" bluxcc"] h4,[class*=" bluxcc"] h5,[class*=" bluxcc"] h6,[class^=bluxcc] h1,[class^=bluxcc] h2,[class^=bluxcc] h3,[class^=bluxcc] h4,[class^=bluxcc] h5,[class^=bluxcc] h6{font-size:inherit;font-weight:inherit}[class*=" bluxcc"] menu,[class*=" bluxcc"] ol,[class*=" bluxcc"] ul,[class^=bluxcc] menu,[class^=bluxcc] ol,[class^=bluxcc] ul{list-style:none}[class*=" bluxcc"] audio,[class*=" bluxcc"] canvas,[class*=" bluxcc"] embed,[class*=" bluxcc"] iframe,[class*=" bluxcc"] img,[class*=" bluxcc"] object,[class*=" bluxcc"] svg,[class*=" bluxcc"] video,[class^=bluxcc] audio,[class^=bluxcc] canvas,[class^=bluxcc] embed,[class^=bluxcc] iframe,[class^=bluxcc] img,[class^=bluxcc] object,[class^=bluxcc] svg,[class^=bluxcc] video{display:block;vertical-align:middle}[class*=" bluxcc"] img,[class*=" bluxcc"] video,[class^=bluxcc] img,[class^=bluxcc] video{height:auto;max-width:100%}#bluxcc-input[type=number]::-webkit-inner-spin-button,#bluxcc-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none!important;margin:0}#bluxcc-input[type=number]{-moz-appearance:textfield!important}#bluxcc-input:-webkit-autofill,#bluxcc-input:-webkit-autofill:active,#bluxcc-input:-webkit-autofill:focus,#bluxcc-input:-webkit-autofill:hover{-webkit-text-fill-color:var(--input-text-color)!important;-webkit-box-shadow:inset 0 0 0 1000px transparent!important;box-shadow:inset 0 0 0 1000px transparent!important;color:var(--input-text-color)!important;transition:background-color 5000s ease-in-out 0s!important}@keyframes bluxcc-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes bluxcc-fadeOut{0%{opacity:1}to{opacity:0}}.bluxcc\\:animate-fadeIn{animation:bluxcc-fadeIn .5s ease-in-out}.bluxcc\\:animate-fadeOut{animation:bluxcc-fadeOut .3s ease-in-out}@keyframes bluxcc-marquee{0%{transform:translateX(-16%)}to{transform:translateX(-100%)}}.bluxcc\\:marquee_outer{position:relative;width:100%}.bluxcc\\:marquee_track{animation:bluxcc-marquee 40s linear infinite;display:flex;width:max-content;will-change:transform}.bluxcc\\:marquee_track:hover{animation-play-state:paused}#bluxcc-button{cursor:pointer}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@keyframes spin{to{transform:rotate(1turn)}}@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-duration:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}');var QA=function(e){if(e instanceof o)return e;if("string"!=typeof e)throw new Error('BLUX: asset must be "xlm", "native", "CODE:ISSUER", or an Asset instance.');var t=e.trim(),n=t.toLowerCase();if("xlm"===n||"native"===n||""===t)return o.native();var r=t.split(":");if(2!==r.length)throw new Error('BLUX: Invalid asset "'.concat(e,'". Use "xlm", "native", or "CODE:ISSUER".'));var a=r[0],s=r[1];if(!a||!s)throw new Error('BLUX: Invalid asset "'.concat(e,'". Use "xlm", "native", or "CODE:ISSUER".'));if(!i.isValidEd25519PublicKey(s))throw new Error('BLUX: Invalid issuer in asset "'.concat(e,'".'));return new o(a,s)},eE=function(e){if(i.isValidEd25519PublicKey(e))return e;if(i.isValidMed25519PublicKey(e))return l(e);throw new Error('BLUX: Resolved an invalid account id "'.concat(e,'".'))},tE=function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,o,a;return te(this,function(s){switch(s.label){case 0:if(!(n=(null!=e?e:"").toString().trim()))throw new Error("BLUX: A destination address is required.");if(i.isValidEd25519PublicKey(n)||i.isValidMed25519PublicKey(n))return[2,{destination:n,publicKey:eE(n),federated:!1}];if(!n.includes("*"))throw new Error('BLUX: "'.concat(n,'" is not a valid Stellar address or federated address.'));s.label=1;case 1:return s.trys.push([1,3,,4]),[4,u.Server.resolve(n,t)];case 2:return r=s.sent(),[3,4];case 3:throw o=s.sent(),a=o instanceof Error?o.message:"lookup failed",new Error('BLUX: Could not resolve federated address "'.concat(n,'": ').concat(a));case 4:return[2,{destination:r.account_id,publicKey:eE(r.account_id),memo:r.memo,memoType:r.memo_type,federated:!0}]}})})},nE=function(e){return ee(void 0,void 0,void 0,function(){return te(this,function(t){switch(t.label){case 0:return e?[4,tE(e)]:[2,void 0];case 1:return[2,t.sent().publicKey]}})})},rE=function(e,t){return ee(void 0,void 0,void 0,function(){var n;return te(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e.loadAccount(t)];case 1:return[2,r.sent()];case 2:if(function(e){var t;if(!e||"object"!=typeof e)return!1;var n=null===(t=e.response)||void 0===t?void 0:t.status,r=e instanceof Error?e.message:"";return 404===n||/account not found/i.test(r)}(n=r.sent()))return[2,null];throw n;case 3:return[2]}})})},iE=function(e,t){return"string"===t?e.toString():"number"===t?Number(e):BigInt(e)},oE=function(e,t,n){var r=t/8,i=BigInt(e).toString(16);n&&e<BigInt(0)&&(i=((BigInt(1)<<BigInt(t))+e).toString(16).replace(/^-/,""));i.length%2!=0&&(i="0".concat(i));for(var o=2*r;i.length<o;)i="0".concat(i);if(i.length>o)throw new Error("BLUX: BigNumber ".concat(e," overflows ").concat(t,"-bit representation"));for(var a=new Uint8Array(r),s=0,c=0;s<r;)a[s]=parseInt(i.slice(c,c+2),16),s+=1,c+=2;return n&&e<BigInt(0)&&(a[0]|=128),Buffer.from(a)},aE=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=BigInt(0),i=0,o=t;i<o.length;i++){var a=o[i];r<<=BigInt(8),r|=BigInt(a)}if(e&&0!==(void 0!==t[0]?128&t[0]:0)){var s=BigInt(8*t.length);r-=BigInt(1)<<s}return r},sE=function(e){if(e>BigInt(Number.MAX_SAFE_INTEGER)||e<BigInt(Number.MIN_SAFE_INTEGER))throw new Error("BLUX: BigInt ".concat(e," is outside the safe integer range for Number type."));return Number(e)},cE=function(e){var t=e,r=sE(t&BigInt(4294967295)),i=Number(t>>BigInt(32)&BigInt(4294967295));return i>=2147483648&&(i-=4294967296),new n.Int64([r,i])},uE=function(e){var t=sE(e&BigInt(4294967295)),r=sE(e>>BigInt(32)&BigInt(4294967295));return new n.Uint64([t,r])};function lE(e){return"object"!=typeof e||null===e||Array.isArray(e)}var dE,fE,hE=function(e){if(!e)return n.ScVal.scvMap(null);for(var t=[],r=0,i=Object.entries(e);r<i.length;r++){var o=i[r],a=o[0],s=o[1],c="string"==typeof a?pE.symbol(a):a;"object"!=typeof s||null===s||lE(s)?t.push(new n.ScMapEntry({key:c,val:s})):t.push(new n.ScMapEntry({key:c,val:hE(s)}))}return n.ScVal.scvMap(t)},pE=function(){function e(){}return e.i32=function(e){var t=iE(e,"number");return n.ScVal.scvI32(t)},e.i64=function(e){var t=iE(e,"bigint");return n.ScVal.scvI64(cE(t))},e.i128=function(e){return function(e){var t=oE(e,128,!0),r=t.subarray(0,8),i=t.subarray(8,16),o=cE(aE.apply(void 0,ne([!0],r,!1))),a=uE(aE.apply(void 0,ne([!1],i,!1)));return n.ScVal.scvI128(new n.Int128Parts({lo:a,hi:o}))}(iE(e,"bigint"))},e.i256=function(e){return function(e){var t=oE(e,256,!0),r=t.subarray(0,8),i=t.subarray(8,16),o=t.subarray(16,24),a=t.subarray(24,32),s=cE(aE.apply(void 0,ne([!0],r,!1))),c=uE(aE.apply(void 0,ne([!1],i,!1))),u=uE(aE.apply(void 0,ne([!1],o,!1))),l=uE(aE.apply(void 0,ne([!1],a,!1)));return n.ScVal.scvI256(new n.Int256Parts({hiHi:s,hiLo:c,loHi:u,loLo:l}))}(iE(e,"bigint"))},e.u32=function(e){var t=iE(e,"number");return n.ScVal.scvU32(t)},e.u64=function(e){var t=iE(e,"bigint");return n.ScVal.scvU64(uE(t))},e.u128=function(e){return function(e){var t=oE(e,128,!1),r=t.subarray(0,8),i=t.subarray(8,16),o=uE(aE.apply(void 0,ne([!1],r,!1))),a=uE(aE.apply(void 0,ne([!1],i,!1)));return n.ScVal.scvU128(new n.UInt128Parts({hi:o,lo:a}))}(iE(e,"bigint"))},e.u256=function(e){return function(e){var t=oE(e,256,!1),r=t.subarray(0,8),i=t.subarray(8,16),o=t.subarray(16,24),a=t.subarray(24,32),s=uE(aE.apply(void 0,ne([!1],r,!1))),c=uE(aE.apply(void 0,ne([!1],i,!1))),u=uE(aE.apply(void 0,ne([!1],o,!1))),l=uE(aE.apply(void 0,ne([!1],a,!1)));return n.ScVal.scvU256(new n.UInt256Parts({hiHi:s,hiLo:c,loHi:u,loLo:l}))}(iE(e,"bigint"))},e.error=function(e){return n.ScVal.scvError(e)},e.duration=function(e){var t=iE(e,"bigint"),r=uE(t);return n.ScVal.scvDuration(r)},e.timepoint=function(e){var t=iE(e,"bigint"),r=uE(t);return n.ScVal.scvTimepoint(r)},e.ledgerKeyNonce=function(e){return n.ScVal.scvLedgerKeyNonce(e)},e.contractInstance=function(e){return n.ScVal.scvContractInstance(e)},e.scvMap=function(e){return n.ScVal.scvMap(e)},e.map=function(e){return hE(e)},e.string=function(e){return n.ScVal.scvString(e)},e.vec=function(e){return n.ScVal.scvVec(e)},e.void=function(){return n.ScVal.scvVoid()},e.bytes=function(e){return n.ScVal.scvBytes(e)},e.ledgerKeyContractInstance=function(){return n.ScVal.scvLedgerKeyContractInstance()},e.symbol=function(e){return n.ScVal.scvSymbol(e)},e.boolean=function(e){return n.ScVal.scvBool(e)},e.address=function(e){return d.fromString(e).toScVal()},e}(),bE=function(){return!!ye().stellar},mE=function(e){var t=ye().user;if(!t&&!e)throw new Error("BLUX: Address not found");return e||(null==t?void 0:t.address)},gE=function(e){var t,n=ye(),r=n.stellar,i=n.config;if(!e){if(r)return{horizon:r.servers.horizon,soroban:r.servers.soroban,networkPassphrase:r.activeNetwork};throw new Error("BLUX: Custom network has no transports.")}var o=kx(e,null!==(t=i.transports)&&void 0!==t?t:{}),s=o.horizon,u=o.soroban;return{networkPassphrase:e,soroban:new a.Server(u),horizon:new c.Server(s)}},vE=function(e){var t,n,r=ye(),i=(null===(t=r.stellar)||void 0===t?void 0:t.activeNetwork)||"";if(0===r.config.networks.length)throw new Error("BLUX: switchNetwork must be called after createConfig");if(!r.config.networks.includes(e))throw new Error("BLUX: New network must be defined in config.networks");if(!r.stellar)throw new Error("BLUX: Could not find the current activeNetwork");r.setStellar({activeNetwork:e,servers:null===(n=r.stellar)||void 0===n?void 0:n.servers}),i&&i!==e&&ye().emitter.emit(re.NetworkChanged,{previousNetwork:i,network:e})},yE=function(e){return ee(void 0,void 0,void 0,function(){var t,n;return te(this,function(r){switch(r.label){case 0:return bE(),[4,tE(mE(e.address))];case 1:t=r.sent().publicKey,n=gE(e.network).horizon,r.label=2;case 2:return r.trys.push([2,4,,5]),[4,n.loadAccount(t)];case 3:return[2,r.sent()];case 4:return r.sent(),[2,null];case 5:return[2]}})})},wE=function(e,t,n){var r=gE(n.network).horizon,i=r[e].apply(r,t);return n.cursor&&i.cursor(n.cursor),n.limit&&i.limit(n.limit),n.order&&i.order(n.order),i},xE=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r,i,o;return te(this,function(a){switch(a.label){case 0:return bE(),t=wE("accounts",[],e),[4,Promise.all([nE(e.forSigner),nE(e.sponsor)])];case 1:return n=a.sent(),r=n[0],i=n[1],r&&(t=t.forSigner(r)),e.forAsset&&(t=t.forAsset(QA(e.forAsset))),i&&(t=t.sponsor(i)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 2:return o=a.sent(),[2,{builder:t,response:o}]}})})},AE=function(e){return ee(void 0,void 0,void 0,function(){var t,n;return te(this,function(r){switch(r.label){case 0:return bE(),t=wE("assets",[],e),e.forCode&&(t=t.forCode(e.forCode)),e.forIssuer&&(t=t.forIssuer(e.forIssuer)),[4,t.call()];case 1:return n=r.sent(),[2,{builder:t,response:n}]}})})},EE=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r,i,o,a;return te(this,function(s){switch(s.label){case 0:return bE(),[4,tE(mE(e.address))];case 1:t=s.sent().publicKey,n=gE(e.network).horizon,s.label=2;case 2:return s.trys.push([2,4,,5]),[4,n.loadAccount(t)];case 3:return r=s.sent(),e.includeZeroBalances?[2,r.balances]:(i=r.balances.filter(function(e){return 0!==Number(e.balance)}),o=i.find(function(e){return"native"===e.asset_type}),a=i.filter(function(e){return"native"!==e.asset_type}),o?[2,ne([o],a,!0)]:[2,a]);case 4:return s.sent(),[2,[]];case 5:return[2]}})})},SE=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r,i,o;return te(this,function(a){switch(a.label){case 0:return bE(),t=wE("claimableBalances",[],e),e.asset&&(t=t.asset(QA(e.asset))),[4,Promise.all([nE(e.claimant),nE(e.sponsor)])];case 1:return n=a.sent(),r=n[0],i=n[1],r&&(t=t.claimant(r)),i&&(t=t.sponsor(i)),[4,t.call()];case 2:return o=a.sent(),[2,{builder:t,response:o}]}})})},_E=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r;return te(this,function(i){switch(i.label){case 0:return bE(),t=wE("effects",[],e),[4,nE(e.forAccount)];case 1:return(n=i.sent())&&(t=t.forAccount(n)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),e.forOperation&&(t=t.forOperation(e.forOperation)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 2:return r=i.sent(),[2,{builder:t,response:r}]}})})},OE=((dE={})[e.TESTNET]="https://friendbot.stellar.org",dE[e.FUTURENET]="https://friendbot-futurenet.stellar.org",dE),NE={testnet:e.TESTNET,futurenet:e.FUTURENET},kE=((fE={})[e.TESTNET]="testnet",fE[e.FUTURENET]="futurenet",fE),TE=function(e){var t,n=e.trim();return OE[n]?n:null!==(t=NE[n.toLowerCase()])&&void 0!==t?t:null},CE=function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i,o;return te(this,function(a){switch(a.label){case 0:n={network:null!==(o=kE[t])&&void 0!==o?o:t,passphrase:t,status:"failed"},a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Lx("".concat(OE[t],"?addr=").concat(encodeURIComponent(e)),{method:"GET"})];case 2:return(r=a.sent()).status>=200&&r.status<300?(n.status="funded",n.hash=r.hash,[2,n]):function(e){var t,n,r=null===(n=null===(t=null==e?void 0:e.extras)||void 0===t?void 0:t.result_codes)||void 0===n?void 0:n.operations;if(Array.isArray(r)&&r.includes("op_already_exists"))return!0;var i=JSON.stringify(null!=e?e:{}).toLowerCase();return i.includes("op_already_exists")||i.includes("already_exists")||i.includes("already exists")||i.includes("already funded")}(r)?(n.status="already_funded",[2,n]):(n.error=r.detail||r.title||"Friendbot responded with status ".concat(r.status),[2,n]);case 3:return i=a.sent(),n.error=i instanceof Error?i.message:"Friendbot request failed",[2,n];case 4:return[2]}})})},IE=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return ee(void 0,ne([t],n,!0),void 0,function(t,n){var r,i,o,a,s,c,u;return void 0===n&&(n={}),te(this,function(l){switch(l.label){case 0:return[4,tE(mE(t))];case 1:if(r=l.sent().publicKey,0===(i=void 0===n.network?[e.TESTNET,e.FUTURENET]:Array.isArray(n.network)?n.network:[n.network]).length)throw new Error("BLUX: options.network must not be empty");for(o=[],a=0,s=i;a<s.length;a++){if(c=s[a],!(u=TE(c)))throw new Error("BLUX: '".concat(c,"' is not fundable. Friendbot only supports testnet and futurenet."));o.includes(u)||o.push(u)}return[2,Promise.all(o.map(function(e){return CE(r,e)}))]}})})},BE=function(e){return ee(void 0,void 0,void 0,function(){var t,n;return te(this,function(r){switch(r.label){case 0:return bE(),t=wE("ledgers",[],e),e.ledger&&(t=t.ledger(e.ledger)),[4,t.call()];case 1:return n=r.sent(),[2,{builder:t,response:n}]}})})},LE=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r;return te(this,function(i){switch(i.label){case 0:return bE(),t=wE("liquidityPools",[],e),[4,nE(e.forAccount)];case 1:return(n=i.sent())&&(t=t.forAccount(n)),e.forAssets&&(t=t.forAssets.apply(t,e.forAssets.map(function(e){return QA(e)}))),[4,t.call()];case 2:return r=i.sent(),[2,{builder:t,response:r}]}})})},ME=function(){var e,t=ye();if(0===t.config.networks.length)throw new Error("BLUX: getNetwork must be called after createConfig");return(null===(e=t.stellar)||void 0===e?void 0:e.activeNetwork)||""},RE=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r,i,o,a;return te(this,function(s){switch(s.label){case 0:return bE(),t=wE("offers",[],e),[4,Promise.all([nE(e.forAccount),nE(e.sponsor),nE(e.seller)])];case 1:return n=s.sent(),r=n[0],i=n[1],o=n[2],r&&(t=t.forAccount(r)),e.buying&&(t=t.buying(QA(e.buying))),e.selling&&(t=t.selling(QA(e.selling))),i&&(t=t.sponsor(i)),o&&(t=t.seller(o)),[4,t.call()];case 2:return a=s.sent(),[2,{builder:t,response:a}]}})})},PE=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r;return te(this,function(i){switch(i.label){case 0:return bE(),t=wE("operations",[],e),[4,nE(e.forAccount)];case 1:return(n=i.sent())&&(t=t.forAccount(n)),e.forClaimableBalance&&(t=t.forClaimableBalance(e.forClaimableBalance)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 2:return r=i.sent(),[2,{builder:t,response:r}]}})})},UE=function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i,o;return te(this,function(a){switch(a.label){case 0:return bE(),n=e[0],r=e[1],[4,(i=wE("orderbook",[QA(n),QA(r)],t)).call()];case 1:return o=a.sent(),[2,{builder:i,response:o}]}})})},jE=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r;return te(this,function(i){switch(i.label){case 0:return bE(),t=wE("payments",[],e),[4,nE(e.forAccount)];case 1:return(n=i.sent())&&(t=t.forAccount(n)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forTransaction&&(t=t.forTransaction(e.forTransaction)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 2:return r=i.sent(),[2,{builder:t,response:r}]}})})},FE=function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i,o,a,s;return te(this,function(c){switch(c.label){case 0:return bE(),n=e[0],r=e[1],i=e[2],"string"!=typeof n?[3,2]:[4,tE(n)];case 1:return o=c.sent().publicKey,[3,3];case 2:o=n.map(function(e){return QA(e)}),c.label=3;case 3:return[4,(a=wE("strictReceivePaths",[o,QA(r),i],t)).call()];case 4:return s=c.sent(),[2,{builder:a,response:s}]}})})},DE=function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i,o,a,s,c;return te(this,function(u){switch(u.label){case 0:return bE(),n=e[0],r=e[1],"string"!=typeof(i=e[2])?[3,2]:[4,tE(i)];case 1:return a=u.sent().publicKey,[3,3];case 2:a=i.map(function(e){return QA(e)}),u.label=3;case 3:return o=a,[4,(s=wE("strictSendPaths",[QA(n),r,o],t)).call()];case 4:return c=u.sent(),[2,{builder:s,response:c}]}})})},zE=function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i,o,a,s,c,u;return te(this,function(l){switch(l.label){case 0:return bE(),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],[4,(c=wE("tradeAggregation",[QA(n),QA(r),i,o,a,s],t)).call()];case 1:return u=l.sent(),[2,{builder:c,response:u}]}})})},$E=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r;return te(this,function(i){switch(i.label){case 0:return bE(),t=wE("trades",[],e),e.forAssetPair&&(t=t.forAssetPair(QA(e.forAssetPair[0]),QA(e.forAssetPair[1]))),e.forOffer&&(t=t.forOffer(e.forOffer)),e.forType&&(t=t.forType(e.forType)),[4,nE(e.forAccount)];case 1:return(n=i.sent())&&(t=t.forAccount(n)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),[4,t.call()];case 2:return r=i.sent(),[2,{builder:t,response:r}]}})})},WE=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r;return te(this,function(i){switch(i.label){case 0:return bE(),t=wE("transactions",[],e),[4,nE(e.forAccount)];case 1:return(n=i.sent())&&(t=t.forAccount(n)),e.forClaimableBalance&&(t=t.forClaimableBalance(e.forClaimableBalance)),e.forLedger&&(t=t.forLedger(e.forLedger)),e.forLiquidityPool&&(t=t.forLiquidityPool(e.forLiquidityPool)),null!=e.includeFailed&&(t=t.includeFailed(e.includeFailed)),[4,t.call()];case 2:return r=i.sent(),[2,{builder:t,response:r}]}})})},XE=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return ee(void 0,ne([e],t,!0),void 0,function(e,t){var n,r,i,o,c,u;return void 0===t&&(t={}),te(this,function(l){switch(l.label){case 0:if(!bE())throw new Error("BLUX: readContracts must be called after createConfig");if(!Array.isArray(e))throw new Error("BLUX: calls must be an array of IContractCall");return 0===e.length?[2,[]]:(n=gE(t.network),r=n.soroban,i=n.networkPassphrase,[4,Promise.all(e.map(function(e,t){return ee(void 0,void 0,void 0,function(){var n,o,c,u,l;return te(this,function(d){switch(d.label){case 0:if(!e||!e.address)throw new Error("BLUX: calls[".concat(t,"].address is required"));if(!e.fn||""===e.fn.trim())throw new Error("BLUX: calls[".concat(t,"].fn is required"));return n=new f(e.address),o=e.args||[],c=new h(new p("GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF","0"),{fee:b,networkPassphrase:i}).addOperation(n.call.apply(n,ne([e.fn],o,!1))).setTimeout(m).build(),[4,r.simulateTransaction(c)];case 1:if(u=d.sent(),a.Api.isSimulationError(u))throw new Error("BLUX: Contract call failed at calls[".concat(t,"] (").concat(e.address,".").concat(e.fn,"): ").concat(u.error));return u.result?("bigint"==typeof(l=s(u.result.retval))&&(l=l.toString()),[2,{raw:u,value:l}]):[2,null]}})})}))]);case 1:return o=l.sent(),c=o.map(function(e){return null==e?void 0:e.raw}),u=o.map(function(e){return null==e?void 0:e.value}),[2,{raws:c,values:u}]}})})},qE=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return ee(void 0,ne([e],t,!0),void 0,function(e,t){var n,r,i,o,s,c,u,l,d,p;return void 0===t&&(t={}),te(this,function(m){switch(m.label){case 0:if(!bE())throw new Error("BLUX: writeContract must be called after createConfig");if(!e||!e.address)throw new Error("BLUX: call.address is required");if(!e.fn||""===e.fn.trim())throw new Error("BLUX: call.fn is required");return n=gE(t.network),r=n.soroban,i=n.networkPassphrase,o=mE(),[4,r.getAccount(o)];case 1:return s=m.sent(),c=new f(e.address),u=e.args||[],l=new h(s,{fee:b,networkPassphrase:i}).addOperation(c.call.apply(c,ne([e.fn],u,!1))).setTimeout(180).build(),[4,r.simulateTransaction(l)];case 2:if(d=m.sent(),a.Api.isSimulationError(d))throw new Error("BLUX: Contract call failed (".concat(e.address,".").concat(e.fn,"): ").concat(d.error));return p=a.assembleTransaction(l,d).build(),[2,IA(p.toXDR(),{network:i})]}})})},KE=function(e,t,n){return g.createClaimableBalance({asset:e,amount:t,claimants:[new y(n,y.predicateUnconditional())]})},GE=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r,o,a,s,c,u,l,d,f,p,b,m,y,w,x,A,E,S,_,O,N,k,T,C,I;return te(this,function(B){switch(B.label){case 0:if(!bE())throw new Error("BLUX: transfer must be called after createConfig");if(!e||"object"!=typeof e)throw new Error("BLUX: transfer requires an options object.");if(!(t=ye().user)||!t.address)throw new Error("BLUX: No account is logged in.");if(n=t.address,r=e.to,o=e.amount,a=e.asset,s=void 0===a?"native":a,c=e.memo,u=e.claimable,l=void 0!==u&&u,d=e.token,f=e.network,!r)throw new Error('BLUX: transfer requires a "to" address.');if(null==o||""===o)throw new Error('BLUX: transfer requires an "amount".');if(p=iE(o,"string"),!(Number(p)>0))throw new Error('BLUX: transfer "amount" must be greater than zero.');if(!d)return[3,4];if(!i.isValidContract(d))throw new Error('BLUX: "token" must be a contract id (C...).');if(p.includes(".")||/e/i.test(p))throw new Error('BLUX: token transfers use integer base units; "amount" cannot have decimals.');return i.isValidContract(r)?(m=r,[3,3]):[3,1];case 1:return[4,tE(r)];case 2:m=B.sent().publicKey,B.label=3;case 3:return b=m,[2,qE({address:d,fn:"transfer",args:[pE.address(n),pE.address(b),pE.i128(p)]},{network:f})];case 4:if(/e/i.test(p))throw new Error('BLUX: "amount" could not be represented precisely; pass it as a string (e.g. "0.0000001").');return y=QA(s),[4,tE(r)];case 5:return w=B.sent(),x=gE(f),A=x.horizon,E=x.networkPassphrase,[4,rE(A,n)];case 6:if(!(S=B.sent()))throw new Error("BLUX: The logged-in account is not active on this network yet.");return[4,rE(A,w.publicKey)];case 7:return _=B.sent(),O=function(e){var t=e.asset,n=e.amount,r=e.claimable,i=e.destination,o=e.publicKey,a=e.destinationAccount;if(a){if(function(e,t){return!!t.isNative()||e.balances.some(function(e){return("credit_alphanum4"===e.asset_type||"credit_alphanum12"===e.asset_type)&&e.asset_code===t.getCode()&&e.asset_issuer===t.getIssuer()})}(a,t))return g.payment({destination:i,asset:t,amount:n});if(r)return KE(t,n,o);throw new Error("BLUX: The destination has no trustline for ".concat(t.getCode(),". Pass { claimable: true } to send it as a claimable balance."))}if(r)return KE(t,n,o);if(t.isNative())return g.createAccount({destination:o,startingBalance:n});throw new Error("BLUX: The destination account does not exist, so it can only be created with XLM. Send XLM, or pass { claimable: true } to send ".concat(t.getCode()," as a claimable balance."))}({asset:y,amount:p,claimable:l,destination:w.destination,publicKey:w.publicKey,destinationAccount:_}),N=new h(S,{fee:"100000",networkPassphrase:E}).addOperation(O),k=null!=c?c:w.memo,T=void 0!==c?"text":w.memoType,C=function(e,t){if(null!=e&&""!==e)switch(t){case"id":return v.id(e);case"hash":return v.hash(e);case"return":return v.return(e);default:return v.text(e)}}(k,T),C&&(N=N.addMemo(C)),I=N.setTimeout(180).build().toXDR(),[2,IA(I,{network:E})]}})})},HE="100000",VE=new Nu(1e7),YE=new Nu(5e6),JE=new Nu("9223372036854775807"),ZE=function(e,t){void 0===t&&(t=!0);var n=new Nu(e).times(VE);if(!n.isFinite()||n.lte(0))throw new Error('BLUX: swap "amount" must be greater than zero.');if(t&&!n.isInteger())throw new Error('BLUX: swap "amount" can have at most 7 decimal places.');var r=t?n:n.integerValue(Nu.ROUND_FLOOR);if(r.gt(JE))throw new Error('BLUX: swap "amount" is too large.');return r},QE=function(e,t,n){var r=ZE(e,!1),i=new Nu("down"===n?1-t:1+t),o=r.times(i);if(o="down"===n?o.integerValue(Nu.ROUND_FLOOR):o.integerValue(Nu.ROUND_CEIL),"down"===n&&o.lt(1)&&(o=new Nu(1)),!o.isFinite()||o.lt(1)||o.gt(JE))throw new Error("BLUX: swap amount is too large.");return function(e){var t=e.idiv(VE),n=e.mod(VE).toFixed(0).padStart(7,"0").replace(/0+$/,"");return n?"".concat(t.toFixed(0),".").concat(n):t.toFixed(0)}(o)},eS=function(e){return e.map(function(e){if("native"===e.asset_type)return o.native();if(!e.asset_code||!e.asset_issuer)throw new Error("BLUX: Swap path contained an unrecognized asset.");return new o(e.asset_code,e.asset_issuer)})},tS=function(e){return e.getCode()},nS=function(e){return e.isNative()?"XLM":"".concat(e.getCode(),":").concat(e.getIssuer())},rS=function(e,t){if(!t.isNative())return e.balances.find(function(e){return("credit_alphanum4"===e.asset_type||"credit_alphanum12"===e.asset_type)&&e.asset_code===t.getCode()&&e.asset_issuer===t.getIssuer()})},iS=function(e){return!1!==e.is_authorized},oS=function(e,t,n,r,i){var o=new Nu(HE).times(1+i),a=function(e,t){var n=e.balances.find(function(e){return"native"===e.asset_type});if(!n)return new Nu(0);var r=2+(e.subentry_count||0)+(e.num_sponsoring||0)-(e.num_sponsored||0)+t,i=new Nu("selling_liabilities"in n?n.selling_liabilities:"0").times(VE);return new Nu(n.balance).times(VE).minus(i).minus(YE.times(r))}(e,r),s=ZE(n,!1);if(t.isNative()){if(a.lt(o.plus(s)))throw new Error("BLUX: Insufficient balance to swap this amount.")}else{if(a.lt(o))throw new Error("BLUX: Insufficient XLM to cover the swap fee and trustline reserve.");if(function(e,t){var n=rS(e,t);return n&&iS(n)?new Nu(n.balance).minus(n.selling_liabilities||"0").times(VE):new Nu(0)}(e,t).lt(s))throw new Error("BLUX: Insufficient balance to swap this amount.")}},aS=function(e){var t;return null!==(t=e.find(function(e){return e.path.length<2}))&&void 0!==t?t:e[0]},sS=function(e,t,n,r){return ee(void 0,void 0,void 0,function(){var i,o,a,s,c,u,l;return te(this,function(d){switch(d.label){case 0:i=null!==(l=null===(u=_x[r])||void 0===u?void 0:u.name)&&void 0!==l?l:"this network",o=0,a=[n,t],d.label=1;case 1:return o<a.length?(s=a[o],(c=s.getIssuer())?[4,rE(e,c)]:[3,3]):[3,4];case 2:if(!d.sent())return[2,new Error("BLUX: No swap path found from ".concat(tS(t)," to ").concat(tS(n)," — the ").concat(s.getCode()," issuer ").concat(c," could not be found on ").concat(i,"; is it an asset from a different network?"))];d.label=3;case 3:return o++,[3,1];case 4:return[2,new Error("BLUX: No swap path found from ".concat(nS(t)," to ").concat(nS(n)," on ").concat(i," — no route can fill this amount right now."))]}})})},cS=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r,o,a,s,c,u,d,f,p,b,m,y,w,x,A,E,S,_,O,N,k,T,C,I,B,L,M,R,P,U,j,F,D,z,$,W,X,q,K;return te(this,function(G){switch(G.label){case 0:if(!bE())throw new Error("BLUX: swap must be called after createConfig");if(!e||"object"!=typeof e)throw new Error("BLUX: swap requires an options object.");if(!(t=ye().user)||!t.address)throw new Error("BLUX: No account is logged in.");if(n=function(e){if(i.isValidEd25519PublicKey(e))return e;if(i.isValidMed25519PublicKey(e))return l(e);throw new Error("BLUX: The logged-in account address is invalid.")}(t.address),r=e.fromAsset,o=e.toAsset,a=e.amount,s=e.type,c=void 0===s?"exactIn":s,u=e.to,d=e.slippage,f=void 0===d?.005:d,p=e.memo,b=e.network,void 0===r||void 0===o)throw new Error('BLUX: swap requires "fromAsset" and "toAsset".');if(null==a||""===a)throw new Error('BLUX: swap requires an "amount".');if("exactIn"!==c&&"exactOut"!==c)throw new Error('BLUX: swap "type" must be "exactIn" or "exactOut".');if(!(f>=0&&f<1))throw new Error('BLUX: swap "slippage" must be a fraction between 0 and 1 (e.g. 0.005 for 0.5%).');if("string"==typeof p&&""!==p&&Buffer.byteLength(p,"utf8")>28)throw new Error('BLUX: swap "memo" must be at most 28 bytes.');if(m=iE(a,"string"),!(Number(m)>0&&Number.isFinite(Number(m))))throw new Error('BLUX: swap "amount" must be greater than zero.');if(/e/i.test(m))throw new Error('BLUX: "amount" could not be represented precisely; pass it as a string (e.g. "0.0000001").');if(function(e){var t=e.split(".")[1];if(t&&t.length>7)throw new Error('BLUX: swap "amount" can have at most 7 decimal places.');ZE(e,!0)}(m),y=QA(r),w=QA(o),y.equals(w))throw new Error('BLUX: "fromAsset" and "toAsset" must be different.');return u?[4,tE(u)]:[3,2];case 1:return A=G.sent(),[3,3];case 2:A={destination:n,publicKey:n,federated:!1},G.label=3;case 3:return x=A,E=gE(b),S=E.horizon,_=E.networkPassphrase,[4,rE(S,n)];case 4:if(!(O=G.sent()))throw new Error("BLUX: The logged-in account is not active on this network yet.");return(N=x.publicKey===n)?(T=O,[3,7]):[3,5];case 5:return[4,rE(S,x.publicKey)];case 6:T=G.sent(),G.label=7;case 7:if(!(k=T))throw new Error("BLUX: The destination account does not exist; a swap cannot create it.");if(!(y.isNative()||(C=rS(O,y))&&iS(C)))throw new Error("BLUX: You do not have a trustline for ".concat(tS(y),"."));if((I=rS(k,w))&&!iS(I))throw new Error("BLUX: The destination is not authorized to hold ".concat(tS(w),"."));if(!(B=w.isNative()||!!I)&&!N)throw new Error("BLUX: The destination has no trustline for ".concat(tS(w),"."));return"exactIn"!==c?[3,11]:[4,DE([y,m,[w]],{network:b})];case 8:return P=G.sent().response,(U=aS(P.records))?[3,10]:[4,sS(S,y,w,_)];case 9:throw G.sent();case 10:return M=U.destination_amount,R=m,L=g.pathPaymentStrictSend({sendAsset:y,sendAmount:m,destination:x.destination,destAsset:w,destMin:QE(U.destination_amount,f,"down"),path:eS(U.path)}),[3,15];case 11:return[4,FE([[y],w,m],{network:b})];case 12:return P=G.sent().response,(U=aS(P.records))?[3,14]:[4,sS(S,y,w,_)];case 13:throw G.sent();case 14:M=m,R=QE(U.source_amount,f,"up"),L=g.pathPaymentStrictReceive({sendAsset:y,sendMax:R,destination:x.destination,destAsset:w,destAmount:m,path:eS(U.path)}),G.label=15;case 15:if(j=function(e,t){if(t.isNative())return"unlimited";var n=rS(e,t);return n&&iS(n)?new Nu(n.limit).minus(n.balance).minus(n.buying_liabilities||"0").times(VE):new Nu(0)}(k,w),F=ZE(M,!1),D="unlimited"!==j&&F.gt(j),z=!w.isNative()&&!B,$=z||N&&D,D&&!N)throw new Error("BLUX: The destination cannot receive this amount of ".concat(tS(w)," (trustline limit)."));return oS(O,y,R,z?1:0,$?1:0),W=new h(O,{fee:HE,networkPassphrase:_}),$&&(W=W.addOperation(g.changeTrust({asset:w}))),W=W.addOperation(L),X=null!=p?p:x.memo,q=void 0!==p?"text":x.memoType,K=function(e,t){if(null!=e&&""!==e)switch(t){case"id":return v.id(e);case"hash":return v.hash(e);case"return":return v.return(e);default:if(Buffer.byteLength(e,"utf8")>28)throw new Error('BLUX: swap "memo" must be at most 28 bytes.');return v.text(e)}}(X,q),K&&(W=W.addMemo(K)),[2,W.setTimeout(180).build().toXDR()]}})})},uS=function(e){return ee(void 0,void 0,void 0,function(){var t;return te(this,function(n){switch(n.label){case 0:return[4,cS(e)];case 1:return t=n.sent(),[4,Promise.resolve().then(function(){return RA})];case 2:return[2,(0,n.sent().sendTransaction)(t,{network:gE(e.network).networkPassphrase})]}})})},lS=function(e,t){var n,r=QA(e),i=null!=t?t:null===(n=ye().stellar)||void 0===n?void 0:n.activeNetwork;if(!i)throw new Error("BLUX: getSacAddress needs a network passphrase — pass one, or call createConfig first.");return r.contractId(i)},dS=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return ee(void 0,ne([e],t,!0),void 0,function(e,t){var n,r,o,a,s,c,u,l,d;return void 0===t&&(t={}),te(this,function(f){switch(f.label){case 0:if(!bE())throw new Error("BLUX: getTokenMetadata must be called after createConfig");if(!e||!i.isValidContract(e))throw new Error("BLUX: getTokenMetadata requires a token contract id (C...).");return n=t.network,[4,XE([{address:e,fn:"decimals",args:[]},{address:e,fn:"name",args:[]},{address:e,fn:"symbol",args:[]}],{network:n})];case 1:if(r=f.sent(),Array.isArray(r))throw new Error("BLUX: getTokenMetadata could not read the token.");o=r.values,a=o[0],s=o[1],c=o[2],f.label=2;case 2:return f.trys.push([2,4,,5]),[4,XE([{address:e,fn:"owner",args:[]}],{network:n})];case 3:return l=f.sent(),Array.isArray(l)||(d=l.values[0],u=null==d?void 0:String(d)),[3,5];case 4:return f.sent(),u=void 0,[3,5];case 5:return[2,{decimals:Number(a),name:String(s),symbol:String(c),owner:u}]}})})},fS={mainnet:e.PUBLIC,testnet:e.TESTNET,sandbox:e.SANDBOX,futurenet:e.FUTURENET,standalone:e.STANDALONE},hS=function(e){var t=ye();vE(e),t.setNetworkSyncDisabled(!0)},pS=Object.freeze({__proto__:null,ToScVal:pE,fundAccount:IE,getAccount:yE,getAccounts:xE,getAssets:AE,getBalances:EE,getClaimableBalances:SE,getEffects:_E,getLedgers:BE,getLiquidityPools:LE,getNetwork:ME,getOffers:RE,getOperations:PE,getOrderbook:UE,getPayments:jE,getSacAddress:lS,getStrictReceivePaths:FE,getStrictSendPaths:DE,getTokenMetadata:dS,getTradeAggregation:zE,getTrades:$E,getTransactions:WE,networks:fS,numberish:iE,readContracts:XE,resolveAddress:tE,resolveAddressKey:nE,resolveAsset:QA,swap:uS,switchNetwork:hS,transfer:GE,writeContract:qE}),bS=ye().setAppearance,mS={on:function(e,t){return ye().emitter.on(e,t)},off:function(e,t){return ye().emitter.off(e,t)},once:function(e,t){return ye().emitter.once(e,t)}};var gS,vS=function(e){var t,n,r,i,o=e.isOpen,a=e.onClose,s=void 0===a?function(){}:a,c=e.children,u=e.isSticky,l=void 0!==u&&u,d=e.appearance,f=e.isPersistent,h=e.isBodyMount,p=e.mountElement,b=P(null),m=P(null),g=M(!1),v=g[0],y=g[1],w=function(e){void 0===e&&(e=460);var t=M(function(){return"undefined"!=typeof window&&window.innerWidth<e}),n=t[0],r=t[1];return R(function(){var t=function(){return r(window.innerWidth<e)};return t(),window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)}},[e]),n}(),x=function(e,t){var n=M({isOpening:!1,isClosing:!1}),r=n[0],i=n[1];return R(function(){if(e){i({isOpening:!0,isClosing:!1});var n=setTimeout(function(){i({isOpening:!1,isClosing:!1})},t);return function(){return clearTimeout(n)}}},[e,t]),Z(Z({},r),{handleClose:function(e){i({isOpening:!1,isClosing:!0});var n=setTimeout(function(){i({isOpening:!1,isClosing:!1}),e()},t);return function(){return clearTimeout(n)}}})}(o,250),A=x.isClosing,E=x.handleClose,S=function(e,t){void 0===t&&(t=[]);var n=M("auto"),r=n[0],i=n[1],o=M(!1),a=o[0],s=o[1],c=M(!1),u=c[0],l=c[1];return R(function(){var t=e.current;if(t){var n=!1,r=function(){n||t.offsetParent&&(i(t.offsetHeight),s(!0))},o=Array.from(t.getElementsByTagName("img")).filter(function(e){return!(e.complete&&e.naturalHeight>0)});if(0!==o.length){var a=o.length,c=function(){0==(a-=1)&&requestAnimationFrame(function(){return requestAnimationFrame(r)})};return o.forEach(function(e){e.addEventListener("load",c),e.addEventListener("error",c)}),function(){n=!0,o.forEach(function(e){e.removeEventListener("load",c),e.removeEventListener("error",c)})}}requestAnimationFrame(function(){return requestAnimationFrame(r)})}},ne(ne([],t,!0),[u],!1)),{height:r,isHeightReady:a,reset:function(){s(!1),i("auto"),l(function(e){return!e})}}}(b,[o,c]),_=S.height,O=S.isHeightReady,N=S.reset;return U(function(){if(!h&&o&&p){var e=m.current;if(e){var t=function(){return function(e,t){var n=t.getBoundingClientRect();e.style.left="".concat(n.left,"px"),e.style.width="".concat(n.width,"px")}(e,p)};t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0);var n=new ResizeObserver(t);return n.observe(p),function(){window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0),n.disconnect(),e.style.left="",e.style.width=""}}}},[h,o,p]),R(function(){if(o&&w){y(!1);var e=requestAnimationFrame(function(){y(!0)});return function(){return cancelAnimationFrame(e)}}},[o,w]),R(function(){return document.body.style.overflow=i?"hidden":"",function(){document.body.style.overflow=""}},[i=o]),R(function(){o||N()},[o]),o?z($,{children:[!f&&W("div",{className:"bluxcc:fixed bluxcc:inset-0 bluxcc:z-9999998 ".concat(A&&!l?"bluxcc:animate-fadeOut":"bluxcc:animate-fadeIn"),style:{backdropFilter:"blur(".concat(d.backdropBlur,")"),WebkitBackdropFilter:"blur(".concat(d.backdropBlur,")"),backgroundColor:d.backdropColor},onClick:function(e){e.stopPropagation(),l||s()}}),W("div",{ref:m,className:"".concat(h?"bluxcc:fixed bluxcc:inset-0":"bluxcc:fixed bluxcc:top-0 bluxcc:bottom-0"," bluxcc:z-9999999 bluxcc:flex bluxcc:items-center bluxcc:justify-center ").concat(A&&!l&&"bluxcc:animate-fadeOut"),onClick:function(e){e.stopPropagation(),e.target!==e.currentTarget||l||E(s)},children:W("div",{id:"bluxcc-modal",onClick:function(e){return e.stopPropagation()},className:"bluxcc:box-border ".concat(w?"bluxcc:fixed bluxcc:bottom-0 bluxcc:left-0 bluxcc:w-full bluxcc:rounded-b-none!":"bluxcc:relative bluxcc:w-90!"),style:{height:"number"==typeof _?"".concat(w?_+20:_,"px"):_,transition:O?"height 250ms ease-in-out, border-radius 250ms, opacity 250ms ease-out, outline 250ms ease-out, color 250ms ease-out".concat(w?", transform 250ms ease-out":""):"border-radius 250ms, opacity 250ms ease-out".concat(w?", transform 250ms ease-out":""),transform:w?A?"translateY(100%)":v?"translateY(0%)":"translateY(80%)":"",background:d.background,opacity:A&&!l?"0":"1",color:d.textColor,fontFamily:d.fontFamily,letterSpacing:"-0.04px",borderRadius:null!==(t=d.outlineRadius)&&void 0!==t?t:d.borderRadius,outline:"".concat(null!==(n=d.outlineWidth)&&void 0!==n?n:d.borderWidth," solid ").concat(null!==(r=d.outlineColor)&&void 0!==r?r:d.borderColor),overflow:"hidden",boxShadow:d.boxShadow},children:W("div",{ref:b,className:"bluxcc:px-6 bluxcc:pb-4",style:{fontFamily:d.fontFamily,opacity:O?1:0,transition:"opacity 200ms ease-in-out"},children:c})})})]}):null},yS=function(e){var t=e.className,n=e.name,r=e.props,i=void 0===r?{}:r,o=Q(e,["className","name","props"]),a=Ee(function(e){return e.logos}),s=j(function(){return null==a?void 0:a.find(function(e){return e.name===n})},[a,n]),c=JSON.stringify(i),u=j(function(){if(!s)return"";var e=s.content,t=new Map;return(s.default_values||[]).forEach(function(e){var n=e.name,r=e.value;t.set(n,r)}),Object.entries(i).forEach(function(e){var n=e[0],r=e[1];t.set(n,r)}),t.forEach(function(t,n){var r=new RegExp("{{".concat(n,"}}"),"g");e=e.replace(r,t)}),e},[s,c]);if(!a||!s){var l="".concat("https://cdn.blux.cc/files","/").concat(encodeURIComponent(n)),d=Object.entries(i).map(function(e){return"".concat(encodeURIComponent(e[0]),"=").concat(encodeURIComponent(e[1]))}).join("&"),f="".concat(l,"?").concat(d);return W("img",{src:f,alt:n})}return W("div",u?Z({dangerouslySetInnerHTML:{__html:u}},o,{className:t}):{style:{width:50,height:50,background:"transparent",objectFit:"contain"}})};!function(e){e.Blux="blux.svg",e.SmallBlux="smallblux.svg",e.About="about.svg",e.ArrowRight="arrowright.svg",e.ArrowLeft="arrowleft.svg",e.Close="close.svg",e.Loading="loading.svg",e.Search="search.svg",e.GreenCheck="greencheck.svg",e.LogOut="logout.svg",e.Copy="copy.svg",e.LargeCopy="largecopy.svg",e.History="history.svg",e.Send="send.svg",e.ArrowDropUp="arrowdropup.svg",e.ArrowDropDown="arrowdropdown.svg",e.RedAlert="redalert.svg",e.Upstream="upstream.svg",e.MultiOperation="multioperation.svg",e.Downstream="downstream.svg",e.Globe="globe.svg",e.SmallEmail="smallemail.svg",e.MoonPayLogo="moonpaylogo.svg",e.Email="email.svg",e.RedExclamation="redexclamation.svg",e.WrongNetwork="wrongnetwork.svg",e.Swap="swap.svg",e.SmallSwap="smallswap.svg",e.Receive="receive.svg",e.Balances="balances.svg",e.NFTs="nfts.svg",e.Assets="assets.svg",e.Token="token.svg",e.Plus="plus.svg",e.OpenEye="openeye.svg",e.CloseEye="closeeye.svg",e.Warn="warn.svg",e.Error="error.svg",e.CopyIcon="copyicon.svg",e.Success="success.svg",e.Key="key.svg",e.Chip="chip.svg",e.Shield="shield.svg",e.Wallet="wallet.svg",e.QuestionMark="questionmark.svg",e.SmallQuestionMark="smallquestionmark.svg",e.GrayCube="graycube.svg",e.Albedo="albedo.svg",e.Hana="hana.svg",e.Hot="hot.svg",e.Rabet="rabet.svg",e.Freighter="freighter.svg",e.DarkFreighter="darkfreighter.svg",e.XBull="xbull.svg",e.Lobstr="lobstr.svg",e.Stellar="stellar.svg",e.StellarSmall="stellarsmall.svg",e.Google="google.svg",e.WalletConnect="walletconnect.svg",e.Klever="klever.svg",e.Ledger="ledger.svg"}(gS||(gS={}));var wS=gS,xS={error:{baseBg:"bluxcc:bg-light-red-50",darkBg:"bluxcc:bg-[#D6000033]",container:"bluxcc:border bluxcc:border-alert-error",text:"bluxcc:text-alert-error",icon:W(yS,{name:wS.Error})},success:{baseBg:"bluxcc:bg-white",darkBg:"bluxcc:bg-[#00D66E33]",container:"bluxcc:border bluxcc:border-alert-success",text:"bluxcc:text-alert-success",icon:W(yS,{name:wS.Success})},copy:{baseBg:"bluxcc:bg-light-blue-50",darkBg:"bluxcc:bg-[#005DF333]",container:"bluxcc:border bluxcc:border-alert-info",text:"bluxcc:text-alert-info",icon:W(yS,{name:wS.CopyIcon})},warn:{baseBg:"bluxcc:bg-white",darkBg:"bluxcc:bg-[#FA8F0233]",container:"bluxcc:border bluxcc:border-alert-warning",text:"bluxcc:text-alert-warning",icon:W(yS,{name:wS.Warn})},none:{baseBg:"",darkBg:"",container:"",text:"",icon:null}},AS=function(e){var t=e.type,n=e.message,r=e.className,i=void 0===r?"":r,o=Ee(function(e){return e.config.appearance}),a=Zx(o.background),s=xS[t],c=s.baseBg,u=s.darkBg,l=s.container,d=s.text,f=s.icon,h=a?u:c;return z("div",{style:{borderRadius:o.borderRadius,fontFamily:o.fontFamily},className:"\n bluxcc:flex bluxcc:items-center bluxcc:gap-2\n bluxcc:px-3 bluxcc:h-10 bluxcc:max-w-46\n ".concat(h,"\n ").concat(l,"\n ").concat(d,"\n ").concat(i,"\n "),children:[f,W("span",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:n})]})},ES=function(){var e=Ee(function(e){return e.config.lang});return function(t,n){return function(e,t,n){var r,i;void 0===n&&(n={});var o=(null===(r=Nx[e])||void 0===r?void 0:r[t])||(null===(i=Nx[e])||void 0===i?void 0:i.en)||String(e);return rA(o,n)}(t,e||"en",n||{})}},SS=function(e){var t=e.onClick,n=e.children;return W("button",{id:"bluxcc-button",onClick:t,className:"bluxcc:flex bluxcc:size-5 bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent",children:n})},_S=function(e){var t=e.icon,n=e.onInfo,r=e.onBack,i=e.title,o=void 0===i?" ":i,a=e.closeButton,s=void 0!==a&&a,c=e.onClose,u=e.isPersistent,l=Ee(function(e){return e.config}),d=Ee(function(e){return e.modal}),f=ES(),h=Vx(l.appearance.textColor,.7),p="none"!==d.alert.type;return z("header",{className:"bluxcc:flex bluxcc:h-16 bluxcc:w-full bluxcc:items-center bluxcc:justify-between",style:{fontFamily:l.appearance.fontFamily},children:["info"===t?W(SS,{onClick:n,children:W(yS,{name:wS.About,props:{fill:h}})}):"back"===t?W(SS,{onClick:r,children:W(yS,{name:wS.ArrowLeft,props:{fill:h}})}):W("div",{className:"bluxcc:size-5"}),W("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:p?W(AS,{type:d.alert.type,message:d.alert.message}):W("p",{className:"bluxcc:grow bluxcc:select-none bluxcc:text-center bluxcc:text-base bluxcc:font-medium",children:f(o)})}),!s||u?W("div",{className:"bluxcc:size-5"}):W(SS,{onClick:c,children:W(yS,{name:wS.Close,props:{fill:h}})})]})},OS=function(){var e=Ee(function(e){return e.config.appearance});return W("div",{className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:W("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:e.borderWidth,borderTopColor:e.borderColor}})})},NS=function(e){var t,n=e.startIcon,r=e.onChange,i=e.onEnter,o=e.onSubmit,a=e.inputType,s=void 0===a?"text":a,c=e.placeholder,u=Ee(function(e){return e}).config.appearance,l=ES(),d=M(!1),f=d[0],h=d[1],p=M(""),b=p[0],m=p[1],g=M(!1),v=g[0],y=g[1];return z("div",{className:"bluxcc:flex bluxcc:transition-colors bluxcc:duration-300 bluxcc:h-14! bluxcc:w-full bluxcc:items-center bluxcc:py-2 bluxcc:pr-3 bluxcc:pl-2",onClick:function(e){return e.stopPropagation()},style:{fontFamily:u.fontFamily,borderRadius:u.borderRadius,borderColor:f?u.accentColor:u.borderColor,backgroundColor:u.fieldBackground,borderWidth:u.borderWidth,color:u.textColor},onMouseEnter:function(e){f||(e.currentTarget.style.borderColor=u.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){f||(e.currentTarget.style.borderColor=u.borderColor)},children:[W("span",{style:{background:u.background,borderRadius:u.borderRadius,borderColor:u.borderColor,borderWidth:u.borderWidth},className:"bluxcc:flex bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-all bluxcc:duration-300",children:n}),z("div",{style:{cursor:"text"},className:"bluxcc:ml-4 bluxcc:relative bluxcc:flex bluxcc:h-full bluxcc:flex-1 bluxcc:items-center",children:[W("input",{id:"bluxcc-input-".concat(s),type:"tel"===s?"tel":s,value:b,autoComplete:"tel"===s?"tel":"off",inputMode:"tel"===s?"tel":void 0,placeholder:null!=c?c:l("tel"===s?"phone":"email"),onKeyDown:function(e){"Enter"===e.key&&v&&(null==i||i(b))},onChange:function(e){var t=e.target.value;m(t);var n=aA(s,t);y(n),null==r||r(t)},className:"bluxcc:mr-1 bluxcc:h-full bluxcc:w-full bluxcc:bg-transparent bluxcc:outline-hidden\n bluxcc:focus:outline-hidden bluxcc:text-base bluxcc:placeholder:text-base!",style:(t={color:u.textColor,fontFamily:u.fontFamily},t["--input-text-color"]=u.textColor,t),onFocus:function(){return h(!0)},onBlur:function(){h(!1),aA(s,b)||y(!1)}}),W("div",{className:"bluxcc:flex bluxcc:h-10 bluxcc:w-25 bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent",children:W("button",{id:"bluxcc-button-".concat(s),disabled:!v,onClick:function(e){e.stopPropagation(),null==o||o(b)},className:"bluxcc:absolute bluxcc:right-0 bluxcc:flex bluxcc:h-8 bluxcc:px-1.5! bluxcc:items-center bluxcc:justify-center bluxcc:border bluxcc:text-sm! bluxcc:font-medium bluxcc:transition-[border-radius,background,border-color] bluxcc:duration-200",style:{background:u.fieldBackground,borderRadius:u.borderRadius,fontFamily:u.fontFamily,borderColor:v?u.accentColor:u.borderColor,color:v?u.accentColor:"#999999",borderWidth:u.borderWidth},children:l("submit")})})]})]})},kS=function(e){var t=e.size,n=void 0===t?"medium":t,r=e.startIcon,i=e.endArrow,o=e.isRecent,a=void 0!==o&&o,s=e.label,c=e.onClick,u=Ee(function(e){return e}),l=M(!1),d=l[0],f=l[1],h=u.config.appearance,p=ES();return z("button",{type:"button",id:"bluxcc-button",onClick:function(e){e.stopPropagation(),null==c||c()},className:"bluxcc:flex bluxcc:transition-colors bluxcc:duration-300\n ".concat("small"===n?"bluxcc:size-24 bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:gap-2 bluxcc:py-4":"bluxcc:h-14! bluxcc:w-full bluxcc:items-center bluxcc:py-2 bluxcc:pr-3 bluxcc:pl-2 bluxcc:text-left","\n "),style:{fontFamily:h.fontFamily,borderRadius:h.borderRadius,borderColor:d?h.accentColor:h.borderColor,backgroundColor:h.fieldBackground,borderWidth:h.borderWidth,color:h.textColor,textAlign:"small"===n?"center":"left"},onMouseEnter:function(e){f(!0),d||(e.currentTarget.style.borderColor=h.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){f(!1),d||(e.currentTarget.style.borderColor=h.borderColor)},children:[W("span",{style:{background:h.background,borderRadius:h.borderRadius,borderColor:h.borderColor,borderWidth:h.borderWidth},className:"bluxcc:flex bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-all bluxcc:duration-300",children:r}),W("div",{className:"".concat("small"===n?"bluxcc:mt-0":"bluxcc:ml-4 bluxcc:min-w-0 bluxcc:overflow-hidden"," bluxcc:relative bluxcc:flex bluxcc:h-full bluxcc:flex-1 bluxcc:items-center"),children:W("span",{className:"".concat("small"===n?"bluxcc:text-sm bluxcc:leading-4":"bluxcc:w-full bluxcc:text-left bluxcc:text-base bluxcc:whitespace-nowrap"," bluxcc:font-medium bluxcc:select-none"),children:s})}),a&&W("div",{className:"bluxcc:px-2 bluxcc:py-1 bluxcc:text-xs bluxcc:font-normal",style:{color:h.accentColor,borderRadius:h.borderRadius,backgroundColor:"".concat(Vx(h.accentColor,.15))},children:p("recent")}),i&&"medium"===n&&W("span",{className:"bluxcc:ml-auto bluxcc:flex bluxcc:items-center",children:W(yS,{name:wS.ArrowRight,props:{fill:"".concat(Vx(h.textColor,.7))}})})]})},TS=function(e){var t=e.variant,n=void 0===t?"default":t,r=e.size,i=void 0===r?"medium":r,o=e.startIcon,a=e.endArrow,s=e.isRecent,c=void 0!==s&&s,u=e.label,l=e.onClick,d=e.onChange,f=e.onEnter,h=e.onSubmit,p=e.inputType,b=void 0===p?"text":p,m=e.placeholder;return"input"===n?W(NS,{onEnter:f,onSubmit:h,onChange:d,inputType:b,startIcon:o,placeholder:m}):W(kS,{size:i,label:u,onClick:l,isRecent:c,endArrow:a,startIcon:o})},CS=function(){var e,t=ES(),n=M(!0),r=n[0],i=n[1],o=Ee(function(e){return e}),a=o.setRoute,s=o.logoutAction,c=o.setAlert,u=o.config.appearance,l=null===(e=o.user)||void 0===e?void 0:e.address,d=0!==o.balances.balances.length?o.balances.balances.find(function(e){return"native"===e.asset_type}).balance:"0";return z("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center",children:[z("div",{className:"bluxcc:mt-4 bluxcc:mb-6 bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center",children:[z("div",{className:"bluxcc:text-center bluxcc:text-2xl bluxcc:h-8 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:gap-2",style:{color:u.accentColor,fontFamily:u.fontFamily},children:[W("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:W("p",{className:"bluxcc:select-none",style:{verticalAlign:"middle",paddingTop:r?"0px":"8px",fontFamily:u.fontFamily},children:d?r?"".concat(Yx(d)," XLM"):"******":t("loading")})}),W("div",{className:"bluxcc:transition-all",children:W("button",r?{id:"bluxcc-button",onClick:function(){return i(!1)},className:"bluxcc:bg-transparent",children:W(yS,{name:wS.OpenEye,props:{fill:u.accentColor}})}:{id:"bluxcc-button",onClick:function(){return i(!0)},className:"bluxcc:bg-transparent",children:W(yS,{name:wS.CloseEye,props:{fill:u.accentColor}})})})]}),W("button",{id:"bluxcc-button",className:"bluxcc:mt-4! bluxcc:leading-4 bluxcc:inline-flex bluxcc:bg-transparent bluxcc:text-sm bluxcc:select-none",onClick:function(){zx(l).then(function(){zx(l),c("copy",t("address_copied")),setTimeout(function(){c("none","")},1e3)}).catch(function(){})},style:{color:Vx(u.textColor,.7),fontFamily:u.fontFamily},children:z("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1",children:[l?eA(l,5):"",W(yS,{name:wS.Copy,props:{fill:Vx(u.textColor,.7)}})]})})]}),z("div",{className:"bluxcc:flex bluxcc:space-x-3",children:[W(TS,{size:"small",label:t("send"),startIcon:W(yS,{name:wS.Send,props:{fill:u.textColor}}),onClick:function(){a(Y.SEND)}}),W(TS,{size:"small",label:t("receive"),startIcon:W(yS,{name:wS.Receive,props:{fill:u.textColor}}),onClick:function(){a(Y.RECEIVE)}}),W(TS,{size:"small",label:t("swap"),startIcon:W(yS,{name:wS.Swap,props:{fill:u.textColor}}),onClick:function(){o.setSelectAsset(Z(Z({},o.selectAsset),{userPicked:!1})),a(Y.SWAP)}})]}),z("div",{className:"bluxcc:mt-4 bluxcc:w-full bluxcc:space-y-2",children:[W(TS,{endArrow:!0,label:t("balances"),startIcon:W(yS,{name:wS.Balances,props:{fill:u.textColor}}),onClick:function(){a(Y.BALANCES)}}),W(TS,{endArrow:!0,label:t("activity"),startIcon:W(yS,{name:wS.History,props:{fill:u.textColor}}),onClick:function(){a(Y.ACTIVITY)}})]}),W(OS,{}),z("button",{style:{color:Vx(u.textColor,.9),fontFamily:u.fontFamily},id:"bluxcc-button",onClick:function(){s(),SA(),o.emitter.emit(re.LoggedOut,void 0)},className:"bluxcc:flex bluxcc:h-12 bluxcc:font-medium bluxcc:text-base bluxcc:w-full bluxcc:bg-transparent bluxcc:items-center bluxcc:justify-center bluxcc:gap-2",children:[W(yS,{name:wS.LogOut,props:{fill:Vx(u.textColor,.9)}}),t("logout")]})]})},IS={small:"bluxcc:h-8 bluxcc:!text-sm bluxcc:gap-1",medium:"bluxcc:h-10 bluxcc:!text-sm bluxcc:gap-1",large:"bluxcc:h-[52px] bluxcc:!text-base bluxcc:gap-1"},BS=function(e){var t=e.size,n=void 0===t?"large":t,r=e.disabled,i=void 0!==r&&r,o=e.variant,a=void 0===o?"outline":o,s=e.state,c=void 0===s?"enabled":s,u=e.children,l=e.startIcon,d=e.endIcon,f=e.onClick,h=e.style,p=e.className,b=e.type,m=Ee(function(e){return e.config.appearance}),g=Z({borderRadius:m.borderRadius,fontFamily:m.fontFamily,pointerEvents:"disabled"===c?"none":void 0},h);return"outline"===a?Object.assign(g,{border:"1px solid ".concat(m.borderColor),color:m.accentColor,backgroundColor:m.fieldBackground,borderWidth:m.borderWidth}):"fill"===a?Object.assign(g,{backgroundColor:m.accentColor,fontWeight:"500",color:Wx(m.accentColor)}):"text"===a?Object.assign(g,{color:m.accentColor,backgroundColor:"transparent"}):"tonal"===a&&Object.assign(g,{color:m.accentColor,backgroundColor:Vx(m.accentColor,.1)}),"selected"===c&&(g.boxShadow="0 0 0 2px ".concat(m.accentColor)),z("button",{type:b||"button",id:"bluxcc-button",onClick:f,disabled:"disabled"===c&&i,className:"".concat("bluxcc:flex bluxcc:justify-center bluxcc:items-center bluxcc:px-[10px] bluxcc:transition-all bluxcc:duration-300 bluxcc:w-full"," ").concat(IS[n]," ").concat(null!=p?p:""," bluxcc:transition-all bluxcc:duration-300"),style:g,children:[l&&W("span",{children:l}),W("span",{children:u}),d&&W("span",{children:d})]})},LS=function(e){var t=e.fill;return W("svg",{width:"40",height:"40",viewBox:"0 -960 960 960",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:W("path",{d:"M480-40q-112 0-206-51T120-227v107H40v-240h240v80h-99q48 72 126.5 116T480-120q75 0 140.5-28.5t114-77q48.5-48.5 77-114T840-480h80q0 91-34.5 171T791-169q-60 60-140 94.5T480-40Zm-36-160v-52q-47-11-76.5-40.5T324-370l66-26q12 41 37.5 61.5T486-314q33 0 56.5-15.5T566-378q0-29-24.5-47T454-466q-59-21-86.5-50T340-592q0-41 28.5-74.5T446-710v-50h70v50q36 3 65.5 29t40.5 61l-64 26q-8-23-26-38.5T482-648q-35 0-53.5 15T410-592q0 26 23 41t83 35q72 26 96 61t24 77q0 29-10 51t-26.5 37.5Q583-274 561-264.5T514-250v50h-70ZM40-480q0-91 34.5-171T169-791q60-60 140-94.5T480-920q112 0 206 51t154 136v-107h80v240H680v-80h99q-48-72-126.5-116T480-840q-75 0-140.5 28.5t-114 77q-48.5 48.5-77 114T120-480H40Z",fill:void 0===t?"#0C1083":t})})},MS=function(e){var t=e.fill;return W("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:W("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z",fill:void 0===t?"#0C1083":t})})},RS=function(e){var t=e.fill;return W("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:W("path",{d:"M9 16h6v-6h4l-7-7-7 7h4zm-4 4h14v-2H5v2z",fill:void 0===t?"#0C1083":t})})},PS=function(e){var t=e.fill,n=void 0===t?"#999999":t;return z("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[W("mask",{id:"mask0_4197_4537",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:W("rect",{width:"24",height:"24",fill:"#D9D9D9"})}),W("g",{mask:"url(#mask0_4197_4537)",children:W("path",{d:"M6.29425 17.6443L5.25 16.6L15.0905 6.75H6.14425V5.25H17.6443V16.75H16.1443V7.80375L6.29425 17.6443Z",fill:n})})]})},US=function(e){var t=e.fill,n=void 0===t?"#0C1083":t;return z("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[W("mask",{id:"mask0_3683_34744",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40",children:W("rect",{width:"40",height:"40",fill:"#D9D9D9"})}),W("g",{mask:"url(#mask0_3683_34744)",children:W("path",{d:"M20 37.3069L7.5 27.9319V4.16602H32.5V27.9319L20 37.3069ZM20 34.166L30 26.6819V6.66602H10V26.6819L20 34.166ZM18.25 24.4223L27.0896 15.5827L25.3333 13.7752L18.25 20.8585L14.7179 17.3264L12.9104 19.0827L18.25 24.4223Z",fill:n})})]})},jS=function(e){var t=e.fill,n=void 0===t?"#05C3DD":t;return z("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[W("path",{d:"M37.1737 32.0256H51.2086L65.5665 46.3274C66.5004 47.2576 66.5052 48.7708 65.5759 49.706L47.1629 68.2582H32.7051L37.076 63.9982L53.1242 48.0114L37.2796 32.0244",fill:n}),W("path",{d:"M42.9419 47.9755H28.907L14.5492 33.6739C13.6152 32.7435 13.6104 31.2303 14.5397 30.2951L32.9527 11.7417H47.4106L43.0397 16.0018L26.9914 31.9887L42.8358 47.9755",fill:n})]})},FS=function(){return z("svg",{width:"144",height:"144",viewBox:"0 0 144 144",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[z("g",{clipPath:"url(#clip0_617_11734)",children:[W("path",{d:"M0 0H144V144H0V0Z",fill:"#44D62C"}),W("path",{d:"M78.5049 30.5303H58.4749L54.9609 41.156H66.0861V63.5379H78.5049V30.5303Z",fill:"black"}),W("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M94.8428 90.626C94.8428 103.242 84.6155 113.469 71.9995 113.469C59.3835 113.469 49.1562 103.242 49.1562 90.626C49.1562 78.01 59.3835 67.7827 71.9995 67.7827C84.6155 67.7827 94.8428 78.01 94.8428 90.626ZM84.4722 90.6259C84.4722 97.5144 78.8879 103.099 71.9995 103.099C65.111 103.099 59.5267 97.5144 59.5267 90.6259C59.5267 83.7374 65.111 78.1532 71.9995 78.1532C78.8879 78.1532 84.4722 83.7374 84.4722 90.6259Z",fill:"black"})]}),W("defs",{children:W("clipPath",{id:"clip0_617_11734",children:W("rect",{width:"144",height:"144",fill:"white"})})})]})},DS=function(e){var t=e.fill,n=void 0===t?"#3FA76E":t;return z("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[W("rect",{x:"9.25",y:"2.5",width:"5.5",height:"16",rx:"2.75",fill:n}),W("rect",{x:"3",y:"7.5",width:"3",height:"7",rx:"1.5",fill:n}),W("rect",{x:"3",y:"11.5",width:"9",height:"3",rx:"1.5",fill:n}),W("rect",{x:"18",y:"5.5",width:"3",height:"7",rx:"1.5",fill:n}),W("rect",{x:"13",y:"9.5",width:"8",height:"3",rx:"1.5",fill:n}),W("rect",{x:"5.5",y:"19.5",width:"13",height:"2.5",rx:"1.25",fill:n})]})},zS=function(){return z("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[W("rect",{width:"32",height:"32",rx:"8",fill:"#2E27F6"}),W("path",{d:"M8 24V8h16l-4.2 4.8H13v3h8.4L17.2 20H13v4H8Z",fill:"#ffffff"})]})},$S=function(e){var t=e.fill;return W("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:W("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7a5 5 0 0 0-5-5Zm3 8V7a3 3 0 1 0-6 0v3h6Zm-3 4a1.75 1.75 0 0 0-.75 3.33V19.5a.75.75 0 0 0 1.5 0v-2.17A1.75 1.75 0 0 0 12 14Z",fill:void 0===t?"#171717":t})})},WS=function(){return z("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[W("rect",{width:"24",height:"24",rx:"6",fill:"#E31837"}),W("path",{d:"M6.4 17.2V6.8h2.35l3.25 6.55L15.25 6.8H17.6v10.4h-2.2V10.3l-2.95 5.85h-1.9L7.6 10.3v6.9H6.4Z",fill:"white"})]})},XS=function(){return z("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[W("g",{clipPath:"url(#clip0_4355_16345)",children:W("path",{d:"M17.9507 8.43559C18.4879 8.43559 19.0133 8.27633 19.4601 7.97795C19.9069 7.67956 20.2552 7.25543 20.4611 6.75915C20.6669 6.26287 20.7211 5.71671 20.6167 5.18966C20.5123 4.66262 20.254 4.17835 19.8744 3.79803C19.4949 3.41771 19.0112 3.15842 18.4844 3.05292C17.9575 2.94741 17.4112 3.00042 16.9146 3.20526C16.4178 3.41009 15.993 3.75755 15.6936 4.20375C15.3944 4.64993 15.234 5.17483 15.2329 5.71212C15.2322 6.06951 15.3019 6.42353 15.4382 6.75392C15.5744 7.08431 15.7745 7.38459 16.0269 7.63756C16.2794 7.89053 16.5792 8.09123 16.9093 8.22816C17.2394 8.3651 17.5933 8.43559 17.9507 8.43559ZM9.61576 20.6742C8.30665 20.6731 7.02725 20.2839 5.93923 19.5559C4.85121 18.8279 4.0034 17.7937 3.50294 16.584C3.00249 15.3743 2.87184 14.0435 3.12751 12.7596C3.38318 11.4757 4.01369 10.2964 4.93938 9.37069C5.86506 8.445 7.04436 7.81449 8.32826 7.55882C9.61217 7.30315 10.943 7.43379 12.1527 7.93425C13.3624 8.43471 14.3966 9.28252 15.1246 10.3705C15.8526 11.4586 16.2417 12.738 16.2429 14.0471C16.2436 14.9176 16.0727 15.7797 15.74 16.584C15.4071 17.3884 14.919 18.1192 14.3035 18.7348C13.688 19.3503 12.9571 19.8385 12.1527 20.1712C11.3483 20.504 10.4862 20.675 9.61576 20.6742Z",fill:"#7D00FF"})}),W("defs",{children:W("clipPath",{id:"clip0_4355_16345",children:W("rect",{width:"24",height:"24",fill:"white"})})})]})},qS=function(){return z("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{width:"38px",height:"38px"},children:[W("path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4"}),W("path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88"}),W("path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02"}),W("path",{d:"M2 12a10 10 0 0 1 18-6"}),W("path",{d:"M2 16h.01"}),W("path",{d:"M21.8 16c.2-2 .131-5.354 0-6"}),W("path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2"}),W("path",{d:"M8.65 22c.21-.66.45-1.32.57-2"}),W("path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2"})]})},KS=function(e){var t=e.fill;return W("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:W("path",{d:"M6.62 10.79a15.05 15.05 0 0 0 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1C10.61 21 3 13.39 3 4c0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2Z",fill:void 0===t?"#0C1083":t})})},GS=function(e,t,n){void 0===n&&(n="small");var r="bluxcc:flex bluxcc:justify-center bluxcc:items-center bluxcc:size-10!";switch(e){case"Rabet":return W(yS,{className:"small"===n?r:"",name:wS.Rabet,props:{fill:t?"#ffffff":"#B8BAC4"}});case"Freighter":return W(yS,t?{className:"small"===n?r:"",name:wS.DarkFreighter,props:{}}:{className:"small"===n?r:"",name:wS.Freighter,props:{fill:"#310CCC"}});case"Albedo":return W(yS,{className:"small"===n?r:"",name:wS.Albedo,props:{}});case"LOBSTR":return W(yS,{className:"small"===n?r:"",name:wS.Lobstr,props:{fill:t?"#ffffff":"#1a8da0"}});case"xBull":return W(yS,{className:"small"===n?r:"",name:wS.XBull,props:{fill:t?"#ffffff":"#C19CFC"}});case"Hana":return W(yS,{className:"small"===n?r:"",name:wS.Hana,props:{fill:t?"#E6E0F7":"#221542"}});case"Hot":return W(yS,{className:"small"===n?r:"",name:wS.Hot,props:{}});case"Wallet Connect":return W(yS,{className:"small"===n?r:"",name:wS.WalletConnect,props:{fill:t?"#ffffff":"#0988f1"}});case"Klever":return W(yS,{className:"small"===n?r:"",name:wS.Klever,props:{}});case"Bitget":return W(jS,{fill:t?"#05C3DD":"#00F0FF"});case"Onekey":return W(FS,{});case"Ledger":return W(yS,{className:"small"===n?r:"",name:wS.Ledger,props:{fill:t?"#ffffff":"#000000"}});case"Cactus Link":return W(DS,{});case"Fordefi":return W(zS,{});case"Trezor":return W($S,{fill:t?"#ffffff":"#171717"});default:return null}},HS=function(){var e,t,n,r=ES(),i=Ee(function(e){return e}),o=i.user,a=i.waitingStatus,s=i.config.appearance;return z("div",{className:"bluxcc:mt-3 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[W("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",style:{borderColor:s.borderColor,borderWidth:s.borderWidth},children:GS(null!==(e=null==o?void 0:o.authValue)&&void 0!==e?e:"",Zx(s.background),"large")}),z("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[W("p",{className:"bluxcc:text-xl",children:"login"===a?r("waitingFor",{walletName:null!==(t=null==o?void 0:o.authValue)&&void 0!==t?t:"wallet"}):r("signingWith",{walletName:null!==(n=null==o?void 0:o.authValue)&&void 0!==n?n:"wallet"})}),W("p",{className:"bluxcc:text-sm",children:r("login"===a?"acceptConnection":"signRequestInWallet")})]}),W(OS,{}),W(BS,{state:"disabled",variant:"outline",startIcon:W(yS,{className:"bluxcc:animate-spin",name:wS.Loading,props:{fill:s.accentColor}}),children:r("login"===a?"connecting":"signing")})]})},VS=function(e){var t=e.assetCode,n=e.assetIssuer,r=e.assetType,i=e.fill,o=e.nativeIcon,a=void 0===o?wS.Stellar:o,s=e.fallbackIcon,c=void 0===s?wS.QuestionMark:s,u=e.className,l=Ee(function(e){return e.assetMeta}),d=Ee(function(e){var t;return null===(t=e.stellar)||void 0===t?void 0:t.activeNetwork}),f=M(!1),h=f[0],p=f[1],b=j(function(){var e;if("native"!==r&&l)return null===(e=l[KA(d,t,n)])||void 0===e?void 0:e.icon},[l,d,t,n,r]);R(function(){return p(!1)},[b]);var m=i?{fill:i}:{};return"native"===r?W(yS,{name:a,props:m,className:u}):b&&!h?W("img",{src:b,alt:t,className:u,onError:function(){return p(!0)},style:{width:40,height:40,objectFit:"contain",borderRadius:"inherit"}}):W(yS,{name:c,props:m,className:u})},YS=function(e){var t=e.handleOpenAssets,n=e.asset,r=Ee(function(e){return e.config.appearance});return z("button",{id:"bluxcc-button",onClick:t,className:"bluxcc:flex bluxcc:bg-transparent bluxcc:items-center bluxcc:gap-1 bluxcc:p-1 bluxcc:max-h-12",style:{fontFamily:r.fontFamily,borderColor:r.borderColor,borderWidth:r.borderWidth,borderRadius:r.borderRadius,backgroundColor:r.fieldBackground,color:r.textColor},children:[W("div",{style:{fontFamily:r.fontFamily,background:r.background,borderRadius:r.borderRadius,borderColor:r.borderColor,borderWidth:r.borderWidth,color:r.textColor},className:"bluxcc:flex bluxcc:mr-0.5 bluxcc:size-10 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-[border-radius] bluxcc:duration-300",children:W(VS,{assetCode:n.assetCode,assetIssuer:n.assetIssuer,assetType:n.assetType,fill:Wx(r.fieldBackground)})}),W("span",{children:n.assetCode}),W(yS,{name:wS.ArrowDropDown,props:{fill:r.accentColor}})]})},JS=function(e){var t,n,r,i=Ee(function(e){return e}),o=M(null),a=o[0],s=o[1],c=null===(t=i.user)||void 0===t?void 0:t.address,u=null===(n=i.stellar)||void 0===n?void 0:n.servers.horizon,l=null===(r=i.stellar)||void 0===r?void 0:r.activeNetwork;return R(function(){var e=!1;if(s(null),c&&u)return u.loadAccount(c).then(function(t){e||s({subentryCount:t.subentry_count,numSponsoring:t.num_sponsoring,numSponsored:t.num_sponsored})}).catch(function(){e||s(null)}),function(){e=!0}},[c,u,l]),jx(e,i.balances.balances,a)},ZS=function(e,t){return e.assetCode===t.assetCode&&e.assetIssuer===t.assetIssuer},QS=function(){var e=ES(),t=M("0"),n=t[0],r=t[1],i=M("0"),o=i[0],a=i[1],s=M(0),c=s[0],u=s[1],l=M(0),d=l[0],f=l[1],h=Ee(function(e){return e}),p=M(!1),b=p[0],m=p[1],g=M([]),v=g[0],y=g[1],w=M({field:"",message:""}),x=w[0],A=w[1],E=M(!1),S=E[0],_=E[1],O=M({rate:0,isInverted:!1}),N=O[0],k=O[1],T=M("from"),C=T[0],I=T[1],B=Mx(h.selectAsset.swapFromAsset,h.balances.balances),L=Mx(h.selectAsset.swapToAsset,h.balances.balances),P=JS(h.selectAsset.swapFromAsset),U=function(e){h.setSelectAsset(Z(Z({},h.selectAsset),{field:e})),h.setRoute(Y.SELECT_ASSET)};R(function(){var e,t=h.selectAsset,n=t.swapFromAsset,r=t.swapToAsset;if(!t.userPicked&&ZS(n,r)){var i=new Set(h.balances.balances.filter(function(e){return"native"!==e.asset_type}).map(function(e){return"".concat(e.asset_code,":").concat(e.asset_issuer)})),o=ce((null===(e=h.stellar)||void 0===e?void 0:e.activeNetwork)||"").find(function(e){return!ZS(e,n)});if(o){var a=i.has("".concat(o.assetCode,":").concat(o.assetIssuer))?h.balances.balances.find(function(e){return e.asset_code===o.assetCode&&e.asset_issuer===o.assetIssuer}):void 0;h.setSelectAsset(Z(Z({},h.selectAsset),{swapToAsset:a?Fx(a):o}))}}},[]);var j=function(e,t){"from"===t?a(e.target.value):r(e.target.value),I(t),_(!S)};R(function(){(y([]),m(!1),A({field:"",message:""}),k({rate:0,isInverted:!1}),isNaN(Number(o))||""===o||Number(o)<0)?A({field:"from",message:e("invalidFromValue")}):isNaN(Number(n))||""===n||Number(n)<0?A({field:"to",message:e("invalidToValue")}):ZS(h.selectAsset.swapFromAsset,h.selectAsset.swapToAsset)?(h.selectAsset.userPicked||Number(o)>0||Number(n)>0)&&A({field:"both",message:e("sameAssetError")}):isNaN(Number(B))?A({field:"from",message:e("fromAssetInvalidBalance")}):Number(o)>Number(P)?A({field:"from",message:e("insufficientBalance")}):0===Number(o)&&0===Number(n)||(A({field:"",message:""}),ee(void 0,void 0,void 0,function(){var t,i,s,c,u;return te(this,function(l){switch(l.label){case 0:if(m(!0),"from"!==C)return[3,5];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,DE([Bx(h.selectAsset.swapFromAsset),o,[Bx(h.selectAsset.swapToAsset)]],{})];case 2:return t=l.sent(),m(!1),i=t.response.records,(s=null!==(c=i.find(function(e){return e.path.length<2}))&&void 0!==c?c:i[0])?(k({rate:Number(s.destination_amount)/Number(s.source_amount),isInverted:!1}),y(ne(ne([h.selectAsset.swapFromAsset],s.path.map(Fx),!0),[h.selectAsset.swapToAsset],!1)),r(s.destination_amount)):A({field:"both",message:e("couldNotFindPath")}),[3,4];case 3:return l.sent(),m(!1),A({field:"both",message:e("couldNotFindPath")}),[3,4];case 4:return[3,8];case 5:return l.trys.push([5,7,,8]),[4,FE([[Bx(h.selectAsset.swapFromAsset)],Bx(h.selectAsset.swapToAsset),n],{})];case 6:return t=l.sent(),m(!1),i=t.response.records,(s=null!==(u=i.find(function(e){return e.path.length<2}))&&void 0!==u?u:i[0])?(k({rate:Number(s.destination_amount)/Number(s.source_amount),isInverted:!1}),y(ne(ne([h.selectAsset.swapFromAsset],s.path.map(Fx),!0),[h.selectAsset.swapToAsset],!1)),a(s.source_amount)):A({field:"both",message:e("couldNotFindPath")}),[3,8];case 7:return l.sent(),m(!1),A({field:"both",message:e("couldNotFindPath")}),[3,8];case 8:return[2]}})}))},[h.selectAsset,S,P]);var F=h.config.appearance,D="";0!==N.rate&&(D=N.isInverted?"1 ".concat(h.selectAsset.swapToAsset.assetCode," = ").concat((1/N.rate).toFixed(5)," ").concat(h.selectAsset.swapFromAsset.assetCode):"1 ".concat(h.selectAsset.swapFromAsset.assetCode," = ").concat(Yx(N.rate)," ").concat(h.selectAsset.swapToAsset.assetCode));var $="",X=""!==o&&"0"!==o&&Number(o)>=0&&!isNaN(Number(o)),q=""!==n&&"0"!==n&&Number(n)>=0&&!isNaN(Number(n));X&&q&&!b&&($="".concat((Number(n)/100*99.5).toFixed(5)," ").concat(h.selectAsset.swapToAsset.assetCode));var K=[{label:e("rate"),value:0!==N.rate&&q?z("span",{className:"bluxcc:flex bluxcc:gap-1.5 bluxcc:items-center",children:[D,W("button",{id:"bluxcc-button",onClick:function(){f(function(e){return e+180}),k(Z(Z({},N),{isInverted:!N.isInverted}))},type:"button",className:"bluxcc:transition-transform bluxcc:duration-300 bluxcc:bg-transparent",style:{transform:"rotate(".concat(d,"deg)"),fontFamily:F.fontFamily},children:W(yS,{name:wS.SmallSwap,props:{fill:Vx(F.textColor,.7)}})})]}):"—"},{label:e("path"),value:(null==v?void 0:v.length)?v.map(function(e){return e.assetCode}).join(" > "):"—"},{label:e("minimumReceived"),value:q?$:"—"}];return z("form",{onSubmit:function(t){return ee(void 0,void 0,void 0,function(){var r;return te(this,function(i){switch(i.label){case 0:if(t.preventDefault(),""!==x.message)return[2];if(ZS(h.selectAsset.swapFromAsset,h.selectAsset.swapToAsset))return A({field:"both",message:e("sameAssetError")}),[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,cS({fromAsset:Bx(h.selectAsset.swapFromAsset),toAsset:Bx(h.selectAsset.swapToAsset),amount:"from"===C?o:n,type:"from"===C?"exactIn":"exactOut"})];case 2:return r=i.sent(),h.closeModal(),setTimeout(function(){IA(r).catch(function(){})},400),[3,4];case 3:return i.sent(),A({field:"both",message:e("failedToMakeTransaction")}),[3,4];case 4:return[2]}})})},children:[z("div",{className:"bluxcc:relative bluxcc:w-full bluxcc:p-4",style:{backgroundColor:F.fieldBackground,borderColor:F.borderColor,borderRadius:F.borderRadius,borderWidth:F.borderWidth,fontFamily:F.fontFamily},children:[z("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:text-sm bluxcc:select-none",children:[W("span",{style:{color:Vx(F.textColor,.7)},children:e("from")}),z("span",{style:{fontFamily:F.fontFamily},children:[W("button",{id:"bluxcc-button",className:"bluxcc:bg-transparent bluxcc:border-none",style:{color:Vx(F.textColor,.7),fontFamily:F.fontFamily},children:Yx(B)}),z("button",{type:"button",id:"bluxcc-button",onClick:function(){I("from"),_(!S),a(P)},style:{color:F.accentColor,fontFamily:F.fontFamily},className:"bluxcc:mr-2 bluxcc:ml-1.5 bluxcc:inline-flex bluxcc:bg-transparent",children:[e("max")," ",W(yS,{name:wS.ArrowDropUp,props:{fill:F.accentColor}})]})]})]}),z("div",{className:"bluxcc:mt-2 bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[W("input",{name:"from",type:"number",value:o,onChange:function(e){j(e,"from")},id:"bluxcc-input",className:"bluxcc:w-full bluxcc:bg-transparent bluxcc:text-xl bluxcc:font-medium bluxcc:outline-none",style:{color:"from"===x.field||"both"===x.field?"#ec2929":F.textColor,fontFamily:F.fontFamily}}),W(YS,{asset:h.selectAsset.swapFromAsset,handleOpenAssets:function(){U("swapFrom")}})]}),W("div",{className:"bluxcc:mt-1 bluxcc:text-left bluxcc:text-xs",style:{color:Vx(F.textColor,.7)}}),z("button",{type:"button",id:"bluxcc-button",className:"bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center bluxcc:bg-transparent",children:[W("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0",style:{borderTopWidth:F.borderWidth,borderTopStyle:"solid",borderTopColor:F.borderColor}}),W("div",{onClick:function(){var e=h.selectAsset.swapFromAsset,t=h.selectAsset.swapToAsset;u(function(e){return e+180}),h.setSelectAsset(Z(Z({},h.selectAsset),{swapFromAsset:t,swapToAsset:e}))},className:"bluxcc:z-20 bluxcc:p-2 bluxcc:transition-all bluxcc:duration-200",style:{backgroundColor:F.fieldBackground,borderColor:F.borderColor,borderRadius:F.borderRadius,borderWidth:F.borderWidth},children:W("div",{className:"bluxcc:transition-transform bluxcc:duration-300",style:{transform:"rotate(".concat(c,"deg)")},children:W(yS,{name:wS.Swap,props:{fill:F.accentColor}})})})]}),z("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:text-sm bluxcc:select-none",style:{color:Vx(F.textColor,.7)},children:[W("span",{children:e("to")}),W("span",{className:"bluxcc:mr-2",children:Yx(L)})]}),z("div",{className:"bluxcc:mt-2 bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[W("input",{name:"to",id:"bluxcc-input",type:"number",value:n,onChange:function(e){j(e,"to")},className:"bluxcc:w-full bluxcc:bg-transparent bluxcc:text-xl bluxcc:font-medium bluxcc:outline-none",style:{color:"to"===x.field||"both"===x.field?"#ec2929":F.textColor,fontFamily:F.fontFamily}}),W(YS,{asset:h.selectAsset.swapToAsset,handleOpenAssets:function(){U("swapTo")}})]}),W("div",{className:"bluxcc:mt-1 bluxcc:text-left bluxcc:text-xs",style:{color:Vx(F.textColor,.7)}})]}),W("div",{className:"bluxcc:h-3.5 bluxcc:my-1.25 bluxcc:mx-3 bluxcc:text-left bluxcc:text-xs bluxcc:text-alert-error",children:x.message}),W("div",{style:{borderColor:F.borderColor,borderRadius:F.borderRadius,borderWidth:F.borderWidth},className:"bluxcc:w-full bluxcc:py-3 bluxcc:px-4",children:K.map(function(t,n,r){return z("div",{children:[z("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:items-center bluxcc:text-xs bluxcc:font-medium",children:[W("span",{style:{color:Vx(F.textColor,.8)},children:t.label}),W("span",{style:{color:Vx(F.textColor,.7)},children:b?"".concat(e("loading"),"..."):t.value})]}),n!==r.length-1&&W("div",{className:"bluxcc:my-2",style:{borderRadius:F.borderRadius,borderTop:"".concat(F.borderWidth," dashed ").concat(F.borderColor)}})]},t.label)})}),W(OS,{}),W(BS,{size:"large",state:"enabled",variant:"outline",type:"submit",disabled:""!==x.message,children:e("swap")})]})},e_=function(e){var t=e.button,n=e.onButtonClick,r=e.appearance;return W("button",{onClick:n,id:"bluxcc-button",style:{borderRadius:r.borderRadius,color:r.textColor,borderColor:r.borderColor,background:r.background,borderWidth:r.borderWidth},className:"bluxcc:border bluxcc:px-3! bluxcc:py-1! bluxcc:text-sm! bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",children:t})},t_=function(e){var t=e.label,n=e.autoFocus,r=e.type,i=void 0===r?"text":r,o=e.placeholder,a=void 0===o?"":o,s=e.error,c=e.iconRight,u=e.iconLeft,l=e.button,d=e.optionalField,f=void 0!==d&&d,h=e.onButtonClick,p=e.customLabel,b=e.value,m=e.className,g=e.onChange,v=Ee(function(e){return e.config.appearance}),y=M(!1),w=y[0],x=y[1],A=ES(),E=function(){return s?"#ec2929":w?v.accentColor:v.borderColor};return z("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col",style:{fontFamily:v.fontFamily},children:[t&&z("label",{style:{color:s?"#ec2929":v.textColor},className:"bluxcc:mb-2 bluxcc:ml-4 bluxcc:flex bluxcc:justify-between bluxcc:text-xs",children:[z("span",{children:[t," ",f&&z("span",{style:{color:Vx(v.textColor,.7)},className:"bluxcc:text-[10px]",children:["(",A("optional"),")"]})]}),W("span",{children:p})]}),z("div",{className:"bluxcc:flex bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:px-4 bluxcc:py-2 bluxcc:transition-all bluxcc:duration-300 ".concat(m),onFocus:function(){return x(!0)},onBlur:function(){return x(!1)},onMouseEnter:function(e){w||s||(e.currentTarget.style.borderColor=v.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){w||(e.currentTarget.style.borderColor=s?"#ec2929":v.borderColor)},style:{"--tw-ring-color":E(),border:"".concat(v.borderWidth," solid ").concat(E()),borderRadius:v.borderRadius,backgroundColor:v.fieldBackground},children:[u&&W("div",{className:"bluxcc:mr-2",children:u}),W("input",{id:"bluxcc-input",autoComplete:"off",min:"number"===i?1:void 0,type:i,autoFocus:n,value:b,placeholder:a,className:"bluxcc:mr-2! bluxcc:bg-transparent bluxcc:outline-hidden bluxcc:text-base bluxcc:font-medium",style:{fontFamily:v.fontFamily,color:v.textColor,width:l?"90%":"100%"},onChange:g}),l&&W(e_,{button:l,onButtonClick:h,appearance:v}),c&&W("div",{className:"bluxcc:ml-4",children:c})]}),!f&&W("div",{className:"bluxcc:mt-1 bluxcc:text-xs bluxcc:ml-4 bluxcc:h-4",children:s?W("p",{className:"bluxcc:text-alert-error",children:s}):""})]})},n_=function(e,t,n,r,i,a,s){for(var c=[],u=7;u<arguments.length;u++)c[u-7]=arguments[u];return ee(void 0,ne([e,t,n,r,i,a,s],c,!0),void 0,function(e,t,n,r,i,a,s,c){var u,l,d,f;return void 0===c&&(c="text"),te(this,function(p){switch(p.label){case 0:u=null,l=null,p.label=1;case 1:return p.trys.push([1,3,,4]),[4,a.loadAccount(n)];case 2:return l=p.sent(),[3,4];case 3:return p.sent(),[3,4];case 4:return p.trys.push([4,6,,7]),[4,a.loadAccount(i)];case 5:return u=p.sent(),[3,7];case 6:return p.sent(),[3,7];case 7:if(!u)throw new Error("BLUX: Inactive account cannot send a transaction.");if(!l&&"native"!==r.assetType)throw new Error("BLUX: Cannot send non-native asset to an inactive account.");return d=new h(u,{fee:"50000",networkPassphrase:s}),l?(f=o.native(),"native"!==r.assetType&&(f=new o(r.assetCode,r.assetIssuer)),d=d.addOperation(g.payment({amount:t,destination:n,asset:f}))):d=d.addOperation(g.createAccount({startingBalance:t,destination:n})),e&&(d="id"===c?d.addMemo(v.id(e)):"hash"===c?d.addMemo(v.hash(e)):d.addMemo(v.text(e))),[2,d.setTimeout(180).build().toXDR()]}})})},r_=function(){var e=ES(),t=Ee(function(e){return e}),n=M({}),r=n[0],o=n[1],a=M({memo:"",amount:"",address:""}),s=a[0],c=a[1],u=t.config.appearance,l=function(e){return function(t){c(function(n){var r;return Z(Z({},n),((r={})[e]=t.target.value,r))}),o(function(t){var n;return Z(Z({},t),((n={})[e]="",n))})}},d=JS(t.selectAsset.sendAsset);return W($,{children:z("div",{children:[W("div",{className:"bluxcc:relative bluxcc:mb-1",children:W(t_,{autoFocus:!0,type:"number",label:e("amount"),placeholder:"0.00",value:s.amount,onChange:l("amount"),error:r.amount,customLabel:z("button",{id:"bluxcc-button",type:"button",onClick:function(){c(function(e){return Z(Z({},e),{amount:d})})},style:{color:u.accentColor,fontFamily:u.fontFamily},className:"bluxcc:mr-2 bluxcc:inline-flex bluxcc:bg-transparent",children:[e("max")," ",W(yS,{name:wS.ArrowDropUp,props:{fill:u.accentColor}})]}),onButtonClick:function(){t.setSelectAsset(Z(Z({},t.selectAsset),{field:"send"})),t.setRoute(Y.SELECT_ASSET)},button:z("span",{className:"bluxcc:flex bluxcc:bg-transparent bluxcc:items-center bluxcc:gap-1 bluxcc:max-h-8",style:{backgroundColor:u.fieldBackground},children:[W("div",{style:{fontFamily:u.fontFamily,background:u.background,borderRadius:u.borderRadius,borderColor:u.borderColor,borderWidth:u.borderWidth,color:u.textColor},className:"bluxcc:flex bluxcc:mr-2 bluxcc:size-7 bluxcc:shrink-0 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:transition-[border-radius] bluxcc:duration-300",children:W(VS,{assetCode:t.selectAsset.sendAsset.assetCode,assetIssuer:t.selectAsset.sendAsset.assetIssuer,assetType:t.selectAsset.sendAsset.assetType,fill:Wx(u.fieldBackground)})}),W("span",{style:{fontFamily:u.fontFamily,color:u.textColor},children:t.selectAsset.sendAsset.assetCode}),W(yS,{name:wS.ArrowDropDown,props:{fill:u.accentColor}})]})})}),W("div",{className:"bluxcc:mb-1",children:W(t_,{label:e("to"),placeholder:e("enterAddress"),value:s.address,onChange:l("address"),error:r.address,button:e("paste"),onButtonClick:function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:return[4,navigator.clipboard.readText()];case 1:return e=t.sent(),c(function(t){return Z(Z({},t),{address:e})}),[2]}})})}})}),W("div",{children:W(t_,{optionalField:!0,label:e("memo"),placeholder:e("enterMemo"),value:s.memo,onChange:l("memo")})}),W(OS,{}),W(BS,{size:"large",variant:"outline",state:"enabled",onClick:function(){return ee(void 0,void 0,void 0,function(){var n,r,a,c,u,l;return te(this,function(f){switch(f.label){case 0:if(n={},s.amount?Number(s.amount)>Number(d)&&(n.amount=e("amountExceedsBalance")):n.amount=e("amountRequired"),s.address?i.isValidEd25519PublicKey(s.address)||(n.address=e("addressInvalid")):n.address=e("addressRequired"),o(n),0!==Object.keys(n).length)return[3,4];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,n_(s.memo,s.amount,s.address,t.selectAsset.sendAsset,null===(c=t.user)||void 0===c?void 0:c.address,null===(u=t.stellar)||void 0===u?void 0:u.servers.horizon,(null===(l=t.stellar)||void 0===l?void 0:l.activeNetwork)||"")];case 2:return r=f.sent(),t.closeModal(),setTimeout(function(){var e;IA(r,{network:(null===(e=t.stellar)||void 0===e?void 0:e.activeNetwork)||""})},400),[3,4];case 3:return a=f.sent(),n.address=a.message,o(n),[3,4];case 4:return[2]}})})},children:e("sendButton")})]})})},i_=function(e){var t=e.otp,n=e.setOtp,r=e.error,i=t.length,o=P([]),a=Ee(function(e){return e.config.appearance});R(function(){r&&setTimeout(function(){var e;return null===(e=o.current[0])||void 0===e?void 0:e.focus()},1001)},[r]);var s=function(e){e.preventDefault();var t=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,i);if(t){var r=ne(ne([],t.split(""),!0),Array(i-t.length).fill(""),!0);n(r),setTimeout(function(){var e;return null===(e=o.current[i-1])||void 0===e?void 0:e.focus()},0)}},c=function(e){return{fontFamily:a.fontFamily,borderRadius:a.borderRadius,color:a.accentColor,background:a.fieldBackground,"--tw-ring-color":r?"#FF6666":a.accentColor,borderColor:r?"#FF6666":e?a.accentColor:a.borderColor,borderWidth:a.borderWidth}};return W("div",{className:"bluxcc:flex bluxcc:gap-1",children:t.map(function(e,r){return W("input",{autoFocus:0===r,ref:function(e){o.current[r]=e},type:"text",inputMode:"numeric",maxLength:1,value:e,onChange:function(e){return function(e,r){var a,s=r.target.value.replace(/\D/g,"");if(s){var c=ne([],t,!0);c[e]=s[0],n(c),e<i-1&&s&&(null===(a=o.current[e+1])||void 0===a||a.focus())}}(r,e)},onPaste:s,onKeyDown:function(e){return function(e,r){var i;if("Backspace"===r.key){var a=ne([],t,!0);a[e]?(a[e]="",n(a)):e>0&&(null===(i=o.current[e-1])||void 0===i||i.focus(),a[e-1]="",n(a))}}(r,e)},className:"bluxcc:h-14 bluxcc:w-12 bluxcc:border bluxcc:text-center bluxcc:text-lg bluxcc:outline-hidden bluxcc:focus:ring-1",style:c(e)},r)})})},o_=function(){var e=ye();e.login&&(e.user&&e.user.address&&e.authState.isAuthenticated?e.login.resolver(e.user):e.login.rejecter("BLUX: Failed to login!"),e.setLogin(void 0))},a_=function(){var e,t=ye(),n=null===(e=t.auth)||void 0===e?void 0:e.JWT;n&&(localStorage.setItem(Oe,n),t.setAuth({isAuthenticated:!0,JWT:n}),t.user&&EA(t.user.authMethod,t.user.authValue||"",Date.now(),n)),t.setIsAuthenticated(!0),t.closeModal(),o_();var r=ye();r.user&&r.emitter.emit(re.LoggedIn,{user:r.user})},s_=function(e){void 0===e&&(e="BLUX: User declined the terms of service.");var t=ye();t.login&&(t.login.rejecter(e),t.setLogin(void 0)),localStorage.removeItem(Oe),SA(),t.logoutAction()},c_=function(){var e=ye();e.apiResponse&&(e.apiResponse.privacyPolicy||e.apiResponse.terms)?e.setRoute(Y.ACCEPT_TERMS_AND_PRIVACY):a_()},u_=function(){var e=ES(),t=Ee(function(e){return e}),n=t.user,r=t.config.appearance,i=null==n?void 0:n.authValue,o="sms"===(null==n?void 0:n.authMethod)||"phone"===(null==n?void 0:n.authMethod),a=M(Array(6).fill("")),s=a[0],c=a[1],u=M(!1),l=u[0],d=u[1];return R(function(){var e,n=s.join("");6===n.length&&(e=n,ee(void 0,void 0,void 0,function(){var n,r,i,o;return te(this,function(a){switch(a.label){case 0:d(!1),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,Ue(t.config.appId,t.user,e)];case 2:return(n=a.sent())?(d(!1),t.setAuth({isAuthenticated:!1,JWT:n}),[4,je(n)]):[3,4];case 3:r=a.sent(),t.connectWalletSuccessful(r.public_key,(null===(o=t.stellar)||void 0===o?void 0:o.activeNetwork)||""),setTimeout(function(){ye().modal.isOpen&&(t.setRoute(Y.SUCCESSFUL),setTimeout(function(){ye().modal.isOpen&&c_()},1e3))}),a.label=4;case 4:return[3,6];case 5:return i=a.sent(),_e(i)?(t.setLoginError(i.message),t.setRoute(Y.FAILED),[2]):(d(!0),setTimeout(function(){return c(Array(6).fill(""))},1e3),[3,6]);case 6:return[2]}})}))},[s,i]),z("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[W("div",{style:{borderColor:r.borderColor,borderWidth:r.borderWidth},className:"bluxcc:mb-6 bluxcc:flex bluxcc:h-20 bluxcc:w-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full bluxcc:border-2",children:o?W(KS,{fill:r.textColor}):W(yS,{name:wS.Email,props:{fill:r.textColor}})}),z("div",{className:"bluxcc:flex-col bluxcc:space-y-1 bluxcc:text-center",children:[W("p",{className:"bluxcc:text-xl bluxcc:font-medium",children:e("enterConfirmationCodeTitle")}),W("p",l?{className:"bluxcc:flex bluxcc:h-10 bluxcc:items-center bluxcc:justify-center bluxcc:text-sm bluxcc:text-alert-error",children:e("invalidCodeError")}:{className:"bluxcc:h-10 bluxcc:text-sm",children:e(o?"enterConfirmationCodeHelpSms":"enterConfirmationCodeHelp")})]}),W("div",{className:"bluxcc:mt-6 bluxcc:text-center",children:W(i_,{otp:s,setOtp:c,error:l})}),W(OS,{}),W(BS,{size:"medium",state:"enabled",variant:"text",onClick:function(){return ee(void 0,void 0,void 0,function(){var e,n;return te(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Me(t.config.appId,(null===(n=t.user)||void 0===n?void 0:n.authValue)||"",o?"sms":"email")];case 1:return r.sent(),[3,3];case 2:return e=r.sent(),_e(e)&&(t.setLoginError(e.message),t.setRoute(Y.FAILED)),[3,3];case 3:return[2]}})})},style:{color:r.accentColor},children:e("resendCode")})]})},l_=function(){var e,t,n,r=ES(),i=Ee(function(e){return e}),o="";"object"==typeof(null===(e=i.sendTransaction)||void 0===e?void 0:e.result)&&i.sendTransaction.result.hash&&(o=i.sendTransaction.result.hash);var a=(null===(n=null===(t=i.sendTransaction)||void 0===t?void 0:t.options)||void 0===n?void 0:n.network)||"",s=o?Xx(a,i.config.explorer,"transactionUrl",o):null,c=function(){switch(i.waitingStatus){case"login":return{title:r("connectionSuccessfulTitle"),message:r("connectionSuccessfulMessage",{appName:Dx(i.config.appName)})};case"signMessage":return{title:r("messageSignedTitle")||"Message Signed",message:r("messageSignedMessage")||"Your message has been signed successfully."};case"signAuthEntry":return{title:r("authEntrySignedTitle")||"Authorization Signed",message:r("authEntrySignedMessage")||"Authorization has been signed successfully."};default:return{title:r("transactionSuccessfulTitle"),message:r("transactionSuccessfulMessage")}}}(),u=c.title,l=c.message;return z("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[W("div",{style:{background:Vx(i.config.appearance.accentColor,.1)},className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",children:W(yS,{name:wS.GreenCheck,props:{fill:i.config.appearance.accentColor}})}),z("div",{className:"bluxcc:w-full bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[W("p",{className:"bluxcc:text-xl",children:u}),W("p",{className:"bluxcc:text-center bluxcc:text-sm bluxcc:leading-5",children:l})]}),"sendTransaction"===i.waitingStatus&&o&&"string"==typeof s&&W(BS,{state:"enabled",variant:"outline",size:"small",className:"bluxcc:mt-4",onClick:function(){s&&window.open(s,"_blank","noopener,noreferrer")},children:r("seeInExplorer")}),W(OS,{}),"login"===i.waitingStatus?W(BS,{state:"disabled",variant:"outline",children:r("loggingIn")}):W(BS,{state:"enabled",variant:"fill",size:"large",onClick:function(){var e=i.waitingStatus;if("sendTransaction"===e&&i.sendTransaction){var t=i.sendTransaction,n=t.resolver,r=t.result;n&&r&&n(r)}else if("signMessage"===e&&i.signMessage){var o=i.signMessage;n=o.resolver,r=o.result;n&&r&&n(r)}else if("signAuthEntry"===e&&i.signAuthEntry){var a=i.signAuthEntry;n=a.resolver,r=a.result;n&&r&&n(r)}setTimeout(function(){i.cleanUp(e),i.closeModal()},150)},children:r("done")})]})},d_=function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i,o,a,s,c,u,l,d,f;return te(this,function(h){switch(h.label){case 0:e.connectWallet(t.name),h.label=1;case 1:return h.trys.push([1,15,,16]),[4,t.connect()];case 2:if(!(n=h.sent())||""===n.trim())return[2];r=void 0,h.label=3;case 3:return h.trys.push([3,12,,13]),t.authenticateWithSignedMessage?[4,Re(e.config.appId,t.name,n,"signed_message")]:[3,7];case 4:if(i=h.sent(),o=i.challenge,u=i.network_passphrase,!o)throw new Error("BLUX: Login challenge is missing.");return[4,dA(t,o,n,u)];case 5:return a=h.sent(),[4,Pe(e.config.appId,a,{proofType:"signed_message",challenge:o})];case 6:return r=h.sent(),[3,11];case 7:return[4,Re(e.config.appId,t.name,n)];case 8:if(s=h.sent(),c=s.challenge_xdr,u=s.network_passphrase,!c)throw new Error("BLUX: Login challenge is missing.");return[4,bA(t,c,n,u)];case 9:return l=h.sent(),[4,Pe(e.config.appId,l)];case 10:r=h.sent(),h.label=11;case 11:return[3,13];case 12:return d=h.sent(),_e(d)&&e.setLoginError(d.message),e.setRoute(Y.FAILED),[2];case 13:return[4,Hx(t)];case 14:return f=h.sent(),e.setAuth({isAuthenticated:!1,JWT:r}),p=t.name,b=qx(),m=ne([p],b.filter(function(e){return e!==p}),!0),localStorage.setItem(Ne,JSON.stringify(m)),setTimeout(function(){ye().modal.isOpen&&(e.connectWalletSuccessful(n,f),e.setRoute(Y.SUCCESSFUL),setTimeout(function(){ye().modal.isOpen&&c_()},1e3))},500),[3,16];case 15:return h.sent(),e.setRoute(Y.FAILED),[3,16];case 16:return[2]}var p,b,m})})},f_=!1,h_=function(e){return ee(void 0,void 0,void 0,function(){return te(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e.connect({optionalNamespaces:{stellar:{methods:["stellar_signXDR","stellar_signAndSubmitXDR","stellar_signMessage"],chains:[ke,Te],events:[]}}})];case 1:return[2,t.sent()];case 2:return t.sent(),[2,null];case 3:return[2]}})})},p_={google:{displayName:"Google",icon:wS.Google}},b_=["wallet","sms","email","passkey"],m_=new Set,g_=function(e,t){m_.has(e)||m_.add(e)},v_=function(e,t){if(!t||!t.isValid)return[];for(var n=new Set(t.socials.map(function(e){return e.toLowerCase()})),r=[],i=0,o=e;i<o.length;i++){var a=o[i],s=String(a).toLowerCase().trim();b_.includes(s)||(p_[s]&&n.has(s)?r.includes(s)||r.push(s):g_(s))}return r},y_=null,w_=function(){if((null==y_?void 0:y_.popup)&&!y_.popup.closed)try{y_.popup.close()}catch(e){}y_=null},x_=function(){try{return new URL(Ce).origin}catch(e){return""}}(),A_=function(e,t){if(w_(),!p_[e]||!t)return y_={provider:e,popup:null,error:"BLUX: '".concat(e,"' login is not fully configured for this app.")};var n=new URLSearchParams({app_id:t,origin:window.location.origin}),r=window.screenX+Math.max(0,(window.outerWidth-480)/2),i=window.screenY+Math.max(0,(window.outerHeight-640)/2),o=window.open("".concat(Ce,"/auth/social/").concat(encodeURIComponent(e),"/start?").concat(n.toString()),"bluxcc-social-login","popup=yes,width=".concat(480,",height=").concat(640,",left=").concat(r,",top=").concat(i));return y_={provider:e,popup:o}},E_=function(e){return new Promise(function(t,n){if(e.error)n(new Error(e.error));else if(e.popup){var r,i,o=Date.now(),a=!1,s=function(){var t;a=!0,clearInterval(r),i&&clearTimeout(i),window.removeEventListener("message",u);try{null===(t=e.popup)||void 0===t||t.close()}catch(e){}},c=function(e){a||(s(),n(new Error(e)))},u=function(e){if(!x_||e.origin===x_){var n,r=e.data||{};if("blux"===r.source&&"social-auth"===r.type)"success"===r.status&&r.jwt?(n=r.jwt,a||(s(),t(n))):c(r.error?"BLUX: ".concat(r.error):"BLUX: Login failed. Please try again.")}};window.addEventListener("message",u),r=setInterval(function(){if(!a)if(Date.now()-o>3e5)c("BLUX: Login timed out. Please try again.");else{var t=e.popup;t&&!t.closed||(clearInterval(r),i=setTimeout(function(){c("BLUX: The login window was closed.")},700))}},400)}else n(new Error("BLUX: Popup was blocked. Please allow popups and try again."))})},S_=function(){var e,t=ES(),n=Ee(function(e){return e}),r=M(""),i=r[0],o=r[1],a=M(""),s=a[0],c=a[1],u=n.config,l=n.wallets,d=n.connectEmail,f=n.connectSms,h=n.setShowAllWallets,p=u.appearance,b=u.loginMethods||[],m=b.includes("passkey"),g=b.includes("sms")&&!0===(null===(e=n.apiResponse)||void 0===e?void 0:e.smsEnabled),v=j(function(){return v_(b,n.apiResponse)},[b,n.apiResponse]),y=j(function(){var e=ne([],b,!0).filter(function(e){return"passkey"!==e});return ne(ne([],e,!0),m?["passkey"]:[],!0)},[b,m]),w=j(function(){return l.length>3?l.slice(2):[]},[l]),x=j(function(){return l.length<=3?l:n.showAllWallets?l.slice(2,l.length):l.slice(0,2)},[l,n.showAllWallets]);R(function(){n.walletConnect&&h_(n.walletConnect.client).then(function(e){n.setWalletConnectClient(n.walletConnect.client,e)}).catch(function(e){})},[]);var A=function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:n.setLoginError(void 0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Me(u.appId,i)];case 2:return t.sent(),d(i),[3,4];case 3:return e=t.sent(),_e(e)&&(n.setLoginError(e.message),n.setRoute(Y.FAILED)),[3,4];case 4:return[2]}})})},E=function(){return ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:n.setLoginError(void 0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Me(u.appId,s,"sms")];case 2:return t.sent(),f(s),[3,4];case 3:return e=t.sent(),_e(e)&&(n.setLoginError(e.message),n.setRoute(Y.FAILED)),[3,4];case 4:return[2]}})})},S=function(){n.setRoute(Y.PASSKEY_ONBOARDING)},_=function(){return z("div",{className:"bluxcc:my-1 bluxcc:flex bluxcc:h-8 bluxcc:w-full bluxcc:items-center bluxcc:justify-center",children:[W("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:z-10",style:{borderTop:"".concat(p.borderWidth," dashed ").concat(p.borderColor)}}),W("span",{className:"bluxcc:z-20 bluxcc:w-auto bluxcc:px-2 bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",style:{background:p.background,color:p.borderColor},children:t("or")})]})};return z("div",{className:"bluxcc:w-full",children:[p.logo&&W("div",{className:"bluxcc:my-6 bluxcc:flex bluxcc:max-h-20 bluxcc:w-full bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden",children:W("img",{src:p.logo,alt:u.appName,width:152,height:60,className:"bluxcc:max-h-20 bluxcc:max-w-45 bluxcc:select-none",loading:"eager",decoding:"async",draggable:"false",style:{contentVisibility:"auto"}})}),W("div",{className:"",children:y.map(function(e,r){var i=function(e){return String(e||"").toLowerCase().trim()},a=i(e),s=y[r+1],u=y.includes("wallet"),l=function(e){return"email"===e||"sms"===e&&g||v.includes(i(e))},d=u&&!n.showAllWallets&&"wallet"===e&&l(s)||u&&l(e)&&"wallet"===s;if("wallet"===e)return W(L.Fragment,{children:z("div",{className:"bluxcc:max-h-81 bluxcc:space-y-2 bluxcc:overflow-y-auto bluxcc:overflowStyle",children:[x.map(function(e){return W(TS,Z({},e,{label:e.name,startIcon:GS(e.name,Zx(p.background)),onClick:function(){return t=e,ee(void 0,void 0,void 0,function(){return te(this,function(e){return t.name===H.WalletConnect?n.setRoute(Y.WALLET_CONNECT):d_(n,t),[2]})});var t}}),e.name)}),w.length>0&&!n.showAllWallets&&W(TS,{endArrow:!0,label:t("allStellarWallets"),startIcon:W(yS,{name:wS.Stellar,props:{fill:Wx(p.background)}}),onClick:function(){h(!0)}}),d&&_()]})},"wallet");if(!n.showAllWallets&&v.includes(a)){if(y.findIndex(function(e){return i(e)===a})!==r)return null;var f=p_[a];return z(L.Fragment,{children:[W("div",{className:"bluxcc:mb-2",children:W(TS,{label:t("continueWith",{provider:f.displayName}),startIcon:W(yS,{name:f.icon}),onClick:function(){return function(e){A_(e,n.config.appId),n.connectSocial(e)}(a)}})}),d&&_()]},a)}return n.showAllWallets||"email"!==e?!n.showAllWallets&&"sms"===e&&g?z(L.Fragment,{children:[W("div",{className:"bluxcc:mb-2",children:W(TS,{inputType:"tel",variant:"input",placeholder:t("phone"),startIcon:W(KS,{fill:p.textColor}),onChange:function(e){return c(e)},onEnter:E,onSubmit:E})}),d&&_()]},"sms"):n.showAllWallets||"passkey"!==e?null:W("button",{onClick:S,className:"bluxcc:mt-6! bluxcc:w-full bluxcc:bg-transparent bluxcc:flex bluxcc:h-4 bluxcc:items-center bluxcc:justify-center bluxcc:text-sm bluxcc:leading-7 bluxcc:font-medium",style:{color:p.accentColor,fontFamily:p.fontFamily},children:t("logInWithPasskey")},"passkey"):z(L.Fragment,{children:[W("div",{className:"bluxcc:mb-2",children:W(TS,{inputType:"email",variant:"input",startIcon:W(yS,{name:wS.SmallEmail,props:{fill:p.textColor}}),onChange:function(e){return o(e)},onEnter:A,onSubmit:A})}),d&&_()]},"email")})}),W("footer",{className:"bluxcc:w-full bluxcc:pt-4.25 bluxcc:text-center bluxcc:text-xs bluxcc:font-medium",children:W("a",{"aria-label":"blux website",href:"https://blux.cc",target:"_blank",rel:"noreferrer",className:"bluxcc:no-underline",style:{color:p.textColor,fontFamily:p.fontFamily},children:t("poweredByBlux")})})]})},__=function(e){var t=e.value,n=e.title,r=void 0===n?"":n,i=e.size,o=void 0===i?184:i,a=e.bgColor,s=void 0===a?"#ffffff":a,c=e.fgColor,u=void 0===c?"#00020f":c,l=e.level,d=void 0===l?"Q":l,f=e.imgSize,h=void 0===f?51:f,p=Q(e,["value","title","size","bgColor","fgColor","level","imgSize"]);return W(K,Z({className:"bluxcc:z-10",value:t,title:r,size:o,bgColor:s,fgColor:u,level:d,marginSize:1,imageSettings:{src:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBw8NDQ8NDQ0PDQ0PDw4NDw0NDQ8PDQ0NFREWFhURExUYHSggGBolGxUVITEhJSkrLi4uFx8zODMsNygtLisBCgoKDQ0OFQ4PFSsdExkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIAKwBJgMBIgACEQEDEQH/xAAXAAEBAQEAAAAAAAAAAAAAAAAAAQIH/8QAIRABAQABBAAHAAAAAAAAAAAAAAERAiFhgSIxQVFxsfD/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8A7iAAACW8d+ygAAACSAoAAAAAAAAAAAAAAADOrVZZJptluLczwzFub9dtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmd/LtQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABLwoAAAAAQAAAAAAAAAAAAAAAAAABL+5UAAAAAAAAAAAEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAJYCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAARQAAAAAAAAAAAAEwoAAAACSqAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAS59NvmZ2yoAAAAAAAAAAAAACAomFAAAAAAAABKoAAAAA//2Q==",x:void 0,y:void 0,height:h,width:h,opacity:1,excavate:!0}},p))},O_=function(){var e,t=ES(),n=Ee(function(e){return e}),r=Ee(function(e){return e}).setAlert,i=n.config.appearance,o=null===(e=n.user)||void 0===e?void 0:e.address;return z("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:[z("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:size-52 bluxcc:items-center bluxcc:justify-center",style:{position:"relative",borderRadius:i.borderRadius,color:i.textColor,borderColor:i.borderColor,backgroundColor:i.fieldBackground,borderWidth:i.borderWidth},children:[W(__,{size:184,value:o,bgColor:i.fieldBackground,fgColor:i.accentColor,level:"Q"}),W("div",{className:"bluxcc:z-20",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:i.background},children:W(yS,{name:wS.SmallBlux,props:{fill:i.accentColor,background:i.fieldBackground}})})]}),z("div",{className:"bluxcc:mt-4 bluxcc:space-y-2 bluxcc:font-medium",children:[W("p",{className:"bluxcc:text-lg",children:"Your Address"}),W("div",{className:"bluxcc:w-full bluxcc:px-2.5 bluxcc:py-3 bluxcc:h-14",style:{borderRadius:i.borderRadius,color:i.textColor,borderColor:i.borderColor,backgroundColor:i.fieldBackground,borderWidth:i.borderWidth},children:W("p",{className:"bluxcc:w-73 bluxcc:text-sm bluxcc:leading-4! bluxcc:break-all",style:{color:Vx(i.textColor,.7)},children:o})})]}),W(OS,{}),W(BS,{size:"large",state:"enabled",variant:"tonal",style:{color:i.accentColor},onClick:function(){zx(o),r("copy",t("address_copied")),setTimeout(function(){r("none","")},1e3)},endIcon:W(yS,{name:wS.LargeCopy,props:{fill:i.accentColor}}),children:t("copy_address")})]})},N_=function(){var e,t,n=ES(),r=Ee(function(e){return e}),i=(t=r.config.networks,Object.entries(Ex).filter(function(e){return t.includes(e[1])}).map(function(e){return Dx(e[0])}));return z("div",{style:{fontFamily:r.config.appearance.fontFamily},className:"bluxcc:mt-4 bluxcc:mb-10 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[W("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden",children:W(yS,{name:wS.WrongNetwork,props:{}})}),z("div",{className:"bluxcc:w-full bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[W("p",{className:"bluxcc:text-2xl",children:n("wrongNetwork")}),W("p",{className:"bluxcc:text-center bluxcc:text-sm bluxcc:leading-5 bluxcc:tracking-[-2%] bluxcc:mx-3",children:n("wrongNetworkMessage",{currentNetwork:Dx(Kx(null===(e=r.user)||void 0===e?void 0:e.walletPassphrase)),switchNetwork:i.join(" or ")})})]})]})},k_=function(e){var t=e.assets,n=M(null),r=n[0],i=n[1],o=Ee(function(e){return e.config.appearance}),a=Ee(function(e){return e}),s=ES();return z("div",{className:"bluxcc:h-full bluxcc:w-full bluxcc:overflow-auto bluxcc:overflowStyle",children:[t.map(function(e,n){return z("button",{id:"bluxcc-button",onClick:function(){return function(e){a.setDetailsAsset(e),a.setDynamicTitle(e.title),a.setRoute(Y.BALANCE_DETAILS)}(e)},onMouseEnter:function(){return i(n)},onMouseLeave:function(){return i(null)},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:py-2 bluxcc:px-4",style:{background:r===n?o.fieldBackground:"transparent",color:o.textColor,borderBottomStyle:"dashed",borderBottomWidth:n<t.length-1?o.borderWidth:"0px",borderBottomColor:o.borderColor,transition:"all 0.2s ease-in-out",fontFamily:o.fontFamily},children:[z("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[W("span",{className:"bluxcc:font-medium bluxcc:size-10 bluxcc:flex bluxcc:items-center bluxcc:justify-center",style:{borderRadius:o.borderRadius,background:o.fieldBackground,border:"".concat(o.borderWidth," solid ").concat(o.borderColor)},children:W(VS,{assetCode:e.assetCode,assetIssuer:e.assetIssuer,assetType:e.assetType,fill:Wx(o.fieldBackground)})}),z("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:justify-start bluxcc:items-start",children:[W("span",{className:"bluxcc:text-sm bluxcc:font-medium",children:e.title}),W("span",{className:"bluxcc:font-semibold bluxcc:text-xs",style:{color:Vx(o.textColor,.7)},children:e.subtitle})]})]}),z("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:text-right",children:[W("span",{className:"bluxcc:font-medium",children:Yx(e.assetBalance)}),Number(e.valueInCurrency)>0&&W("span",{className:"bluxcc:font-semibold bluxcc:text-xs",style:{color:Vx(o.textColor,.7)},children:Jx(e.valueInCurrency||"0")})]})]},e.assetType+e.assetIssuer)}),0===t.length&&W("div",{style:{color:Vx(o.textColor,.7)},className:"bluxcc:mb-2 bluxcc:text-center bluxcc:h-full bluxcc:flex bluxcc:justify-center bluxcc:items-center",children:s("noAssetsFound")})]})},T_=function(e){return"native"===e.asset_type?"native":"liquidity_pool_shares"===e.asset_type?"lp:".concat(e.liquidity_pool_id):"".concat(e.asset_code,":").concat(e.asset_issuer)},C_=function(e,t){if(!t.isFinite()||t.lte(0))return new Nu(0);for(var n=t,r=new Nu(0),i=0,o=e;i<o.length;i++){var a=o[i];if(n.lte(0))break;var s=new Nu(a.price),c=new Nu(a.amount);if(s.isFinite()&&!s.lte(0)&&c.isFinite()&&!c.lte(0)){var u=c.div(s),l=Nu.minimum(n,u);r=r.plus(l.times(s)),n=n.minus(l)}}return r},I_=function(e){return!e.isFinite()||e.isNaN()||e.lte(0)?"0":e.decimalPlaces(7,Nu.ROUND_DOWN).toString()},B_=function(e,t,n){return ee(void 0,void 0,void 0,function(){return te(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,UE([e,t],{network:n,limit:200})];case 1:return[2,r.sent().response.bids];case 2:return r.sent(),[2,[]];case 3:return[2]}})})},L_=function(e,t,n,r){return ee(void 0,void 0,void 0,function(){var i,a,s,c,u,l,d,f;return te(this,function(h){switch(h.label){case 0:return!(i=new Nu(null!==(f=e.balance)&&void 0!==f?f:"0")).isFinite()||i.lte(0)?[2,"0"]:function(e){return("credit_alphanum4"===e.asset_type||"credit_alphanum12"===e.asset_type)&&"USDC"===e.asset_code&&e.asset_issuer===oe.assetIssuer}(e)?[2,I_(i)]:"native"===e.asset_type?[2,I_(C_(n,i))]:"liquidity_pool_shares"===e.asset_type?[2,"0"]:(a=new o(e.asset_code,e.asset_issuer),[4,B_(a,t,r)]);case 1:return s=h.sent(),c=C_(s,i),[4,B_(a,o.native(),r)];case 2:return u=h.sent(),l=C_(u,i),d=C_(n,l),[2,I_(Nu.maximum(c,d))]}})})},M_=function(t){return t===e.PUBLIC?"mainnet":"testnet"},R_=function(e,t){if(!e)return"0";if(!t)return e;var n=e.startsWith("-"),r=(n?e.slice(1):e).padStart(t+1,"0"),i=r.slice(0,r.length-t),o=r.slice(r.length-t).replace(/0+$/,"");return"".concat(n?"-":"").concat(i).concat(o?".".concat(o):"")},P_=function(e){if("native"===e)return{type:"native"};var t=e.indexOf(":");if(-1===t)return null;var n=e.slice(0,t),r=e.slice(t+1);return n&&i.isValidEd25519PublicKey(r)?{type:"credit",code:n,issuer:r}:null},U_=function(e,t){return"native"===e?t||"XLM":e.includes(":")?t||e.split(":")[0]:e||t},j_=function(e,t){var n=P_(e);return n&&"credit"===n.type?{code:n.code,issuer:n.issuer}:{code:t,issuer:""}},F_=function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i,o;return te(this,function(a){switch(a.label){case 0:n=0,r=["admin","owner"],a.label=1;case 1:if(!(n<r.length))return[3,6];i=r[n],a.label=2;case 2:return a.trys.push([2,4,,5]),[4,XE([{address:e,fn:i,args:[]}],{network:t})];case 3:return o=a.sent(),Array.isArray(o)||null==o.values[0]?[3,5]:[2,String(o.values[0])];case 4:return a.sent(),[3,5];case 5:return n++,[3,1];case 6:return[2,void 0]}})})},D_=function(e,t,n){return ee(void 0,void 0,void 0,function(){var r,o,a,s,c,u,l,d,f,h;return te(this,function(p){switch(p.label){case 0:if(!i.isValidContract(e))throw new Error("BLUX: invalid token contract id");return r=[{address:e,fn:"name",args:[]},{address:e,fn:"symbol",args:[]},{address:e,fn:"decimals",args:[]}],t&&r.push({address:e,fn:"balance",args:[pE.address(t)]}),[4,XE(r,{network:n})];case 1:if(o=p.sent(),Array.isArray(o))throw new Error("BLUX: could not read token metadata");return a=o.values,s=a[0],c=a[1],u=a[2],l=a[3],d=Number(u),f=t&&null!=l?String(l):"0",h={name:String(s),symbol:String(c),decimals:d,rawBalance:f,balance:R_(f,d)},[4,F_(e,n)];case 2:return[2,(h.adminOrOwner=p.sent(),h)]}})})},z_=function(e,t){return void 0===t&&(t="0"),{id:e.id,contractAddress:e.contract_address,network:"mainnet"===e.network?"mainnet":"testnet",name:e.name,symbol:e.symbol,decimals:e.decimals,balance:t}},$_=function(e){var t=e.tokens,n=ES(),r=M(null),i=r[0],o=r[1],a=Ee(function(e){return e.config.appearance}),s=Ee(function(e){return e.setRoute}),c=Ee(function(e){return e.setDetailsToken}),u=Ee(function(e){return e.setDynamicTitle});return z("div",{className:"bluxcc:flex bluxcc:h-full bluxcc:w-full bluxcc:flex-col",children:[z("div",{className:"bluxcc:flex-1 bluxcc:overflow-auto bluxcc:overflowStyle",children:[t.map(function(e,n){var r=U_(e.name,e.symbol),l=j_(e.name,e.symbol);return z("button",{id:"bluxcc-button",onClick:function(){return function(e){c(e),u(e.symbol),s(Y.TOKEN_DETAILS)}(e)},onMouseEnter:function(){return o(n)},onMouseLeave:function(){return o(null)},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:py-2 bluxcc:px-4",style:{background:i===n?a.fieldBackground:"transparent",color:a.textColor,borderBottomStyle:"dashed",borderBottomWidth:n<t.length-1?a.borderWidth:"0px",borderBottomColor:a.borderColor,transition:"all 0.2s ease-in-out",fontFamily:a.fontFamily},children:[z("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[W("span",{className:"bluxcc:font-medium bluxcc:size-10 bluxcc:flex bluxcc:items-center bluxcc:justify-center",style:{borderRadius:a.borderRadius,background:a.fieldBackground,border:"".concat(a.borderWidth," solid ").concat(a.borderColor)},children:W(VS,{assetType:"credit",assetCode:l.code,assetIssuer:l.issuer,fallbackIcon:wS.QuestionMark,fill:Wx(a.fieldBackground)})}),z("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:justify-start bluxcc:items-start",children:[z("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1.5 bluxcc:text-sm bluxcc:font-medium",children:[r,e.symbol&&e.symbol!==r&&W("span",{className:"bluxcc:rounded bluxcc:px-1 bluxcc:py-[1px] bluxcc:text-[10px] bluxcc:font-semibold",style:{background:Vx(a.textColor,.08),color:Vx(a.textColor,.7)},children:e.symbol})]}),W("span",{className:"bluxcc:font-semibold bluxcc:text-xs",style:{color:Vx(a.textColor,.7)},children:eA(e.contractAddress,4)})]})]}),W("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:text-right",children:W("span",{className:"bluxcc:font-medium",children:Yx(e.balance)})})]},e.id||e.contractAddress)}),0===t.length&&z("div",{style:{color:Vx(a.textColor,.7)},className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:gap-2 bluxcc:text-center",children:[W(yS,{name:wS.GrayCube,props:{}}),n("no_tokens_found")]})]}),W("div",{className:"bluxcc:flex bluxcc:shrink-0 bluxcc:justify-center bluxcc:pt-3",children:z("button",{id:"bluxcc-button",onClick:function(){s(Y.ADD_TOKEN)},className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2 bluxcc:h-11 bluxcc:px-6 bluxcc:text-sm bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",style:{color:a.accentColor,background:Vx(a.accentColor,.1),borderRadius:a.borderRadius,fontFamily:a.fontFamily},children:[W(yS,{name:wS.Plus,props:{fill:a.accentColor}}),n("add_new_token")]})})]})},W_=function(){var e,t=ES(),n=Ee(function(e){return e.config.appearance}),r=Ee(function(e){return e.balances}),i=r.loading,o=r.error,a=r.balances,s=Ee(function(e){return e.balanceValues}),c=Ee(function(e){var t;return null===(t=e.stellar)||void 0===t?void 0:t.activeNetwork}),u=Ee(function(e){return e.customTokens}),l=Ee(function(e){return e.balancesTab}),d=Ee(function(e){return e.setBalancesTab}),f=a.map(function(e){var t,n;return Z(Z({},Fx(e)),{valueInCurrency:null!==(t=s[T_(e)])&&void 0!==t?t:"0",title:(n=e,"native"===n.asset_type?"XLM":"credit_alphanum4"===n.asset_type||"credit_alphanum12"===n.asset_type?n.asset_code:"liquidity_pool_shares"===n.asset_type?"Liquidity Pool":""),subtitle:Ix(e)})}),h=null!==(e=u[M_(c)])&&void 0!==e?e:[],p=[{key:"assets",label:t("assets"),icon:wS.Assets},{key:"tokens",label:t("tokens"),icon:wS.Token}],b=function(){return z("div",{className:"bluxcc:w-full bluxcc:flex bluxcc:h-full bluxcc:justify-center bluxcc:items-center bluxcc:flex-col bluxcc:gap-2",children:[W(yS,{name:wS.GrayCube,props:{}}),W("p",{className:"bluxcc:font-medium",style:{color:Vx(n.textColor,.7)},children:t("no_balance_message")})]})},m=function(e){var t=e.text;return W("div",{className:"bluxcc:flex bluxcc:h-full bluxcc:items-center bluxcc:justify-center bluxcc:text-center",style:{color:Vx(n.textColor,.7),fontFamily:n.fontFamily},children:t})};return z("div",{style:{fontFamily:n.fontFamily},children:[W("div",{className:"bluxcc:flex bluxcc:gap-3 bluxcc:py-3",children:p.map(function(e){var t=l===e.key;return z("button",{role:"tab",id:"bluxcc-button","aria-label":e.label,"aria-selected":t,onClick:function(){return d(e.key)},className:"bluxcc:flex bluxcc:h-20 bluxcc:flex-1 bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:gap-2 bluxcc:py-4 bluxcc:text-sm bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",style:{background:t?Vx(n.accentColor,.1):n.background,color:t?n.accentColor:n.textColor,borderRadius:n.borderRadius},children:[W(yS,{name:e.icon,props:{fill:t?n.accentColor:n.textColor}}),W("span",{children:e.label})]},e.key)})}),W("div",{className:"bluxcc:h-[320px] bluxcc:py-1",role:"tabpanel",children:"assets"===l?i?W(m,{text:"".concat(t("loading"),"...")}):o?W(m,{text:t("errorTryAgain")}):a.length?W(k_,{assets:f}):W(b,{}):W($_,{tokens:h})})]})},X_={error:null,loading:!1,transactions:[]},q_=function(){var e,t=Ee(function(e){var t;return null===(t=e.user)||void 0===t?void 0:t.address}),n=Ee(function(e){var t;return(null===(t=e.stellar)||void 0===t?void 0:t.activeNetwork)||""}),r=Ee(function(e){return e.accountRefreshNonce}),o=!!(e=t)&&(i.isValidEd25519PublicKey(e)||i.isValidMed25519PublicKey(e))&&!!n,a="".concat(null!=t?t:"","|").concat(n),s=M(function(){return o?{error:null,loading:!0,transactions:[]}:X_}),c=s[0],u=s[1],l=M(a),d=l[0],f=l[1];a!==d&&(f(a),u(o?{error:null,loading:!0,transactions:[]}:X_));var h=P(0);return R(function(){if(o&&t){var e=++h.current,r=!1;return u(function(e){return{error:null,loading:0===e.transactions.length,transactions:e.transactions}}),WE({limit:5,order:"desc",forAccount:t,network:n}).then(function(t){return ee(void 0,void 0,void 0,function(){var n,i;return te(this,function(o){switch(o.label){case 0:return n=t.response.records,[4,Promise.all(n.map(function(e){return e.operations().then(function(e){return e.records}).catch(function(){return[]})}))];case 1:return i=o.sent(),r||e!==h.current?[2]:(u({error:null,loading:!1,transactions:n.map(function(e,t){return Z(Z({},e),{operations:i[t]})})}),[2])}})})}).catch(function(t){var n;if(!r&&e===h.current){var i=null===(n=null==t?void 0:t.response)||void 0===n?void 0:n.status;u(404!==i?function(e){return{error:t,loading:!1,transactions:e.transactions}}:{error:null,loading:!1,transactions:[]})}}),function(){r=!0}}u(X_)},[t,n,r,o]),c},K_=L.memo(function(e){var t,n,r,i,o,a=e.tx,s=ES(),c=Ee(function(e){return e}),u=c.config.appearance,l=Xx((null===(t=c.stellar)||void 0===t?void 0:t.activeNetwork)||"",c.config.explorer,"transactionUrl",a.hash);return z("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-between",children:[z("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-start bluxcc:gap-3",children:[W("div",{className:"bluxcc:flex bluxcc:size-10 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",style:{background:u.background},children:function(e){switch(e){case"receive":return W(yS,{name:wS.Downstream});case"send":return W(yS,{name:wS.Upstream});default:return W(yS,{name:wS.MultiOperation})}}(a.action)}),z("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:justify-start",children:[W("p",{className:"bluxcc:text-start bluxcc:text-xs bluxcc:font-medium",style:{color:u.textColor},children:a.title}),W("p",{className:"bluxcc:text-sm bluxcc:font-medium",children:a.description})]})]}),z("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2 bluxcc:text-xs",style:{color:Vx(u.textColor,.7)},children:[(n=a.date,r=new Date(n),i=r.getUTCDate(),o=r.toLocaleString("en-US",{month:"short"}),"".concat(i," ").concat(o)),W("button",{id:"bluxcc-button",className:"bluxcc:flex bluxcc:size-8 bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full",title:s("viewTransactionDetails"),onClick:function(){l&&window.open(l,"_blank","noopener,noreferrer")},style:{background:u.fieldBackground},children:W("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:W(yS,{name:wS.Globe})})})]})]})}),G_=function(e,t){return"native"===e.asset_type?"XLM":e.asset_code||t},H_=new Set(["payment"]),V_=new Set(["path_payment_strict_send","path_payment_strict_receive",c.HorizonApi.OperationResponseType.pathPaymentStrictSend,c.HorizonApi.OperationResponseType.pathPayment]),Y_=new Set(["create_account","createAccount"]),J_=new Set(["invoke_host_function","invokeHostFunction"]),Z_=function(e,t){return!!e&&!!t&&e.toLowerCase()===t.toLowerCase()},Q_=function(e){return e.find(function(e){return H_.has(e.type)})||e.find(function(e){return V_.has(e.type)})||e.find(function(e){return Y_.has(e.type)})||e.find(function(e){return J_.has(e.type)})||e[0]},eO=function(){var e,t,n=ES(),r=Ee(function(e){return e}),i=q_(),o=i.loading,a=i.transactions,s=M([]),c=s[0],u=s[1],l=r.config.appearance,d=null===(e=r.user)||void 0===e?void 0:e.address,f=Xx(null===(t=r.stellar)||void 0===t?void 0:t.activeNetwork,r.config.explorer,"accountUrl",d);R(function(){if(a){for(var e=[],t=0,r=a;t<r.length;t++){var i=r[t],o=i.operations||[],s=Q_(o);if(null==s?void 0:s.type){var c={hash:i.hash,description:"",date:i.created_at,action:"other",title:nA(s.type)},l=H_.has(s.type)||V_.has(s.type)||Y_.has(s.type)||J_.has(s.type);if(o.length>1&&!l)c.title=n("multiOperation"),c.action="multi";else if(H_.has(s.type)){var f=s,h=Z_(f.to,d);c.action=h?"receive":"send",c.title=n(h?"receive":"send"),c.description="".concat(Yx(f.amount)," ").concat(G_(f,n("pool")))}else if(V_.has(s.type))c.title=n("swap"),c.action="swap",c.description=n("receivedAsset",{asset:G_(s,n("pool"))});else if(Y_.has(s.type)){var p=s;h=Z_(p.account,d);c.action=h?"receive":"send",c.title=n(h?"receive":"send"),c.description="".concat(Yx(p.starting_balance)," XLM")}else if(J_.has(s.type)){var b=(Array.isArray(s.asset_balance_changes)?s.asset_balance_changes:[]).find(function(e){return"transfer"===e.type&&(Z_(e.to,d)||Z_(e.from,d))});if(null==b?void 0:b.amount){h=Z_(b.to,d);c.action=h?"receive":"send",c.title=n(h?"receive":"send"),c.description="".concat(Yx(b.amount)," ").concat("native"===b.asset_type?"XLM":b.asset_code||n("pool"))}}e.push(c)}}u(e)}else u([])},[a,d]);var h=!o&&0===c.length;return z("div",{className:"bluxcc:flex bluxcc:h-[355px] bluxcc:flex-col",children:[o?W("div",{style:{color:Vx(l.textColor,.7)},className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:n("loadingActivity")}):h?W("div",{style:{color:Vx(l.textColor,.7)},className:"bluxcc:flex bluxcc:h-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:n("noActivityFound")}):c.map(function(e,t){return W("div",{style:{borderBottomStyle:"dashed",borderBottomWidth:t<c.length-1?l.borderWidth:"0px",borderBottomColor:l.borderColor},className:"bluxcc:p-2",children:W(K_,{tx:e})},e.hash||t)}),c.length>0&&f&&W("div",{className:"bluxcc:absolute bluxcc:bottom-4 bluxcc:left-1/2 bluxcc:!mt-4 bluxcc:w-[calc(100%-3rem)] bluxcc:-translate-x-1/2 bluxcc:transform",children:W(BS,{state:"enabled",variant:"outline",size:"medium",onClick:function(){f&&window.open(f,"_blank","noopener,noreferrer")},children:n("seeAllInExplorer")})})]})},tO=function(e){var t,n=e.operationsCount,r=e.sender,i=e.receiver,o=e.network,a=e.estimatedFee,s=e.action,c=ES(),u=Ee(function(e){return e.config.appearance}),l=Ee(function(e){return e}).setAlert,d=[{label:c("action"),value:Dx(s)},{label:c("operations"),value:n.toString()},{label:c("sender"),value:eA(r,5),isHighlighted:!0,isCopyable:!0,copyValue:r},{label:c("network"),value:(null===(t=_x[o])||void 0===t?void 0:t.name)||o},{label:c("estimatedFee"),value:"".concat(a," XLM")}];return i&&d.splice(3,0,{label:c("to"),value:eA(i,5),isHighlighted:!0,isCopyable:!0,copyValue:i}),W("div",{className:"bluxcc:w-full bluxcc:text-sm bluxcc:text-gray-800",style:{fontFamily:u.fontFamily},children:d.map(function(e,t){var n=e.label,r=e.value,i=e.isHighlighted,o=e.isCopyable,a=e.copyValue;return z("div",{className:"bluxcc:flex bluxcc:justify-between bluxcc:px-4 bluxcc:py-2",style:t===d.length-1?{}:{borderBottomColor:u.borderColor,borderBottomStyle:"dashed",borderBottomWidth:u.borderWidth},children:[W("span",{style:{color:u.textColor},children:n}),o?W("button",{id:"bluxcc-button",className:"bluxcc:bg-transparent",style:{color:i?u.accentColor:u.textColor},onClick:function(){return a&&(zx(a),l("copy",c("address_copied")),void setTimeout(function(){l("none","")},1e3))},children:r}):W("span",{style:{color:i?u.accentColor:u.textColor},children:r})]},t)})})},nO=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r,i;return te(this,function(o){switch(o.label){case 0:if(!(t=e.sendTransaction))return e.setRoute(Y.FAILED),[2];if(e.setRoute(Y.WAITING),!e.user)return e.setRoute(Y.FAILED),[2];if(!(n=Ax(e.user,e.wallets)))return e.setRoute(Y.FAILED),[2];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,wA(n,t.xdr,null===(i=e.user)||void 0===i?void 0:i.address,t.options.network,e.config.transports||{},t.shouldSubmit)];case 2:return r=o.sent(),e.setSendTransaction(Z(Z({},t),{result:r}),!0,Y.WAITING),setTimeout(function(){e.setRoute(Y.SUCCESSFUL)},400),[3,4];case 3:return o.sent(),setTimeout(function(){e.setRoute(Y.FAILED)},200),[3,4];case 4:return[2]}})})},rO=function(){var e,t=ES(),n=Ee(function(e){return e}),r=n.config.appearance,i=n.user,o=n.stellar,a=n.sendTransaction;if(!a||!i||!o)return W("div",{children:W("p",{children:t("invalidXdr")})});var s=a.xdr,c=a.options,u=pA(s,c.network);if(!u)return W("div",{children:W("p",{children:t("invalidXdr")})});var l,d,f=0===n.balances.balances.length?"0":n.balances.balances.find(function(e){return"native"===e.asset_type}).balance,h=i.authValue===H.Lobstr,p=(l=o.activeNetwork,(d=Object.entries(Ex).find(function(e){return e[1]===l}))?d[0].toUpperCase():"MAINNET");return z("div",{className:"bluxcc:w-full",style:{fontFamily:r.fontFamily},children:[z("p",{className:"bluxcc:mx-3 bluxcc:my-4 bluxcc:text-center bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:[z("span",{className:"bluxcc:font-semibold bluxcc:capitalize",children:[n.config.appName," "]}),t("signTransactionPrompt")]}),W(tO,{operationsCount:u.operations,sender:u.sender,receiver:u.receiver,network:c.network,estimatedFee:u.estimatedFee.toString(),action:u.action}),h&&W("p",{className:"bluxcc:my-2! bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:text-xs! bluxcc:text-alert-error",children:t("lobstrWarning",{network:p})}),z("div",{className:"bluxcc:inline-flex bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:border bluxcc:px-4",style:{marginTop:h?"0px":"16px",borderRadius:r.borderRadius,borderColor:r.borderColor},children:[z("div",{className:"bluxcc:inline-flex bluxcc:items-center bluxcc:gap-1 bluxcc:font-medium bluxcc:whitespace-nowrap",children:[W("p",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:whitespace-nowrap",children:t("yourWallet")}),W("p",{className:"bluxcc:mt-0.5 bluxcc:text-xs",style:{color:"".concat(Vx(r.textColor,.8))},children:i.address?eA(null===(e=n.user)||void 0===e?void 0:e.address,5):t("noAddressFound")})]}),W("div",{className:"bluxcc:overflow-hidden bluxcc:px-2.5 bluxcc:py-2",style:{borderRadius:r.borderRadius,backgroundColor:r.fieldBackground,color:r.textColor},children:z("p",{className:"bluxcc:max-w-22.5 bluxcc:text-xs bluxcc:font-normal",children:[f?Yx(f):"0"," XLM"]})})]}),W(OS,{}),W(BS,{size:"large",state:"enabled",variant:"fill",onClick:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return nO(n),[2]})})},children:t("approve")})]})},iO=function(){var e,t,n,r,i,o=ES(),a=Ee(function(e){return e}),s=a.config.appearance,c=a.detailsAsset,u=a.balances.balances,l=a.balanceValues,d=(null===(e=a.stellar)||void 0===e?void 0:e.activeNetwork)||"";if(R(function(){return function(){a.setDynamicTitle("")}},[]),R(function(){c||a.setRoute(Y.BALANCES)},[c]),!c)return null;var f,h,p,b="native"===c.assetType,m=u.find(function(e){return b?"native"===e.asset_type:e.asset_code===c.assetCode&&e.asset_issuer===c.assetIssuer}),g=null!==(t=null==m?void 0:m.balance)&&void 0!==t?t:c.assetBalance,v=null!==(r=null!==(n=l[(f=c.assetType,h=c.assetCode,p=c.assetIssuer,"native"===f?"native":"".concat(h,":").concat(p))])&&void 0!==n?n:c.valueInCurrency)&&void 0!==r?r:"0",y=Number(v)>0,w=Sx[d]||(null===(i=_x[d])||void 0===i?void 0:i.name)||o("network"),x=m&&"selling_liabilities"in m?m.selling_liabilities:"0",A=m&&"buying_liabilities"in m?m.buying_liabilities:"0",E=m&&"limit"in m?m.limit:null,S=m&&"is_authorized"in m?m.is_authorized:null,_=b?null:Xx(d,a.config.explorer,"accountUrl",c.assetIssuer),O={color:Vx(s.textColor,.7)},N=z("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1",style:{color:s.accentColor},children:[w,W(yS,{name:wS.StellarSmall,props:{fill:s.accentColor}})]}),k=z("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1",children:[_?W("a",{href:_,target:"_blank",rel:"noreferrer",className:"bluxcc:no-underline",style:{color:s.accentColor,fontFamily:s.fontFamily},children:eA(c.assetIssuer,5)}):W("span",{style:{color:s.accentColor},children:eA(c.assetIssuer,5)}),W("button",{id:"bluxcc-button",onClick:function(){zx(c.assetIssuer).then(function(){a.setAlert("copy",o("address_copied")),setTimeout(function(){a.setAlert("none","")},1e3)}).catch(function(){})},className:"bluxcc:flex bluxcc:items-center bluxcc:bg-transparent",children:W(yS,{name:wS.Copy,props:{fill:s.accentColor}})})]}),T=[{label:o("network"),value:N,divider:!1}];return!b&&c.assetIssuer&&T.push({label:o("issuer"),value:k,divider:!1}),T.push({label:o("sellingLiabilities"),value:W("span",{style:O,children:Yx(x)}),divider:!0},{label:o("buyingLiabilities"),value:W("span",{style:O,children:Yx(A)}),divider:!0}),b||(T.push({label:o("limit"),value:W("span",{style:O,children:null==E?"—":"922337203685.4775807"===E?"∞":Yx(E,!0)}),divider:!0}),null!==S&&T.push({label:o("authorized"),value:W("span",{style:O,children:o(S?"yes":"no")}),divider:!0})),z("div",{children:[z("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-between bluxcc:gap-3 bluxcc:my-5 bluxcc:px-4",children:[W("div",{className:"bluxcc:size-14 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full bluxcc:border",style:{borderColor:s.borderColor,borderWidth:s.borderWidth},children:W(VS,{assetCode:c.assetCode,assetIssuer:c.assetIssuer,assetType:c.assetType,fill:Wx(s.background)})}),z("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-end bluxcc:text-right",children:[W("span",{className:"bluxcc:text-3xl bluxcc:font-semibold bluxcc:leading-8",style:{color:s.accentColor},children:y?Jx(v):"".concat(Yx(g)," ").concat(c.assetCode)}),W("span",{className:"bluxcc:text-sm bluxcc:font-medium",style:O,children:y?"".concat(Yx(g)," ").concat(c.assetCode):b?"Stellar Lumens":c.assetIssuer?eA(c.assetIssuer,4):c.assetCode})]})]}),W("div",{children:T.map(function(e){return z("div",{className:"bluxcc:flex bluxcc:font-medium bluxcc:items-center bluxcc:justify-between bluxcc:text-xs bluxcc:h-10 bluxcc:px-4",style:{color:s.textColor,fontFamily:s.fontFamily,borderTop:e.divider?"".concat(s.borderWidth," dashed ").concat(s.borderColor):"none"},children:[W("span",{children:e.label}),W("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1 bluxcc:text-xs",children:e.value})]},e.label)})})]})},oO=function(){var e,t,n,r,i,o,a=ES(),s=Ee(function(e){return e}),c=s.config.appearance,u=s.detailsToken,l=null===(e=s.auth)||void 0===e?void 0:e.JWT,d=null===(t=s.user)||void 0===t?void 0:t.address,f=(null===(n=s.stellar)||void 0===n?void 0:n.activeNetwork)||"",h=M(null),p=h[0],b=h[1],m=M(!1),g=m[0],v=m[1],y=M(""),w=y[0],x=y[1];if(R(function(){return function(){s.setDynamicTitle("")}},[]),R(function(){u||s.setRoute(Y.BALANCES)},[u]),R(function(){if(u){var e=!1;return D_(u.contractAddress,d,f).then(function(t){e||b(t)}).catch(function(){}),function(){e=!0}}},[null==u?void 0:u.contractAddress,d,f]),!u)return null;var A=null!==(r=null==p?void 0:p.balance)&&void 0!==r?r:u.balance,E=null==p?void 0:p.adminOrOwner,S=null!==(i=null==p?void 0:p.decimals)&&void 0!==i?i:u.decimals,_={color:Vx(c.textColor,.7)},O=U_(u.name,u.symbol),N=j_(u.name,u.symbol),k=Sx[f]||(null===(o=_x[f])||void 0===o?void 0:o.name)||a("network"),T=function(e){return z("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1",children:[W("span",{style:{color:c.accentColor},children:eA(e,4)}),W("button",{id:"bluxcc-button",onClick:function(){return function(e){zx(e).then(function(){s.setAlert("copy",a("address_copied")),setTimeout(function(){s.setAlert("none","")},1e3)}).catch(function(){})}(e)},className:"bluxcc:flex bluxcc:items-center bluxcc:bg-transparent",children:W(yS,{name:wS.Copy,props:{fill:c.accentColor}})})]})},C=[{label:a("network"),value:z("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1",style:{color:c.accentColor},children:[k,W(yS,{name:wS.StellarSmall,props:{fill:c.accentColor}})]}),divider:!1},{label:a("contract"),value:T(u.contractAddress),divider:!1},{label:a("symbol"),value:W("span",{style:_,children:u.symbol}),divider:!0},{label:a("decimals"),value:W("span",{style:_,children:S}),divider:!0}];E&&C.push({label:a("admin"),value:T(E),divider:!0});return z("div",{children:[z("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-between bluxcc:gap-3 bluxcc:my-5 bluxcc:px-4",children:[z("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[W("div",{className:"bluxcc:size-14 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full bluxcc:border",style:{borderColor:c.borderColor,borderWidth:c.borderWidth},children:W(VS,{assetType:"credit",assetCode:N.code,assetIssuer:N.issuer,fallbackIcon:wS.QuestionMark,fill:Wx(c.background)})}),z("div",{className:"bluxcc:flex bluxcc:flex-col",children:[W("span",{className:"bluxcc:text-base bluxcc:font-semibold",children:O}),W("span",{className:"bluxcc:text-xs bluxcc:font-medium",style:_,children:u.symbol!==O?u.symbol:eA(u.contractAddress,4)})]})]}),z("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-end bluxcc:text-right",children:[W("span",{className:"bluxcc:text-2xl bluxcc:font-semibold bluxcc:leading-7",style:{color:c.accentColor},children:Yx(A)}),W("span",{className:"bluxcc:text-xs bluxcc:font-medium",style:_,children:u.symbol})]})]}),W("div",{children:C.map(function(e){return z("div",{className:"bluxcc:flex bluxcc:font-medium bluxcc:items-center bluxcc:justify-between bluxcc:text-xs bluxcc:h-10 bluxcc:px-4",style:{color:c.textColor,fontFamily:c.fontFamily,borderTop:e.divider?"".concat(c.borderWidth," dashed ").concat(c.borderColor):"none"},children:[W("span",{children:e.label}),W("span",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1 bluxcc:text-xs",children:e.value})]},e.label)})}),z("div",{className:"bluxcc:mt-6 bluxcc:px-4",children:[w&&W("p",{className:"bluxcc:mb-2 bluxcc:text-center bluxcc:text-xs bluxcc:text-alert-error",children:w}),W("button",{id:"bluxcc-button",onClick:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:if(g)return[2];if(!l)return x(a("errorTryAgain")),[2];v(!0),x(""),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Xe(l,u.id)];case 2:return e.sent(),s.removeCustomToken(u.network,u.id),s.setDetailsToken(void 0),s.setBalancesTab("tokens"),s.setRoute(Y.BALANCES),[3,4];case 3:return e.sent(),v(!1),x(a("errorTryAgain")),[3,4];case 4:return[2]}})})},className:"bluxcc:flex bluxcc:h-[52px] bluxcc:w-full bluxcc:items-center bluxcc:justify-center bluxcc:text-base bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",style:{color:"var(--color-alert-error)",background:"color-mix(in srgb, var(--color-alert-error) 10%, transparent)",borderRadius:c.borderRadius,fontFamily:c.fontFamily,pointerEvents:g?"none":void 0},children:g?W(yS,{name:wS.Loading,className:"bluxcc:animate-spin",props:{fill:"var(--color-alert-error)"}}):a("delete_token")})]})]})},aO={purple:{id:"purple_gradient",colors:[[.992,.878,1],[.992,.878,1],[.592,.451,1],[.792,.663,1]]}},sO=function(e){var t,n=e.theme,r=void 0===n?"purple":n,i=e.className,o=void 0===i?"":i,a=e.children,s=e.animationSpeed,c=void 0===s?1:s,u=e.onClick,l=e.style,d=e.size,f=void 0===d?"100%":d,h=P(null),p=P(null);return R(function(){var e=h.current;if(e){var t=e.getContext("webgl");if(t){var n=e.getBoundingClientRect();e.width=n.width,e.height=n.height;var i=function(e,n){var r=t.createShader(n);return t.shaderSource(r,e),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS),r},o=t.createProgram(),a=i("\n attribute vec2 aPos;\n varying vec2 vUv;\n void main() {\n vUv = (aPos + 1.0) * 0.5;\n gl_Position = vec4(aPos, 0.0, 1.0);\n }\n ",t.VERTEX_SHADER),s=i("\n precision mediump float;\n uniform float uTime;\n uniform vec2 uResolution;\n uniform vec3 uColor1;\n uniform vec3 uColor2;\n uniform vec3 uColor3;\n uniform vec3 uColor4;\n varying vec2 vUv;\n\n float noise(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);\n }\n float smoothNoise(vec2 st) {\n vec2 i=floor(st),f=fract(st);\n float a=noise(i);\n float b=noise(i+vec2(1.,0.));\n float c=noise(i+vec2(0.,1.));\n float d=noise(i+vec2(1.,1.));\n vec2 u=f*f*(3.-2.*f);\n return mix(a,b,u.x)+(c-a)*u.y*(1.-u.x)+(d-b)*u.x*u.y;\n }\n float fbm(vec2 st){\n float v=0.,a=0.7;\n for(int i=0;i<2;i++){\n v+=a*smoothNoise(st);\n st*=1.8;a*=0.4;\n }\n return v;\n }\n\n void main(){\n vec2 st=vUv;\n float time=uTime*0.12;\n vec2 center=vec2(0.5);\n vec2 fromCenter=st-center;\n float rot=time*0.3;\n float c=cos(rot),s=sin(rot);\n vec2 rotated=vec2(\n fromCenter.x*c-fromCenter.y*s,\n fromCenter.x*s+fromCenter.y*c\n )+center;\n\n vec2 pos=st;\n pos+=vec2(\n fbm(rotated*1.2+time*0.4)*0.08,\n fbm(rotated*1.2+time*0.5+50.0)*0.08\n );\n\n float mixX=clamp(pos.x+fbm(rotated*1.0+time*0.6)*0.25,0.,1.);\n float mixY=clamp(pos.y+fbm(rotated*1.0+time*0.7)*0.25,0.,1.);\n\n vec3 topColors=mix(uColor1,uColor2,smoothstep(0.1,0.9,mixX));\n vec3 bottomColors=mix(uColor3,uColor4,smoothstep(0.1,0.9,mixX));\n vec3 finalColor=mix(topColors,bottomColors,smoothstep(0.1,0.9,mixY));\n\n gl_FragColor=vec4(finalColor,1.0);\n }\n ",t.FRAGMENT_SHADER);t.attachShader(o,a),t.attachShader(o,s),t.linkProgram(o),t.useProgram(o);var u=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW);var l=t.getAttribLocation(o,"aPos");t.enableVertexAttribArray(l),t.vertexAttribPointer(l,2,t.FLOAT,!1,0,0);var d=t.getUniformLocation(o,"uTime"),f=t.getUniformLocation(o,"uResolution"),b=t.getUniformLocation(o,"uColor1"),m=t.getUniformLocation(o,"uColor2"),g=t.getUniformLocation(o,"uColor3"),v=t.getUniformLocation(o,"uColor4"),y=aO[r].colors;t.uniform2f(f,n.width,n.height),t.uniform3fv(b,y[0]),t.uniform3fv(m,y[1]),t.uniform3fv(g,y[2]),t.uniform3fv(v,y[3]);var w=0,x=function(){p.current=requestAnimationFrame(x),w+=.015*c,t.uniform1f(d,w),t.viewport(0,0,e.width,e.height),t.drawArrays(t.TRIANGLE_STRIP,0,4)};return x(),function(){p.current&&cancelAnimationFrame(p.current),t.deleteProgram(o),t.deleteBuffer(u)}}}},[r,c]),z("div",{onClick:u,className:"bluxcc:relative bluxcc:overflow-hidden ".concat(o),style:l,"data-gradient-id":(null===(t=aO[r])||void 0===t?void 0:t.id)||"unknown_gradient",children:[W("canvas",{ref:h,className:"bluxcc:absolute bluxcc:inset-0 bluxcc:z-0",style:{width:f,height:f}}),a&&W("div",{className:"bluxcc:absolute bluxcc:inset-0 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:z-10",children:a})]})},cO=function(){var e=ES(),t=Ee(function(e){return e.config.appearance}),n=[wS.Shield,wS.Key,wS.Wallet,wS.Chip];return z("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:select-none bluxcc:items-center bluxcc:justify-center bluxcc:text-center bluxcc:font-medium bluxcc:mt-4 bluxcc:mb-2",style:{color:t.textColor},children:[W(sO,{theme:"purple",animationSpeed:3,style:{borderRadius:t.borderRadius},className:"bluxcc:size-66 bluxcc:mx-6 bluxcc:overflow-hidden bluxcc:flex bluxcc:items-center",children:W("div",{className:"bluxcc:marquee_outer",children:W("div",{className:"bluxcc:marquee_track bluxcc:gap-2.5",children:ne(ne(ne(ne([],n,!0),n,!0),n,!0),n,!0).map(function(e,n){return W("div",{style:{borderRadius:"0px"!==t.borderRadius?"16px":"0px"},className:"bluxcc:size-20.5 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:bg-primary-500",children:W(yS,{name:e,props:{fill:"#fff"}})},n)})})})}),W("p",{className:"bluxcc:text-2xl bluxcc:mt-6.5 bluxcc:mb-2 bluxcc:px-6 ",children:e("wallet_infra")}),W("p",{className:"bluxcc:text-sm bluxcc:text-center",children:e("blux_gateway")})]})},uO={color:"var(--color-alert-success)",background:"color-mix(in srgb, var(--color-alert-success) 12%, transparent)"},lO={color:"var(--color-alert-warning)",background:"color-mix(in srgb, var(--color-alert-warning) 12%, transparent)"},dO=function(){var e=ES(),t=Ee(function(e){return e.config.appearance}),n=Ee(function(e){var t;return null===(t=e.auth)||void 0===t?void 0:t.JWT}),r=Ee(function(e){var t;return null===(t=e.user)||void 0===t?void 0:t.address}),o=Ee(function(e){var t;return null===(t=e.stellar)||void 0===t?void 0:t.activeNetwork}),a=Ee(function(e){return e.balances.balances}),s=Ee(function(e){return e.setRoute}),c=Ee(function(e){return e.setBalancesTab}),u=Ee(function(e){return e.addCustomToken}),l=M(""),d=l[0],f=l[1],h=M("idle"),p=h[0],b=h[1],m=M(""),g=m[0],v=m[1],y=M(null),w=y[0],x=y[1],A=M(!1),E=A[0],S=A[1],_=M(!1),O=_[0],N=_[1],k=M(""),T=k[0],C=k[1],I="valid"===p&&!!w&&!O&&!E,B=w?U_(w.name,w.symbol):"",L=w?j_(w.name,w.symbol):{code:"",issuer:""},R=function(e,n,r){return void 0===r&&(r=!0),z("div",{className:"bluxcc:flex bluxcc:h-10 bluxcc:items-center bluxcc:justify-between bluxcc:px-4 bluxcc:text-xs bluxcc:font-medium",style:{color:t.textColor,borderTop:r?"".concat(t.borderWidth," dashed ").concat(t.borderColor):"none"},children:[W("span",{children:e}),W("span",{style:{color:Vx(t.textColor,.7)},children:n})]})};return z("div",{className:"bluxcc:flex bluxcc:flex-col",style:{fontFamily:t.fontFamily},children:[W(t_,{autoFocus:!0,type:"text",value:d,onChange:function(e){f(e.target.value),b("idle"),x(null),v(""),C(""),S(!1)},onButtonClick:function(){return ee(void 0,void 0,void 0,function(){var t,n;return te(this,function(s){switch(s.label){case 0:if(t=d.trim(),!i.isValidContract(t))return b("invalid"),x(null),S(!1),v(e("invalid_address")),[2];b("checking"),v(""),C(""),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,D_(t,r,o)];case 2:return n=s.sent(),x(n),S((c=n.name,!!(u=P_(c))&&a.some(function(e){return"native"===u.type?"native"===e.asset_type:"native"!==e.asset_type&&"asset_code"in e&&e.asset_code===u.code&&"asset_issuer"in e&&e.asset_issuer===u.issuer}))),b("valid"),[3,4];case 3:return s.sent(),x(null),S(!1),b("invalid"),v(e("could_not_validate_token")),[3,4];case 4:return[2]}var c,u})})},label:e("enter_token_address"),placeholder:e("enter_address"),error:"invalid"===p?g:void 0,button:W("span",{style:{color:t.accentColor},children:e("check")})}),z("div",{className:"bluxcc:min-h-[248px] bluxcc:py-2",children:["checking"===p&&W("div",{className:"bluxcc:flex bluxcc:h-[240px] bluxcc:items-center bluxcc:justify-center",children:W(yS,{name:wS.Loading,className:"bluxcc:animate-spin",props:{fill:t.accentColor}})}),"valid"===p&&w&&z("div",{style:{borderRadius:t.borderRadius,border:"".concat(t.borderWidth," solid ").concat(t.borderColor)},children:[z("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:gap-1 bluxcc:py-4",children:[W("div",{className:"bluxcc:size-14 bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:rounded-full bluxcc:border",style:{borderColor:t.borderColor,borderWidth:t.borderWidth},children:W(VS,{assetType:"credit",assetCode:L.code,assetIssuer:L.issuer,fallbackIcon:wS.QuestionMark,fill:Wx(t.background)})}),z("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-1.5",children:[W("span",{className:"bluxcc:text-lg bluxcc:font-semibold",style:{color:t.accentColor},children:B}),w.symbol&&w.symbol!==B&&z("span",{className:"bluxcc:text-sm",style:{color:Vx(t.textColor,.7)},children:["(",w.symbol,")"]})]})]}),R(e("status"),W("span",{className:"bluxcc:rounded-full bluxcc:px-2 bluxcc:py-[2px] bluxcc:text-[11px] bluxcc:font-semibold",style:E?lO:uO,children:e(E?"already_in_assets":"valid_token")}),!1),R(e("your_balance"),"".concat(Yx(w.balance)," ").concat(w.symbol)),w.adminOrOwner?R(e("admin"),eA(w.adminOrOwner,4)):R(e("decimals"),String(w.decimals))]}),T&&W("p",{className:"bluxcc:mt-2 bluxcc:px-1 bluxcc:text-center bluxcc:text-xs bluxcc:text-alert-error",children:T})]}),W(OS,{}),z("div",{className:"bluxcc:flex bluxcc:gap-3",children:[W("div",{className:"bluxcc:flex-1",children:W(BS,{variant:"outline",size:"large",onClick:function(){s(Y.BALANCES)},children:e("cancel")})}),W("div",{className:"bluxcc:flex-[1.6]",children:W(BS,{size:"large",variant:"fill",state:I?"enabled":"disabled",disabled:!I,onClick:function(){return ee(void 0,void 0,void 0,function(){var t,r,i,a;return te(this,function(l){switch(l.label){case 0:if("valid"!==p||!w||O||E)return[2];if(!n)return C(e("errorTryAgain")),[2];N(!0),C(""),t=M_(o),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,We(n,d.trim(),t)];case 2:return r=l.sent(),u(z_(r,w.balance)),c("tokens"),s(Y.BALANCES),[3,4];case 3:return i=l.sent(),N(!1),a=String((null==i?void 0:i.message)||""),C(a.includes("already added")?e("token_already_added"):e("errorTryAgain")),[3,4];case 4:return[2]}})})},style:{opacity:I?1:.5},children:O?W(yS,{name:wS.Loading,className:"bluxcc:animate-spin",props:{fill:Wx(t.accentColor)}}):e("add_token")})})]})]})},fO=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r,i;return te(this,function(o){switch(o.label){case 0:if(!(t=e.signMessage))return e.setRoute(Y.FAILED),[2];if(e.setRoute(Y.WAITING),!e.user)return e.setRoute(Y.FAILED),[2];if(!(n=Ax(e.user,e.wallets)))return e.setRoute(Y.FAILED),[2];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,dA(n,t.message,null===(i=e.user)||void 0===i?void 0:i.address)];case 2:return r=o.sent(),e.setSignMessage(Z(Z({},t),{result:r}),!0,Y.WAITING),setTimeout(function(){e.setRoute(Y.SUCCESSFUL)},400),[3,4];case 3:return o.sent(),setTimeout(function(){e.setRoute(Y.FAILED)},200),[3,4];case 4:return[2]}})})},hO=function(e){return ee(void 0,void 0,void 0,function(){var t,n,r,i;return te(this,function(o){switch(o.label){case 0:if(!(t=e.signAuthEntry))return e.setRoute(Y.FAILED),[2];if(e.setRoute(Y.WAITING),!e.user)return e.setRoute(Y.FAILED),[2];if(!(n=Ax(e.user,e.wallets)))return e.setRoute(Y.FAILED),[2];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,OA(n,t.authEntry,null===(i=e.user)||void 0===i?void 0:i.address,t.options.network)];case 2:return r=o.sent(),e.setSignAuthEntry(Z(Z({},t),{result:r}),!0,Y.WAITING),setTimeout(function(){e.setRoute(Y.SUCCESSFUL)},400),[3,4];case 3:return o.sent(),setTimeout(function(){e.setRoute(Y.FAILED)},200),[3,4];case 4:return[2]}})})},pO=function(){var e,t,n=ES(),r=Ee(function(e){return e}),i=r.config.appearance;if("signMessage"!==r.waitingStatus&&"signAuthEntry"!==r.waitingStatus)return r.setRoute(Y.FAILED),null;var o="signMessage"===r.waitingStatus,a=o?r.signMessage:r.signAuthEntry;if(!a)return null;var s=o?a.message:a.authEntry;return z("div",{children:[z("div",{className:"bluxcc:p-4 bluxcc:text-center bluxcc:text-sm bluxcc:font-medium bluxcc:select-none",children:[z("span",{className:"bluxcc:font-semibold bluxcc:capitalize",children:[r.config.appName," "]}),n("sign_permission")]}),W("div",{className:"bluxcc:h-24 bluxcc:p-4 bluxcc:font-mono bluxcc:text-xs bluxcc:overflow-auto",style:{border:"".concat(i.borderWidth," solid ").concat(i.borderColor),borderRadius:i.borderRadius},children:s}),z("div",{className:"bluxcc:inline-flex bluxcc:mt-4 bluxcc:h-14 bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:border bluxcc:px-4",style:{borderRadius:i.borderRadius,borderColor:i.borderColor},children:[W("div",{className:"bluxcc:inline-flex bluxcc:items-center bluxcc:gap-1 bluxcc:font-medium bluxcc:whitespace-nowrap",children:W("p",{className:"bluxcc:text-sm bluxcc:font-medium bluxcc:whitespace-nowrap",children:n("yourWallet")})}),W("div",{className:"bluxcc:overflow-hidden bluxcc:px-[10px] bluxcc:py-2",style:{borderRadius:i.borderRadius,backgroundColor:i.fieldBackground,color:i.textColor},children:W("p",{className:"bluxcc:mt-0.5 bluxcc:text-xs",style:{color:"".concat(Vx(i.textColor,.8))},children:(null===(e=r.user)||void 0===e?void 0:e.address)?eA(null===(t=r.user)||void 0===t?void 0:t.address,5):n("noAddressFound")})})]}),W(OS,{}),W(BS,{size:"large",state:"enabled",variant:"fill",onClick:function(){return ee(void 0,void 0,void 0,function(){return te(this,function(e){return o?fO(r):hO(r),[2]})})},children:n("approve")})]})},bO=function(){var e,t,n=ES(),r=Ee(function(e){return e}),i="login"===r.waitingStatus&&!!r.loginError;return z("div",i?{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[W("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:W(yS,{name:wS.RedExclamation,props:{}})}),z("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[W("p",{className:"bluxcc:text-xl",children:n("accessDeniedTitle")}),W("p",{className:"bluxcc:text-sm",children:r.loginError}),W("p",{className:"bluxcc:text-sm bluxcc:opacity-70",children:n("accessDeniedHelp")})]}),W(OS,{}),W(BS,{onClick:function(){r.setLoginError(void 0),r.setRoute(Y.ONBOARDING)},state:"enabled",variant:"outline",children:n("back")})]}:{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[W("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:W(yS,{name:wS.RedExclamation,props:{}})}),z("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[W("p",{className:"bluxcc:text-xl",children:"login"===r.waitingStatus?n("loginFailed"):n("signingFailed",{walletName:null!==(t=null===(e=r.user)||void 0===e?void 0:e.authValue)&&void 0!==t?t:"wallet"})}),W("p",{className:"bluxcc:text-sm",children:"login"===r.waitingStatus?n("loginRetryMessage"):n("signingRetryMessage")})]}),W(OS,{}),W(BS,{onClick:function(){var e;"signMessage"===r.waitingStatus?fO(r):"signAuthEntry"===r.waitingStatus?hO(r):"sendTransaction"===r.waitingStatus?nO(r):"login"===r.waitingStatus&&d_(r,xx[(null===(e=r.user)||void 0===e?void 0:e.authValue)||"Rabet"])},state:"enabled",variant:"outline",children:n("tryAgain")})]})},mO=function(){var e=ES(),t=Ee(function(e){return e}),n=t.config.appearance;R(function(){ee(void 0,void 0,void 0,function(){return te(this,function(e){return d_(t,xx[H.WalletConnect]),[2]})})},[]);if(!t.walletConnect)return null;if(!t.walletConnect.connection||!t.walletConnect.client)return null;var r=t.walletConnect.connection.uri;return z("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:[z("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:size-52 bluxcc:items-center bluxcc:justify-center",style:{position:"relative",borderRadius:n.borderRadius,color:n.textColor,borderColor:n.borderColor,backgroundColor:n.fieldBackground,borderWidth:n.borderWidth},children:[W(__,{size:184,value:r,bgColor:n.fieldBackground,fgColor:n.accentColor,level:"Q",imgSize:40}),W("div",{className:"bluxcc:z-20",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:n.background},children:W(yS,{name:wS.WalletConnect,props:{fill:n.accentColor,background:n.fieldBackground}})})]}),W("div",{className:"bluxcc:mt-4 bluxcc:font-medium",children:W("p",{className:"bluxcc:text-lg",children:"Scan this QR code with your phone"})}),W(OS,{}),W(BS,{size:"large",state:"enabled",variant:"tonal",style:{color:n.accentColor},onClick:function(){return function(n){zx(n),t.setAlert("copy",e("address_copied")),setTimeout(function(){t.setAlert("none","")},1e3)}(r)},children:"Copy URI"})]})},gO=function(){var e,t,n=ES(),r=M(!1),i=r[0],o=r[1],a=M(""),s=a[0],c=a[1],u=Ee(function(e){return e}),l=M(null),d=l[0],f=l[1],h=u.config.appearance,p=u.balances.balances.filter(function(e){return"liquidity_pool_shares"!==e.asset_type}).filter(function(e){return"0.0000000"!==e.balance}).map(function(e){return"native"===e.asset_type?{assetIssuer:"",assetCode:"XLM",assetBalance:e.balance,assetType:e.asset_type}:{assetBalance:e.balance,assetCode:e.asset_code,assetType:e.asset_type,assetIssuer:e.asset_issuer}}),b=0!==(t=p).length?t:[ie],m="swapTo"===u.selectAsset.field?ce((null===(e=u.stellar)||void 0===e?void 0:e.activeNetwork)||"").filter(function(e){return!b.some(function(t){return t.assetCode===e.assetCode&&t.assetIssuer===e.assetIssuer})}):[],g=function(e){return e.assetCode.toLowerCase().includes(s.trim().toLowerCase())},v=b.filter(g),y=m.filter(g),w=function(){return i?h.accentColor:h.borderColor},x=function(e,t,n){return z("button",{id:"bluxcc-button",onClick:function(){!function(e){var t,n="sendAsset";"swapTo"===u.selectAsset.field?n="swapToAsset":"swapFrom"===u.selectAsset.field&&(n="swapFromAsset"),u.setSelectAsset(Z(Z({},u.selectAsset),((t={})[n]=e,t.userPicked=!0,t)));var r=$x(u.selectAsset.field);u.setRoute(r)}(e)},onMouseEnter:function(){return f(t)},onMouseLeave:function(){return f(null)},className:"bluxcc:flex bluxcc:w-full bluxcc:items-center bluxcc:justify-between bluxcc:px-4 bluxcc:py-3",style:{background:d===t?h.fieldBackground:"transparent",color:h.textColor,borderBottomStyle:"dashed",borderBottomWidth:n?"0px":h.borderWidth,borderBottomColor:h.borderColor,transition:"all 0.2s ease-in-out",fontFamily:h.fontFamily},children:[z("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:gap-2.5",children:[W("span",{className:"bluxcc:font-medium bluxcc:size-10 bluxcc:flex bluxcc:items-center bluxcc:justify-center",style:{borderRadius:h.borderRadius,background:h.fieldBackground,border:"".concat(h.borderWidth," solid ").concat(h.borderColor)},children:W(VS,{assetCode:e.assetCode,assetIssuer:e.assetIssuer,assetType:e.assetType,fill:Wx(h.fieldBackground)})}),z("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-start",children:[W("span",{className:"bluxcc:text-sm bluxcc:font-medium",children:e.assetCode}),W("span",{className:"bluxcc:text-xs",style:{color:Vx(h.textColor,.7)},children:"native"===e.assetType?"native":eA(e.assetIssuer,4)})]})]}),W("span",{className:"bluxcc:font-medium",children:Yx(e.assetBalance)})]},"".concat(e.assetCode,":").concat(e.assetIssuer))};return z("div",{className:"bluxcc:h-[360px] bluxcc:w-full",children:[W("div",{children:z("div",{onFocus:function(){return o(!0)},onBlur:function(){return o(!1)},onMouseEnter:function(e){i||(e.currentTarget.style.borderColor=h.accentColor,e.currentTarget.style.transition="border-color 0.35s ease-in-out")},onMouseLeave:function(e){i||(e.currentTarget.style.borderColor=h.borderColor)},className:"bluxcc:flex bluxcc:h-14 bluxcc:items-center bluxcc:gap-2 bluxcc:p-4",style:{background:h.fieldBackground,borderWidth:h.borderWidth,"--tw-ring-color":w(),borderRadius:h.borderRadius,borderColor:w(),color:h.textColor},children:[W(yS,{name:wS.Search,props:{fill:h.textColor}}),W("input",{autoFocus:!0,type:"text",id:"bluxcc-input",placeholder:n("search"),value:s,onChange:function(e){return c(e.target.value)},className:"bluxcc:bg-transparent bluxcc:outline-hidden bluxcc:text-base",style:{fontFamily:h.fontFamily,color:h.textColor}})]})}),z("div",{className:"bluxcc:absolute bluxcc:right-0 bluxcc:left-0 bluxcc:mt-4 bluxcc:gap-2 bluxcc:overflow-y-auto bluxcc:overflowStyle bluxcc:max-h-[300px]",children:[v.map(function(e,t){return x(e,t,t===v.length-1)}),y.length>0&&z($,{children:[W("div",{className:"bluxcc:px-4 bluxcc:pt-3 bluxcc:pb-1 bluxcc:text-left bluxcc:text-xs bluxcc:font-medium bluxcc:select-none",style:{color:Vx(h.textColor,.7)},children:n("popularAssets")}),y.map(function(e,t){return x(e,v.length+t,t===y.length-1)})]}),0===v.length&&0===y.length&&W("div",{style:{color:h.textColor},className:"bluxcc:mt-2 bluxcc:text-center",children:n("noAssetsFound")})]})]})},vO=function(){var e;ES();var t=Ee(function(e){return e}),n=t.config.appearance,r=null===(e=t.user)||void 0===e?void 0:e.address,i=t.balances.balances,o=t.setAlert,a=i.find(function(e){return"native"===e.asset_type});a&&a.balance;return z("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:text-center",children:[z("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:size-52 bluxcc:items-center bluxcc:justify-center",style:{position:"relative",borderRadius:n.borderRadius,color:n.textColor,borderColor:n.borderColor,backgroundColor:n.fieldBackground,borderWidth:n.borderWidth},children:[W(__,{size:184,value:r,bgColor:n.fieldBackground,fgColor:n.accentColor,level:"Q"}),W("div",{className:"bluxcc:z-20",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:n.background},children:W(yS,{name:wS.SmallBlux,props:{fill:n.accentColor,background:n.fieldBackground}})})]}),W("p",{style:{color:n.textColor},className:"bluxcc:my-4",children:"Scan this QR code or copy your wallet address to receive payments"}),z("div",{className:"bluxcc:px-2.5 bluxcc:py-3 bluxcc:w-full",style:{color:n.textColor,borderColor:n.borderColor,borderWidth:n.borderWidth,borderRadius:n.borderRadius,backgroundColor:n.fieldBackground},children:[z("div",{className:"bluxcc:py-2 bluxcc:font-medium bluxcc:flex bluxcc:text-sm bluxcc:justify-between bluxcc:items-center",children:[W("span",{className:"",children:"Your Address"}),z("span",{className:"bluxcc:flex bluxcc:justify-center bluxcc:items-center bluxcc:gap-1 bluxcc:text-[15px]",style:{color:Vx(n.accentColor,.7)},onClick:function(){zx(r).then(function(){zx(r),o("copy","Address Copied"),setTimeout(function(){o("none","")},1e3)}).catch(function(){})},children:[r?eA(r,5):"",W(yS,{name:wS.Copy,props:{fill:Vx(n.accentColor,.7)}})]})]}),W("div",{className:"bluxcc:my-2",style:{borderRadius:n.borderRadius,borderTop:"".concat(n.borderWidth," dashed ").concat(n.borderColor)}}),z("div",{className:"bluxcc:py-2 bluxcc:font-medium bluxcc:flex bluxcc:text-sm bluxcc:justify-between bluxcc:items-center",children:[W("span",{className:"",children:"Your Balance"}),z("span",{style:{color:Vx(n.textColor,.7)},children:[Yx(null==a?void 0:a.balance)," XLM"]})]})]})]})},yO=function(e){return"string"==typeof e?e:""},wO=function(t){return t===e.PUBLIC?"mgxanchor.moneygram.com":t===e.TESTNET?"extmgxanchor.moneygram.com":null},xO=function(e){return e.replace(/\/$/,"")},AO=function(e){var t=new URL(e);return t.searchParams.set("callback","postMessage"),t.toString()},EO=function(e,t){if(e.status>=400)throw new Error(yO(e.error)||yO(e.message)||t)},SO=function(t){return t===e.PUBLIC?oe:ae},_O=function(e){return ee(void 0,[e],void 0,function(e){var t,n,r,i,o,a,s,c,u,l,d,f,h,p=e.address,b=e.network,m=e.lang,g=e.sign,v=e.signal;return te(this,function(e){switch(e.label){case 0:if(!(t=wO(b)))throw new Error("BLUX: MoneyGram is only available on mainnet and testnet.");return[4,w.Resolver.resolve(t)];case 1:if(n=e.sent(),r=n.WEB_AUTH_ENDPOINT,i=function(e){var t=e.TRANSFER_SERVER_SEP0024||yO(e.TRANSFER_SERVER_SEP24);if(!t)throw new Error("BLUX: MoneyGram stellar.toml is missing SEP-24.");return xO(t)}(n),!r)throw new Error("BLUX: MoneyGram stellar.toml is missing SEP-10.");return[4,Lx("".concat(xO(r),"?account=").concat(encodeURIComponent(p)),{method:"GET",signal:v})];case 2:if(o=e.sent(),EO(o,"BLUX: MoneyGram authentication failed."),!(a=yO(o.transaction)))throw new Error("BLUX: MoneyGram did not return an auth challenge.");return[4,g(a)];case 3:return s=e.sent(),[4,Lx(xO(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({transaction:s}),signal:v})];case 4:if(c=e.sent(),EO(c,"BLUX: MoneyGram authentication failed."),!(u=yO(c.token)))throw new Error("BLUX: MoneyGram did not return an auth token.");return l=SO(b),[4,Lx("".concat(i,"/transactions/withdraw/interactive"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(u)},body:JSON.stringify({asset_code:l.assetCode,asset_issuer:l.assetIssuer,account:p,lang:m||"en"}),signal:v})];case 5:if(d=e.sent(),EO(d,"BLUX: MoneyGram withdraw failed."),f=yO(d.url),h=yO(d.id),!f||!h)throw new Error("BLUX: MoneyGram did not return a withdraw session.");return[2,{id:h,token:u,transferServer:i,url:AO(f)}]}})})},OO=function(e,t){return ee(void 0,void 0,void 0,function(){var n,r,i,o,a,s,c;return te(this,function(u){switch(u.label){case 0:n=Date.now(),u.label=1;case 1:if(null==t?void 0:t.aborted)throw new Error("BLUX: MoneyGram cash-out cancelled.");if(Date.now()-n>9e5)throw new Error("BLUX: MoneyGram cash-out timed out.");return[4,Lx("".concat(e.transferServer,"/transaction?id=").concat(encodeURIComponent(e.id)),{method:"GET",headers:{Authorization:"Bearer ".concat(e.token)},signal:t})];case 2:if(r=u.sent(),EO(r,"BLUX: MoneyGram transaction lookup failed."),i=r.transaction&&"object"==typeof r.transaction?r.transaction:{},"error"===(o=yO(i.status))||"expired"===o)throw new Error(yO(i.message)||"BLUX: MoneyGram cash-out ".concat(o,"."));if("pending_user_transfer_start"===o){if(a=yO(i.withdraw_anchor_account),s=yO(i.amount_in),c=yO(i.withdraw_memo),!a||!s)throw new Error("BLUX: MoneyGram did not return deposit details.");return[2,{amount:s,destination:a,memo:c,memoType:(l=yO(i.withdraw_memo_type),"id"===l||"hash"===l?l:"text")}]}return[4,new Promise(function(e,n){if(null==t?void 0:t.aborted)n(new Error("BLUX: MoneyGram cash-out cancelled."));else{var r=window.setTimeout(e,3e3);null==t||t.addEventListener("abort",function(){window.clearTimeout(r),n(new Error("BLUX: MoneyGram cash-out cancelled."))},{once:!0})}})];case 3:return u.sent(),[3,1];case 4:return[2]}var l})})},NO=function(e){if(!e)throw new Error("BLUX: Horizon is not configured.");return e};function kO(){var e,t,n=this,r=ES(),i=Ee(function(e){return e}),o=i.config.appearance,a=null===(e=i.user)||void 0===e?void 0:e.address,s=(null===(t=i.stellar)||void 0===t?void 0:t.activeNetwork)||"",c=M("onramp"),u=c[0],l=c[1],d=M("idle"),f=d[0],h=d[1],p=P(null),b=a?"https://buy.moonpay.com?".concat(new URLSearchParams({currencyCode:"xlm",network:"stellar",walletAddress:a}).toString()):void 0,m=a?"https://sell.moonpay.com?".concat(new URLSearchParams({defaultBaseCurrencyCode:"xlm"}).toString()):void 0;R(function(){i.setDynamicTitle("offramp"===u?"cashOut":"addFunds")},[u]),R(function(){return function(){var e;null===(e=p.current)||void 0===e||e.abort(),i.setDynamicTitle("")}},[]);var g=function(e){i.setAlert("error",e),setTimeout(function(){i.setAlert("none","")},2500)},v=[{id:"moonpay",logoElement:W(XS,{}),title:"MoonPay",url:b,disabled:!b},{id:"crypto",logo:wS.Receive,title:r("receiveFunds"),route:Y.FUND_ME_CRYPTO}],y=[{id:"moonpay",logoElement:W(XS,{}),title:"MoonPay",url:m,disabled:!m}];(function(e){return null!==wO(e)})(s)&&y.push({id:"moneygram",logoElement:W(WS,{}),title:"MoneyGram",disabled:!a,onClick:function(){return ee(n,void 0,void 0,function(){var e,t,n,o,c,u;return te(this,function(l){switch(l.label){case 0:if(!a||"idle"!==f)return[2];if(!(e=i.user?Ax(i.user,i.wallets):void 0))return g(r("moneygramError")),[2];t=new AbortController,p.current=t,h("starting"),l.label=1;case 1:return l.trys.push([1,5,,6]),[4,_O({address:a,network:s,lang:i.config.lang,signal:t.signal,sign:function(t){return bA(e,t,a,s)}})];case 2:return n=l.sent(),t.signal.aborted?[2]:(window.open(n.url,"_blank","noopener,noreferrer"),h("waiting"),[4,OO(n,t.signal)]);case 3:return o=l.sent(),[4,n_(o.memo,o.amount,o.destination,SO(s),a,NO(null===(u=i.stellar)||void 0===u?void 0:u.servers.horizon),s,o.memoType)];case 4:return c=l.sent(),i.closeModal(),setTimeout(function(){IA(c,{network:s})},400),[3,6];case 5:return l.sent(),t.signal.aborted?[2]:(g(r("moneygramError")),h("idle"),[3,6]);case 6:return[2]}})})}});var w="onramp"===u?v:y,x=[{key:"onramp",label:r("buy"),Icon:MS},{key:"offramp",label:r("sell"),Icon:RS}],A="idle"!==f;return z("div",{className:"bluxcc:space-y-2",children:[z("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:w-full",children:[W("div",{className:"bluxcc:flex bluxcc:items-center bluxcc:justify-center bluxcc:mb-2 bluxcc:size-17 bluxcc:rounded-full",style:{background:Vx(o.accentColor,.12)},children:W(LS,{fill:o.accentColor})}),W("div",{className:"bluxcc:mb-8 bluxcc:w-2/3 bluxcc:text-center",children:W("p",{className:"bluxcc:text-base bluxcc:font-medium",style:{color:Vx(o.textColor,.7)},children:r(A?"starting"===f?"moneygramSignHelp":"moneygramWaitingHelp":"onramp"===u?"fundMeOnrampHelp":"fundMeOfframpHelp")})})]}),!A&&W("div",{className:"bluxcc:flex bluxcc:gap-3 bluxcc:pb-3",children:x.map(function(e){var t=u===e.key,n=e.Icon;return z("button",{type:"button",role:"tab",id:"bluxcc-button","aria-label":e.label,"aria-selected":t,onClick:function(){return l(e.key)},className:"bluxcc:flex bluxcc:h-20 bluxcc:flex-1 bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:gap-2 bluxcc:py-4 bluxcc:text-sm bluxcc:font-medium bluxcc:transition-all bluxcc:duration-300",style:{background:t?Vx(o.accentColor,.1):o.background,color:t?o.accentColor:o.textColor,borderRadius:o.borderRadius},children:[W(n,{fill:t?o.accentColor:o.textColor}),W("span",{children:e.label})]},e.key)})}),A?W(TS,{label:r("back"),startIcon:W(yS,{name:wS.ArrowLeft,props:{fill:o.accentColor}}),onClick:function(){var e;null===(e=p.current)||void 0===e||e.abort(),p.current=null,h("idle")}}):w.map(function(e){var t;return W(TS,{endArrow:!0,label:e.title,startIcon:null!==(t=e.logoElement)&&void 0!==t?t:e.logo?W(yS,{name:e.logo,props:{fill:o.accentColor}}):W(XS,{}),onClick:function(){return function(e){e.disabled||"idle"!==f||(e.onClick?e.onClick():e.url?window.open(e.url,"_blank","noopener,noreferrer"):e.route&&i.openModal(e.route))}(e)}},e.id)})]})}var TO=function(e){var t=e.label,n=e.icon,r=e.href;e.onClick;var i=Ee(function(e){return e}).config.appearance;return z("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"bluxcc:flex bluxcc:no-underline bluxcc:items-center bluxcc:justify-between bluxcc:w-full bluxcc:h-12 bluxcc:px-4 bluxcc:py-3 bluxcc:my-1 bluxcc:text-sm bluxcc:font-medium bluxcc:cursor-pointer",style:{color:i.textColor,fontFamily:i.fontFamily,borderColor:i.borderColor,borderWidth:i.borderWidth,borderRadius:i.borderRadius,backgroundColor:i.fieldBackground},children:[W("span",{children:t}),n]})},CO=function(){var e,t,n=ES(),r=Ee(function(e){return e}),i=r.config.appearance,o=null===(e=r.apiResponse)||void 0===e?void 0:e.terms,a=null===(t=r.apiResponse)||void 0===t?void 0:t.privacyPolicy,s=[];o&&s.push({label:n("termsOfService"),icon:W(PS,{}),href:o}),a&&s.push({label:n("privacyPolicy"),icon:W(PS,{}),href:a});return z("div",{className:"bluxcc:mt-1 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[W("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",style:{background:Vx(i.accentColor,.12)},children:W(US,{fill:i.accentColor})}),W("div",{className:"bluxcc:mb-10 bluxcc:w-full bluxcc:text-center",children:W("p",{className:"bluxcc:text-base bluxcc:font-medium",style:{color:Vx(i.textColor,.7)},children:n("acceptTermsAndPrivacy")})}),s.map(function(e){return W(TO,Z({},e),e.label)}),W(OS,{}),z("div",{className:"bluxcc:flex bluxcc:flex-col bluxcc:gap-2 bluxcc:w-full",children:[W(BS,{size:"large",variant:"fill",state:"enabled",onClick:function(){a_()},children:n("agree")}),W("button",{style:{color:Vx(i.textColor,.9),fontFamily:i.fontFamily},id:"bluxcc-button",onClick:function(){s_()},className:"bluxcc:flex bluxcc:h-11 bluxcc:font-medium bluxcc:text-base bluxcc:w-full bluxcc:bg-transparent bluxcc:items-center bluxcc:justify-center",children:n("disagree")})]})]})},IO=function(e){return"__BLUX__PASSKEY_CRED__".concat(e)},BO={loading:{title:"passkeyWaitingTitle",content:"passkeyWaitingHelp"},failed:{title:"passkeyFailedTitle",content:"passkeyFailedHelp"},success:{title:"passkeySuccessTitle",content:"passkeySuccessHelp"}};function LO(){return ee(this,void 0,void 0,function(){return te(this,function(e){if("undefined"==typeof window)throw new Error("BLUX: Passkeys require a browser environment.");if(!("credentials"in navigator))throw new Error("BLUX: WebAuthn is not supported in this browser.");if(!("PublicKeyCredential"in window))throw new Error("BLUX: Passkeys are not supported in this browser.");return[2]})})}function MO(e,t,n,r){return ee(this,void 0,void 0,function(){var i,o,a,s;return te(this,function(c){switch(c.label){case 0:return[4,LO()];case 1:return c.sent(),i=Cx(e),o=window.location.hostname,"login"===n&&r?[4,navigator.credentials.get({publicKey:{challenge:i,rpId:o,userVerification:"preferred",timeout:6e4,allowCredentials:[{id:Cx(r),type:"public-key"}]}})]:[3,3];case 2:if(!((a=c.sent())instanceof PublicKeyCredential))throw new Error("BLUX: Passkey login was not completed.");return[2,{step:"login",credential:a}];case 3:return[4,navigator.credentials.create({publicKey:{challenge:i,rp:{name:"BLUX",id:o},user:{id:(new TextEncoder).encode(t),name:"Blux User",displayName:"Blux User"},pubKeyCredParams:[{type:"public-key",alg:-7}],authenticatorSelection:{residentKey:"required",userVerification:"preferred"},timeout:6e4,attestation:"none"}})];case 4:if(!((s=c.sent())instanceof PublicKeyCredential))throw new Error("BLUX: Passkey registration was not completed.");return[2,{step:"register",credential:s}]}})})}var RO=function(){var e=ES(),t=Ee(function(e){return e}),n=t.config.appearance,r=M("loading"),i=r[0],o=r[1],a=function(){return ee(void 0,void 0,void 0,function(){var e,n,r,i,a,c,u;return te(this,function(l){switch(l.label){case 0:return l.trys.push([0,5,,6]),e=t.config.appId,n=function(e){if("undefined"==typeof window||!e)return null;try{return localStorage.getItem(IO(e))||null}catch(e){return null}}(e),r=n?"login":"register",i=null!=n?n:function(){try{if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return"blux-pk-".concat(crypto.randomUUID())}catch(e){}var e=new Uint8Array(16);if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues)crypto.getRandomValues(e);else for(var t=0;t<e.length;t++)e[t]=Math.floor(256*Math.random());var n=Array.from(e).map(function(e){return e.toString(16).padStart(2,"0")}).join("");return"blux-pk-".concat(n)}(),[4,Be(e,i)];case 1:return[4,MO((a=l.sent()).challenge,String(a.user_id),r,null!=n?n:void 0)];case 2:return c=l.sent(),[4,Le(e,a,c)];case 3:return u=l.sent(),function(e,t){if("undefined"!=typeof window&&e&&t)try{localStorage.setItem(IO(e),t)}catch(e){}}(e,c.credential.id),o("success"),[4,s(u)];case 4:return l.sent(),[3,6];case 5:return l.sent(),o("failed"),[3,6];case 6:return[2]}})})},s=function(e){return ee(void 0,void 0,void 0,function(){var n,r;return te(this,function(i){switch(i.label){case 0:return t.setAuth({isAuthenticated:!1,JWT:e}),[4,je(e)];case 1:return n=i.sent(),we(function(e){return Z(Z({},e),{user:{address:n.public_key,walletPassphrase:"",authMethod:n.auth_method||"passkey",authValue:n.auth_value}})}),t.connectWalletSuccessful(n.public_key,(null===(r=t.stellar)||void 0===r?void 0:r.activeNetwork)||""),setTimeout(function(){ye().modal.isOpen&&(t.setRoute(Y.SUCCESSFUL),setTimeout(function(){ye().modal.isOpen&&c_()},1e3))}),[2]}})})};R(function(){a()},[]);return z("div",{className:"bluxcc:mt-4 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[W("div","success"===i?{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",style:{background:Vx(n.accentColor,.1)},children:W(yS,{name:wS.GreenCheck,props:{fill:n.accentColor}})}:"failed"===i?{className:"bluxcc:mb-6 bluxcc:flex bluxcc:items-center bluxcc:justify-center",children:W(yS,{name:wS.RedExclamation,props:{}})}:{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-17 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full",style:{background:Vx(n.accentColor,.1),color:n.accentColor},children:W(qS,{})}),z("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[W("p",{className:"bluxcc:text-xl",children:e(BO[i].title)}),W("p",{className:"bluxcc:text-sm bluxcc:leading-5",children:e(BO[i].content)})]}),W(OS,{}),"loading"===i&&W(BS,{state:"disabled",variant:"outline",startIcon:W(yS,{className:"bluxcc:animate-spin",name:wS.Loading,props:{fill:n.accentColor}}),children:e("passkeyVerifying")}),"success"===i&&W(BS,{state:"disabled",variant:"outline",children:e("loggingIn")}),"failed"===i&&W(BS,{onClick:function(){o("loading"),a()},state:"enabled",variant:"outline",children:e("tryAgain")})]})},PO="#D92D20",UO=function(){var e,t=ES(),n=Ee(function(e){return e}),r=M("loading"),i=r[0],o=r[1],a=M(""),s=a[0],c=a[1],u=M(!1),l=u[0],d=u[1],f=P(!1),h=n.config.appearance,p=(null===(e=n.user)||void 0===e?void 0:e.authMethod)||"",b=p_[p],m=(null==b?void 0:b.displayName)||Dx(p||"social"),g=function(e){return ee(void 0,void 0,void 0,function(){var r,i,a,s,u,l,h;return te(this,function(b){switch(b.label){case 0:if(f.current)return[2];f.current=!0,o("loading"),c(""),d(!1),b.label=1;case 1:return b.trys.push([1,4,5,6]),(r=null!=e?e:y_)&&r.provider===p||(r=A_(p,n.config.appId)),[4,E_(r)];case 2:return i=b.sent(),n.setAuth({isAuthenticated:!1,JWT:i}),[4,je(i)];case 3:return a=b.sent(),we(function(e){return Z(Z({},e),{user:{address:a.public_key,walletPassphrase:"",authMethod:p,authValue:a.auth_value}})}),n.connectWalletSuccessful(a.public_key,(null===(h=n.stellar)||void 0===h?void 0:h.activeNetwork)||""),o("success"),setTimeout(function(){ye().modal.isOpen&&c_()},1200),[3,6];case 4:return s=b.sent(),w_(),u=((null==s?void 0:s.message)||"").replace(/^BLUX:\s*/,""),l=_e(s)||function(e){return/not allowed to access/i.test(e)}(u),o("failed"),d(l),c(u||t("loginRetryMessage")),[3,6];case 5:return f.current=!1,[7];case 6:return[2]}})})};R(function(){return g(),function(){w_()}},[]);var v=function(){w_(),n.setRoute(Y.ONBOARDING)},y="success"===i?"#12B76A":"failed"===i?PO:h.borderColor;return z("div",{className:"bluxcc:mt-3 bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:justify-center bluxcc:select-none",children:[W("div",{className:"bluxcc:mb-6 bluxcc:flex bluxcc:size-20 bluxcc:items-center bluxcc:justify-center bluxcc:overflow-hidden bluxcc:rounded-full bluxcc:transition-colors bluxcc:duration-300",style:{borderColor:y,borderWidth:h.borderWidth,borderStyle:"solid"},children:W(yS,b?{name:b.icon}:{name:wS.Globe,props:{fill:h.textColor}})}),z("div",{className:"bluxcc:flex-col bluxcc:space-y-2 bluxcc:text-center bluxcc:font-medium",children:[z("p",{className:"bluxcc:text-xl",style:{color:h.textColor},children:["loading"===i&&t("waitingFor",{walletName:m}),"success"===i&&t("connectionSuccessfulTitle"),"failed"===i&&t(l?"accessDeniedTitle":"loginFailed")]}),z("p",{className:"bluxcc:min-h-10 bluxcc:text-sm",style:{color:"failed"===i?PO:h.textColor},children:["loading"===i&&t("socialPopupHelp",{provider:m}),"success"===i&&t("connectionSuccessfulMessage"),"failed"===i&&(s||t("loginRetryMessage"))]}),"failed"===i&&l&&W("p",{className:"bluxcc:text-sm bluxcc:opacity-70",style:{color:h.textColor},children:t("accessDeniedHelp")})]}),W(OS,{}),"loading"===i&&W(BS,{state:"disabled",variant:"outline",startIcon:W(yS,{className:"bluxcc:animate-spin",name:wS.Loading,props:{fill:h.accentColor}}),children:t("connecting")}),"success"===i&&W(BS,{state:"disabled",variant:"outline",children:t("loggingIn")}),"failed"===i&&(l?W(BS,{state:"enabled",variant:"fill",onClick:v,children:t("back")}):z("div",{className:"bluxcc:flex bluxcc:w-full bluxcc:flex-col bluxcc:items-center bluxcc:gap-2",children:[W(BS,{state:"enabled",variant:"fill",onClick:function(){g(A_(p,n.config.appId))},children:t("tryAgain")}),W(BS,{size:"medium",state:"enabled",variant:"text",onClick:v,style:{color:h.accentColor},children:t("back")})]}))]})},jO=function(){var e,t=Ee(function(e){var t;return null===(t=e.auth)||void 0===t?void 0:t.JWT}),n=Ee(function(e){var t;return null===(t=e.user)||void 0===t?void 0:t.address}),r=Ee(function(e){var t;return(null===(t=e.stellar)||void 0===t?void 0:t.activeNetwork)||""}),i=Ee(function(e){return e.accountRefreshNonce}),o=Ee(function(e){return e.customTokens}),a=Ee(function(e){return e.setCustomTokens}),s=Ee(function(e){return e.setCustomTokenBalances}),c=P("");R(function(){if(t){if(c.current!==t){c.current=t;var e=!1;return function(e){return ee(void 0,void 0,void 0,function(){var t,n,r,i,o;return te(this,function(a){switch(a.label){case 0:return[4,Lx("".concat(Ce,"/tokens"),{method:"GET",headers:$e(e)})];case 1:if(401===(t=a.sent()).status)throw new Error("BLUX: invalid JWT");if(500===t.status)throw new Error("BLUX: server error");if(200===t.status)return[2,{mainnet:null!==(r=null===(n=t.result)||void 0===n?void 0:n.mainnet)&&void 0!==r?r:[],testnet:null!==(o=null===(i=t.result)||void 0===i?void 0:i.testnet)&&void 0!==o?o:[]}];throw new Error("BLUX: Unexpected response from api")}})})}(t).then(function(t){e||a({mainnet:t.mainnet.map(function(e){return z_(e)}),testnet:t.testnet.map(function(e){return z_(e)})})}).catch(function(){}),function(){e=!0}}}else c.current=""},[t,a]);var u=M_(r),l=null!==(e=o[u])&&void 0!==e?e:[],d=l.map(function(e){return e.id}).join(",");R(function(){if(l.length&&n){var e=!1;return ee(void 0,void 0,void 0,function(){var t;return te(this,function(i){switch(i.label){case 0:return t={},[4,Promise.all(l.map(function(e){return ee(void 0,void 0,void 0,function(){var i,o;return te(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),i=t,o=e.id,[4,(s=e.contractAddress,c=n,u=e.decimals,l=r,ee(void 0,void 0,void 0,function(){var e;return te(this,function(t){switch(t.label){case 0:return[4,XE([{address:s,fn:"balance",args:[pE.address(c)]}],{network:l})];case 1:return e=t.sent(),Array.isArray(e)||null==e.values[0]?[2,"0"]:[2,R_(String(e.values[0]),u)]}})}))];case 1:return i[o]=a.sent(),[3,3];case 2:return a.sent(),[3,3];case 3:return[2]}var s,c,u,l})})}))];case 1:return i.sent(),!e&&Object.keys(t).length&&s(u,t),[2]}})}),function(){e=!0}}},[u,d,n,r,i,s])},FO={error:null,loading:!1,balances:[]},DO=function(){var e,t=Ee(function(e){var t;return null===(t=e.user)||void 0===t?void 0:t.address}),n=Ee(function(e){var t;return(null===(t=e.stellar)||void 0===t?void 0:t.activeNetwork)||""}),r=Ee(function(e){return e.accountRefreshNonce}),o=!!(e=t)&&(i.isValidEd25519PublicKey(e)||i.isValidMed25519PublicKey(e))&&!!n,a="".concat(null!=t?t:"","|").concat(n),s=M(FO),c=s[0],u=s[1],l=M(a),d=l[0],f=l[1];a!==d&&(f(a),u(o?{error:null,loading:!0,balances:[]}:FO));var h=P(0);return R(function(){if(o&&t){var e=++h.current,r=!1;return u(function(e){return{error:null,loading:0===e.balances.length,balances:e.balances}}),EE({address:t,network:n}).then(function(t){r||e!==h.current||u({error:null,loading:!1,balances:t})}).catch(function(t){r||e!==h.current||u(function(e){return{error:t,loading:!1,balances:e.balances}})}),function(){r=!0}}u(FO)},[t,n,r,o]),c},zO=function(){var t,n,r=Ee(function(e){return e}),i=DO(),a=(null===(t=r.stellar)||void 0===t?void 0:t.activeNetwork)||"",s=r.authState.isAuthenticated,c=null===(n=r.user)||void 0===n?void 0:n.address,u=r.modal.isOpen,l=r.modal.route,d=P(""),f=P(!1),h=function(){var e=i.balances,t=e.find(function(e){return"native"===e.asset_type});if(r.modal.route!==Y.SEND&&r.modal.route!==Y.SWAP&&r.modal.route!==Y.SELECT_ASSET&&0!==e.length&&t){var n=Fx(t);e.length>1&&(n=Fx(e[1])),r.setSelectAsset(Z(Z({},r.selectAsset),{swapToAsset:n,sendAsset:Fx(t),swapFromAsset:Fx(t)}))}};R(function(){r.setBalances(i),h()},[i,r.modal.route]),R(function(){if(s&&c){var e=setInterval(function(){ye().bumpAccountRefresh()},2e4);return function(){clearInterval(e)}}},[s,c,a]),R(function(){var e=u&&!f.current;f.current=u,e&&s&&c&&l===Y.PROFILE&&ye().bumpAccountRefresh()},[u,l,s,c]),R(function(){if(!i.loading&&!i.error){var t=i.balances,n=a+"|"+t.map(function(e){return"".concat(T_(e),"@").concat(e.balance)}).join(",");if(n!==d.current){if(d.current=n,t.length){var s=!1;return function(t,n){return ee(void 0,void 0,void 0,function(){var r,i,a,s,c,u;return te(this,function(l){switch(l.label){case 0:if(r={},n!==e.PUBLIC){for(i=0,a=t;i<a.length;i++)s=a[i],r[T_(s)]="0";return[2,r]}return c=new o("USDC",oe.assetIssuer),[4,B_(o.native(),c,n)];case 1:return u=l.sent(),[4,Promise.all(t.map(function(e){return ee(void 0,void 0,void 0,function(){var t,i,o;return te(this,function(a){switch(a.label){case 0:t=T_(e),a.label=1;case 1:return a.trys.push([1,3,,4]),i=r,o=t,[4,L_(e,c,u,n)];case 2:return i[o]=a.sent(),[3,4];case 3:return a.sent(),r[t]="0",[3,4];case 4:return[2]}})})}))];case 2:return l.sent(),[2,r]}})})}(t,a).then(function(e){s||r.setBalanceValues(e)}).catch(function(){}),function(){s=!0}}r.setBalanceValues({})}}},[i,a])},$O=function(e){var t,n,r,i=e.isBodyMount,o=e.mountElement;zO(),jO();var s=Ee(function(e){return e});!function(e){var t,n,r=M(!1),i=r[0],o=r[1];R(function(){var t=setInterval(function(){var t;e.authState.isAuthenticated&&(null===(t=e.user)||void 0===t?void 0:t.authValue)&&"wallet"===e.user.authMethod?Hx(xx[e.user.authValue]).then(function(t){var n;t&&e.config.networks.includes(t)&&(null===(n=e.stellar)||void 0===n?void 0:n.activeNetwork)!==t&&!e.networkSyncDisabled?vE(t):t&&!e.config.networks.includes(t)?(e.setNetworkSyncDisabled(!1),o(!0)):o(!1)}).catch(function(){o(!1)}):o(!1)},1e3);return function(){clearInterval(t),o(!1)}},[e.authState.isAuthenticated,e.config.networks,null===(t=e.user)||void 0===t?void 0:t.authValue,null===(n=e.stellar)||void 0===n?void 0:n.activeNetwork]),R(function(){e.modal.isOpen?i||e.modal.route!==Y.WRONG_NETWORK||e.closeModal():setTimeout(function(){i&&e.config.promptOnWrongNetwork?e.openModal(Y.WRONG_NETWORK):e.closeModal()},300)},[i,e.modal.isOpen])}(s);var u=s.modal,l=s.closeModal,d=s.setShowAllWallets,f=u.route,h=function(){var e;return(e={})[Y.ONBOARDING]={title:"logInOrSignUp",Component:W(S_,{})},e[Y.PROFILE]={title:"profile",Component:W(CS,{})},e[Y.WAITING]={title:"",Component:W(HS,{})},e[Y.SUCCESSFUL]={title:"",Component:W(l_,{})},e[Y.FAILED]={title:"",Component:W(bO,{})},e[Y.SEND_TRANSACTION]={title:"confirmation",Component:W(rO,{})},e[Y.SEND]={title:"send",Component:W(r_,{})},e[Y.ACTIVITY]={title:"activity",Component:W(eO,{})},e[Y.RECEIVE]={title:"receive",Component:W(O_,{})},e[Y.SWAP]={title:"swap",Component:W(QS,{})},e[Y.BALANCES]={title:"balances",Component:W(W_,{})},e[Y.BALANCE_DETAILS]={title:"",Component:W(iO,{})},e[Y.TOKEN_DETAILS]={title:"token_details",Component:W(oO,{})},e[Y.OTP]={title:"",Component:W(u_,{})},e[Y.PASSKEY_ONBOARDING]={title:"",Component:W(RO,{})},e[Y.SOCIALS_ONBOARDING]={title:"",Component:W(UO,{})},e[Y.WRONG_NETWORK]={title:"",Component:W(N_,{})},e[Y.ABOUT]={title:"whatIsBlux",Component:W(cO,{})},e[Y.ADD_TOKEN]={title:"new_token",Component:W(dO,{})},e[Y.SIGN_MESSAGE]={title:"signMessage",Component:W(pO,{})},e[Y.SELECT_ASSET]={title:"selectAsset",Component:W(gO,{})},e[Y.WALLET_CONNECT]={title:"walletConnect",Component:W(mO,{})},e[Y.FUND_ME]={title:"addFunds",Component:W(kO,{})},e[Y.FUND_ME_CRYPTO]={title:"receiveFunds",Component:W(vO,{})},e[Y.ACCEPT_TERMS_AND_PRIVACY]={title:"termsAndConditions",Component:W(CO,{})},e}()[f],p=f===Y.WRONG_NETWORK,b=f===Y.WAITING,m=f===Y.SUCCESSFUL,g=f===Y.SIGN_MESSAGE||f===Y.SEND_TRANSACTION||f===Y.FAILED,v=f===Y.WRONG_NETWORK||b||m,y=b&&"sendTransaction"!==s.waitingStatus||f===Y.ONBOARDING&&s.showAllWallets||[Y.ACTIVITY,Y.SEND,Y.OTP,Y.BALANCES,Y.RECEIVE,Y.SWAP,Y.BALANCE_DETAILS,Y.TOKEN_DETAILS,Y.ABOUT,Y.ADD_TOKEN,Y.WALLET_CONNECT,Y.FUND_ME_CRYPTO].includes(f)?"back":f===Y.ONBOARDING?"info":void 0,w=s.modal.dynamicTitle||h.title,x=function(){if(!p)if(d(!1),"login"!==s.waitingStatus||s.authState.isAuthenticated||!s.login){l();var e=s.waitingStatus;o_();var t="signMessage"===e?s.signMessage:"signAuthEntry"===e?s.signAuthEntry:"sendTransaction"===e?s.sendTransaction:void 0;if("login"!==e&&t){var n=t.resolver,r=t.rejecter,i=t.result;m&&n&&i?(n(i),setTimeout(function(){s.cleanUp(e)},200)):g&&r&&(r("BLUX: User rejected the transaction"),setTimeout(function(){s.cleanUp(e)},200))}}else s_("BLUX: Login cancelled.")};return R(function(){s.authState.isAuthenticated||(s.signMessage&&(s.cleanUp("signMessage"),s.signMessage.rejecter("BLUX: User logged out during the process.")),s.signAuthEntry&&(s.cleanUp("signAuthEntry"),s.signAuthEntry.rejecter("BLUX: User logged out during the process.")),s.sendTransaction&&(s.cleanUp("sendTransaction"),s.sendTransaction.rejecter("BLUX: User logged out during the process.")))},[s.authState]),R(function(){var e,t,n,r=kx((null===(e=s.stellar)||void 0===e?void 0:e.activeNetwork)||"",null!==(t=s.config.transports)&&void 0!==t?t:{}),i=r.horizon,o=r.soroban;s.setStellar({activeNetwork:(null===(n=s.stellar)||void 0===n?void 0:n.activeNetwork)||"",servers:{horizon:new c.Server(i),soroban:new a.Server(o)}})},[s.config.transports,s.config.networks,null===(t=s.stellar)||void 0===t?void 0:t.activeNetwork]),z(vS,{isOpen:u.isOpen,isSticky:p||s.config.isPersistent,onClose:x,isPersistent:null!==(n=s.config.isPersistent)&&void 0!==n&&n,appearance:s.config.appearance,isBodyMount:i,mountElement:o,children:[W(_S,{icon:y,onBack:function(){if(f===Y.WAITING||f===Y.OTP&&!s.authState.isAuthenticated||f===Y.ABOUT||f===Y.WALLET_CONNECT)s.setRoute(Y.ONBOARDING);else if(s.showAllWallets)d(!1);else if([Y.SEND,Y.ACTIVITY,Y.BALANCES,Y.RECEIVE,Y.SWAP].includes(f))s.setRoute(Y.PROFILE);else if([Y.BALANCE_DETAILS,Y.TOKEN_DETAILS,Y.ADD_TOKEN].includes(f))s.setRoute(Y.BALANCES);else if(f!==Y.FUND_ME_CRYPTO){if(f===Y.SELECT_ASSET){var e=$x(s.selectAsset.field);s.setRoute(e)}}else s.setRoute(Y.FUND_ME)},onInfo:function(){s.setRoute(Y.ABOUT)},onClose:x,title:w,closeButton:!v,isPersistent:null!==(r=s.config.isPersistent)&&void 0!==r&&r}),h.Component]})},WO=!1,XO=null,qO=null,KO=function(e){void 0===e&&(e=document.body),WO&&XO&&qO&&qO.contains(XO)&&qO.removeChild(XO),qO=e,XO=document.createElement("div"),e.appendChild(XO),D(XO).render(F($O,{isBodyMount:e===document.body,mountElement:e===document.body?void 0:e}))};function GO(e,t){var n,r;if(WO=!0,!e||0===Object.keys(e).length)throw new Error("BLUX: createConfig must take a config object");if(!e.appId)throw new Error("BLUX: createConfig config object must have the appId property.");if(!e.appName)throw new Error("BLUX: createConfig config object must have the appName property.");if(!e.networks)throw new Error("BLUX: createConfig config object must have the networks property.");var i=["en","es","pt","fr","de","ru","zh","ja","ko","tr"],o=(e.lang||"en").trim().toLowerCase();i.includes(o)||(console.warn("BLUX: '".concat(e.lang,"' is not a supported language (").concat(i.join(", "),"). Falling back to English.")),o="en"),e.isPersistent&&console.warn("BLUX: isPersistent: true is only for testing purposes. Know what you are doing. For a better experience with Blux, remove isPersistent: true."),KO(t);var s=e.excludeWallets||["lobstr"];s=s.map(function(e){return e.toLowerCase().replace(/\s+/g,"")});var u=function(e){if(!e)return[];if(!Array.isArray(e))throw new Error("BLUX: config.orderWallets must be an array of wallet names.");for(var t=new Set(Object.values(H).map(function(e){return Gx(e)})),n=[],r=0,i=e;r<i.length;r++){var o=i[r],a=Gx(String(o));t.has(a)?n.includes(a)||n.push(a):console.warn("BLUX: unknown wallet '".concat(o,"' in config.orderWallets."))}return n}(e.orderWallets),l=!1;void 0!==e.promptOnWrongNetwork&&(l=e.promptOnWrongNetwork);var d=Z(Z(Z({},e),{excludeWallets:s,orderWallets:u,appearance:Z(Z({},ue),null==e?void 0:e.appearance),defaultNetwork:"",promptOnWrongNetwork:l,lang:o,explorer:e.explorer||"stellarchain",loginMethods:e.loginMethods||["wallet"],showWalletUIs:void 0===e.showWalletUIs||e.showWalletUIs}),(null==e?void 0:e.walletConnect)?{walletConnect:e.walletConnect}:{});!function(e,t,n){if(!e||0===e.length)throw new Error("BLUX: No network is set in config.networks.");var r=null!=t?t:e[0];if(!e.includes(r))throw new Error("BLUX: config.defaultNetwork is not listed in config.networks.");for(var i=0,o=e;i<o.length;i++){var a=o[i];if(!(_x[a]||n&&n[a]))throw new Error("BLUX: Must set transports for custom network ".concat(a))}}(e.networks,e.defaultNetwork,e.transports),d.defaultNetwork=null!==(n=e.defaultNetwork)&&void 0!==n?n:e.networks[0];var f=kx(d.defaultNetwork,null!==(r=e.transports)&&void 0!==r?r:{}),h=f.horizon,p=f.soroban,b=ye(),m=b.setConfig,g=b.setWallets,v=b.setIsReady,y=b.setStellar,w=b.setApiResponse;y({activeNetwork:d.defaultNetwork,servers:{horizon:new c.Server(h),soroban:new a.Server(p)}}),m(d);var x,A,E,S=(d.loginMethods||[]).some(function(e){return"wallet"===String(e).toLowerCase().trim()});S||v(!0),function(e,t){return void 0===t&&(t=[]),new Promise(function(n){"complete"===document.readyState?Qx(e,t).then(function(e){n(e)}):window.addEventListener("load",function(){Qx(e,t).then(function(e){n(e)})})})}(s,u).then(function(e){var t=e.filter(function(e){return!s.includes(e.name.toLowerCase().replace(/\s+/g,""))});g(t),S&&v(!0)}),e.walletConnect&&(x=e.walletConnect,A=e.appName,ee(void 0,void 0,void 0,function(){var e,t,n,r;return te(this,function(i){switch(i.label){case 0:if(f_)return[2];f_=!0,i.label=1;case 1:return i.trys.push([1,4,,5]),e=ye(),t=new X({projectId:x.projectId}),[4,q.init({core:t,metadata:{name:A,url:x.url,icons:x.icons,description:x.description}})];case 2:return n=i.sent(),e.setWalletConnectClient(n,null),[4,h_(n)];case 3:return r=i.sent(),e.setWalletConnectClient(n,r),[3,5];case 4:return i.sent(),[3,5];case 5:return[2]}})})),e.trezor&&function(e,t){ux||(ux=tx.init({manifest:{appName:t,appUrl:e.appUrl||window.location.origin,email:e.email},lazyLoad:!0}).catch(function(){ux=null}))}(e.trezor,e.appName),(E=e.appId,ee(void 0,void 0,void 0,function(){var e,t,n,r;return te(this,function(i){switch(i.label){case 0:if(!E)throw new Error("BLUX: appId is missing in config.");i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Lx("".concat(Ce,"/auth/validate"),{method:"POST",headers:(t={},t[Ie]=E,t)})];case 2:return 200===(e=i.sent()).status?[2,{isValid:!0,message:e.message,terms:e.result.terms,privacyPolicy:e.result.privacy_policy,socials:(null!==(n=e.result.socials)&&void 0!==n?n:[]).map(function(e){return e.toLowerCase()}),socialsConfig:(null!==(r=e.result.socials_config)&&void 0!==r?r:[]).map(function(e){return{provider:(e.provider||"").toLowerCase(),displayName:e.display_name||e.provider||""}}),plan:e.result.plan||"free",smsEnabled:!!e.result.sms_enabled}]:404===e.status?[2,{isValid:!1,message:e.error,terms:"",privacyPolicy:"",socials:[],socialsConfig:[],plan:"",smsEnabled:!1}]:[2,{isValid:!1,message:"Unexpected response from api.",terms:"",privacyPolicy:"",socials:[],socialsConfig:[],plan:"",smsEnabled:!1}];case 3:return[2,{isValid:!1,message:"Unexpected response from api. "+i.sent().message,terms:"",privacyPolicy:"",socials:[],socialsConfig:[],plan:"",smsEnabled:!1}];case 4:return[2]}})})).then(function(e){(w(e),e.isValid)?(v_(d.loginMethods,e),(d.loginMethods||[]).some(function(e){return"sms"===String(e).toLowerCase().trim()})&&!e.smsEnabled&&console.error("BLUX: SMS login requires a paid Blux plan. SMS will not be offered until this app is upgraded.")):console.error("BLUX: appId is invalid".concat(e.message?" — ".concat(e.message):"",".")+" Login and signing are disabled.")})}ee(void 0,void 0,void 0,function(){var e,t,n,r;return te(this,function(i){switch(i.label){case 0:if((e=ye().logos)&&e.length>0)return[2];i.label=1;case 1:return i.trys.push([1,6,,7]),[4,ee(void 0,void 0,void 0,function(){var e,t;return te(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,zA()];case 1:return e=n.sent(),[4,WA(e)];case 2:return[2,(t=n.sent()).length?t:null];case 3:return n.sent(),[2,null];case 4:return[2]}})})];case 2:return(t=i.sent())?(ye().setLogos(t),jA(),[2]):[4,UA()];case 3:return n=i.sent(),ye().setLogos(n),[4,zA()];case 4:return r=i.sent(),[4,$A(r,n)];case 5:case 6:return i.sent(),[3,7];case 7:return[2]}})}),ee(void 0,void 0,void 0,function(){var e,t;return te(this,function(n){switch(n.label){case 0:if(ye().assetMeta)return[2];n.label=1;case 1:return n.trys.push([1,5,,6]),[4,ZA()];case 2:return(e=n.sent())?(ye().setAssetMeta(e),GA(),[2]):[4,HA()];case 3:return t=n.sent(),ye().setAssetMeta(t),[4,JA(t)];case 4:case 5:return n.sent(),[3,6];case 6:return[2]}})}),ee(void 0,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:return[4,lA()];case 1:return e.sent(),function(){var e;return!0===(null===(e=ye().apiResponse)||void 0===e?void 0:e.isValid)}()?(NA(!0),[2]):[2]}})});export{re as BluxEvent,pE as ToScVal,MA as blux,pS as core,GO as createConfig,mS as events,IE as fundAccount,yE as getAccount,xE as getAccounts,AE as getAssets,EE as getBalances,SE as getClaimableBalances,_E as getEffects,pe as getInitialState,BE as getLedgers,LE as getLiquidityPools,ME as getNetwork,RE as getOffers,PE as getOperations,UE as getOrderbook,jE as getPayments,lS as getSacAddress,fe as getState,FE as getStrictReceivePaths,DE as getStrictSendPaths,dS as getTokenMetadata,zE as getTradeAggregation,$E as getTrades,WE as getTransactions,fS as networks,iE as numberish,XE as readContracts,tE as resolveAddress,nE as resolveAddressKey,QA as resolveAsset,bS as setAppearance,he as subscribe,uS as swap,hS as switchNetwork,GE as transfer,de as useExportedStore,qE as writeContract};