import { r as registerInstance, c as createEvent, h, g as getElement } from './index-148a7577.js';

const utilResizeObserverCss = ".sc-digi-util-resize-observer-h{display:block}";
const DigiUtilResizeObserverStyle0 = utilResizeObserverCss;

const UtilResizeObserver = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.afOnChange = createEvent(this, "afOnChange", 7);
        this._observer = null;
    }
    componentWillLoad() {
        this.initObserver();
    }
    disconnectedCallback() {
        this.removeObserver();
    }
    initObserver() {
        this._observer = new ResizeObserver(([entry]) => {
            this.afOnChange.emit(entry);
        });
        this._observer.observe(this.hostElement);
    }
    removeObserver() {
        if (this._observer)
            this._observer.disconnect();
    }
    changeHandler(e) {
        this.afOnChange.emit(e);
    }
    render() {
        return h("slot", { key: '1428211db620bf886a98eb908958a7d7ffb0eac1' });
    }
    get hostElement() { return getElement(this); }
};
UtilResizeObserver.style = DigiUtilResizeObserverStyle0;

export { UtilResizeObserver as digi_util_resize_observer };
