'use strict';

var swapModule_entry = require('./swap-module-BZ0C_ywD.js');
var index = require('./index-CAgSYWnN.js');
require('./index-D67PsI9D.js');
require('./index-Mw_M0XDo.js');
require('./index-DPGpMPia.js');
var ref = require('./ref-DoziWPoT.js');
require('./index-DsnRxG7H.js');
require('./index-Bq66f3r7.js');
require('./index-I_LnCKSh.js');
var SwapController = require('./SwapController-WkMJI0Id.js');
require('./index-l_GugSCx.js');
require('./index-C6jID9WD.js');
require('./index-DYShkd_q.js');
require('./index-UWPXTZUD.js');
var ifDefined = require('./if-defined-C8-lLqpT.js');
require('./index-kE_lp0w-.js');
require('buffer');
require('events');
require('ox');
require('viem');
require('viem/chains');
require('./index-U1WZx3oG.js');
require('./index-ClB8inJV.js');

var styles$8 = swapModule_entry.css `
  :host {
    width: 100%;
    height: 100px;
    border-radius: ${({ borderRadius }) => borderRadius['5']};
    border: 1px solid ${({ tokens }) => tokens.theme.foregroundPrimary};
    background-color: ${({ tokens }) => tokens.theme.foregroundPrimary};
    transition: background-color ${({ durations }) => durations['lg']}
      ${({ easings }) => easings['ease-out-power-1']};
    will-change: background-color;
    position: relative;
  }

  :host(:hover) {
    background-color: ${({ tokens }) => tokens.theme.foregroundSecondary};
  }

  wui-flex {
    width: 100%;
    height: fit-content;
  }

  wui-button {
    display: ruby;
    color: ${({ tokens }) => tokens.theme.textPrimary};
    margin: 0 ${({ spacing }) => spacing['2']};
  }

  .instruction {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
  }

  .paste {
    display: inline-flex;
  }

  textarea {
    background: transparent;
    width: 100%;
    font-family: ${({ fontFamily }) => fontFamily.regular};
    font-style: normal;
    font-size: ${({ textSize }) => textSize.large};
    font-weight: ${({ fontWeight }) => fontWeight.regular};
    line-height: ${({ typography }) => typography['lg-regular'].lineHeight};
    letter-spacing: ${({ typography }) => typography['lg-regular'].letterSpacing};
    color: ${({ tokens }) => tokens.theme.textSecondary};
    caret-color: ${({ tokens }) => tokens.core.backgroundAccentPrimary};
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    padding: 0px;
    border: none;
    outline: none;
    appearance: none;
    resize: none;
    overflow: hidden;
  }
`;

var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
let W3mInputAddress = class W3mInputAddress extends swapModule_entry.i {
    constructor() {
        super(...arguments);
        this.inputElementRef = ref.e();
        this.instructionElementRef = ref.e();
        this.readOnly = false;
        this.instructionHidden = Boolean(this.value);
        this.pasting = false;
        this.onDebouncedSearch = swapModule_entry.CoreHelperUtil.debounce(async (value) => {
            if (!value.length) {
                this.setReceiverAddress('');
                return;
            }
            const activeChain = swapModule_entry.ChainController.state.activeChain;
            const isValidAddress = swapModule_entry.CoreHelperUtil.isAddress(value, activeChain);
            if (isValidAddress) {
                this.setReceiverAddress(value);
                return;
            }
            try {
                const resolvedAddress = await swapModule_entry.ConnectionController.getEnsAddress(value);
                if (resolvedAddress) {
                    swapModule_entry.SendController.setReceiverProfileName(value);
                    swapModule_entry.SendController.setReceiverAddress(resolvedAddress);
                    const avatar = await swapModule_entry.ConnectionController.getEnsAvatar(value);
                    swapModule_entry.SendController.setReceiverProfileImageUrl(avatar || undefined);
                }
            }
            catch (error) {
                this.setReceiverAddress(value);
            }
            finally {
                swapModule_entry.SendController.setLoading(false);
            }
        });
    }
    firstUpdated() {
        if (this.value) {
            this.instructionHidden = true;
        }
        this.checkHidden();
    }
    render() {
        if (this.readOnly) {
            return swapModule_entry.b ` <wui-flex
        flexDirection="column"
        justifyContent="center"
        gap="01"
        .padding=${['8', '4', '5', '4']}
      >
        <textarea
          spellcheck="false"
          ?disabled=${true}
          autocomplete="off"
          .value=${this.value ?? ''}
        >
           ${this.value ?? ''}</textarea
        >
      </wui-flex>`;
        }
        return swapModule_entry.b ` <wui-flex
      @click=${this.onBoxClick.bind(this)}
      flexDirection="column"
      justifyContent="center"
      gap="01"
      .padding=${['8', '4', '5', '4']}
    >
      <wui-text
        ${ref.n(this.instructionElementRef)}
        class="instruction"
        color="secondary"
        variant="md-medium"
      >
        Type or
        <wui-button
          class="paste"
          size="md"
          variant="neutral-secondary"
          iconLeft="copy"
          @click=${this.onPasteClick.bind(this)}
        >
          <wui-icon size="sm" color="inherit" slot="iconLeft" name="copy"></wui-icon>
          Paste
        </wui-button>
        address
      </wui-text>
      <textarea
        spellcheck="false"
        ?disabled=${!this.instructionHidden}
        ${ref.n(this.inputElementRef)}
        @input=${this.onInputChange.bind(this)}
        @blur=${this.onBlur.bind(this)}
        .value=${this.value ?? ''}
        autocomplete="off"
      >
${this.value ?? ''}</textarea
      >
    </wui-flex>`;
    }
    async focusInput() {
        if (this.instructionElementRef.value) {
            this.instructionHidden = true;
            await this.toggleInstructionFocus(false);
            this.instructionElementRef.value.style.pointerEvents = 'none';
            this.inputElementRef.value?.focus();
            if (this.inputElementRef.value) {
                this.inputElementRef.value.selectionStart = this.inputElementRef.value.selectionEnd =
                    this.inputElementRef.value.value.length;
            }
        }
    }
    async focusInstruction() {
        if (this.instructionElementRef.value) {
            this.instructionHidden = false;
            await this.toggleInstructionFocus(true);
            this.instructionElementRef.value.style.pointerEvents = 'auto';
            this.inputElementRef.value?.blur();
        }
    }
    async toggleInstructionFocus(focus) {
        if (this.instructionElementRef.value) {
            await this.instructionElementRef.value.animate([{ opacity: focus ? 0 : 1 }, { opacity: focus ? 1 : 0 }], {
                duration: 100,
                easing: 'ease',
                fill: 'forwards'
            }).finished;
        }
    }
    onBoxClick() {
        if (!this.value && !this.instructionHidden) {
            this.focusInput();
        }
    }
    onBlur() {
        if (!this.value && this.instructionHidden && !this.pasting) {
            this.focusInstruction();
        }
    }
    checkHidden() {
        if (this.instructionHidden) {
            this.focusInput();
        }
    }
    async onPasteClick() {
        this.pasting = true;
        const text = await navigator.clipboard.readText();
        swapModule_entry.SendController.setReceiverAddress(text);
        this.focusInput();
    }
    onInputChange(e) {
        const element = e.target;
        this.pasting = false;
        this.value = e.target?.value;
        if (element.value && !this.instructionHidden) {
            this.focusInput();
        }
        swapModule_entry.SendController.setLoading(true);
        this.onDebouncedSearch(element.value);
    }
    setReceiverAddress(address) {
        swapModule_entry.SendController.setReceiverAddress(address);
        swapModule_entry.SendController.setReceiverProfileName(undefined);
        swapModule_entry.SendController.setReceiverProfileImageUrl(undefined);
        swapModule_entry.SendController.setLoading(false);
    }
};
W3mInputAddress.styles = styles$8;
__decorate$8([
    index.n()
], W3mInputAddress.prototype, "value", void 0);
__decorate$8([
    index.n({ type: Boolean })
], W3mInputAddress.prototype, "readOnly", void 0);
__decorate$8([
    index.r()
], W3mInputAddress.prototype, "instructionHidden", void 0);
__decorate$8([
    index.r()
], W3mInputAddress.prototype, "pasting", void 0);
W3mInputAddress = __decorate$8([
    index.customElement('w3m-input-address')
], W3mInputAddress);

