import { p as proxyCustomElement, H, h } from './p-C6Ye8jK5.js';
import { P as ProviderTypeEnum } from './p-BZSByugD.js';
import { d as defineCustomElement$2 } from './p-Bu_IiCIv.js';
import { d as defineCustomElement$1 } from './p-2CFIVj0B.js';

const getIsExtensionAvailable = () => {
    const safeWindow = typeof window !== 'undefined' ? window : {};
    // Check if either elrondWallet or multiversxWallet exists and has an extensionId
    return Boolean(safeWindow === null || safeWindow === void 0 ? void 0 : safeWindow.elrondWallet) || Boolean(safeWindow === null || safeWindow === void 0 ? void 0 : safeWindow.multiversxWallet);
};

// Helper to check if MetaMask is available
const getIsMetaMaskAvailable = () => {
    const safeWindow = typeof window !== 'undefined' ? window : {};
    // Check if MetaMask is available through the ethereum object and that isMetaMask is true
    return Boolean((safeWindow === null || safeWindow === void 0 ? void 0 : safeWindow.ethereum) && safeWindow.ethereum.isMetaMask);
};

const unlockButtonCss = "/*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */@layer theme{:host,:root{--mvx-font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--mvx-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--mvx-default-font-family:var(--mvx-font-sans);--mvx-default-mono-font-family:var(--mvx-font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{appearance:button;background-color:#0000;border:0 solid;border-radius:0;box-sizing:border-box;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;margin:0;margin-inline-end:4px;opacity:1;padding:0}:host,html{-webkit-text-size-adjust:100%;font-family:var(--mvx-default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-feature-settings:var(--mvx-default-font-feature-settings,normal);font-variation-settings:var(--mvx-default-font-variation-settings,normal);line-height:1.5;tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--mvx-default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-feature-settings:var(--mvx-default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--mvx-default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}button,input,optgroup,select,textarea{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentColor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex;padding-block:0}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components,utilities; /*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */@layer base{}@layer components,utilities; /*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */@layer base{}@layer components,utilities; /*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */@layer base{}@layer components,utilities; /*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */@layer base{}@layer components,utilities; /*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */@layer base{}@layer components,utilities; /*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */@layer base{}@layer components,utilities; /*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */@layer base{}@layer components,utilities; /*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */@layer base{}@layer components,utilities; /*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */@layer base{}@layer components,utilities;.unlock-button{align-items:center;background:#3535354d;cursor:pointer;display:flex;gap:16px;height:60px;padding:0 16px 0 12px;transition:all .2s}.unlock-button:hover{background:#353535}.unlock-button:first-child{border-top-left-radius:12px;border-top-right-radius:12px}.unlock-button:last-child{border-bottom-left-radius:12px;border-bottom-right-radius:12px}.unlock-button .unlock-button-icon{align-items:flex-end;display:flex;height:40px;justify-content:flex-start;width:40px}.unlock-button .unlock-button-label{color:#e8e8e8;font-size:16px;line-height:1}.unlock-button .unlock-button-status{font-size:12px;font-weight:500;line-height:1;margin-left:auto}.unlock-button .unlock-button-status .unlock-button-status-open{color:#23f7dd;padding:0 8px}.unlock-button .unlock-button-status .unlock-button-status-install{align-items:center;background:#0b0b0bcc;border:1px solid #40404066;border-radius:20px;display:flex;gap:4px;padding:4px 8px}.unlock-button .unlock-button-status .unlock-button-status-install .unlock-button-status-install-label{color:#23f7dd}.unlock-button .unlock-button-status .unlock-button-status-install .unlock-button-status-install-icon{align-items:center;display:flex}.unlock-button .unlock-button-status .unlock-button-status-install .unlock-button-status-install-icon svg path{fill:#23f7dd}";

const UnlockButton = /*@__PURE__*/ proxyCustomElement(class UnlockButton extends H {
    constructor() {
        super();
        this.__registerHost();
        this.__attachShadow();
    }
    render() {
        const isExtensionProvider = this.type === ProviderTypeEnum.extension;
        const isMetaMaskProvider = this.type === ProviderTypeEnum.metamask;
        const isDetectableProvider = isExtensionProvider || isMetaMaskProvider;
        const isExtensionInstalled = isExtensionProvider && getIsExtensionAvailable();
        const isMetaMaskInstalled = isMetaMaskProvider && getIsMetaMaskAvailable();
        const shouldShowOpenLabel = isDetectableProvider && (isExtensionInstalled || isMetaMaskInstalled);
        return (h("div", { key: '5756eea34ddce724af94282fb2a69d38f31204dd', class: { 'unlock-button': true, [this.class]: Boolean(this.class) } }, this.icon ? (h("div", { class: "unlock-button-icon" }, this.icon)) : (h("div", { class: "unlock-button-icon" }, h("mvx-multiversx-logo-icon", null))), h("div", { key: '123d257164bd25376ad1dc3e67e36f008115b63d', class: "unlock-button-label" }, this.label), isDetectableProvider && (h("div", { key: 'bef6d9d10c0bb7d56efb46f6b739c7f37e8513ff', class: "unlock-button-status" }, shouldShowOpenLabel ? (h("div", { class: "unlock-button-status-open" }, "Open")) : (h("div", { class: "unlock-button-status-install" }, h("span", { class: "unlock-button-status-install-label" }, "Install"), h("mvx-arrow-up-right-icon", { class: "unlock-button-status-install-icon" })))))));
    }
    static get style() { return unlockButtonCss; }
}, [1, "mvx-unlock-button", {
        "label": [1],
        "icon": [16],
        "type": [1],
        "class": [1]
    }]);
function defineCustomElement() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["mvx-unlock-button", "mvx-arrow-up-right-icon", "mvx-multiversx-logo-icon"];
    components.forEach(tagName => { switch (tagName) {
        case "mvx-unlock-button":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, UnlockButton);
            }
            break;
        case "mvx-arrow-up-right-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
        case "mvx-multiversx-logo-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$1();
            }
            break;
    } });
}

export { UnlockButton as U, getIsMetaMaskAvailable as a, defineCustomElement as d, getIsExtensionAvailable as g };
//# sourceMappingURL=p-odfGTZSl.js.map

//# sourceMappingURL=p-odfGTZSl.js.map