@dcl/builder-site 7.9.1 → 7.9.2-16202422627.commit-2162b6e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/assets/{Back-iVIqxATW.js → Back-D4W_O81e.js} +1 -1
  2. package/assets/{CollectionProvider.container-D5AviJmj.js → CollectionProvider.container-CJ2iDKGX.js} +1 -1
  3. package/assets/{CollectionStatus.container-BA96F5oG.js → CollectionStatus.container-IWl9eE40.js} +1 -1
  4. package/assets/{ConfirmDelete-DbFeXC54.js → ConfirmDelete-CGDLMrJr.js} +1 -1
  5. package/assets/{FileSaver.min-Co5yNCWq.js → FileSaver.min-DLSz4GG6.js} +1 -1
  6. package/assets/{ItemProvider.container-DFEZSCMr.js → ItemProvider.container-BbqNgUEL.js} +1 -1
  7. package/assets/{JumpIn.container-Bfsb8XQY.js → JumpIn.container-D2EpA82b.js} +1 -1
  8. package/assets/{LandAction-CPxdm2mW.js → LandAction-Bya5iY9t.js} +1 -1
  9. package/assets/{LandProviderPage-CcaXrtuL.js → LandProviderPage-DMG9x9Uh.js} +1 -1
  10. package/assets/{LoggedInDetailPage.container-P8-KV9ow.js → LoggedInDetailPage.container-BO7Rsigx.js} +1 -1
  11. package/assets/{Navigation-DcWJGKAO.css → Navigation-PyqSlJpo.css} +1 -1
  12. package/assets/{Navigation.container-h_uvbEV-.js → Navigation.container-CsesGRoh.js} +1 -1
  13. package/assets/{NotFound-DLc93Jdo.js → NotFound-PGQXtpug.js} +1 -1
  14. package/assets/{OptionsDropdown-D-NX2iG9.js → OptionsDropdown-A7bqXuQQ.js} +1 -1
  15. package/assets/{RentalPeriod-zYkY1mDE.js → RentalPeriod-BraXFDZS.js} +1 -1
  16. package/assets/{SDKTag-zvq-EFlK.js → SDKTag-DJMRg0px.js} +1 -1
  17. package/assets/{SceneStats.container-BaAgsVQY.js → SceneStats.container-Wj4QXrQM.js} +1 -1
  18. package/assets/{SignInRequired-CvEoVbqe.js → SignInRequired-D6dYEPdh.js} +1 -1
  19. package/assets/{ThirdPartyKindBadge-BGDRAUQ5.js → ThirdPartyKindBadge-CFiwrfph.js} +1 -1
  20. package/assets/{dataReader-CLgBoImj.js → dataReader-CYT0dmyo.js} +1 -1
  21. package/assets/{date-DaS5tTOc.js → date-BqKdO_5V.js} +1 -1
  22. package/assets/{fortmatic-C5kGMbac.js → fortmatic-nVWFrs39.js} +1 -1
  23. package/assets/{index-xeNI-sul.js → index-B-CgHsLs.js} +1 -1
  24. package/assets/{index-DMVn9XTQ.js → index-B-U4GUpe.js} +1 -1
  25. package/assets/index-B443cfLz.js +1 -0
  26. package/assets/{index-DBzbK1MF.js → index-BBNCItH9.js} +1 -1
  27. package/assets/index-BCTU6gRE.js +1 -0
  28. package/assets/{index-BKK3ugfo.js → index-BI-MYVXj.js} +1 -1
  29. package/assets/{index-CJSWaccM.js → index-BLL_kcFx.js} +1 -1
  30. package/assets/{index-CcMbrywa.js → index-BSgMtMFr.js} +1 -1
  31. package/assets/{index-BYe-BrLx.js → index-BT1Ly74q.js} +1 -1
  32. package/assets/{index-BTpC11Oq.js → index-BTNRbe6-.js} +1 -1
  33. package/assets/{index-nH65R0Ne.js → index-BTV1BibB.js} +1 -1
  34. package/assets/{index-C5utrJrI.css → index-BXI0TOxc.css} +1 -1
  35. package/assets/{index-B75IRI8j.js → index-BcIVXak6.js} +1 -1
  36. package/assets/index-Bf7y2ke5.css +1 -0
  37. package/assets/{index-GJXVneNz.js → index-BfqSzaty.js} +1 -1
  38. package/assets/{index-BfhfbjsI.js → index-BskZ5mzb.js} +1 -1
  39. package/assets/{index-CJrsLA__.js → index-BwMnXutj.js} +1 -1
  40. package/assets/{index-Dal_XZcP.js → index-BxTFNW_J.js} +2 -2
  41. package/assets/{index-BmBjMJGp.js → index-C1WvKOvC.js} +1 -1
  42. package/assets/{index-C4iDnHzQ.js → index-C5StGWKF.js} +1 -1
  43. package/assets/{index-BeIUTgzC.js → index-CD26aSF-.js} +1 -1
  44. package/assets/{index-MESwJQyA.js → index-CGtTZh5E.js} +1 -1
  45. package/assets/{index-C9cg4O1G.js → index-CLR7PH5p.js} +1 -1
  46. package/assets/{index-C6KkvWBP.js → index-COkEjczd.js} +1 -1
  47. package/assets/{index-BRnDLGtf.js → index-CTqGCIas.js} +1 -1
  48. package/assets/{index-CR7Ij6lz.js → index-CVV3dZXB.js} +1 -1
  49. package/assets/{index-CTfA02Fv.js → index-Cbtee_5J.js} +1 -1
  50. package/assets/index-ChSw1JF8.js +2 -0
  51. package/assets/{index-BSn7FPUk.js → index-CxNV7bdb.js} +1 -1
  52. package/assets/index-D5GgTucn.css +1 -0
  53. package/assets/{index-Bv5zwwVy.js → index-DEx5ewtI.js} +1 -1
  54. package/assets/{index-Db_urTlf.css → index-DGfJMRq1.css} +7 -7
  55. package/assets/index-DI-Q_3C2.css +1 -0
  56. package/assets/index-DLqYYi0x.css +1 -0
  57. package/assets/{index-DvBGq_qU.js → index-DSYN9Vlq.js} +1 -1
  58. package/assets/{index-CU5Zz03o.js → index-DShmef8G.js} +1 -1
  59. package/assets/{index-CR4G-DF6.js → index-Dh82delg.js} +1 -1
  60. package/assets/{index-285OW5UD.js → index-DhNeyJ74.js} +1 -1
  61. package/assets/index-DmT-osKc.js +1 -0
  62. package/assets/{index-g6IkFXl6.js → index-EznQ1aU3.js} +1 -1
  63. package/assets/{index-BlzBJCBk.css → index-QhQimFh2.css} +1 -1
  64. package/assets/{index-CzWZM_Xn.js → index-Sf_Exf2t.js} +1 -1
  65. package/assets/{index-C2Y2eZ28.js → index-ZuMScRBF.js} +109 -109
  66. package/assets/{index-DUc4VmF0.js → index-gXzzgwlS.js} +1 -1
  67. package/assets/{index-BrBCHOe4.js → index-i2ccmdc3.js} +1 -1
  68. package/assets/{index-CaOeGZDQ.js → index-k99NNR6U.js} +1 -1
  69. package/assets/{index-5MfovQ0h.js → index-vie0nMOv.js} +1 -1
  70. package/assets/{index-CKgGhN0e.js → index-x4ikeg4v.js} +1 -1
  71. package/assets/{index-BvEd9UFa.js → index-zqRa_a6z.js} +1 -1
  72. package/assets/{index.es-I-3UUEct.js → index.es-D6ZROQ2S.js} +4 -4
  73. package/assets/{selectors-Zkd3yj1l.js → selectors-CVDyed6b.js} +1 -1
  74. package/index.html +3 -3
  75. package/package.json +3 -3
  76. package/assets/index-BKXwZXjK.css +0 -1
  77. package/assets/index-C2C0FpAa.css +0 -1
  78. package/assets/index-CFGFIaXM.js +0 -1
  79. package/assets/index-DKVSkEva.js +0 -1
  80. package/assets/index-Df2XL9vC.js +0 -2
  81. package/assets/index-DgBSAmDq.css +0 -1
  82. package/assets/index-Door2Ali.js +0 -1
  83. package/assets/index-oit6oKkQ.css +0 -1