var styles$7 = swapModule_entry.css `
  :host {
    width: 100%;
    height: 100px;
    border-radius: ${({ borderRadius }) => borderRadius['5']};
    border: 1px solid ${({ tokens }) => tokens.theme.foregroundPrimary};
    background-color: ${({ tokens }) => tokens.theme.foregroundPrimary};
    transition: background-color ${({ durations }) => durations['lg']}
      ${({ easings }) => easings['ease-out-power-1']};
    will-change: background-color;
    transition: all ${({ easings }) => easings['ease-out-power-1']}
      ${({ durations }) => durations['lg']};
  }

  :host(:hover) {
    background-color: ${({ tokens }) => tokens.theme.foregroundSecondary};
  }

  wui-flex {
    width: 100%;
    height: fit-content;
  }

  wui-button {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  wui-input-amount {
    mask-image: linear-gradient(
      270deg,
      transparent 0px,
      transparent 8px,
      black 24px,
      black 25px,
      black 32px,
      black 100%
    );
  }

  .totalValue {
    width: 100%;
  }
`;

var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
let W3mInputToken = class W3mInputToken extends swapModule_entry.i {
    constructor() {
        super(...arguments);
        this.readOnly = false;
        this.isInsufficientBalance = false;
    }
    render() {
        const isDisabled = this.readOnly || !this.token;
        return swapModule_entry.b ` <wui-flex
      flexDirection="column"
      gap="01"
      .padding=${['5', '3', '4', '3']}
    >
      <wui-flex alignItems="center">
        <wui-input-amount
          @inputChange=${this.onInputChange.bind(this)}
          ?disabled=${isDisabled}
          .value=${this.sendTokenAmount ? String(this.sendTokenAmount) : ''}
          ?error=${Boolean(this.isInsufficientBalance)}
        ></wui-input-amount>
        ${this.buttonTemplate()}
      </wui-flex>
      ${this.bottomTemplate()}
    </wui-flex>`;
    }
    buttonTemplate() {
        if (this.token) {
            return swapModule_entry.b `<wui-token-button
        text=${this.token.symbol}
        imageSrc=${this.token.iconUrl}
        @click=${this.handleSelectButtonClick.bind(this)}
      >
      </wui-token-button>`;
        }
        return swapModule_entry.b `<wui-button
      size="md"
      variant="neutral-secondary"
      @click=${this.handleSelectButtonClick.bind(this)}
      >Select token</wui-button
    >`;
    }
    handleSelectButtonClick() {
        if (!this.readOnly) {
            swapModule_entry.RouterController.push('WalletSendSelectToken');
        }
    }
    sendValueTemplate() {
        if (!this.readOnly && this.token && this.sendTokenAmount) {
            const price = this.token.price;
            const totalValue = price * this.sendTokenAmount;
            return swapModule_entry.b `<wui-text class="totalValue" variant="sm-regular" color="secondary"
        >${totalValue
                ? `$${swapModule_entry.NumberUtil.formatNumberToLocalString(totalValue, 2)}`
                : 'Incorrect value'}</wui-text
      >`;
        }
        return null;
    }
    maxAmountTemplate() {
        if (this.token) {
            return swapModule_entry.b ` <wui-text variant="sm-regular" color="secondary">
        ${index.UiHelperUtil.roundNumber(Number(this.token.quantity.numeric), 6, 5)}
      </wui-text>`;
        }
        return null;
    }
    actionTemplate() {
        if (this.token) {
            return swapModule_entry.b `<wui-link @click=${this.onMaxClick.bind(this)}>Max</wui-link>`;
        }
        return null;
    }
    bottomTemplate() {
        if (this.readOnly) {
            return null;
        }
        return swapModule_entry.b `<wui-flex alignItems="center" justifyContent="space-between">
      ${this.sendValueTemplate()}
      <wui-flex alignItems="center" gap="01" justifyContent="flex-end">
        ${this.maxAmountTemplate()} ${this.actionTemplate()}
      </wui-flex>
    </wui-flex>`;
    }
    onInputChange(event) {
        swapModule_entry.SendController.setTokenAmount(event.detail);
    }
    onMaxClick() {
        if (this.token) {
            const maxValue = swapModule_entry.NumberUtil.bigNumber(this.token.quantity.numeric);
            swapModule_entry.SendController.setTokenAmount(Number(maxValue.toFixed(20)));
        }
    }
};
W3mInputToken.styles = styles$7;
__decorate$7([
    index.n({ type: Object })
], W3mInputToken.prototype, "token", void 0);
__decorate$7([
    index.n({ type: Boolean })
], W3mInputToken.prototype, "readOnly", void 0);
__decorate$7([
    index.n({ type: Number })
], W3mInputToken.prototype, "sendTokenAmount", void 0);
__decorate$7([
    index.n({ type: Boolean })
], W3mInputToken.prototype, "isInsufficientBalance", void 0);
W3mInputToken = __decorate$7([
    index.customElement('w3m-input-token')
], W3mInputToken);

