import { p as proxyCustomElement, H, h } from './index.js';
import { d as defineCustomElement$2 } from './p-Bu8Hq-yR.js';

const downloadCss = "";

const Download = /*@__PURE__*/ proxyCustomElement(class Download extends H {
    constructor() {
        super();
        this.__registerHost();
        this.__attachShadow();
        this.tokens = 'css';
    }
    render() {
        const fileMap = {
            css: 'css-variables.css',
            scss: 'scss-variables.scss'
        };
        const fileName = `infineon-tokens.${this.tokens}`;
        const sourceFile = fileMap[this.tokens];
        const fileUrl = `https://raw.githubusercontent.com/Infineon/public-assets/main/ifx-tokens/${sourceFile}`;
        return (h("ifx-link", { key: '51887d03944efc6448ef2c71288a16754bebf12f', onClick: (e) => {
                e.preventDefault();
                fetch(fileUrl)
                    .then(res => res.blob())
                    .then(blob => {
                    const link = document.createElement('a');
                    link.href = URL.createObjectURL(blob);
                    link.download = fileName;
                    link.click();
                });
            }, href: fileUrl, download: fileName, class: "download__wrapper", size: "m", variant: "bold" }, h("slot", { key: '8b4c69297dcbf44cf7182e8db89758a4f3a1f981' })));
    }
    static get style() { return downloadCss; }
}, [257, "ifx-download", {
        "tokens": [1]
    }]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["ifx-download", "ifx-link"];
    components.forEach(tagName => { switch (tagName) {
        case "ifx-download":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, Download);
            }
            break;
        case "ifx-link":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}

const IfxDownload = Download;
const defineCustomElement = defineCustomElement$1;

export { IfxDownload, defineCustomElement };
//# sourceMappingURL=ifx-download.js.map

//# sourceMappingURL=ifx-download.js.map