@@ -1,5 +1,5 @@
1
- import{p as dt}from"./index-C2Y2eZ28.js";var U=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(U||{}),j=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e.ProductAnnouncement="ANNOUNCEMENT",e))(j||{}),ve=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e[e.RedirectLoginComplete=-10015]="RedirectLoginComplete",e))(ve||{}),M=(e=>(e.MetaMask="metamask",e.CoinbaseWallet="coinbase_wallet",e))(M||{}),ae=(e=>(e.WalletSelected="wallet_selected",e.WalletConnected="wallet_connected",e.WalletRejected="wallet_rejected",e))(ae||{}),h=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.SetAuthorizationToken="magic_auth_set_authorization_token",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="magic_get_info",e.ShowUI="magic_wallet",e.NFTPurchase="magic_nft_purchase",e.NFTCheckout="magic_nft_checkout",e.NFTTransfer="magic_nft_transfer",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e.MagicBoxHeartBeat="magic_box_heart_beat",e.AutoConnect="mc_auto_connect",e.Login="mc_login",e.EncryptV1="magic_auth_encrypt_v1",e.DecryptV1="magic_auth_decrypt_v1",e.ShowNFTs="magic_show_nfts",e.ShowOnRamp="magic_show_fiat_onramp",e.ShowSendTokensUI="magic_show_send_tokens_ui",e.ShowAddress="magic_show_address",e.ShowBalances="magic_show_balances",e.SendGaslessTransaction="eth_sendGaslessTransaction",e))(h||{}),k=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",e.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",e))(k||{}),ce=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(ce||{}),ht=(e=>(e.UpdateEmail="update-email",e.MFA="mfa",e.Recovery="recovery",e))(ht||{}),pt=(e=>(e.Retry="retry",e))(pt||{}),mt=(e=>(e.EmailSent="email-sent",e.EmailNotDeliverable="email-not-deliverable",e))(mt||{}),X=(e=>(e.VerifyEmailOtp="verify-email-otp",e.Cancel="cancel",e))(X||{}),Et=(e=>(e.EmailOTPSent="email-otp-sent",e.InvalidEmailOtp="invalid-email-otp",e.ExpiredEmailOtp="expired-email-otp",e))(Et||{}),ge=(e=>(e.Retry="device-retry",e))(ge||{}),ft=(e=>(e.DeviceApproved="device-approved",e.DeviceNeedsApproval="device-needs-approval",e.DeviceVerificationLinkExpired="device-verification-link-expired",e.DeviceVerificationEmailSent="device-verification-email-sent",e))(ft||{}),b=(e=>(e.Retry="Recency/auth-factor-retry",e.Cancel="Recency/auth-factor-verification-cancel",e.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",e))(b||{}),gt=(e=>(e.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",e.PrimaryAuthFactorVerified="Recency/auth-factor-verified",e.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",e.EmailExpired="Recency/auth-factor-verification-email-expired",e.EmailSent="Recency/auth-factor-verification-email-sent",e.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",e))(gt||{}),P=(e=>(e.RetryWithNewEmail="UpdateEmail/retry-with-new-email",e.Cancel="UpdateEmail/new-email-verification-cancel",e.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",e))(P||{}),_t=(e=>(e.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",e.EmailUpdated="UpdateEmail/email-updated",e.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",e.EmailExpired="UpdateEmail/new-email-verification-email-expired",e.EmailSent="UpdateEmail/new-email-verification-email-sent",e.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",e.InvalidEmail="UpdateEmail/new-email-invalid",e.EmailAlreadyExists="UpdateEmail/new-email-already-exists",e))(_t||{}),vt=(e=>(e.Harmony="HARMONY",e))(vt||{}),It=(e=>(e.PhoneNumber="phone_number",e))(It||{}),Ee={VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.9.1"},yt=Object.create,pe=Object.defineProperty,wt=Object.defineProperties,Rt=Object.getOwnPropertyDescriptor,$t=Object.getOwnPropertyDescriptors,Nt=Object.getOwnPropertyNames,Te=Object.getOwnPropertySymbols,At=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable,Le=(e,t,r)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ie=(e,t)=>{for(var r in t||(t={}))He.call(t,r)&&Le(e,r,t[r]);if(Te)for(var r of Te(t))Ot.call(t,r)&&Le(e,r,t[r]);return e},ye=(e,t)=>wt(e,$t(t)),Mt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Tt=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},Lt=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Nt(t))!He.call(e,n)&&n!==r&&pe(e,n,{get:()=>t[n],enumerable:!(i=Rt(t,n))||i.enumerable});return e},St=(e,t,r)=>(r=e!=null?yt(At(e)):{},Lt(!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),v=(e,t,r)=>new Promise((i,n)=>{var s=u=>{try{o(r.next(u))}catch(l){n(l)}},a=u=>{try{o(r.throw(u))}catch(l){n(l)}},o=u=>u.done?i(u.value):Promise.resolve(u.value).then(s,a);o((r=r.apply(e,t)).next())}),Ct=Mt((e,t)=>{var r=Object.prototype.hasOwnProperty,i="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(i=!1));function s(l,c,d){this.fn=l,this.context=c,this.once=d||!1}function a(l,c,d,f,_){if(typeof d!="function")throw new TypeError("The listener must be a function");var I=new s(d,f||l,_),$=i?i+c:c;return l._events[$]?l._events[$].fn?l._events[$]=[l._events[$],I]:l._events[$].push(I):(l._events[$]=I,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var l=[],c,d;if(this._eventsCount===0)return l;for(d in c=this._events)r.call(c,d)&&l.push(i?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},u.prototype.listeners=function(l){var c=i?i+l:l,d=this._events[c];if(!d)return[];if(d.fn)return[d.fn];for(var f=0,_=d.length,I=new Array(_);f<_;f++)I[f]=d[f].fn;return I},u.prototype.listenerCount=function(l){var c=i?i+l:l,d=this._events[c];return d?d.fn?1:d.length:0},u.prototype.emit=function(l,c,d,f,_,I){var $=i?i+l:l;if(!this._events[$])return!1;var p=this._events[$],L=arguments.length,C,y;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),L){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,d),!0;case 4:return p.fn.call(p.context,c,d,f),!0;case 5:return p.fn.call(p.context,c,d,f,_),!0;case 6:return p.fn.call(p.context,c,d,f,_,I),!0}for(y=1,C=new Array(L-1);y<L;y++)C[y-1]=arguments[y];p.fn.apply(p.context,C)}else{var ut=p.length,V;for(y=0;y<ut;y++)switch(p[y].once&&this.removeListener(l,p[y].fn,void 0,!0),L){case 1:p[y].fn.call(p[y].context);break;case 2:p[y].fn.call(p[y].context,c);break;case 3:p[y].fn.call(p[y].context,c,d);break;case 4:p[y].fn.call(p[y].context,c,d,f);break;default:if(!C)for(V=1,C=new Array(L-1);V<L;V++)C[V-1]=arguments[V];p[y].fn.apply(p[y].context,C)}}return!0},u.prototype.on=function(l,c,d){return a(this,l,c,d,!1)},u.prototype.once=function(l,c,d){return a(this,l,c,d,!0)},u.prototype.removeListener=function(l,c,d,f){var _=i?i+l:l;if(!this._events[_])return this;if(!c)return o(this,_),this;var I=this._events[_];if(I.fn)I.fn===c&&(!f||I.once)&&(!d||I.context===d)&&o(this,_);else{for(var $=0,p=[],L=I.length;$<L;$++)(I[$].fn!==c||f&&!I[$].once||d&&I[$].context!==d)&&p.push(I[$]);p.length?this._events[_]=p.length===1?p[0]:p:o(this,_)}return this},u.prototype.removeAllListeners=function(l){var c;return l?(c=i?i+l:l,this._events[c]&&o(this,c)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=i,u.EventEmitter=u,typeof t<"u"&&(t.exports=u)});function bt(e){let t={exports:{}};return e(t,t.exports),t.exports}var Pt=Number.MAX_SAFE_INTEGER||9007199254740991,we={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Pt,MAX_SAFE_COMPONENT_LENGTH:16},kt=typeof dt=="object"&&Ee&&Ee.NODE_DEBUG&&/\bsemver\b/i.test(Ee.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},E=kt,ee=bt(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:r}=we,i=(t=e.exports={}).re=[],n=t.src=[],s=t.t={},a=0,o=(u,l,c)=>{let d=a++;E(d,l),s[u]=d,n[d]=l,i[d]=new RegExp(l,c?"g":void 0)};o("NUMERICIDENTIFIER","0|[1-9]\\d*"),o("NUMERICIDENTIFIERLOOSE","[0-9]+"),o("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),o("MAINVERSION",`(${n[s.NUMERICIDENTIFIER]})\\.(${n[s.NUMERICIDENTIFIER]})\\.(${n[s.NUMERICIDENTIFIER]})`),o("MAINVERSIONLOOSE",`(${n[s.NUMERICIDENTIFIERLOOSE]})\\.(${n[s.NUMERICIDENTIFIERLOOSE]})\\.(${n[s.NUMERICIDENTIFIERLOOSE]})`),o("PRERELEASEIDENTIFIER",`(?:${n[s.NUMERICIDENTIFIER]}|${n[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASEIDENTIFIERLOOSE",`(?:${n[s.NUMERICIDENTIFIERLOOSE]}|${n[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASE",`(?:-(${n[s.PRERELEASEIDENTIFIER]}(?:\\.${n[s.PRERELEASEIDENTIFIER]})*))`),o("PRERELEASELOOSE",`(?:-?(${n[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${n[s.PRERELEASEIDENTIFIERLOOSE]})*))`),o("BUILDIDENTIFIER","[0-9A-Za-z-]+"),o("BUILD",`(?:\\+(${n[s.BUILDIDENTIFIER]}(?:\\.${n[s.BUILDIDENTIFIER]})*))`),o("FULLPLAIN",`v?${n[s.MAINVERSION]}${n[s.PRERELEASE]}?${n[s.BUILD]}?`),o("FULL",`^${n[s.FULLPLAIN]}$`),o("LOOSEPLAIN",`[v=\\s]*${n[s.MAINVERSIONLOOSE]}${n[s.PRERELEASELOOSE]}?${n[s.BUILD]}?`),o("LOOSE",`^${n[s.LOOSEPLAIN]}$`),o("GTLT","((?:<|>)?=?)"),o("XRANGEIDENTIFIERLOOSE",`${n[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),o("XRANGEIDENTIFIER",`${n[s.NUMERICIDENTIFIER]}|x|X|\\*`),o("XRANGEPLAIN",`[v=\\s]*(${n[s.XRANGEIDENTIFIER]})(?:\\.(${n[s.XRANGEIDENTIFIER]})(?:\\.(${n[s.XRANGEIDENTIFIER]})(?:${n[s.PRERELEASE]})?${n[s.BUILD]}?)?)?`),o("XRANGEPLAINLOOSE",`[v=\\s]*(${n[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[s.XRANGEIDENTIFIERLOOSE]})(?:${n[s.PRERELEASELOOSE]})?${n[s.BUILD]}?)?)?`),o("XRANGE",`^${n[s.GTLT]}\\s*${n[s.XRANGEPLAIN]}$`),o("XRANGELOOSE",`^${n[s.GTLT]}\\s*${n[s.XRANGEPLAINLOOSE]}$`),o("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),o("COERCERTL",n[s.COERCE],!0),o("LONETILDE","(?:~>?)"),o("TILDETRIM",`(\\s*)${n[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",o("TILDE",`^${n[s.LONETILDE]}${n[s.XRANGEPLAIN]}$`),o("TILDELOOSE",`^${n[s.LONETILDE]}${n[s.XRANGEPLAINLOOSE]}$`),o("LONECARET","(?:\\^)"),o("CARETTRIM",`(\\s*)${n[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",o("CARET",`^${n[s.LONECARET]}${n[s.XRANGEPLAIN]}$`),o("CARETLOOSE",`^${n[s.LONECARET]}${n[s.XRANGEPLAINLOOSE]}$`),o("COMPARATORLOOSE",`^${n[s.GTLT]}\\s*(${n[s.LOOSEPLAIN]})$|^$`),o("COMPARATOR",`^${n[s.GTLT]}\\s*(${n[s.FULLPLAIN]})$|^$`),o("COMPARATORTRIM",`(\\s*)${n[s.GTLT]}\\s*(${n[s.LOOSEPLAIN]}|${n[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",o("HYPHENRANGE",`^\\s*(${n[s.XRANGEPLAIN]})\\s+-\\s+(${n[s.XRANGEPLAIN]})\\s*$`),o("HYPHENRANGELOOSE",`^\\s*(${n[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${n[s.XRANGEPLAINLOOSE]})\\s*$`),o("STAR","(<|>)?=?\\s*\\*"),o("GTE0","^\\s*>=\\s*0.0.0\\s*$"),o("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),Se=/^[0-9]+$/,Be=(e,t)=>{let r=Se.test(e),i=Se.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},Ut=(e,t)=>Be(t,e),Dt={compareIdentifiers:Be,rcompareIdentifiers:Ut},{MAX_LENGTH:Ce,MAX_SAFE_INTEGER:re}=we,{re:be,t:Pe}=ee,{compareIdentifiers:H}=Dt,w=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof w){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>Ce)throw new TypeError(`version is longer than ${Ce} characters`);E("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?be[Pe.LOOSE]:be[Pe.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>re||this.major<0)throw new TypeError("Invalid major version");if(this.minor>re||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>re||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let n=+i;if(n>=0&&n<re)return n}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(E("SemVer.compare",this.version,this.options,e),!(e instanceof w)){if(typeof e=="string"&&e===this.version)return 0;e=new w(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof w||(e=new w(e,this.options)),H(this.major,e.major)||H(this.minor,e.minor)||H(this.patch,e.patch)}comparePre(e){if(e instanceof w||(e=new w(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(E("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return H(r,i)}while(++t)}compareBuild(e){e instanceof w||(e=new w(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(E("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return H(r,i)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},Gt=(e,t,r)=>new w(e,r).compare(new w(t,r)),q=Gt,xt=(e,t,r)=>q(e,t,r)===0,Ft=xt,Wt=(e,t,r)=>q(e,t,r)!==0,jt=Wt,qt=(e,t,r)=>q(e,t,r)>0,Vt=qt,Ht=(e,t,r)=>q(e,t,r)>=0,Bt=Ht,Xt=(e,t,r)=>q(e,t,r)<0,Kt=Xt,Yt=(e,t,r)=>q(e,t,r)<=0,zt=Yt,Jt=(e,t,r,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Ft(e,r,i);case"!=":return jt(e,r,i);case">":return Vt(e,r,i);case">=":return Bt(e,r,i);case"<":return Kt(e,r,i);case"<=":return zt(e,r,i);default:throw new TypeError(`Invalid operator: ${t}`)}},fe=Jt,B=Symbol("SemVer ANY"),Q=class{static get ANY(){return B}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Q){if(e.loose===!!t.loose)return e;e=e.value}E("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===B?this.value="":this.value=this.operator+this.semver.version,E("comp",this)}parse(e){let t=this.options.loose?ke[Ue.COMPARATORLOOSE]:ke[Ue.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new w(r[2],this.options.loose):this.semver=B}toString(){return this.value}test(e){if(E("Comparator.test",e,this.options.loose),this.semver===B||e===B)return!0;if(typeof e=="string")try{e=new w(e,this.options)}catch{return!1}return fe(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Q))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new F(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new F(this.value,t).test(e.semver);let r=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),i=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),n=this.semver.version===e.semver.version,s=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),a=fe(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),o=fe(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return r||i||n&&s||a||o}},{re:ke,t:Ue}=ee,F=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof F)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new F(e.raw,t);if(e instanceof Q)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let r=t?N[R.HYPHENRANGELOOSE]:N[R.HYPHENRANGE];e=e.replace(r,ur(this.options.includePrerelease)),E("hyphen replace",e),e=e.replace(N[R.COMPARATORTRIM],Qt),E("comparator trim",e,N[R.COMPARATORTRIM]),e=(e=(e=e.replace(N[R.TILDETRIM],Zt)).replace(N[R.CARETTRIM],er)).split(/\s+/).join(" ");let i=t?N[R.COMPARATORLOOSE]:N[R.COMPARATOR];return e.split(" ").map(n=>tr(n,this.options)).join(" ").split(/\s+/).map(n=>cr(n,this.options)).filter(this.options.loose?n=>!!n.match(i):()=>!0).map(n=>new Q(n,this.options))}intersects(e,t){if(!(e instanceof F))throw new TypeError("a Range is required");return this.set.some(r=>De(r,t)&&e.set.some(i=>De(i,t)&&r.every(n=>i.every(s=>n.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new w(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(dr(this.set[t],e,this.options))return!0;return!1}},{re:N,t:R,comparatorTrimReplace:Qt,tildeTrimReplace:Zt,caretTrimReplace:er}=ee,De=(e,t)=>{let r=!0,i=e.slice(),n=i.pop();for(;r&&i.length;)r=i.every(s=>n.intersects(s,t)),n=i.pop();return r},tr=(e,t)=>(E("comp",e,t),e=nr(e,t),E("caret",e),e=rr(e,t),E("tildes",e),e=or(e,t),E("xrange",e),e=lr(e,t),E("stars",e),e),A=e=>!e||e.toLowerCase()==="x"||e==="*",rr=(e,t)=>e.trim().split(/\s+/).map(r=>ir(r,t)).join(" "),ir=(e,t)=>{let r=t.loose?N[R.TILDELOOSE]:N[R.TILDE];return e.replace(r,(i,n,s,a,o)=>{let u;return E("tilde",e,i,n,s,a,o),A(n)?u="":A(s)?u=`>=${n}.0.0 <${+n+1}.0.0-0`:A(a)?u=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:o?(E("replaceTilde pr",o),u=`>=${n}.${s}.${a}-${o} <${n}.${+s+1}.0-0`):u=`>=${n}.${s}.${a} <${n}.${+s+1}.0-0`,E("tilde return",u),u})},nr=(e,t)=>e.trim().split(/\s+/).map(r=>sr(r,t)).join(" "),sr=(e,t)=>{E("caret",e,t);let r=t.loose?N[R.CARETLOOSE]:N[R.CARET],i=t.includePrerelease?"-0":"";return e.replace(r,(n,s,a,o,u)=>{let l;return E("caret",e,n,s,a,o,u),A(s)?l="":A(a)?l=`>=${s}.0.0${i} <${+s+1}.0.0-0`:A(o)?l=s==="0"?`>=${s}.${a}.0${i} <${s}.${+a+1}.0-0`:`>=${s}.${a}.0${i} <${+s+1}.0.0-0`:u?(E("replaceCaret pr",u),l=s==="0"?a==="0"?`>=${s}.${a}.${o}-${u} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}-${u} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o}-${u} <${+s+1}.0.0-0`):(E("no pr"),l=s==="0"?a==="0"?`>=${s}.${a}.${o}${i} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}${i} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o} <${+s+1}.0.0-0`),E("caret return",l),l})},or=(e,t)=>(E("replaceXRanges",e,t),e.split(/\s+/).map(r=>ar(r,t)).join(" ")),ar=(e,t)=>{e=e.trim();let r=t.loose?N[R.XRANGELOOSE]:N[R.XRANGE];return e.replace(r,(i,n,s,a,o,u)=>{E("xRange",e,i,n,s,a,o,u);let l=A(s),c=l||A(a),d=c||A(o),f=d;return n==="="&&f&&(n=""),u=t.includePrerelease?"-0":"",l?i=n===">"||n==="<"?"<0.0.0-0":"*":n&&f?(c&&(a=0),o=0,n===">"?(n=">=",c?(s=+s+1,a=0,o=0):(a=+a+1,o=0)):n==="<="&&(n="<",c?s=+s+1:a=+a+1),n==="<"&&(u="-0"),i=`${n+s}.${a}.${o}${u}`):c?i=`>=${s}.0.0${u} <${+s+1}.0.0-0`:d&&(i=`>=${s}.${a}.0${u} <${s}.${+a+1}.0-0`),E("xRange return",i),i})},lr=(e,t)=>(E("replaceStars",e,t),e.trim().replace(N[R.STAR],"")),cr=(e,t)=>(E("replaceGTE0",e,t),e.trim().replace(N[t.includePrerelease?R.GTE0PRE:R.GTE0],"")),ur=e=>(t,r,i,n,s,a,o,u,l,c,d,f,_)=>`${r=A(i)?"":A(n)?`>=${i}.0.0${e?"-0":""}`:A(s)?`>=${i}.${n}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`} ${u=A(l)?"":A(c)?`<${+l+1}.0.0-0`:A(d)?`<${l}.${+c+1}.0-0`:f?`<=${l}.${c}.${d}-${f}`:e?`<${l}.${c}.${+d+1}-0`:`<=${u}`}`.trim(),dr=(e,t,r)=>{for(let i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let i=0;i<e.length;i++)if(E(e[i].semver),e[i].semver!==Q.ANY&&e[i].semver.prerelease.length>0){let n=e[i].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0},hr=(e,t,r)=>{try{t=new F(t,r)}catch{return!1}return t.test(e)},{MAX_LENGTH:pr}=we,{re:Ge,t:xe}=ee,mr=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof w)return e;if(typeof e!="string"||e.length>pr||!(t.loose?Ge[xe.LOOSE]:Ge[xe.FULL]).test(e))return null;try{return new w(e,t)}catch{return null}},Er=mr,{re:ie,t:ne}=ee,fr=(e,t)=>{if(e instanceof w)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let r=null;if((t=t||{}).rtl){let i;for(;(i=ie[ne.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&i.index+i[0].length===r.index+r[0].length||(r=i),ie[ne.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;ie[ne.COERCERTL].lastIndex=-1}else r=e.match(ie[ne.COERCE]);return r===null?null:Er(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function gr(e){return String.fromCharCode(parseInt(e.slice(1),16))}function _r(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function vr(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,gr))}function Ir(e){return decodeURIComponent(Array.from(atob(e),_r).join(""))}function Xe(e){return vr(JSON.stringify(e))}function yr(e){return JSON.parse(Ir(e))}function K(e){return typeof e>"u"}function wr(e){return e===null}function Ke(e){return wr(e)||K(e)}function Rr(e){return Ke(e)?!1:!K(e.jsonrpc)&&!K(e.id)&&(!K(e.result)||!K(e.error))}function $r(e){return Ke(e)?!1:typeof e=="number"&&Object.values(ve).includes(e)}function ue(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var g={};function Ii(e,t){return Object.assign(g,t),e}var Nr={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},D=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,D.prototype)}},de=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(e==null?void 0:e.code);this.rawMessage=(e==null?void 0:e.message)||"Internal error",this.code=$r(t)?t:ve.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(e==null?void 0:e.data)||void 0,Object.setPrototypeOf(this,de.prototype)}},te=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},Ye=class extends Error{constructor(e,t,r,i){super(`Magic Extension Error (${e.name}): [${t}] ${r}`),this.code=t,this.rawMessage=r,this.data=i,this.__proto__=Error,Object.setPrototypeOf(this,Ye.prototype)}},Fe=class{constructor(e,t,r){this.code=t,this.rawMessage=r,this.message=`Magic Extension Warning (${e.name}): [${t}] ${r}`}log(){console.warn(this.message)}};function Ar(){return new D(U.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function Or(){return new D(U.ModalNotReady,"Modal is not ready.")}function Mr(){return new D(U.MalformedResponse,"Response from the Magic iframe is malformed.")}function Tr(e){return new D(U.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function Lr(e){let t=`Some extensions are incompatible with \`${g.sdkName}@${g.version}\`:`;return e.filter(r=>typeof r.compat<"u"&&r.compat!==null).forEach(r=>{let i=r.compat[g.sdkName];typeof i=="string"?t+=`
1
+ import{p as dt}from"./index-ZuMScRBF.js";var U=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(U||{}),j=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e.ProductAnnouncement="ANNOUNCEMENT",e))(j||{}),ve=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e[e.RedirectLoginComplete=-10015]="RedirectLoginComplete",e))(ve||{}),M=(e=>(e.MetaMask="metamask",e.CoinbaseWallet="coinbase_wallet",e))(M||{}),ae=(e=>(e.WalletSelected="wallet_selected",e.WalletConnected="wallet_connected",e.WalletRejected="wallet_rejected",e))(ae||{}),h=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.SetAuthorizationToken="magic_auth_set_authorization_token",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="magic_get_info",e.ShowUI="magic_wallet",e.NFTPurchase="magic_nft_purchase",e.NFTCheckout="magic_nft_checkout",e.NFTTransfer="magic_nft_transfer",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e.MagicBoxHeartBeat="magic_box_heart_beat",e.AutoConnect="mc_auto_connect",e.Login="mc_login",e.EncryptV1="magic_auth_encrypt_v1",e.DecryptV1="magic_auth_decrypt_v1",e.ShowNFTs="magic_show_nfts",e.ShowOnRamp="magic_show_fiat_onramp",e.ShowSendTokensUI="magic_show_send_tokens_ui",e.ShowAddress="magic_show_address",e.ShowBalances="magic_show_balances",e.SendGaslessTransaction="eth_sendGaslessTransaction",e))(h||{}),k=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",e.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",e))(k||{}),ce=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(ce||{}),ht=(e=>(e.UpdateEmail="update-email",e.MFA="mfa",e.Recovery="recovery",e))(ht||{}),pt=(e=>(e.Retry="retry",e))(pt||{}),mt=(e=>(e.EmailSent="email-sent",e.EmailNotDeliverable="email-not-deliverable",e))(mt||{}),X=(e=>(e.VerifyEmailOtp="verify-email-otp",e.Cancel="cancel",e))(X||{}),Et=(e=>(e.EmailOTPSent="email-otp-sent",e.InvalidEmailOtp="invalid-email-otp",e.ExpiredEmailOtp="expired-email-otp",e))(Et||{}),ge=(e=>(e.Retry="device-retry",e))(ge||{}),ft=(e=>(e.DeviceApproved="device-approved",e.DeviceNeedsApproval="device-needs-approval",e.DeviceVerificationLinkExpired="device-verification-link-expired",e.DeviceVerificationEmailSent="device-verification-email-sent",e))(ft||{}),C=(e=>(e.Retry="Recency/auth-factor-retry",e.Cancel="Recency/auth-factor-verification-cancel",e.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",e))(C||{}),gt=(e=>(e.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",e.PrimaryAuthFactorVerified="Recency/auth-factor-verified",e.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",e.EmailExpired="Recency/auth-factor-verification-email-expired",e.EmailSent="Recency/auth-factor-verification-email-sent",e.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",e))(gt||{}),P=(e=>(e.RetryWithNewEmail="UpdateEmail/retry-with-new-email",e.Cancel="UpdateEmail/new-email-verification-cancel",e.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",e))(P||{}),_t=(e=>(e.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",e.EmailUpdated="UpdateEmail/email-updated",e.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",e.EmailExpired="UpdateEmail/new-email-verification-email-expired",e.EmailSent="UpdateEmail/new-email-verification-email-sent",e.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",e.InvalidEmail="UpdateEmail/new-email-invalid",e.EmailAlreadyExists="UpdateEmail/new-email-already-exists",e))(_t||{}),vt=(e=>(e.Harmony="HARMONY",e))(vt||{}),It=(e=>(e.PhoneNumber="phone_number",e))(It||{}),Ee={VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.9.2-16202422627.commit-2162b6e"},yt=Object.create,pe=Object.defineProperty,wt=Object.defineProperties,Rt=Object.getOwnPropertyDescriptor,$t=Object.getOwnPropertyDescriptors,Nt=Object.getOwnPropertyNames,Te=Object.getOwnPropertySymbols,At=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable,Le=(e,t,r)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ie=(e,t)=>{for(var r in t||(t={}))He.call(t,r)&&Le(e,r,t[r]);if(Te)for(var r of Te(t))Ot.call(t,r)&&Le(e,r,t[r]);return e},ye=(e,t)=>wt(e,$t(t)),Mt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Tt=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},Lt=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Nt(t))!He.call(e,n)&&n!==r&&pe(e,n,{get:()=>t[n],enumerable:!(i=Rt(t,n))||i.enumerable});return e},St=(e,t,r)=>(r=e!=null?yt(At(e)):{},Lt(!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),v=(e,t,r)=>new Promise((i,n)=>{var s=u=>{try{o(r.next(u))}catch(l){n(l)}},a=u=>{try{o(r.throw(u))}catch(l){n(l)}},o=u=>u.done?i(u.value):Promise.resolve(u.value).then(s,a);o((r=r.apply(e,t)).next())}),bt=Mt((e,t)=>{var r=Object.prototype.hasOwnProperty,i="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(i=!1));function s(l,c,d){this.fn=l,this.context=c,this.once=d||!1}function a(l,c,d,f,_){if(typeof d!="function")throw new TypeError("The listener must be a function");var I=new s(d,f||l,_),$=i?i+c:c;return l._events[$]?l._events[$].fn?l._events[$]=[l._events[$],I]:l._events[$].push(I):(l._events[$]=I,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var l=[],c,d;if(this._eventsCount===0)return l;for(d in c=this._events)r.call(c,d)&&l.push(i?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},u.prototype.listeners=function(l){var c=i?i+l:l,d=this._events[c];if(!d)return[];if(d.fn)return[d.fn];for(var f=0,_=d.length,I=new Array(_);f<_;f++)I[f]=d[f].fn;return I},u.prototype.listenerCount=function(l){var c=i?i+l:l,d=this._events[c];return d?d.fn?1:d.length:0},u.prototype.emit=function(l,c,d,f,_,I){var $=i?i+l:l;if(!this._events[$])return!1;var p=this._events[$],L=arguments.length,b,y;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),L){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,d),!0;case 4:return p.fn.call(p.context,c,d,f),!0;case 5:return p.fn.call(p.context,c,d,f,_),!0;case 6:return p.fn.call(p.context,c,d,f,_,I),!0}for(y=1,b=new Array(L-1);y<L;y++)b[y-1]=arguments[y];p.fn.apply(p.context,b)}else{var ut=p.length,V;for(y=0;y<ut;y++)switch(p[y].once&&this.removeListener(l,p[y].fn,void 0,!0),L){case 1:p[y].fn.call(p[y].context);break;case 2:p[y].fn.call(p[y].context,c);break;case 3:p[y].fn.call(p[y].context,c,d);break;case 4:p[y].fn.call(p[y].context,c,d,f);break;default:if(!b)for(V=1,b=new Array(L-1);V<L;V++)b[V-1]=arguments[V];p[y].fn.apply(p[y].context,b)}}return!0},u.prototype.on=function(l,c,d){return a(this,l,c,d,!1)},u.prototype.once=function(l,c,d){return a(this,l,c,d,!0)},u.prototype.removeListener=function(l,c,d,f){var _=i?i+l:l;if(!this._events[_])return this;if(!c)return o(this,_),this;var I=this._events[_];if(I.fn)I.fn===c&&(!f||I.once)&&(!d||I.context===d)&&o(this,_);else{for(var $=0,p=[],L=I.length;$<L;$++)(I[$].fn!==c||f&&!I[$].once||d&&I[$].context!==d)&&p.push(I[$]);p.length?this._events[_]=p.length===1?p[0]:p:o(this,_)}return this},u.prototype.removeAllListeners=function(l){var c;return l?(c=i?i+l:l,this._events[c]&&o(this,c)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=i,u.EventEmitter=u,typeof t<"u"&&(t.exports=u)});function Ct(e){let t={exports:{}};return e(t,t.exports),t.exports}var Pt=Number.MAX_SAFE_INTEGER||9007199254740991,we={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Pt,MAX_SAFE_COMPONENT_LENGTH:16},kt=typeof dt=="object"&&Ee&&Ee.NODE_DEBUG&&/\bsemver\b/i.test(Ee.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},E=kt,ee=Ct(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:r}=we,i=(t=e.exports={}).re=[],n=t.src=[],s=t.t={},a=0,o=(u,l,c)=>{let d=a++;E(d,l),s[u]=d,n[d]=l,i[d]=new RegExp(l,c?"g":void 0)};o("NUMERICIDENTIFIER","0|[1-9]\\d*"),o("NUMERICIDENTIFIERLOOSE","[0-9]+"),o("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),o("MAINVERSION",`(${n[s.NUMERICIDENTIFIER]})\\.(${n[s.NUMERICIDENTIFIER]})\\.(${n[s.NUMERICIDENTIFIER]})`),o("MAINVERSIONLOOSE",`(${n[s.NUMERICIDENTIFIERLOOSE]})\\.(${n[s.NUMERICIDENTIFIERLOOSE]})\\.(${n[s.NUMERICIDENTIFIERLOOSE]})`),o("PRERELEASEIDENTIFIER",`(?:${n[s.NUMERICIDENTIFIER]}|${n[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASEIDENTIFIERLOOSE",`(?:${n[s.NUMERICIDENTIFIERLOOSE]}|${n[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASE",`(?:-(${n[s.PRERELEASEIDENTIFIER]}(?:\\.${n[s.PRERELEASEIDENTIFIER]})*))`),o("PRERELEASELOOSE",`(?:-?(${n[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${n[s.PRERELEASEIDENTIFIERLOOSE]})*))`),o("BUILDIDENTIFIER","[0-9A-Za-z-]+"),o("BUILD",`(?:\\+(${n[s.BUILDIDENTIFIER]}(?:\\.${n[s.BUILDIDENTIFIER]})*))`),o("FULLPLAIN",`v?${n[s.MAINVERSION]}${n[s.PRERELEASE]}?${n[s.BUILD]}?`),o("FULL",`^${n[s.FULLPLAIN]}$`),o("LOOSEPLAIN",`[v=\\s]*${n[s.MAINVERSIONLOOSE]}${n[s.PRERELEASELOOSE]}?${n[s.BUILD]}?`),o("LOOSE",`^${n[s.LOOSEPLAIN]}$`),o("GTLT","((?:<|>)?=?)"),o("XRANGEIDENTIFIERLOOSE",`${n[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),o("XRANGEIDENTIFIER",`${n[s.NUMERICIDENTIFIER]}|x|X|\\*`),o("XRANGEPLAIN",`[v=\\s]*(${n[s.XRANGEIDENTIFIER]})(?:\\.(${n[s.XRANGEIDENTIFIER]})(?:\\.(${n[s.XRANGEIDENTIFIER]})(?:${n[s.PRERELEASE]})?${n[s.BUILD]}?)?)?`),o("XRANGEPLAINLOOSE",`[v=\\s]*(${n[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[s.XRANGEIDENTIFIERLOOSE]})(?:${n[s.PRERELEASELOOSE]})?${n[s.BUILD]}?)?)?`),o("XRANGE",`^${n[s.GTLT]}\\s*${n[s.XRANGEPLAIN]}$`),o("XRANGELOOSE",`^${n[s.GTLT]}\\s*${n[s.XRANGEPLAINLOOSE]}$`),o("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),o("COERCERTL",n[s.COERCE],!0),o("LONETILDE","(?:~>?)"),o("TILDETRIM",`(\\s*)${n[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",o("TILDE",`^${n[s.LONETILDE]}${n[s.XRANGEPLAIN]}$`),o("TILDELOOSE",`^${n[s.LONETILDE]}${n[s.XRANGEPLAINLOOSE]}$`),o("LONECARET","(?:\\^)"),o("CARETTRIM",`(\\s*)${n[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",o("CARET",`^${n[s.LONECARET]}${n[s.XRANGEPLAIN]}$`),o("CARETLOOSE",`^${n[s.LONECARET]}${n[s.XRANGEPLAINLOOSE]}$`),o("COMPARATORLOOSE",`^${n[s.GTLT]}\\s*(${n[s.LOOSEPLAIN]})$|^$`),o("COMPARATOR",`^${n[s.GTLT]}\\s*(${n[s.FULLPLAIN]})$|^$`),o("COMPARATORTRIM",`(\\s*)${n[s.GTLT]}\\s*(${n[s.LOOSEPLAIN]}|${n[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",o("HYPHENRANGE",`^\\s*(${n[s.XRANGEPLAIN]})\\s+-\\s+(${n[s.XRANGEPLAIN]})\\s*$`),o("HYPHENRANGELOOSE",`^\\s*(${n[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${n[s.XRANGEPLAINLOOSE]})\\s*$`),o("STAR","(<|>)?=?\\s*\\*"),o("GTE0","^\\s*>=\\s*0.0.0\\s*$"),o("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),Se=/^[0-9]+$/,Be=(e,t)=>{let r=Se.test(e),i=Se.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},Ut=(e,t)=>Be(t,e),Dt={compareIdentifiers:Be,rcompareIdentifiers:Ut},{MAX_LENGTH:be,MAX_SAFE_INTEGER:re}=we,{re:Ce,t:Pe}=ee,{compareIdentifiers:H}=Dt,w=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof w){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>be)throw new TypeError(`version is longer than ${be} characters`);E("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Ce[Pe.LOOSE]:Ce[Pe.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>re||this.major<0)throw new TypeError("Invalid major version");if(this.minor>re||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>re||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let n=+i;if(n>=0&&n<re)return n}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(E("SemVer.compare",this.version,this.options,e),!(e instanceof w)){if(typeof e=="string"&&e===this.version)return 0;e=new w(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof w||(e=new w(e,this.options)),H(this.major,e.major)||H(this.minor,e.minor)||H(this.patch,e.patch)}comparePre(e){if(e instanceof w||(e=new w(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(E("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return H(r,i)}while(++t)}compareBuild(e){e instanceof w||(e=new w(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(E("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return H(r,i)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},Gt=(e,t,r)=>new w(e,r).compare(new w(t,r)),q=Gt,xt=(e,t,r)=>q(e,t,r)===0,Ft=xt,Wt=(e,t,r)=>q(e,t,r)!==0,jt=Wt,qt=(e,t,r)=>q(e,t,r)>0,Vt=qt,Ht=(e,t,r)=>q(e,t,r)>=0,Bt=Ht,Xt=(e,t,r)=>q(e,t,r)<0,Kt=Xt,Yt=(e,t,r)=>q(e,t,r)<=0,zt=Yt,Jt=(e,t,r,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Ft(e,r,i);case"!=":return jt(e,r,i);case">":return Vt(e,r,i);case">=":return Bt(e,r,i);case"<":return Kt(e,r,i);case"<=":return zt(e,r,i);default:throw new TypeError(`Invalid operator: ${t}`)}},fe=Jt,B=Symbol("SemVer ANY"),Q=class{static get ANY(){return B}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Q){if(e.loose===!!t.loose)return e;e=e.value}E("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===B?this.value="":this.value=this.operator+this.semver.version,E("comp",this)}parse(e){let t=this.options.loose?ke[Ue.COMPARATORLOOSE]:ke[Ue.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new w(r[2],this.options.loose):this.semver=B}toString(){return this.value}test(e){if(E("Comparator.test",e,this.options.loose),this.semver===B||e===B)return!0;if(typeof e=="string")try{e=new w(e,this.options)}catch{return!1}return fe(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Q))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new F(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new F(this.value,t).test(e.semver);let r=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),i=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),n=this.semver.version===e.semver.version,s=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),a=fe(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),o=fe(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return r||i||n&&s||a||o}},{re:ke,t:Ue}=ee,F=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof F)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new F(e.raw,t);if(e instanceof Q)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let r=t?N[R.HYPHENRANGELOOSE]:N[R.HYPHENRANGE];e=e.replace(r,ur(this.options.includePrerelease)),E("hyphen replace",e),e=e.replace(N[R.COMPARATORTRIM],Qt),E("comparator trim",e,N[R.COMPARATORTRIM]),e=(e=(e=e.replace(N[R.TILDETRIM],Zt)).replace(N[R.CARETTRIM],er)).split(/\s+/).join(" ");let i=t?N[R.COMPARATORLOOSE]:N[R.COMPARATOR];return e.split(" ").map(n=>tr(n,this.options)).join(" ").split(/\s+/).map(n=>cr(n,this.options)).filter(this.options.loose?n=>!!n.match(i):()=>!0).map(n=>new Q(n,this.options))}intersects(e,t){if(!(e instanceof F))throw new TypeError("a Range is required");return this.set.some(r=>De(r,t)&&e.set.some(i=>De(i,t)&&r.every(n=>i.every(s=>n.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new w(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(dr(this.set[t],e,this.options))return!0;return!1}},{re:N,t:R,comparatorTrimReplace:Qt,tildeTrimReplace:Zt,caretTrimReplace:er}=ee,De=(e,t)=>{let r=!0,i=e.slice(),n=i.pop();for(;r&&i.length;)r=i.every(s=>n.intersects(s,t)),n=i.pop();return r},tr=(e,t)=>(E("comp",e,t),e=nr(e,t),E("caret",e),e=rr(e,t),E("tildes",e),e=or(e,t),E("xrange",e),e=lr(e,t),E("stars",e),e),A=e=>!e||e.toLowerCase()==="x"||e==="*",rr=(e,t)=>e.trim().split(/\s+/).map(r=>ir(r,t)).join(" "),ir=(e,t)=>{let r=t.loose?N[R.TILDELOOSE]:N[R.TILDE];return e.replace(r,(i,n,s,a,o)=>{let u;return E("tilde",e,i,n,s,a,o),A(n)?u="":A(s)?u=`>=${n}.0.0 <${+n+1}.0.0-0`:A(a)?u=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:o?(E("replaceTilde pr",o),u=`>=${n}.${s}.${a}-${o} <${n}.${+s+1}.0-0`):u=`>=${n}.${s}.${a} <${n}.${+s+1}.0-0`,E("tilde return",u),u})},nr=(e,t)=>e.trim().split(/\s+/).map(r=>sr(r,t)).join(" "),sr=(e,t)=>{E("caret",e,t);let r=t.loose?N[R.CARETLOOSE]:N[R.CARET],i=t.includePrerelease?"-0":"";return e.replace(r,(n,s,a,o,u)=>{let l;return E("caret",e,n,s,a,o,u),A(s)?l="":A(a)?l=`>=${s}.0.0${i} <${+s+1}.0.0-0`:A(o)?l=s==="0"?`>=${s}.${a}.0${i} <${s}.${+a+1}.0-0`:`>=${s}.${a}.0${i} <${+s+1}.0.0-0`:u?(E("replaceCaret pr",u),l=s==="0"?a==="0"?`>=${s}.${a}.${o}-${u} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}-${u} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o}-${u} <${+s+1}.0.0-0`):(E("no pr"),l=s==="0"?a==="0"?`>=${s}.${a}.${o}${i} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}${i} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o} <${+s+1}.0.0-0`),E("caret return",l),l})},or=(e,t)=>(E("replaceXRanges",e,t),e.split(/\s+/).map(r=>ar(r,t)).join(" ")),ar=(e,t)=>{e=e.trim();let r=t.loose?N[R.XRANGELOOSE]:N[R.XRANGE];return e.replace(r,(i,n,s,a,o,u)=>{E("xRange",e,i,n,s,a,o,u);let l=A(s),c=l||A(a),d=c||A(o),f=d;return n==="="&&f&&(n=""),u=t.includePrerelease?"-0":"",l?i=n===">"||n==="<"?"<0.0.0-0":"*":n&&f?(c&&(a=0),o=0,n===">"?(n=">=",c?(s=+s+1,a=0,o=0):(a=+a+1,o=0)):n==="<="&&(n="<",c?s=+s+1:a=+a+1),n==="<"&&(u="-0"),i=`${n+s}.${a}.${o}${u}`):c?i=`>=${s}.0.0${u} <${+s+1}.0.0-0`:d&&(i=`>=${s}.${a}.0${u} <${s}.${+a+1}.0-0`),E("xRange return",i),i})},lr=(e,t)=>(E("replaceStars",e,t),e.trim().replace(N[R.STAR],"")),cr=(e,t)=>(E("replaceGTE0",e,t),e.trim().replace(N[t.includePrerelease?R.GTE0PRE:R.GTE0],"")),ur=e=>(t,r,i,n,s,a,o,u,l,c,d,f,_)=>`${r=A(i)?"":A(n)?`>=${i}.0.0${e?"-0":""}`:A(s)?`>=${i}.${n}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`} ${u=A(l)?"":A(c)?`<${+l+1}.0.0-0`:A(d)?`<${l}.${+c+1}.0-0`:f?`<=${l}.${c}.${d}-${f}`:e?`<${l}.${c}.${+d+1}-0`:`<=${u}`}`.trim(),dr=(e,t,r)=>{for(let i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let i=0;i<e.length;i++)if(E(e[i].semver),e[i].semver!==Q.ANY&&e[i].semver.prerelease.length>0){let n=e[i].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0},hr=(e,t,r)=>{try{t=new F(t,r)}catch{return!1}return t.test(e)},{MAX_LENGTH:pr}=we,{re:Ge,t:xe}=ee,mr=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof w)return e;if(typeof e!="string"||e.length>pr||!(t.loose?Ge[xe.LOOSE]:Ge[xe.FULL]).test(e))return null;try{return new w(e,t)}catch{return null}},Er=mr,{re:ie,t:ne}=ee,fr=(e,t)=>{if(e instanceof w)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let r=null;if((t=t||{}).rtl){let i;for(;(i=ie[ne.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&i.index+i[0].length===r.index+r[0].length||(r=i),ie[ne.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;ie[ne.COERCERTL].lastIndex=-1}else r=e.match(ie[ne.COERCE]);return r===null?null:Er(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function gr(e){return String.fromCharCode(parseInt(e.slice(1),16))}function _r(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function vr(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,gr))}function Ir(e){return decodeURIComponent(Array.from(atob(e),_r).join(""))}function Xe(e){return vr(JSON.stringify(e))}function yr(e){return JSON.parse(Ir(e))}function K(e){return typeof e>"u"}function wr(e){return e===null}function Ke(e){return wr(e)||K(e)}function Rr(e){return Ke(e)?!1:!K(e.jsonrpc)&&!K(e.id)&&(!K(e.result)||!K(e.error))}function $r(e){return Ke(e)?!1:typeof e=="number"&&Object.values(ve).includes(e)}function ue(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var g={};function Ii(e,t){return Object.assign(g,t),e}var Nr={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},D=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,D.prototype)}},de=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(e==null?void 0:e.code);this.rawMessage=(e==null?void 0:e.message)||"Internal error",this.code=$r(t)?t:ve.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(e==null?void 0:e.data)||void 0,Object.setPrototypeOf(this,de.prototype)}},te=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},Ye=class extends Error{constructor(e,t,r,i){super(`Magic Extension Error (${e.name}): [${t}] ${r}`),this.code=t,this.rawMessage=r,this.data=i,this.__proto__=Error,Object.setPrototypeOf(this,Ye.prototype)}},Fe=class{constructor(e,t,r){this.code=t,this.rawMessage=r,this.message=`Magic Extension Warning (${e.name}): [${t}] ${r}`}log(){console.warn(this.message)}};function Ar(){return new D(U.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function Or(){return new D(U.ModalNotReady,"Modal is not ready.")}function Mr(){return new D(U.MalformedResponse,"Response from the Magic iframe is malformed.")}function Tr(e){return new D(U.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function Lr(e){let t=`Some extensions are incompatible with \`${g.sdkName}@${g.version}\`:`;return e.filter(r=>typeof r.compat<"u"&&r.compat!==null).forEach(r=>{let i=r.compat[g.sdkName];typeof i=="string"?t+=`
2
2
  - Extension \`${r.name}\` supports version(s) \`${i}\``:i||(t+=`
3
3
  - Extension \`${r.name}\` does not support ${g.platform} environments.`)}),new D(U.IncompatibleExtensions,t)}function Sr(e){let t=r=>{let i=r+1,n=i%10,s=i%100;return n===1&&s!==11?`${i}st`:n===2&&s!==12?`${i}nd`:n===3&&s!==13?`${i}rd`:`${i}th`};return new D(U.InvalidArgument,`Invalid ${t(e.argument)} argument given to \`${e.procedure}\`.
4
4
  Expected: \`${e.expected}\`
5
- Received: \`${e.received}\``)}function yi(){return new te(j.DuplicateIframe,"Duplicate iframes found.")}function Cr(){return new te(j.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function br(){return new te(j.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${g.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function Y(e){let{method:t,removalVersions:r,useInstead:i}=e,n=r[g.sdkName],s=i?` Use \`${i}\` instead.`:"",a=`\`${t}\` will be removed from \`${g.sdkName}\` in version \`${n}\`.${s}`;return new te(j.DeprecationNotice,a)}function*Pr(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}var kr=Pr();function ze(){return kr.next().value}var Je=Symbol("Payload pre-processed by Magic SDK");function Qe(e){return Object.defineProperty(e,Je,{value:!0,enumerable:!1}),e}function Ur(e){return!!e[Je]}function he(e){var t,r,i;return Ur(e)||(e.jsonrpc=(t=e.jsonrpc)!=null?t:"2.0",e.id=ze(),e.method=(r=e.method)!=null?r:"noop",e.params=(i=e.params)!=null?i:[],Qe(e)),e}function m(e,t=[]){return Qe({params:t,method:e,jsonrpc:"2.0",id:ze()})}var Re=class{constructor(e){e instanceof Re?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):Rr(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=void 0,this._error=void 0)}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return typeof this._error<"u"&&this._error!==null}get hasResult(){return typeof this._result<"u"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},Dr=St(Ct()),Gr=class extends Dr.default{};function Ze(){let e=new Gr;return{emitter:e,createChainingEmitterMethod:(t,r)=>(...i)=>(e[t].apply(e,i),r),createBoundEmitterMethod:t=>(...r)=>e[t].apply(e,r)}}var et=Symbol("isPromiEvent");function xr(e){return!!e[et]}function Z(e){let t=tt(e),{createBoundEmitterMethod:r,createChainingEmitterMethod:i}=Ze(),n=Symbol("Promise.then"),s=Symbol("Promise.catch"),a=Symbol("Promise.finally"),o=(c,d)=>(...f)=>{let _=d[c].apply(d,f);return u(_)},u=c=>Object.assign(c,{[et]:!0,[n]:c[n]||c.then,[s]:c[s]||c.catch,[a]:c[a]||c.finally,then:o(n,c),catch:o(s,c),finally:o(a,c),on:i("on",c),once:i("once",c),addListener:i("addListener",c),off:i("off",c),removeListener:i("removeListener",c),removeAllListeners:i("removeAllListeners",c),emit:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),l=u(t.then(c=>(l.emit("done",c),l.emit("settled"),c),c=>{throw l.emit("error",c),l.emit("settled"),c}));return l}function tt(e){return new Promise((t,r)=>{let i=e(t,r);Promise.resolve(i).catch(r)})}var G=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(ce.MAGIC_HANDLE_REQUEST,he(e)),r=Z((n,s)=>{t.then(a=>{if(i(),a.hasError)s(new de(a.payload.error));else if(a.hasResult)n(a.payload.result);else throw Mr()}).catch(a=>{i(),s(a)})}),i=this.overlay.on(k.MAGIC_HANDLE_EVENT,n=>{var s;let{response:a}=n.data;if(a.id===e.id&&((s=a.result)!=null&&s.event)){let{event:o,params:u=[]}=a.result;r.emit(o,...u)}});return r}createIntermediaryEvent(e,t){return r=>{let i=m(h.IntermediaryEvent,[{payloadId:t,eventType:e,args:r}]);this.request(i)}}};function Fr(e,t){let[r]=e.split(".").map(Number);return r>=t}var z={"magic-sdk":"v18.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v19.0.0","@magic-sdk/react-native-expo":"v19.0.0"},Wr=class extends G{loginWithMagicLink(e){let t=g.sdkName==="@magic-sdk/react-native"||g.sdkName==="@magic-sdk/react-native-bare"||g.sdkName==="@magic-sdk/react-native-expo";if(t&&Fr(g.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");t&&Y({method:"auth.loginWithMagicLink()",removalVersions:z,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:r,showUI:i=!0,redirectURI:n,overrides:s}=e,a=m(this.sdk.testMode?h.LoginWithMagicLinkTestMode:h.LoginWithMagicLink,[{email:r,showUI:i,redirectURI:n,overrides:s}]);return this.request(a)}loginWithSMS(e){let{phoneNumber:t}=e,r=m(this.sdk.testMode?h.LoginWithSmsTestMode:h.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(r)}loginWithEmailOTP(e){let{email:t,showUI:r,deviceCheckUI:i,overrides:n}=e,s=m(this.sdk.testMode?h.LoginWithEmailOTPTestMode:h.LoginWithEmailOTP,[{email:t,showUI:r,deviceCheckUI:i,overrides:n}]),a=this.request(s);return!i&&a&&a.on(ge.Retry,()=>{this.createIntermediaryEvent(ge.Retry,s.id)()}),!r&&a&&(a.on(X.VerifyEmailOtp,o=>{this.createIntermediaryEvent(X.VerifyEmailOtp,s.id)(o)}),a.on(X.Cancel,()=>{this.createIntermediaryEvent(X.Cancel,s.id)()})),a}loginWithCredential(e){let t=e??"";if(!e&&g.platform==="web"){t=window.location.search;let i=window.location.origin+window.location.pathname;window.history.replaceState(null,"",i)}let r=m(this.sdk.testMode?h.LoginWithCredentialTestMode:h.LoginWithCredential,[t]);return this.request(r)}setAuthorizationToken(e){let t=m(h.SetAuthorizationToken,[{jwt:e}]);return this.request(t)}updateEmailWithUI(e){let{email:t,showUI:r=!0}=e,i=m(this.sdk.testMode?h.UpdateEmailTestMode:h.UpdateEmail,[{email:t,showUI:r}]),n=this.request(i);return r||(n.on(b.Retry,()=>{this.createIntermediaryEvent(b.Retry,i.id)()}),n.on(b.Cancel,()=>{this.createIntermediaryEvent(b.Cancel,i.id)()}),n.on(b.VerifyEmailOtp,s=>{this.createIntermediaryEvent(b.VerifyEmailOtp,i.id)(s)}),n.on(P.RetryWithNewEmail,s=>{this.createIntermediaryEvent(P.RetryWithNewEmail,i.id)(s)}),n.on(P.Cancel,()=>{this.createIntermediaryEvent(P.Cancel,i.id)()}),n.on(P.VerifyEmailOtp,s=>{this.createIntermediaryEvent(P.VerifyEmailOtp,i.id)(s)})),n}},rt={};Tt(rt,{clear:()=>jr,getItem:()=>O,iterate:()=>it,key:()=>Vr,keys:()=>Hr,length:()=>qr,removeItem:()=>W,setItem:()=>T});var se;function S(e){return(...t)=>v(this,null,function*(){return se||(se=yield g.configureStorage()),yield se.ready(),se[e](...t)})}var O=S("getItem"),T=S("setItem"),W=S("removeItem"),jr=S("clear"),qr=S("length"),Vr=S("key"),Hr=S("keys"),it=S("iterate");function Br(){let e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&191|128;let t="";return t+=e[0].toString(16),t+=e[1].toString(16),t+=e[2].toString(16),t+=e[3].toString(16),t+="-",t+=e[4].toString(16),t+=e[5].toString(16),t+="-",t+=e[6].toString(16),t+=e[7].toString(16),t+="-",t+=e[8].toString(16),t+=e[9].toString(16),t+="-",t+=e[10].toString(16),t+=e[11].toString(16),t+=e[12].toString(16),t+=e[13].toString(16),t+=e[14].toString(16),t+=e[15].toString(16),t}var nt="STORE_KEY_PRIVATE_KEY",_e="STORE_KEY_PUBLIC_JWK",st="ECDSA",Xr="P-256",Kr={name:st,namedCurve:Xr};function me(){let e=typeof window<"u"&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}function Yr(){return v(this,null,function*(){let e=yield zr();if(!e){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:t}=window.crypto,r=yield O(nt);if(!r||!t){console.info("unable to find private key or webcrypto unsupported");return}let i={iat:Math.floor(new Date().getTime()/1e3),jti:Br()},n={typ:"dpop+jwt",alg:"ES256",jwk:e},s={protected:We(JSON.stringify(n)),claims:We(JSON.stringify(i))},a=Qr(`${s.protected}.${s.claims}`),o={name:st,hash:{name:"SHA-256"}},u=ei(new Uint8Array(yield t.sign(o,r,a)));return`${s.protected}.${s.claims}.${u}`})}function zr(){return v(this,null,function*(){if(!me()){console.info("webcrypto is not supported");return}return(yield O(_e))||(yield Jr()),O(_e)})}function Jr(){return v(this,null,function*(){let{subtle:e}=window.crypto,t=yield e.generateKey(Kr,!1,["sign"]),r=yield e.exportKey("jwk",t.publicKey);yield T(nt,t.privateKey),yield T(_e,r)})}function We(e){return ot(Zr(e))}function Qr(e){return new TextEncoder().encode(e)}function ot(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function Zr(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,r)=>String.fromCharCode(parseInt(r,16)))}function ei(e){let t="";return e.forEach(r=>{t+=String.fromCharCode(r)}),ot(t)}var $e="ds",Ne="ek",Ae="iv",Oe="AES-GCM",ti=256;function Me(){return v(this,null,function*(){let e=[];yield it((t,r,i)=>{r.startsWith(`${$e}_`)&&e.push(r)});for(let t of e)yield W(t)})}function at(e){let t="",r=new Uint8Array(e),i=r.byteLength;for(let n=0;n<i;n++)t+=String.fromCharCode(r[n]);return window.btoa(t)}function lt(e){let t=window.atob(e),r=t.length,i=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=t.charCodeAt(n);return i.buffer}function ri(){return v(this,null,function*(){if(!me()){console.info("webcrypto is not supported");return}let{crypto:e}=window;return(yield O(Ae))||e.getRandomValues(new Uint8Array(12))})}function ii(){return v(this,null,function*(){if(!me()){console.info("webcrypto is not supported");return}let{subtle:e}=window.crypto;return(yield O(Ne))||(yield e.generateKey({name:Oe,length:ti},!1,["encrypt","decrypt"]))})}function ni(e,t){return v(this,null,function*(){let r=yield ri(),i=yield ii();if(!r||!i||!e)return;let n=lt(e),{subtle:s}=window.crypto,a=yield s.encrypt({name:Oe,iv:r},i,n),o=at(a);yield T(`${$e}_${t}`,o),yield T(Ne,i),yield T(Ae,r)})}function si(e){return v(this,null,function*(){let t=yield O(`${$e}_${e}`),r=yield O(Ae),i=yield O(Ne);if(!r||!t||!i||!me())return;let{subtle:n}=window.crypto,s=yield n.decrypt({name:Oe,iv:r},i,lt(t));return at(s)})}function je(e,t){return t?new URL(e,t):new URL(e)}var oi=class extends G{constructor(){super(...arguments),this.localForageKey="mc_active_wallet",this.localForageIsLoggedInKey="magic_auth_is_logged_in",this.userLoggedOutCallbacks=[]}getIdToken(e){let t=m(this.sdk.testMode?h.GetIdTokenTestMode:h.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=m(this.sdk.testMode?h.GenerateIdTokenTestMode:h.GenerateIdToken,[e]);return this.request(t)}getInfo(){return v(this,null,function*(){let e=yield O(this.localForageKey),t=m(h.GetInfo,[{walletType:e}]);return this.request(t)})}isLoggedIn(){return Z((e,t)=>v(this,null,function*(){try{let r=!1;this.sdk.useStorageCache&&(r=(yield O(this.localForageIsLoggedInKey))==="true",r&&e(!0));let i=m(this.sdk.testMode?h.IsLoggedInTestMode:h.IsLoggedIn),n=yield this.request(i);this.sdk.useStorageCache&&(n?T(this.localForageIsLoggedInKey,!0):W(this.localForageIsLoggedInKey),r&&!n&&this.emitUserLoggedOut(!0)),e(n)}catch(r){t(r)}}))}logout(){return W(this.localForageKey),W(this.localForageIsLoggedInKey),Me(),Z((e,t)=>v(this,null,function*(){try{let r=m(this.sdk.testMode?h.LogoutTestMode:h.Logout),i=yield this.request(r);this.sdk.useStorageCache&&this.emitUserLoggedOut(i),e(i)}catch(r){t(r)}}))}requestInfoWithUI(e){let t=m(h.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}showSettings(e){let t=m(this.sdk.testMode?h.UserSettingsTestMode:h.UserSettings,[e]);return this.request(t)}recoverAccount(e){let t=m(this.sdk.testMode?h.RecoverAccountTestMode:h.RecoverAccount,[e]);return this.request(t)}getMetadata(){Y({method:"user.getMetadata()",removalVersions:z,useInstead:"user.getInfo()"}).log();let e=m(this.sdk.testMode?h.GetMetadataTestMode:h.GetMetadata);return this.request(e)}onUserLoggedOut(e){this.userLoggedOutCallbacks.push(e)}emitUserLoggedOut(e){this.userLoggedOutCallbacks.forEach(t=>{t(e)})}},ai=class extends G{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){let e=Z((t,r)=>v(this,null,function*(){try{if(this.isMetaMaskBrowser()&&(yield this.isWalletEnabled(M.MetaMask))){let o=yield this.autoConnectIfWalletBrowser(M.MetaMask);t(o);return}if(this.isCoinbaseWalletBrowser()&&(yield this.isWalletEnabled(M.CoinbaseWallet))){let o=yield this.autoConnectIfWalletBrowser(M.CoinbaseWallet);t(o);return}let i=this.getUserEnv(),n=m(h.Login,[i]),s=this.request(n);s.on(ae.WalletSelected,o=>this.handleWalletSelected(ye(Ie({},o),{payloadId:n.id}))),s.on("id-token-created",o=>{e.emit("id-token-created",o)});let a=yield s;a.error&&r(a),t(a)}catch(i){r(i)}}));return e}showUI(){return this.request(m(h.ShowUI))}showAddress(){return this.request(m(h.ShowAddress))}showSendTokensUI(){return this.request(m(h.ShowSendTokensUI))}showOnRamp(){return this.request(m(h.ShowOnRamp))}showNFTs(){return this.request(m(h.ShowNFTs))}showBalances(){return this.request(m(h.ShowBalances))}sendGaslessTransaction(e,t){return this.request(m(h.SendGaslessTransaction,[e,t]))}getInfo(){return v(this,null,function*(){Y({method:"wallet.getInfo()",removalVersions:z,useInstead:"user.getInfo()"}).log();let e=yield O(this.localForageKey),t=m(h.GetInfo,[{walletType:e}]);return this.request(t)})}disconnect(){Y({method:"wallet.disconnect()",removalVersions:z,useInstead:"user.logout()"}).log(),W(this.localForageKey),Me();let e=m(h.Disconnect);return this.request(e)}requestUserInfoWithUI(e){Y({method:"wallet.requestUserInfoWithUI()",removalVersions:z,useInstead:"user.requestUserInfoWithUI()"}).log();let t=m(h.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}getProvider(){return v(this,null,function*(){switch(yield O(this.localForageKey)){case M.MetaMask:return this.getMetaMaskProvider();case M.CoinbaseWallet:return this.getCoinbaseProvider();default:return this.sdk.rpcProvider}})}isMetaMaskInstalled(){var e,t,r;return((e=window.ethereum)==null?void 0:e.isMetaMask)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.find(i=>i==null?void 0:i.isMetaMask))}isMetaMaskBrowser(){return this.isMobile()&&this.isMetaMaskInstalled()}getMetaMaskProvider(){var e,t;return((t=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:t.find(r=>r==null?void 0:r.isMetaMask))||window.ethereum}connectToMetaMask(){if(this.isMobile()&&!this.isMetaMaskInstalled()){let e=`https://metamask.app.link/dapp/${window.location.href.replace(/(^\w+:|^)\/\//,"")}`;window.location.href=e}return this.getMetaMaskProvider().request({method:"eth_requestAccounts"})}isCoinbaseWalletInstalled(){var e,t,r;return((e=window.ethereum)==null?void 0:e.isCoinbaseWallet)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.find(i=>i==null?void 0:i.isCoinbaseWallet))}isCoinbaseWalletBrowser(){var e;return!!((e=window.ethereum)!=null&&e.isCoinbaseBrowser)}getCoinbaseProvider(){var e,t;return((t=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:t.find(r=>r==null?void 0:r.isCoinbaseWallet))||window.ethereum}connectToCoinbaseWallet(){if(this.isMobile()&&!this.isCoinbaseWalletBrowser()){let e=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`;window.location.href=e}return this.getCoinbaseProvider().request({method:"eth_requestAccounts"})}isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Silk|Opera Mini/i.test(navigator.userAgent)}getUserEnv(){return{env:{isMetaMaskInstalled:this.isMetaMaskInstalled(),isCoinbaseWalletInstalled:this.isCoinbaseWalletInstalled()}}}connectToThirdPartyWallet(e){switch(e){case M.MetaMask:return this.connectToMetaMask();case M.CoinbaseWallet:return this.connectToCoinbaseWallet();default:throw new Error(`Invalid provider: ${e}. Must be one of "metamask" or "coinbase_wallet".`)}}isWalletEnabled(e){let t=m("mc_is_wallet_enabled",[{wallet:e}]);return this.request(t)}handleWalletSelected(e){return v(this,null,function*(){try{let t=yield this.connectToThirdPartyWallet(e.wallet);yield T(this.localForageKey,e.wallet),this.createIntermediaryEvent(ae.WalletConnected,e.payloadId)(t)}catch(t){console.error(t),this.createIntermediaryEvent(ae.WalletRejected,e.payloadId)()}})}autoConnectIfWalletBrowser(e){return v(this,null,function*(){let t;e===M.MetaMask&&(t=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),e===M.CoinbaseWallet&&(t=yield this.getCoinbaseProvider().request({method:"eth_requestAccounts"})),yield T(this.localForageKey,e);let r=m(h.AutoConnect,[{wallet:e,address:t}]);return this.request(r)})}},{createBoundEmitterMethod:oe,createChainingEmitterMethod:x}=Ze(),li=class extends G{constructor(){super(...arguments),this.isMagic=!0,this.on=x("on",this),this.once=x("once",this),this.addListener=x("addListener",this),this.off=x("off",this),this.removeListener=x("removeListener",this),this.removeAllListeners=x("removeAllListeners",this),this.emit=oe("emit"),this.eventNames=oe("eventNames"),this.listeners=oe("listeners"),this.listenerCount=oe("listenerCount")}sendAsync(e,t){if(!t)throw Sr({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:t===null?"null":typeof t});if(Array.isArray(e))this.overlay.post(ce.MAGIC_HANDLE_REQUEST,e.map(r=>{let i=he(r);return this.prefixPayloadMethodForTestMode(i),i})).then(r=>{t(null,r.map(i=>ye(Ie({},i.payload),{error:i.hasError?new de(i.payload.error):null})))});else{let r=he(e);this.prefixPayloadMethodForTestMode(r),this.overlay.post(ce.MAGIC_HANDLE_REQUEST,r).then(i=>{t(i.hasError?new de(i.payload.error):null,i.payload)})}}send(e,t){if(typeof e=="string"){let i=m(e,Array.isArray(t)?t:[]);return this.request(i)}if(Array.isArray(e)||t){this.sendAsync(e,t);return}let r=Cr();return r.log(),new Re(e).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let e=m(h.Login);return this.request(e)}request(e){return this.prefixPayloadMethodForTestMode(e),super.request(e)}prefixPayloadMethodForTestMode(e){let t="testMode/eth/";this.sdk.testMode&&(e.method=`${t}${e.method}`)}},qe=["request","overlay","sdk"];function ci(e){let t=Object.getPrototypeOf(e),r=[t];for(;t!==G.prototype;)t=Object.getPrototypeOf(t),r.push(t);return r}var ct=class extends G{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:Z,isPromiEvent:xr,encodeJSON:Xe,decodeJSON:yr,createJsonRpcRequestPayload:m,standardizeJsonRpcRequestPayload:he,storage:rt};let e=[this,...ci(this)];qe.forEach(t=>{let r=e.map(a=>Object.getOwnPropertyDescriptor(a,t)),i=r.findIndex(a=>!!a),n=i>0,s=r[i];s&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:s,isPrototypeField:n}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw Tr(t)}}))})}init(e){this.__is_initialized__||(qe.forEach(t=>{if(this.__sdk_access_field_descriptors__.has(t)){let{descriptor:r,isPrototypeField:i}=this.__sdk_access_field_descriptors__.get(t);i?delete this[t]:Object.defineProperty(this,t,r)}}),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:r,useInstead:i}=e,n=i?` Use \`${i}\` instead.`:"",s=`\`${t}\` will be removed from this Extension in version \`${r}\`.${n}`;return new Fe(this,"DEPRECATION_NOTICE",s)}createWarning(e,t){return new Fe(this,e,t)}createError(e,t,r){return new Ye(this,e,t,r)}},ui=class extends ct{},J=class extends ct{};J.Internal=ui,J.Anonymous="anonymous extension";var di=class extends G{purchase(e){let t=m(h.NFTPurchase,[e]);return this.request(t)}checkout(e){let t=m(h.NFTCheckout,[e]);return this.request(t)}transfer(e){let t=m(h.NFTTransfer,[e]);return this.request(t)}};function Ve(e){return e.compat&&e.compat[g.sdkName]!=null?typeof e.compat[g.sdkName]=="string"?hr(fr(g.version),e.compat[g.sdkName]):!!e.compat[g.sdkName]:!0}function hi(e,t,r){return!t&&!r?`${e}_eth_mainnet`:r?`${e}_${JSON.stringify(r)}`:t?typeof t=="string"?`${e}_eth_${t}`:`${e}_${t.rpcUrl}_${t.chainId}_${t.chainType}`:`${e}_unknown`}function pi(e){var t;let r=(t=e==null?void 0:e.extensions)!=null?t:[],i={},n=[];if(Array.isArray(r)?r.forEach(s=>{Ve(s)?(s.init(this),(s.name||s.name!==J.Anonymous)&&(this[s.name]=s),s instanceof J.Internal&&(ue(s.config)||(i[s.name]=s.config))):n.push(s)}):Object.keys(r).forEach(s=>{if(Ve(r[s])){r[s].init(this);let a=r[s];this[s]=a,a instanceof J.Internal&&(ue(a.config)||(i[r[s].name]=a.config))}else n.push(r[s])}),n.length)throw Lr(n);return i}var le=class{constructor(e,t){this.apiKey=e;var r;if(!e)throw Ar();g.platform==="react-native"&&(t!=null&&t.endpoint)&&br().log();let{defaultEndpoint:i,version:n}=g;this.testMode=!!(t!=null&&t.testMode),this.useStorageCache=!!(t!=null&&t.useStorageCache),this.endpoint=je((r=t==null?void 0:t.endpoint)!=null?r:i).origin,this.auth=new Wr(this),this.user=new oi(this),this.wallet=new ai(this),this.nft=new di(this),this.rpcProvider=new li(this);let s=pi.call(this,t);this.parameters=Xe(ye(Ie({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:t==null?void 0:t.network,host:je(this.endpoint).host,sdk:Nr[g.sdkName],version:n,ext:ue(s)?void 0:s,locale:(t==null?void 0:t.locale)||"en_US"},g.bundleId?{bundleId:g.bundleId}:{}),{meta:t==null?void 0:t.meta})),this.networkHash=hi(this.apiKey,t==null?void 0:t.network,ue(s)?void 0:s),t!=null&&t.deferPreload||this.preload()}get overlay(){if(!le.__overlays__.has(this.parameters)){let e=new g.ViewController(this.endpoint,this.parameters,this.networkHash);e.init(),le.__overlays__.set(this.parameters,e)}return le.__overlays__.get(this.parameters)}preload(){return v(this,null,function*(){yield this.overlay.checkIsReadyForRequest})}},mi=le;mi.__overlays__=new Map;function Ei(e,t){return t&&Array.isArray(e)?e.find(r=>r.id===t):e}function fi(e,t){var r;let i=(r=t.data.response)==null?void 0:r.id,n=Ei(e,i);if(i&&n){let s=new Re(n).applyResult(t.data.response.result).applyError(t.data.response.error);return{id:i,response:s}}return{}}function gi(e,t,r){return v(this,null,function*(){var i;let n=yield O("rt"),s;if(g.platform==="web")try{s=(i=yield O("jwt"))!=null?i:yield Yr()}catch(u){console.error("webcrypto error",u)}let a={msgType:e,payload:t};s&&(a.jwt=s),s&&n&&(a.rt=n);let o=yield si(r);return o&&(a.deviceShare=o),a})}function _i(e){return v(this,null,function*(){!e.data.rt||(yield T("rt",e.data.rt))})}var wi=class{constructor(e,t,r){this.endpoint=e,this.parameters=t,this.networkHash=r,this.messageHandlers=new Set,this.isConnectedToInternet=!0,this.checkIsReadyForRequest=this.waitForReady(),this.isReadyForRequest=!1,this.listen()}post(e,t){return v(this,null,function*(){return tt((r,i)=>v(this,null,function*(){if(!this.isConnectedToInternet){let l=Or();i(l)}this.isReadyForRequest||(yield this.waitForReady());let n=[],s=Array.isArray(t)?t.map(l=>l.id):[],a=yield gi(`${e}-${this.parameters}`,t,this.networkHash);yield this._post(a);let o=l=>c=>{var d;let{id:f,response:_}=fi(t,c);if(_i(c),((d=_==null?void 0:_.payload.error)==null?void 0:d.message)==="User denied account access.")Me();else if(c.data.deviceShare){let{deviceShare:I}=c.data;ni(I,this.networkHash)}f&&_&&Array.isArray(t)&&s.includes(f)?(n.push(_),n.length===t.length&&(l(),r(n))):f&&_&&!Array.isArray(t)&&f===t.id&&(l(),r(_))},u=this.on(k.MAGIC_HANDLE_RESPONSE,o(()=>u()))}))})}on(e,t){let r=t.bind(window),i=n=>{n.data.msgType===`${e}-${this.parameters}`&&r(n)};return this.messageHandlers.add(i),()=>this.messageHandlers.delete(i)}waitForReady(){return new Promise(e=>{let t=this.on(k.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=!0,e(),t()})})}listen(){this.on(k.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(k.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()}),this.on(k.MAGIC_SEND_PRODUCT_ANNOUNCEMENT,e=>{e.data.response.result.product_announcement&&new te(j.ProductAnnouncement,e.data.response.result.product_announcement).log()})}};export{mi as $,D as A,wi as B,ae as E,X as I,je as J,Ii as K,_t as L,mt as N,gt as O,ge as R,ft as T,P as U,Ye as V,te as W,de as _,J as a,Et as b,pt as c,ce as d,ve as e,k as f,ht as g,b as h,U as i,vt as k,Or as m,j as p,yi as q,Fe as s,M as u,h as v,xr as x,It as y};
5
+ Received: \`${e.received}\``)}function yi(){return new te(j.DuplicateIframe,"Duplicate iframes found.")}function br(){return new te(j.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function Cr(){return new te(j.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${g.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function Y(e){let{method:t,removalVersions:r,useInstead:i}=e,n=r[g.sdkName],s=i?` Use \`${i}\` instead.`:"",a=`\`${t}\` will be removed from \`${g.sdkName}\` in version \`${n}\`.${s}`;return new te(j.DeprecationNotice,a)}function*Pr(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}var kr=Pr();function ze(){return kr.next().value}var Je=Symbol("Payload pre-processed by Magic SDK");function Qe(e){return Object.defineProperty(e,Je,{value:!0,enumerable:!1}),e}function Ur(e){return!!e[Je]}function he(e){var t,r,i;return Ur(e)||(e.jsonrpc=(t=e.jsonrpc)!=null?t:"2.0",e.id=ze(),e.method=(r=e.method)!=null?r:"noop",e.params=(i=e.params)!=null?i:[],Qe(e)),e}function m(e,t=[]){return Qe({params:t,method:e,jsonrpc:"2.0",id:ze()})}var Re=class{constructor(e){e instanceof Re?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):Rr(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=void 0,this._error=void 0)}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return typeof this._error<"u"&&this._error!==null}get hasResult(){return typeof this._result<"u"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},Dr=St(bt()),Gr=class extends Dr.default{};function Ze(){let e=new Gr;return{emitter:e,createChainingEmitterMethod:(t,r)=>(...i)=>(e[t].apply(e,i),r),createBoundEmitterMethod:t=>(...r)=>e[t].apply(e,r)}}var et=Symbol("isPromiEvent");function xr(e){return!!e[et]}function Z(e){let t=tt(e),{createBoundEmitterMethod:r,createChainingEmitterMethod:i}=Ze(),n=Symbol("Promise.then"),s=Symbol("Promise.catch"),a=Symbol("Promise.finally"),o=(c,d)=>(...f)=>{let _=d[c].apply(d,f);return u(_)},u=c=>Object.assign(c,{[et]:!0,[n]:c[n]||c.then,[s]:c[s]||c.catch,[a]:c[a]||c.finally,then:o(n,c),catch:o(s,c),finally:o(a,c),on:i("on",c),once:i("once",c),addListener:i("addListener",c),off:i("off",c),removeListener:i("removeListener",c),removeAllListeners:i("removeAllListeners",c),emit:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),l=u(t.then(c=>(l.emit("done",c),l.emit("settled"),c),c=>{throw l.emit("error",c),l.emit("settled"),c}));return l}function tt(e){return new Promise((t,r)=>{let i=e(t,r);Promise.resolve(i).catch(r)})}var G=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(ce.MAGIC_HANDLE_REQUEST,he(e)),r=Z((n,s)=>{t.then(a=>{if(i(),a.hasError)s(new de(a.payload.error));else if(a.hasResult)n(a.payload.result);else throw Mr()}).catch(a=>{i(),s(a)})}),i=this.overlay.on(k.MAGIC_HANDLE_EVENT,n=>{var s;let{response:a}=n.data;if(a.id===e.id&&((s=a.result)!=null&&s.event)){let{event:o,params:u=[]}=a.result;r.emit(o,...u)}});return r}createIntermediaryEvent(e,t){return r=>{let i=m(h.IntermediaryEvent,[{payloadId:t,eventType:e,args:r}]);this.request(i)}}};function Fr(e,t){let[r]=e.split(".").map(Number);return r>=t}var z={"magic-sdk":"v18.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v19.0.0","@magic-sdk/react-native-expo":"v19.0.0"},Wr=class extends G{loginWithMagicLink(e){let t=g.sdkName==="@magic-sdk/react-native"||g.sdkName==="@magic-sdk/react-native-bare"||g.sdkName==="@magic-sdk/react-native-expo";if(t&&Fr(g.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");t&&Y({method:"auth.loginWithMagicLink()",removalVersions:z,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:r,showUI:i=!0,redirectURI:n,overrides:s}=e,a=m(this.sdk.testMode?h.LoginWithMagicLinkTestMode:h.LoginWithMagicLink,[{email:r,showUI:i,redirectURI:n,overrides:s}]);return this.request(a)}loginWithSMS(e){let{phoneNumber:t}=e,r=m(this.sdk.testMode?h.LoginWithSmsTestMode:h.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(r)}loginWithEmailOTP(e){let{email:t,showUI:r,deviceCheckUI:i,overrides:n}=e,s=m(this.sdk.testMode?h.LoginWithEmailOTPTestMode:h.LoginWithEmailOTP,[{email:t,showUI:r,deviceCheckUI:i,overrides:n}]),a=this.request(s);return!i&&a&&a.on(ge.Retry,()=>{this.createIntermediaryEvent(ge.Retry,s.id)()}),!r&&a&&(a.on(X.VerifyEmailOtp,o=>{this.createIntermediaryEvent(X.VerifyEmailOtp,s.id)(o)}),a.on(X.Cancel,()=>{this.createIntermediaryEvent(X.Cancel,s.id)()})),a}loginWithCredential(e){let t=e??"";if(!e&&g.platform==="web"){t=window.location.search;let i=window.location.origin+window.location.pathname;window.history.replaceState(null,"",i)}let r=m(this.sdk.testMode?h.LoginWithCredentialTestMode:h.LoginWithCredential,[t]);return this.request(r)}setAuthorizationToken(e){let t=m(h.SetAuthorizationToken,[{jwt:e}]);return this.request(t)}updateEmailWithUI(e){let{email:t,showUI:r=!0}=e,i=m(this.sdk.testMode?h.UpdateEmailTestMode:h.UpdateEmail,[{email:t,showUI:r}]),n=this.request(i);return r||(n.on(C.Retry,()=>{this.createIntermediaryEvent(C.Retry,i.id)()}),n.on(C.Cancel,()=>{this.createIntermediaryEvent(C.Cancel,i.id)()}),n.on(C.VerifyEmailOtp,s=>{this.createIntermediaryEvent(C.VerifyEmailOtp,i.id)(s)}),n.on(P.RetryWithNewEmail,s=>{this.createIntermediaryEvent(P.RetryWithNewEmail,i.id)(s)}),n.on(P.Cancel,()=>{this.createIntermediaryEvent(P.Cancel,i.id)()}),n.on(P.VerifyEmailOtp,s=>{this.createIntermediaryEvent(P.VerifyEmailOtp,i.id)(s)})),n}},rt={};Tt(rt,{clear:()=>jr,getItem:()=>O,iterate:()=>it,key:()=>Vr,keys:()=>Hr,length:()=>qr,removeItem:()=>W,setItem:()=>T});var se;function S(e){return(...t)=>v(this,null,function*(){return se||(se=yield g.configureStorage()),yield se.ready(),se[e](...t)})}var O=S("getItem"),T=S("setItem"),W=S("removeItem"),jr=S("clear"),qr=S("length"),Vr=S("key"),Hr=S("keys"),it=S("iterate");function Br(){let e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&191|128;let t="";return t+=e[0].toString(16),t+=e[1].toString(16),t+=e[2].toString(16),t+=e[3].toString(16),t+="-",t+=e[4].toString(16),t+=e[5].toString(16),t+="-",t+=e[6].toString(16),t+=e[7].toString(16),t+="-",t+=e[8].toString(16),t+=e[9].toString(16),t+="-",t+=e[10].toString(16),t+=e[11].toString(16),t+=e[12].toString(16),t+=e[13].toString(16),t+=e[14].toString(16),t+=e[15].toString(16),t}var nt="STORE_KEY_PRIVATE_KEY",_e="STORE_KEY_PUBLIC_JWK",st="ECDSA",Xr="P-256",Kr={name:st,namedCurve:Xr};function me(){let e=typeof window<"u"&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}function Yr(){return v(this,null,function*(){let e=yield zr();if(!e){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:t}=window.crypto,r=yield O(nt);if(!r||!t){console.info("unable to find private key or webcrypto unsupported");return}let i={iat:Math.floor(new Date().getTime()/1e3),jti:Br()},n={typ:"dpop+jwt",alg:"ES256",jwk:e},s={protected:We(JSON.stringify(n)),claims:We(JSON.stringify(i))},a=Qr(`${s.protected}.${s.claims}`),o={name:st,hash:{name:"SHA-256"}},u=ei(new Uint8Array(yield t.sign(o,r,a)));return`${s.protected}.${s.claims}.${u}`})}function zr(){return v(this,null,function*(){if(!me()){console.info("webcrypto is not supported");return}return(yield O(_e))||(yield Jr()),O(_e)})}function Jr(){return v(this,null,function*(){let{subtle:e}=window.crypto,t=yield e.generateKey(Kr,!1,["sign"]),r=yield e.exportKey("jwk",t.publicKey);yield T(nt,t.privateKey),yield T(_e,r)})}function We(e){return ot(Zr(e))}function Qr(e){return new TextEncoder().encode(e)}function ot(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function Zr(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,r)=>String.fromCharCode(parseInt(r,16)))}function ei(e){let t="";return e.forEach(r=>{t+=String.fromCharCode(r)}),ot(t)}var $e="ds",Ne="ek",Ae="iv",Oe="AES-GCM",ti=256;function Me(){return v(this,null,function*(){let e=[];yield it((t,r,i)=>{r.startsWith(`${$e}_`)&&e.push(r)});for(let t of e)yield W(t)})}function at(e){let t="",r=new Uint8Array(e),i=r.byteLength;for(let n=0;n<i;n++)t+=String.fromCharCode(r[n]);return window.btoa(t)}function lt(e){let t=window.atob(e),r=t.length,i=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=t.charCodeAt(n);return i.buffer}function ri(){return v(this,null,function*(){if(!me()){console.info("webcrypto is not supported");return}let{crypto:e}=window;return(yield O(Ae))||e.getRandomValues(new Uint8Array(12))})}function ii(){return v(this,null,function*(){if(!me()){console.info("webcrypto is not supported");return}let{subtle:e}=window.crypto;return(yield O(Ne))||(yield e.generateKey({name:Oe,length:ti},!1,["encrypt","decrypt"]))})}function ni(e,t){return v(this,null,function*(){let r=yield ri(),i=yield ii();if(!r||!i||!e)return;let n=lt(e),{subtle:s}=window.crypto,a=yield s.encrypt({name:Oe,iv:r},i,n),o=at(a);yield T(`${$e}_${t}`,o),yield T(Ne,i),yield T(Ae,r)})}function si(e){return v(this,null,function*(){let t=yield O(`${$e}_${e}`),r=yield O(Ae),i=yield O(Ne);if(!r||!t||!i||!me())return;let{subtle:n}=window.crypto,s=yield n.decrypt({name:Oe,iv:r},i,lt(t));return at(s)})}function je(e,t){return t?new URL(e,t):new URL(e)}var oi=class extends G{constructor(){super(...arguments),this.localForageKey="mc_active_wallet",this.localForageIsLoggedInKey="magic_auth_is_logged_in",this.userLoggedOutCallbacks=[]}getIdToken(e){let t=m(this.sdk.testMode?h.GetIdTokenTestMode:h.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=m(this.sdk.testMode?h.GenerateIdTokenTestMode:h.GenerateIdToken,[e]);return this.request(t)}getInfo(){return v(this,null,function*(){let e=yield O(this.localForageKey),t=m(h.GetInfo,[{walletType:e}]);return this.request(t)})}isLoggedIn(){return Z((e,t)=>v(this,null,function*(){try{let r=!1;this.sdk.useStorageCache&&(r=(yield O(this.localForageIsLoggedInKey))==="true",r&&e(!0));let i=m(this.sdk.testMode?h.IsLoggedInTestMode:h.IsLoggedIn),n=yield this.request(i);this.sdk.useStorageCache&&(n?T(this.localForageIsLoggedInKey,!0):W(this.localForageIsLoggedInKey),r&&!n&&this.emitUserLoggedOut(!0)),e(n)}catch(r){t(r)}}))}logout(){return W(this.localForageKey),W(this.localForageIsLoggedInKey),Me(),Z((e,t)=>v(this,null,function*(){try{let r=m(this.sdk.testMode?h.LogoutTestMode:h.Logout),i=yield this.request(r);this.sdk.useStorageCache&&this.emitUserLoggedOut(i),e(i)}catch(r){t(r)}}))}requestInfoWithUI(e){let t=m(h.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}showSettings(e){let t=m(this.sdk.testMode?h.UserSettingsTestMode:h.UserSettings,[e]);return this.request(t)}recoverAccount(e){let t=m(this.sdk.testMode?h.RecoverAccountTestMode:h.RecoverAccount,[e]);return this.request(t)}getMetadata(){Y({method:"user.getMetadata()",removalVersions:z,useInstead:"user.getInfo()"}).log();let e=m(this.sdk.testMode?h.GetMetadataTestMode:h.GetMetadata);return this.request(e)}onUserLoggedOut(e){this.userLoggedOutCallbacks.push(e)}emitUserLoggedOut(e){this.userLoggedOutCallbacks.forEach(t=>{t(e)})}},ai=class extends G{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){let e=Z((t,r)=>v(this,null,function*(){try{if(this.isMetaMaskBrowser()&&(yield this.isWalletEnabled(M.MetaMask))){let o=yield this.autoConnectIfWalletBrowser(M.MetaMask);t(o);return}if(this.isCoinbaseWalletBrowser()&&(yield this.isWalletEnabled(M.CoinbaseWallet))){let o=yield this.autoConnectIfWalletBrowser(M.CoinbaseWallet);t(o);return}let i=this.getUserEnv(),n=m(h.Login,[i]),s=this.request(n);s.on(ae.WalletSelected,o=>this.handleWalletSelected(ye(Ie({},o),{payloadId:n.id}))),s.on("id-token-created",o=>{e.emit("id-token-created",o)});let a=yield s;a.error&&r(a),t(a)}catch(i){r(i)}}));return e}showUI(){return this.request(m(h.ShowUI))}showAddress(){return this.request(m(h.ShowAddress))}showSendTokensUI(){return this.request(m(h.ShowSendTokensUI))}showOnRamp(){return this.request(m(h.ShowOnRamp))}showNFTs(){return this.request(m(h.ShowNFTs))}showBalances(){return this.request(m(h.ShowBalances))}sendGaslessTransaction(e,t){return this.request(m(h.SendGaslessTransaction,[e,t]))}getInfo(){return v(this,null,function*(){Y({method:"wallet.getInfo()",removalVersions:z,useInstead:"user.getInfo()"}).log();let e=yield O(this.localForageKey),t=m(h.GetInfo,[{walletType:e}]);return this.request(t)})}disconnect(){Y({method:"wallet.disconnect()",removalVersions:z,useInstead:"user.logout()"}).log(),W(this.localForageKey),Me();let e=m(h.Disconnect);return this.request(e)}requestUserInfoWithUI(e){Y({method:"wallet.requestUserInfoWithUI()",removalVersions:z,useInstead:"user.requestUserInfoWithUI()"}).log();let t=m(h.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}getProvider(){return v(this,null,function*(){switch(yield O(this.localForageKey)){case M.MetaMask:return this.getMetaMaskProvider();case M.CoinbaseWallet:return this.getCoinbaseProvider();default:return this.sdk.rpcProvider}})}isMetaMaskInstalled(){var e,t,r;return((e=window.ethereum)==null?void 0:e.isMetaMask)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.find(i=>i==null?void 0:i.isMetaMask))}isMetaMaskBrowser(){return this.isMobile()&&this.isMetaMaskInstalled()}getMetaMaskProvider(){var e,t;return((t=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:t.find(r=>r==null?void 0:r.isMetaMask))||window.ethereum}connectToMetaMask(){if(this.isMobile()&&!this.isMetaMaskInstalled()){let e=`https://metamask.app.link/dapp/${window.location.href.replace(/(^\w+:|^)\/\//,"")}`;window.location.href=e}return this.getMetaMaskProvider().request({method:"eth_requestAccounts"})}isCoinbaseWalletInstalled(){var e,t,r;return((e=window.ethereum)==null?void 0:e.isCoinbaseWallet)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.find(i=>i==null?void 0:i.isCoinbaseWallet))}isCoinbaseWalletBrowser(){var e;return!!((e=window.ethereum)!=null&&e.isCoinbaseBrowser)}getCoinbaseProvider(){var e,t;return((t=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:t.find(r=>r==null?void 0:r.isCoinbaseWallet))||window.ethereum}connectToCoinbaseWallet(){if(this.isMobile()&&!this.isCoinbaseWalletBrowser()){let e=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`;window.location.href=e}return this.getCoinbaseProvider().request({method:"eth_requestAccounts"})}isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Silk|Opera Mini/i.test(navigator.userAgent)}getUserEnv(){return{env:{isMetaMaskInstalled:this.isMetaMaskInstalled(),isCoinbaseWalletInstalled:this.isCoinbaseWalletInstalled()}}}connectToThirdPartyWallet(e){switch(e){case M.MetaMask:return this.connectToMetaMask();case M.CoinbaseWallet:return this.connectToCoinbaseWallet();default:throw new Error(`Invalid provider: ${e}. Must be one of "metamask" or "coinbase_wallet".`)}}isWalletEnabled(e){let t=m("mc_is_wallet_enabled",[{wallet:e}]);return this.request(t)}handleWalletSelected(e){return v(this,null,function*(){try{let t=yield this.connectToThirdPartyWallet(e.wallet);yield T(this.localForageKey,e.wallet),this.createIntermediaryEvent(ae.WalletConnected,e.payloadId)(t)}catch(t){console.error(t),this.createIntermediaryEvent(ae.WalletRejected,e.payloadId)()}})}autoConnectIfWalletBrowser(e){return v(this,null,function*(){let t;e===M.MetaMask&&(t=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),e===M.CoinbaseWallet&&(t=yield this.getCoinbaseProvider().request({method:"eth_requestAccounts"})),yield T(this.localForageKey,e);let r=m(h.AutoConnect,[{wallet:e,address:t}]);return this.request(r)})}},{createBoundEmitterMethod:oe,createChainingEmitterMethod:x}=Ze(),li=class extends G{constructor(){super(...arguments),this.isMagic=!0,this.on=x("on",this),this.once=x("once",this),this.addListener=x("addListener",this),this.off=x("off",this),this.removeListener=x("removeListener",this),this.removeAllListeners=x("removeAllListeners",this),this.emit=oe("emit"),this.eventNames=oe("eventNames"),this.listeners=oe("listeners"),this.listenerCount=oe("listenerCount")}sendAsync(e,t){if(!t)throw Sr({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:t===null?"null":typeof t});if(Array.isArray(e))this.overlay.post(ce.MAGIC_HANDLE_REQUEST,e.map(r=>{let i=he(r);return this.prefixPayloadMethodForTestMode(i),i})).then(r=>{t(null,r.map(i=>ye(Ie({},i.payload),{error:i.hasError?new de(i.payload.error):null})))});else{let r=he(e);this.prefixPayloadMethodForTestMode(r),this.overlay.post(ce.MAGIC_HANDLE_REQUEST,r).then(i=>{t(i.hasError?new de(i.payload.error):null,i.payload)})}}send(e,t){if(typeof e=="string"){let i=m(e,Array.isArray(t)?t:[]);return this.request(i)}if(Array.isArray(e)||t){this.sendAsync(e,t);return}let r=br();return r.log(),new Re(e).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let e=m(h.Login);return this.request(e)}request(e){return this.prefixPayloadMethodForTestMode(e),super.request(e)}prefixPayloadMethodForTestMode(e){let t="testMode/eth/";this.sdk.testMode&&(e.method=`${t}${e.method}`)}},qe=["request","overlay","sdk"];function ci(e){let t=Object.getPrototypeOf(e),r=[t];for(;t!==G.prototype;)t=Object.getPrototypeOf(t),r.push(t);return r}var ct=class extends G{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:Z,isPromiEvent:xr,encodeJSON:Xe,decodeJSON:yr,createJsonRpcRequestPayload:m,standardizeJsonRpcRequestPayload:he,storage:rt};let e=[this,...ci(this)];qe.forEach(t=>{let r=e.map(a=>Object.getOwnPropertyDescriptor(a,t)),i=r.findIndex(a=>!!a),n=i>0,s=r[i];s&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:s,isPrototypeField:n}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw Tr(t)}}))})}init(e){this.__is_initialized__||(qe.forEach(t=>{if(this.__sdk_access_field_descriptors__.has(t)){let{descriptor:r,isPrototypeField:i}=this.__sdk_access_field_descriptors__.get(t);i?delete this[t]:Object.defineProperty(this,t,r)}}),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:r,useInstead:i}=e,n=i?` Use \`${i}\` instead.`:"",s=`\`${t}\` will be removed from this Extension in version \`${r}\`.${n}`;return new Fe(this,"DEPRECATION_NOTICE",s)}createWarning(e,t){return new Fe(this,e,t)}createError(e,t,r){return new Ye(this,e,t,r)}},ui=class extends ct{},J=class extends ct{};J.Internal=ui,J.Anonymous="anonymous extension";var di=class extends G{purchase(e){let t=m(h.NFTPurchase,[e]);return this.request(t)}checkout(e){let t=m(h.NFTCheckout,[e]);return this.request(t)}transfer(e){let t=m(h.NFTTransfer,[e]);return this.request(t)}};function Ve(e){return e.compat&&e.compat[g.sdkName]!=null?typeof e.compat[g.sdkName]=="string"?hr(fr(g.version),e.compat[g.sdkName]):!!e.compat[g.sdkName]:!0}function hi(e,t,r){return!t&&!r?`${e}_eth_mainnet`:r?`${e}_${JSON.stringify(r)}`:t?typeof t=="string"?`${e}_eth_${t}`:`${e}_${t.rpcUrl}_${t.chainId}_${t.chainType}`:`${e}_unknown`}function pi(e){var t;let r=(t=e==null?void 0:e.extensions)!=null?t:[],i={},n=[];if(Array.isArray(r)?r.forEach(s=>{Ve(s)?(s.init(this),(s.name||s.name!==J.Anonymous)&&(this[s.name]=s),s instanceof J.Internal&&(ue(s.config)||(i[s.name]=s.config))):n.push(s)}):Object.keys(r).forEach(s=>{if(Ve(r[s])){r[s].init(this);let a=r[s];this[s]=a,a instanceof J.Internal&&(ue(a.config)||(i[r[s].name]=a.config))}else n.push(r[s])}),n.length)throw Lr(n);return i}var le=class{constructor(e,t){this.apiKey=e;var r;if(!e)throw Ar();g.platform==="react-native"&&(t!=null&&t.endpoint)&&Cr().log();let{defaultEndpoint:i,version:n}=g;this.testMode=!!(t!=null&&t.testMode),this.useStorageCache=!!(t!=null&&t.useStorageCache),this.endpoint=je((r=t==null?void 0:t.endpoint)!=null?r:i).origin,this.auth=new Wr(this),this.user=new oi(this),this.wallet=new ai(this),this.nft=new di(this),this.rpcProvider=new li(this);let s=pi.call(this,t);this.parameters=Xe(ye(Ie({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:t==null?void 0:t.network,host:je(this.endpoint).host,sdk:Nr[g.sdkName],version:n,ext:ue(s)?void 0:s,locale:(t==null?void 0:t.locale)||"en_US"},g.bundleId?{bundleId:g.bundleId}:{}),{meta:t==null?void 0:t.meta})),this.networkHash=hi(this.apiKey,t==null?void 0:t.network,ue(s)?void 0:s),t!=null&&t.deferPreload||this.preload()}get overlay(){if(!le.__overlays__.has(this.parameters)){let e=new g.ViewController(this.endpoint,this.parameters,this.networkHash);e.init(),le.__overlays__.set(this.parameters,e)}return le.__overlays__.get(this.parameters)}preload(){return v(this,null,function*(){yield this.overlay.checkIsReadyForRequest})}},mi=le;mi.__overlays__=new Map;function Ei(e,t){return t&&Array.isArray(e)?e.find(r=>r.id===t):e}function fi(e,t){var r;let i=(r=t.data.response)==null?void 0:r.id,n=Ei(e,i);if(i&&n){let s=new Re(n).applyResult(t.data.response.result).applyError(t.data.response.error);return{id:i,response:s}}return{}}function gi(e,t,r){return v(this,null,function*(){var i;let n=yield O("rt"),s;if(g.platform==="web")try{s=(i=yield O("jwt"))!=null?i:yield Yr()}catch(u){console.error("webcrypto error",u)}let a={msgType:e,payload:t};s&&(a.jwt=s),s&&n&&(a.rt=n);let o=yield si(r);return o&&(a.deviceShare=o),a})}function _i(e){return v(this,null,function*(){!e.data.rt||(yield T("rt",e.data.rt))})}var wi=class{constructor(e,t,r){this.endpoint=e,this.parameters=t,this.networkHash=r,this.messageHandlers=new Set,this.isConnectedToInternet=!0,this.checkIsReadyForRequest=this.waitForReady(),this.isReadyForRequest=!1,this.listen()}post(e,t){return v(this,null,function*(){return tt((r,i)=>v(this,null,function*(){if(!this.isConnectedToInternet){let l=Or();i(l)}this.isReadyForRequest||(yield this.waitForReady());let n=[],s=Array.isArray(t)?t.map(l=>l.id):[],a=yield gi(`${e}-${this.parameters}`,t,this.networkHash);yield this._post(a);let o=l=>c=>{var d;let{id:f,response:_}=fi(t,c);if(_i(c),((d=_==null?void 0:_.payload.error)==null?void 0:d.message)==="User denied account access.")Me();else if(c.data.deviceShare){let{deviceShare:I}=c.data;ni(I,this.networkHash)}f&&_&&Array.isArray(t)&&s.includes(f)?(n.push(_),n.length===t.length&&(l(),r(n))):f&&_&&!Array.isArray(t)&&f===t.id&&(l(),r(_))},u=this.on(k.MAGIC_HANDLE_RESPONSE,o(()=>u()))}))})}on(e,t){let r=t.bind(window),i=n=>{n.data.msgType===`${e}-${this.parameters}`&&r(n)};return this.messageHandlers.add(i),()=>this.messageHandlers.delete(i)}waitForReady(){return new Promise(e=>{let t=this.on(k.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=!0,e(),t()})})}listen(){this.on(k.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(k.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()}),this.on(k.MAGIC_SEND_PRODUCT_ANNOUNCEMENT,e=>{e.data.response.result.product_announcement&&new te(j.ProductAnnouncement,e.data.response.result.product_announcement).log()})}};export{mi as $,D as A,wi as B,ae as E,X as I,je as J,Ii as K,_t as L,mt as N,gt as O,ge as R,ft as T,P as U,Ye as V,te as W,de as _,J as a,Et as b,pt as c,ce as d,ve as e,k as f,ht as g,C as h,U as i,vt as k,Or as m,j as p,yi as q,Fe as s,M as u,h as v,xr as x,It as y};
@@ -1 +1 @@
1
- var B=Object.defineProperty;var D=(e,t,n)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var R=(e,t,n)=>D(e,typeof t!="symbol"?t+"":t,n);import{Z as f,D as d,aA as $,aB as E,aC as v,G as _,H as s,M as o,J as N,I as U,N as T,at as C,aD as V,aE as w,aF as k,aG as y,X as O,aH as M,ae as A,aI as G,aJ as J,aK as X,aL as H}from"./index-C2Y2eZ28.js";import{S as z}from"./SignInRequired-CvEoVbqe.js";const K="_container_1abv2_1",q="_nameContainer_1abv2_8",F="_editNameBtn_1abv2_20",Y="_actions_1abv2_30",W="_downloadBtn_1abv2_36",Z="_button_1abv2_13",I={container:K,nameContainer:q,editNameBtn:F,actions:Y,downloadBtn:W,button:Z},Q=E.get("EXPLORER_URL",""),ee=E.get("BUILDER_SERVER_URL",""),se=E.get("PEER_TESTING_URL","");function te({currentProject:e,metrics:t,limits:n,areEntitiesOutOfBoundaries:r,isUploading:c,onOpenModal:l}){const b=f(),m=d.useCallback(()=>{l("ExportModal",{project:e})},[e,l]),u=d.useCallback(()=>{l("EditProjectModal")},[l]),a=d.useCallback(()=>{l("DeployModal",{view:$.NONE,projectId:e.id})},[l,e]),h=d.useMemo(()=>{if(!e)return"";const i=new URL(Q);return i.searchParams.set("skipSetup","true"),i.searchParams.set("realm",`${ee}/projects/${e.id}`),i.searchParams.set("DEBUG_MODE","true"),E.is(v.Env.DEVELOPMENT)?(i.searchParams.set("NETWORK","sepolia"),i.searchParams.set("DEBUG_SCENE_LOG","")):i.searchParams.set("CATALYST",se),i.toString()},[]),g=d.useMemo(()=>Object.keys(t).some(i=>t[i]>n[i]),[t]),x=d.useMemo(()=>c||r,[t,n,r,c]),j=d.useMemo(()=>c||!x,[c,x]),L=d.useCallback(()=>r?_("topbar.bounds_exceeded",{br:s.jsx("br",{})}):g?_("topbar.limits_exceeded"):null,[r,g]),S=d.useCallback(()=>{b.goBack()},[b]);return s.jsxs("div",{className:I.container,children:[s.jsxs("div",{className:I.nameContainer,children:[s.jsx(o.Button,{basic:!0,"aria-label":_("inspector.top_bar.back"),onClick:S,children:s.jsx(o.Icon,{name:"chevron left"})}),e&&s.jsxs(o.Button,{basic:!0,onClick:u,disabled:c,className:I.editNameBtn,children:[e.title,s.jsx(N,{name:"layout",className:"edit-project-icon"})]}),c&&s.jsx(N,{name:"cloud-upload",className:"cloud-upload-indicator is-uploading"})]}),s.jsxs("div",{className:I.actions,children:[e?s.jsx(U,{projectId:e.id}):null,s.jsx(o.Popup,{content:_("inspector.top_bar.download"),trigger:s.jsx(o.Button,{secondary:!0,"aria-label":_("inspector.top_bar.download"),size:"small",className:I.downloadBtn,disabled:c,onClick:m,children:s.jsx(o.Icon,{name:"download"})})}),s.jsxs(o.Button,{as:"a",href:h,target:"_blank",secondary:!0,size:"small",disabled:c,children:[s.jsx(o.Icon,{name:"eye"}),_("inspector.top_bar.preview")]}),s.jsx(o.Popup,{content:L(),position:"bottom center",disabled:j,trigger:s.jsx("span",{children:s.jsxs(o.Button,{primary:!0,size:"small",disabled:x,onClick:a,children:[s.jsx(o.Icon,{name:"globe"}),_("inspector.top_bar.publish")]})}),on:"hover"})]})]})}const ne=e=>({currentProject:C(e),metrics:V(e),limits:w(e),areEntitiesOutOfBoundaries:k(e)>0,isUploading:y(e)}),ae=e=>({onOpenModal:(t,n)=>e(O(t,n))}),oe=T(ne,ae)(te);var p={VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.9.1"};const re=e=>e.replace(/\/$/,""),P=re(p.VITE_BASE_URL);let ce=class extends d.PureComponent{constructor(){super(...arguments);R(this,"state",{isLoaded:!1});R(this,"refIframe",n=>{const{onConnect:r}=this.props;n&&(n.onload=()=>{this.setState({isLoaded:!0})},r(n.id))})}componentDidMount(){const{onOpen:n}=this.props;n()}render(){const{scene:n,project:r,isLoggedIn:c,isReloading:l,address:b=""}=this.props;if(!c)return s.jsx(z,{});let m=`${P}/inspector-index.html`,u=`${P}/bin/index.js`;p.VITE_INSPECTOR_PORT&&(m=`http://localhost:${p.VITE_INSPECTOR_PORT}`,u=`${m}/bin/index.js`);let a=`?dataLayerRpcParentUrl=${window.location.origin}`;if(p.VITE_BIN_INDEX_JS_DEV_PORT&&p.VITE_BIN_INDEX_JS_DEV_PATH){const h=btoa(p.VITE_BIN_INDEX_JS_DEV_PATH);u=`http://localhost:${p.VITE_BIN_INDEX_JS_DEV_PORT}/content/contents/b64-${h}`}return a=a.concat(`&binIndexJsUrl=${u}`),a=a.concat(`&contentUrl=${E.get("INSPECTOR_CONTENT_URL")}`),a=a.concat(`&segmentKey=${E.get("INSPECTOR_SEGMENT_API_KEY")}`),a=a.concat(`&segmentAppId=${E.get("INSPECTOR_SEGMENT_APP_ID")}`),a=a.concat(`&segmentUserId=${b}`),r!=null&&r.id&&(a=a.concat(`&projectId=${r.id}`)),s.jsxs("div",{className:"InspectorPage",children:[(!this.state.isLoaded||l)&&s.jsx(o.Loader,{active:!0}),n&&!l&&s.jsxs(s.Fragment,{children:[s.jsx(oe,{}),s.jsx("iframe",{ref:this.refIframe,title:"inspector",id:"inspector",src:`${m}${a}`})]})]})}};const ie=e=>({address:M(e),isLoggedIn:A(e),scene:G(e),project:C(e),isReloading:J(e)}),de=e=>({onOpen:()=>e(X()),onConnect:t=>e(H(t))}),me=T(ie,de)(ce);export{me as default};
1
+ var B=Object.defineProperty;var D=(e,t,n)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var R=(e,t,n)=>D(e,typeof t!="symbol"?t+"":t,n);import{Z as f,D as d,aA as $,aB as m,aC as v,G as _,H as s,M as o,J as N,I as U,N as T,at as C,aD as V,aE as w,aF as k,aG as y,X as O,aH as M,ae as A,aI as G,aJ as J,aK as X,aL as H}from"./index-ZuMScRBF.js";import{S as z}from"./SignInRequired-D6dYEPdh.js";const K="_container_1abv2_1",q="_nameContainer_1abv2_8",F="_editNameBtn_1abv2_20",Y="_actions_1abv2_30",W="_downloadBtn_1abv2_36",Z="_button_1abv2_13",I={container:K,nameContainer:q,editNameBtn:F,actions:Y,downloadBtn:W,button:Z},Q=m.get("EXPLORER_URL",""),ee=m.get("BUILDER_SERVER_URL",""),se=m.get("PEER_TESTING_URL","");function te({currentProject:e,metrics:t,limits:n,areEntitiesOutOfBoundaries:r,isUploading:c,onOpenModal:l}){const b=f(),E=d.useCallback(()=>{l("ExportModal",{project:e})},[e,l]),u=d.useCallback(()=>{l("EditProjectModal")},[l]),a=d.useCallback(()=>{l("DeployModal",{view:$.NONE,projectId:e.id})},[l,e]),h=d.useMemo(()=>{if(!e)return"";const i=new URL(Q);return i.searchParams.set("skipSetup","true"),i.searchParams.set("realm",`${ee}/projects/${e.id}`),i.searchParams.set("DEBUG_MODE","true"),m.is(v.Env.DEVELOPMENT)?(i.searchParams.set("NETWORK","sepolia"),i.searchParams.set("DEBUG_SCENE_LOG","")):i.searchParams.set("CATALYST",se),i.toString()},[]),g=d.useMemo(()=>Object.keys(t).some(i=>t[i]>n[i]),[t]),x=d.useMemo(()=>c||r,[t,n,r,c]),j=d.useMemo(()=>c||!x,[c,x]),L=d.useCallback(()=>r?_("topbar.bounds_exceeded",{br:s.jsx("br",{})}):g?_("topbar.limits_exceeded"):null,[r,g]),S=d.useCallback(()=>{b.goBack()},[b]);return s.jsxs("div",{className:I.container,children:[s.jsxs("div",{className:I.nameContainer,children:[s.jsx(o.Button,{basic:!0,"aria-label":_("inspector.top_bar.back"),onClick:S,children:s.jsx(o.Icon,{name:"chevron left"})}),e&&s.jsxs(o.Button,{basic:!0,onClick:u,disabled:c,className:I.editNameBtn,children:[e.title,s.jsx(N,{name:"layout",className:"edit-project-icon"})]}),c&&s.jsx(N,{name:"cloud-upload",className:"cloud-upload-indicator is-uploading"})]}),s.jsxs("div",{className:I.actions,children:[e?s.jsx(U,{projectId:e.id}):null,s.jsx(o.Popup,{content:_("inspector.top_bar.download"),trigger:s.jsx(o.Button,{secondary:!0,"aria-label":_("inspector.top_bar.download"),size:"small",className:I.downloadBtn,disabled:c,onClick:E,children:s.jsx(o.Icon,{name:"download"})})}),s.jsxs(o.Button,{as:"a",href:h,target:"_blank",secondary:!0,size:"small",disabled:c,children:[s.jsx(o.Icon,{name:"eye"}),_("inspector.top_bar.preview")]}),s.jsx(o.Popup,{content:L(),position:"bottom center",disabled:j,trigger:s.jsx("span",{children:s.jsxs(o.Button,{primary:!0,size:"small",disabled:x,onClick:a,children:[s.jsx(o.Icon,{name:"globe"}),_("inspector.top_bar.publish")]})}),on:"hover"})]})]})}const ne=e=>({currentProject:C(e),metrics:V(e),limits:w(e),areEntitiesOutOfBoundaries:k(e)>0,isUploading:y(e)}),ae=e=>({onOpenModal:(t,n)=>e(O(t,n))}),oe=T(ne,ae)(te);var p={VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.9.2-16202422627.commit-2162b6e"};const re=e=>e.replace(/\/$/,""),P=re(p.VITE_BASE_URL);let ce=class extends d.PureComponent{constructor(){super(...arguments);R(this,"state",{isLoaded:!1});R(this,"refIframe",n=>{const{onConnect:r}=this.props;n&&(n.onload=()=>{this.setState({isLoaded:!0})},r(n.id))})}componentDidMount(){const{onOpen:n}=this.props;n()}render(){const{scene:n,project:r,isLoggedIn:c,isReloading:l,address:b=""}=this.props;if(!c)return s.jsx(z,{});let E=`${P}/inspector-index.html`,u=`${P}/bin/index.js`;p.VITE_INSPECTOR_PORT&&(E=`http://localhost:${p.VITE_INSPECTOR_PORT}`,u=`${E}/bin/index.js`);let a=`?dataLayerRpcParentUrl=${window.location.origin}`;if(p.VITE_BIN_INDEX_JS_DEV_PORT&&p.VITE_BIN_INDEX_JS_DEV_PATH){const h=btoa(p.VITE_BIN_INDEX_JS_DEV_PATH);u=`http://localhost:${p.VITE_BIN_INDEX_JS_DEV_PORT}/content/contents/b64-${h}`}return a=a.concat(`&binIndexJsUrl=${u}`),a=a.concat(`&contentUrl=${m.get("INSPECTOR_CONTENT_URL")}`),a=a.concat(`&segmentKey=${m.get("INSPECTOR_SEGMENT_API_KEY")}`),a=a.concat(`&segmentAppId=${m.get("INSPECTOR_SEGMENT_APP_ID")}`),a=a.concat(`&segmentUserId=${b}`),r!=null&&r.id&&(a=a.concat(`&projectId=${r.id}`)),s.jsxs("div",{className:"InspectorPage",children:[(!this.state.isLoaded||l)&&s.jsx(o.Loader,{active:!0}),n&&!l&&s.jsxs(s.Fragment,{children:[s.jsx(oe,{}),s.jsx("iframe",{ref:this.refIframe,title:"inspector",id:"inspector",src:`${E}${a}`})]})]})}};const ie=e=>({address:M(e),isLoggedIn:A(e),scene:G(e),project:C(e),isReloading:J(e)}),de=e=>({onOpen:()=>e(X()),onConnect:t=>e(H(t))}),Ee=T(ie,de)(ce);export{Ee as default};
@@ -1 +1 @@
1
- var x=Object.defineProperty;var j=(i,n,t)=>n in i?x(i,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[n]=t;var d=(i,n,t)=>j(i,typeof n!="symbol"?n+"":n,t);import{D as C,bU as h,H as e,M as s,G as r,e7 as b,cA as v,cB as y,bm as u,bC as S,cc as A,N as _,e8 as T,e9 as z,ea as N}from"./index-C2Y2eZ28.js";import{L as P}from"./LoggedInDetailPage.container-P8-KV9ow.js";import{S as f}from"./SignInRequired-CvEoVbqe.js";import"./Navigation.container-h_uvbEV-.js";import"./selectors-Zkd3yj1l.js";let L=class extends C.PureComponent{constructor(){super(...arguments);d(this,"timeoutId",null);d(this,"state",{hasCopiedText:!1,type:h.PARCEL,managerAddress:""});d(this,"handleOnCopy",()=>{this.timeoutId&&clearTimeout(this.timeoutId),this.setState({hasCopiedText:!0}),this.timeoutId=setTimeout(()=>{this.timeoutId=null,this.setState({hasCopiedText:!1})},1200)});d(this,"handleAddressChange",(t,a)=>{this.setState({managerAddress:a.value})});d(this,"handleTypeChange",(t,a)=>{this.setState({type:a.value})});d(this,"handleAddAuthorization",()=>{const{onSetUpdateManager:t}=this.props,{managerAddress:a,type:c}=this.state;t(a,c,!0)})}renderPage(){const{authorizations:t,wallet:a,onSetUpdateManager:c}=this.props,{hasCopiedText:g,managerAddress:o,type:m}=this.state,p=A(o);return e.jsx(s.Grid,{children:a===null?e.jsx(s.Loader,{size:"big",active:!0}):e.jsxs(e.Fragment,{children:[e.jsxs(s.Grid.Row,{children:[e.jsx(s.Grid.Column,{computer:4,mobile:16,children:e.jsx("div",{className:"left-column secondary-text",children:r("global.address")})}),e.jsxs(s.Grid.Column,{computer:12,mobile:16,children:[e.jsx("div",{className:"blockie-container",children:e.jsx(s.Blockie,{seed:a.address,scale:12})}),e.jsxs("div",{className:"address-container",children:[e.jsx("div",{className:"address",children:b()?v(a.address):a.address}),e.jsx(y,{role:"button",text:a.address,onCopy:this.handleOnCopy,children:g?e.jsx("span",{children:r("settings_page.copied")}):e.jsx("span",{className:"link",children:r("settings_page.copy_address")})})]})]})]}),e.jsxs(s.Grid.Row,{children:[e.jsx(s.Grid.Column,{computer:4,mobile:16,children:e.jsx("div",{className:"left-column secondary-text",children:r("settings_page.authorizations")})}),e.jsxs(s.Grid.Column,{computer:12,mobile:16,children:[e.jsx(s.Section,{className:"authoziations-disclaimer",children:r("settings_page.disclaimer",{emphasis:e.jsx("strong",{children:r("settings_page.emphasis")})})}),e.jsxs(s.Row,{className:"authorization-action",children:[e.jsx(u,{id:"settings_page.authorization_action",values:{address:e.jsx(s.Field,{value:o,onChange:this.handleAddressChange,placeholder:"0x...",error:o.length>0&&!p}),type:e.jsx(s.Dropdown,{options:[{text:"Parcels",value:h.PARCEL},{text:"Estates",value:h.ESTATE}],value:m,onChange:this.handleTypeChange})}}),e.jsx(s.Button,{size:"small",primary:!0,disabled:o.length===0||!p,onClick:this.handleAddAuthorization,children:r("global.submit")})]}),t.length>0?e.jsxs(s.Section,{children:[e.jsx(s.Header,{sub:!0,children:r("settings_page.authorizations_title")}),t.map(l=>e.jsxs(s.Row,{className:"authorization",children:[e.jsx(u,{id:"settings_page.authorization",values:{address:e.jsx(S,{address:l.address}),type:e.jsxs("span",{children:[" ",e.jsx("strong",{children:r(`global.${l.type}_plural`)})," "]})}}),e.jsx(s.Button,{basic:!0,onClick:()=>c(l.address,l.type,!1),children:r("global.revoke")})]}))]}):null]})]})]})})}renderLogin(){return e.jsx(f,{})}renderLoading(){return e.jsx("div",{className:"center",children:e.jsx(s.Loader,{active:!0,size:"huge"})})}render(){return e.jsx(P,{className:"SettingsPage",children:this.renderPage()})}};const R=i=>({wallet:T(i),authorizations:z(i)}),E=i=>({onSetUpdateManager:(n,t,a)=>i(N(n,t,a))}),B=_(R,E)(L);export{B as default};
1
+ var x=Object.defineProperty;var j=(i,n,t)=>n in i?x(i,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[n]=t;var d=(i,n,t)=>j(i,typeof n!="symbol"?n+"":n,t);import{D as C,bU as h,H as e,M as s,G as r,e7 as b,cA as v,cB as y,bm as u,bC as S,cc as A,N as _,e8 as T,e9 as z,ea as N}from"./index-ZuMScRBF.js";import{L as P}from"./LoggedInDetailPage.container-BO7Rsigx.js";import{S as f}from"./SignInRequired-D6dYEPdh.js";import"./Navigation.container-CsesGRoh.js";import"./selectors-CVDyed6b.js";let L=class extends C.PureComponent{constructor(){super(...arguments);d(this,"timeoutId",null);d(this,"state",{hasCopiedText:!1,type:h.PARCEL,managerAddress:""});d(this,"handleOnCopy",()=>{this.timeoutId&&clearTimeout(this.timeoutId),this.setState({hasCopiedText:!0}),this.timeoutId=setTimeout(()=>{this.timeoutId=null,this.setState({hasCopiedText:!1})},1200)});d(this,"handleAddressChange",(t,a)=>{this.setState({managerAddress:a.value})});d(this,"handleTypeChange",(t,a)=>{this.setState({type:a.value})});d(this,"handleAddAuthorization",()=>{const{onSetUpdateManager:t}=this.props,{managerAddress:a,type:c}=this.state;t(a,c,!0)})}renderPage(){const{authorizations:t,wallet:a,onSetUpdateManager:c}=this.props,{hasCopiedText:g,managerAddress:o,type:m}=this.state,p=A(o);return e.jsx(s.Grid,{children:a===null?e.jsx(s.Loader,{size:"big",active:!0}):e.jsxs(e.Fragment,{children:[e.jsxs(s.Grid.Row,{children:[e.jsx(s.Grid.Column,{computer:4,mobile:16,children:e.jsx("div",{className:"left-column secondary-text",children:r("global.address")})}),e.jsxs(s.Grid.Column,{computer:12,mobile:16,children:[e.jsx("div",{className:"blockie-container",children:e.jsx(s.Blockie,{seed:a.address,scale:12})}),e.jsxs("div",{className:"address-container",children:[e.jsx("div",{className:"address",children:b()?v(a.address):a.address}),e.jsx(y,{role:"button",text:a.address,onCopy:this.handleOnCopy,children:g?e.jsx("span",{children:r("settings_page.copied")}):e.jsx("span",{className:"link",children:r("settings_page.copy_address")})})]})]})]}),e.jsxs(s.Grid.Row,{children:[e.jsx(s.Grid.Column,{computer:4,mobile:16,children:e.jsx("div",{className:"left-column secondary-text",children:r("settings_page.authorizations")})}),e.jsxs(s.Grid.Column,{computer:12,mobile:16,children:[e.jsx(s.Section,{className:"authoziations-disclaimer",children:r("settings_page.disclaimer",{emphasis:e.jsx("strong",{children:r("settings_page.emphasis")})})}),e.jsxs(s.Row,{className:"authorization-action",children:[e.jsx(u,{id:"settings_page.authorization_action",values:{address:e.jsx(s.Field,{value:o,onChange:this.handleAddressChange,placeholder:"0x...",error:o.length>0&&!p}),type:e.jsx(s.Dropdown,{options:[{text:"Parcels",value:h.PARCEL},{text:"Estates",value:h.ESTATE}],value:m,onChange:this.handleTypeChange})}}),e.jsx(s.Button,{size:"small",primary:!0,disabled:o.length===0||!p,onClick:this.handleAddAuthorization,children:r("global.submit")})]}),t.length>0?e.jsxs(s.Section,{children:[e.jsx(s.Header,{sub:!0,children:r("settings_page.authorizations_title")}),t.map(l=>e.jsxs(s.Row,{className:"authorization",children:[e.jsx(u,{id:"settings_page.authorization",values:{address:e.jsx(S,{address:l.address}),type:e.jsxs("span",{children:[" ",e.jsx("strong",{children:r(`global.${l.type}_plural`)})," "]})}}),e.jsx(s.Button,{basic:!0,onClick:()=>c(l.address,l.type,!1),children:r("global.revoke")})]}))]}):null]})]})]})})}renderLogin(){return e.jsx(f,{})}renderLoading(){return e.jsx("div",{className:"center",children:e.jsx(s.Loader,{active:!0,size:"huge"})})}render(){return e.jsx(P,{className:"SettingsPage",children:this.renderPage()})}};const R=i=>({wallet:T(i),authorizations:z(i)}),E=i=>({onSetUpdateManager:(n,t,a)=>i(N(n,t,a))}),B=_(R,E)(L);export{B as default};
@@ -1 +1 @@
1
- import{D as l,Z as E,du as w,K as I,bB as h,H as e,M as d,G as r,bA as H,N as y,de as B,dj as T,a6 as R,bw as A,cH as O,bK as P,bZ as D,cK as F}from"./index-C2Y2eZ28.js";import{L as K}from"./LoggedInDetailPage.container-P8-KV9ow.js";import{B as z}from"./Back-iVIqxATW.js";import{N as G}from"./NotFound-DLc93Jdo.js";import"./Navigation.container-h_uvbEV-.js";import"./selectors-Zkd3yj1l.js";import"./SignInRequired-CvEoVbqe.js";function M(i){const[s,u]=l.useState(void 0),[g,L]=l.useState(void 0),{isLoading:b,ens:o,landTiles:c}=i,m=E(),x=l.useMemo(()=>{const a=Object.values(c||{});if(a.length===1)return a[0].land;let n;for(const t of a)if(t.land.id!==o.landId){n=t.land;break}return n},[c]);l.useEffect(()=>{!s&&!b&&o&&u(x)},[x]);const j=l.useCallback((a,n)=>{const t=h(a,n);return c&&t in c?c[t].land:void 0},[c]),f=l.useCallback((a,n)=>{const t=j(a,n);t&&u(t)},[]),v=l.useCallback(()=>{const a=w(c,s.id);u(a)},[s,c]),S=l.useCallback(()=>{s&&m.push(I.landAssignENS(s.id,o.subdomain))},[o,m,s]),C=l.useCallback((a,n)=>{const t=h(a,n);return(!s||s.id!==t)&&g===t},[]),_=l.useCallback((a,n)=>C(a,n)&&j(a,n)?{color:"#fcc6d1",scale:1.4}:null,[]),k=l.useCallback((a,n)=>{L(h(a,n))},[]),p=l.useCallback(()=>{m.goBack()},[m]),N=s&&o&&s.id===o.landId;return e.jsx(K,{className:"ENSSelectLandPage",hasNavigation:!1,children:b?e.jsx(d.Loader,{active:!0,size:"massive"}):o?e.jsxs(e.Fragment,{children:[e.jsx(z,{absolute:!0,onClick:p}),e.jsxs(d.Narrow,{children:[e.jsx(d.Row,{children:e.jsx(d.Column,{children:e.jsxs(d.Section,{children:[e.jsx(d.Header,{className:"title",size:"large",children:r("ens_select_land_page.title",{name:o?o.subdomain:r("global.name")})}),e.jsx("span",{className:"subtitle",children:r("ens_select_land_page.subtitle")})]})})}),e.jsx("div",{className:"atlas-wrapper",children:e.jsx(H,{showControls:!0,showOwner:!0,isDraggable:!0,landId:s?s.id:void 0,onClick:f,onHover:k,onLocateLand:v,layers:[_]})}),e.jsxs(d.Row,{className:"atlas-footer",children:[e.jsx(d.Column,{grow:!0,children:s?e.jsxs("div",{className:"selected-land",children:[e.jsx("div",{className:"label",children:r("ens_select_land_page.land_selected")}),e.jsxs("div",{className:"land",children:[s.name," (",s.id,")"]})]}):null}),e.jsx(d.Column,{grow:!1,children:e.jsxs("div",{className:"actions",children:[e.jsx(d.Button,{secondary:!0,onClick:p,children:r("global.cancel")}),e.jsx(d.Button,{primary:!0,disabled:!s||N,onClick:S,children:N?r("ens_select_land_page.already_assigned"):r("global.continue")})]})})]})]})]}):e.jsx(G,{})})}const Z=(i,s)=>{const{subdomain:u}=s.match.params,g=B(i);return{ens:T(g,u),isLoading:R(i)||A(O(i),F)||P(i),landTiles:D(i)}},X=y(Z)(M);export{X as default};
1
+ import{D as l,Z as E,du as w,K as I,bB as h,H as e,M as d,G as r,bA as H,N as y,de as B,dj as T,a6 as R,bw as A,cH as O,bK as P,bZ as D,cK as F}from"./index-ZuMScRBF.js";import{L as K}from"./LoggedInDetailPage.container-BO7Rsigx.js";import{B as z}from"./Back-D4W_O81e.js";import{N as G}from"./NotFound-PGQXtpug.js";import"./Navigation.container-CsesGRoh.js";import"./selectors-CVDyed6b.js";import"./SignInRequired-D6dYEPdh.js";function M(i){const[s,u]=l.useState(void 0),[g,L]=l.useState(void 0),{isLoading:b,ens:o,landTiles:c}=i,m=E(),x=l.useMemo(()=>{const a=Object.values(c||{});if(a.length===1)return a[0].land;let n;for(const t of a)if(t.land.id!==o.landId){n=t.land;break}return n},[c]);l.useEffect(()=>{!s&&!b&&o&&u(x)},[x]);const j=l.useCallback((a,n)=>{const t=h(a,n);return c&&t in c?c[t].land:void 0},[c]),f=l.useCallback((a,n)=>{const t=j(a,n);t&&u(t)},[]),v=l.useCallback(()=>{const a=w(c,s.id);u(a)},[s,c]),S=l.useCallback(()=>{s&&m.push(I.landAssignENS(s.id,o.subdomain))},[o,m,s]),C=l.useCallback((a,n)=>{const t=h(a,n);return(!s||s.id!==t)&&g===t},[]),_=l.useCallback((a,n)=>C(a,n)&&j(a,n)?{color:"#fcc6d1",scale:1.4}:null,[]),k=l.useCallback((a,n)=>{L(h(a,n))},[]),p=l.useCallback(()=>{m.goBack()},[m]),N=s&&o&&s.id===o.landId;return e.jsx(K,{className:"ENSSelectLandPage",hasNavigation:!1,children:b?e.jsx(d.Loader,{active:!0,size:"massive"}):o?e.jsxs(e.Fragment,{children:[e.jsx(z,{absolute:!0,onClick:p}),e.jsxs(d.Narrow,{children:[e.jsx(d.Row,{children:e.jsx(d.Column,{children:e.jsxs(d.Section,{children:[e.jsx(d.Header,{className:"title",size:"large",children:r("ens_select_land_page.title",{name:o?o.subdomain:r("global.name")})}),e.jsx("span",{className:"subtitle",children:r("ens_select_land_page.subtitle")})]})})}),e.jsx("div",{className:"atlas-wrapper",children:e.jsx(H,{showControls:!0,showOwner:!0,isDraggable:!0,landId:s?s.id:void 0,onClick:f,onHover:k,onLocateLand:v,layers:[_]})}),e.jsxs(d.Row,{className:"atlas-footer",children:[e.jsx(d.Column,{grow:!0,children:s?e.jsxs("div",{className:"selected-land",children:[e.jsx("div",{className:"label",children:r("ens_select_land_page.land_selected")}),e.jsxs("div",{className:"land",children:[s.name," (",s.id,")"]})]}):null}),e.jsx(d.Column,{grow:!1,children:e.jsxs("div",{className:"actions",children:[e.jsx(d.Button,{secondary:!0,onClick:p,children:r("global.cancel")}),e.jsx(d.Button,{primary:!0,disabled:!s||N,onClick:S,children:N?r("ens_select_land_page.already_assigned"):r("global.continue")})]})})]})]})]}):e.jsx(G,{})})}const Z=(i,s)=>{const{subdomain:u}=s.match.params,g=B(i);return{ens:T(g,u),isLoading:R(i)||A(O(i),F)||P(i),landTiles:D(i)}},X=y(Z)(M);export{X as default};
@@ -1 +1 @@
1
- import{af as ne,H as e,M as a,G as n,D as r,fo as K,fp as Ne,eO as v,ce as Fe,b8 as V,N as F,eQ as fe,fq as le,fr as Ue,X as M,fs as He,ft as ve,eZ as J,cB as ue,fu as me,e8 as ye,cC as We,bw as $,eC as Y,fv as Oe,et as ze,fw as Ge,fc as ke,bk as Ye,Z as Ee,fx as q,fy as te,K as w,eR as Te,er as _e,fz as qe,fA as Qe,bu as ee,fB as Ve,f3 as Je,f4 as Ze,e$ as Pe,eT as Se,L as pe,fC as Xe,dC as Ke,ep as es,f7 as ss,fD as as,fE as Q,fF as ts,f2 as ns,eD as he,fG as xe,aH as ls,cN as os,fH as Re,eo as is,fI as rs,fJ as cs,bv as ds,eX as f,fK as us,eu as ms,J as L,fL as be,a1 as se,fM as _s,f5 as ae,fN as ge,fO as ps,fb as hs,fP as xs,fQ as bs,fR as gs,fS as Cs,fT as js}from"./index-C2Y2eZ28.js";import{g as Is}from"./selector-CtnQnmhq.js";import{C as Ns}from"./CollectionProvider.container-D5AviJmj.js";import{L as fs}from"./LoggedInDetailPage.container-P8-KV9ow.js";import{N as vs}from"./NotFound-DLc93Jdo.js";import{B as ys}from"./Back-iVIqxATW.js";import{C as ks}from"./CollectionStatus.container-BA96F5oG.js";import{J as Es}from"./JumpIn.container-Bfsb8XQY.js";import{C as Ts}from"./ConfirmDelete-DbFeXC54.js";import"./Navigation.container-h_uvbEV-.js";import"./selectors-Zkd3yj1l.js";import"./SignInRequired-CvEoVbqe.js";const Ps=({type:s})=>e.jsx(a.Popup,{content:n(s==="publish"?"collection_detail_page.cant_mint":"collection_detail_page.cant_push"),position:"top center",trigger:e.jsx("div",{className:"popup-button",children:e.jsx(a.Button,{secondary:!0,compact:!0,disabled:!0,children:n("collection_detail_page.under_review")})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:s==="publish"}),Ce=ne.memo(Ps),Ss=s=>{const{collection:l,items:o,status:t,hasPendingCuration:u,onPublish:d,onPush:_,onInit:j}=s;r.useEffect(()=>{l.isPublished&&j()},[l,j]);const x=o.length>K,k=r.useMemo(()=>o.length===0||!o.every(Ne)||x,[o,x]);let g;if(l.isPublished)l.isApproved?u?g=e.jsx(Ce,{type:"push"}):t===v.UNSYNCED?g=e.jsx(a.Button,{primary:!0,compact:!0,onClick:_,children:n("collection_detail_page.push_changes")}):g=e.jsx(a.Button,{secondary:!0,compact:!0,disabled:!0,children:n("global.published")}):g=e.jsx(Ce,{type:"publish"});else{const y=e.jsx(Fe,{disabled:k,primary:!0,compact:!0,onClick:d,network:V.Network.MATIC,children:n("collection_detail_page.publish")});if(k){let b;o.length>K?b=n("collection_detail_page.publish_reason_max_items",{maxItems:K}):o.length===0?b=n("collection_detail_page.publish_reason_no_items"):b=n("collection_detail_page.publish_reason_items_not_complete"),g=e.jsx(a.Popup,{content:b,position:"top center",trigger:e.jsx("div",{className:"popup-button",children:y}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})}else g=y}return g},Rs=ne.memo(Ss),ws=(s,l)=>{const{id:o}=l.collection,t=fe(s);return{items:le(s,o),status:t[o],hasPendingCuration:Ue(s,o)}},Ms=(s,l)=>{const{id:o}=l.collection;return{onPublish:()=>s(M("PublishWizardCollectionModal",{collectionId:o})),onPush:()=>s(M("PushCollectionChangesModal",{collectionId:o})),onInit:()=>s(He(o))}},je=F(ws,Ms)(Rs),Ds="_dropdown_1a07a_1",As="_ellipsis_1a07a_9",Bs="_menu_1a07a_13",Ls="_disabled_1a07a_13",$s="_item_1a07a_13",Ie={dropdown:Ds,ellipsis:As,menu:Bs,disabled:Ls,item:$s},Fs=({collection:s,wallet:l,onOpenModal:o,onDelete:t})=>{const u=()=>{o("ManageCollectionRoleModal",{type:me.MANAGER,collectionId:s.id,roles:s.managers})},d=()=>{o("ManageCollectionRoleModal",{type:me.MINTER,collectionId:s.id,roles:s.minters})},_=()=>{o("AddExistingItemModal",{collectionId:s.id})},j=()=>{t(s)},x=ve(s,l.address);return e.jsx(a.Dropdown,{className:Ie.dropdown,trigger:e.jsx(a.Button,{basic:!0,children:e.jsx(a.Icon,{className:Ie.ellipsis,name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(a.Dropdown.Menu,{children:[s.isPublished?x?e.jsxs(e.Fragment,{children:[e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.managers"),onClick:u}),e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.minters"),onClick:d})]}):null:J(s)?null:e.jsxs(e.Fragment,{children:[e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.add_existing_item"),onClick:_}),e.jsx(Ts,{name:s.name,onDelete:j,trigger:e.jsx(a.Dropdown.Item,{text:n("global.delete")})})]}),e.jsx(ue,{role:"option",className:"item",text:s.urn,children:e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.copy_urn")})}),e.jsx(a.Popup,{content:n("collection_context_menu.unpublished"),position:"right center",disabled:s.isPublished,trigger:e.jsx(ue,{role:"option",className:"item",text:s.contractAddress,children:e.jsx(a.Dropdown.Item,{disabled:!s.isPublished,text:n("collection_context_menu.copy_address")})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})]})})},Us=Fs,Hs=(s,l)=>({wallet:ye(s),items:le(s,l.collection.id),name:We(s)||"",isForumPostLoading:$(Y(s),Ge)}),Ws=s=>({onOpenModal:(l,o)=>s(M(l,o)),onPostToForum:(l,o)=>s(Oe(l,o)),onDelete:l=>s(ze(l))}),Os=F(Hs,Ws)(Us),zs=({isEnabled:s,onClick:l})=>s?e.jsx(a.Dropdown.Item,{text:n("collection_item.reset_item"),onClick:l}):null,Gs=ne.memo(zs),Ys=(s,l)=>{const{itemId:o}=l;return{isEnabled:ke(s)[o]===v.UNSYNCED}},qs=(s,l)=>{const{itemId:o}=l;return{onClick:()=>s(M("ResetItemModal",{itemId:o}))}},Qs=F(Ys,qs)(Gs),Vs="_itemImage_10lcv_1",Js="_itemStatus_10lcv_9",Zs="_mana_10lcv_13",Xs="_grid_10lcv_19",Ks="_row_10lcv_30",ea="_avatarColumn_10lcv_35",sa="_avatarContainer_10lcv_40",aa="_info_10lcv_44",ta="_nameWrapper_10lcv_49",na="_badgeContainer_10lcv_54",la="_badge_10lcv_54",oa="_name_10lcv_49",ia="_linkAction_10lcv_76",ra="_subtitle_10lcv_80",ca="_itemActions_10lcv_86",da="_removeSaleButton_10lcv_93",ua="_status_10lcv_98",ma="_ready_10lcv_112",_a="_notReady_10lcv_117",pa="_incomplete_10lcv_122",ha="_published_10lcv_126",xa="_underReview_10lcv_131",ba="_unsynced_10lcv_132",ga="_alertIcon_10lcv_137",Ca="_check_10lcv_148",ja="_contextMenuButton_10lcv_152",Ia="_contextMenu_10lcv_152",i={itemImage:Vs,itemStatus:Js,mana:Zs,grid:Xs,row:Ks,avatarColumn:ea,avatarContainer:sa,info:aa,nameWrapper:ta,badgeContainer:na,badge:la,name:oa,linkAction:ia,subtitle:ra,itemActions:ca,removeSaleButton:da,status:ua,ready:ma,notReady:_a,incomplete:pa,published:ha,underReview:xa,unsynced:ba,alertIcon:ga,check:Ca,contextMenuButton:ja,contextMenu:Ia},Na=25;function fa({onOpenModal:s,onSetItems:l,onRemoveFromSale:o,item:t,isOffchainPublicItemOrdersEnabled:u,collection:d,status:_,ethAddress:j,wallet:x,loadingTradeIds:k,isCancellingItemOrder:g}){const y=Ye(),b=Ee(),E=x&&q(d,x),C=x&&u&&te(d,x),U=!u||C&&t.tradeId||E,T=r.useCallback(()=>{if(u&&C){s("PutForSaleOffchainModal",{itemId:t.id});return}s("EditPriceAndBeneficiaryModal",{itemId:t.id})},[t,s]),D=r.useCallback(()=>{s("SeeInWorldModal",{itemIds:[t.id]})},[s,t]),N=r.useCallback(()=>{l([t]),b.push(w.itemEditor({itemId:t.id,collectionId:t.collectionId}),{fromParam:Te.COLLECTIONS}),y==null||y.track("Preview Item",{ITEM_ID:t!=null&&t.urn?_e(t.urn)?qe(t.urn):Qe(t.urn):null,ITEM_TYPE:t.type,ITEM_NAME:t.name,ITEM_IS_THIRD_PARTY:_e(t.urn)})},[t,l,b]),A=r.useCallback(()=>{s("DeleteItemModal",{item:t})},[t,s]),P=r.useCallback(()=>{s("MoveItemToAnotherCollectionModal",{item:t,fromCollection:d})},[t,s,d]),H=r.useCallback(()=>{s("PutForSaleOffchainModal",{itemId:t.id})},[]),W=r.useCallback(()=>{t.tradeId&&o(t.tradeId)},[t]),Z=r.useCallback(()=>t.price?t.price===Ve.toString()||u&&!E&&!t.tradeId?e.jsx("span",{children:"-"}):Je(t)?e.jsx("span",{children:n("global.free")}):e.jsx(a.Mana,{className:i.mana,network:V.Network.MATIC,showTooltip:!0,children:Ze(t.price)}):e.jsx("div",{className:`link ${i.linkAction}`,onClick:ee(T),children:n("collection_item.set_price")}),[t,E,u,T]),S=r.useCallback(()=>_===v.UNSYNCED?e.jsxs("div",{className:`${i.unsynced} ${i.status}`,children:[e.jsx("div",{className:i.alertIcon}),n("collection_item.unsynced")]}):_===v.UNDER_REVIEW||t.isPublished&&!t.isApproved?e.jsxs("div",{className:`${i.underReview} ${i.status}`,children:[e.jsx(a.Icon,{name:"clock outline"}),n("collection_item.under_review")]}):t.isPublished&&t.isApproved?e.jsxs("div",{className:`${i.published} ${i.status}`,children:[e.jsx(a.Icon,{name:"check circle outline"}),n("collection_item.published")]}):Ne(t)?e.jsxs("div",{className:`${i.ready} ${i.status}`,children:[e.jsx(a.Icon,{className:i.check,name:"cloud upload"}),n("collection_item.ready")]}):!t.price||Pe(t)&&!(Se in t.contents)?e.jsxs("div",{className:`${i.notReady} ${i.status}`,children:[e.jsx(a.Icon,{name:"exclamation circle"}),n("collection_item.not_ready")]}):e.jsx("span",{onClick:ee(N),className:`link ${i.linkAction}`,children:n("collection_item.edit_item")}),[N,t,_]),R=r.useCallback(()=>e.jsx("div",{className:i.itemActions,children:e.jsx(a.Dropdown,{trigger:e.jsx(a.Button,{basic:!0,children:e.jsx(a.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",className:i.action,onClick:ee(),children:e.jsxs(a.Dropdown.Menu,{className:i.contextMenu,children:[e.jsx(a.Dropdown.Item,{text:n("collection_item.see_details"),as:pe,to:w.itemDetail(t.id)}),e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.see_in_decentraland"),onClick:D}),e.jsx(a.Dropdown.Item,{text:n("collection_item.preview"),onClick:N}),!d.isPublished&&e.jsx(a.Dropdown.Item,{text:n("collection_item.move_to_another_collection"),onClick:P}),Xe(d,t,j)&&!J(d)?e.jsxs(e.Fragment,{children:[t.price&&U?e.jsx(a.Dropdown.Item,{text:n("collection_item.edit_price"),onClick:T}):null,e.jsx(Qs,{itemId:t.id}),t.isPublished?null:e.jsxs(e.Fragment,{children:[e.jsx(a.Dropdown.Divider,{}),e.jsx(a.Dropdown.Item,{text:n("collection_item.delete_item"),onClick:A})]})]}):null]})})}),[d,t,j,D,N,P,T,A]),I=t.data;return e.jsxs(a.Table.Row,{className:`CollectionItem ${i.row}`,children:[e.jsx(a.Table.Cell,{className:`${i.avatarColumn}`,width:t.name.length>Na?6:5,children:e.jsx(pe,{to:w.itemDetail(t.id),className:"CollectionItem",children:e.jsxs("div",{className:i.avatarContainer,children:[e.jsx(Ke,{className:i.itemImage,item:t}),e.jsx("div",{className:i.info,children:e.jsx("div",{className:i.nameWrapper,children:e.jsxs("div",{className:i.name,title:t.name,children:[e.jsx(es,{className:i.itemStatus,item:t}),t.name,e.jsx("div",{className:i.badgeContainer,children:e.jsx(ss,{className:i.badge,item:t,size:"small"})})]})})})]})})}),e.jsx(a.Table.Cell,{className:i.column,children:t.rarity&&I.category?e.jsx(as,{size:"medium",rarity:t.rarity,withTooltip:!0}):null}),e.jsx(a.Table.Cell,{className:i.column,children:I.category?e.jsx("div",{children:n(`${t.type}.category.${I.category}`)}):null}),Q(t)&&ts(I)?e.jsx(a.Table.Cell,{className:i.column,children:I.category?e.jsx("div",{children:n(`emote.play_mode.${I.loop?"loop":"simple"}.text`)}):null}):null,u&&!d.isPublished?null:e.jsx(a.Table.Cell,{className:i.column,children:Z()}),t.isPublished&&t.isApproved?e.jsx(a.Table.Cell,{className:i.column,children:e.jsxs("div",{children:[t.totalSupply,"/",ns(t)]})}):null,e.jsx(a.Table.Cell,{children:S()}),u&&!E&&!t.tradeId&&t.isPublished&&e.jsx(a.Table.Cell,{children:e.jsx(a.Button,{primary:!0,size:"tiny",disabled:!C,onClick:H,children:n("collection_item.put_for_sale")})}),u&&t.tradeId&&e.jsx(a.Table.Cell,{children:e.jsx(a.Button,{secondary:!0,size:"tiny",className:i.removeSaleButton,onClick:W,loading:g&&k.includes(t.tradeId),children:n("collection_item.remove_from_sale")})}),e.jsx(a.Table.Cell,{className:i.contextMenuButton,children:R()})]})}const va=(s,l)=>{const o=ke(s),t=he(s).filter(u=>u.type===xe).map(u=>u.payload.tradeId);return{ethAddress:ls(s),status:o[l.item.id],wallet:os(s),isOffchainPublicItemOrdersEnabled:Re(s),isCancellingItemOrder:$(he(s),xe),loadingTradeIds:t}},ya=s=>({onOpenModal:(l,o)=>s(M(l,o)),onDeleteItem:l=>s(is(l)),onSetItems:l=>s(rs(l)),onRemoveFromSale:l=>s(cs(l,!0))}),ka=F(va,ya)(fa);function Ea({collection:s,wallet:l,items:o,isOnSaleLoading:t,lastLocation:u,status:d,onOpenModal:_,isLoading:j,isOffchainPublicItemOrdersEnabled:x,onFetchCollectionForumPostReply:k}){const g=ds(),y=r.useMemo(()=>new URLSearchParams(g.search).get("tab"),[g]),[b,E]=r.useState(y||f.WEARABLE),C=Ee(),U=u===w.collections(),T=r.useCallback(()=>{s&&s.isPublished&&!s.isApproved&&s.forumLink&&k(s.id)},[s,k]);r.useEffect(()=>{s&&T()},[s]);const D=r.useCallback(()=>{_("MintItemsModal",{collectionId:s.id})},[s,_]),N=r.useCallback(()=>{_("CreateSingleItemModal",{collectionId:s.id})},[s,_]),A=r.useCallback(()=>{s&&!s.isPublished&&_("EditCollectionNameModal",{collection:s})},[s,_]),P=r.useCallback(()=>{s&&_("SellCollectionModal",{collectionId:s.id,isOnSale:te(s,l)||q(s,l)})},[s,l,_]),H=r.useCallback(()=>{U?C.goBack():C.push(w.collections())},[C,U]),W=r.useCallback(()=>{s&&C.push(us(s,o),{fromParam:Te.COLLECTIONS})},[C,s,o]),Z=r.useCallback((c,p="")=>{const m=window.open(c,p);m&&m.focus()},[]),S=r.useCallback(()=>{s&&s.isPublished&&s.forumLink&&Z(s.forumLink,"_blank")},[s]),R=r.useCallback(c=>{E(c),C.push(w.collectionDetail(s.id,ms.STANDARD,{tab:b}))},[s,C]),I=r.useCallback(c=>{const p=c===f.WEARABLE?n("collection_detail_page.wearables"):n("collection_detail_page.emotes");return e.jsx(a.Popup,{className:"modal-tooltip",content:n("collection_detail_page.missing_item_price",{item_type:p.toLowerCase()}),position:"top center",trigger:e.jsx("i",{"aria-hidden":"true",className:"circle icon tiny"})})},[]),oe=r.useCallback(()=>e.jsx(a.Popup,{className:"modal-tooltip",content:n("collection_detail_page.missing_smart_wearable_video"),position:"top center",trigger:e.jsx("i",{"aria-hidden":"true",className:"circle icon tiny"})}),[]),X=r.useCallback(c=>{if(!s)return null;const p=J(s),m=c.length>0;return e.jsxs(e.Fragment,{children:[e.jsx(Es,{size:"small",active:!0,collection:s,text:n("global.see_in_decentraland"),disabled:p||!m}),e.jsxs(a.Button,{basic:!0,className:"action-button",disabled:p||!m,onClick:W,children:[e.jsx(L,{name:"cube"}),e.jsx("span",{className:"text",children:n("collection_detail_page.preview")})]}),m&&!s.isPublished?e.jsxs(a.Button,{basic:!0,className:"action-button add-items",disabled:p,onClick:N,children:[e.jsx(L,{name:"add-active"}),e.jsx("span",{className:"text",children:n("collection_detail_page.add_item")})]}):null]})},[s,W,N]),ie=r.useCallback(()=>{if(!s)return null;const c=q(s,l),p=te(s,l);return x&&!c?p?null:e.jsx(be,{network:V.Network.MATIC,children:m=>e.jsxs(a.Button,{className:se("action-button",p?"secondary":"primary"),disabled:t||!m,onClick:P,children:[e.jsx(a.Icon,{name:"lock"}),e.jsx("span",{className:"text",children:n("collection_detail_page.enable_sales")})]})}):e.jsx(be,{network:V.Network.MATIC,children:m=>e.jsx(a.Button,{className:se("action-button",c?"basic":"primary"),disabled:t||!m,onClick:P,children:e.jsx("span",{className:"text",children:c?n("collection_detail_page.remove_from_marketplace"):n("collection_detail_page.put_for_sale")})})})},[s,x,P]),O=r.useCallback((c="tiny")=>{if(s!=null&&s.forumPostReply){const{highest_post_number:p,last_read_post_number:m}=s.forumPostReply,z=p-(m??0);return e.jsx(a.Label,{className:"badge-forum-unread-posts",circular:!0,size:c,children:z})}return null},[s]),re=r.useCallback(()=>!(s!=null&&s.isApproved)||![v.UNSYNCED,v.UNDER_REVIEW].includes(d)?null:e.jsxs("div",{className:"unsynced-collection container",children:[e.jsx("i",{className:"unsynced-collection alert-icon"}),e.jsxs("div",{className:"unsynced-collection message",children:[e.jsx("h4",{className:"unsynced-collection title",children:n("collection_detail_page.unsynced_collection_title")}),e.jsx("p",{className:"unsynced-collection text",children:n(`collection_detail_page.${d}_collection_message`,{br:e.jsx("br",{})})})]}),d===v.UNDER_REVIEW?e.jsxs(a.Button,{primary:!0,onClick:S,className:"unsynced-collection action-button",children:[e.jsx("span",{children:n("collection_context_menu.forum_post")}),O("medium")]}):null,d===v.UNSYNCED?e.jsx(je,{collection:s}):null]}),[s,d,O,S]),we=r.useCallback(c=>{if(!s)return null;const p=_s(s,l.address),m=J(s),z=q(s,l),G=c.some(Q),B=c.some(ae),Me=G?c.some(h=>Q(h)&&!h.price):!1,De=B?c.some(h=>ae(h)&&!h.price):!1,Ae=B&&c.some(h=>Pe(h)&&!(Se in h.contents)),de=G&&!B,Be=B&&!G,Le=c.filter(h=>Be?ae(h):de?Q(h):h.type===b),$e=G&&B;return e.jsxs(e.Fragment,{children:[e.jsx(a.Section,{className:se({"is-published":s.isPublished}),children:e.jsxs(a.Row,{children:[e.jsx(ys,{absolute:!0,onClick:H}),e.jsx(a.Narrow,{children:e.jsxs(a.Row,{children:[e.jsx(a.Column,{grow:!1,className:"name-container",children:m?e.jsxs(a.Header,{size:"huge",className:"name",children:[s.isPublished&&e.jsx(ks,{collection:s}),s.name]}):e.jsxs(a.Row,{className:"header-row",onClick:A,children:[e.jsx(a.Header,{size:"huge",className:"name",children:s.name}),e.jsx(L,{name:"edit",className:"edit-collection-name"}),z?e.jsx(a.Label,{className:"badge-on-sale",size:"small",circular:!0,children:n("collection_detail_page.on_sale")}):null]})}),e.jsx(a.Column,{align:"right",className:"actions-container",shrink:!1,grow:!1,children:e.jsxs(a.Row,{className:"actions",children:[s.isPublished&&s.isApproved?e.jsx(a.Popup,{content:n("collection_detail_page.can_mint"),className:"CollectionDetailPage popup-mint",position:"top center",trigger:e.jsx(a.Button,{basic:!0,className:"action-button",disabled:!p,onClick:D,children:e.jsx("span",{className:"text",children:n("collection_detail_page.mint_items")})}),on:"hover",inverted:!0,flowing:!0}):null,s.isPublished&&s.forumLink&&!s.isApproved?e.jsxs(e.Fragment,{children:[e.jsx(a.Button,{basic:!0,onClick:S,children:e.jsx("span",{children:n("collection_context_menu.forum_post")})}),s!=null&&s.forumPostReply?O():null]}):null,!(s.isPublished&&s.isApproved)&&d!==v.UNSYNCED?e.jsx(je,{collection:s}):null,ve(s,l.address)&&s.isPublished&&s.isApproved?ie():null,ge(s,l.address)?e.jsx(Os,{collection:s}):null]})})]})})]})}),e.jsxs(a.Narrow,{children:[re(),$e?e.jsxs(a.Tabs,{isFullscreen:!0,children:[e.jsxs(a.Tabs.Tab,{active:b===f.WEARABLE,onClick:()=>R(f.WEARABLE),children:[e.jsx(L,{name:"wearable"}),n("collection_detail_page.wearables"),De?I(f.WEARABLE):Ae?oe():null]}),e.jsxs(a.Tabs.Tab,{active:b===f.EMOTE,onClick:()=>R(f.EMOTE),children:[e.jsx(L,{name:"emote"}),n("collection_detail_page.emotes"),Me?I(f.EMOTE):null]}),e.jsx("div",{className:"secondary-actions tab",children:X(c)})]}):e.jsx("div",{className:"secondary-actions",children:X(c)}),c.length>0?e.jsxs(a.Table,{basic:"very",children:[e.jsx(a.Table.Header,{children:e.jsxs(a.Table.Row,{children:[e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.item")}),e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.rarity")}),e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.category")}),b===f.EMOTE||de?e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.play_mode")}):null,x&&!s.isPublished?null:e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.price")}),s.isPublished&&s.isApproved?e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.supply")}):null,e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.status")}),x&&!z&&e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.actions")}),e.jsx(a.Table.HeaderCell,{})]})}),e.jsx(a.Table.Body,{children:Le.map(h=>e.jsx(ka,{collection:s,item:h},h.id))})]}):e.jsxs("div",{className:"empty",children:[e.jsx("div",{className:"sparkles"}),e.jsxs("div",{children:[e.jsx("span",{className:"empty-collection-title",children:n("collection_detail_page.add_items_title")}),e.jsx("br",{}),n("collection_detail_page.add_items_subtitle"),e.jsx("br",{}),n("collection_detail_page.cant_remove"),e.jsx("br",{}),e.jsx(a.Button,{basic:!0,className:"empty-action-button",disabled:m,onClick:N,children:e.jsx("span",{className:"text",children:n("collection_detail_page.add_item")})})]})]})]})]})},[b,d,l,s,N,X,A,I,R,re,ie,R,S,oe,O,D,H]),ce=l!==null&&s!==null&&ge(s,l.address);return e.jsx(Ns,{id:s==null?void 0:s.id,itemsPage:1,itemsPageSize:5e3,children:({isLoadingCollection:c,isLoadingCollectionItems:p,items:m})=>e.jsx(fs,{className:"CollectionDetailPage",hasNavigation:!ce&&!j&&!c,isLoading:j||c||p,children:ce?we(m):e.jsx(vs,{})})})}const Ta=s=>{const l=ps(s)||"",o=hs(s,l),t=fe(s);return{wallet:ye(s),collection:o,isOnSaleLoading:xs(s)||$(Y(s),gs),items:le(s,l),status:t[l],isLoading:$(Y(s),Cs)||$(Y(s),js),lastLocation:Is(s),isOffchainPublicItemOrdersEnabled:Re(s)}},Pa=s=>({onOpenModal:(l,o)=>s(M(l,o)),onFetchCollectionForumPostReply:l=>s(bs(l))}),Oa=F(Ta,Pa)(Ea);export{Oa as default};
1
+ import{af as ne,H as e,M as a,G as n,D as r,fo as K,fp as Ne,eO as v,ce as Fe,b8 as V,N as F,eQ as fe,fq as le,fr as Ue,X as M,fs as He,ft as ve,eZ as J,cB as ue,fu as me,e8 as ye,cC as We,bw as $,eC as Y,fv as Oe,et as ze,fw as Ge,fc as ke,bk as Ye,Z as Ee,fx as q,fy as te,K as w,eR as Te,er as _e,fz as qe,fA as Qe,bu as ee,fB as Ve,f3 as Je,f4 as Ze,e$ as Pe,eT as Se,L as pe,fC as Xe,dC as Ke,ep as es,f7 as ss,fD as as,fE as Q,fF as ts,f2 as ns,eD as he,fG as xe,aH as ls,cN as os,fH as Re,eo as is,fI as rs,fJ as cs,bv as ds,eX as f,fK as us,eu as ms,J as L,fL as be,a1 as se,fM as _s,f5 as ae,fN as ge,fO as ps,fb as hs,fP as xs,fQ as bs,fR as gs,fS as Cs,fT as js}from"./index-ZuMScRBF.js";import{g as Is}from"./selector-CtnQnmhq.js";import{C as Ns}from"./CollectionProvider.container-CJ2iDKGX.js";import{L as fs}from"./LoggedInDetailPage.container-BO7Rsigx.js";import{N as vs}from"./NotFound-PGQXtpug.js";import{B as ys}from"./Back-D4W_O81e.js";import{C as ks}from"./CollectionStatus.container-IWl9eE40.js";import{J as Es}from"./JumpIn.container-D2EpA82b.js";import{C as Ts}from"./ConfirmDelete-CGDLMrJr.js";import"./Navigation.container-CsesGRoh.js";import"./selectors-CVDyed6b.js";import"./SignInRequired-D6dYEPdh.js";const Ps=({type:s})=>e.jsx(a.Popup,{content:n(s==="publish"?"collection_detail_page.cant_mint":"collection_detail_page.cant_push"),position:"top center",trigger:e.jsx("div",{className:"popup-button",children:e.jsx(a.Button,{secondary:!0,compact:!0,disabled:!0,children:n("collection_detail_page.under_review")})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:s==="publish"}),Ce=ne.memo(Ps),Ss=s=>{const{collection:l,items:o,status:t,hasPendingCuration:u,onPublish:d,onPush:_,onInit:j}=s;r.useEffect(()=>{l.isPublished&&j()},[l,j]);const x=o.length>K,k=r.useMemo(()=>o.length===0||!o.every(Ne)||x,[o,x]);let g;if(l.isPublished)l.isApproved?u?g=e.jsx(Ce,{type:"push"}):t===v.UNSYNCED?g=e.jsx(a.Button,{primary:!0,compact:!0,onClick:_,children:n("collection_detail_page.push_changes")}):g=e.jsx(a.Button,{secondary:!0,compact:!0,disabled:!0,children:n("global.published")}):g=e.jsx(Ce,{type:"publish"});else{const y=e.jsx(Fe,{disabled:k,primary:!0,compact:!0,onClick:d,network:V.Network.MATIC,children:n("collection_detail_page.publish")});if(k){let b;o.length>K?b=n("collection_detail_page.publish_reason_max_items",{maxItems:K}):o.length===0?b=n("collection_detail_page.publish_reason_no_items"):b=n("collection_detail_page.publish_reason_items_not_complete"),g=e.jsx(a.Popup,{content:b,position:"top center",trigger:e.jsx("div",{className:"popup-button",children:y}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})}else g=y}return g},Rs=ne.memo(Ss),ws=(s,l)=>{const{id:o}=l.collection,t=fe(s);return{items:le(s,o),status:t[o],hasPendingCuration:Ue(s,o)}},Ms=(s,l)=>{const{id:o}=l.collection;return{onPublish:()=>s(M("PublishWizardCollectionModal",{collectionId:o})),onPush:()=>s(M("PushCollectionChangesModal",{collectionId:o})),onInit:()=>s(He(o))}},je=F(ws,Ms)(Rs),Ds="_dropdown_1a07a_1",As="_ellipsis_1a07a_9",Bs="_menu_1a07a_13",Ls="_disabled_1a07a_13",$s="_item_1a07a_13",Ie={dropdown:Ds,ellipsis:As,menu:Bs,disabled:Ls,item:$s},Fs=({collection:s,wallet:l,onOpenModal:o,onDelete:t})=>{const u=()=>{o("ManageCollectionRoleModal",{type:me.MANAGER,collectionId:s.id,roles:s.managers})},d=()=>{o("ManageCollectionRoleModal",{type:me.MINTER,collectionId:s.id,roles:s.minters})},_=()=>{o("AddExistingItemModal",{collectionId:s.id})},j=()=>{t(s)},x=ve(s,l.address);return e.jsx(a.Dropdown,{className:Ie.dropdown,trigger:e.jsx(a.Button,{basic:!0,children:e.jsx(a.Icon,{className:Ie.ellipsis,name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(a.Dropdown.Menu,{children:[s.isPublished?x?e.jsxs(e.Fragment,{children:[e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.managers"),onClick:u}),e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.minters"),onClick:d})]}):null:J(s)?null:e.jsxs(e.Fragment,{children:[e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.add_existing_item"),onClick:_}),e.jsx(Ts,{name:s.name,onDelete:j,trigger:e.jsx(a.Dropdown.Item,{text:n("global.delete")})})]}),e.jsx(ue,{role:"option",className:"item",text:s.urn,children:e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.copy_urn")})}),e.jsx(a.Popup,{content:n("collection_context_menu.unpublished"),position:"right center",disabled:s.isPublished,trigger:e.jsx(ue,{role:"option",className:"item",text:s.contractAddress,children:e.jsx(a.Dropdown.Item,{disabled:!s.isPublished,text:n("collection_context_menu.copy_address")})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})]})})},Us=Fs,Hs=(s,l)=>({wallet:ye(s),items:le(s,l.collection.id),name:We(s)||"",isForumPostLoading:$(Y(s),Ge)}),Ws=s=>({onOpenModal:(l,o)=>s(M(l,o)),onPostToForum:(l,o)=>s(Oe(l,o)),onDelete:l=>s(ze(l))}),Os=F(Hs,Ws)(Us),zs=({isEnabled:s,onClick:l})=>s?e.jsx(a.Dropdown.Item,{text:n("collection_item.reset_item"),onClick:l}):null,Gs=ne.memo(zs),Ys=(s,l)=>{const{itemId:o}=l;return{isEnabled:ke(s)[o]===v.UNSYNCED}},qs=(s,l)=>{const{itemId:o}=l;return{onClick:()=>s(M("ResetItemModal",{itemId:o}))}},Qs=F(Ys,qs)(Gs),Vs="_itemImage_10lcv_1",Js="_itemStatus_10lcv_9",Zs="_mana_10lcv_13",Xs="_grid_10lcv_19",Ks="_row_10lcv_30",ea="_avatarColumn_10lcv_35",sa="_avatarContainer_10lcv_40",aa="_info_10lcv_44",ta="_nameWrapper_10lcv_49",na="_badgeContainer_10lcv_54",la="_badge_10lcv_54",oa="_name_10lcv_49",ia="_linkAction_10lcv_76",ra="_subtitle_10lcv_80",ca="_itemActions_10lcv_86",da="_removeSaleButton_10lcv_93",ua="_status_10lcv_98",ma="_ready_10lcv_112",_a="_notReady_10lcv_117",pa="_incomplete_10lcv_122",ha="_published_10lcv_126",xa="_underReview_10lcv_131",ba="_unsynced_10lcv_132",ga="_alertIcon_10lcv_137",Ca="_check_10lcv_148",ja="_contextMenuButton_10lcv_152",Ia="_contextMenu_10lcv_152",i={itemImage:Vs,itemStatus:Js,mana:Zs,grid:Xs,row:Ks,avatarColumn:ea,avatarContainer:sa,info:aa,nameWrapper:ta,badgeContainer:na,badge:la,name:oa,linkAction:ia,subtitle:ra,itemActions:ca,removeSaleButton:da,status:ua,ready:ma,notReady:_a,incomplete:pa,published:ha,underReview:xa,unsynced:ba,alertIcon:ga,check:Ca,contextMenuButton:ja,contextMenu:Ia},Na=25;function fa({onOpenModal:s,onSetItems:l,onRemoveFromSale:o,item:t,isOffchainPublicItemOrdersEnabled:u,collection:d,status:_,ethAddress:j,wallet:x,loadingTradeIds:k,isCancellingItemOrder:g}){const y=Ye(),b=Ee(),E=x&&q(d,x),C=x&&u&&te(d,x),U=!u||C&&t.tradeId||E,T=r.useCallback(()=>{if(u&&C){s("PutForSaleOffchainModal",{itemId:t.id});return}s("EditPriceAndBeneficiaryModal",{itemId:t.id})},[t,s]),D=r.useCallback(()=>{s("SeeInWorldModal",{itemIds:[t.id]})},[s,t]),N=r.useCallback(()=>{l([t]),b.push(w.itemEditor({itemId:t.id,collectionId:t.collectionId}),{fromParam:Te.COLLECTIONS}),y==null||y.track("Preview Item",{ITEM_ID:t!=null&&t.urn?_e(t.urn)?qe(t.urn):Qe(t.urn):null,ITEM_TYPE:t.type,ITEM_NAME:t.name,ITEM_IS_THIRD_PARTY:_e(t.urn)})},[t,l,b]),A=r.useCallback(()=>{s("DeleteItemModal",{item:t})},[t,s]),P=r.useCallback(()=>{s("MoveItemToAnotherCollectionModal",{item:t,fromCollection:d})},[t,s,d]),H=r.useCallback(()=>{s("PutForSaleOffchainModal",{itemId:t.id})},[]),W=r.useCallback(()=>{t.tradeId&&o(t.tradeId)},[t]),Z=r.useCallback(()=>t.price?t.price===Ve.toString()||u&&!E&&!t.tradeId?e.jsx("span",{children:"-"}):Je(t)?e.jsx("span",{children:n("global.free")}):e.jsx(a.Mana,{className:i.mana,network:V.Network.MATIC,showTooltip:!0,children:Ze(t.price)}):e.jsx("div",{className:`link ${i.linkAction}`,onClick:ee(T),children:n("collection_item.set_price")}),[t,E,u,T]),S=r.useCallback(()=>_===v.UNSYNCED?e.jsxs("div",{className:`${i.unsynced} ${i.status}`,children:[e.jsx("div",{className:i.alertIcon}),n("collection_item.unsynced")]}):_===v.UNDER_REVIEW||t.isPublished&&!t.isApproved?e.jsxs("div",{className:`${i.underReview} ${i.status}`,children:[e.jsx(a.Icon,{name:"clock outline"}),n("collection_item.under_review")]}):t.isPublished&&t.isApproved?e.jsxs("div",{className:`${i.published} ${i.status}`,children:[e.jsx(a.Icon,{name:"check circle outline"}),n("collection_item.published")]}):Ne(t)?e.jsxs("div",{className:`${i.ready} ${i.status}`,children:[e.jsx(a.Icon,{className:i.check,name:"cloud upload"}),n("collection_item.ready")]}):!t.price||Pe(t)&&!(Se in t.contents)?e.jsxs("div",{className:`${i.notReady} ${i.status}`,children:[e.jsx(a.Icon,{name:"exclamation circle"}),n("collection_item.not_ready")]}):e.jsx("span",{onClick:ee(N),className:`link ${i.linkAction}`,children:n("collection_item.edit_item")}),[N,t,_]),R=r.useCallback(()=>e.jsx("div",{className:i.itemActions,children:e.jsx(a.Dropdown,{trigger:e.jsx(a.Button,{basic:!0,children:e.jsx(a.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",className:i.action,onClick:ee(),children:e.jsxs(a.Dropdown.Menu,{className:i.contextMenu,children:[e.jsx(a.Dropdown.Item,{text:n("collection_item.see_details"),as:pe,to:w.itemDetail(t.id)}),e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.see_in_decentraland"),onClick:D}),e.jsx(a.Dropdown.Item,{text:n("collection_item.preview"),onClick:N}),!d.isPublished&&e.jsx(a.Dropdown.Item,{text:n("collection_item.move_to_another_collection"),onClick:P}),Xe(d,t,j)&&!J(d)?e.jsxs(e.Fragment,{children:[t.price&&U?e.jsx(a.Dropdown.Item,{text:n("collection_item.edit_price"),onClick:T}):null,e.jsx(Qs,{itemId:t.id}),t.isPublished?null:e.jsxs(e.Fragment,{children:[e.jsx(a.Dropdown.Divider,{}),e.jsx(a.Dropdown.Item,{text:n("collection_item.delete_item"),onClick:A})]})]}):null]})})}),[d,t,j,D,N,P,T,A]),I=t.data;return e.jsxs(a.Table.Row,{className:`CollectionItem ${i.row}`,children:[e.jsx(a.Table.Cell,{className:`${i.avatarColumn}`,width:t.name.length>Na?6:5,children:e.jsx(pe,{to:w.itemDetail(t.id),className:"CollectionItem",children:e.jsxs("div",{className:i.avatarContainer,children:[e.jsx(Ke,{className:i.itemImage,item:t}),e.jsx("div",{className:i.info,children:e.jsx("div",{className:i.nameWrapper,children:e.jsxs("div",{className:i.name,title:t.name,children:[e.jsx(es,{className:i.itemStatus,item:t}),t.name,e.jsx("div",{className:i.badgeContainer,children:e.jsx(ss,{className:i.badge,item:t,size:"small"})})]})})})]})})}),e.jsx(a.Table.Cell,{className:i.column,children:t.rarity&&I.category?e.jsx(as,{size:"medium",rarity:t.rarity,withTooltip:!0}):null}),e.jsx(a.Table.Cell,{className:i.column,children:I.category?e.jsx("div",{children:n(`${t.type}.category.${I.category}`)}):null}),Q(t)&&ts(I)?e.jsx(a.Table.Cell,{className:i.column,children:I.category?e.jsx("div",{children:n(`emote.play_mode.${I.loop?"loop":"simple"}.text`)}):null}):null,u&&!d.isPublished?null:e.jsx(a.Table.Cell,{className:i.column,children:Z()}),t.isPublished&&t.isApproved?e.jsx(a.Table.Cell,{className:i.column,children:e.jsxs("div",{children:[t.totalSupply,"/",ns(t)]})}):null,e.jsx(a.Table.Cell,{children:S()}),u&&!E&&!t.tradeId&&t.isPublished&&e.jsx(a.Table.Cell,{children:e.jsx(a.Button,{primary:!0,size:"tiny",disabled:!C,onClick:H,children:n("collection_item.put_for_sale")})}),u&&t.tradeId&&e.jsx(a.Table.Cell,{children:e.jsx(a.Button,{secondary:!0,size:"tiny",className:i.removeSaleButton,onClick:W,loading:g&&k.includes(t.tradeId),children:n("collection_item.remove_from_sale")})}),e.jsx(a.Table.Cell,{className:i.contextMenuButton,children:R()})]})}const va=(s,l)=>{const o=ke(s),t=he(s).filter(u=>u.type===xe).map(u=>u.payload.tradeId);return{ethAddress:ls(s),status:o[l.item.id],wallet:os(s),isOffchainPublicItemOrdersEnabled:Re(s),isCancellingItemOrder:$(he(s),xe),loadingTradeIds:t}},ya=s=>({onOpenModal:(l,o)=>s(M(l,o)),onDeleteItem:l=>s(is(l)),onSetItems:l=>s(rs(l)),onRemoveFromSale:l=>s(cs(l,!0))}),ka=F(va,ya)(fa);function Ea({collection:s,wallet:l,items:o,isOnSaleLoading:t,lastLocation:u,status:d,onOpenModal:_,isLoading:j,isOffchainPublicItemOrdersEnabled:x,onFetchCollectionForumPostReply:k}){const g=ds(),y=r.useMemo(()=>new URLSearchParams(g.search).get("tab"),[g]),[b,E]=r.useState(y||f.WEARABLE),C=Ee(),U=u===w.collections(),T=r.useCallback(()=>{s&&s.isPublished&&!s.isApproved&&s.forumLink&&k(s.id)},[s,k]);r.useEffect(()=>{s&&T()},[s]);const D=r.useCallback(()=>{_("MintItemsModal",{collectionId:s.id})},[s,_]),N=r.useCallback(()=>{_("CreateSingleItemModal",{collectionId:s.id})},[s,_]),A=r.useCallback(()=>{s&&!s.isPublished&&_("EditCollectionNameModal",{collection:s})},[s,_]),P=r.useCallback(()=>{s&&_("SellCollectionModal",{collectionId:s.id,isOnSale:te(s,l)||q(s,l)})},[s,l,_]),H=r.useCallback(()=>{U?C.goBack():C.push(w.collections())},[C,U]),W=r.useCallback(()=>{s&&C.push(us(s,o),{fromParam:Te.COLLECTIONS})},[C,s,o]),Z=r.useCallback((c,p="")=>{const m=window.open(c,p);m&&m.focus()},[]),S=r.useCallback(()=>{s&&s.isPublished&&s.forumLink&&Z(s.forumLink,"_blank")},[s]),R=r.useCallback(c=>{E(c),C.push(w.collectionDetail(s.id,ms.STANDARD,{tab:b}))},[s,C]),I=r.useCallback(c=>{const p=c===f.WEARABLE?n("collection_detail_page.wearables"):n("collection_detail_page.emotes");return e.jsx(a.Popup,{className:"modal-tooltip",content:n("collection_detail_page.missing_item_price",{item_type:p.toLowerCase()}),position:"top center",trigger:e.jsx("i",{"aria-hidden":"true",className:"circle icon tiny"})})},[]),oe=r.useCallback(()=>e.jsx(a.Popup,{className:"modal-tooltip",content:n("collection_detail_page.missing_smart_wearable_video"),position:"top center",trigger:e.jsx("i",{"aria-hidden":"true",className:"circle icon tiny"})}),[]),X=r.useCallback(c=>{if(!s)return null;const p=J(s),m=c.length>0;return e.jsxs(e.Fragment,{children:[e.jsx(Es,{size:"small",active:!0,collection:s,text:n("global.see_in_decentraland"),disabled:p||!m}),e.jsxs(a.Button,{basic:!0,className:"action-button",disabled:p||!m,onClick:W,children:[e.jsx(L,{name:"cube"}),e.jsx("span",{className:"text",children:n("collection_detail_page.preview")})]}),m&&!s.isPublished?e.jsxs(a.Button,{basic:!0,className:"action-button add-items",disabled:p,onClick:N,children:[e.jsx(L,{name:"add-active"}),e.jsx("span",{className:"text",children:n("collection_detail_page.add_item")})]}):null]})},[s,W,N]),ie=r.useCallback(()=>{if(!s)return null;const c=q(s,l),p=te(s,l);return x&&!c?p?null:e.jsx(be,{network:V.Network.MATIC,children:m=>e.jsxs(a.Button,{className:se("action-button",p?"secondary":"primary"),disabled:t||!m,onClick:P,children:[e.jsx(a.Icon,{name:"lock"}),e.jsx("span",{className:"text",children:n("collection_detail_page.enable_sales")})]})}):e.jsx(be,{network:V.Network.MATIC,children:m=>e.jsx(a.Button,{className:se("action-button",c?"basic":"primary"),disabled:t||!m,onClick:P,children:e.jsx("span",{className:"text",children:c?n("collection_detail_page.remove_from_marketplace"):n("collection_detail_page.put_for_sale")})})})},[s,x,P]),O=r.useCallback((c="tiny")=>{if(s!=null&&s.forumPostReply){const{highest_post_number:p,last_read_post_number:m}=s.forumPostReply,z=p-(m??0);return e.jsx(a.Label,{className:"badge-forum-unread-posts",circular:!0,size:c,children:z})}return null},[s]),re=r.useCallback(()=>!(s!=null&&s.isApproved)||![v.UNSYNCED,v.UNDER_REVIEW].includes(d)?null:e.jsxs("div",{className:"unsynced-collection container",children:[e.jsx("i",{className:"unsynced-collection alert-icon"}),e.jsxs("div",{className:"unsynced-collection message",children:[e.jsx("h4",{className:"unsynced-collection title",children:n("collection_detail_page.unsynced_collection_title")}),e.jsx("p",{className:"unsynced-collection text",children:n(`collection_detail_page.${d}_collection_message`,{br:e.jsx("br",{})})})]}),d===v.UNDER_REVIEW?e.jsxs(a.Button,{primary:!0,onClick:S,className:"unsynced-collection action-button",children:[e.jsx("span",{children:n("collection_context_menu.forum_post")}),O("medium")]}):null,d===v.UNSYNCED?e.jsx(je,{collection:s}):null]}),[s,d,O,S]),we=r.useCallback(c=>{if(!s)return null;const p=_s(s,l.address),m=J(s),z=q(s,l),G=c.some(Q),B=c.some(ae),Me=G?c.some(h=>Q(h)&&!h.price):!1,De=B?c.some(h=>ae(h)&&!h.price):!1,Ae=B&&c.some(h=>Pe(h)&&!(Se in h.contents)),de=G&&!B,Be=B&&!G,Le=c.filter(h=>Be?ae(h):de?Q(h):h.type===b),$e=G&&B;return e.jsxs(e.Fragment,{children:[e.jsx(a.Section,{className:se({"is-published":s.isPublished}),children:e.jsxs(a.Row,{children:[e.jsx(ys,{absolute:!0,onClick:H}),e.jsx(a.Narrow,{children:e.jsxs(a.Row,{children:[e.jsx(a.Column,{grow:!1,className:"name-container",children:m?e.jsxs(a.Header,{size:"huge",className:"name",children:[s.isPublished&&e.jsx(ks,{collection:s}),s.name]}):e.jsxs(a.Row,{className:"header-row",onClick:A,children:[e.jsx(a.Header,{size:"huge",className:"name",children:s.name}),e.jsx(L,{name:"edit",className:"edit-collection-name"}),z?e.jsx(a.Label,{className:"badge-on-sale",size:"small",circular:!0,children:n("collection_detail_page.on_sale")}):null]})}),e.jsx(a.Column,{align:"right",className:"actions-container",shrink:!1,grow:!1,children:e.jsxs(a.Row,{className:"actions",children:[s.isPublished&&s.isApproved?e.jsx(a.Popup,{content:n("collection_detail_page.can_mint"),className:"CollectionDetailPage popup-mint",position:"top center",trigger:e.jsx(a.Button,{basic:!0,className:"action-button",disabled:!p,onClick:D,children:e.jsx("span",{className:"text",children:n("collection_detail_page.mint_items")})}),on:"hover",inverted:!0,flowing:!0}):null,s.isPublished&&s.forumLink&&!s.isApproved?e.jsxs(e.Fragment,{children:[e.jsx(a.Button,{basic:!0,onClick:S,children:e.jsx("span",{children:n("collection_context_menu.forum_post")})}),s!=null&&s.forumPostReply?O():null]}):null,!(s.isPublished&&s.isApproved)&&d!==v.UNSYNCED?e.jsx(je,{collection:s}):null,ve(s,l.address)&&s.isPublished&&s.isApproved?ie():null,ge(s,l.address)?e.jsx(Os,{collection:s}):null]})})]})})]})}),e.jsxs(a.Narrow,{children:[re(),$e?e.jsxs(a.Tabs,{isFullscreen:!0,children:[e.jsxs(a.Tabs.Tab,{active:b===f.WEARABLE,onClick:()=>R(f.WEARABLE),children:[e.jsx(L,{name:"wearable"}),n("collection_detail_page.wearables"),De?I(f.WEARABLE):Ae?oe():null]}),e.jsxs(a.Tabs.Tab,{active:b===f.EMOTE,onClick:()=>R(f.EMOTE),children:[e.jsx(L,{name:"emote"}),n("collection_detail_page.emotes"),Me?I(f.EMOTE):null]}),e.jsx("div",{className:"secondary-actions tab",children:X(c)})]}):e.jsx("div",{className:"secondary-actions",children:X(c)}),c.length>0?e.jsxs(a.Table,{basic:"very",children:[e.jsx(a.Table.Header,{children:e.jsxs(a.Table.Row,{children:[e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.item")}),e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.rarity")}),e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.category")}),b===f.EMOTE||de?e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.play_mode")}):null,x&&!s.isPublished?null:e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.price")}),s.isPublished&&s.isApproved?e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.supply")}):null,e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.status")}),x&&!z&&e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.actions")}),e.jsx(a.Table.HeaderCell,{})]})}),e.jsx(a.Table.Body,{children:Le.map(h=>e.jsx(ka,{collection:s,item:h},h.id))})]}):e.jsxs("div",{className:"empty",children:[e.jsx("div",{className:"sparkles"}),e.jsxs("div",{children:[e.jsx("span",{className:"empty-collection-title",children:n("collection_detail_page.add_items_title")}),e.jsx("br",{}),n("collection_detail_page.add_items_subtitle"),e.jsx("br",{}),n("collection_detail_page.cant_remove"),e.jsx("br",{}),e.jsx(a.Button,{basic:!0,className:"empty-action-button",disabled:m,onClick:N,children:e.jsx("span",{className:"text",children:n("collection_detail_page.add_item")})})]})]})]})]})},[b,d,l,s,N,X,A,I,R,re,ie,R,S,oe,O,D,H]),ce=l!==null&&s!==null&&ge(s,l.address);return e.jsx(Ns,{id:s==null?void 0:s.id,itemsPage:1,itemsPageSize:5e3,children:({isLoadingCollection:c,isLoadingCollectionItems:p,items:m})=>e.jsx(fs,{className:"CollectionDetailPage",hasNavigation:!ce&&!j&&!c,isLoading:j||c||p,children:ce?we(m):e.jsx(vs,{})})})}const Ta=s=>{const l=ps(s)||"",o=hs(s,l),t=fe(s);return{wallet:ye(s),collection:o,isOnSaleLoading:xs(s)||$(Y(s),gs),items:le(s,l),status:t[l],isLoading:$(Y(s),Cs)||$(Y(s),js),lastLocation:Is(s),isOffchainPublicItemOrdersEnabled:Re(s)}},Pa=s=>({onOpenModal:(l,o)=>s(M(l,o)),onFetchCollectionForumPostReply:l=>s(bs(l))}),Oa=F(Ta,Pa)(Ea);export{Oa as default};
@@ -1 +1 @@
1
- import{N as n,am as s,an as r,ao as i,ap as m,aq as g,ar as t,ae as d,as as c,at as u,au as S,X as I,av as P,aw as l,ax as p,ay as y,az as O}from"./index-C2Y2eZ28.js";const R=a=>({isPreviewing:r(a),isSidebarOpen:i(a),isReady:m(a),isLoading:g(a),isFetching:t(a),isLoggedIn:d(a),isScreenshotReady:c(a),currentProject:u(a),numItems:S(a)}),C=a=>({onOpenModal:(e,o)=>a(I(e,o)),onCloseEditor:()=>a(P()),onZoomIn:()=>a(l()),onZoomOut:()=>a(p()),onResetCamera:()=>a(y()),onTakeScreenshot:()=>a(O())}),L=n(R,C)(s);export{L as default};
1
+ import{N as n,am as s,an as r,ao as i,ap as m,aq as g,ar as t,ae as d,as as c,at as u,au as S,X as I,av as P,aw as l,ax as p,ay as y,az as O}from"./index-ZuMScRBF.js";const R=a=>({isPreviewing:r(a),isSidebarOpen:i(a),isReady:m(a),isLoading:g(a),isFetching:t(a),isLoggedIn:d(a),isScreenshotReady:c(a),currentProject:u(a),numItems:S(a)}),C=a=>({onOpenModal:(e,o)=>a(I(e,o)),onCloseEditor:()=>a(P()),onZoomIn:()=>a(l()),onZoomOut:()=>a(p()),onResetCamera:()=>a(y()),onTakeScreenshot:()=>a(O())}),L=n(R,C)(s);export{L as default};
@@ -1 +1 @@
1
- import{af as b,Z as k,bk as T,D as i,K as C,H as e,ah as f,M as s,aj as w,G as l,N as D,hO as S,hM as L,O as E,bw as P,b3 as M,X as R,Y as v,Q as F,em as y}from"./index-C2Y2eZ28.js";import{N as H}from"./NotFound-DLc93Jdo.js";const I=n=>{const{template:a,isLoading:t,scene:c,onOpenModal:r,onLoadTemplateScene:m}=n,u=k(),o=T(),d=i.useMemo(()=>({id:a==null?void 0:a.id,name:a==null?void 0:a.title,description:a==null?void 0:a.description}),[a]);i.useEffect(()=>{a&&!c&&m(a)},[a,c,m]);const x=()=>e.jsx(s.Center,{children:e.jsx(s.Loader,{active:!0,size:"large"})}),j=()=>e.jsx(H,{}),h=i.useCallback(()=>{o==null||o.track("Download Template",d),r("ExportModal",{project:a})},[o,a,d,r]),g=i.useCallback(()=>{u.push(C.templates())},[u]),_=i.useCallback(()=>{a&&(o==null||o.track("Select Template",d),r("CloneTemplateModal",{template:a}))},[o,a,d,r]),N=p=>e.jsxs(e.Fragment,{children:[e.jsx(s.Section,{size:"large",children:e.jsx(s.Row,{children:e.jsx(s.Column,{children:e.jsx(s.Row,{children:e.jsxs("div",{className:"title-container",children:[e.jsx(s.Button,{className:"back-button",basic:!0,icon:e.jsx(s.Icon,{name:"arrow alternate circle left outline"}),onClick:g,"aria-label":l("templates_page.back_to_scenes")}),e.jsx(s.Header,{className:"name",children:p.title})]})})})})}),e.jsx(s.Section,{children:e.jsx("div",{className:"header-image",style:{backgroundImage:`url(${p.thumbnail})`}})}),e.jsxs(s.Section,{children:[e.jsxs(s.Row,{className:"content info-container",children:[e.jsxs(s.Column,{className:"creator-container",children:[e.jsx(s.Header,{children:l("template_detail_page.creator")}),e.jsxs("p",{className:"description-content",children:[e.jsx(s.Logo,{})," Decentraland",e.jsx("br",{}),"Foundation"]})]}),e.jsxs(s.Column,{className:"description-container",children:[e.jsx(s.Header,{children:l("template_detail_page.description")}),e.jsx("p",{className:"description-content",children:p.description})]}),e.jsxs(s.Column,{className:"action-buttons-container",children:[e.jsx(s.Button,{primary:!0,className:"select-button",onClick:_,children:l("template_detail_page.select_template")}),e.jsx(s.Button,{inverted:!0,className:"download-button",onClick:h,children:l("template_detail_page.download_scene")})]})]}),e.jsx(s.Row,{className:"content",children:e.jsxs(s.Column,{className:"scene-details-container",children:[e.jsx(s.Header,{children:l("template_detail_page.scene_details")}),e.jsx("p",{className:"description-content world",children:l("template_detail_page.built_for_world")}),e.jsx("p",{className:"description-content size-scene",children:l("template_detail_page.parcels",{...p.layout})}),e.jsx("p",{className:"description-content personalize-content",children:l("template_detail_page.personalize_it_yourself")}),c&&e.jsx("p",{className:"description-content sdk",children:c!=null&&c.sdk6?"SDK 6":"SDK 7"})]})})]})]});return e.jsxs(e.Fragment,{children:[e.jsx(f,{}),e.jsxs(s.Page,{className:"TemplateDetailPage",isFullscreen:!0,children:[t&&!a?x():null,!t&&!a?j():null,a?N(a):null]}),e.jsx(w,{})]})},O=b.memo(I),z=n=>{const a=S(n),t=a&&L(n)[a],c=t?E(n)[t.sceneId]:null;return{template:t||null,scene:c,isLoading:P(M(n),y)}},B=n=>({onOpenModal:(a,t)=>n(R(a,t)),onLoadTemplateScene:a=>n(v(a,F.TEMPLATE))}),$=D(z,B)(O);export{$ as default};
1
+ import{af as b,Z as k,bk as T,D as i,K as C,H as e,ah as f,M as s,aj as w,G as l,N as D,hO as S,hM as L,O as E,bw as P,b3 as M,X as R,Y as v,Q as F,em as y}from"./index-ZuMScRBF.js";import{N as H}from"./NotFound-PGQXtpug.js";const I=n=>{const{template:a,isLoading:t,scene:c,onOpenModal:r,onLoadTemplateScene:m}=n,u=k(),o=T(),d=i.useMemo(()=>({id:a==null?void 0:a.id,name:a==null?void 0:a.title,description:a==null?void 0:a.description}),[a]);i.useEffect(()=>{a&&!c&&m(a)},[a,c,m]);const x=()=>e.jsx(s.Center,{children:e.jsx(s.Loader,{active:!0,size:"large"})}),j=()=>e.jsx(H,{}),h=i.useCallback(()=>{o==null||o.track("Download Template",d),r("ExportModal",{project:a})},[o,a,d,r]),g=i.useCallback(()=>{u.push(C.templates())},[u]),_=i.useCallback(()=>{a&&(o==null||o.track("Select Template",d),r("CloneTemplateModal",{template:a}))},[o,a,d,r]),N=p=>e.jsxs(e.Fragment,{children:[e.jsx(s.Section,{size:"large",children:e.jsx(s.Row,{children:e.jsx(s.Column,{children:e.jsx(s.Row,{children:e.jsxs("div",{className:"title-container",children:[e.jsx(s.Button,{className:"back-button",basic:!0,icon:e.jsx(s.Icon,{name:"arrow alternate circle left outline"}),onClick:g,"aria-label":l("templates_page.back_to_scenes")}),e.jsx(s.Header,{className:"name",children:p.title})]})})})})}),e.jsx(s.Section,{children:e.jsx("div",{className:"header-image",style:{backgroundImage:`url(${p.thumbnail})`}})}),e.jsxs(s.Section,{children:[e.jsxs(s.Row,{className:"content info-container",children:[e.jsxs(s.Column,{className:"creator-container",children:[e.jsx(s.Header,{children:l("template_detail_page.creator")}),e.jsxs("p",{className:"description-content",children:[e.jsx(s.Logo,{})," Decentraland",e.jsx("br",{}),"Foundation"]})]}),e.jsxs(s.Column,{className:"description-container",children:[e.jsx(s.Header,{children:l("template_detail_page.description")}),e.jsx("p",{className:"description-content",children:p.description})]}),e.jsxs(s.Column,{className:"action-buttons-container",children:[e.jsx(s.Button,{primary:!0,className:"select-button",onClick:_,children:l("template_detail_page.select_template")}),e.jsx(s.Button,{inverted:!0,className:"download-button",onClick:h,children:l("template_detail_page.download_scene")})]})]}),e.jsx(s.Row,{className:"content",children:e.jsxs(s.Column,{className:"scene-details-container",children:[e.jsx(s.Header,{children:l("template_detail_page.scene_details")}),e.jsx("p",{className:"description-content world",children:l("template_detail_page.built_for_world")}),e.jsx("p",{className:"description-content size-scene",children:l("template_detail_page.parcels",{...p.layout})}),e.jsx("p",{className:"description-content personalize-content",children:l("template_detail_page.personalize_it_yourself")}),c&&e.jsx("p",{className:"description-content sdk",children:c!=null&&c.sdk6?"SDK 6":"SDK 7"})]})})]})]});return e.jsxs(e.Fragment,{children:[e.jsx(f,{}),e.jsxs(s.Page,{className:"TemplateDetailPage",isFullscreen:!0,children:[t&&!a?x():null,!t&&!a?j():null,a?N(a):null]}),e.jsx(w,{})]})},O=b.memo(I),z=n=>{const a=S(n),t=a&&L(n)[a],c=t?E(n)[t.sceneId]:null;return{template:t||null,scene:c,isLoading:P(M(n),y)}},B=n=>({onOpenModal:(a,t)=>n(R(a,t)),onLoadTemplateScene:a=>n(v(a,F.TEMPLATE))}),$=D(z,B)(O);export{$ as default};
@@ -1 +1 @@
1
- var k=Object.defineProperty;var j=(r,a,e)=>a in r?k(r,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[a]=e;var i=(r,a,e)=>j(r,typeof a!="symbol"?a+"":a,e);import{D as b,dv as O,bD as v,dw as L,bI as x,H as s,M as u,cd as S,G as o,L as y,K as E,ce as R,b8 as N,cc as _,bm as P,N as w,dx as C}from"./index-C2Y2eZ28.js";import{L as A}from"./LandAction-CPxdm2mW.js";import{L as D}from"./LandProviderPage-CcaXrtuL.js";import"./Back-iVIqxATW.js";import"./NotFound-DLc93Jdo.js";class T extends b.PureComponent{constructor(){super(...arguments);i(this,"state",{address:"",initial:"",loading:!1,editing:!1,dirty:!1,revoked:!1});i(this,"handleSetOperator",()=>{const{land:e,onSetOperator:t}=this.props,{address:n,revoked:p}=this.state;t(e,p?null:n)});i(this,"handleChange",(e,t)=>{this.setState({address:t.value,dirty:!0,revoked:!1})});i(this,"handleRevoke",()=>{this.setState({revoked:!0,dirty:!0})});i(this,"handleUndo",()=>{this.setState({revoked:!1,dirty:!1})})}async componentWillMount(){this.setState({loading:!0});const{land:e}=this.props,t=await O(e);t!==null?this.setState({address:t,initial:t,loading:!1,editing:!0}):this.setState({loading:!1})}render(){const{land:e}=this.props,{address:t,loading:n,dirty:p,revoked:d,editing:g,initial:m}=this.state,c=g&&v(t,m),h=!n&&!!t&&!_(t),f=n||!p||(v(t,m)||h)&&!d||!L(e,[x.OWNER,x.TENANT]),l=[];return d&&l.push("revoked"),g&&l.push("editing"),c&&l.push("is-revokable"),s.jsxs(u.Form,{className:"LandOperatorForm",children:[s.jsx(S,{placeholder:"0x...",label:o("operator_page.address"),className:l.join(" "),value:t,onChange:this.handleChange,loading:n,action:c?d?o("operator_page.undo"):o("operator_page.revoke"):void 0,onAction:c?d?this.handleUndo:this.handleRevoke:void 0,error:h,message:h?o("operator_page.invalid_address"):void 0}),s.jsxs(u.Row,{children:[s.jsx(y,{className:"cancel",to:E.landDetail(e.id),children:s.jsx(u.Button,{children:o("global.cancel")})}),s.jsx(R,{type:"submit",primary:!0,disabled:f,onClick:this.handleSetOperator,network:N.Network.ETHEREUM,children:o("global.submit")})]})]})}}let F=class extends b.PureComponent{render(){const{onSetOperator:a}=this.props;return s.jsx(D,{children:e=>s.jsx(A,{land:e,title:o("operator_page.title"),subtitle:s.jsx(P,{id:"operator_page.subtitle",values:{name:s.jsx("strong",{children:e.name}),b:t=>s.jsx("strong",{children:t}),br:()=>s.jsx("br",{})}}),children:s.jsx(T,{land:e,onSetOperator:a})})})}};const U=r=>({onSetOperator:(a,e)=>r(C(a,e))}),K=w(void 0,U)(F);export{K as default};
1
+ var k=Object.defineProperty;var j=(r,a,e)=>a in r?k(r,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[a]=e;var i=(r,a,e)=>j(r,typeof a!="symbol"?a+"":a,e);import{D as b,dv as O,bD as v,dw as L,bI as x,H as s,M as u,cd as S,G as o,L as y,K as E,ce as R,b8 as N,cc as _,bm as P,N as w,dx as C}from"./index-ZuMScRBF.js";import{L as A}from"./LandAction-Bya5iY9t.js";import{L as D}from"./LandProviderPage-DMG9x9Uh.js";import"./Back-D4W_O81e.js";import"./NotFound-PGQXtpug.js";class T extends b.PureComponent{constructor(){super(...arguments);i(this,"state",{address:"",initial:"",loading:!1,editing:!1,dirty:!1,revoked:!1});i(this,"handleSetOperator",()=>{const{land:e,onSetOperator:t}=this.props,{address:n,revoked:p}=this.state;t(e,p?null:n)});i(this,"handleChange",(e,t)=>{this.setState({address:t.value,dirty:!0,revoked:!1})});i(this,"handleRevoke",()=>{this.setState({revoked:!0,dirty:!0})});i(this,"handleUndo",()=>{this.setState({revoked:!1,dirty:!1})})}async componentWillMount(){this.setState({loading:!0});const{land:e}=this.props,t=await O(e);t!==null?this.setState({address:t,initial:t,loading:!1,editing:!0}):this.setState({loading:!1})}render(){const{land:e}=this.props,{address:t,loading:n,dirty:p,revoked:d,editing:g,initial:m}=this.state,c=g&&v(t,m),h=!n&&!!t&&!_(t),f=n||!p||(v(t,m)||h)&&!d||!L(e,[x.OWNER,x.TENANT]),l=[];return d&&l.push("revoked"),g&&l.push("editing"),c&&l.push("is-revokable"),s.jsxs(u.Form,{className:"LandOperatorForm",children:[s.jsx(S,{placeholder:"0x...",label:o("operator_page.address"),className:l.join(" "),value:t,onChange:this.handleChange,loading:n,action:c?d?o("operator_page.undo"):o("operator_page.revoke"):void 0,onAction:c?d?this.handleUndo:this.handleRevoke:void 0,error:h,message:h?o("operator_page.invalid_address"):void 0}),s.jsxs(u.Row,{children:[s.jsx(y,{className:"cancel",to:E.landDetail(e.id),children:s.jsx(u.Button,{children:o("global.cancel")})}),s.jsx(R,{type:"submit",primary:!0,disabled:f,onClick:this.handleSetOperator,network:N.Network.ETHEREUM,children:o("global.submit")})]})]})}}let F=class extends b.PureComponent{render(){const{onSetOperator:a}=this.props;return s.jsx(D,{children:e=>s.jsx(A,{land:e,title:o("operator_page.title"),subtitle:s.jsx(P,{id:"operator_page.subtitle",values:{name:s.jsx("strong",{children:e.name}),b:t=>s.jsx("strong",{children:t}),br:()=>s.jsx("br",{})}}),children:s.jsx(T,{land:e,onSetOperator:a})})})}};const U=r=>({onSetOperator:(a,e)=>r(C(a,e))}),K=w(void 0,U)(F);export{K as default};
@@ -1,4 +1,4 @@
1
- import{T as xt,M as re,R as N,E as k,C as x,a as X,b as Wo,O as Z,c as ht}from"./index-Df2XL9vC.js";import"./index-C2Y2eZ28.js";/**
1
+ import{T as xt,M as re,R as N,E as k,C as x,a as X,b as Wo,O as Z,c as ht}from"./index-ChSw1JF8.js";import"./index-ZuMScRBF.js";/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1 +1 @@
1
- import{bk as _,Z as b,D as c,K as d,H as s,ah as h,M as l,G as n,hL as k,J as x,aj as g,N as v,hM as j,hN as C}from"./index-C2Y2eZ28.js";import{a as N,N as T}from"./Navigation.container-h_uvbEV-.js";import"./selectors-Zkd3yj1l.js";var r=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(r||{});const E="_titleContainer_5ka3v_1",S="_backButton_5ka3v_8",B="_title_5ka3v_1",f="_templates_5ka3v_26",I="_subtitle_5ka3v_32",a={titleContainer:E,backButton:S,title:B,templates:f,subtitle:I},y=({templates:e,onLoadTemplates:u})=>{const i=_(),o=b();c.useEffect(()=>{u()},[u]);const p=c.useCallback(()=>{o.push(d.scenes())},[o]),m=c.useCallback(t=>{i==null||i.track("Go to template detail",{id:t.id,name:t.title,description:t.description}),o.push(d.templateDetail(t.id))},[i,o]);return s.jsxs(s.Fragment,{children:[s.jsx(h,{}),s.jsxs(l.Page,{isFullscreen:!0,className:"ScenesPage",children:[s.jsx(N,{activeTab:T.SCENES}),s.jsxs("div",{className:a.titleContainer,children:[s.jsx(l.Button,{className:a.backButton,basic:!0,icon:s.jsx(l.Icon,{name:"arrow alternate circle left outline"}),onClick:p,"aria-label":n("templates_page.back_to_scenes")}),s.jsx("h2",{className:a.title,children:n("templates_page.title")})]}),s.jsx("div",{className:a.templates,children:Object.values(e).map(t=>s.jsx(k,{title:t.title,description:t.description,videoSrc:t.video,imgSrc:t.thumbnail,subtitle:s.jsxs("span",{className:a.subtitle,children:[s.jsx(x,{name:"scene-parcel"}),n("templates_page.parcels",{size:t.layout.rows*t.layout.cols})]}),tag:t.templateStatus!==r.ACTIVE?{label:n("templates_page.coming_soon"),color:"#716B7C"}:void 0,disabled:t.templateStatus!==r.ACTIVE,onClick:m.bind(null,t)},t.id))})]}),s.jsx(g,{})]})},A=e=>({templates:j(e)}),G=e=>({onLoadTemplates:()=>e(C())}),F=v(A,G)(y);export{F as default};
1
+ import{bk as _,Z as b,D as c,K as d,H as s,ah as h,M as l,G as n,hL as k,J as x,aj as g,N as v,hM as j,hN as C}from"./index-ZuMScRBF.js";import{a as N,N as T}from"./Navigation.container-CsesGRoh.js";import"./selectors-CVDyed6b.js";var r=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(r||{});const E="_titleContainer_5ka3v_1",S="_backButton_5ka3v_8",B="_title_5ka3v_1",f="_templates_5ka3v_26",I="_subtitle_5ka3v_32",a={titleContainer:E,backButton:S,title:B,templates:f,subtitle:I},y=({templates:e,onLoadTemplates:u})=>{const i=_(),o=b();c.useEffect(()=>{u()},[u]);const p=c.useCallback(()=>{o.push(d.scenes())},[o]),m=c.useCallback(t=>{i==null||i.track("Go to template detail",{id:t.id,name:t.title,description:t.description}),o.push(d.templateDetail(t.id))},[i,o]);return s.jsxs(s.Fragment,{children:[s.jsx(h,{}),s.jsxs(l.Page,{isFullscreen:!0,className:"ScenesPage",children:[s.jsx(N,{activeTab:T.SCENES}),s.jsxs("div",{className:a.titleContainer,children:[s.jsx(l.Button,{className:a.backButton,basic:!0,icon:s.jsx(l.Icon,{name:"arrow alternate circle left outline"}),onClick:p,"aria-label":n("templates_page.back_to_scenes")}),s.jsx("h2",{className:a.title,children:n("templates_page.title")})]}),s.jsx("div",{className:a.templates,children:Object.values(e).map(t=>s.jsx(k,{title:t.title,description:t.description,videoSrc:t.video,imgSrc:t.thumbnail,subtitle:s.jsxs("span",{className:a.subtitle,children:[s.jsx(x,{name:"scene-parcel"}),n("templates_page.parcels",{size:t.layout.rows*t.layout.cols})]}),tag:t.templateStatus!==r.ACTIVE?{label:n("templates_page.coming_soon"),color:"#716B7C"}:void 0,disabled:t.templateStatus!==r.ACTIVE,onClick:m.bind(null,t)},t.id))})]}),s.jsx(g,{})]})},A=e=>({templates:j(e)}),G=e=>({onLoadTemplates:()=>e(C())}),F=v(A,G)(y);export{F as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CVV3dZXB.js","assets/index-ZuMScRBF.js","assets/index-DGfJMRq1.css"])))=>i.map(i=>d[i]);
2
+ import{B as pe,_ as me}from"./index-ZuMScRBF.js";const he=Symbol(),ee=Object.getPrototypeOf,Y=new WeakMap,ge=e=>e&&(Y.has(e)?Y.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),ye=e=>ge(e)&&e[he]||null,te=(e,t=!0)=>{Y.set(e,t)},z={BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.9.2-16202422627.commit-2162b6e",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.9.2-16202422627.commit-2162b6e",VITE_REACT_APP_WEBSITE_VERSION:"7.9.2-16202422627.commit-2162b6e"},F=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,ve=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>F(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,I=n)=>{const v=l.get(o);if((v==null?void 0:v[0])===g)return v[1];const b=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return te(b,!0),l.set(o,[g,b]),Reflect.ownKeys(o).forEach(j=>{if(Object.getOwnPropertyDescriptor(b,j))return;const O=Reflect.get(o,j),A={value:O,enumerable:!0,configurable:!0};if(x.has(O))te(O,!1);else if(O instanceof Promise)delete A.value,A.get=()=>I(O);else if(C.has(O)){const[y,H]=C.get(O);A.value=c(y,H(),I)}Object.defineProperty(b,j,A)}),Object.preventExtensions(b)},d=new WeakMap,f=[1,1],W=o=>{if(!F(o))throw new Error("object required");const g=d.get(o);if(g)return g;let I=f[0];const v=new Set,b=(a,i=++f[0])=>{I!==i&&(I=i,v.forEach(r=>r(a,i)))};let j=f[1];const O=(a=++f[1])=>(j!==a&&!v.size&&(j=a,y.forEach(([i])=>{const r=i[1](a);r>I&&(I=r)})),I),A=a=>(i,r)=>{const h=[...i];h[1]=[a,...h[1]],b(h,r)},y=new Map,H=(a,i)=>{if((z?"production":void 0)!=="production"&&y.has(a))throw new Error("prop listener already exists");if(v.size){const r=i[3](A(a));y.set(a,[i,r])}else y.set(a,[i])},Z=a=>{var i;const r=y.get(a);r&&(y.delete(a),(i=r[1])==null||i.call(r))},ue=a=>(v.add(a),v.size===1&&y.forEach(([r,h],U)=>{if((z?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const N=r[3](A(U));y.set(U,[r,N])}),()=>{v.delete(a),v.size===0&&y.forEach(([r,h],U)=>{h&&(h(),y.set(U,[r]))})}),q=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),k=t(q,{deleteProperty(a,i){const r=Reflect.get(a,i);Z(i);const h=Reflect.deleteProperty(a,i);return h&&b(["delete",[i],r]),h},set(a,i,r,h){const U=Reflect.has(a,i),N=Reflect.get(a,i,h);if(U&&(e(N,r)||d.has(r)&&e(N,d.get(r))))return!0;Z(i),F(r)&&(r=ye(r)||r);let V=r;if(r instanceof Promise)r.then(L=>{r.status="fulfilled",r.value=L,b(["resolve",[i],L])}).catch(L=>{r.status="rejected",r.reason=L,b(["reject",[i],L])});else{!C.has(r)&&s(r)&&(V=W(r));const L=!x.has(V)&&C.get(V);L&&H(i,L)}return Reflect.set(a,i,V,h),b(["set",[i],r,N]),!0}});d.set(o,k);const fe=[q,O,c,ue];return C.set(k,fe),Reflect.ownKeys(o).forEach(a=>{const i=Object.getOwnPropertyDescriptor(o,a);"value"in i&&(k[a]=o[a],delete i.value,delete i.writable),Object.defineProperty(q,a,i)}),k})=>[W,C,x,e,t,s,n,l,c,d,f],[be]=ve();function P(e={}){return be(e)}function D(e,t,s){const n=C.get(e);(z?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let l;const c=[],d=n[3];let f=!1;const o=d(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function we(e,t){const s=C.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[n,l,c]=s;return c(n,l(),t)}const u=P({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return D(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const c=pe.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",c),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},Ie=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=P({enabled:Ie,userSessionId:"",events:[],connectedWalletId:void 0}),_e={state:p,subscribe(e){return D(p.events,()=>e(we(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},_=P({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:_,subscribe(e){return D(_,()=>e(_))},setChains(e){_.chains=e},setWalletConnectUri(e){_.walletConnectUri=e},setIsCustomDesktop(e){_.isCustomDesktop=e},setIsCustomMobile(e){_.isCustomMobile=e},setIsDataLoaded(e){_.isDataLoaded=e},setIsUiLoaded(e){_.isUiLoaded=e},setIsAuth(e){_.isAuth=e}},B=P({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),$={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;_e.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),m.setModalVersionInStorage(),Object.assign(B,e)}};var Ee=Object.defineProperty,se=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Le=(e,t)=>{for(var s in t||(t={}))Oe.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))We.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.7.0";async function K(e,t){const s=Le({sdkType:Q,sdkVersion:X},t),n=new URL(e,G);return n.searchParams.append("projectId",$.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&n.searchParams.append(c,String(d))}),(await fetch(n)).json()}const S={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Ce=Object.defineProperty,oe=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Se=(e,t)=>{for(var s in t||(t={}))Pe.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Ae.call(t,s)&&re(e,s,t[s]);return e};const ie=m.isMobile(),E=P({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),ke={state:E,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=$.state;if(e==="NONE"||t==="ALL"&&!e)return E.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await S.getAllListings(n),c=Object.values(l);c.sort((d,f)=>{const W=e.indexOf(d.id),o=e.indexOf(f.id);return W-o}),E.recomendedWallets=c}else{const{chains:s,isAuth:n}=w.state,l=s==null?void 0:s.join(","),c=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ie?await S.getMobileListings(d):await S.getDesktopListings(d);E.recomendedWallets=Object.values(f)}return E.recomendedWallets},async getWallets(e){const t=Se({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=$.state,{recomendedWallets:l}=E;if(n==="ALL")return E.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:d}=e,{listings:f,total:W}=ie?await S.getMobileListings(t):await S.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return E[g]={listings:[...E[g].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return S.getWalletImageUrl(e)},getAssetImageUrl(e){return S.getAssetImageUrl(e)},resetSearch(){E.search={listings:[],total:0,page:1}}},T=P({open:!1}),J={state:T,subscribe(e){return D(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=w.state;if(m.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&n)T.open=!0,t();else{const l=setInterval(()=>{const c=w.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,ae=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ue=(e,t)=>{for(var s in t||(t={}))De.call(t,s)&&le(e,s,t[s]);if(ae)for(var s of ae(t))je.call(t,s)&&le(e,s,t[s]);return e};function Te(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const R=P({themeMode:Te()?"dark":"light"}),ce={state:R,subscribe(e){return D(R,()=>e(R))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(R.themeMode=t),s&&(R.themeVariables=Ue({},s))}},M=P({open:!1,message:"",variant:"success"}),Ve={state:M,subscribe(e){return D(M,()=>e(M))},openToast(e,t){M.open=!0,M.message=e,M.variant=t},closeToast(){M.open=!1}};class $e{constructor(t){this.openModal=J.open,this.closeModal=J.close,this.subscribeModal=J.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),$.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await me(()=>import("./index-CVV3dZXB.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const xe=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:$e},Symbol.toStringTag,{value:"Module"}));export{m as C,ke as E,J as M,w as O,de as R,ce as T,Ve as a,_e as b,$ as c,xe as i};
@@ -1 +1 @@
1
- import{a as g}from"./index-Dal_XZcP.js";import"./index-C2Y2eZ28.js";var m=Object.defineProperty,v=Object.defineProperties,y=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,d=(e,r,t)=>r in e?m(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,h=(e,r)=>{for(var t in r||(r={}))w.call(r,t)&&d(e,t,r[t]);if(c)for(var t of c(r))f.call(r,t)&&d(e,t,r[t]);return e},_=(e,r)=>v(e,y(r)),u=(e,r,t)=>new Promise((n,s)=>{var l=i=>{try{o(t.next(i))}catch(p){s(p)}},a=i=>{try{o(t.throw(i))}catch(p){s(p)}},o=i=>i.done?n(i.value):Promise.resolve(i.value).then(l,a);o((t=t.apply(e,r)).next())}),b=(e=>(e.Start="magic_oauth_login_with_redirect_start",e.Verify="magic_oauth_login_with_redirect_verify",e.Popup="magic_oauth_login_with_popup",e.VerifyTelegramData="magic_oauth_verify_telegram_data",e))(b||{}),R=(e=>(e.InvalidRequest="invalid_request",e.InvalidClient="invalid_client",e.InvalidScope="invalid_scope",e.InvalidGrant="invalid_grant",e.UnauthorizedClient="unauthorized_client",e.UnsupportedResponseType="unsupported_response_type",e.UnsupportedGrantType="unsupported_grant_type",e.UnsupportedTokenType="unsupported_token_type",e.AccessDenied="access_denied",e.ServerError="server_error",e.TemporarilyUnavailable="temporarily_unavailable",e))(R||{}),I=class extends g.Internal{constructor(){super(),this.name="oauth2",this.config={},this.compat={"magic-sdk":">=2.4.6","@magic-sdk/react-native":!1,"@magic-sdk/react-native-bare":!1,"@magic-sdk/react-native-expo":!1},this.seamlessTelegramLogin()}loginWithRedirect(e){return this.utils.createPromiEvent((r,t)=>u(this,null,function*(){var n;let s=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_redirect_start",[_(h({},e),{apiKey:this.sdk.apiKey,platform:"web"})]),l=yield this.request(s),a=l,o=l;if(o.error&&t(this.createError(o.error,(n=o.error_description)!=null?n:"An error occurred.",{errorURI:o.error_uri,provider:o.provider})),a!=null&&a.oauthAuthoriationURI){let i=a.useMagicServerCallback?new URL(a.oauthAuthoriationURI,this.sdk.endpoint).href:a.oauthAuthoriationURI;a!=null&&a.shouldReturnURI?r(i):window.location.href=i}r(null)}))}getRedirectResult(e,r){let t=r||window.location.search,n=window.location.origin+window.location.pathname;return window.history.replaceState(null,"",n),P.call(this,t,e)}loginWithPopup(e){let r=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_popup",[_(h({},e),{apiKey:this.sdk.apiKey,platform:"web"})]);return this.request(r)}seamlessTelegramLogin(){try{if(!window.location.hash.toString().includes("#tgWebAppData"))return;let e=document.createElement("script");e.src="https://telegram.org/js/telegram-web-app.js",document.head.prepend(e),e.onload=()=>u(this,null,function*(){var r;try{let t=(r=window.Telegram)==null?void 0:r.WebApp.initData,n=this.utils.createJsonRpcRequestPayload("magic_oauth_verify_telegram_data",[{userData:t,isMiniApp:!0}]);yield this.request(n)}catch(t){console.log("Error while verifying telegram data",t)}})}catch(e){console.log("Error while loading telegram-web-app script",e)}}};function P(e,r){return this.utils.createPromiEvent((t,n)=>u(this,null,function*(){var s;let l=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_redirect_verify",[{authorizationResponseParams:e,magicApiKey:this.sdk.apiKey,platform:"web",lifespan:r}]),a=yield this.request(l),o=a,i=a;i.error&&n(this.createError(i.error,(s=i.error_description)!=null?s:"An error occurred.",{errorURI:i.error_uri,provider:i.provider})),t(o)}))}export{R as OAuthErrorCode,I as OAuthExtension,b as OAuthPayloadMethods};
1
+ import{a as g}from"./index-BxTFNW_J.js";import"./index-ZuMScRBF.js";var m=Object.defineProperty,v=Object.defineProperties,y=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,d=(e,r,t)=>r in e?m(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,h=(e,r)=>{for(var t in r||(r={}))w.call(r,t)&&d(e,t,r[t]);if(c)for(var t of c(r))f.call(r,t)&&d(e,t,r[t]);return e},_=(e,r)=>v(e,y(r)),u=(e,r,t)=>new Promise((n,s)=>{var l=i=>{try{o(t.next(i))}catch(p){s(p)}},a=i=>{try{o(t.throw(i))}catch(p){s(p)}},o=i=>i.done?n(i.value):Promise.resolve(i.value).then(l,a);o((t=t.apply(e,r)).next())}),b=(e=>(e.Start="magic_oauth_login_with_redirect_start",e.Verify="magic_oauth_login_with_redirect_verify",e.Popup="magic_oauth_login_with_popup",e.VerifyTelegramData="magic_oauth_verify_telegram_data",e))(b||{}),R=(e=>(e.InvalidRequest="invalid_request",e.InvalidClient="invalid_client",e.InvalidScope="invalid_scope",e.InvalidGrant="invalid_grant",e.UnauthorizedClient="unauthorized_client",e.UnsupportedResponseType="unsupported_response_type",e.UnsupportedGrantType="unsupported_grant_type",e.UnsupportedTokenType="unsupported_token_type",e.AccessDenied="access_denied",e.ServerError="server_error",e.TemporarilyUnavailable="temporarily_unavailable",e))(R||{}),I=class extends g.Internal{constructor(){super(),this.name="oauth2",this.config={},this.compat={"magic-sdk":">=2.4.6","@magic-sdk/react-native":!1,"@magic-sdk/react-native-bare":!1,"@magic-sdk/react-native-expo":!1},this.seamlessTelegramLogin()}loginWithRedirect(e){return this.utils.createPromiEvent((r,t)=>u(this,null,function*(){var n;let s=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_redirect_start",[_(h({},e),{apiKey:this.sdk.apiKey,platform:"web"})]),l=yield this.request(s),a=l,o=l;if(o.error&&t(this.createError(o.error,(n=o.error_description)!=null?n:"An error occurred.",{errorURI:o.error_uri,provider:o.provider})),a!=null&&a.oauthAuthoriationURI){let i=a.useMagicServerCallback?new URL(a.oauthAuthoriationURI,this.sdk.endpoint).href:a.oauthAuthoriationURI;a!=null&&a.shouldReturnURI?r(i):window.location.href=i}r(null)}))}getRedirectResult(e,r){let t=r||window.location.search,n=window.location.origin+window.location.pathname;return window.history.replaceState(null,"",n),P.call(this,t,e)}loginWithPopup(e){let r=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_popup",[_(h({},e),{apiKey:this.sdk.apiKey,platform:"web"})]);return this.request(r)}seamlessTelegramLogin(){try{if(!window.location.hash.toString().includes("#tgWebAppData"))return;let e=document.createElement("script");e.src="https://telegram.org/js/telegram-web-app.js",document.head.prepend(e),e.onload=()=>u(this,null,function*(){var r;try{let t=(r=window.Telegram)==null?void 0:r.WebApp.initData,n=this.utils.createJsonRpcRequestPayload("magic_oauth_verify_telegram_data",[{userData:t,isMiniApp:!0}]);yield this.request(n)}catch(t){console.log("Error while verifying telegram data",t)}})}catch(e){console.log("Error while loading telegram-web-app script",e)}}};function P(e,r){return this.utils.createPromiEvent((t,n)=>u(this,null,function*(){var s;let l=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_redirect_verify",[{authorizationResponseParams:e,magicApiKey:this.sdk.apiKey,platform:"web",lifespan:r}]),a=yield this.request(l),o=a,i=a;i.error&&n(this.createError(i.error,(s=i.error_description)!=null?s:"An error occurred.",{errorURI:i.error_uri,provider:i.provider})),t(o)}))}export{R as OAuthErrorCode,I as OAuthExtension,b as OAuthPayloadMethods};