var styles$6 = swapModule_entry.css `
  :host {
    display: block;
  }

  wui-flex {
    position: relative;
  }

  wui-icon-box {
    width: 32px;
    height: 32px;
    border-radius: ${({ borderRadius }) => borderRadius['10']} !important;
    border: 4px solid ${({ tokens }) => tokens.theme.backgroundPrimary};
    background: ${({ tokens }) => tokens.theme.foregroundPrimary};
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
  }

  wui-button {
    --local-border-radius: ${({ borderRadius }) => borderRadius['4']} !important;
  }

  .inputContainer {
    height: fit-content;
  }
`;

var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
const SEND_BUTTON_MESSAGE = {
    INSUFFICIENT_FUNDS: 'Insufficient Funds',
    INCORRECT_VALUE: 'Incorrect Value',
    INVALID_ADDRESS: 'Invalid Address',
    ADD_ADDRESS: 'Add Address',
    ADD_AMOUNT: 'Add Amount',
    SELECT_TOKEN: 'Select Token',
    PREVIEW_SEND: 'Preview Send'
};
exports.W3mWalletSendView = class W3mWalletSendView extends swapModule_entry.i {
    constructor() {
        super();
        this.unsubscribe = [];
        this.isTryingToChooseDifferentWallet = false;
        this.token = swapModule_entry.SendController.state.token;
        this.sendTokenAmount = swapModule_entry.SendController.state.sendTokenAmount;
        this.receiverAddress = swapModule_entry.SendController.state.receiverAddress;
        this.receiverProfileName = swapModule_entry.SendController.state.receiverProfileName;
        this.loading = swapModule_entry.SendController.state.loading;
        this.params = swapModule_entry.RouterController.state.data?.send;
        this.caipAddress = swapModule_entry.ChainController.getAccountData()?.caipAddress;
        this.message = SEND_BUTTON_MESSAGE.PREVIEW_SEND;
        this.disconnecting = false;
        if (this.token && !this.params) {
            this.fetchBalances();
            this.fetchNetworkPrice();
        }
        const unsubscribe = swapModule_entry.ChainController.subscribeKey('activeCaipAddress', val => {
            if (!val && this.isTryingToChooseDifferentWallet) {
                this.isTryingToChooseDifferentWallet = false;
                swapModule_entry.ModalController.open({
                    view: 'Connect',
                    data: {
                        redirectView: 'WalletSend'
                    }
                }).catch(() => null);
                unsubscribe();
            }
        });
        this.unsubscribe.push(...[
            swapModule_entry.ChainController.subscribeAccountStateProp('caipAddress', val => {
                this.caipAddress = val;
            }),
            swapModule_entry.SendController.subscribe(val => {
                this.token = val.token;
                this.sendTokenAmount = val.sendTokenAmount;
                this.receiverAddress = val.receiverAddress;
                this.receiverProfileName = val.receiverProfileName;
                this.loading = val.loading;
            })
        ]);
    }
    disconnectedCallback() {
        this.unsubscribe.forEach(unsubscribe => unsubscribe());
    }
    async firstUpdated() {
        await this.handleSendParameters();
    }
    render() {
        this.getMessage();
        const isReadOnly = Boolean(this.params);
        return swapModule_entry.b ` <wui-flex flexDirection="column" .padding=${['0', '4', '4', '4']}>
      <wui-flex class="inputContainer" gap="2" flexDirection="column">
        <w3m-input-token
          .token=${this.token}
          .sendTokenAmount=${this.sendTokenAmount}
          ?readOnly=${isReadOnly}
          ?isInsufficientBalance=${this.message === SEND_BUTTON_MESSAGE.INSUFFICIENT_FUNDS}
        ></w3m-input-token>
        <wui-icon-box size="md" variant="secondary" icon="arrowBottom"></wui-icon-box>
        <w3m-input-address
          ?readOnly=${isReadOnly}
          .value=${this.receiverProfileName ? this.receiverProfileName : this.receiverAddress}
        ></w3m-input-address>
      </wui-flex>
      ${this.buttonTemplate()}
    </wui-flex>`;
    }
    async fetchBalances() {
        await swapModule_entry.SendController.fetchTokenBalance();
        swapModule_entry.SendController.fetchNetworkBalance();
    }
    async fetchNetworkPrice() {
        await SwapController.SwapController.getNetworkTokenPrice();
    }
    onButtonClick() {
        swapModule_entry.RouterController.push('WalletSendPreview', {
            send: this.params
        });
    }
    onFundWalletClick() {
        swapModule_entry.RouterController.push('FundWallet', {
            redirectView: 'WalletSend'
        });
    }
    async onConnectDifferentWalletClick() {
        try {
            this.isTryingToChooseDifferentWallet = true;
            this.disconnecting = true;
            await swapModule_entry.ConnectionController.disconnect();
        }
        finally {
            this.disconnecting = false;
        }
    }
    getMessage() {
        this.message = SEND_BUTTON_MESSAGE.PREVIEW_SEND;
        if (this.receiverAddress &&
            !swapModule_entry.CoreHelperUtil.isAddress(this.receiverAddress, swapModule_entry.ChainController.state.activeChain)) {
            this.message = SEND_BUTTON_MESSAGE.INVALID_ADDRESS;
        }
        if (!this.receiverAddress) {
            this.message = SEND_BUTTON_MESSAGE.ADD_ADDRESS;
        }
        if (this.sendTokenAmount &&
            this.token &&
            this.sendTokenAmount > Number(this.token.quantity.numeric)) {
            this.message = SEND_BUTTON_MESSAGE.INSUFFICIENT_FUNDS;
        }
        if (!this.sendTokenAmount) {
            this.message = SEND_BUTTON_MESSAGE.ADD_AMOUNT;
        }
        if (this.sendTokenAmount && this.token?.price) {
            const value = this.sendTokenAmount * this.token.price;
            if (!value) {
                this.message = SEND_BUTTON_MESSAGE.INCORRECT_VALUE;
            }
        }
        if (!this.token) {
            this.message = SEND_BUTTON_MESSAGE.SELECT_TOKEN;
        }
    }
    buttonTemplate() {
        const isDisabled = !this.message.startsWith(SEND_BUTTON_MESSAGE.PREVIEW_SEND);
        const isInsufficientBalance = this.message === SEND_BUTTON_MESSAGE.INSUFFICIENT_FUNDS;
        const isReadOnly = Boolean(this.params);
        if (isInsufficientBalance && !isReadOnly) {
            return swapModule_entry.b `
        <wui-flex .margin=${['4', '0', '0', '0']} flexDirection="column" gap="4">
          <wui-button
            @click=${this.onFundWalletClick.bind(this)}
            size="lg"
            variant="accent-secondary"
            fullWidth
          >
            Fund Wallet
          </wui-button>

          <wui-separator data-testid="wui-separator" text="or"></wui-separator>

          <wui-button
            @click=${this.onConnectDifferentWalletClick.bind(this)}
            size="lg"
            variant="neutral-secondary"
            fullWidth
            ?loading=${this.disconnecting}
          >
            Connect a different wallet
          </wui-button>
        </wui-flex>
      `;
        }
        return swapModule_entry.b `<wui-flex .margin=${['4', '0', '0', '0']}>
      <wui-button
        @click=${this.onButtonClick.bind(this)}
        ?disabled=${isDisabled}
        size="lg"
        variant="accent-primary"
        ?loading=${this.loading}
        fullWidth
      >
        ${this.message}
      </wui-button>
    </wui-flex>`;
    }
    async handleSendParameters() {
        this.loading = true;
        if (!this.params) {
            this.loading = false;
            return;
        }
        const amount = Number(this.params.amount);
        if (isNaN(amount)) {
            swapModule_entry.SnackController.showError('Invalid amount');
            this.loading = false;
            return;
        }
        const { namespace, chainId, assetAddress } = this.params;
        if (!swapModule_entry.ConstantsUtil.SEND_PARAMS_SUPPORTED_CHAINS.includes(namespace)) {
            swapModule_entry.SnackController.showError(`Chain "${namespace}" is not supported for send parameters`);
            this.loading = false;
            return;
        }
        const caipNetwork = swapModule_entry.ChainController.getCaipNetworkById(chainId, namespace);
        if (!caipNetwork) {
            swapModule_entry.SnackController.showError(`Network with id "${chainId}" not found`);
            this.loading = false;
            return;
        }
        try {
            const { balance, name, symbol, decimals } = await swapModule_entry.BalanceUtil.fetchERC20Balance({
                caipAddress: this.caipAddress,
                assetAddress,
                caipNetwork
            });
            if (!name || !symbol || !decimals || !balance) {
                swapModule_entry.SnackController.showError('Token not found');
                return;
            }
            swapModule_entry.SendController.setToken({
                name,
                symbol,
                chainId: caipNetwork.id.toString(),
                address: `${caipNetwork.chainNamespace}:${caipNetwork.id}:${assetAddress}`,
                value: 0,
                price: 0,
                quantity: {
                    decimals: decimals.toString(),
                    numeric: balance.toString()
                },
                iconUrl: swapModule_entry.AssetUtil.getTokenImage(symbol) ?? ''
            });
            swapModule_entry.SendController.setTokenAmount(amount);
            swapModule_entry.SendController.setReceiverAddress(this.params.to);
        }
        catch (err) {
            console.error('Failed to load token information:', err);
            swapModule_entry.SnackController.showError('Failed to load token information');
        }
        finally {
            this.loading = false;
        }
    }
};
exports.W3mWalletSendView.styles = styles$6;
__decorate$6([
    index.r()
], exports.W3mWalletSendView.prototype, "token", void 0);
__decorate$6([
    index.r()
], exports.W3mWalletSendView.prototype, "sendTokenAmount", void 0);
__decorate$6([
    index.r()
], exports.W3mWalletSendView.prototype, "receiverAddress", void 0);
__decorate$6([
    index.r()
], exports.W3mWalletSendView.prototype, "receiverProfileName", void 0);
__decorate$6([
    index.r()
], exports.W3mWalletSendView.prototype, "loading", void 0);
__decorate$6([
    index.r()
], exports.W3mWalletSendView.prototype, "params", void 0);
__decorate$6([
    index.r()
], exports.W3mWalletSendView.prototype, "caipAddress", void 0);
__decorate$6([
    index.r()
], exports.W3mWalletSendView.prototype, "message", void 0);
__decorate$6([
    index.r()
], exports.W3mWalletSendView.prototype, "disconnecting", void 0);
exports.W3mWalletSendView = __decorate$6([
    index.customElement('w3m-wallet-send-view')
], exports.W3mWalletSendView);

