1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- 'use strict';
- import './webcomponents-sd-ce-pf-index.js';
- const customElements = window.customElements;
- let shouldFlush = false;
- let flusher = null;
- if (customElements['polyfillWrapFlushCallback']) {
- customElements['polyfillWrapFlushCallback']((flush) => {
- flusher = flush;
- if (shouldFlush) {
- flush();
- }
- });
- }
- function flushAndFire() {
- if (window.HTMLTemplateElement.bootstrap) {
- window.HTMLTemplateElement.bootstrap(window.document);
- }
- flusher && flusher();
- shouldFlush = true;
- window.WebComponents.ready = true;
- document.dispatchEvent(new CustomEvent('WebComponentsReady', { bubbles: true }));
- }
- if (document.readyState !== 'complete') {
-
- window.addEventListener('load', flushAndFire)
- window.addEventListener('DOMContentLoaded', () => {
- window.removeEventListener('load', flushAndFire);
- flushAndFire();
- });
- } else {
- flushAndFire();
- }
|