"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./lit-element-Cpy16KIW.js"),d=require("./class-map-BMhmY7P2.js"),r=require("./solana-CXtk3UX1.js"),w=require("./index-DUyGY36L.js"),p=o.proxy({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),C={state:p,subscribe(s){return o.subscribe(p,()=>s(p))},subscribeKey(s,e){return o.subscribeKey(p,s,e)},showTooltip({message:s,triggerRect:e,variant:t}){p.open=!0,p.message=s,p.triggerRect=e,p.variant=t},hide(){p.open=!1,p.message="",p.triggerRect={width:0,height:0,top:0,left:0}}},j=o.i`
  :host {
    display: block;
    border-radius: clamp(0px, var(--wui-border-radius-l), 44px);
    box-shadow: 0 0 0 1px var(--wui-color-gray-glass-005);
    background-color: var(--wui-color-modal-bg);
    overflow: hidden;
  }

  :host([data-embedded='true']) {
    box-shadow:
      0 0 0 1px var(--wui-color-gray-glass-005),
      0px 4px 12px 4px var(--w3m-card-embedded-shadow-color);
  }
`;var M=function(s,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,n);else for(var c=s.length-1;c>=0;c--)(l=s[c])&&(i=(a<3?l(i):a>3?l(e,t,i):l(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i};let O=class extends o.i$1{render(){return o.x`<slot></slot>`}};O.styles=[r.resetStyles,j];O=M([w.customElement("wui-card")],O);const L=o.i`
  :host {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--wui-spacing-s);
    border-radius: var(--wui-border-radius-s);
    border: 1px solid var(--wui-color-dark-glass-100);
    box-sizing: border-box;
    background-color: var(--wui-color-bg-325);
    box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25);
  }

  wui-flex {
    width: 100%;
  }

  wui-text {
    word-break: break-word;
    flex: 1;
  }

  .close {
    cursor: pointer;
  }

  .icon-box {
    height: 40px;
    width: 40px;
    border-radius: var(--wui-border-radius-3xs);
    background-color: var(--local-icon-bg-value);
  }
`;var k=function(s,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,n);else for(var c=s.length-1;c>=0;c--)(l=s[c])&&(i=(a<3?l(i):a>3?l(e,t,i):l(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i};let v=class extends o.i$1{constructor(){super(...arguments),this.message="",this.backgroundColor="accent-100",this.iconColor="accent-100",this.icon="info"}render(){return this.style.cssText=`
      --local-icon-bg-value: var(--wui-color-${this.backgroundColor});
   `,o.x`
      <wui-flex flexDirection="row" justifyContent="space-between" alignItems="center">
        <wui-flex columnGap="xs" flexDirection="row" alignItems="center">
          <wui-flex
            flexDirection="row"
            alignItems="center"
            justifyContent="center"
            class="icon-box"
          >
            <wui-icon color=${this.iconColor} size="md" name=${this.icon}></wui-icon>
          </wui-flex>
          <wui-text variant="small-500" color="bg-350" data-testid="wui-alertbar-text"
            >${this.message}</wui-text
          >
        </wui-flex>
        <wui-icon
          class="close"
          color="bg-350"
          size="sm"
          name="close"
          @click=${this.onClose}
        ></wui-icon>
      </wui-flex>
    `}onClose(){r.AlertController.close()}};v.styles=[r.resetStyles,L];k([d.n()],v.prototype,"message",void 0);k([d.n()],v.prototype,"backgroundColor",void 0);k([d.n()],v.prototype,"iconColor",void 0);k([d.n()],v.prototype,"icon",void 0);v=k([w.customElement("wui-alertbar")],v);const z=o.i`
  :host {
    display: block;
    position: absolute;
    top: var(--wui-spacing-s);
    left: var(--wui-spacing-l);
    right: var(--wui-spacing-l);
    opacity: 0;
    pointer-events: none;
  }
`;var _=function(s,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,n);else for(var c=s.length-1;c>=0;c--)(l=s[c])&&(i=(a<3?l(i):a>3?l(e,t,i):l(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i};const H={info:{backgroundColor:"fg-350",iconColor:"fg-325",icon:"info"},success:{backgroundColor:"success-glass-reown-020",iconColor:"success-125",icon:"checkmark"},warning:{backgroundColor:"warning-glass-reown-020",iconColor:"warning-100",icon:"warningCircle"},error:{backgroundColor:"error-glass-reown-020",iconColor:"error-125",icon:"exclamationTriangle"}};let $=class extends o.i$1{constructor(){super(),this.unsubscribe=[],this.open=r.AlertController.state.open,this.onOpen(!0),this.unsubscribe.push(r.AlertController.subscribeKey("open",e=>{this.open=e,this.onOpen(!1)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const{message:e,variant:t}=r.AlertController.state,n=H[t];return o.x`
      <wui-alertbar
        message=${e}
        backgroundColor=${n?.backgroundColor}
        iconColor=${n?.iconColor}
        icon=${n?.icon}
      ></wui-alertbar>
    `}onOpen(e){this.open?(this.animate([{opacity:0,transform:"scale(0.85)"},{opacity:1,transform:"scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: auto"):e||(this.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: none")}};$.styles=z;_([d.r()],$.prototype,"open",void 0);$=_([w.customElement("w3m-alertbar")],$);const K=o.i`
  button {
    border-radius: var(--local-border-radius);
    color: var(--wui-color-fg-100);
    padding: var(--local-padding);
  }

  @media (max-width: 700px) {
    button {
      padding: var(--wui-spacing-s);
    }
  }

  button > wui-icon {
    pointer-events: none;
  }

  button:disabled > wui-icon {
    color: var(--wui-color-bg-300) !important;
  }

  button:disabled {
    background-color: transparent;
  }
`;var S=function(s,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,n);else for(var c=s.length-1;c>=0;c--)(l=s[c])&&(i=(a<3?l(i):a>3?l(e,t,i):l(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i};let f=class extends o.i$1{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.icon="copy",this.iconColor="inherit"}render(){const e=this.size==="lg"?"--wui-border-radius-xs":"--wui-border-radius-xxs",t=this.size==="lg"?"--wui-spacing-1xs":"--wui-spacing-2xs";return this.style.cssText=`
    --local-border-radius: var(${e});
    --local-padding: var(${t});
`,o.x`
      <button ?disabled=${this.disabled}>
        <wui-icon color=${this.iconColor} size=${this.size} name=${this.icon}></wui-icon>
      </button>
    `}};f.styles=[r.resetStyles,r.elementStyles,r.colorStyles,K];S([d.n()],f.prototype,"size",void 0);S([d.n({type:Boolean})],f.prototype,"disabled",void 0);S([d.n()],f.prototype,"icon",void 0);S([d.n()],f.prototype,"iconColor",void 0);f=S([w.customElement("wui-icon-link")],f);const V=o.i`
  button {
    display: block;
    display: flex;
    align-items: center;
    padding: var(--wui-spacing-xxs);
    gap: var(--wui-spacing-xxs);
    transition: all var(--wui-ease-out-power-1) var(--wui-duration-md);
    border-radius: var(--wui-border-radius-xxs);
  }

  wui-image {
    border-radius: 100%;
    width: var(--wui-spacing-xl);
    height: var(--wui-spacing-xl);
  }

  wui-icon-box {
    width: var(--wui-spacing-xl);
    height: var(--wui-spacing-xl);
  }

  button:hover {
    background-color: var(--wui-color-gray-glass-002);
  }

  button:active {
    background-color: var(--wui-color-gray-glass-005);
  }
`;var P=function(s,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,n);else for(var c=s.length-1;c>=0;c--)(l=s[c])&&(i=(a<3?l(i):a>3?l(e,t,i):l(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i};let W=class extends o.i$1{constructor(){super(...arguments),this.imageSrc=""}render(){return o.x`<button>
      ${this.imageTemplate()}
      <wui-icon size="xs" color="fg-200" name="chevronBottom"></wui-icon>
    </button>`}imageTemplate(){return this.imageSrc?o.x`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>`:o.x`<wui-icon-box
      size="xxs"
      iconColor="fg-200"
      backgroundColor="fg-100"
      background="opaque"
      icon="networkPlaceholder"
    ></wui-icon-box>`}};W.styles=[r.resetStyles,r.elementStyles,r.colorStyles,V];P([d.n()],W.prototype,"imageSrc",void 0);W=P([w.customElement("wui-select")],W);const X=o.i`
  :host {
    height: 64px;
  }

  wui-text {
    text-transform: capitalize;
  }

  wui-flex.w3m-header-title {
    transform: translateY(0);
    opacity: 1;
  }

  wui-flex.w3m-header-title[view-direction='prev'] {
    animation:
      slide-down-out 120ms forwards var(--wui-ease-out-power-2),
      slide-down-in 120ms forwards var(--wui-ease-out-power-2);
    animation-delay: 0ms, 200ms;
  }

  wui-flex.w3m-header-title[view-direction='next'] {
    animation:
      slide-up-out 120ms forwards var(--wui-ease-out-power-2),
      slide-up-in 120ms forwards var(--wui-ease-out-power-2);
    animation-delay: 0ms, 200ms;
  }

  wui-icon-link[data-hidden='true'] {
    opacity: 0 !important;
    pointer-events: none;
  }

  @keyframes slide-up-out {
    from {
      transform: translateY(0px);
      opacity: 1;
    }
    to {
      transform: translateY(3px);
      opacity: 0;
    }
  }

  @keyframes slide-up-in {
    from {
      transform: translateY(-3px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  @keyframes slide-down-out {
    from {
      transform: translateY(0px);
      opacity: 1;
    }
    to {
      transform: translateY(-3px);
      opacity: 0;
    }
  }

  @keyframes slide-down-in {
    from {
      transform: translateY(3px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
`;var m=function(s,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,n);else for(var c=s.length-1;c>=0;c--)(l=s[c])&&(i=(a<3?l(i):a>3?l(e,t,i):l(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i};const Y=["SmartSessionList"];function E(){const s=r.RouterController.state.data?.connector?.name,e=r.RouterController.state.data?.wallet?.name,t=r.RouterController.state.data?.network?.name,n=e??s,a=r.ConnectorController.getConnectors();return{Connect:`Connect ${a.length===1&&a[0]?.id==="w3m-email"?"Email":""} Wallet`,Create:"Create Wallet",ChooseAccountName:void 0,Account:void 0,AccountSettings:void 0,AllWallets:"All Wallets",ApproveTransaction:"Approve Transaction",BuyInProgress:"Buy",ConnectingExternal:n??"Connect Wallet",ConnectingWalletConnect:n??"WalletConnect",ConnectingWalletConnectBasic:"WalletConnect",ConnectingSiwe:"Sign In",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview convert",Downloads:n?`Get ${n}`:"Downloads",EmailLogin:"Email Login",EmailVerifyOtp:"Confirm Email",EmailVerifyDevice:"Register Device",GetWallet:"Get a wallet",Networks:"Choose Network",OnRampProviders:"Choose Provider",OnRampActivity:"Activity",OnRampTokenSelect:"Select Token",OnRampFiatSelect:"Select Currency",Profile:void 0,SwitchNetwork:t??"Switch Network",SwitchAddress:"Switch Address",Transactions:"Activity",UnsupportedChain:"Switch Network",UpgradeEmailWallet:"Upgrade your Wallet",UpdateEmailWallet:"Edit Email",UpdateEmailPrimaryOtp:"Confirm Current Email",UpdateEmailSecondaryOtp:"Confirm New Email",WhatIsABuy:"What is Buy?",RegisterAccountName:"Choose name",RegisterAccountNameSuccess:"",WalletReceive:"Receive",WalletCompatibleNetworks:"Compatible Networks",Swap:"Swap",SwapSelectToken:"Select token",SwapPreview:"Preview swap",WalletSend:"Send",WalletSendPreview:"Review send",WalletSendSelectToken:"Select Token",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a wallet?",ConnectWallets:"Connect wallet",ConnectSocials:"All socials",ConnectingSocial:r.AccountController.state.socialProvider?r.AccountController.state.socialProvider:"Connect Social",ConnectingMultiChain:"Select chain",ConnectingFarcaster:"Farcaster",SwitchActiveChain:"Switch chain",SmartSessionCreated:void 0,SmartSessionList:"Smart Sessions",SIWXSignMessage:"Sign In"}}let u=class extends o.i$1{constructor(){super(),this.unsubscribe=[],this.heading=E()[r.RouterController.state.view],this.network=r.ChainController.state.activeCaipNetwork,this.networkImage=r.AssetUtil.getNetworkImage(this.network),this.buffering=!1,this.showBack=!1,this.prevHistoryLength=1,this.view=r.RouterController.state.view,this.viewDirection="",this.headerText=E()[r.RouterController.state.view],this.unsubscribe.push(r.AssetController.subscribeNetworkImages(()=>{this.networkImage=r.AssetUtil.getNetworkImage(this.network)}),r.RouterController.subscribeKey("view",e=>{setTimeout(()=>{this.view=e,this.headerText=E()[e]},r.ConstantsUtil$2.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()}),r.ConnectionController.subscribeKey("buffering",e=>this.buffering=e),r.ChainController.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=r.AssetUtil.getNetworkImage(this.network)}))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){return o.x`
      <wui-flex .padding=${this.getPadding()} justifyContent="space-between" alignItems="center">
        ${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()}
      </wui-flex>
    `}onWalletHelp(){r.EventsController.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),r.RouterController.push("WhatIsAWallet")}async onClose(){r.RouterController.state.view==="UnsupportedChain"||await r.SIWXUtil.isSIWXCloseDisabled()?r.ModalController.shake():r.ModalController.close()}rightHeaderTemplate(){const e=r.OptionsController?.state?.features?.smartSessions;return r.RouterController.state.view!=="Account"||!e?this.closeButtonTemplate():o.x`<wui-flex>
      <wui-icon-link
        icon="clock"
        @click=${()=>r.RouterController.push("SmartSessionList")}
        data-testid="w3m-header-smart-sessions"
      ></wui-icon-link>
      ${this.closeButtonTemplate()}
    </wui-flex> `}closeButtonTemplate(){return o.x`
      <wui-icon-link
        ?disabled=${this.buffering}
        icon="close"
        @click=${this.onClose.bind(this)}
        data-testid="w3m-header-close"
      ></wui-icon-link>
    `}titleTemplate(){const e=Y.includes(this.view);return o.x`
      <wui-flex
        view-direction="${this.viewDirection}"
        class="w3m-header-title"
        alignItems="center"
        gap="xs"
      >
        <wui-text variant="paragraph-700" color="fg-100" data-testid="w3m-header-text"
          >${this.headerText}</wui-text
        >
        ${e?o.x`<wui-tag variant="main">Beta</wui-tag>`:null}
      </wui-flex>
    `}leftHeaderTemplate(){const{view:e}=r.RouterController.state,t=e==="Connect",n=r.OptionsController.state.enableEmbedded,a=e==="ApproveTransaction",i=e==="ConnectingSiwe",l=e==="Account",c=r.OptionsController.state.enableNetworkSwitch,A=a||i||t&&n;return l&&c?o.x`<wui-select
        id="dynamic"
        data-testid="w3m-account-select-network"
        active-network=${d.o(this.network?.name)}
        @click=${this.onNetworks.bind(this)}
        imageSrc=${d.o(this.networkImage)}
      ></wui-select>`:this.showBack&&!A?o.x`<wui-icon-link
        data-testid="header-back"
        id="dynamic"
        icon="chevronLeft"
        ?disabled=${this.buffering}
        @click=${this.onGoBack.bind(this)}
      ></wui-icon-link>`:o.x`<wui-icon-link
      data-hidden=${!t}
      id="dynamic"
      icon="helpCircle"
      @click=${this.onWalletHelp.bind(this)}
    ></wui-icon-link>`}onNetworks(){this.isAllowedNetworkSwitch()&&(r.EventsController.sendEvent({type:"track",event:"CLICK_NETWORKS"}),r.RouterController.push("Networks"))}isAllowedNetworkSwitch(){const e=r.ChainController.getAllRequestedCaipNetworks(),t=e?e.length>1:!1,n=e?.find(({id:a})=>a===this.network?.id);return t||!n}getPadding(){return this.heading?["l","2l","l","2l"]:["0","2l","0","2l"]}onViewChange(){const{history:e}=r.RouterController.state;let t=r.ConstantsUtil$2.VIEW_DIRECTION.Next;e.length<this.prevHistoryLength&&(t=r.ConstantsUtil$2.VIEW_DIRECTION.Prev),this.prevHistoryLength=e.length,this.viewDirection=t}async onHistoryChange(){const{history:e}=r.RouterController.state,t=this.shadowRoot?.querySelector("#dynamic");e.length>1&&!this.showBack&&t?(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!0,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})):e.length<=1&&this.showBack&&t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!1,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}onGoBack(){r.RouterController.goBack()}};u.styles=X;m([d.r()],u.prototype,"heading",void 0);m([d.r()],u.prototype,"network",void 0);m([d.r()],u.prototype,"networkImage",void 0);m([d.r()],u.prototype,"buffering",void 0);m([d.r()],u.prototype,"showBack",void 0);m([d.r()],u.prototype,"prevHistoryLength",void 0);m([d.r()],u.prototype,"view",void 0);m([d.r()],u.prototype,"viewDirection",void 0);m([d.r()],u.prototype,"headerText",void 0);u=m([w.customElement("w3m-header")],u);const q=o.i`
  :host {
    display: flex;
    column-gap: var(--wui-spacing-s);
    align-items: center;
    padding: var(--wui-spacing-xs) var(--wui-spacing-m) var(--wui-spacing-xs) var(--wui-spacing-xs);
    border-radius: var(--wui-border-radius-s);
    border: 1px solid var(--wui-color-gray-glass-005);
    box-sizing: border-box;
    background-color: var(--wui-color-bg-175);
    box-shadow:
      0px 14px 64px -4px rgba(0, 0, 0, 0.15),
      0px 8px 22px -6px rgba(0, 0, 0, 0.15);

    max-width: 300px;
  }

  :host wui-loading-spinner {
    margin-left: var(--wui-spacing-3xs);
  }
`;var b=function(s,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,n);else for(var c=s.length-1;c>=0;c--)(l=s[c])&&(i=(a<3?l(i):a>3?l(e,t,i):l(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i};let h=class extends o.i$1{constructor(){super(...arguments),this.backgroundColor="accent-100",this.iconColor="accent-100",this.icon="checkmark",this.message="",this.loading=!1,this.iconType="default"}render(){return o.x`
      ${this.templateIcon()}
      <wui-text variant="paragraph-500" color="fg-100" data-testid="wui-snackbar-message"
        >${this.message}</wui-text
      >
    `}templateIcon(){return this.loading?o.x`<wui-loading-spinner size="md" color="accent-100"></wui-loading-spinner>`:this.iconType==="default"?o.x`<wui-icon size="xl" color=${this.iconColor} name=${this.icon}></wui-icon>`:o.x`<wui-icon-box
      size="sm"
      iconSize="xs"
      iconColor=${this.iconColor}
      backgroundColor=${this.backgroundColor}
      icon=${this.icon}
      background="opaque"
    ></wui-icon-box>`}};h.styles=[r.resetStyles,q];b([d.n()],h.prototype,"backgroundColor",void 0);b([d.n()],h.prototype,"iconColor",void 0);b([d.n()],h.prototype,"icon",void 0);b([d.n()],h.prototype,"message",void 0);b([d.n()],h.prototype,"loading",void 0);b([d.n()],h.prototype,"iconType",void 0);h=b([w.customElement("wui-snackbar")],h);const G=o.i`
  :host {
    display: block;
    position: absolute;
    opacity: 0;
    pointer-events: none;
    top: 11px;
    left: 50%;
    width: max-content;
  }
`;var U=function(s,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,n);else for(var c=s.length-1;c>=0;c--)(l=s[c])&&(i=(a<3?l(i):a>3?l(e,t,i):l(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i};const F={loading:void 0,success:{backgroundColor:"success-100",iconColor:"success-100",icon:"checkmark"},error:{backgroundColor:"error-100",iconColor:"error-100",icon:"close"}};let N=class extends o.i$1{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=r.SnackController.state.open,this.unsubscribe.push(r.SnackController.subscribeKey("open",e=>{this.open=e,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(e=>e())}render(){const{message:e,variant:t,svg:n}=r.SnackController.state,a=F[t],{icon:i,iconColor:l}=n??a??{};return o.x`
      <wui-snackbar
        message=${e}
        backgroundColor=${a?.backgroundColor}
        iconColor=${l}
        icon=${i}
        .loading=${t==="loading"}
      ></wui-snackbar>
    `}onOpen(){clearTimeout(this.timeout),this.open?(this.animate([{opacity:0,transform:"translateX(-50%) scale(0.85)"},{opacity:1,transform:"translateX(-50%) scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.timeout&&clearTimeout(this.timeout),r.SnackController.state.autoClose&&(this.timeout=setTimeout(()=>r.SnackController.hide(),2500))):this.animate([{opacity:1,transform:"translateX(-50%) scale(1)"},{opacity:0,transform:"translateX(-50%) scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"})}};N.styles=G;U([d.r()],N.prototype,"open",void 0);N=U([w.customElement("w3m-snackbar")],N);const J=o.i`
  :host {
    pointer-events: none;
  }

  :host > wui-flex {
    display: var(--w3m-tooltip-display);
    opacity: var(--w3m-tooltip-opacity);
    padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s);
    border-radius: var(--wui-border-radius-xxs);
    color: var(--wui-color-bg-100);
    position: fixed;
    top: var(--w3m-tooltip-top);
    left: var(--w3m-tooltip-left);
    transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px));
    max-width: calc(var(--w3m-modal-width) - var(--wui-spacing-xl));
    transition: opacity 0.2s var(--wui-ease-out-power-2);
    will-change: opacity;
  }

  :host([data-variant='shade']) > wui-flex {
    background-color: var(--wui-color-bg-150);
    border: 1px solid var(--wui-color-gray-glass-005);
  }

  :host([data-variant='shade']) > wui-flex > wui-text {
    color: var(--wui-color-fg-150);
  }

  :host([data-variant='fill']) > wui-flex {
    background-color: var(--wui-color-fg-100);
    border: none;
  }

  wui-icon {
    position: absolute;
    width: 12px !important;
    height: 4px !important;
    color: var(--wui-color-bg-150);
  }

  wui-icon[data-placement='top'] {
    bottom: 0px;
    left: 50%;
    transform: translate(-50%, 95%);
  }

  wui-icon[data-placement='bottom'] {
    top: 0;
    left: 50%;
    transform: translate(-50%, -95%) rotate(180deg);
  }

  wui-icon[data-placement='right'] {
    top: 50%;
    left: 0;
    transform: translate(-65%, -50%) rotate(90deg);
  }

  wui-icon[data-placement='left'] {
    top: 50%;
    right: 0%;
    transform: translate(65%, -50%) rotate(270deg);
  }
`;var R=function(s,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,n);else for(var c=s.length-1;c>=0;c--)(l=s[c])&&(i=(a<3?l(i):a>3?l(e,t,i):l(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i};let g=class extends o.i$1{constructor(){super(),this.unsubscribe=[],this.open=C.state.open,this.message=C.state.message,this.triggerRect=C.state.triggerRect,this.variant=C.state.variant,this.unsubscribe.push(C.subscribe(e=>{this.open=e.open,this.message=e.message,this.triggerRect=e.triggerRect,this.variant=e.variant}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){this.dataset.variant=this.variant;const e=this.triggerRect.top,t=this.triggerRect.left;return this.style.cssText=`
    --w3m-tooltip-top: ${e}px;
    --w3m-tooltip-left: ${t}px;
    --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px;
    --w3m-tooltip-display: ${this.open?"flex":"none"};
    --w3m-tooltip-opacity: ${this.open?1:0};
    `,o.x`<wui-flex>
      <wui-icon data-placement="top" color="fg-100" size="inherit" name="cursor"></wui-icon>
      <wui-text color="inherit" variant="small-500">${this.message}</wui-text>
    </wui-flex>`}};g.styles=[J];R([d.r()],g.prototype,"open",void 0);R([d.r()],g.prototype,"message",void 0);R([d.r()],g.prototype,"triggerRect",void 0);R([d.r()],g.prototype,"variant",void 0);g=R([w.customElement("w3m-tooltip"),w.customElement("w3m-tooltip")],g);const Q=o.i`
  :host {
    --prev-height: 0px;
    --new-height: 0px;
    display: block;
  }

  div.w3m-router-container {
    transform: translateY(0);
    opacity: 1;
  }

  div.w3m-router-container[view-direction='prev'] {
    animation:
      slide-left-out 150ms forwards ease,
      slide-left-in 150ms forwards ease;
    animation-delay: 0ms, 200ms;
  }

  div.w3m-router-container[view-direction='next'] {
    animation:
      slide-right-out 150ms forwards ease,
      slide-right-in 150ms forwards ease;
    animation-delay: 0ms, 200ms;
  }

  @keyframes slide-left-out {
    from {
      transform: translateX(0px);
      opacity: 1;
    }
    to {
      transform: translateX(10px);
      opacity: 0;
    }
  }

  @keyframes slide-left-in {
    from {
      transform: translateX(-10px);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }

  @keyframes slide-right-out {
    from {
      transform: translateX(0px);
      opacity: 1;
    }
    to {
      transform: translateX(-10px);
      opacity: 0;
    }
  }

  @keyframes slide-right-in {
    from {
      transform: translateX(10px);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
`;var T=function(s,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,n);else for(var c=s.length-1;c>=0;c--)(l=s[c])&&(i=(a<3?l(i):a>3?l(e,t,i):l(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i};let y=class extends o.i$1{constructor(){super(),this.resizeObserver=void 0,this.prevHeight="0px",this.prevHistoryLength=1,this.unsubscribe=[],this.view=r.RouterController.state.view,this.viewDirection="",this.unsubscribe.push(r.RouterController.subscribeKey("view",e=>this.onViewChange(e)))}firstUpdated(){this.resizeObserver=new ResizeObserver(([e])=>{const t=`${e?.contentRect.height}px`;this.prevHeight!=="0px"&&(this.style.setProperty("--prev-height",this.prevHeight),this.style.setProperty("--new-height",t),this.style.animation="w3m-view-height 150ms forwards ease",this.style.height="auto"),setTimeout(()=>{this.prevHeight=t,this.style.animation="unset"},r.ConstantsUtil$2.ANIMATION_DURATIONS.ModalHeight)}),this.resizeObserver?.observe(this.getWrapper())}disconnectedCallback(){this.resizeObserver?.unobserve(this.getWrapper()),this.unsubscribe.forEach(e=>e())}render(){return o.x`<div class="w3m-router-container" view-direction="${this.viewDirection}">
      ${this.viewTemplate()}
    </div>`}viewTemplate(){switch(this.view){case"AccountSettings":return o.x`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return o.x`<w3m-account-view></w3m-account-view>`;case"AllWallets":return o.x`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return o.x`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return o.x`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return o.x`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":return o.x`<w3m-connect-view></w3m-connect-view>`;case"Create":return o.x`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return o.x`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingWalletConnectBasic":return o.x`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;case"ConnectingExternal":return o.x`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return o.x`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return o.x`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return o.x`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return o.x`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"Downloads":return o.x`<w3m-downloads-view></w3m-downloads-view>`;case"EmailLogin":return o.x`<w3m-email-login-view></w3m-email-login-view>`;case"EmailVerifyOtp":return o.x`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return o.x`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return o.x`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return o.x`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return o.x`<w3m-network-switch-view></w3m-network-switch-view>`;case"Profile":return o.x`<w3m-profile-view></w3m-profile-view>`;case"SwitchAddress":return o.x`<w3m-switch-address-view></w3m-switch-address-view>`;case"Transactions":return o.x`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return o.x`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampActivity":return o.x`<w3m-onramp-activity-view></w3m-onramp-activity-view>`;case"OnRampTokenSelect":return o.x`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return o.x`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return o.x`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpdateEmailWallet":return o.x`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return o.x`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return o.x`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return o.x`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return o.x`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return o.x`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return o.x`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return o.x`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return o.x`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return o.x`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WhatIsABuy":return o.x`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return o.x`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return o.x`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return o.x`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return o.x`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return o.x`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return o.x`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return o.x`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return o.x`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return o.x`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return o.x`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return o.x`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;case"SIWXSignMessage":return o.x`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;default:return o.x`<w3m-connect-view></w3m-connect-view>`}}onViewChange(e){C.hide();let t=r.ConstantsUtil$2.VIEW_DIRECTION.Next;const{history:n}=r.RouterController.state;n.length<this.prevHistoryLength&&(t=r.ConstantsUtil$2.VIEW_DIRECTION.Prev),this.prevHistoryLength=n.length,this.viewDirection=t,setTimeout(()=>{this.view=e},r.ConstantsUtil$2.ANIMATION_DURATIONS.ViewTransition)}getWrapper(){return this.shadowRoot?.querySelector("div")}};y.styles=Q;T([d.r()],y.prototype,"view",void 0);T([d.r()],y.prototype,"viewDirection",void 0);y=T([w.customElement("w3m-router")],y);const Z=o.i`
  :host {
    z-index: var(--w3m-z-index);
    display: block;
    backface-visibility: hidden;
    will-change: opacity;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0;
    background-color: var(--wui-cover);
    transition: opacity 0.2s var(--wui-ease-out-power-2);
    will-change: opacity;
  }

  :host(.open) {
    opacity: 1;
  }

  :host(.embedded) {
    position: relative;
    pointer-events: unset;
    background: none;
    width: 100%;
    opacity: 1;
  }

  wui-card {
    max-width: var(--w3m-modal-width);
    width: 100%;
    position: relative;
    animation: zoom-in 0.2s var(--wui-ease-out-power-2);
    animation-fill-mode: backwards;
    outline: none;
    transition:
      border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1),
      background-color var(--wui-duration-lg) var(--wui-ease-out-power-1);
    will-change: border-radius, background-color;
  }

  :host(.embedded) wui-card {
    max-width: 400px;
  }

  wui-card[shake='true'] {
    animation:
      zoom-in 0.2s var(--wui-ease-out-power-2),
      w3m-shake 0.5s var(--wui-ease-out-power-2);
  }

  wui-flex {
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
  }

  @media (max-height: 700px) and (min-width: 431px) {
    wui-flex {
      align-items: flex-start;
    }

    wui-card {
      margin: var(--wui-spacing-xxl) 0px;
    }
  }

  @media (max-width: 430px) {
    wui-flex {
      align-items: flex-end;
    }

    wui-card {
      max-width: 100%;
      border-bottom-left-radius: var(--local-border-bottom-mobile-radius);
      border-bottom-right-radius: var(--local-border-bottom-mobile-radius);
      border-bottom: none;
      animation: slide-in 0.2s var(--wui-ease-out-power-2);
    }

    wui-card[shake='true'] {
      animation:
        slide-in 0.2s var(--wui-ease-out-power-2),
        w3m-shake 0.5s var(--wui-ease-out-power-2);
    }
  }

  @keyframes zoom-in {
    0% {
      transform: scale(0.95) translateY(0);
    }
    100% {
      transform: scale(1) translateY(0);
    }
  }

  @keyframes slide-in {
    0% {
      transform: scale(1) translateY(50px);
    }
    100% {
      transform: scale(1) translateY(0);
    }
  }

  @keyframes w3m-shake {
    0% {
      transform: scale(1) rotate(0deg);
    }
    20% {
      transform: scale(1) rotate(-1deg);
    }
    40% {
      transform: scale(1) rotate(1.5deg);
    }
    60% {
      transform: scale(1) rotate(-1.5deg);
    }
    80% {
      transform: scale(1) rotate(1deg);
    }
    100% {
      transform: scale(1) rotate(0deg);
    }
  }

  @keyframes w3m-view-height {
    from {
      height: var(--prev-height);
    }
    to {
      height: var(--new-height);
    }
  }
`;var x=function(s,e,t,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,n);else for(var c=s.length-1;c>=0;c--)(l=s[c])&&(i=(a<3?l(i):a>3?l(e,t,i):l(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i};const I="scroll-lock";exports.W3mModal=class extends o.i$1{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.hasPrefetched=!1,this.enableEmbedded=r.OptionsController.state.enableEmbedded,this.open=r.ModalController.state.open,this.caipAddress=r.ChainController.state.activeCaipAddress,this.caipNetwork=r.ChainController.state.activeCaipNetwork,this.shake=r.ModalController.state.shake,this.filterByNamespace=r.ConnectorController.state.filterByNamespace,this.initializeTheming(),r.ApiController.prefetchAnalyticsConfig(),this.unsubscribe.push(r.ModalController.subscribeKey("open",e=>e?this.onOpen():this.onClose()),r.ModalController.subscribeKey("shake",e=>this.shake=e),r.ChainController.subscribeKey("activeCaipNetwork",e=>this.onNewNetwork(e)),r.ChainController.subscribeKey("activeCaipAddress",e=>this.onNewAddress(e)),r.OptionsController.subscribeKey("enableEmbedded",e=>this.enableEmbedded=e),r.ConnectorController.subscribeKey("filterByNamespace",e=>{this.filterByNamespace!==e&&!r.ChainController.getAccountData(e)?.caipAddress&&(r.ApiController.fetchRecommendedWallets(),this.filterByNamespace=e)}))}firstUpdated(){if(this.caipAddress){if(this.enableEmbedded){r.ModalController.close(),this.prefetch();return}this.onNewAddress(this.caipAddress)}this.open&&this.onOpen(),this.enableEmbedded&&this.prefetch()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.onRemoveKeyboardListener()}render(){return this.style.cssText=`
      --local-border-bottom-mobile-radius: ${this.enableEmbedded?"clamp(0px, var(--wui-border-radius-l), 44px)":"0px"};
    `,this.enableEmbedded?o.x`${this.contentTemplate()}
        <w3m-tooltip></w3m-tooltip> `:this.open?o.x`
          <wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
            ${this.contentTemplate()}
          </wui-flex>
          <w3m-tooltip></w3m-tooltip>
        `:null}contentTemplate(){return o.x` <wui-card
      shake="${this.shake}"
      data-embedded="${d.o(this.enableEmbedded)}"
      role="alertdialog"
      aria-modal="true"
      tabindex="0"
      data-testid="w3m-modal-card"
    >
      <w3m-header></w3m-header>
      <w3m-router></w3m-router>
      <w3m-snackbar></w3m-snackbar>
      <w3m-alertbar></w3m-alertbar>
    </wui-card>`}async onOverlayClick(e){e.target===e.currentTarget&&await this.handleClose()}async handleClose(){r.RouterController.state.view==="UnsupportedChain"||await r.SIWXUtil.isSIWXCloseDisabled()?r.ModalController.shake():r.ModalController.close()}initializeTheming(){const{themeVariables:e,themeMode:t}=r.ThemeController.state,n=w.UiHelperUtil.getColorTheme(t);r.initializeTheming(e,n)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),r.SnackController.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){const e=document.createElement("style");e.dataset.w3m=I,e.textContent=`
      body {
        touch-action: none;
        overflow: hidden;
        overscroll-behavior: contain;
      }
      w3m-modal {
        pointer-events: auto;
      }
    `,document.head.appendChild(e)}onScrollUnlock(){const e=document.head.querySelector(`style[data-w3m="${I}"]`);e&&e.remove()}onAddKeyboardListener(){this.abortController=new AbortController;const e=this.shadowRoot?.querySelector("wui-card");e?.focus(),window.addEventListener("keydown",t=>{if(t.key==="Escape")this.handleClose();else if(t.key==="Tab"){const{tagName:n}=t.target;n&&!n.includes("W3M-")&&!n.includes("WUI-")&&e?.focus()}},this.abortController)}onRemoveKeyboardListener(){this.abortController?.abort(),this.abortController=void 0}async onNewAddress(e){const t=r.ChainController.state.isSwitchingNamespace,n=r.CoreHelperUtil.getPlainAddress(e);!n&&!t?r.ModalController.close():t&&n&&r.RouterController.goBack(),await r.SIWXUtil.initializeIfEnabled(),this.caipAddress=e,r.ChainController.setIsSwitchingNamespace(!1)}onNewNetwork(e){const t=this.caipNetwork?.caipNetworkId?.toString(),n=e?.caipNetworkId?.toString(),a=t&&n&&t!==n,i=r.ChainController.state.isSwitchingNamespace,l=this.caipNetwork?.name===r.ConstantsUtil.UNSUPPORTED_NETWORK_NAME,c=r.RouterController.state.view==="ConnectingExternal",A=!this.caipAddress,B=a&&!l&&!i,D=r.RouterController.state.view==="UnsupportedChain";r.ModalController.state.open&&!c&&(A||D||B)&&r.RouterController.goBack(),this.caipNetwork=e}prefetch(){this.hasPrefetched||(r.ApiController.prefetch(),r.ApiController.fetchWallets({page:1}),this.hasPrefetched=!0)}};exports.W3mModal.styles=Z;x([d.n({type:Boolean})],exports.W3mModal.prototype,"enableEmbedded",void 0);x([d.r()],exports.W3mModal.prototype,"open",void 0);x([d.r()],exports.W3mModal.prototype,"caipAddress",void 0);x([d.r()],exports.W3mModal.prototype,"caipNetwork",void 0);x([d.r()],exports.W3mModal.prototype,"shake",void 0);x([d.r()],exports.W3mModal.prototype,"filterByNamespace",void 0);exports.W3mModal=x([w.customElement("w3m-modal")],exports.W3mModal);