var styles$5 = swapModule_entry.css `
  .contentContainer {
    height: 440px;
    overflow: scroll;
    scrollbar-width: none;
  }

  .contentContainer::-webkit-scrollbar {
    display: none;
  }

  wui-icon-box {
    width: 40px;
    height: 40px;
    border-radius: ${({ borderRadius }) => borderRadius['3']};
  }
`;

var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
exports.W3mSendSelectTokenView = class W3mSendSelectTokenView extends swapModule_entry.i {
    constructor() {
        super();
        this.unsubscribe = [];
        this.tokenBalances = swapModule_entry.SendController.state.tokenBalances;
        this.search = '';
        this.onDebouncedSearch = swapModule_entry.CoreHelperUtil.debounce((value) => {
            this.search = value;
        });
        this.fetchBalancesAndNetworkPrice();
        this.unsubscribe.push(...[
            swapModule_entry.SendController.subscribe(val => {
                this.tokenBalances = val.tokenBalances;
            })
        ]);
    }
    disconnectedCallback() {
        this.unsubscribe.forEach(unsubscribe => unsubscribe());
    }
    render() {
        return swapModule_entry.b `
      <wui-flex flexDirection="column">
        ${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()}
      </wui-flex>
    `;
    }
    async fetchBalancesAndNetworkPrice() {
        if (!this.tokenBalances || this.tokenBalances?.length === 0) {
            await this.fetchBalances();
            await this.fetchNetworkPrice();
        }
    }
    async fetchBalances() {
        await swapModule_entry.SendController.fetchTokenBalance();
        swapModule_entry.SendController.fetchNetworkBalance();
    }
    async fetchNetworkPrice() {
        await SwapController.SwapController.getNetworkTokenPrice();
    }
    templateSearchInput() {
        return swapModule_entry.b `
      <wui-flex gap="2" padding="3">
        <wui-input-text
          @inputChange=${this.onInputChange.bind(this)}
          class="network-search-input"
          size="sm"
          placeholder="Search token"
          icon="search"
        ></wui-input-text>
      </wui-flex>
    `;
    }
    templateTokens() {
        this.tokens = this.tokenBalances?.filter(token => token.chainId === swapModule_entry.ChainController.state.activeCaipNetwork?.caipNetworkId);
        if (this.search) {
            this.filteredTokens = this.tokenBalances?.filter(token => token.name.toLowerCase().includes(this.search.toLowerCase()));
        }
        else {
            this.filteredTokens = this.tokens;
        }
        return swapModule_entry.b `
      <wui-flex
        class="contentContainer"
        flexDirection="column"
        .padding=${['0', '3', '0', '3']}
      >
        <wui-flex justifyContent="flex-start" .padding=${['4', '3', '3', '3']}>
          <wui-text variant="md-medium" color="secondary">Your tokens</wui-text>
        </wui-flex>
        <wui-flex flexDirection="column" gap="2">
          ${this.filteredTokens && this.filteredTokens.length > 0
            ? this.filteredTokens.map(token => swapModule_entry.b `<wui-list-token
                    @click=${this.handleTokenClick.bind(this, token)}
                    ?clickable=${true}
                    tokenName=${token.name}
                    tokenImageUrl=${token.iconUrl}
                    tokenAmount=${token.quantity.numeric}
                    tokenValue=${token.value}
                    tokenCurrency=${token.symbol}
                  ></wui-list-token>`)
            : swapModule_entry.b `<wui-flex
                .padding=${['20', '0', '0', '0']}
                alignItems="center"
                flexDirection="column"
                gap="4"
              >
                <wui-icon-box icon="coinPlaceholder" color="default" size="lg"></wui-icon-box>
                <wui-flex
                  class="textContent"
                  gap="2"
                  flexDirection="column"
                  justifyContent="center"
                  flexDirection="column"
                >
                  <wui-text variant="lg-medium" align="center" color="primary">
                    No tokens found
                  </wui-text>
                  <wui-text variant="lg-regular" align="center" color="secondary">
                    Your tokens will appear here
                  </wui-text>
                </wui-flex>
                <wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>
              </wui-flex>`}
        </wui-flex>
      </wui-flex>
    `;
    }
    onBuyClick() {
        swapModule_entry.RouterController.push('OnRampProviders');
    }
    onInputChange(event) {
        this.onDebouncedSearch(event.detail);
    }
    handleTokenClick(token) {
        swapModule_entry.SendController.setToken(token);
        swapModule_entry.SendController.setTokenAmount(undefined);
        swapModule_entry.RouterController.goBack();
    }
};
exports.W3mSendSelectTokenView.styles = styles$5;
__decorate$5([
    index.r()
], exports.W3mSendSelectTokenView.prototype, "tokenBalances", void 0);
__decorate$5([
    index.r()
], exports.W3mSendSelectTokenView.prototype, "tokens", void 0);
__decorate$5([
    index.r()
], exports.W3mSendSelectTokenView.prototype, "filteredTokens", void 0);
__decorate$5([
    index.r()
], exports.W3mSendSelectTokenView.prototype, "search", void 0);
exports.W3mSendSelectTokenView = __decorate$5([
    index.customElement('w3m-wallet-send-select-token-view')
], exports.W3mSendSelectTokenView);

