/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/oreid-js@4.7.2/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("uuid"),require("canonicalize"),require("jwt-decode"),require("js-base64"),require("@aikon/eos-transit"),require("@msgpack/msgpack"),require("axios"),require("crypto-js/hmac-sha256"),require("js-cookie")):"function"==typeof define&&define.amd?define(["exports","uuid","canonicalize","jwt-decode","js-base64","@aikon/eos-transit","@msgpack/msgpack","axios","crypto-js/hmac-sha256","js-cookie"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["oreid-js"]={},e.uuid,e.canonicalize,e.jwtDecode,e.jsBase64,e.eosTransit,e.msgpack,e.axios,e.HmacSHA256,e.Cookie)}(this,(function(e,t,r,n,o,i,s,a,c,u){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var p=l(r),h=l(n),v=l(a),f=l(c),g=d(u),y=function(e,t){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},y(e,t)};function T(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}y(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var w,m,k,b,A,I,_,P,C,E,x=function(){return x=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},x.apply(this,arguments)};function S(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function N(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function W(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function O(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function U(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}e.RequestType=void 0,(w=e.RequestType||(e.RequestType={})).Get="get",w.Post="put",e.ApiEndpoint=void 0,(m=e.ApiEndpoint||(e.ApiEndpoint={})).AddPermission="account/add-permission",m.AppToken="app-token",m.CanAutoSign="transaction/can-auto-sign",m.ConvertOauthTokens="account/convert-oauth",m.CustodialMigrateAccount="custodial/migrate-account",m.CustodialNewAccount="custodial/new-user",m.CustodialSignString="custodial/sign-string",m.DeleteTestUser="account/delete-test-user",m.CustodialSign="custodial/sign",m.GetUser="account/user",m.GetConfig="services/config",m.LoginUserWithToken="account/login-user-with-token",m.NewUserWithToken="account/new-user-with-token",m.PasswordLessSendCode="account/login-passwordless-send-code",m.PasswordLessVerifyCode="account/login-passwordless-verify-code",m.TransactionSign="transaction/sign",m.UpdateDelayWalletSetup="account/update-delay-wallet-setup",e.ConfigType=void 0,(e.ConfigType||(e.ConfigType={})).Chains="chains",e.ChainPlatformType=void 0,(k=e.ChainPlatformType||(e.ChainPlatformType={})).algorand="algorand",k.eos="eos",k.ethereum="ethereum",k.ore="ore",e.ChainNetwork=void 0,(b=e.ChainNetwork||(e.ChainNetwork={})).AlgoMain="algo_main",b.AlgoBeta="algo_beta",b.AlgoTest="algo_test",b.AvalancheC_Main="avalanchec_main",b.AvalancheC_Fuji="avalanchec_fuji",b.DspEosKylin1="kylin-dsp-1.liquidapps.io",b.DspEosKylin2="kylin-dsp-2.liquidapps.io",b.DspMoonlighting="eos_moon_blockstartdsp_com",b.DspMoonlightingTest="eos_moontest_blockstartdsp_com",b.DosMain="dos_main",b.DosTest="dos_test",b.EthMain="eth_main",b.EthRopsten="eth_ropsten",b.EthRinkeby="eth_rinkeby",b.EthGoerli="eth_goerli",b.EosMain="eos_main",b.EosKylin="eos_kylin",b.EosJungle="eos_jungle",b.MigrateEosMain="migrate_eos_main",b.OreMain="ore_main",b.OreTest="ore_test",b.PolygonMain="polygon_main",b.PolygonMumbai="polygon_mumbai",b.TelosMain="telos_main",b.TelosTest="telos_test",b.TelosEvmMain="telosevm_main",b.TelosEvmTest="telosevm_test",b.UxMain="ux_main",b.WaxMain="wax_main",b.WaxTest="wax_test",e.AccountType=void 0,(A=e.AccountType||(e.AccountType={})).Native="native",A.Pending="pending",A.VirtualLiquid="liquid",A.VirtualNested="nested",e.LoginProvider=void 0,(I=e.LoginProvider||(e.LoginProvider={})).Custodial="custodial",I.Apple="apple",I.Email="email",I.Facebook="facebook",I.Github="github",I.Google="google",I.Instagram="instagram",I.Kakao="kakao",I.Line="line",I.LinkedIn="linkedin",I.Phone="phone",I.Twitch="twitch",I.Twitter="twitter",e.ExternalWalletType=void 0,(_=e.ExternalWalletType||(e.ExternalWalletType={})).AlgoSigner="algosigner",_.Anchor="anchor",_.Keycat="keycat",_.Ledger="ledger",_.Lynx="lynx",_.Meetone="meetone",_.Metro="metro",_.Portis="portis",_.Scatter="scatter",_.SimpleEos="simpleos",_.TokenPocket="tokenpocket",_.WalletConnect="walletconnect",_.Web3="web3",_.WhaleVault="whalevault",_.Wombat="wombat",e.AuthProvider=void 0,(P=e.AuthProvider||(e.AuthProvider={})).Custodial="custodial",P.Apple="apple",P.Email="email",P.Facebook="facebook",P.Github="github",P.Google="google",P.Instagram="instagram",P.Kakao="kakao",P.Line="line",P.LinkedIn="linkedin",P.Phone="phone",P.Twitch="twitch",P.Twitter="twitter",P.AlgoSigner="algosigner",P.Anchor="anchor",P.Keycat="keycat",P.Ledger="ledger",P.Lynx="lynx",P.Meetone="meetone",P.Metro="metro",P.Portis="portis",P.Scatter="scatter",P.SimpleEos="simpleos",P.TokenPocket="tokenpocket",P.WalletConnect="walletconnect",P.Web3="web3",P.WhaleVault="whalevault",P.Wombat="wombat",P.OreId="oreid",e.ApiKeyUsedFor=void 0,(C=e.ApiKeyUsedFor||(e.ApiKeyUsedFor={})).AccountMigration="accountMigration",C.Airdrop="airdrop",C.AdminAccess="adminAccess",C.AutoSigning="autoSigning",C.ChangePassword="changePassword",C.CreateUser="createUser",C.ProxySigning="proxySigning",C.TokenFunding="tokenFunding",e.RecoverAccountAction=void 0,(e.RecoverAccountAction||(e.RecoverAccountAction={})).Republic="republic",e.ExternalWalletInterface=void 0,(E=e.ExternalWalletInterface||(e.ExternalWalletInterface={})).Transit="transit",E.Ual="ual";var D,L;e.WebWidgetAction=void 0,(D=e.WebWidgetAction||(e.WebWidgetAction={})).Auth="auth",D.Logout="logout",D.NewChainAccount="newChainAccount",D.RecoverAccount="recoverAccount",D.Sign="sign",D.Buy="buy",D.KeyExport="keyExport",e.SignStringMethod=void 0,(L=e.SignStringMethod||(e.SignStringMethod={})).EthereumPersonalSign="ethereum.personal-sign",L.EthereumSignTypedData="ethereum.sign-typed-data",L.EthereumSign="ethereum.eth-sign";var q=function(e,t,r){return e.replace(new RegExp(t,"g"),r)},H=function(){function r(){}return r.isNullOrEmpty=function(e){return void 0===e||(null===e||(!(!Array.isArray(e)||0!==e.length)||0===Object.keys(e).length&&e.constructor===Object))},r.log=function(e,t){},r.jwtDecodeSafe=function(e){var t;if(this.isNullOrEmpty(e))return null;try{t=h.default(e)}catch(e){}return t},r.parseUrlParams=function(e){var t,r={};try{var n=new URL(e);t=n.hash?n.hash.slice(1):n.search}catch(r){t=e}return new URLSearchParams(t).forEach((function(e,t){r[t]=decodeURIComponent(e)||"true"})),r},r.tryParseJSON=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o="";if(!e||!r.isAString(e)||""===e.trim())return null;try{t&&(e=decodeURI(e)),o=e,n&&(o=q(e,"'",'"'),o=q(o,"`",'"'));var i=JSON.parse(o,r.jsonParseComplexObjectReviver);if(i&&"object"==typeof i)return i}catch(e){}return null},r.jsonParseComplexObjectReviver=function(e,t){if(null!==t&&"object"==typeof t&&"type"in t&&"Buffer"===t.type&&"data"in t&&Array.isArray(t.data))return Buffer.from(t.data);if(null!==t&&"object"==typeof t&&!Array.isArray(t)&&"0"in t&&r.isANumber(t[0])){var n=Object.entries(t).map((function(e){return O(e,2)[1]}));if(n.every((function(e){return r.isANumber(e)||e<256})))return new Uint8Array(n)}return t},r.base64DecodeSafe=function(e){var t={};if(this.isNullOrEmpty(e))return null;try{t=o.Base64.decode(e),r.tryParseJSON(t)&&(t=JSON.parse(t))}catch(e){return null}return t},r.base64Encode=function(e){if(!e)return null;var t=e;return r.isAnObject(t)&&(t=JSON.stringify(t)),o.Base64.encode(t)},r.sleep=function(e){return new Promise((function(t){return setTimeout(t,e)}))},r.createGuid=function(){return t.v4()},r.isInEnum=function(e,t){return Object.values(e).includes(t)},r.toEnumValue=function(e,t,r){if(void 0===r&&(r=!1),this.isNullOrEmpty(t))return null;if(this.isInEnum(e,t))return t;var n="Value ".concat(JSON.stringify(t)," is not a valid member of enum ").concat(JSON.stringify(e),".");if(r)throw new Error(n);return null},r.getErrorCodesFromParams=function(e){var t,r=e.error_code||e.errorCode,n=e.error_message||e.errorMessage;return r&&(t=r.split(/[/?/$&]/)),(t||n)&&(t=t||[]).push(n),t},r.extractDataFromCallbackUrl=function(e){var t={};if(e){t=this.parseUrlParams(e);var r=this.getErrorCodesFromParams(t);return x(x({},t),{errors:r})}return t},r.asyncForEach=function(e,t){return N(this,void 0,void 0,(function(){var n;return W(this,(function(o){switch(o.label){case 0:if(r.isNullOrEmpty(e))return[2];n=0,o.label=1;case 1:return n<e.length?[4,t(e[n],n,e)]:[3,4];case 2:o.sent(),o.label=3;case 3:return n+=1,[3,1];case 4:return[2]}}))}))},r.getClaimFromJwtTokenBySearchString=function(e,t){var r;return this.isAnObject(e)?(Object.keys(e).forEach((function(n){n.includes(t)&&(r=e[n])})),r):null},r.getErrorFromAxiosError=function(e){if("network error"===(null==e?void 0:e.message.toLowerCase()))throw new Error("Browser threw a Network Error. This is likely because of CORS error. Make sure that you are not sending an api-key in the header of the request.");if("ECONNREFUSED"===(null==e?void 0:e.code))throw new Error("Could not connect to ORE ID service. ".concat(e.message,"."));if(!r.isAxiosError(e))return e;var t=((null==e?void 0:e.response)||{}).data,n=void 0===t?{}:t,o=n.message,i=this.getErrorCodesFromParams(n),s=i&&(null==i?void 0:i.length)>1?i.join(", "):i;return Error(s||o||"unknown error")},r.isAxiosError=function(e){return void 0!==e.isAxiosError},r.isAString=function(e){return!!e&&("string"==typeof e||e instanceof String)},r.isADate=function(e){return e instanceof Date},r.isABoolean=function(e){return"boolean"==typeof e||e instanceof Boolean},r.isANumber=function(e){return!Number.isNaN(e)&&("number"==typeof e||e instanceof Number)},r.isAnObject=function(e){return null!==e&&"object"==typeof e},r.assertValidProvider=function(t){if(r.isInEnum(e.AuthProvider,t))return!0;throw new Error("Auth provider ".concat(t," is not a valid option"))},r.mapAuthProviderToWalletType=function(t){return t?r.toEnumValue(e.ExternalWalletType,t):null},r.isCustodial=function(t){return t===e.AuthProvider.Custodial},r.isValidEmail=function(e){if(!e)return!1;return/^(([^<>()[]\\.,;:\s@]+(\.[^<>()[]\\.,;:\s@]+)*)|(.+))@(([[0-9]{1,3}\[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},r.sortJson=function(e){if(!e)return e;var t=p.default(e);return JSON.parse(t)},r.getUniqueValues=function(e){return Array.from(new Set(e.map((function(e){return JSON.stringify(e)})))).map((function(e){return JSON.parse(e)}))},r.runAtTime=function(e,t){var r=Date.now(),n=Math.max(t,r);return setTimeout(e,n-r)},r.objectsAreEqual=function(e,t){var n,o;if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;try{for(var a=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(i),c=a.next();!c.done;c=a.next()){var u=c.value;if(!s.includes(u))return!1;if("function"==typeof e[u]||"function"==typeof t[u]){if(e[u].toString()!==t[u].toString())return!1}else if(!r.objectsAreEqual(e[u],t[u]))return!1}}catch(e){n={error:e}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return!0},r.isInBrowser="undefined"!=typeof window,r}(),j=H.isNullOrEmpty;function R(e,t){var r;if(!e.accessToken&&!(null===(r=e.options)||void 0===r?void 0:r.apiKey))throw new Error("Missing required header for API ".concat(t,": Must have a valid user accessToken or options.apiKey"))}function F(e,t,r){var n;if(!(null===(n=e.options)||void 0===n?void 0:n.apiKey)){var o=t?" - with ".concat(t," right."):".";throw new Error("Missing required header for API ".concat(r,": Must have an options.apiKey").concat(o))}}function M(e,t,r){void 0===e&&(e={});var n=[];if(t.forEach((function(t){j(e[t])&&n.push(t)})),!j(n))throw new Error("Missing required parameter(s) for API ".concat(r,": ").concat(n.join(", ")))}function K(e,t,r){if(void 0===e&&(e={}),t.filter((function(t){return!j(e[t])})).length>1)throw new Error("You can only provide one of these parameter(s) for API ".concat(r,": ").concat(t.join(", ")))}function V(e){var t;return(null==e?void 0:e.processId)&&(t=e.processId,delete e.processId),{data:e,processId:t}}function B(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s,a,c,u;return W(this,(function(l){switch(l.label){case 0:return n=e.ApiEndpoint.AddPermission,R(t,n),M(r,["account","chainAccount","chainNetwork","permission","publicKey"],n),o=r.account,i=r.permission,s=r.provider,a=r.parentPermission,c={},s&&(c["wallet-type"]=s),a&&(c["parent-permission"]=a),u=x({account:o,"chain-account":r.chainAccount,"chain-network":r.chainNetwork,"public-key":r.publicKey,permission:i},c),[4,t.callOreIdApi(e.RequestType.Get,e.ApiEndpoint.AddPermission,u,null)];case 1:return[2,l.sent()]}}))}))}function z(t,r){return N(this,void 0,void 0,(function(){var n,o;return W(this,(function(i){switch(i.label){case 0:return n=e.ApiEndpoint.AppToken,o=r.appAccessTokenMetadata,H.isNullOrEmpty(o)?F(t,null,n):F(t,e.ApiKeyUsedFor.CreateUser,n),[4,t.callOreIdApi(e.RequestType.Post,e.ApiEndpoint.AppToken,o,null)];case 1:return[2,i.sent().appAccessToken]}}))}))}function J(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s,a,c,u,l;return W(this,(function(d){switch(d.label){case 0:return n=e.ApiEndpoint.CanAutoSign,o=r.account,i=r.chainAccount,s=r.chainNetwork,a=r.signedTransaction,c=r.transaction,u=r.transactionChainAccount,F(t,e.ApiKeyUsedFor.AutoSigning,n),M(r,["account","chainNetwork","chainAccount"],n),K(r,["transaction","signedTransaction"],n),l={account:o,chain_account:i,chain_network:s},c&&(l.transaction=H.base64Encode(c)),a&&(l.signed_transaction=H.base64Encode(a)),c&&(l.transaction_chain_acccount=u),[4,t.callOreIdApi(e.RequestType.Post,e.ApiEndpoint.CanAutoSign,l,null)];case 1:return[2,d.sent()]}}))}))}function G(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s;return W(this,(function(a){switch(a.label){case 0:return n=e.ApiEndpoint.ConvertOauthTokens,o=r.accessToken,i=r.idToken,R(t,n),M(r,["idToken"],n),s={},o&&(s.access_token=o),i&&(s.id_token=i),[4,t.callOreIdApi(e.RequestType.Post,e.ApiEndpoint.ConvertOauthTokens,s,null)];case 1:return[2,a.sent()]}}))}))}function Y(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s,a,c,u,l;return W(this,(function(d){switch(d.label){case 0:return n=e.ApiEndpoint.CustodialMigrateAccount,o=r.account,i=r.chainAccount,s=r.chainNetwork,a=r.toType,c=r.userPassword,u=r.userPasswordEncrypted,l={account:o,chain_account:i,chain_network:s,to_type:a,user_password:c,user_password_encrypted:u},F(t,e.ApiKeyUsedFor.AccountMigration,n),M(r,["account","chainAccount","chainNetwork","toType"],n),K(r,["user_password","user_password_encrypted"],n),[4,t.callOreIdApi(e.RequestType.Post,e.ApiEndpoint.CustodialMigrateAccount,l,null)];case 1:return[2,d.sent()]}}))}))}function Z(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s,a,c,u,l,d,p,h,v,f,g;return W(this,(function(y){switch(y.label){case 0:if(n=e.ApiEndpoint.CustodialNewAccount,o=r.accountType,i=r.delayWalletSetup,s=r.email,a=r.emailVerified,c=r.idToken,u=r.isTestUser,l=r.name,d=r.picture,p=r.phone,h=r.phoneVerified,v=r.userName,f=r.userPassword,g={account_type:o,delay_wallet_setup:i,email:s,email_verified:a,id_token:c,is_test_user:u,name:l,phone:p,phone_verified:h,picture:d,user_name:v,user_password:f},F(t,e.ApiKeyUsedFor.CreateUser,n),M(r,["accountType"],n),K(r,["user_password","user_password_encrypted","user_password_encrypted_backup"],n),!(c||s&&l))throw new Error("Missing required parameter(s) for API ".concat(n,": Must include email AND name or an idToken"));return[4,t.callOreIdApi(e.RequestType.Post,e.ApiEndpoint.CustodialNewAccount,g,null)];case 1:return[2,y.sent()]}}))}))}function $(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s,a,c,u,l;return W(this,(function(d){switch(d.label){case 0:return n=e.ApiEndpoint.CustodialSignString,o=r.chainAccount,i=r.chainNetwork,s=r.permission,a=r.stringToSign,c=r.signMethod,u=r.userPassword,l={chain_account:o,chain_network:i,permission:s,string_to_sign:a,user_password:u},c&&(l.sign_method=c),F(t,e.ApiKeyUsedFor.ProxySigning,n),M(r,["chainAccount","chainNetwork","stringToSign"],n),K(r,["user_password","user_password_encrypted"],n),[4,t.callOreIdApi(e.RequestType.Post,e.ApiEndpoint.CustodialSignString,l,null)];case 1:return[2,d.sent()]}}))}))}function Q(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s;return W(this,(function(a){switch(a.label){case 0:return n=e.ApiEndpoint.DeleteTestUser,o=r.account,R(t,n),M(r,["account"],n),i={account:o},[4,t.callOreIdApi(e.RequestType.Post,e.ApiEndpoint.DeleteTestUser,i)];case 1:return s=a.sent(),[2,V(s).data]}}))}))}function X(t,r){return N(this,void 0,void 0,(function(){var n,o,i;return W(this,(function(s){switch(s.label){case 0:return n=e.ApiEndpoint.GetConfig,R(t,n),M(r,["configType"],n),o=r.configType,i={type:o},[4,t.callOreIdApi(e.RequestType.Get,e.ApiEndpoint.GetConfig,i,null)];case 1:return[2,s.sent().values]}}))}))}function ee(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s;return W(this,(function(a){switch(a.label){case 0:return n=e.ApiEndpoint.GetUser,o=r.account,R(t,n),M(r,["account"],n),i={account:o},[4,t.callOreIdApi(e.RequestType.Get,e.ApiEndpoint.GetUser,i)];case 1:return s=a.sent(),[2,V(s).data]}}))}))}function te(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s,a;return W(this,(function(c){switch(c.label){case 0:return n=e.ApiEndpoint.LoginUserWithToken,o=r.accessToken,i=r.idToken,s=r.provider,K(r,["accessToken","idToken"],n),K(r,["idToken","provider"],n),o&&!H.jwtDecodeSafe(o)&&(M(r,["provider"],n),F(t,null,"login-user-with-token")),a={},i?a.id_token=i:(a.access_token=o,a.provider=s),[4,t.callOreIdApi(e.RequestType.Post,e.ApiEndpoint.LoginUserWithToken,a,null)];case 1:return[2,c.sent()]}}))}))}function re(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s,a,c,u;return W(this,(function(l){switch(l.label){case 0:return n=e.ApiEndpoint.NewUserWithToken,o=r.accessToken,i=r.delayWalletSetup,s=r.isTestUser,a=r.idToken,c=r.provider,function(e,t,r){if(void 0===e&&(e={}),0===t.filter((function(t){return!j(e[t])})).length)throw new Error("Missing at least one of these parameter(s) for API ".concat(r,": ").concat(t.join(", ")))}(r,["idToken","accessToken"],n),K(r,["idToken","provider"],n),o&&(M(r,["accessToken","provider"],n),F(t,null,"new-user-with-token")),u={},a?u.id_token=a:(u.access_token=o,u.provider=c),!0===s&&(u.is_test_user=!0),!0===i&&(u.delay_wallet_setup=!0),[4,t.callOreIdApi(e.RequestType.Post,e.ApiEndpoint.NewUserWithToken,u,null)];case 1:return[2,l.sent()]}}))}))}function ne(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s,a;return W(this,(function(c){switch(c.label){case 0:return n=e.ApiEndpoint.PasswordLessSendCode,R(t,n),M(r,["provider"],n),K(r,["email","phone"],n),o=r.email,i=r.phone,s=r.provider,a={provider:s},o&&(a.email=encodeURIComponent(o)),i&&(a.phone=encodeURIComponent(i)),[4,t.callOreIdApi(e.RequestType.Get,e.ApiEndpoint.PasswordLessSendCode,a,null)];case 1:return[2,c.sent()]}}))}))}function oe(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s,a,c;return W(this,(function(u){switch(u.label){case 0:return n=e.ApiEndpoint.PasswordLessVerifyCode,R(t,n),M(r,["code","provider"],n),K(r,["email","phone"],n),o=r.code,i=r.email,s=r.phone,a=r.provider,c={code:o,provider:a},i&&(c.email=encodeURIComponent(i)),s&&(c.phone=encodeURIComponent(s)),[4,t.callOreIdApi(e.RequestType.Get,e.ApiEndpoint.PasswordLessVerifyCode,c,null)];case 1:return[2,u.sent()]}}))}))}function ie(e){var t,r=e.transactionData||{},n=r.account,o=r.chainAccount,i=r.chainNetwork,s=r.expireSeconds,a=r.signedTransaction,c=r.transaction,u=r.transactionChainAccount,l=r.transactionRecordId,d=(null===(t=e.transactionData)||void 0===t?void 0:t.signOptions)||{},p=d.allowChainAccountSelection,h=d.broadcast,v=d.generateAutoSignCredential,f=d.multiSigChainAccounts,g=d.returnSignedTransaction,y=d.userPassword,T=d.userPasswordEncrypted,w=e.autoSign,m={account:n,broadcast:h,chain_account:o,chain_network:i};return p&&(m.allow_chain_account_selection=p),w&&(m.auto_sign=w),s&&(m.expire_seconds=s),v&&(m.generate_auto_sign_credential=v),f&&(m.multisig_chain_accounts=f),g&&(m.return_signed_transaction=g),a&&(m.signed_transaction=H.base64Encode(a)),u&&(m.transaction_chain_acccount=u),c&&(m.transaction=H.base64Encode(c)),l&&(m.transaction_record_id=l),y&&(m.user_password=y),T&&(m.user_password_encrypted=T),m}function se(e){var t=e.signed_transaction,r=e.transaction_id,n=S(e,["signed_transaction","transaction_id"]);return x({signedTransaction:t,transactionId:r},n)}function ae(t,r){return N(this,void 0,void 0,(function(){var n,o;return W(this,(function(i){switch(i.label){case 0:return n=e.ApiEndpoint.TransactionSign,(null==r?void 0:r.autoSign)?F(t,e.ApiKeyUsedFor.AutoSigning,n):R(t,n),M(r.transactionData,["account","chainNetwork","chainAccount"],n),K(r.transactionData,["transaction","signedTransaction"],n),o=ie(r),[4,t.callOreIdApi(e.RequestType.Post,e.ApiEndpoint.TransactionSign,o,null)];case 1:return[2,se(i.sent())]}}))}))}function ce(t,r){return N(this,void 0,void 0,(function(){var n,o,i;return W(this,(function(s){switch(s.label){case 0:return n=e.ApiEndpoint.CustodialSign,o=(r.transactionData||{}).signOptions,F(t,e.ApiKeyUsedFor.ProxySigning,n),M(r.transactionData,["account","chainNetwork","chainAccount"],n),K(r.transactionData,["transaction","signedTransaction"],n),K(o,["userPassword","userPasswordEncrypted"],n),i=ie(r),[4,t.callOreIdApi(e.RequestType.Post,e.ApiEndpoint.CustodialSign,i,null)];case 1:return[2,se(s.sent())]}}))}))}var ue=H.isNullOrEmpty;function le(e,t){return N(this,void 0,void 0,(function(){var r,n,o,i,s,a,c,u,l,d,p,h,v;return W(this,(function(f){if(r=t.account,n=t.accountType,o=t.chainNetwork,i=t.accountOptions,s=t.provider,a=t.callbackUrl,c=t.backgroundColor,u=t.state,l=e.options.oreIdUrl,d={paramsNewAccount:{account:r,accountType:n,chainNetwork:o,accountOptions:i}},!(r&&n&&o&&s&&a))throw new Error("Missing a required parameter");return p="&oauth_access_token=".concat(e.accessToken),h=u?"&state=".concat(u):"",v="".concat(l,"/new-account#provider=").concat(s,"&chain_network=").concat(o)+"&callback_url=".concat(encodeURIComponent(a),"&background_color=").concat(encodeURIComponent(c)).concat(h).concat(p),[2,e.addAccessTokenAndHmacToUrl(v,d)]}))}))}function de(e,t){return N(this,void 0,void 0,(function(){var r,n,o,i,s,a,c,u,l,d,p,h,v,f,g,y,T,w,m;return W(this,(function(k){if(r=t.code,n=t.email,o=t.phone,i=t.provider,s=t.callbackUrl,a=t.backgroundColor,c=t.state,u=t.linkToAccount,l=t.returnAccessToken,d=t.returnIdToken,p=e.options.oreIdUrl,!i||!s)throw new Error("Missing a required parameter");return h=c?"&state=".concat(c):"",v=u?"&link_to_account=".concat(u):"",f=r?"&code=".concat(r):"",g=n?"&email=".concat(encodeURIComponent(n)):"",y=o?"&phone=".concat(encodeURIComponent(o)):"",T=l?"&return_access_token=".concat(l):"",w=d?"&return_id_token=".concat(d):"",m="".concat(p,"/auth#provider=").concat(i)+"".concat(f).concat(g).concat(y)+"&callback_url=".concat(encodeURIComponent(s),"&background_color=").concat(encodeURIComponent(a)).concat(v).concat(h).concat(T).concat(w),[2,e.addAccessTokenAndHmacToUrl(m,null)]}))}))}function pe(e,t){return N(this,void 0,void 0,(function(){var r,n,o,i,s,a,c,u,l,d,p,h,v,f,g,y,T,w,m,k;return W(this,(function(b){if(r=t.account,n=t.chainNetwork,o=t.expireSeconds,i=t.signedTransaction,s=t.transaction,a=t.transactionRecordId,c=(null==t?void 0:t.signOptions)||{},u=c.allowChainAccountSelection,l=c.broadcast,d=c.callbackUrl,p=c.multiSigChainAccounts,h=c.provider,v=c.returnSignedTransaction,f=c.state,g=t.chainAccount,y=e.options.oreIdUrl,!r||!d||!s&&!i)throw new Error("Missing a required parameter");return g||(g=r),T=H.base64Encode(s),w=H.base64Encode(i),m=f?"&state=".concat(f):"",m+=ue(s)?"":"&transaction=".concat(T),m+=ue(i)?"":"&signed_transaction=".concat(w),m+=ue(u)?"":"&allow_chain_account_selection=".concat(u),m+=ue(o)?"":"&expire_seconds=".concat(o),m+=ue(p)?"":"&multisig_chain_accounts=".concat(p),m+=ue(h)?"":"&provider=".concat(h),m+=ue(v)?"":"&return_signed_transaction=".concat(v),m+=ue(a)?"":"&transaction_record_id=".concat(a),m+="&oauth_access_token=".concat(e.accessToken),k="".concat(y,"/sign#account=").concat(r,"&broadcast=").concat(l,"&callback_url=").concat(encodeURIComponent(d),"&chain_account=").concat(g,"&chain_network=").concat(encodeURIComponent(n)).concat(m),[2,e.addAccessTokenAndHmacToUrl(k,null)]}))}))}function he(e){var t=function(e){for(var t in e)if(e.hasOwnProperty(t)&&(!e[t]||0===e[t].length))return{containsEmpty:!0,firstEmptyKey:t};return{containsEmpty:!1,firstEmptyKey:void 0}}(e);if(t.containsEmpty)throw new Error("The object contains empty or 0 values. First empty or 0 value encountered during encoding: "+t.firstEmptyKey);return s.encode(e,{sortKeys:!0})}var ve=function(e,t){t(e.keyToAccountMap)},fe=[{providerName:e.ExternalWalletType.AlgoSigner,chainType:e.ChainPlatformType.algorand,providerId:"algosigner",requiresLogin:!1,supportsDiscovery:!0,supportsSignArbitrary:!1,requiresLogoutLoginToDiscover:!1,requiresDiscoverToLogin:!1,helpText:{login:"This wallet doesn’t require you to login.",sign:"",discover:"",versionsRequired:""},discoveryKeyLookupFunc:function(e,t){t(e.keys.map((function(e){var t=JSON.parse(e.note);return{index:e.index,key:e.key,accounts:[{account:null==t?void 0:t.accountName,authorization:null==t?void 0:t.permission}]}})))},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-algosigner-logo.png"},{providerName:e.ExternalWalletType.Keycat,chainType:e.ChainPlatformType.eos,providerId:"Keycat",requiresLogin:!0,supportsDiscovery:!1,supportsSignArbitrary:!0,requiresLogoutLoginToDiscover:!0,requiresDiscoverToLogin:!1,helpText:{login:"Keycat requires logging in through the Keycat app.",sign:"",discover:"",versionsRequired:""},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-keycat-logo.png"},{providerName:e.ExternalWalletType.Ledger,chainType:e.ChainPlatformType.eos,providerId:"ledger",requiresLogin:!0,supportsDiscovery:!0,supportsSignArbitrary:!1,requiresLogoutLoginToDiscover:!1,requiresDiscoverToLogin:!0,defaultDiscoveryPathIndexList:[0,1,2],helpText:{login:"This wallet doesn’t require you to login",sign:"Connect and unlock your Ledger with your PIN code. Launch the EOS app on the device.",discover:"Connect and unlock your Ledger with your PIN code. Launch the EOS app on the device.",versionsRequired:"You need to have recent versions of your browser, Ledger firmware, and the Ledger EOS app. Click here for more details."},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-ledger-logo.png"},{providerName:e.ExternalWalletType.Lynx,chainType:e.ChainPlatformType.eos,providerId:"EOS Lynx",requiresLogin:!0,supportsDiscovery:!1,supportsSignArbitrary:!0,requiresLogoutLoginToDiscover:!0,requiresDiscoverToLogin:!1,helpText:{login:"EOS Lynx requires logging in through the EOS Lynx app.",sign:"",discover:"",versionsRequired:""},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-lynx-logo.png"},{providerName:e.ExternalWalletType.Meetone,chainType:e.ChainPlatformType.eos,providerId:"meetone_provider",requiresLogin:!1,supportsDiscovery:!1,supportsSignArbitrary:!0,requiresLogoutLoginToDiscover:!0,requiresDiscoverToLogin:!1,helpText:{login:"This wallet doesn’t require you to login",sign:"",discover:"",versionsRequired:""},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-meetone-logo.png"},{providerName:e.ExternalWalletType.Metro,chainType:e.ChainPlatformType.eos,providerId:"metro",requiresLogin:!1,supportsDiscovery:!1,supportsSignArbitrary:!1,requiresLogoutLoginToDiscover:!1,requiresDiscoverToLogin:!1,helpText:{login:"This wallet doesn’t require you to login",sign:"",discover:"",versionsRequired:""},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-generic-logo.png"},{providerName:e.ExternalWalletType.Portis,chainType:e.ChainPlatformType.eos,providerId:"PortisProvider",requiresLogin:!0,supportsDiscovery:!1,supportsSignArbitrary:!1,requiresLogoutLoginToDiscover:!0,requiresDiscoverToLogin:!1,helpText:{login:"Portis requires logging in through the Portis app.",sign:"",discover:"",versionsRequired:""},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-portis-logo.png"},{providerName:e.ExternalWalletType.Scatter,chainType:e.ChainPlatformType.eos,providerId:"scatter",requiresLogin:!0,supportsDiscovery:!1,supportsSignArbitrary:!0,requiresLogoutLoginToDiscover:!0,requiresDiscoverToLogin:!1,helpText:{login:"Scatter requires logging in through the Scatter app.",sign:"",discover:"",versionsRequired:""},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-scatter-logo.png"},{providerName:e.ExternalWalletType.SimpleEos,chainType:e.ChainPlatformType.eos,providerId:"simpleos",requiresLogin:!0,supportsDiscovery:!1,supportsSignArbitrary:!1,requiresLogoutLoginToDiscover:!0,requiresDiscoverToLogin:!1,helpText:{login:"Simpleos requires logging in through the Simpleos app.",sign:"",discover:"",versionsRequired:""},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-simpleos-logo.png"},{providerName:e.ExternalWalletType.TokenPocket,chainType:e.ChainPlatformType.eos,providerId:"TokenPocket",requiresLogin:!0,supportsDiscovery:!1,supportsSignArbitrary:!0,requiresLogoutLoginToDiscover:!0,requiresDiscoverToLogin:!1,helpText:{login:"This wallet doesn’t require you to login",sign:"",discover:"",versionsRequired:""},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-generic-logo.png"},{providerName:e.ExternalWalletType.WalletConnect,chainType:e.ChainPlatformType.ethereum,providerId:"walletconnect",requiresLogin:!1,supportsDiscovery:!0,supportsSignArbitrary:!0,requiresLogoutLoginToDiscover:!1,requiresDiscoverToLogin:!1,helpText:{login:"This wallet doesn’t require you to login.",sign:"",discover:"",versionsRequired:""},discoveryKeyLookupFunc:ve,logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-walletconnect-logo.png"},{providerName:e.ExternalWalletType.Web3,chainType:e.ChainPlatformType.ethereum,providerId:"web3",requiresLogin:!1,supportsDiscovery:!0,supportsSignArbitrary:!0,requiresLogoutLoginToDiscover:!1,requiresDiscoverToLogin:!1,helpText:{login:"This wallet doesn’t require you to login.",sign:"",discover:"",versionsRequired:""},discoveryKeyLookupFunc:ve,logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-web3-logo.png"},{providerName:e.ExternalWalletType.WhaleVault,chainType:e.ChainPlatformType.eos,providerId:"whalevault",requiresLogin:!0,supportsDiscovery:!1,supportsSignArbitrary:!0,requiresLogoutLoginToDiscover:!0,requiresDiscoverToLogin:!1,helpText:{login:"Whalevault requires logging in through the Whalevault app.",sign:"",discover:"",versionsRequired:""},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-whalevault-logo.png"}];function ge(e){return fe.find((function(t){return t.providerName===e.toString()}))}var ye=fe.map((function(e){return e.providerName})),Te=function(){function t(e){this._oreIdContext=e.oreIdContext,this._user=e.user,this.transitAccessContexts={}}return t.prototype.installTransitProviders=function(e){return N(this,void 0,void 0,(function(){return W(this,(function(t){return this._oreIdContext.transitProvidersInstalled=(e||[]).map((function(e){try{return e(null)}catch(e){return console.log("Couldn't initiate a wallet provider. ".concat(e)),null}})).filter((function(e){return e&&!0})).map((function(e){return(t=e.id,fe.find((function(e){return e.providerId===t}))).providerName;var t})),[2]}))}))},t.prototype.setupTransitWallet=function(t){var r=t.walletType,n=t.chainNetwork;return N(this,void 0,void 0,(function(){var t,o,i,s;return W(this,(function(a){switch(a.label){case 0:return this.assertHasProviderInstalled(r,e.ExternalWalletInterface.Transit),this.assertProviderValidForChainNetwork(r,n),t=ge(r).providerId,[4,this.getOrCreateTransitAccessContext(n)];case 1:return o=a.sent(),i=o.getWalletProviders().find((function(e){return e.id===t})),[4,(s=o.initWallet(i)).connect()];case 2:return a.sent(),[4,this.waitWhileWalletIsBusy(s,r)];case 3:return a.sent(),[2,s]}}))}))},t.prototype.getOrCreateTransitAccessContext=function(e){return N(this,void 0,void 0,(function(){var t,r,n,o,s,a,c;return W(this,(function(u){switch(u.label){case 0:return t=this._oreIdContext.options,r=t.appName,n=t.eosTransitWalletProviders,o=void 0===n?[]:n,this.transitAccessContexts[e]?[2,this.transitAccessContexts[e]]:[4,this._oreIdContext.settings.getChainNetworkNextworkConfig(e)];case 1:return s=u.sent(),[4,this._oreIdContext.settings.isNotEosNetwork(e)];case 2:return a=u.sent(),c=i.initAccessContext({appName:r||"missing appName",network:s,walletProviders:o,isNotEosNetwork:a}),this.transitAccessContexts[e]=c,[2,c]}}))}))},t.prototype.connectToTransitProvider=function(t){var r=t.walletType,n=t.chainNetwork,o=t.chainAccount,i=void 0===o?null:o;return N(this,void 0,void 0,(function(){var t,o,s,a,c,u,l,d,p,h,v;return W(this,(function(f){switch(f.label){case 0:this.assertHasProviderInstalled(r,e.ExternalWalletInterface.Transit),this.assertProviderValidForChainNetwork(r,n),f.label=1;case 1:return f.trys.push([1,9,10,11]),[4,this.setupTransitWallet({walletType:r,chainNetwork:n})];case 2:return o=f.sent(),t={transitWallet:o},ge(r).requiresLogin?o.authenticated?[3,4]:[4,this.loginToTransitProvider(o,r,n,i)]:[3,4];case 3:f.sent(),f.label=4;case 4:return o.connected?o.authenticated&&o.auth?[4,this.updateOreAccountPermissionsfromTransitWalletAuth(o,r)]:[3,6]:[3,7];case 5:f.sent(),s=o.auth,a=s.accountName,c=s.permission,u=s.publicKey,t={isLoggedIn:!0,chainAccount:a,permissions:[{name:c,publicKey:u}],transitWallet:o,provider:r},f.label=6;case 6:return[3,8];case 7:throw l="".concat(r," not connected!"),d=o.hasError,p=o.errorMessage,d&&(l+=" Error: ".concat(p)),new Error(l);case 8:return[3,11];case 9:throw h=f.sent(),v="Failed to connect to ".concat(r," on ").concat(n,". ").concat((null==h?void 0:h.message)||""),console.log("connectToTransitProvider:".concat(v),h),new Error(v);case 10:return this._oreIdContext.setIsBusy(!1),[7];case 11:return[2,t]}}))}))},t.prototype.doTransitProviderLogin=function(t,r,n,o,i){return void 0===i&&(i=0),N(this,void 0,void 0,(function(){var s,a,c,u;return W(this,(function(l){switch(l.label){case 0:return this.assertHasProviderInstalled(o,e.ExternalWalletInterface.Transit),this.assertProviderValidForChainNetwork(o,n),ge(o).requiresDiscoverToLogin?[4,t.discover(this.discoverOptionsForProvider(o))]:[3,5];case 1:return a=l.sent(),(c=this.findAccountInDiscoverData(a,r))?[4,t.login(r,c.authorization)]:[3,3];case 2:return s=l.sent(),[3,4];case 3:throw new Error("Account ".concat(r," not found in wallet"));case 4:return[3,7];case 5:return[4,t.login(r)];case 6:s=l.sent(),l.label=7;case 7:return i>2?[2,null]:(u=((null==t?void 0:t.auth)||{}).accountName,r&&u!==r?[4,t.logout()]:[3,9]);case 8:l.sent(),this.doTransitProviderLogin(t,r,n,o,i+1),l.label=9;case 9:return[2,s]}}))}))},t.prototype.loginWithTransitProvider=function(e){return N(this,void 0,void 0,(function(){var t,r,n,o,i,s;return W(this,(function(a){switch(a.label){case 0:return t=e.walletType,r=e.chainAccount,n=e.chainNetwork,o=H.mapAuthProviderToWalletType(t),[4,this.connectToTransitProvider({walletType:o,chainAccount:r,chainNetwork:n})];case 1:return i=a.sent(),(null==(s=null==i?void 0:i.transitWallet)?void 0:s.auth)?[3,4]:[4,this.loginToTransitProvider(s,t,n,r)];case 2:return a.sent(),[4,this.updateOreAccountPermissionsfromTransitWalletAuth(s,t)];case 3:a.sent(),a.label=4;case 4:return[2,i]}}))}))},t.prototype.loginToTransitProvider=function(t,r,n,o){return void 0===o&&(o=null),N(this,void 0,void 0,(function(){var i,s;return W(this,(function(a){switch(a.label){case 0:this.assertHasProviderInstalled(r,e.ExternalWalletInterface.Transit),this.assertProviderValidForChainNetwork(r,n),a.label=1;case 1:return a.trys.push([1,3,4,6]),[4,this.doTransitProviderLogin(t,o,n,r)];case 2:return a.sent(),[3,6];case 3:throw i=a.sent(),s=i.message,(void 0===s?"":s).includes("unknown key (boost::tuples::tuple")?new Error("The account selected by the wallet for login isn't on the ".concat(n," chain")):i;case 4:return[4,this.waitWhileWalletIsBusy(t,r)];case 5:return a.sent(),[7];case 6:return[2]}}))}))},t.prototype.assertHasProviderInstalled=function(t,r){if(r===e.ExternalWalletInterface.Transit&&!this.hasTransitProvider(t))throw Error('Transit provider:"'.concat(t,'" not installed. Please pass it in via eosTransitWalletProviders.'))},t.prototype.discoverWithTransit=function(t){return N(this,void 0,void 0,(function(){var r,n,o,i,s,a,c;return W(this,(function(u){switch(u.label){case 0:return r=t.walletType,n=t.chainNetwork,o=void 0===n?e.ChainNetwork.EosMain:n,i=t.oreAccount,s=t.discoveryPathIndexList,this.assertProviderValidForChainNetwork(r,o),a=null,this.canDiscover(r)?[4,this.discoverCredentialsInTransitWallet(o,r,i,s)]:[3,2];case 1:return a=u.sent(),[3,7];case 2:return[4,this.setupTransitWallet({walletType:r,chainNetwork:o})];case 3:return c=u.sent(),this.requiresLogoutLoginToDiscover(r)?[4,c.logout()]:[3,6];case 4:return u.sent(),[4,c.login()];case 5:return u.sent(),this.updateOreAccountPermissionsfromTransitWalletAuth(c,r),[3,7];case 6:console.log("Discover not working for walletType: ",r),u.label=7;case 7:return[2,a]}}))}))},t.prototype.discoverCredentialsInTransitWallet=function(e,t,r,n){return N(this,void 0,void 0,(function(){var r,o,i,s,a=this;return W(this,(function(c){switch(c.label){case 0:r=[],c.label=1;case 1:return c.trys.push([1,,5,6]),[4,this.setupTransitWallet({walletType:t,chainNetwork:e})];case 2:return o=c.sent(),this._oreIdContext.setIsBusy(!0),[4,o.discover(this.discoverOptionsForProvider(t,n))];case 3:return i=c.sent(),s=i.keyToAccountMap,[4,H.asyncForEach(s,(function(e){return N(a,void 0,void 0,(function(){var n,i,s,a,c,u,l,d,p,h;return W(this,(function(v){switch(v.label){case 0:return n=e.accounts,i=void 0===n?[]:n,s=e.key,i.length>0&&s?(a=O(i,1),c=a[0],u=c.account,l=c.authorization,d=[{account:u,publicKey:s,name:l,parent:null}],[4,this.getChainNetworkFromTransitWallet(o)]):[3,3];case 1:return p=v.sent(),[4,null===(h=this._user)||void 0===h?void 0:h.addWalletPermissionsToOreIdAccount({chainAccount:u,chainNetwork:p,permissions:d,walletType:t})];case 2:v.sent(),r=r.concat(d),v.label=3;case 3:return[2]}}))}))}))];case 4:return c.sent(),[3,6];case 5:return this._oreIdContext.setIsBusy(!1),[7];case 6:return[2,r]}}))}))},t.prototype.discoverOptionsForProvider=function(e,t){var r,n;void 0===t&&(t=null);var o=H.mapAuthProviderToWalletType(e);if(this.hasTransitProvider(o)){var i=ge(H.mapAuthProviderToWalletType(e)),s=i.defaultDiscoveryPathIndexList;r=t||s||[],n=i.discoveryKeyLookupFunc}var a={pathIndexList:r};return n&&(a.keyLookupFunc=n),a},t.prototype.findAccountInDiscoverData=function(e,t){var r=e.keyToAccountMap.find((function(e){return e.accounts.find((function(e){return e.account===t}))}));if(r){var n="active";if(!r.accounts.find((function(e){return"active"===e.authorization}))){var o=O(r.accounts,1)[0];o&&(n=o.authorization)}return{index:r.index,key:r.key,authorization:n}}return null},t.prototype.signWithTransitProvider=function(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s,a,c;return W(this,(function(u){switch(u.label){case 0:return o=t.chainNetwork,i=t.chainAccount,this.assertHasProviderInstalled(r,e.ExternalWalletInterface.Transit),this.assertProviderValidForChainNetwork(r,o),[4,this.connectToTransitProvider({walletType:r,chainNetwork:o,chainAccount:i})];case 1:s=u.sent().transitWallet,u.label=2;case 2:return u.trys.push([2,10,11,12]),this._oreIdContext.setIsBusy(!0),(a=ge(r).chainType)!==e.ChainPlatformType.eos?[3,4]:[4,this.signTransactionWithTransitAndEosSDK(t,s)];case 3:return n=u.sent(),[3,9];case 4:return a!==e.ChainPlatformType.algorand?[3,6]:[4,this.signTransactionWithTransitAndAlgorandSDK(t,s)];case 5:return n=u.sent(),[3,9];case 6:return a!==e.ChainPlatformType.ethereum?[3,8]:[4,this.signTransactionWithTransitAndEthereumSDK(t,s)];case 7:return n=u.sent(),[3,9];case 8:throw new Error("signWithTransitProvider doesnt support chain type: ".concat(a));case 9:return[3,12];case 10:throw c=u.sent(),console.error(c),c;case 11:return this._oreIdContext.setIsBusy(!1),[7];case 12:return n.serializedTransaction&&(n.serializedTransaction=Buffer.from(n.serializedTransaction)),[2,{signedTransaction:n}]}}))}))},t.prototype.signStringWithTransitProvider=function(t){var r=t.walletType,n=t.chainNetwork,o=t.string,i=t.message,s=t.metadata;return N(this,void 0,void 0,(function(){var t,a;return W(this,(function(c){switch(c.label){case 0:return this.assertHasProviderInstalled(r,e.ExternalWalletInterface.Transit),this.assertProviderValidForChainNetwork(r,n),[4,this.connectToTransitProvider({walletType:r,chainNetwork:n})];case 1:t=c.sent().transitWallet,c.label=2;case 2:return c.trys.push([2,4,5,6]),this._oreIdContext.setIsBusy(!0),[4,t.signArbitrary(o,i,s)];case 3:return[2,{signedString:c.sent()}];case 4:throw a=c.sent(),console.error(a),a;case 5:return this._oreIdContext.setIsBusy(!1),[7];case 6:return[2]}}))}))},t.prototype.signTransactionWithTransitAndEosSDK=function(e,t){return N(this,void 0,void 0,(function(){var r,n,o,i,s,a;return W(this,(function(c){switch(c.label){case 0:return r=e.expireSeconds,n=e.transaction,o=((null==e?void 0:e.signOptions)||{}).broadcast,[4,t.eosApi.transact({actions:[n]},{broadcast:o,blocksBehind:3,expireSeconds:r||60})];case 1:return i=c.sent(),s=i.signatures,a=i.serializedTransaction,[4,this.callDiscoverAfterSign(e)];case 2:return c.sent(),[2,{signatures:s,serializedTransaction:a}]}}))}))},t.prototype.signTransactionWithTransitAndAlgorandSDK=function(e,t){return N(this,void 0,void 0,(function(){var r,n,o,i,s,a,c;return W(this,(function(u){switch(u.label){case 0:return r=e.chainNetwork,n=e.transaction,[4,this._oreIdContext.settings.getChainNetworkNextworkConfig(r)];case 1:return o=u.sent(),i={chainId:o.chainId,requiredKeys:null,serializedTransaction:he(n),abis:null},[4,t.provider.signatureProvider.sign(i)];case 2:return s=u.sent(),a=s.signatures,c=s.serializedTransaction,[4,this.callDiscoverAfterSign(e)];case 3:return u.sent(),[2,{signatures:a,serializedTransaction:c}]}}))}))},t.prototype.signTransactionWithTransitAndEthereumSDK=function(e,t){return N(this,void 0,void 0,(function(){var r,n,o,i,s,a,c;return W(this,(function(u){switch(u.label){case 0:return r=e.chainNetwork,n=e.transaction,[4,this._oreIdContext.settings.getChainNetworkNextworkConfig(r)];case 1:return o=u.sent(),i={chainId:o.chainId,requiredKeys:null,serializedTransaction:he(n),abis:null},[4,t.provider.signatureProvider.sign(i)];case 2:return s=u.sent(),a=s.signatures,c=s.serializedTransaction,[4,this.callDiscoverAfterSign(e)];case 3:return u.sent(),[2,{signatures:a,serializedTransaction:c}]}}))}))},t.prototype.getChainNetworkFromTransitWallet=function(e){var t,r;return N(this,void 0,void 0,(function(){var n,o;return W(this,(function(i){switch(i.label){case 0:return(n=((null===(t=null==e?void 0:e.ctx)||void 0===t?void 0:t.network)||{}).chainId)?[4,this._oreIdContext.settings.getAllChainNetworkSettings()]:[2,null];case 1:return o=i.sent(),[2,null===(r=o.find((function(e){return e.hosts.find((function(e){return e.chainId===n}))})))||void 0===r?void 0:r.network]}}))}))},t.prototype.updateOreAccountPermissionsfromTransitWalletAuth=function(e,t){var r;return N(this,void 0,void 0,(function(){var n,o,i,s,a,c;return W(this,(function(u){switch(u.label){case 0:return(null==e?void 0:e.connected)&&(null==e?void 0:e.auth)?(n=e.auth,o=n.accountName,i=n.permission,s=n.publicKey,o&&i&&s?(a=[{name:i,publicKey:s}],[4,this.getChainNetworkFromTransitWallet(e)]):[2]):[2];case 1:return(c=u.sent())?[4,null===(r=this._user)||void 0===r?void 0:r.updatePermissionsIfNecessary({chainAccount:o,chainNetwork:c,permissions:a,walletType:t})]:[3,3];case 2:u.sent(),u.label=3;case 3:return[2]}}))}))},t.prototype.isTransitProvider=function(e){var t=H.mapAuthProviderToWalletType(e);return!!t&&ye.includes(t)},t.prototype.hasTransitProvider=function(e){return this._oreIdContext.transitProvidersInstalled.includes(e)},t.prototype.assertProviderValidForChainNetwork=function(e,t){return N(this,void 0,void 0,(function(){var r,n;return W(this,(function(o){switch(o.label){case 0:return r=ge(e).chainType,[4,this._oreIdContext.settings.getAllChainNetworkSettings()];case 1:if(n=o.sent(),!!!n.find((function(e){return e.network===t&&e.type===r})))throw Error("External Wallet Type: ".concat(e," doesnt support chainNetwork ").concat(t,". Hint: It supports networks of type ").concat(r,"."));return[2]}}))}))},t.prototype.waitWhileWalletIsBusy=function(e,t){return N(this,void 0,void 0,(function(){return W(this,(function(r){switch(r.label){case 0:return e.inProgress?(this._oreIdContext.setIsBusy(!0),[4,H.sleep(250)]):[3,2];case 1:return r.sent(),console.log("connecting to ".concat(t," via eos-transit wallet in progress:"),e.inProgress),[3,0];case 2:return this._oreIdContext.setIsBusy(!1),[2]}}))}))},t.prototype.discover=function(e){return N(this,void 0,void 0,(function(){return W(this,(function(t){return[2,this.discoverWithTransit(e)]}))}))},t.prototype.callDiscoverAfterSign=function(e){return N(this,void 0,void 0,(function(){var t,r,n,o,i;return W(this,(function(s){switch(s.label){case 0:return t=e.chainNetwork,r=e.account,n=((null==e?void 0:e.signOptions)||{}).provider,o=H.mapAuthProviderToWalletType(n),i={walletType:o,chainNetwork:t,oreAccount:r},[4,this.discover(i)];case 1:return s.sent(),[2]}}))}))},t.prototype.canDiscover=function(e){return!!this.hasTransitProvider(e)&&ge(e).supportsDiscovery},t.prototype.canSignString=function(e){return!!this.hasTransitProvider(e)&&ge(e).supportsSignArbitrary},t.prototype.requiresDiscoverToLogin=function(e){return!!this.hasTransitProvider(e)&&ge(e).requiresDiscoverToLogin},t.prototype.requiresLogoutLoginToDiscover=function(e){return!!this.hasTransitProvider(e)&&ge(e).requiresLogoutLoginToDiscover},t.prototype.defaultDiscoveryPathIndexList=function(e){var t;return this.hasTransitProvider(e)?null===(t=ge(e))||void 0===t?void 0:t.defaultDiscoveryPathIndexList:null},t.prototype.helpTextForProvider=function(e){return this.hasTransitProvider(e)?ge(e).helpText:null},t}(),we=[{providerName:e.ExternalWalletType.Anchor,providerId:"Anchor",chainType:e.ChainPlatformType.eos,requiresLogin:!0,supportsSignArbitrary:!1,requiresLogoutLoginToDiscover:!1,requiresDiscoverToLogin:!1,supportsDiscovery:!1,helpText:{login:"This wallet doesn’t require you to login",sign:"",discover:"",versionsRequired:""},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-generic-logo.png"},{providerName:e.ExternalWalletType.Ledger,providerId:"Ledger",chainType:e.ChainPlatformType.eos,requiresLogin:!0,supportsSignArbitrary:!1,requiresLogoutLoginToDiscover:!1,requiresDiscoverToLogin:!1,supportsDiscovery:!1,helpText:{login:"This wallet doesn’t require you to login",sign:"Connect and unlock your Ledger with your PIN code. Launch the EOS app on the device.",discover:"Connect and unlock your Ledger with your PIN code. Launch the EOS app on the device.",versionsRequired:"You need to have recent versions of your browser, Ledger firmware, and the Ledger EOS app. Click here for more details."},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-ledger-logo.png"},{providerName:e.ExternalWalletType.Lynx,providerId:"Lynx",chainType:e.ChainPlatformType.eos,requiresLogin:!1,supportsSignArbitrary:!0,requiresLogoutLoginToDiscover:!1,requiresDiscoverToLogin:!1,supportsDiscovery:!1,helpText:{login:"This wallet doesn’t require you to login",sign:"",discover:"",versionsRequired:""},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-lynx-logo.png"},{providerName:e.ExternalWalletType.Scatter,providerId:"Scatter",chainType:e.ChainPlatformType.eos,requiresLogin:!0,supportsSignArbitrary:!0,requiresLogoutLoginToDiscover:!1,requiresDiscoverToLogin:!1,supportsDiscovery:!1,helpText:{login:"Scatter requires logging in through the Scatter app.",sign:"",discover:"",versionsRequired:""},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-scatter-logo.png"},{providerName:e.ExternalWalletType.TokenPocket,providerId:"Token Pocket",chainType:e.ChainPlatformType.eos,requiresLogin:!1,supportsSignArbitrary:!0,requiresLogoutLoginToDiscover:!1,requiresDiscoverToLogin:!1,supportsDiscovery:!1,helpText:{login:"This wallet doesn’t require you to login",sign:"",discover:"",versionsRequired:""},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-generic-logo.png"},{providerName:e.ExternalWalletType.Wombat,providerId:"Wombat",chainType:e.ChainPlatformType.eos,requiresLogin:!0,supportsSignArbitrary:!0,requiresLogoutLoginToDiscover:!1,requiresDiscoverToLogin:!1,supportsDiscovery:!1,helpText:{login:"This wallet doesn’t require you to login",sign:"",discover:"",versionsRequired:""},logoUrl:"https://storage.googleapis.com/oreid-files/partners/wallet-wombat-logo.png"}];function me(e){return we.find((function(t){return t.providerName===e.toString().toLowerCase()}))}var ke=we.map((function(e){return e.providerName})),be=function(){function t(e){this._oreIdContext=e.oreIdContext,this._user=e.user}return t.prototype.installUalProviders=function(e){return N(this,void 0,void 0,(function(){return W(this,(function(t){return this._oreIdContext.ualProvidersInstalled=(e||[]).map((function(e){var t,r;return null===(r=null==e?void 0:e.name,t=we.find((function(e){return e.providerName===r.toLowerCase()})))||void 0===t?void 0:t.providerName})),[2]}))}))},t.prototype.loginToUalProvider=function(t,r,n,o){return N(this,void 0,void 0,(function(){var i,s,a,c,u=this;return W(this,(function(l){switch(l.label){case 0:this.assertHasProviderInstalled(t,e.ExternalWalletInterface.Ual),this.assertProviderValidForChainNetwork(t,n),l.label=1;case 1:return l.trys.push([1,4,,5]),[4,r.login(o)];case 2:return i=l.sent(),H.isNullOrEmpty(i)?[2,null]:(s=[],[4,H.asyncForEach(i,(function(e){return N(u,void 0,void 0,(function(){var t;return W(this,(function(r){switch(r.label){case 0:return[4,this.getAccountAndPermissionsFromUalUser(e)];case 1:return t=r.sent(),s.push({user:e,userPermissions:t}),[2]}}))}))}))]);case 3:return l.sent(),[2,s.find((function(e){return e.userPermissions.chainNetwork===n}))];case 4:throw a=l.sent(),c=a.message,(void 0===c?"":c).includes("unknown key (boost::tuples::tuple")?new Error("The account selected by the wallet for login isn't on the ".concat(n," chain")):a;case 5:return[2]}}))}))},t.prototype.connectToUalProvider=function(t){var r=t.walletType,n=t.chainNetwork,o=t.chainAccount,i=void 0===o?null:o;return N(this,void 0,void 0,(function(){var t,o,s,a,c,u,l,d,p;return W(this,(function(h){switch(h.label){case 0:this.assertHasProviderInstalled(r,e.ExternalWalletInterface.Ual),this.assertProviderValidForChainNetwork(r,n),t=this._oreIdContext.options,o=t.ualAuthenticators.find((function(e){return e.name.toLowerCase()===r})),h.label=1;case 1:return h.trys.push([1,10,,11]),[4,this._oreIdContext.settings.getChainNetworkNextworkConfig(n)];case 2:return s=h.sent(),a={chainId:s.chainId,rpcEndpoints:[x({},s)]},c=new o([a],{appName:t.appName}),this._oreIdContext.setIsBusy(!0),[4,c.init()];case 3:return h.sent(),[4,this.waitWhileWalletIsBusy(c,r)];case 4:if(h.sent(),c.isErrored())throw u=c.getError(),console.log("Error connecting to UAL wallet type: ".concat(u.name),u.cause),u.cause;return[4,this.loginToUalProvider(r,c,n,i)];case 5:if(!(l=h.sent()))return console.log("User doesn't have an account for the chainNetwork: ".concat(n," in wallet type: ").concat(r)),[2,null];h.label=6;case 6:return h.trys.push([6,8,,9]),[4,this.updateOreAccountPermissionsfromUalUser(l.user,r)];case 7:return h.sent(),[3,9];case 8:return d=h.sent(),console.log("Failed to add newly discovered chain accounts in connectToUalProvider for chainNetwork: ".concat(n," in wallet type: ").concat(r),d),[3,9];case 9:return[2,{isLoggedIn:!0,chainAccount:l.userPermissions.chainAccount,chainNetwork:l.userPermissions.chainNetwork,permissions:l.userPermissions.permissions,walletType:r,authenticator:c,ualUser:l.user}];case 10:throw p=h.sent(),console.log("Failed to connect to ".concat(r," wallet:"),p),p;case 11:return[2]}}))}))},t.prototype.getAccountAndPermissionsFromUalUser=function(e){return N(this,void 0,void 0,(function(){var t,r,n,o,i;return W(this,(function(s){switch(s.label){case 0:return[4,e.getChainId()];case 1:return t=s.sent(),[4,this._oreIdContext.settings.getChainNetworkByChainId(t)];case 2:return r=s.sent(),[4,e.getAccountName()];case 3:return n=s.sent(),[4,this.getKeys(e)];case 4:return o=s.sent(),i=o.map((function(e){return{account:n,publicKey:e,name:"active"}})),[2,{chainAccount:n,chainNetwork:r,permissions:i}]}}))}))},t.prototype.loginWithUalProvider=function(e){return N(this,void 0,void 0,(function(){var t,r,n,o,i,s;return W(this,(function(a){switch(a.label){case 0:return t=e.walletType,r=e.chainAccount,n=e.chainNetwork,[4,this.connectToUalProvider({walletType:t,chainAccount:r,chainNetwork:n})];case 1:return o=a.sent(),i=o.authenticator,o.isLoggedIn?[3,4]:[4,this.loginToUalProvider(t,i,n,r)];case 2:return(s=a.sent())?[4,this.updateOreAccountPermissionsfromUalUser(s.user,t)]:[3,4];case 3:a.sent(),a.label=4;case 4:return[2,o]}}))}))},t.prototype.assertHasProviderInstalled=function(t,r){if(r===e.ExternalWalletInterface.Ual&&!this.hasUalProvider(t))throw Error('UAL authenticator:"'.concat(t,'" not installed. Please pass it in via ualAuthenticators.'))},t.prototype.signWithUalProvider=function(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s,a,c,u,l,d;return W(this,(function(p){switch(p.label){case 0:return n=t.chainNetwork,o=t.transaction,i=t.chainAccount,(s=t.signOptions).provider,a=s.broadcast,this.assertHasProviderInstalled(r,e.ExternalWalletInterface.Ual),this.assertProviderValidForChainNetwork(r,n),[4,this.connectToUalProvider({walletType:r,chainNetwork:n,chainAccount:i})];case 1:c=p.sent().ualUser,p.label=2;case 2:return p.trys.push([2,4,5,6]),this._oreIdContext.setIsBusy(!0),[4,c.signTransaction(o,{broadcast:a})];case 3:return u=p.sent(),(l=u.transaction.serializedTransaction)&&(u.transaction.serializedTransaction=Buffer.from(l)),[2,{signedTransaction:u.transaction}];case 4:throw d=p.sent(),console.error(d),d;case 5:return this._oreIdContext.setIsBusy(!1),[7];case 6:return[2]}}))}))},t.prototype.signStringWithUalProvider=function(t){var r=t.walletType,n=t.chainNetwork,o=t.string,i=t.chainAccount,s=t.message;return N(this,void 0,void 0,(function(){var t,a,c;return W(this,(function(u){switch(u.label){case 0:return this.assertHasProviderInstalled(r,e.ExternalWalletInterface.Ual),this.assertProviderValidForChainNetwork(r,n),[4,this.connectToUalProvider({walletType:r,chainNetwork:n,chainAccount:i})];case 1:t=u.sent().ualUser,u.label=2;case 2:return u.trys.push([2,5,6,7]),this._oreIdContext.setIsBusy(!0),[4,this.getKeys(t)];case 3:return a=u.sent(),[4,t.signArbitrary(a[0],o,s)];case 4:return[2,{signedString:u.sent()}];case 5:throw c=u.sent(),console.error(c),c;case 6:return this._oreIdContext.setIsBusy(!1),[7];case 7:return[2]}}))}))},t.prototype.updateOreAccountPermissionsfromUalUser=function(e,t){var r;return N(this,void 0,void 0,(function(){var n,o,i,s;return W(this,(function(a){switch(a.label){case 0:return e?[4,this.getAccountAndPermissionsFromUalUser(e)]:[2];case 1:return n=a.sent(),o=n.chainAccount,i=n.chainNetwork,s=n.permissions,o&&s&&i?[4,null===(r=this._user)||void 0===r?void 0:r.updatePermissionsIfNecessary({chainAccount:o,chainNetwork:i,permissions:s,walletType:t})]:[2];case 2:return a.sent(),[2]}}))}))},t.prototype.isUalProvider=function(e){var t=H.mapAuthProviderToWalletType(e);return!!t&&ke.includes(t)},t.prototype.hasUalProvider=function(e){return this._oreIdContext.ualProvidersInstalled.includes(e)},t.prototype.getKeys=function(e){return N(this,void 0,void 0,(function(){var t;return W(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e.getKeys()];case 1:return t=r.sent(),[3,3];case 2:return r.sent(),t=[],[3,3];case 3:return[2,t]}}))}))},t.prototype.assertProviderValidForChainNetwork=function(e,t){return N(this,void 0,void 0,(function(){var r,n;return W(this,(function(o){switch(o.label){case 0:return r=me(e).chainType,[4,this._oreIdContext.settings.getAllChainNetworkSettings()];case 1:if(n=o.sent(),!!!n.find((function(e){return e.network===t&&e.type===r})))throw Error("External Wallet Type: ".concat(e," doesnt support chainNetwork ").concat(t,". Hint: It supports networks of type ").concat(r,"."));return[2]}}))}))},t.prototype.waitWhileWalletIsBusy=function(e,t){return N(this,void 0,void 0,(function(){return W(this,(function(r){switch(r.label){case 0:return e.isLoading()?(this._oreIdContext.setIsBusy(!0),[4,H.sleep(250)]):[3,2];case 1:return r.sent(),console.log("connecting to ".concat(t," via UAL wallet in progress:"),e.isLoading()),[3,0];case 2:return this._oreIdContext.setIsBusy(!1),[2]}}))}))},t.prototype.canDiscover=function(e){return!!this.hasUalProvider(e)&&me(e).supportsDiscovery},t.prototype.canSignString=function(e){return!!this.hasUalProvider(e)&&me(e).supportsSignArbitrary},t.prototype.requiresDiscoverToLogin=function(e){return!!this.hasUalProvider(e)&&me(e).requiresDiscoverToLogin},t.prototype.requiresLogoutLoginToDiscover=function(e){return!!this.hasUalProvider(e)&&me(e).requiresLogoutLoginToDiscover},t.prototype.defaultDiscoveryPathIndexList=function(e){var t;return this.hasUalProvider(e)?null===(t=me(e))||void 0===t?void 0:t.defaultDiscoveryPathIndexList:null},t.prototype.helpTextForProvider=function(e){return this.hasUalProvider(e)?me(e).helpText:null},t}(),Ae=function(){function e(){this._subscribers=[]}return e.prototype.subscribe=function(e){var t=this._subscribers.find((function(t){return t===e}));e&&!t&&(e(this),this._subscribers.push(e))},e.prototype.unsubscribe=function(e){this._subscribers=this._subscribers.filter((function(t){return t!==e}))},e.prototype.callSubscribers=function(){var e=this;this._subscribers.forEach((function(t){return t(e)}))},e}();function Ie(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s;return W(this,(function(a){switch(a.label){case 0:return n=e.ApiEndpoint.UpdateDelayWalletSetup,o=r.account,i=r.delayWalletSetup,R(t,n),M(r,["account","delayWalletSetup"],n),s={account:o,delay_wallet_setup:i},[4,t.callOreIdApi(e.RequestType.Post,e.ApiEndpoint.UpdateDelayWalletSetup,s,null)];case 1:return[2,a.sent()]}}))}))}var _e=H.isNullOrEmpty,Pe=function(t){function r(e){var r=t.call(this)||this;return r.onUpdateAccessTokenHelper=function(e){r._accountName=e.accountName,t.prototype.callSubscribers.call(r)},r._oreIdContext=e.oreIdContext,r._accessTokenHelper=e.accessTokenHelper,r._accountName=e.accountName,r._accessTokenHelper.subscribe(r.onUpdateAccessTokenHelper),r}return T(r,t),Object.defineProperty(r.prototype,"accessToken",{get:function(){return this._accessTokenHelper.accessToken},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"accountName",{get:function(){return this._accountName},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"data",{get:function(){this.assertUserHasData();var e=this._userSourceData;e.permissions;var t=S(e,["permissions"]);return x(x({},t),{chainAccounts:this.getChainAccounts()})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hasData",{get:function(){return!_e(null==this?void 0:this._userSourceData)},enumerable:!1,configurable:!0}),r.prototype.setUserSourceData=function(e){this._userSourceData=e,t.prototype.callSubscribers.call(this)},r.prototype.getChainAccounts=function(){var e=this;this.assertUserHasData();var t=(this._userSourceData.permissions||[]).map((function(t){var r=O(e.getDefaultPermissionForChainAccount(t.chainAccount,t.chainNetwork),1)[0];return{chainAccount:t.chainAccount,chainNetwork:t.chainNetwork,defaultPermission:r,permissions:e.getPermissionForChainAccount(t.chainAccount,t.chainNetwork)}}));return H.getUniqueValues(t)},Object.defineProperty(r.prototype,"isLoggedIn",{get:function(){return!!this.accessToken},enumerable:!1,configurable:!0}),r.prototype.assertUserHasData=function(){if(!this.hasData)throw new Error("User data hasnt been retrieved. Call user.getData() first.")},r.prototype.assertUserHasValidEmail=function(){this.assertUserHasData();var e=((null==this?void 0:this.data)||{}).email;if(!H.isValidEmail(e))throw new Error("User doesnt have a valid email")},r.prototype.getData=function(e){return N(this,void 0,void 0,(function(){var t,r,n;return W(this,(function(o){switch(o.label){case 0:if(this.hasData&&!e)return[2,this.data];if(!this.accessToken)throw new Error("AccessToken is missing or has expired");return t=null==this?void 0:this._accountName,r={account:t},[4,ee(this._oreIdContext,r)];case 1:return n=o.sent(),this._accountName=t,this.setUserSourceData(n),[2,this.data]}}))}))},r.prototype.logout=function(){this._oreIdContext.logout()},r.prototype.getNewChainAccountUrl=function(e){return N(this,void 0,void 0,(function(){var t,r,n,o,i,s,a,c,u,l,d;return W(this,(function(p){switch(p.label){case 0:return r=(t=e||{}).account,n=t.accountType,o=t.chainNetwork,i=t.accountOptions,s=t.provider,a=t.state,c=this._oreIdContext.options,u=c.newAccountCallbackUrl,l=c.backgroundColor,d={account:r,accountType:n,backgroundColor:l,chainNetwork:o,accountOptions:i,provider:s,callbackUrl:u,state:a},[4,le(this._oreIdContext,d)];case 1:return[2,{newAccountUrl:p.sent(),errors:null}]}}))}))},r.prototype.deleteTestUser=function(){return N(this,void 0,void 0,(function(){return W(this,(function(e){switch(e.label){case 0:if(!(null==this?void 0:this.accountName))throw new Error("User not authenticated. Must be logged-in (or have set an accessToken).");return[4,Q(this._oreIdContext,{account:this.accountName})];case 1:return[2,e.sent()]}}))}))},r.prototype.disableDelayedWalletSetup=function(){return N(this,void 0,void 0,(function(){var e;return W(this,(function(t){switch(t.label){case 0:if(!(null==this?void 0:this.accountName))throw new Error("User not authenticated. Must be logged-in (or have set an accessToken).");return[4,Ie(this._oreIdContext,{account:this.accountName,delayWalletSetup:!1})];case 1:return e=t.sent(),[4,this.getData(!0)];case 2:return t.sent(),[2,e]}}))}))},r.prototype.sendVerificationCodeToEmail=function(){var t;return N(this,void 0,void 0,(function(){return W(this,(function(r){switch(r.label){case 0:return this.assertUserHasValidEmail(),[4,ne(this._oreIdContext,{email:null===(t=null==this?void 0:this.data)||void 0===t?void 0:t.email,provider:e.AuthProvider.Email})];case 1:return[2,r.sent()]}}))}))},r.prototype.checkVerificationCodeForEmail=function(t){var r,n=t.code;return N(this,void 0,void 0,(function(){return W(this,(function(t){switch(t.label){case 0:return this.assertUserHasValidEmail(),[4,oe(this._oreIdContext,{code:n,email:null===(r=null==this?void 0:this.data)||void 0===r?void 0:r.email,provider:e.AuthProvider.Email})];case 1:return[2,t.sent()]}}))}))},r.prototype.mapUserPermission=function(e){if(_e(e))return null;e.chainNetwork,e.chainAccount;var t=e.permission,r=S(e,["chainNetwork","chainAccount","permission"]);return x(x({},r),{name:t})},r.prototype.getPermissionForChainAccount=function(e,t){return this._userSourceData.permissions.filter((function(r){return r.chainAccount===e&&r.chainNetwork===t})).map(this.mapUserPermission)},r.prototype.getDefaultPermissionForChainAccount=function(e,t){var r=this.getPermissionForChainAccount(e,t),n=r.filter((function(e){return!0===e.isDefault}));return _e(n)&&1===(null==r?void 0:r.length)&&(n=r),n},r.prototype.updatePermissionsIfNecessary=function(e){return N(this,void 0,void 0,(function(){return W(this,(function(t){switch(t.label){case 0:return[4,this.addWalletPermissionsToOreIdAccount(e)];case 1:return t.sent(),[2]}}))}))},r.prototype.addWalletPermissionsToOreIdAccount=function(e){return N(this,void 0,void 0,(function(){var t,r,n,o,i=this;return W(this,(function(s){switch(s.label){case 0:return[4,this.getData()];case 1:return s.sent(),t=e.chainAccount,r=e.chainNetwork,n=e.permissions,o=e.walletType,!this.accountName||_e(n)||_e(r)?[2]:[4,H.asyncForEach(n,(function(e){return N(i,void 0,void 0,(function(){var n,i,s;return W(this,(function(a){switch(a.label){case 0:return n=e.name,(i=e.parent)||(i="active","owner"===n?i="":"active"===n&&(i="owner")),!0===this._userSourceData.permissions.some((function(e){return e.chainAccount===t&&e.chainNetwork===r&&e.permission===n||"owner"===n}))?[3,2]:(s=e.publicKey,[4,B(this._oreIdContext,{account:this.accountName,chainAccount:t,chainNetwork:r,publicKey:s,parentPermission:i,permission:n,provider:o})]);case 1:a.sent(),a.label=2;case 2:return[2]}}))}))}))];case 2:return s.sent(),[4,this.getData()];case 3:return s.sent(),[2]}}))}))},r}(Ae),Ce=function(e){function t(t,r){void 0===r&&(r=!1);var n=e.call(this)||this;return n._ignoreIssuer=r,n.setAccessToken(t),n}return T(t,e),Object.defineProperty(t.prototype,"accessToken",{get:function(){return this._accessToken},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"decodedAccessToken",{get:function(){return this.accessToken?this._decodedAccessToken:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idToken",{get:function(){return this._idToken},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"decodedIdToken",{get:function(){return this._decodedIdToken},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accountName",{get:function(){return this.accessToken?(t.assertIsTokenValid(this.decodedAccessToken),H.getClaimFromJwtTokenBySearchString(this.decodedAccessToken,"https://oreid.aikon.com/account")):null},enumerable:!1,configurable:!0}),t.prototype.clearAccessToken=function(){this.setAccessToken(null)},t.prototype.clearIdToken=function(){this.setIdToken(null)},t.prototype.hasExpired=function(e){return!this._decodedAccessToken||!t.isTokenDateValidNow(this._decodedAccessToken,e)},t.prototype.setAccessToken=function(r){var n=this;if(r){var o=H.jwtDecodeSafe(r);if(!o)throw Error("Can't set accessToken. Value provided: ".concat(r));t.assertIsTokenValid(o,this._ignoreIssuer),t.assertIdTokenMatchesAccessToken(o,this.decodedIdToken),this._decodedAccessToken=o,this._accessToken=r,H.runAtTime((function(){n.clearAccessToken(),console.log("accessToken has expired and has been cleared")}),1e3*this._decodedAccessToken.exp)}else this._accessToken=null;e.prototype.callSubscribers.call(this)},t.prototype.setIdToken=function(r){var n=this;if(r){var o=H.jwtDecodeSafe(r);if(!o)throw Error("Can't set IdToken. Value provided: ".concat(r));t.assertIsTokenValid(o,this._ignoreIssuer),t.assertIdTokenMatchesAccessToken(this.decodedAccessToken,o),this._decodedIdToken=o,this._idToken=r,H.runAtTime((function(){n.clearIdToken(),console.log("idToken has expired and has been cleared")}),1e3*this._decodedIdToken.exp)}else this._decodedIdToken=null;e.prototype.callSubscribers.call(this)},t.prototype.assertHasAccessToken=function(){if(!this.accessToken)throw Error("AccessToken not set. Login first.")},t.isTokenValid=function(e,r){void 0===r&&(r=!1);try{return t.assertIsTokenValid(e,r),!0}catch(e){return!1}},t.assertIsTokenValid=function(e,r){void 0===r&&(r=!1);var n=new Date;if(!e)throw Error("JWT (access or id) token is invalid, or expired)");if(!r&&!e.iss.includes("oreid.io"))throw Error("Access token not issued by ORE ID");if(!t.isTokenDateValidNow(e,n))throw Error("Access token has expired")},t.assertIdTokenMatchesAccessToken=function(e,t){if(e&&t){if(e.iss!==t.iss)throw Error("AccessToken and IdToken mismatch - not issued by the same issuer");if(e.sub!==t.sub)throw Error("AccessToken and IdToken mismatch - not for the same user")}},t.isTokenDateValidNow=function(e,t){var r=(t||new Date).getTime()/1e3;return!(void 0!==e.exp&&(null==e?void 0:e.exp)<r)&&!(void 0!==(null==e?void 0:e.nbf)&&(null==e?void 0:e.nbf)>r)},t}(Ae),Ee=function(e){function t(t){var r=e.call(this)||this;return r.onUpdateAccessTokenHelper=function(e){r.saveAccessTokenAndNotifySubscribers(r._accessTokenHelper.accessToken)},r._oreIdContext=t.oreIdContext,r._localState=r._oreIdContext.localState,r._transitHelper=new Te({oreIdContext:r._oreIdContext,user:r._user}),r._ualHelper=new be({oreIdContext:r._oreIdContext,user:r._user}),r.initAccessTokenHelper(),r}return T(t,e),Object.defineProperty(t.prototype,"accessTokenHelper",{get:function(){return this._accessTokenHelper},enumerable:!1,configurable:!0}),t.prototype.initAccessTokenHelper=function(){var e;this._accessTokenHelper=new Ce;var t=null===(e=this._localState)||void 0===e?void 0:e.accessToken;this.accessToken=t,this.saveAccessTokenAndNotifySubscribers(t),this._accessTokenHelper.subscribe(this.onUpdateAccessTokenHelper)},Object.defineProperty(t.prototype,"accountName",{get:function(){var e,t;return(null===(e=this._accessTokenHelper)||void 0===e?void 0:e.accessToken)?null===(t=this._accessTokenHelper)||void 0===t?void 0:t.accountName:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idToken",{get:function(){var e;return null===(e=this._accessTokenHelper)||void 0===e?void 0:e.idToken},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessToken",{get:function(){var e;return null===(e=this._accessTokenHelper)||void 0===e?void 0:e.accessToken},set:function(e){try{this._accessTokenHelper.setAccessToken(e)}catch(e){console.log("Cant set accessToken.",e.message)}},enumerable:!1,configurable:!0}),t.prototype.saveAccessTokenAndNotifySubscribers=function(t){var r;(null===(r=this._localState)||void 0===r?void 0:r.accessToken)!==t&&(this._localState.saveAccessToken(t),this._user=null),e.prototype.callSubscribers.call(this)},Object.defineProperty(t.prototype,"user",{get:function(){return this._user||(this._user=new Pe({oreIdContext:this._oreIdContext,accessTokenHelper:this._accessTokenHelper,accountName:this.accountName})),this._user},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLoggedIn",{get:function(){return!!this.accessToken},enumerable:!1,configurable:!0}),t.prototype.clearAccessToken=function(){this._localState.clearAccessToken(),this._accessTokenHelper.clearAccessToken(),e.prototype.callSubscribers.call(this)},t.prototype.connectWithWallet=function(e){return N(this,void 0,void 0,(function(){var t;return W(this,(function(r){if(t=e.walletType,!this._oreIdContext.walletHelper.isAValidExternalWalletType(t))throw new Error("loginWithWallet not supported for external wallet type: ".concat(t));return[2,this.connectToWalletProvider(e)]}))}))},t.prototype.connectToWalletProvider=function(e){return N(this,void 0,void 0,(function(){return W(this,(function(t){return[2,this._oreIdContext.walletHelper.connectToWalletProvider(e)]}))}))},t.prototype.convertOauthTokens=function(e){return N(this,void 0,void 0,(function(){return W(this,(function(t){return[2,G(this._oreIdContext,e)]}))}))},t.prototype.loginWithToken=function(e){return N(this,void 0,void 0,(function(){var t,r,n,o;return W(this,(function(i){switch(i.label){case 0:if(!(null==e?void 0:e.idToken)&&!(null==e?void 0:e.accessToken))throw new Error("Cant loginWithToken - missing required parameter: accessToken OR idToken");return[4,this.loginWithAccessOrIdTokenToken(e)];case 1:return t=i.sent(),r=t.accessToken,n=t.error,o=t.processId,n?[3,3]:(this.accessToken=r,[4,this.user.getData()]);case 2:i.sent(),i.label=3;case 3:return[2,{accessToken:r,errors:n,processId:o}]}}))}))},t.prototype.newUserWithToken=function(e){return N(this,void 0,void 0,(function(){var t,r,n,o;return W(this,(function(i){switch(i.label){case 0:return[4,this.newAccountWithIdToken(e)];case 1:return t=i.sent(),r=t.accessToken,n=t.error,o=t.processId,n?[3,3]:(this.accessToken=r,[4,this.user.getData()]);case 2:i.sent(),i.label=3;case 3:return[2,{accessToken:r,errors:n,processId:o}]}}))}))},t.checkJwtTokenAndReturnError=function(e){try{new Ce(e,!0)}catch(e){return{error:"token_invalid",message:"token invalid or corrupt - must be a JWT Oauth2 token"}}return null},t.prototype.loginWithAccessOrIdTokenToken=function(e){return N(this,void 0,void 0,(function(){var r,n,o,i;return W(this,(function(s){switch(s.label){case 0:return r=e.accessToken,n=e.idToken,(o=r&&H.jwtDecodeSafe(r)?r?t.checkJwtTokenAndReturnError(r):null:n?t.checkJwtTokenAndReturnError(n):null)?[2,x({accessToken:null},o)]:[4,te(this._oreIdContext,e)];case 1:return(null==(i=s.sent())?void 0:i.errorCode)||this.setAuthResult({accessToken:null==i?void 0:i.accessToken}),[2,{accessToken:i.accessToken,error:null==i?void 0:i.errorCode,message:null==i?void 0:i.errorMessage,processId:null==i?void 0:i.processId}]}}))}))},t.prototype.newAccountWithIdToken=function(e){return N(this,void 0,void 0,(function(){var r,n,o;return W(this,(function(i){switch(i.label){case 0:return r=e.idToken,(n=r?t.checkJwtTokenAndReturnError(r):null)?[2,x({accessToken:null},n)]:[4,re(this._oreIdContext,e)];case 1:return(null==(o=i.sent())?void 0:o.errorCode)||this.setAuthResult({accessToken:null==o?void 0:o.accessToken}),[2,{accessToken:o.accessToken,error:null==o?void 0:o.errorCode,message:null==o?void 0:o.errorMessage,processId:null==o?void 0:o.processId}]}}))}))},t.prototype.logout=function(){this.clearAccessToken(),this._user=null},t.prototype.getLoginUrl=function(e){return N(this,void 0,void 0,(function(){var t,r,n,o,i,s,a,c,u,l,d,p,h,v;return W(this,(function(f){switch(f.label){case 0:return r=(t=e||{}).code,n=t.email,o=t.idToken,i=t.phone,s=t.provider,a=t.state,c=t.linkToAccount,u=t.returnAccessToken,l=t.returnIdToken,d=this._oreIdContext.options,p=d.authCallbackUrl,h=d.backgroundColor,v={code:r,email:n,idToken:o,phone:i,provider:s,backgroundColor:h,callbackUrl:p,state:a,linkToAccount:c,returnAccessToken:!!H.isNullOrEmpty(u)||u,returnIdToken:l},[4,de(this._oreIdContext,v)];case 1:return[2,{loginUrl:f.sent(),errors:null}]}}))}))},t.prototype.handleAuthCallback=function(e){var t=H.extractDataFromCallbackUrl(e),r=t.access_token,n=t.account,o=t.id_token,i=t.errors,s=t.process_id,a=t.state,c={account:n};return i&&(c.errors=i),s&&(c.processId=s),a&&(c.state=a),r&&(c.accessToken=r),o&&(c.idToken=o),i||this.setAuthResult(c),this._oreIdContext.setIsBusy(!1),c},t.prototype.setAuthResult=function(e){var t=e.accessToken,r=e.idToken;if(!t)throw Error("Cant setAuthResult. accessToken is missing");this._accessTokenHelper.setIdToken(null),this.accessToken=t,r&&this._accessTokenHelper.setIdToken(r)},t}(Ae),xe=["metro"],Se="4.7.2",Ne=[e.ApiEndpoint.LoginUserWithToken,e.ApiEndpoint.NewUserWithToken],We=function(){function t(e){this._oreIdContext=e.oreIdContext,this._user=e.user,this.assertValidTransactionAndSetData(e.data),this._transitHelper=new Te({oreIdContext:this._oreIdContext,user:this._user}),this._ualHelper=new be({oreIdContext:this._oreIdContext,user:this._user})}return Object.defineProperty(t.prototype,"data",{get:function(){return this._data},enumerable:!1,configurable:!0}),t.prototype.assertValidTransactionAndSetData=function(e){var t=e||{},r=t.chainNetwork,n=t.transaction,o=t.signedTransaction,i=[],s=[];if(!this._user||!this._user.hasData)throw new Error("Make sure that a user has been authenticated and that youve called user.getData()");if(r||i.push("chainNetwork"),n||o||i.push("transaction OR signedTransaction"),this._user.accountName||s.push("Transaction Data error - Expecting a user.accountName - is the user logged-in in?"),n&&o&&s.push("Only provide one: transaction OR signedTransaction"),!H.isNullOrEmpty(i))throw new Error("Transaction parameter(s) missing: ".concat(i.join(", ")));if(!H.isNullOrEmpty(s))throw new Error("Transaction parameter error: ".concat(s.join(", ")));this.setTransactionData(e)},t.prototype.setTransactionData=function(e){this._data=x({account:this._user.accountName},e),(null==e?void 0:e.transaction)&&(this._data.encodedTransaction=H.base64Encode(JSON.stringify(e.transaction))),(null==e?void 0:e.signedTransaction)&&(this._data.encodedSignedTransaction=H.base64Encode(JSON.stringify(e.signedTransaction)))},t.prototype.assertTransactionAccountValidForUser=function(){var e,t,r,n,o,i,s=this._data,a=s.chainAccount,c=s.chainNetwork,u=this._user.accountName,l=null===(r=null===(t=null===(e=this._user)||void 0===e?void 0:e.data)||void 0===t?void 0:t.chainAccounts)||void 0===r?void 0:r.find((function(e){return e.chainNetwork===c&&e.chainAccount===a})),d=null===(n=null==l?void 0:l.permissions)||void 0===n?void 0:n.every((function(e){return!0===e.privateKeyStoredExterally})),p=null===(i=null===(o=null==l?void 0:l.permissions)||void 0===o?void 0:o.find((function(e){return!0===e.privateKeyStoredExterally})))||void 0===i?void 0:i.externalWalletType;if(!l)throw new Error("Can't find a chainAccount: ".concat(a," for chainNetwork: ").concat(c," in user's oreId account: ").concat(u));if(d)throw new Error("ChainAccount: ".concat(a," for chainNetwork: ").concat(c," appears to be in a wallet app (type: ").concat(p,") - use signWithWallet() to sign"))},t.prototype.validate=function(){return N(this,void 0,void 0,(function(){return W(this,(function(e){throw new Error("Not Implemented")}))}))},t.prototype.getSignUrl=function(){return N(this,void 0,void 0,(function(){var e,t;return W(this,(function(r){switch(r.label){case 0:return this.assertTransactionAccountValidForUser(),e=this.data,t=this._oreIdContext.options.signCallbackUrl,(null==e?void 0:e.signOptions)||(e.signOptions={}),e.signOptions.callbackUrl=t,[4,pe(this._oreIdContext,e)];case 1:return[2,{signUrl:r.sent(),errors:null}]}}))}))},t.prototype.checkCanAutoSign=function(){return N(this,void 0,void 0,(function(){var t;return W(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),F(this._oreIdContext,e.ApiKeyUsedFor.AutoSigning,""),[4,J(this._oreIdContext,this._data)];case 1:return t=r.sent().autoSignCredentialsExist,[3,3];case 2:return r.sent(),[2,!1];case 3:return[2,t]}}))}))},t.prototype.autoSign=function(){return N(this,void 0,void 0,(function(){var e,t,r,n,o,i,s;return W(this,(function(a){switch(a.label){case 0:return this.assertTransactionAccountValidForUser(),e=this.data,[4,ae(this._oreIdContext,{transactionData:e,autoSign:!0})];case 1:if(t=a.sent(),r=t.processId,n=t.signedTransaction,o=t.transactionId,i=t.errorCode,s=t.errorMessage,i||s)throw new Error(s);return[2,{processId:r,signedTransaction:n,transactionId:o}]}}))}))},t.prototype.signWithPassword=function(e,t){return N(this,void 0,void 0,(function(){var r,n,o,i,s,a,c;return W(this,(function(u){switch(u.label){case 0:if(this.assertTransactionAccountValidForUser(),(null==(r=this.data)?void 0:r.signOptions)||(r.signOptions={}),e&&(r.signOptions.userPassword=e),t&&(r.signOptions.userPasswordEncrypted=t),r.signOptions.userPassword&&r.signOptions.userPasswordEncrypted)throw new Error("Provide either a userPassword OR userPasswordEncrypted param. Both were provided.");return[4,ce(this._oreIdContext,{transactionData:r,autoSign:!1})];case 1:if(n=u.sent(),o=n.processId,i=n.signedTransaction,s=n.transactionId,a=n.errorCode,c=n.errorMessage,a||c)throw new Error(c);return[2,{processId:o,signedTransaction:i,transactionId:s}]}}))}))},t.prototype.signWithWallet=function(e){return N(this,void 0,void 0,(function(){var t;return W(this,(function(r){switch(r.label){case 0:return t=this.data,[4,this._oreIdContext.walletHelper.signWithWallet(e,t)];case 1:return[2,r.sent()]}}))}))},t}();function Oe(e,t){return f.default(t,e).toString()}function Ue(e,t,r){var n;return N(this,void 0,void 0,(function(){var o,i,s;return W(this,(function(a){switch(a.label){case 0:if(!e&&H.isNullOrEmpty(t))throw new Error("Cant generate hmac. apiKey missing or empty - its required if not using a proxy server");if(!e)return[3,5];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,v.default.post("/oreid/hmac",JSON.stringify({data:r}),{headers:{"Content-Type":"application/json"}})];case 2:return i=a.sent(),o=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.hmac,[3,4];case 3:throw s=a.sent(),this.getErrorFromAxiosError(s);case 4:return[3,6];case 5:o=Oe(t,r),a.label=6;case 6:return[2,o]}}))}))}function De(e,t,r){return N(this,void 0,void 0,(function(){var n,o;return W(this,(function(i){switch(i.label){case 0:if(H.isNullOrEmpty(r))throw new Error("Cant generate hmac. url missing or empty");return[4,Ue(e,t,r)];case 1:return n=i.sent(),o=encodeURIComponent(n),r.includes("&hmac=".concat(o))?[2,r]:[2,"".concat(r,"&hmac=").concat(o)]}}))}))}var Le=function(){function e(e,t){this.appId=e,this.cachedaccessToken=null,this.cachedUser=null,this.storage=t}return e.prototype.accessTokenKey=function(){return"oreid.".concat(this.appId,".accessToken")},Object.defineProperty(e.prototype,"accessToken",{get:function(){return this.cachedaccessToken||this.loadAccessToken(),this.cachedaccessToken},enumerable:!1,configurable:!0}),e.prototype.loadAccessToken=function(){this.cachedaccessToken=this.storage.getItem(this.accessTokenKey())},e.prototype.saveAccessToken=function(e){e?(this.cachedaccessToken=e,this.storage.setItem(this.accessTokenKey(),e)):this.clearAccessToken()},e.prototype.clearAccessToken=function(){this.cachedaccessToken=null,this.storage.removeItem(this.accessTokenKey())},e.prototype.clear=function(){this.clearAccessToken()},e}(),qe=function(){function e(){}return e.prototype.getItem=function(e){return g.get(e)},e.prototype.removeItem=function(e){g.remove(e)},e.prototype.setItem=function(e,t,r){var n=x({expires:1},r);return g.set(e,t,n)},e}(),He=function(){function e(){window?this.storage=window.localStorage:H.log("Not running in Browser. Using CookieStorage instead.")}return e.prototype.getItem=function(e){return this.storage?this.storage.getItem(e):null},e.prototype.removeItem=function(e){this.storage&&this.storage.removeItem(e)},e.prototype.setItem=function(e,t,r){this.storage&&this.storage.setItem(e,t)},e}(),je=function(){function e(){}return e.prototype.getItem=function(e){return null},e.prototype.removeItem=function(e){},e.prototype.setItem=function(e,t,r){},e}(),Re=function(){function e(){this.memoryCache={}}return e.prototype.getItem=function(e){return e in this.memoryCache?this.memoryCache[e]:null},e.prototype.removeItem=function(e){this.getItem(e)&&delete this.memoryCache[e]},e.prototype.setItem=function(e,t,r){this.memoryCache[e]=t},e}(),Fe=function(){function e(e){if(void 0===e&&(e={tryLocalStorageFirst:!0}),this.triedLocalStorage=!1,this.triedCookieStorage=!1,!0===e.tryLocalStorageFirst){this.triedLocalStorage=!0;try{var t=new He;t&&t.storage&&(this.storage=t)}catch(t){H.log("Cant use localStorage. Using CookieStorage instead.",e)}}this.storage||(this.storage=new qe,this.triedCookieStorage=!0)}return e.prototype.failover=function(){if(!(this.storage instanceof je)){var e=!1;this.storage instanceof He?this.triedCookieStorage||(this.storage=new qe,this.triedCookieStorage=!0,e=!0):this.storage instanceof qe&&(this.triedLocalStorage||(this.storage=new He,this.triedLocalStorage=!0,e=!0)),e||(this.storage=new je)}},e.prototype.getItem=function(e){try{return this.storage.getItem(e)}catch(t){return H.log("Cant getItem in storage.",t),this.failover(),this.storage.getItem(e)}},e.prototype.removeItem=function(e){try{return void this.storage.removeItem(e)}catch(t){H.log("Cant removeItem in storage.",t),this.failover(),this.storage.removeItem(e)}},e.prototype.setItem=function(e,t,r){try{return this.storage.setItem(e,t,r)}catch(n){return H.log("Cant setItem in storage.",n),this.failover(),this.storage.setItem(e,t,r)}},e}(),Me=function(){function t(e){this._cachedChainNetworks=[],this._oreIdContext=e.oreIdContext,this._cachedChainNetworks=null}return t.prototype.getAllChainNetworkSettings=function(){return N(this,void 0,void 0,(function(){var t;return W(this,(function(r){switch(r.label){case 0:return H.isNullOrEmpty(this._cachedChainNetworks)?[4,this.getConfigFromApi(e.ConfigType.Chains)]:[3,2];case 1:t=r.sent(),this._cachedChainNetworks=t.chains,r.label=2;case 2:return[2,this._cachedChainNetworks]}}))}))},t.prototype.getChainNetworkSettings=function(e){return N(this,void 0,void 0,(function(){return W(this,(function(t){switch(t.label){case 0:return[4,this.getAllChainNetworkSettings()];case 1:return[2,t.sent().find((function(t){return t.network===e}))]}}))}))},t.prototype.getConfig=function(e){return N(this,void 0,void 0,(function(){return W(this,(function(t){return[2,this.getConfigFromApi(e)]}))}))},t.prototype.getConfigFromApi=function(e){return N(this,void 0,void 0,(function(){var t;return W(this,(function(r){switch(r.label){case 0:return[4,X(this._oreIdContext,{configType:e})];case 1:if(t=r.sent(),H.isNullOrEmpty(t))throw new Error("Not able to retrieve config values for ".concat(e));return[2,t]}}))}))},t.prototype.getChainNetworkNextworkConfig=function(e){return N(this,void 0,void 0,(function(){var t,r,n,o,i,s;return W(this,(function(a){switch(a.label){case 0:return[4,this.getChainNetworkSettings(e)];case 1:if(!(t=a.sent()))throw new Error("Invalid chain network: ".concat(e,"."));return r=(null==t?void 0:t.hosts[0])||{},n=r.chainId,o=r.host,i=r.port,s=r.protocol,[2,{host:o,port:i,protocol:s,chainId:n}]}}))}))},t.prototype.getChainNetworkByChainId=function(e){return N(this,void 0,void 0,(function(){var t,r;return W(this,(function(n){switch(n.label){case 0:return[4,this.getAllChainNetworkSettings()];case 1:return t=n.sent(),r=t.find((function(t){return t.hosts.find((function(t){return t.chainId===e}))})),H.isNullOrEmpty(r)?[2,null]:[2,r.network]}}))}))},t.prototype.isNotEosNetwork=function(t){return N(this,void 0,void 0,(function(){var r;return W(this,(function(n){switch(n.label){case 0:return[4,this._oreIdContext.settings.getChainNetworkSettings(t)];case 1:return[2,!((r=n.sent()).type===e.ChainPlatformType.eos||r.type===e.ChainPlatformType.ore)]}}))}))},t}(),Ke=function(){function t(e){this._oreIdContext=e.oreIdContext,this._transitHelper=e.transitHelper,this._ualHelper=e.ualHelper}return Object.defineProperty(t.prototype,"transitHelper",{get:function(){return this._transitHelper},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ualHelper",{get:function(){return this._ualHelper},enumerable:!1,configurable:!0}),t.prototype.isAValidExternalWalletType=function(e){return(this._transitHelper.isTransitProvider(e)||this._ualHelper.isUalProvider(e))&&!xe.includes(e)},t.prototype.getExternalWalletInfo=function(t,r){if(!this.isAValidExternalWalletType(t))throw new Error("Not a valid external wallet type: ".concat(t));return this._transitHelper.hasTransitProvider(t)||r===e.ExternalWalletInterface.Transit?ge(t):this._ualHelper.hasUalProvider(t)||r===e.ExternalWalletInterface.Ual?me(t):null},t.prototype.getExternalWalletInfoByChain=function(e){var t=this,r=fe.filter((function(e){return t._oreIdContext.transitProvidersInstalled.includes(e.providerName)})),n=we.filter((function(e){return t._oreIdContext.ualProvidersInstalled.includes(e.providerName)}));return U(U([],O(r),!1),O(n),!1).filter((function(t){return t.chainType===e}))},t.prototype.connectToWalletProvider=function(e){return N(this,void 0,void 0,(function(){var t;return W(this,(function(r){if(t=e.walletType,!this.isAValidExternalWalletType(t))throw new Error("Not a valid external wallet type: ".concat(t));if(this._transitHelper.hasTransitProvider(t))return[2,this._transitHelper.loginWithTransitProvider(e)];if(this._ualHelper.hasUalProvider(t))return[2,this._ualHelper.loginWithUalProvider(e)];throw new Error("Wallet type ".concat(t," invalid or not installed"))}))}))},t.prototype.signWithWallet=function(t,r){return N(this,void 0,void 0,(function(){var n,o,i,s;return W(this,(function(a){switch(a.label){case 0:if(!this._oreIdContext.walletHelper.isAValidExternalWalletType(t))throw new Error("signWithWallet not supported for external wallet type: ".concat(t));return o=H.toEnumValue(e.AuthProvider,t),this._transitHelper.hasTransitProvider(t)?[4,this._transitHelper.signWithTransitProvider(r,t)]:[3,3];case 1:return n=a.sent(),i=r.account,s=r.chainNetwork,[4,this._transitHelper.callDiscoverAfterSign({account:i,chainNetwork:s,signOptions:{provider:o}})];case 2:return a.sent(),[3,5];case 3:return this._ualHelper.hasUalProvider(t)?[4,this._ualHelper.signWithUalProvider(r,t)]:[3,5];case 4:n=a.sent(),a.label=5;case 5:return[2,n]}}))}))},t.prototype.signStringWithWallet=function(t){return N(this,void 0,void 0,(function(){var r,n,o,i,s;return W(this,(function(a){switch(a.label){case 0:if(r=t.account,n=t.walletType,o=t.chainNetwork,!this.isAValidExternalWalletType(n))throw new Error("signStringWithWallet not supported for external wallet type: ".concat(n));if(s=H.toEnumValue(e.AuthProvider,n),!this._transitHelper.hasTransitProvider(n))return[3,3];if(!this._transitHelper.canSignString(n))throw Error("The walletType ".concat(n," does not support signString"));return[4,this._transitHelper.signStringWithTransitProvider(t)];case 1:return i=a.sent(),[4,this._transitHelper.callDiscoverAfterSign({account:r,chainNetwork:o,signOptions:{provider:s}})];case 2:return a.sent(),[3,5];case 3:if(!this._ualHelper.hasUalProvider(n))return[3,5];if(!this._ualHelper.canSignString(n))throw Error("The walletType ".concat(n," does not support signString"));return[4,this._ualHelper.signStringWithUalProvider(t)];case 4:i=a.sent(),a.label=5;case 5:return[2,i]}}))}))},t.prototype.assertWalletTypeValidForChainNetwork=function(e,t,r){return N(this,void 0,void 0,(function(){var n,o;return W(this,(function(i){switch(i.label){case 0:return n=this.getExternalWalletInfo(e,r).chainType,[4,this._oreIdContext.settings.getAllChainNetworkSettings()];case 1:if(o=i.sent(),!!!o.find((function(e){return e.network===t&&e.type===n})))throw Error("External Wallet Type: ".concat(e," doesnt support chainNetwork ").concat(t,". Hint: It supports networks of type ").concat(n,"."));return[2]}}))}))},t.prototype.canDiscover=function(e,t){var r;return(null===(r=this.getExternalWalletInfo(e,t))||void 0===r?void 0:r.supportsDiscovery)||!1},t.prototype.canSignString=function(e,t){var r;return(null===(r=this.getExternalWalletInfo(e,t))||void 0===r?void 0:r.supportsSignArbitrary)||!1},t.prototype.requiresDiscoverToLogin=function(e,t){var r;return(null===(r=this.getExternalWalletInfo(e,t))||void 0===r?void 0:r.requiresDiscoverToLogin)||!1},t.prototype.requiresLogoutLoginToDiscover=function(e,t){var r;return(null===(r=this.getExternalWalletInfo(e,t))||void 0===r?void 0:r.requiresLogoutLoginToDiscover)||!1},t.prototype.defaultDiscoveryPathIndexList=function(e,t){var r;return(null===(r=this.getExternalWalletInfo(e,t))||void 0===r?void 0:r.defaultDiscoveryPathIndexList)||null},t.prototype.helpTextForProvider=function(e,t){var r;return(null===(r=this.getExternalWalletInfo(e,t))||void 0===r?void 0:r.helpText)||null},t}(),Ve=H.isNullOrEmpty,Be=function(){function t(e){var t,r,n,o;this.transitProvidersInstalled=[],this.ualProvidersInstalled=[],this._options=null,this.validateAndSetOptions(e);var i=(null===(t=this.options)||void 0===t?void 0:t.storageHandler)||new Fe;this._localState=new Le(null===(r=this.options)||void 0===r?void 0:r.appId,i),this._settings=new Me({oreIdContext:this}),this._auth=new Ee({oreIdContext:this}),this._transitHelper=new Te({oreIdContext:this,user:this._auth.user}),this._transitHelper.installTransitProviders(null===(n=this.options)||void 0===n?void 0:n.eosTransitWalletProviders),this._ualHelper=new be({oreIdContext:this,user:this._auth.user}),this._ualHelper.installUalProviders(null===(o=this.options)||void 0===o?void 0:o.ualAuthenticators),this._walletHelper=new Ke({oreIdContext:this,transitHelper:this._transitHelper,ualHelper:this._ualHelper}),this._initializerPlugins=e.plugins||{},this._isInitialized=!1}return Object.defineProperty(t.prototype,"accessToken",{get:function(){return this.auth.accessToken},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessTokenHelper",{get:function(){return this.auth.accessTokenHelper},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"auth",{get:function(){return this._auth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDemoApp",{get:function(){var e,t;return(null===(t=null===(e=this.options)||void 0===e?void 0:e.appId)||void 0===t?void 0:t.toLowerCase().startsWith("demo"))||!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isInitialized",{get:function(){return this._isInitialized},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localState",{get:function(){return this._localState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this._options},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"popup",{get:function(){return this.assertIsInitialized(),this._popup},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"requiresProxyServer",{get:function(){var e,t;return!!(null===(e=null==this?void 0:this.options)||void 0===e?void 0:e.isUsingProxyServer)||!!(null===(t=null==this?void 0:this.options)||void 0===t?void 0:t.apiKey)&&(H.isInBrowser&&!this.isDemoApp)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"settings",{get:function(){return this._settings},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"walletHelper",{get:function(){return this._walletHelper},enumerable:!1,configurable:!0}),t.prototype.init=function(){var e,t,r;return N(this,void 0,void 0,(function(){var n;return W(this,(function(o){switch(o.label){case 0:return this.isInitialized?[2]:(null===(e=this._initializerPlugins)||void 0===e?void 0:e.popup)?(n=this,[4,null===(r=null===(t=this._initializerPlugins)||void 0===t?void 0:t.popup)||void 0===r?void 0:r.init(this)]):[3,2];case 1:n._popup=o.sent(),o.label=2;case 2:return this._isInitialized=!0,[2]}}))}))},t.prototype.assertIsInitialized=function(){if(!this.isInitialized)throw new Error("OreId is not initialized - call init() first")},t.prototype.logout=function(){this.auth.logout()},t.prototype.signStringWithWallet=function(e){return N(this,void 0,void 0,(function(){return W(this,(function(t){return[2,this.walletHelper.signStringWithWallet(e)]}))}))},t.prototype.custodialSignString=function(e){return N(this,void 0,void 0,(function(){var t;return W(this,(function(r){switch(r.label){case 0:return[4,$(this,e)];case 1:if((null==(t=r.sent())?void 0:t.errorCode)||(null==t?void 0:t.errorMessage))throw new Error(t.errorMessage);return[2,t]}}))}))},t.prototype.custodialNewAccount=function(e){return N(this,void 0,void 0,(function(){var t;return W(this,(function(r){switch(r.label){case 0:return[4,Z(this,e)];case 1:if((null==(t=r.sent())?void 0:t.errorCode)||(null==t?void 0:t.errorMessage))throw new Error(t.errorMessage);return[2,t]}}))}))},t.prototype.custodialMigrateAccount=function(e){return N(this,void 0,void 0,(function(){var t;return W(this,(function(r){switch(r.label){case 0:return[4,Y(this,e)];case 1:if((null==(t=r.sent())?void 0:t.errorCode)||(null==t?void 0:t.errorMessage))throw new Error(t.errorMessage);return[2,t]}}))}))},t.prototype.getExternalWalletInfo=function(e){return this.walletHelper.getExternalWalletInfo(e)},t.prototype.createTransaction=function(e){return N(this,void 0,void 0,(function(){return W(this,(function(t){switch(t.label){case 0:return this._auth.user.hasData?[3,2]:[4,this._auth.user.getData()];case 1:t.sent(),t.label=2;case 2:return[2,new We({oreIdContext:this,user:this.auth.user,data:e})]}}))}))},t.prototype.setIsBusy=function(e){this.isBusy!==e&&(this.isBusy=e,this.options.setBusyCallback&&this.options.setBusyCallback(e))},t.prototype.validateAndSetOptions=function(e){var t=e||{},r=t.appId,n=t.apiKey,o=t.oreIdUrl,i="";if(this._options=e,e&&(this.options.oreIdUrl=o||"https://service.oreid.io"),r||(i+="\n --\x3e Missing required parameter - appId. You can get an appId when you register your app with ORE ID."),this.requiresProxyServer&&n&&(i+="\n --\x3e You cant include the apiKey when creating an instance of OreId that runs in the browser. This is to prevent your key from being visible in the browser. If this app runs solely in the browser (like a Create React App), you need to set-up a proxy server to protect your keys. Refer to https://github.com/TeamAikon/ore-id-docs. Note: You wont get this error when using the appId and apiKey for a demo app (appId starts with demo_)."),""!==i)throw new Error("Options are missing or invalid. ".concat(i))},t.prototype.getAppAccessToken=function(e){return N(this,void 0,void 0,(function(){return W(this,(function(t){return[2,z(this,e)]}))}))},t.prototype.handleNewAccountResponse=function(e){var t=H.extractDataFromCallbackUrl(e),r=t.chain_account,n=t.process_id,o=t.state,i=t.errors;return this.setIsBusy(!1),{chainAccount:r,processId:n,state:o,errors:i}},t.prototype.handleSignCallback=function(e){var t,r=H.extractDataFromCallbackUrl(e),n=r.signed_transaction,o=r.process_id,i=r.state,s=r.transaction_id,a=r.errors;return a||(t=H.base64DecodeSafe(n)),this.setIsBusy(!1),{signedTransaction:t,processId:o,state:i,transactionId:s,errors:a}},t.prototype.appendTimestampAndSignatureToWidgetProps=function(e){return N(this,void 0,void 0,(function(){var t,r,n;return W(this,(function(o){switch(o.label){case 0:if((null==e?void 0:e.timestamp)&&(null==e?void 0:e.signature))return[2,e];t=x({},e),r=(null==e?void 0:e.timestamp)||(new Date).getTime(),t.origin=(null==e?void 0:e.origin)||(null===window||void 0===window?void 0:window.location.origin),t.timestamp=r,o.label=1;case 1:return o.trys.push([1,3,,4]),n=t,[4,Ue(this.requiresProxyServer,this.options.apiKey,JSON.stringify(H.sortJson(e)))];case 2:return n.signature=o.sent(),[3,4];case 3:return o.sent(),[3,4];case 4:return[2,t]}}))}))},t.prototype.callOreIdApi=function(t,r,n,o,i){return void 0===n&&(n={}),void 0===i&&(i=null),N(this,void 0,void 0,(function(){var s,a,c,u,l,d,p,h,f,g,y,T;return W(this,(function(w){switch(w.label){case 0:if(c={},u=this.options,l=u.apiKey,d=u.oreIdUrl,p=this.requiresProxyServer?"/oreid":d,h="".concat(p,"/api/").concat(r),f=o||this.accessToken,!l&&!f&&!Ne.includes(r))throw new Error("OreId API request requires either apiKey or accessToken");l&&(c["api-key"]=l),f&&(c.Authorization="Bearer ".concat(f)),Ve(i)||(c["process-id"]=i),c["sdk-version"]="oreidjs/".concat(Se),w.label=1;case 1:return w.trys.push([1,6,,7]),t!==e.RequestType.Get?[3,3]:(Ve(n)||(s=Object.keys(n).map((function(e){return"".concat(e,"=").concat(n[e])})).join("&")),g=s?"".concat(h,"?").concat(s):h,[4,v.default.get(g,{headers:c})]);case 2:a=w.sent(),w.label=3;case 3:return t!==e.RequestType.Post?[3,5]:(y=Ve(n)?null:JSON.stringify(n),[4,v.default.post(h,y,{headers:x({"Content-Type":"application/json"},c)})]);case 4:a=w.sent(),w.label=5;case 5:return[3,7];case 6:throw T=w.sent(),H.getErrorFromAxiosError(T);case 7:return[2,null==a?void 0:a.data]}}))}))},t.prototype.addAccessTokenAndHmacToUrl=function(e,t,r){var n,o,i;return N(this,void 0,void 0,(function(){var s,a,c,u,l;return W(this,(function(d){switch(d.label){case 0:return s=this.options.appId,this.requiresProxyServer?[4,v.default.post("/oreid/prepare-url",{appAccessTokenMetadata:t,urlString:e})]:[3,2];case 1:return a=d.sent(),[2,null===(n=null==a?void 0:a.data)||void 0===n?void 0:n.urlString];case 2:return c="".concat(e,"&app_id=").concat(s),Ve(t)?[3,5]:(l=r)?[3,4]:[4,this.getAppAccessToken({appAccessTokenMetadata:t})];case 3:l=d.sent(),d.label=4;case 4:u=l,c="".concat(c,"&app_access_token=").concat(u),d.label=5;case 5:return(null===(o=this.options)||void 0===o?void 0:o.apiKey)?[4,De(!1,null===(i=this.options)||void 0===i?void 0:i.apiKey,c)]:[3,7];case 6:c=d.sent(),d.label=7;case 7:return[2,c]}}))}))},t}();e.PluginType=void 0,(e.PluginType||(e.PluginType={})).Popup="popup",e.Auth=Ee,e.DummyStorage=je,e.Helpers=H,e.MemoryStorage=Re,e.OreId=Be,e.Transaction=We,e.User=Pe,e.WidgetVersion="1",e.appendHmacToUrl=De,e.generateHmac=Oe,e.generateHmacWithApiKeyOrProxyServer=Ue,Object.defineProperty(e,"__esModule",{value:!0})}));//# sourceMappingURL=index.js.map
