import { r as e, c as r, h as t, H as a } from "./p-9b9ccd0c.js";

const i = "button.button-secondary{border-color:var(--color-border-neutral-default)}.loader__wrapper{position:absolute;border:none;opacity:0;transition:var(--show-transition) opacity;inline-size:100%;block-size:100%;display:flex;background-color:var(--elevation-background-color, var(--color-accent-surface-surface));padding:var(--spacing-padding-xxxl);flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;color:var(--color-text-neutral-default);z-index:99;animation:fadeIn var(--timing-fast) forwards}.loader__wrapper--visible{opacity:1}.loader__spinner{border:4px solid var(--elevation-border-color, var(--color-border-surface-on-surface));border-block-start:4px solid var(--color-border-primary-default);border-radius:50%;animation:spinner 0.6s infinite linear;inline-size:32px;block-size:32px;flex-shrink:0;opacity:1}.loader__content-wrapper{display:flex;text-align:center;flex-direction:column;margin-block-start:16px;gap:var(--spacing-gap-m);max-block-size:400px;opacity:1}.loader__content-wrapper--hidden{display:none}.loader__cancel-button{margin-block-start:8px}@keyframes spinner{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}@keyframes fadeIn{0%{opacity:0}}";

var o = undefined && undefined.__classPrivateFieldGet || function(e, r, t, a) {
  if (t === "a" && !a) throw new TypeError("Private accessor was defined without a getter");
  if (typeof r === "function" ? e !== r || !a : !r.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return t === "m" ? a : t === "a" ? a.call(e) : a ? a.value : r.get(e);
};

var n, s, d, l, c;

const p = [ "resets/box-sizing", "components/button", "utils/typography" ];

const h = class {
  constructor(a) {
    e(this, a);
    this.loaderFinished = r(this, "loaderFinished", 7);
    n.set(this, void 0);
    s.set(this, (() => {
      if (this.cancelCallback) {
        this.cancelCallback();
      }
      clearTimeout(o(this, n, "f"));
      this.show = false;
    }));
    d.set(this, (() => this.cancelLabel && t("div", null, t("button", {
      class: "button-secondary loader__cancel-button",
      type: "button",
      onClick: o(this, s, "f")
    }, this.cancelLabel))));
    l.set(this, (() => this.description && t("p", {
      class: "body-regular-italic-s"
    }, this.description)));
    c.set(this, (() => this.loaderTitle && t("p", {
      class: "body-regular-l"
    }, this.loaderTitle)));
    this.showWrapper = true;
    this.abortTime = 5 * 60 * 1e3;
    this.cancelCallback = undefined;
    this.cancelLabel = undefined;
    this.description = undefined;
    this.loaderTitle = undefined;
    this.show = false;
  }
  render() {
    return t(a, null, t("ch-theme", {
      model: p
    }), this.show && t("div", {
      class: {
        [`loader__wrapper`]: true,
        "loader__wrapper--visible": this.showWrapper
      },
      part: "loader-wrapper",
      popover: ""
    }, t("div", {
      class: "loader__spinner"
    }), t("div", {
      class: {
        "loader__content-wrapper": true,
        "loader__content-wrapper--hidden": !this.description && !this.loaderTitle && !this.cancelLabel
      }
    }, o(this, c, "f").call(this), o(this, l, "f").call(this), o(this, d, "f").call(this))));
  }
};

n = new WeakMap, s = new WeakMap, d = new WeakMap, l = new WeakMap, c = new WeakMap;

h.style = i;

export { h as gx_ide_loader };
//# sourceMappingURL=p-24247ec3.entry.js.map