var styles$4 = swapModule_entry.css `
  :host {
    height: 32px;
    display: flex;
    align-items: center;
    gap: ${({ spacing }) => spacing[1]};
    border-radius: ${({ borderRadius }) => borderRadius[32]};
    background-color: ${({ tokens }) => tokens.theme.foregroundPrimary};
    padding: ${({ spacing }) => spacing[1]};
    padding-left: ${({ spacing }) => spacing[2]};
  }

  wui-avatar,
  wui-image {
    width: 24px;
    height: 24px;
    border-radius: ${({ borderRadius }) => borderRadius[16]};
  }

  wui-icon {
    border-radius: ${({ borderRadius }) => borderRadius[16]};
  }
`;

var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
let WuiPreviewItem = class WuiPreviewItem extends swapModule_entry.i {
    constructor() {
        super(...arguments);
        this.text = '';
    }
    render() {
        return swapModule_entry.b `<wui-text variant="lg-regular" color="primary">${this.text}</wui-text>
      ${this.imageTemplate()}`;
    }
    imageTemplate() {
        if (this.address) {
            return swapModule_entry.b `<wui-avatar address=${this.address} .imageSrc=${this.imageSrc}></wui-avatar>`;
        }
        else if (this.imageSrc) {
            return swapModule_entry.b `<wui-image src=${this.imageSrc}></wui-image>`;
        }
        return swapModule_entry.b `<wui-icon size="lg" color="inverse" name="networkPlaceholder"></wui-icon>`;
    }
};
WuiPreviewItem.styles = [swapModule_entry.resetStyles, swapModule_entry.elementStyles, styles$4];
__decorate$4([
    index.n({ type: String })
], WuiPreviewItem.prototype, "text", void 0);
__decorate$4([
    index.n({ type: String })
], WuiPreviewItem.prototype, "address", void 0);
__decorate$4([
    index.n({ type: String })
], WuiPreviewItem.prototype, "imageSrc", void 0);
WuiPreviewItem = __decorate$4([
    index.customElement('wui-preview-item')
], WuiPreviewItem);

