"use client";
import { A as h, C as v, D as y } from "./index.package-DVXWP15X.js";
import { n as a, a as b } from "./class-map-PJQE20qS.js";
import { r as x } from "./tron-connector-BRlrwEsj.js";
const p = {
  getSpacingStyles(t, e) {
    if (Array.isArray(t))
      return t[e] ? `var(--wui-spacing-${t[e]})` : void 0;
    if (typeof t == "string")
      return `var(--wui-spacing-${t})`;
  },
  getFormattedDate(t) {
    return new Intl.DateTimeFormat("en-US", { month: "short", day: "numeric" }).format(t);
  },
  getHostName(t) {
    try {
      return new URL(t).hostname;
    } catch {
      return "";
    }
  },
  getTruncateString({ string: t, charsStart: e, charsEnd: i, truncate: n }) {
    return t.length <= e + i ? t : n === "end" ? `${t.substring(0, e)}...` : n === "start" ? `...${t.substring(t.length - i)}` : `${t.substring(0, Math.floor(e))}...${t.substring(t.length - Math.floor(i))}`;
  },
  generateAvatarColors(t) {
    const i = t.toLowerCase().replace(/^0x/iu, "").replace(/[^a-f0-9]/gu, "").substring(0, 6).padEnd(6, "0"), n = this.hexToRgb(i), r = getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"), s = 100 - 3 * Number(r?.replace("px", "")), f = `${s}% ${s}% at 65% 40%`, g = [];
    for (let w = 0; w < 5; w += 1) {
      const m = this.tintColor(n, 0.15 * w);
      g.push(`rgb(${m[0]}, ${m[1]}, ${m[2]})`);
    }
    return `
    --local-color-1: ${g[0]};
    --local-color-2: ${g[1]};
    --local-color-3: ${g[2]};
    --local-color-4: ${g[3]};
    --local-color-5: ${g[4]};
    --local-radial-circle: ${f}
   `;
  },
  hexToRgb(t) {
    const e = parseInt(t, 16), i = e >> 16 & 255, n = e >> 8 & 255, r = e & 255;
    return [i, n, r];
  },
  tintColor(t, e) {
    const [i, n, r] = t, o = Math.round(i + (255 - i) * e), s = Math.round(n + (255 - n) * e), f = Math.round(r + (255 - r) * e);
    return [o, s, f];
  },
  isNumber(t) {
    return {
      number: /^[0-9]+$/u
    }.number.test(t);
  },
  getColorTheme(t) {
    return t || (typeof window < "u" && window.matchMedia && typeof window.matchMedia == "function" ? window.matchMedia("(prefers-color-scheme: dark)")?.matches ? "dark" : "light" : "dark");
  },
  splitBalance(t) {
    const e = t.split(".");
    return e.length === 2 ? [e[0], e[1]] : ["0", "00"];
  },
  roundNumber(t, e, i) {
    return t.toString().length >= e ? Number(t).toFixed(i) : t;
  }
};
function S(t, e) {
  const { kind: i, elements: n } = e;
  return {
    kind: i,
    elements: n,
    finisher(r) {
      customElements.get(t) || customElements.define(t, r);
    }
  };
}
function z(t, e) {
  return customElements.get(t) || customElements.define(t, e), e;
}
function $(t) {
  return function(i) {
    return typeof i == "function" ? z(t, i) : S(t, i);
  };
}
const C = h`
  :host {
    display: inline-flex !important;
  }

  slot {
    width: 100%;
    display: inline-block;
    font-style: normal;
    font-family: var(--wui-font-family);
    font-feature-settings:
      'tnum' on,
      'lnum' on,
      'case' on;
    line-height: 130%;
    font-weight: var(--wui-font-weight-regular);
    overflow: inherit;
    text-overflow: inherit;
    text-align: var(--local-align);
    color: var(--local-color);
  }

  .wui-line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .wui-line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .wui-font-medium-400 {
    font-size: var(--wui-font-size-medium);
    font-weight: var(--wui-font-weight-light);
    letter-spacing: var(--wui-letter-spacing-medium);
  }

  .wui-font-medium-600 {
    font-size: var(--wui-font-size-medium);
    letter-spacing: var(--wui-letter-spacing-medium);
  }

  .wui-font-title-600 {
    font-size: var(--wui-font-size-title);
    letter-spacing: var(--wui-letter-spacing-title);
  }

  .wui-font-title-6-600 {
    font-size: var(--wui-font-size-title-6);
    letter-spacing: var(--wui-letter-spacing-title-6);
  }

  .wui-font-mini-700 {
    font-size: var(--wui-font-size-mini);
    letter-spacing: var(--wui-letter-spacing-mini);
    text-transform: uppercase;
  }

  .wui-font-large-500,
  .wui-font-large-600,
  .wui-font-large-700 {
    font-size: var(--wui-font-size-large);
    letter-spacing: var(--wui-letter-spacing-large);
  }

  .wui-font-2xl-500,
  .wui-font-2xl-600,
  .wui-font-2xl-700 {
    font-size: var(--wui-font-size-2xl);
    letter-spacing: var(--wui-letter-spacing-2xl);
  }

  .wui-font-paragraph-400,
  .wui-font-paragraph-500,
  .wui-font-paragraph-600,
  .wui-font-paragraph-700 {
    font-size: var(--wui-font-size-paragraph);
    letter-spacing: var(--wui-letter-spacing-paragraph);
  }

  .wui-font-small-400,
  .wui-font-small-500,
  .wui-font-small-600 {
    font-size: var(--wui-font-size-small);
    letter-spacing: var(--wui-letter-spacing-small);
  }

  .wui-font-tiny-400,
  .wui-font-tiny-500,
  .wui-font-tiny-600 {
    font-size: var(--wui-font-size-tiny);
    letter-spacing: var(--wui-letter-spacing-tiny);
  }

  .wui-font-micro-700,
  .wui-font-micro-600,
  .wui-font-micro-500 {
    font-size: var(--wui-font-size-micro);
    letter-spacing: var(--wui-letter-spacing-micro);
    text-transform: uppercase;
  }

  .wui-font-tiny-400,
  .wui-font-small-400,
  .wui-font-medium-400,
  .wui-font-paragraph-400 {
    font-weight: var(--wui-font-weight-light);
  }

  .wui-font-large-700,
  .wui-font-paragraph-700,
  .wui-font-micro-700,
  .wui-font-mini-700 {
    font-weight: var(--wui-font-weight-bold);
  }

  .wui-font-medium-600,
  .wui-font-medium-title-600,
  .wui-font-title-6-600,
  .wui-font-large-600,
  .wui-font-paragraph-600,
  .wui-font-small-600,
  .wui-font-tiny-600,
  .wui-font-micro-600 {
    font-weight: var(--wui-font-weight-medium);
  }

  :host([disabled]) {
    opacity: 0.4;
  }
`;
var d = function(t, e, i, n) {
  var r = arguments.length, o = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(t, e, i, n);
  else for (var f = t.length - 1; f >= 0; f--) (s = t[f]) && (o = (r < 3 ? s(o) : r > 3 ? s(e, i, o) : s(e, i)) || o);
  return r > 3 && o && Object.defineProperty(e, i, o), o;
};
let c = class extends v {
  constructor() {
    super(...arguments), this.variant = "paragraph-500", this.color = "fg-300", this.align = "left", this.lineClamp = void 0;
  }
  render() {
    const e = {
      [`wui-font-${this.variant}`]: !0,
      [`wui-color-${this.color}`]: !0,
      [`wui-line-clamp-${this.lineClamp}`]: !!this.lineClamp
    };
    return this.style.cssText = `
      --local-align: ${this.align};
      --local-color: var(--wui-color-${this.color});
    `, y`<slot class=${b(e)}></slot>`;
  }
};
c.styles = [x, C];
d([
  a()
], c.prototype, "variant", void 0);
d([
  a()
], c.prototype, "color", void 0);
d([
  a()
], c.prototype, "align", void 0);
d([
  a()
], c.prototype, "lineClamp", void 0);
c = d([
  $("wui-text")
], c);
const R = h`
  :host {
    display: flex;
    width: inherit;
    height: inherit;
  }
`;
var u = function(t, e, i, n) {
  var r = arguments.length, o = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(t, e, i, n);
  else for (var f = t.length - 1; f >= 0; f--) (s = t[f]) && (o = (r < 3 ? s(o) : r > 3 ? s(e, i, o) : s(e, i)) || o);
  return r > 3 && o && Object.defineProperty(e, i, o), o;
};
let l = class extends v {
  render() {
    return this.style.cssText = `
      flex-direction: ${this.flexDirection};
      flex-wrap: ${this.flexWrap};
      flex-basis: ${this.flexBasis};
      flex-grow: ${this.flexGrow};
      flex-shrink: ${this.flexShrink};
      align-items: ${this.alignItems};
      justify-content: ${this.justifyContent};
      column-gap: ${this.columnGap && `var(--wui-spacing-${this.columnGap})`};
      row-gap: ${this.rowGap && `var(--wui-spacing-${this.rowGap})`};
      gap: ${this.gap && `var(--wui-spacing-${this.gap})`};
      padding-top: ${this.padding && p.getSpacingStyles(this.padding, 0)};
      padding-right: ${this.padding && p.getSpacingStyles(this.padding, 1)};
      padding-bottom: ${this.padding && p.getSpacingStyles(this.padding, 2)};
      padding-left: ${this.padding && p.getSpacingStyles(this.padding, 3)};
      margin-top: ${this.margin && p.getSpacingStyles(this.margin, 0)};
      margin-right: ${this.margin && p.getSpacingStyles(this.margin, 1)};
      margin-bottom: ${this.margin && p.getSpacingStyles(this.margin, 2)};
      margin-left: ${this.margin && p.getSpacingStyles(this.margin, 3)};
    `, y`<slot></slot>`;
  }
};
l.styles = [x, R];
u([
  a()
], l.prototype, "flexDirection", void 0);
u([
  a()
], l.prototype, "flexWrap", void 0);
u([
  a()
], l.prototype, "flexBasis", void 0);
u([
  a()
], l.prototype, "flexGrow", void 0);
u([
  a()
], l.prototype, "flexShrink", void 0);
u([
  a()
], l.prototype, "alignItems", void 0);
u([
  a()
], l.prototype, "justifyContent", void 0);
u([
  a()
], l.prototype, "columnGap", void 0);
u([
  a()
], l.prototype, "rowGap", void 0);
u([
  a()
], l.prototype, "gap", void 0);
u([
  a()
], l.prototype, "padding", void 0);
u([
  a()
], l.prototype, "margin", void 0);
l = u([
  $("wui-flex")
], l);
export {
  p as U,
  $ as c
};
