import { r as registerInstance, h, H as Host } from './index-7159ffcd.js';
import { b as watchBlockNumber } from './chunk-LAFZBYO7-9a6189f1.js';
import { s as state } from './wallet-3e4cc9a4.js';

const NKEditionSupplyText = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.quantity = undefined;
    this.maxQuantity = undefined;
    this.editionId = undefined;
  }
  componentWillLoad() {
    this.disconnect = watchBlockNumber({ listen: true }, async () => {
      const edition = await state.diamond.apps.edition.getEdition(this.editionId);
      this.quantity = edition.quantity.toNumber();
      this.maxQuantity = edition.maxQuantity.toNumber();
    });
  }
  disconnectedCallback() {
    this.disconnect();
  }
  render() {
    return (h(Host, null, this.maxQuantity === 0
      ? this.quantity
      : `${this.quantity} / ${this.maxQuantity}`, h("slot", null)));
  }
};

export { NKEditionSupplyText as nk_edition_supply_text };

//# sourceMappingURL=nk-edition-supply-text.entry.js.map