var styles$3 = swapModule_entry.css `
  :host {
    display: flex;
    padding: ${({ spacing }) => spacing[4]} ${({ spacing }) => spacing[3]};
    width: 100%;
    background-color: ${({ tokens }) => tokens.theme.foregroundPrimary};
    border-radius: ${({ borderRadius }) => borderRadius[4]};
  }

  wui-image {
    width: 20px;
    height: 20px;
    border-radius: ${({ borderRadius }) => borderRadius[16]};
  }

  wui-icon {
    width: 20px;
    height: 20px;
  }
`;

var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
let WuiListContent = class WuiListContent extends swapModule_entry.i {
    constructor() {
        super(...arguments);
        this.imageSrc = undefined;
        this.textTitle = '';
        this.textValue = undefined;
    }
    render() {
        return swapModule_entry.b `
      <wui-flex justifyContent="space-between" alignItems="center">
        <wui-text variant="lg-regular" color="primary"> ${this.textTitle} </wui-text>
        ${this.templateContent()}
      </wui-flex>
    `;
    }
    templateContent() {
        if (this.imageSrc) {
            return swapModule_entry.b `<wui-image src=${this.imageSrc} alt=${this.textTitle}></wui-image>`;
        }
        else if (this.textValue) {
            return swapModule_entry.b ` <wui-text variant="md-regular" color="secondary"> ${this.textValue} </wui-text>`;
        }
        return swapModule_entry.b `<wui-icon size="inherit" color="default" name="networkPlaceholder"></wui-icon>`;
    }
};
WuiListContent.styles = [swapModule_entry.resetStyles, swapModule_entry.elementStyles, styles$3];
__decorate$3([
    index.n()
], WuiListContent.prototype, "imageSrc", void 0);
__decorate$3([
    index.n()
], WuiListContent.prototype, "textTitle", void 0);
__decorate$3([
    index.n()
], WuiListContent.prototype, "textValue", void 0);
WuiListContent = __decorate$3([
    index.customElement('wui-list-content')
], WuiListContent);

var styles$2 = swapModule_entry.css `
  :host {
    display: flex;
    width: auto;
    flex-direction: column;
    gap: ${({ spacing }) => spacing['1']};
    border-radius: ${({ borderRadius }) => borderRadius['5']};
    background: ${({ tokens }) => tokens.theme.foregroundPrimary};
    padding: ${({ spacing }) => spacing['3']} ${({ spacing }) => spacing['2']}
      ${({ spacing }) => spacing['2']} ${({ spacing }) => spacing['2']};
  }

  wui-list-content {
    width: -webkit-fill-available !important;
  }

  wui-text {
    padding: 0 ${({ spacing }) => spacing['2']};
  }

  wui-flex {
    margin-top: ${({ spacing }) => spacing['2']};
  }

  .network {
    cursor: pointer;
    transition: background-color ${({ durations }) => durations['lg']}
      ${({ easings }) => easings['ease-out-power-1']};
    will-change: background-color;
  }

  .network:focus-visible {
    border: 1px solid ${({ tokens }) => tokens.core.textAccentPrimary};
    background-color: ${({ tokens }) => tokens.core.glass010};
    -webkit-box-shadow: 0px 0px 0px 4px ${({ tokens }) => tokens.core.foregroundAccent010};
    -moz-box-shadow: 0px 0px 0px 4px ${({ tokens }) => tokens.core.foregroundAccent010};
    box-shadow: 0px 0px 0px 4px ${({ tokens }) => tokens.core.foregroundAccent010};
  }

  .network:hover {
    background-color: ${({ tokens }) => tokens.core.glass010};
  }

  .network:active {
    background-color: ${({ tokens }) => tokens.core.glass010};
  }
`;

