import { D as o } from "./Tools_delayFun-CA1ktv1L.js";
import { A as t } from "./Tools_animateEasing-D0lY_Vn8.js";
import { L as r } from "./Tools_localStorage-DVvhtzhL.js";
import { C as a } from "./Tools_cookie-DKctMXdK.js";
import { C as l } from "./Tools_number-C_MjN473.js";
import { C as s } from "./base-PQGakkrl.js";
import { C as n } from "./Element_Event_drag-DeZYlveu.js";
import "js-cookie";
import "decimal.js";
const y = {
  DelayFun: o,
  AnimateEasing: t,
  LocalStorage: r,
  Cookie: a,
  Number: l
};
class d {
  options;
  _isWinResize;
  _isRunDelay;
  _runDelayFun;
  _bindWinResize;
  _objResizeObserver;
  constructor(i) {
    this._isWinResize = s.isUndefined(i.element), this._isRunDelay = !!(!s.isBoolean(i.isDelay) || i.isDelay), this.options = i, this._init();
  }
  _init() {
    this._isRunDelay && (this._runDelayFun = new o(this.options.callback, this.options.delayTime)), this._isWinResize ? (this._bindWinResize = this._onWinResize.bind(this), n.onListener(window, "resize", this._bindWinResize)) : this._initResizeObserver();
  }
  _onWinResize() {
    this._isRunDelay ? this._runDelayFun.run() : this.options.callback && this.options.callback();
  }
  _initResizeObserver() {
    window && "ResizeObserver" in window && (this._objResizeObserver = new ResizeObserver((i) => {
      const e = i[0];
      this._isRunDelay ? this._runDelayFun.run(() => {
        this.options.callback(e);
      }) : this.options.callback(e);
    }), this._objResizeObserver.observe(this.options.element));
  }
  destroy() {
    this._isWinResize ? n.offListener(window, "resize", this._bindWinResize) : this._objResizeObserver && (this._objResizeObserver.disconnect(), this._objResizeObserver = null);
  }
}
export {
  y as C,
  d as R
};
//# sourceMappingURL=Element_Event_resize-DqH_UT2k.js.map
