import { onPageLoadComplete } from '@nimius/event-utility';

onPageLoadComplete(async () => {
    if (document.querySelector('[data-toubiz-sticky-element]')) {
        // eslint-disable-next-line max-len
        const { default: ToubizStickyElement } = await import(/* webpackChunkName: "toubiz-sticky-element" */ '../../Scripts/toubiz-sticky-element');

        for (const node of document.querySelectorAll('[data-toubiz-sticky-element]')) {
            new ToubizStickyElement(node);
        }
    }
});