var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
let W3mWalletSendDetails = class W3mWalletSendDetails extends swapModule_entry.i {
    constructor() {
        super(...arguments);
        this.params = swapModule_entry.RouterController.state.data?.send;
    }
    render() {
        return swapModule_entry.b ` <wui-text variant="sm-regular" color="secondary">Details</wui-text>
      <wui-flex flexDirection="column" gap="1">
        <wui-list-content
          textTitle="Address"
          textValue=${index.UiHelperUtil.getTruncateString({
            string: this.receiverAddress ?? '',
            charsStart: 4,
            charsEnd: 4,
            truncate: 'middle'
        })}
        >
        </wui-list-content>
        ${this.networkTemplate()}
      </wui-flex>`;
    }
    networkTemplate() {
        if (this.caipNetwork?.name) {
            return swapModule_entry.b ` <wui-list-content
        @click=${() => this.onNetworkClick(this.caipNetwork)}
        class="network"
        textTitle="Network"
        imageSrc=${ifDefined.o(swapModule_entry.AssetUtil.getNetworkImage(this.caipNetwork))}
      ></wui-list-content>`;
        }
        return null;
    }
    onNetworkClick(network) {
        if (network && !this.params) {
            swapModule_entry.RouterController.push('Networks', { network });
        }
    }
};
W3mWalletSendDetails.styles = styles$2;
__decorate$2([
    index.n()
], W3mWalletSendDetails.prototype, "receiverAddress", void 0);
__decorate$2([
    index.n({ type: Object })
], W3mWalletSendDetails.prototype, "caipNetwork", void 0);
__decorate$2([
    index.r()
], W3mWalletSendDetails.prototype, "params", void 0);
W3mWalletSendDetails = __decorate$2([
    index.customElement('w3m-wallet-send-details')
], W3mWalletSendDetails);

var styles$1 = swapModule_entry.css `
  wui-avatar,
  wui-image {
    display: ruby;
    width: 32px;
    height: 32px;
    border-radius: ${({ borderRadius }) => borderRadius['20']};
  }

  .sendButton {
    width: 70%;
    --local-width: 100% !important;
    --local-border-radius: ${({ borderRadius }) => borderRadius['4']} !important;
  }

  .cancelButton {
    width: 30%;
    --local-width: 100% !important;
    --local-border-radius: ${({ borderRadius }) => borderRadius['4']} !important;
  }
`;

