import { b as TailwindStyledElement, x } from '../../chunks/index-5X9ujrWL.js';
import { n } from '../../chunks/property-DfumgIL6.js';
import { s as safeCustomElement } from '../../chunks/safe-custom-element-qdGIR_v6.js';

const style = ":host {\n    display: inline-flex\n}";

var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result) __defProp(target, key, result);
  return result;
};
let LuksoShare = class extends TailwindStyledElement(style) {
  constructor() {
    super(...arguments);
    this.customStyle = "";
    this.providers = "";
    this.defaultProviders = [
      "twitter",
      "instagram",
      "linkedin",
      "telegram",
      "discord",
      "reddit",
      "medium",
      "github"
    ];
    this.defaultProviderLinks = {
      twitter: "https://twitter.com/ERC725Account",
      instagram: "https://www.instagram.com/lukso",
      linkedin: "https://linkedin.com/company/lukso",
      telegram: "https://t.me/LUKSO_News",
      discord: "https://discord.gg/lukso",
      reddit: "https://www.reddit.com/r/lukso",
      medium: "https://medium.com/lukso",
      github: "https://github.com/lukso-network"
    };
  }
  linkTemplate(name, url) {
    return x`<a
      href=${url}
      target="_blank"
      class="transition-all duration-300 rounded-full opacity-50 hover:opacity-80 hover:shadow-button-medium-hover-primary h-7 w-7"
      aria-label="${name}"
      ><img src="/assets/images/social-${name}.svg" alt=""
    /></a>`;
  }
  render() {
    const linkTemplates = [];
    let providers = this.defaultProviders;
    try {
      providers = JSON.parse(this.providers);
    } catch (error) {
    }
    for (const provider of providers) {
      if (typeof provider === "string") {
        linkTemplates.push(
          this.linkTemplate(provider, this.defaultProviderLinks[provider])
        );
      } else {
        linkTemplates.push(this.linkTemplate(provider.name, provider.url));
      }
    }
    return x`<div
      class="grid gap-2 sm:gap-4"
      style="grid-template-columns: repeat(${providers.length}, max-content); ${this.customStyle}"
    >
      ${linkTemplates}
    </div>`;
  }
};
__decorateClass([
  n({ type: String, attribute: "custom-style" })
], LuksoShare.prototype, "customStyle", 2);
__decorateClass([
  n({ type: String })
], LuksoShare.prototype, "providers", 2);
LuksoShare = __decorateClass([
  safeCustomElement("lukso-share")
], LuksoShare);

export { LuksoShare };