var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
exports.W3mWalletSendPreviewView = class W3mWalletSendPreviewView extends swapModule_entry.i {
    constructor() {
        super();
        this.unsubscribe = [];
        this.token = swapModule_entry.SendController.state.token;
        this.sendTokenAmount = swapModule_entry.SendController.state.sendTokenAmount;
        this.receiverAddress = swapModule_entry.SendController.state.receiverAddress;
        this.receiverProfileName = swapModule_entry.SendController.state.receiverProfileName;
        this.receiverProfileImageUrl = swapModule_entry.SendController.state.receiverProfileImageUrl;
        this.caipNetwork = swapModule_entry.ChainController.state.activeCaipNetwork;
        this.loading = swapModule_entry.SendController.state.loading;
        this.params = swapModule_entry.RouterController.state.data?.send;
        this.unsubscribe.push(...[
            swapModule_entry.SendController.subscribe(val => {
                this.token = val.token;
                this.sendTokenAmount = val.sendTokenAmount;
                this.receiverAddress = val.receiverAddress;
                this.receiverProfileName = val.receiverProfileName;
                this.receiverProfileImageUrl = val.receiverProfileImageUrl;
                this.loading = val.loading;
            }),
            swapModule_entry.ChainController.subscribeKey('activeCaipNetwork', val => (this.caipNetwork = val))
        ]);
    }
    disconnectedCallback() {
        this.unsubscribe.forEach(unsubscribe => unsubscribe());
    }
    render() {
        return swapModule_entry.b ` <wui-flex flexDirection="column" .padding=${['0', '4', '4', '4']}>
      <wui-flex gap="2" flexDirection="column" .padding=${['0', '2', '0', '2']}>
        <wui-flex alignItems="center" justifyContent="space-between">
          <wui-flex flexDirection="column" gap="01">
            <wui-text variant="sm-regular" color="secondary">Send</wui-text>
            ${this.sendValueTemplate()}
          </wui-flex>
          <wui-preview-item
            text="${this.sendTokenAmount
            ? index.UiHelperUtil.roundNumber(this.sendTokenAmount, 6, 5)
            : 'unknown'} ${this.token?.symbol}"
            .imageSrc=${this.token?.iconUrl}
          ></wui-preview-item>
        </wui-flex>
        <wui-flex>
          <wui-icon color="default" size="md" name="arrowBottom"></wui-icon>
        </wui-flex>
        <wui-flex alignItems="center" justifyContent="space-between">
          <wui-text variant="sm-regular" color="secondary">To</wui-text>
          <wui-preview-item
            text="${this.receiverProfileName
            ? index.UiHelperUtil.getTruncateString({
                string: this.receiverProfileName,
                charsStart: 20,
                charsEnd: 0,
                truncate: 'end'
            })
            : index.UiHelperUtil.getTruncateString({
                string: this.receiverAddress ? this.receiverAddress : '',
                charsStart: 4,
                charsEnd: 4,
                truncate: 'middle'
            })}"
            address=${this.receiverAddress ?? ''}
            .imageSrc=${this.receiverProfileImageUrl ?? undefined}
            .isAddress=${true}
          ></wui-preview-item>
        </wui-flex>
      </wui-flex>
      <wui-flex flexDirection="column" .padding=${['6', '0', '0', '0']}>
        <w3m-wallet-send-details
          .caipNetwork=${this.caipNetwork}
          .receiverAddress=${this.receiverAddress}
        ></w3m-wallet-send-details>
        <wui-flex justifyContent="center" gap="1" .padding=${['3', '0', '0', '0']}>
          <wui-icon size="sm" color="default" name="warningCircle"></wui-icon>
          <wui-text variant="sm-regular" color="secondary">Review transaction carefully</wui-text>
        </wui-flex>
        <wui-flex justifyContent="center" gap="3" .padding=${['4', '0', '0', '0']}>
          <wui-button
            class="cancelButton"
            @click=${this.onCancelClick.bind(this)}
            size="lg"
            variant="neutral-secondary"
          >
            Cancel
          </wui-button>
          <wui-button
            class="sendButton"
            @click=${this.onSendClick.bind(this)}
            size="lg"
            variant="accent-primary"
            .loading=${this.loading}
          >
            Send
          </wui-button>
        </wui-flex>
      </wui-flex></wui-flex
    >`;
    }
    sendValueTemplate() {
        if (!this.params && this.token && this.sendTokenAmount) {
            const price = this.token.price;
            const totalValue = price * this.sendTokenAmount;
            return swapModule_entry.b `<wui-text variant="md-regular" color="primary"
        >$${totalValue.toFixed(2)}</wui-text
      >`;
        }
        return null;
    }
    async onSendClick() {
        if (!this.sendTokenAmount || !this.receiverAddress) {
            swapModule_entry.SnackController.showError('Please enter a valid amount and receiver address');
            return;
        }
        try {
            await swapModule_entry.SendController.sendToken();
            if (this.params) {
                swapModule_entry.RouterController.reset('WalletSendConfirmed');
            }
            else {
                swapModule_entry.SnackController.showSuccess('Transaction started');
                swapModule_entry.RouterController.replace('Account');
            }
        }
        catch (error) {
            let errMessage = 'Failed to send transaction. Please try again.';
            const isUserRejectedRequestError = error instanceof swapModule_entry.AppKitError &&
                error.originalName === swapModule_entry.ErrorUtil$1.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST;
            if (swapModule_entry.ChainController.state.activeChain === swapModule_entry.ConstantsUtil$1.CHAIN.SOLANA ||
                isUserRejectedRequestError) {
                if (error instanceof Error) {
                    errMessage = error.message;
                }
            }
            swapModule_entry.EventsController.sendEvent({
                type: 'track',
                event: isUserRejectedRequestError ? 'SEND_REJECTED' : 'SEND_ERROR',
                properties: swapModule_entry.SendController.getSdkEventProperties(error)
            });
            swapModule_entry.SnackController.showError(errMessage);
        }
    }
    onCancelClick() {
        swapModule_entry.RouterController.goBack();
    }
};
exports.W3mWalletSendPreviewView.styles = styles$1;
__decorate$1([
    index.r()
], exports.W3mWalletSendPreviewView.prototype, "token", void 0);
__decorate$1([
    index.r()
], exports.W3mWalletSendPreviewView.prototype, "sendTokenAmount", void 0);
__decorate$1([
    index.r()
], exports.W3mWalletSendPreviewView.prototype, "receiverAddress", void 0);
__decorate$1([
    index.r()
], exports.W3mWalletSendPreviewView.prototype, "receiverProfileName", void 0);
__decorate$1([
    index.r()
], exports.W3mWalletSendPreviewView.prototype, "receiverProfileImageUrl", void 0);
__decorate$1([
    index.r()
], exports.W3mWalletSendPreviewView.prototype, "caipNetwork", void 0);
__decorate$1([
    index.r()
], exports.W3mWalletSendPreviewView.prototype, "loading", void 0);
__decorate$1([
    index.r()
], exports.W3mWalletSendPreviewView.prototype, "params", void 0);
exports.W3mWalletSendPreviewView = __decorate$1([
    index.customElement('w3m-wallet-send-preview-view')
], exports.W3mWalletSendPreviewView);

var styles = swapModule_entry.css `
  .icon-box {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background-color: ${({ spacing }) => spacing[16]};
    border: 8px solid ${({ tokens }) => tokens.theme.borderPrimary};
    border-radius: ${({ borderRadius }) => borderRadius.round};
  }
`;

var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
exports.W3mSendConfirmedView = class W3mSendConfirmedView extends swapModule_entry.i {
    constructor() {
        super();
        this.unsubscribe = [];
        this.unsubscribe.push(...[]);
    }
    render() {
        return swapModule_entry.b `
      <wui-flex
        flexDirection="column"
        alignItems="center"
        gap="4"
        .padding="${['1', '3', '4', '3']}"
      >
        <wui-flex justifyContent="center" alignItems="center" class="icon-box">
          <wui-icon size="xxl" color="success" name="checkmark"></wui-icon>
        </wui-flex>

        <wui-text variant="h6-medium" color="primary">You successfully sent asset</wui-text>

        <wui-button
          fullWidth
          @click=${this.onCloseClick.bind(this)}
          size="lg"
          variant="neutral-secondary"
        >
          Close
        </wui-button>
      </wui-flex>
    `;
    }
    onCloseClick() {
        swapModule_entry.ModalController.close();
    }
};
exports.W3mSendConfirmedView.styles = styles;
exports.W3mSendConfirmedView = __decorate([
    index.customElement('w3m-send-confirmed-view')
], exports.W3mSendConfirmedView);
//# sourceMappingURL=send-C2UlsiuZ.js.map

//# sourceMappingURL=send-C2UlsiuZ.js.map