1 | var __extends = (this && this.__extends) || (function () {
|
2 | var extendStatics = function (d, b) {
|
3 | extendStatics = Object.setPrototypeOf ||
|
4 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
5 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
6 | return extendStatics(d, b);
|
7 | };
|
8 | return function (d, b) {
|
9 | extendStatics(d, b);
|
10 | function __() { this.constructor = d; }
|
11 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
12 | };
|
13 | })();
|
14 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
15 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
16 | return new (P || (P = Promise))(function (resolve, reject) {
|
17 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
18 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
19 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
20 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
21 | });
|
22 | };
|
23 | var __generator = (this && this.__generator) || function (thisArg, body) {
|
24 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
25 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
26 | function verb(n) { return function (v) { return step([n, v]); }; }
|
27 | function step(op) {
|
28 | if (f) throw new TypeError("Generator is already executing.");
|
29 | while (_) try {
|
30 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
31 | if (y = 0, t) op = [op[0] & 2, t.value];
|
32 | switch (op[0]) {
|
33 | case 0: case 1: t = op; break;
|
34 | case 4: _.label++; return { value: op[1], done: false };
|
35 | case 5: _.label++; y = op[1]; op = [0]; continue;
|
36 | case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
37 | default:
|
38 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
39 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
40 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
41 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
42 | if (t[2]) _.ops.pop();
|
43 | _.trys.pop(); continue;
|
44 | }
|
45 | op = body.call(thisArg, _);
|
46 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
47 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
48 | }
|
49 | };
|
50 | var __spreadArrays = (this && this.__spreadArrays) || function () {
|
51 | for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
52 | for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
53 | for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
54 | r[k] = a[j];
|
55 | return r;
|
56 | };
|
57 | var NAMESPACE = 'bulmil';
|
58 | var contentRef;
|
59 | var hostTagName;
|
60 | var useNativeShadowDom = false;
|
61 | var checkSlotFallbackVisibility = false;
|
62 | var checkSlotRelocate = false;
|
63 | var isSvgMode = false;
|
64 | var queueCongestion = 0;
|
65 | var queuePending = false;
|
66 | var win = typeof window !== 'undefined' ? window : {};
|
67 | var CSS = win.CSS;
|
68 | var doc = win.document || { head: {} };
|
69 | var plt = {
|
70 | $flags$: 0,
|
71 | $resourcesUrl$: '',
|
72 | jmp: function (h) { return h(); },
|
73 | raf: function (h) { return requestAnimationFrame(h); },
|
74 | ael: function (el, eventName, listener, opts) { return el.addEventListener(eventName, listener, opts); },
|
75 | rel: function (el, eventName, listener, opts) { return el.removeEventListener(eventName, listener, opts); },
|
76 | };
|
77 | var supportsShadow = true;
|
78 | var promiseResolve = function (v) { return Promise.resolve(v); };
|
79 | var supportsConstructibleStylesheets = (function () {
|
80 | try {
|
81 | new CSSStyleSheet();
|
82 | return true;
|
83 | }
|
84 | catch (e) { }
|
85 | return false;
|
86 | })();
|
87 | var CONTENT_REF_ID = 'r';
|
88 | var ORG_LOCATION_ID = 'o';
|
89 | var SLOT_NODE_ID = 's';
|
90 | var TEXT_NODE_ID = 't';
|
91 | var HYDRATE_ID = 's-id';
|
92 | var HYDRATED_STYLE_ID = 'sty-id';
|
93 | var HYDRATE_CHILD_ID = 'c-id';
|
94 | var HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
95 | var createTime = function (fnName, tagName) {
|
96 | if (tagName === void 0) { tagName = ''; }
|
97 | {
|
98 | return function () {
|
99 | return;
|
100 | };
|
101 | }
|
102 | };
|
103 | var uniqueTime = function (key, measureText) {
|
104 | {
|
105 | return function () {
|
106 | return;
|
107 | };
|
108 | }
|
109 | };
|
110 | var rootAppliedStyles = new WeakMap();
|
111 | var registerStyle = function (scopeId, cssText, allowCS) {
|
112 | var style = styles.get(scopeId);
|
113 | if (supportsConstructibleStylesheets && allowCS) {
|
114 | style = (style || new CSSStyleSheet());
|
115 | style.replace(cssText);
|
116 | }
|
117 | else {
|
118 | style = cssText;
|
119 | }
|
120 | styles.set(scopeId, style);
|
121 | };
|
122 | var addStyle = function (styleContainerNode, cmpMeta, mode, hostElm) {
|
123 | var scopeId = getScopeId(cmpMeta.$tagName$);
|
124 | var style = styles.get(scopeId);
|
125 |
|
126 |
|
127 | styleContainerNode = styleContainerNode.nodeType === 11 ? styleContainerNode : doc;
|
128 | if (style) {
|
129 | if (typeof style === 'string') {
|
130 | styleContainerNode = styleContainerNode.head || styleContainerNode;
|
131 | var appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
132 | var styleElm = void 0;
|
133 | if (!appliedStyles) {
|
134 | rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
135 | }
|
136 | if (!appliedStyles.has(scopeId)) {
|
137 | if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector("[" + HYDRATED_STYLE_ID + "=\"" + scopeId + "\"]"))) {
|
138 |
|
139 | styleElm.innerHTML = style;
|
140 | }
|
141 | else {
|
142 | if (plt.$cssShim$) {
|
143 | styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 ));
|
144 | var newScopeId = styleElm['s-sc'];
|
145 | if (newScopeId) {
|
146 | scopeId = newScopeId;
|
147 |
|
148 |
|
149 |
|
150 | appliedStyles = null;
|
151 | }
|
152 | }
|
153 | else {
|
154 | styleElm = doc.createElement('style');
|
155 | styleElm.innerHTML = style;
|
156 | }
|
157 | styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
158 | }
|
159 | if (appliedStyles) {
|
160 | appliedStyles.add(scopeId);
|
161 | }
|
162 | }
|
163 | }
|
164 | else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
165 | styleContainerNode.adoptedStyleSheets = __spreadArrays(styleContainerNode.adoptedStyleSheets, [style]);
|
166 | }
|
167 | }
|
168 | return scopeId;
|
169 | };
|
170 | var attachStyles = function (hostRef) {
|
171 | var cmpMeta = hostRef.$cmpMeta$;
|
172 | var elm = hostRef.$hostElement$;
|
173 | var endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
174 | var scopeId = addStyle(elm.getRootNode(), cmpMeta, hostRef.$modeName$, elm);
|
175 | endAttachStyles();
|
176 | };
|
177 | var getScopeId = function (tagName, mode) { return 'sc-' + (tagName); };
|
178 |
|
179 |
|
180 |
|
181 |
|
182 |
|
183 |
|
184 |
|
185 | var EMPTY_OBJ = {};
|
186 | var isComplexType = function (o) {
|
187 |
|
188 | o = typeof o;
|
189 | return o === 'object' || o === 'function';
|
190 | };
|
191 | var getDynamicImportFunction = function (namespace) { return "__sc_import_" + namespace.replace(/\s|-/g, '_'); };
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 | var h = function (nodeName, vnodeData) {
|
204 | var children = [];
|
205 | for (var _i = 2; _i < arguments.length; _i++) {
|
206 | children[_i - 2] = arguments[_i];
|
207 | }
|
208 | var child = null;
|
209 | var slotName = null;
|
210 | var simple = false;
|
211 | var lastSimple = false;
|
212 | var vNodeChildren = [];
|
213 | var walk = function (c) {
|
214 | for (var i = 0; i < c.length; i++) {
|
215 | child = c[i];
|
216 | if (Array.isArray(child)) {
|
217 | walk(child);
|
218 | }
|
219 | else if (child != null && typeof child !== 'boolean') {
|
220 | if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
|
221 | child = String(child);
|
222 | }
|
223 | if (simple && lastSimple) {
|
224 |
|
225 | vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
226 | }
|
227 | else {
|
228 |
|
229 | vNodeChildren.push(simple ? newVNode(null, child) : child);
|
230 | }
|
231 | lastSimple = simple;
|
232 | }
|
233 | }
|
234 | };
|
235 | walk(children);
|
236 | if (vnodeData) {
|
237 | if (vnodeData.name) {
|
238 | slotName = vnodeData.name;
|
239 | }
|
240 | {
|
241 | var classData_1 = vnodeData.className || vnodeData.class;
|
242 | if (classData_1) {
|
243 | vnodeData.class =
|
244 | typeof classData_1 !== 'object'
|
245 | ? classData_1
|
246 | : Object.keys(classData_1)
|
247 | .filter(function (k) { return classData_1[k]; })
|
248 | .join(' ');
|
249 | }
|
250 | }
|
251 | }
|
252 | if (typeof nodeName === 'function') {
|
253 |
|
254 | return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
|
255 | }
|
256 | var vnode = newVNode(nodeName, null);
|
257 | vnode.$attrs$ = vnodeData;
|
258 | if (vNodeChildren.length > 0) {
|
259 | vnode.$children$ = vNodeChildren;
|
260 | }
|
261 | {
|
262 | vnode.$name$ = slotName;
|
263 | }
|
264 | return vnode;
|
265 | };
|
266 | var newVNode = function (tag, text) {
|
267 | var vnode = {
|
268 | $flags$: 0,
|
269 | $tag$: tag,
|
270 | $text$: text,
|
271 | $elm$: null,
|
272 | $children$: null,
|
273 | };
|
274 | {
|
275 | vnode.$attrs$ = null;
|
276 | }
|
277 | {
|
278 | vnode.$name$ = null;
|
279 | }
|
280 | return vnode;
|
281 | };
|
282 | var Host = {};
|
283 | var isHost = function (node) { return node && node.$tag$ === Host; };
|
284 | var vdomFnUtils = {
|
285 | forEach: function (children, cb) { return children.map(convertToPublic).forEach(cb); },
|
286 | map: function (children, cb) { return children
|
287 | .map(convertToPublic)
|
288 | .map(cb)
|
289 | .map(convertToPrivate); },
|
290 | };
|
291 | var convertToPublic = function (node) { return ({
|
292 | vattrs: node.$attrs$,
|
293 | vchildren: node.$children$,
|
294 | vkey: node.$key$,
|
295 | vname: node.$name$,
|
296 | vtag: node.$tag$,
|
297 | vtext: node.$text$,
|
298 | }); };
|
299 | var convertToPrivate = function (node) {
|
300 | var vnode = newVNode(node.vtag, node.vtext);
|
301 | vnode.$attrs$ = node.vattrs;
|
302 | vnode.$children$ = node.vchildren;
|
303 | vnode.$key$ = node.vkey;
|
304 | vnode.$name$ = node.vname;
|
305 | return vnode;
|
306 | };
|
307 |
|
308 |
|
309 |
|
310 |
|
311 |
|
312 |
|
313 |
|
314 |
|
315 | var setAccessor = function (elm, memberName, oldValue, newValue, isSvg, flags) {
|
316 | if (oldValue !== newValue) {
|
317 | var isProp = isMemberInElement(elm, memberName);
|
318 | var ln = memberName.toLowerCase();
|
319 | if (memberName === 'class') {
|
320 | var classList = elm.classList;
|
321 | var oldClasses_1 = parseClassList(oldValue);
|
322 | var newClasses_1 = parseClassList(newValue);
|
323 | classList.remove.apply(classList, oldClasses_1.filter(function (c) { return c && !newClasses_1.includes(c); }));
|
324 | classList.add.apply(classList, newClasses_1.filter(function (c) { return c && !oldClasses_1.includes(c); }));
|
325 | }
|
326 | else if ((!isProp) && memberName[0] === 'o' && memberName[1] === 'n') {
|
327 |
|
328 |
|
329 |
|
330 |
|
331 | if (memberName[2] === '-') {
|
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 | memberName = memberName.slice(3);
|
340 | }
|
341 | else if (isMemberInElement(win, ln)) {
|
342 |
|
343 |
|
344 |
|
345 |
|
346 | memberName = ln.slice(2);
|
347 | }
|
348 | else {
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 | memberName = ln[2] + memberName.slice(3);
|
355 | }
|
356 | if (oldValue) {
|
357 | plt.rel(elm, memberName, oldValue, false);
|
358 | }
|
359 | if (newValue) {
|
360 | plt.ael(elm, memberName, newValue, false);
|
361 | }
|
362 | }
|
363 | else {
|
364 |
|
365 | var isComplex = isComplexType(newValue);
|
366 | if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
367 | try {
|
368 | if (!elm.tagName.includes('-')) {
|
369 | var n = newValue == null ? '' : newValue;
|
370 |
|
371 | if (memberName === 'list') {
|
372 | isProp = false;
|
373 |
|
374 | }
|
375 | else if (oldValue == null || elm[memberName] != n) {
|
376 | elm[memberName] = n;
|
377 | }
|
378 | }
|
379 | else {
|
380 | elm[memberName] = newValue;
|
381 | }
|
382 | }
|
383 | catch (e) { }
|
384 | }
|
385 | if (newValue == null || newValue === false) {
|
386 | {
|
387 | elm.removeAttribute(memberName);
|
388 | }
|
389 | }
|
390 | else if ((!isProp || flags & 4 || isSvg) && !isComplex) {
|
391 | newValue = newValue === true ? '' : newValue;
|
392 | {
|
393 | elm.setAttribute(memberName, newValue);
|
394 | }
|
395 | }
|
396 | }
|
397 | }
|
398 | };
|
399 | var parseClassListRegex = /\s/;
|
400 | var parseClassList = function (value) { return (!value ? [] : value.split(parseClassListRegex)); };
|
401 | var updateElement = function (oldVnode, newVnode, isSvgMode, memberName) {
|
402 |
|
403 |
|
404 |
|
405 | var elm = newVnode.$elm$.nodeType === 11 && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
406 | var oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
407 | var newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
408 | {
|
409 |
|
410 | for (memberName in oldVnodeAttrs) {
|
411 | if (!(memberName in newVnodeAttrs)) {
|
412 | setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
|
413 | }
|
414 | }
|
415 | }
|
416 |
|
417 | for (memberName in newVnodeAttrs) {
|
418 | setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
419 | }
|
420 | };
|
421 | var createElm = function (oldParentVNode, newParentVNode, childIndex, parentElm) {
|
422 |
|
423 | var newVNode = newParentVNode.$children$[childIndex];
|
424 | var i = 0;
|
425 | var elm;
|
426 | var childNode;
|
427 | var oldVNode;
|
428 | if (!useNativeShadowDom) {
|
429 |
|
430 | checkSlotRelocate = true;
|
431 | if (newVNode.$tag$ === 'slot') {
|
432 | newVNode.$flags$ |= newVNode.$children$
|
433 | ?
|
434 | 2
|
435 | :
|
436 | 1 ;
|
437 | }
|
438 | }
|
439 | if (newVNode.$text$ !== null) {
|
440 |
|
441 | elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
442 | }
|
443 | else if (newVNode.$flags$ & 1 ) {
|
444 |
|
445 | elm = newVNode.$elm$ = doc.createTextNode('');
|
446 | }
|
447 | else {
|
448 |
|
449 | elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 ? 'slot-fb' : newVNode.$tag$));
|
450 |
|
451 | {
|
452 | updateElement(null, newVNode, isSvgMode);
|
453 | }
|
454 | if (newVNode.$children$) {
|
455 | for (i = 0; i < newVNode.$children$.length; ++i) {
|
456 |
|
457 | childNode = createElm(oldParentVNode, newVNode, i);
|
458 |
|
459 | if (childNode) {
|
460 |
|
461 | elm.appendChild(childNode);
|
462 | }
|
463 | }
|
464 | }
|
465 | }
|
466 | {
|
467 | elm['s-hn'] = hostTagName;
|
468 | if (newVNode.$flags$ & (2 | 1 )) {
|
469 |
|
470 | elm['s-sr'] = true;
|
471 |
|
472 | elm['s-cr'] = contentRef;
|
473 |
|
474 | elm['s-sn'] = newVNode.$name$ || '';
|
475 |
|
476 | oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
477 | if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
|
478 |
|
479 |
|
480 | putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
481 | }
|
482 | }
|
483 | }
|
484 | return elm;
|
485 | };
|
486 | var putBackInOriginalLocation = function (parentElm, recursive) {
|
487 | plt.$flags$ |= 1 ;
|
488 | var oldSlotChildNodes = parentElm.childNodes;
|
489 | for (var i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
490 | var childNode = oldSlotChildNodes[i];
|
491 | if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
|
492 |
|
493 |
|
494 |
|
495 |
|
496 | parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
|
497 |
|
498 |
|
499 |
|
500 | childNode['s-ol'].remove();
|
501 | childNode['s-ol'] = undefined;
|
502 | checkSlotRelocate = true;
|
503 | }
|
504 | if (recursive) {
|
505 | putBackInOriginalLocation(childNode, recursive);
|
506 | }
|
507 | }
|
508 | plt.$flags$ &= ~1 ;
|
509 | };
|
510 | var addVnodes = function (parentElm, before, parentVNode, vnodes, startIdx, endIdx) {
|
511 | var containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
512 | var childNode;
|
513 | for (; startIdx <= endIdx; ++startIdx) {
|
514 | if (vnodes[startIdx]) {
|
515 | childNode = createElm(null, parentVNode, startIdx);
|
516 | if (childNode) {
|
517 | vnodes[startIdx].$elm$ = childNode;
|
518 | containerElm.insertBefore(childNode, referenceNode(before));
|
519 | }
|
520 | }
|
521 | }
|
522 | };
|
523 | var removeVnodes = function (vnodes, startIdx, endIdx, vnode, elm) {
|
524 | for (; startIdx <= endIdx; ++startIdx) {
|
525 | if ((vnode = vnodes[startIdx])) {
|
526 | elm = vnode.$elm$;
|
527 | {
|
528 |
|
529 |
|
530 | checkSlotFallbackVisibility = true;
|
531 | if (elm['s-ol']) {
|
532 |
|
533 | elm['s-ol'].remove();
|
534 | }
|
535 | else {
|
536 |
|
537 |
|
538 | putBackInOriginalLocation(elm, true);
|
539 | }
|
540 | }
|
541 |
|
542 | elm.remove();
|
543 | }
|
544 | }
|
545 | };
|
546 | var updateChildren = function (parentElm, oldCh, newVNode, newCh) {
|
547 | var oldStartIdx = 0;
|
548 | var newStartIdx = 0;
|
549 | var oldEndIdx = oldCh.length - 1;
|
550 | var oldStartVnode = oldCh[0];
|
551 | var oldEndVnode = oldCh[oldEndIdx];
|
552 | var newEndIdx = newCh.length - 1;
|
553 | var newStartVnode = newCh[0];
|
554 | var newEndVnode = newCh[newEndIdx];
|
555 | var node;
|
556 | while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
557 | if (oldStartVnode == null) {
|
558 |
|
559 | oldStartVnode = oldCh[++oldStartIdx];
|
560 | }
|
561 | else if (oldEndVnode == null) {
|
562 | oldEndVnode = oldCh[--oldEndIdx];
|
563 | }
|
564 | else if (newStartVnode == null) {
|
565 | newStartVnode = newCh[++newStartIdx];
|
566 | }
|
567 | else if (newEndVnode == null) {
|
568 | newEndVnode = newCh[--newEndIdx];
|
569 | }
|
570 | else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
571 | patch(oldStartVnode, newStartVnode);
|
572 | oldStartVnode = oldCh[++oldStartIdx];
|
573 | newStartVnode = newCh[++newStartIdx];
|
574 | }
|
575 | else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
576 | patch(oldEndVnode, newEndVnode);
|
577 | oldEndVnode = oldCh[--oldEndIdx];
|
578 | newEndVnode = newCh[--newEndIdx];
|
579 | }
|
580 | else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
581 |
|
582 | if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
583 | putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
584 | }
|
585 | patch(oldStartVnode, newEndVnode);
|
586 | parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
587 | oldStartVnode = oldCh[++oldStartIdx];
|
588 | newEndVnode = newCh[--newEndIdx];
|
589 | }
|
590 | else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
591 |
|
592 | if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
593 | putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
594 | }
|
595 | patch(oldEndVnode, newStartVnode);
|
596 | parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
597 | oldEndVnode = oldCh[--oldEndIdx];
|
598 | newStartVnode = newCh[++newStartIdx];
|
599 | }
|
600 | else {
|
601 | {
|
602 |
|
603 | node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
604 | newStartVnode = newCh[++newStartIdx];
|
605 | }
|
606 | if (node) {
|
607 | {
|
608 | parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
609 | }
|
610 | }
|
611 | }
|
612 | }
|
613 | if (oldStartIdx > oldEndIdx) {
|
614 | addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
615 | }
|
616 | else if (newStartIdx > newEndIdx) {
|
617 | removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
618 | }
|
619 | };
|
620 | var isSameVnode = function (vnode1, vnode2) {
|
621 |
|
622 |
|
623 | if (vnode1.$tag$ === vnode2.$tag$) {
|
624 | if (vnode1.$tag$ === 'slot') {
|
625 | return vnode1.$name$ === vnode2.$name$;
|
626 | }
|
627 | return true;
|
628 | }
|
629 | return false;
|
630 | };
|
631 | var referenceNode = function (node) {
|
632 |
|
633 |
|
634 |
|
635 |
|
636 | return (node && node['s-ol']) || node;
|
637 | };
|
638 | var parentReferenceNode = function (node) { return (node['s-ol'] ? node['s-ol'] : node).parentNode; };
|
639 | var patch = function (oldVNode, newVNode) {
|
640 | var elm = (newVNode.$elm$ = oldVNode.$elm$);
|
641 | var oldChildren = oldVNode.$children$;
|
642 | var newChildren = newVNode.$children$;
|
643 | var tag = newVNode.$tag$;
|
644 | var text = newVNode.$text$;
|
645 | var defaultHolder;
|
646 | if (text === null) {
|
647 |
|
648 | {
|
649 | if (tag === 'slot')
|
650 | ;
|
651 | else {
|
652 |
|
653 |
|
654 |
|
655 | updateElement(oldVNode, newVNode, isSvgMode);
|
656 | }
|
657 | }
|
658 | if (oldChildren !== null && newChildren !== null) {
|
659 |
|
660 | updateChildren(elm, oldChildren, newVNode, newChildren);
|
661 | }
|
662 | else if (newChildren !== null) {
|
663 |
|
664 | if (oldVNode.$text$ !== null) {
|
665 |
|
666 | elm.textContent = '';
|
667 | }
|
668 |
|
669 | addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
|
670 | }
|
671 | else if (oldChildren !== null) {
|
672 |
|
673 | removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
674 | }
|
675 | }
|
676 | else if ((defaultHolder = elm['s-cr'])) {
|
677 |
|
678 | defaultHolder.parentNode.textContent = text;
|
679 | }
|
680 | else if (oldVNode.$text$ !== text) {
|
681 |
|
682 |
|
683 | elm.data = text;
|
684 | }
|
685 | };
|
686 | var updateFallbackSlotVisibility = function (elm) {
|
687 |
|
688 | var childNodes = elm.childNodes;
|
689 | var childNode;
|
690 | var i;
|
691 | var ilen;
|
692 | var j;
|
693 | var slotNameAttr;
|
694 | var nodeType;
|
695 | for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
696 | childNode = childNodes[i];
|
697 | if (childNode.nodeType === 1 ) {
|
698 | if (childNode['s-sr']) {
|
699 |
|
700 |
|
701 | slotNameAttr = childNode['s-sn'];
|
702 |
|
703 |
|
704 | childNode.hidden = false;
|
705 | for (j = 0; j < ilen; j++) {
|
706 | if (childNodes[j]['s-hn'] !== childNode['s-hn']) {
|
707 |
|
708 | nodeType = childNodes[j].nodeType;
|
709 | if (slotNameAttr !== '') {
|
710 |
|
711 | if (nodeType === 1 && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
712 | childNode.hidden = true;
|
713 | break;
|
714 | }
|
715 | }
|
716 | else {
|
717 |
|
718 |
|
719 |
|
720 | if (nodeType === 1 || (nodeType === 3 && childNodes[j].textContent.trim() !== '')) {
|
721 | childNode.hidden = true;
|
722 | break;
|
723 | }
|
724 | }
|
725 | }
|
726 | }
|
727 | }
|
728 |
|
729 | updateFallbackSlotVisibility(childNode);
|
730 | }
|
731 | }
|
732 | };
|
733 | var relocateNodes = [];
|
734 | var relocateSlotContent = function (elm) {
|
735 |
|
736 | var childNode;
|
737 | var node;
|
738 | var hostContentNodes;
|
739 | var slotNameAttr;
|
740 | var relocateNodeData;
|
741 | var j;
|
742 | var i = 0;
|
743 | var childNodes = elm.childNodes;
|
744 | var ilen = childNodes.length;
|
745 | for (; i < ilen; i++) {
|
746 | childNode = childNodes[i];
|
747 | if (childNode['s-sr'] && (node = childNode['s-cr'])) {
|
748 |
|
749 |
|
750 | hostContentNodes = node.parentNode.childNodes;
|
751 | slotNameAttr = childNode['s-sn'];
|
752 | for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
753 | node = hostContentNodes[j];
|
754 | if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
|
755 |
|
756 |
|
757 |
|
758 | if (isNodeLocatedInSlot(node, slotNameAttr)) {
|
759 |
|
760 | relocateNodeData = relocateNodes.find(function (r) { return r.$nodeToRelocate$ === node; });
|
761 |
|
762 |
|
763 |
|
764 | checkSlotFallbackVisibility = true;
|
765 | node['s-sn'] = node['s-sn'] || slotNameAttr;
|
766 | if (relocateNodeData) {
|
767 |
|
768 |
|
769 | relocateNodeData.$slotRefNode$ = childNode;
|
770 | }
|
771 | else {
|
772 |
|
773 | relocateNodes.push({
|
774 | $slotRefNode$: childNode,
|
775 | $nodeToRelocate$: node,
|
776 | });
|
777 | }
|
778 | if (node['s-sr']) {
|
779 | relocateNodes.map(function (relocateNode) {
|
780 | if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
|
781 | relocateNodeData = relocateNodes.find(function (r) { return r.$nodeToRelocate$ === node; });
|
782 | if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
783 | relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
784 | }
|
785 | }
|
786 | });
|
787 | }
|
788 | }
|
789 | else if (!relocateNodes.some(function (r) { return r.$nodeToRelocate$ === node; })) {
|
790 |
|
791 |
|
792 | relocateNodes.push({
|
793 | $nodeToRelocate$: node,
|
794 | });
|
795 | }
|
796 | }
|
797 | }
|
798 | }
|
799 | if (childNode.nodeType === 1 ) {
|
800 | relocateSlotContent(childNode);
|
801 | }
|
802 | }
|
803 | };
|
804 | var isNodeLocatedInSlot = function (nodeToRelocate, slotNameAttr) {
|
805 | if (nodeToRelocate.nodeType === 1 ) {
|
806 | if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
807 | return true;
|
808 | }
|
809 | if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
|
810 | return true;
|
811 | }
|
812 | return false;
|
813 | }
|
814 | if (nodeToRelocate['s-sn'] === slotNameAttr) {
|
815 | return true;
|
816 | }
|
817 | return slotNameAttr === '';
|
818 | };
|
819 | var renderVdom = function (hostRef, renderFnResults) {
|
820 | var hostElm = hostRef.$hostElement$;
|
821 | var cmpMeta = hostRef.$cmpMeta$;
|
822 | var oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
823 | var rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
824 | hostTagName = hostElm.tagName;
|
825 | if (cmpMeta.$attrsToReflect$) {
|
826 | rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
827 | cmpMeta.$attrsToReflect$.map(function (_a) {
|
828 | var propName = _a[0], attribute = _a[1];
|
829 | return (rootVnode.$attrs$[attribute] = hostElm[propName]);
|
830 | });
|
831 | }
|
832 | rootVnode.$tag$ = null;
|
833 | rootVnode.$flags$ |= 4 ;
|
834 | hostRef.$vnode$ = rootVnode;
|
835 | rootVnode.$elm$ = oldVNode.$elm$ = (hostElm);
|
836 | {
|
837 | contentRef = hostElm['s-cr'];
|
838 | useNativeShadowDom = (cmpMeta.$flags$ & 1 ) !== 0;
|
839 |
|
840 | checkSlotFallbackVisibility = false;
|
841 | }
|
842 |
|
843 | patch(oldVNode, rootVnode);
|
844 | {
|
845 |
|
846 |
|
847 | plt.$flags$ |= 1 ;
|
848 | if (checkSlotRelocate) {
|
849 | relocateSlotContent(rootVnode.$elm$);
|
850 | var relocateData = void 0;
|
851 | var nodeToRelocate = void 0;
|
852 | var orgLocationNode = void 0;
|
853 | var parentNodeRef = void 0;
|
854 | var insertBeforeNode = void 0;
|
855 | var refNode = void 0;
|
856 | var i = 0;
|
857 | for (; i < relocateNodes.length; i++) {
|
858 | relocateData = relocateNodes[i];
|
859 | nodeToRelocate = relocateData.$nodeToRelocate$;
|
860 | if (!nodeToRelocate['s-ol']) {
|
861 |
|
862 |
|
863 | orgLocationNode = doc.createTextNode('');
|
864 | orgLocationNode['s-nr'] = nodeToRelocate;
|
865 | nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
|
866 | }
|
867 | }
|
868 | for (i = 0; i < relocateNodes.length; i++) {
|
869 | relocateData = relocateNodes[i];
|
870 | nodeToRelocate = relocateData.$nodeToRelocate$;
|
871 | if (relocateData.$slotRefNode$) {
|
872 |
|
873 |
|
874 | parentNodeRef = relocateData.$slotRefNode$.parentNode;
|
875 | insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
|
876 | orgLocationNode = nodeToRelocate['s-ol'];
|
877 | while ((orgLocationNode = orgLocationNode.previousSibling)) {
|
878 | refNode = orgLocationNode['s-nr'];
|
879 | if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
|
880 | refNode = refNode.nextSibling;
|
881 | if (!refNode || !refNode['s-nr']) {
|
882 | insertBeforeNode = refNode;
|
883 | break;
|
884 | }
|
885 | }
|
886 | }
|
887 | if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) || nodeToRelocate.nextSibling !== insertBeforeNode) {
|
888 |
|
889 |
|
890 |
|
891 | if (nodeToRelocate !== insertBeforeNode) {
|
892 | if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
|
893 |
|
894 | nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
|
895 | }
|
896 |
|
897 | parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
|
898 | }
|
899 | }
|
900 | }
|
901 | else {
|
902 |
|
903 | if (nodeToRelocate.nodeType === 1 ) {
|
904 | nodeToRelocate.hidden = true;
|
905 | }
|
906 | }
|
907 | }
|
908 | }
|
909 | if (checkSlotFallbackVisibility) {
|
910 | updateFallbackSlotVisibility(rootVnode.$elm$);
|
911 | }
|
912 |
|
913 |
|
914 | plt.$flags$ &= ~1 ;
|
915 |
|
916 | relocateNodes.length = 0;
|
917 | }
|
918 | };
|
919 | var emitEvent = function (elm, name, opts) {
|
920 | var ev = new (CustomEvent)(name, opts);
|
921 | elm.dispatchEvent(ev);
|
922 | return ev;
|
923 | };
|
924 | var attachToAncestor = function (hostRef, ancestorComponent) {
|
925 | if (ancestorComponent && !hostRef.$onRenderResolve$) {
|
926 | ancestorComponent['s-p'].push(new Promise(function (r) { return (hostRef.$onRenderResolve$ = r); }));
|
927 | }
|
928 | };
|
929 | var scheduleUpdate = function (hostRef, isInitialLoad) {
|
930 | {
|
931 | hostRef.$flags$ |= 16 ;
|
932 | }
|
933 | if (hostRef.$flags$ & 4 ) {
|
934 | hostRef.$flags$ |= 512 ;
|
935 | return;
|
936 | }
|
937 | var endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
938 | var ancestorComponent = hostRef.$ancestorComponent$;
|
939 | var instance = hostRef.$lazyInstance$;
|
940 | var update = function () { return updateComponent(hostRef, instance, isInitialLoad); };
|
941 | attachToAncestor(hostRef, ancestorComponent);
|
942 | var promise;
|
943 | endSchedule();
|
944 |
|
945 |
|
946 |
|
947 | return then(promise, function () { return writeTask(update); });
|
948 | };
|
949 | var updateComponent = function (hostRef, instance, isInitialLoad) {
|
950 |
|
951 | var elm = hostRef.$hostElement$;
|
952 | var endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
|
953 | var rc = elm['s-rc'];
|
954 | if (isInitialLoad) {
|
955 |
|
956 | attachStyles(hostRef);
|
957 | }
|
958 | var endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
|
959 | {
|
960 | {
|
961 |
|
962 |
|
963 |
|
964 | renderVdom(hostRef, callRender(instance));
|
965 | }
|
966 | }
|
967 | if (plt.$cssShim$) {
|
968 | plt.$cssShim$.updateHost(elm);
|
969 | }
|
970 | {
|
971 | hostRef.$flags$ &= ~16 ;
|
972 | }
|
973 | {
|
974 | hostRef.$flags$ |= 2 ;
|
975 | }
|
976 | if (rc) {
|
977 |
|
978 |
|
979 |
|
980 | rc.map(function (cb) { return cb(); });
|
981 | elm['s-rc'] = undefined;
|
982 | }
|
983 | endRender();
|
984 | endUpdate();
|
985 | {
|
986 | var childrenPromises = elm['s-p'];
|
987 | var postUpdate = function () { return postUpdateComponent(hostRef); };
|
988 | if (childrenPromises.length === 0) {
|
989 | postUpdate();
|
990 | }
|
991 | else {
|
992 | Promise.all(childrenPromises).then(postUpdate);
|
993 | hostRef.$flags$ |= 4 ;
|
994 | childrenPromises.length = 0;
|
995 | }
|
996 | }
|
997 | };
|
998 | var callRender = function (instance) {
|
999 | try {
|
1000 | instance = instance.render();
|
1001 | }
|
1002 | catch (e) {
|
1003 | consoleError(e);
|
1004 | }
|
1005 | return instance;
|
1006 | };
|
1007 | var postUpdateComponent = function (hostRef) {
|
1008 | var tagName = hostRef.$cmpMeta$.$tagName$;
|
1009 | var elm = hostRef.$hostElement$;
|
1010 | var endPostUpdate = createTime('postUpdate', tagName);
|
1011 | var ancestorComponent = hostRef.$ancestorComponent$;
|
1012 | if (!(hostRef.$flags$ & 64 )) {
|
1013 | hostRef.$flags$ |= 64 ;
|
1014 | {
|
1015 |
|
1016 | addHydratedFlag(elm);
|
1017 | }
|
1018 | endPostUpdate();
|
1019 | {
|
1020 | hostRef.$onReadyResolve$(elm);
|
1021 | if (!ancestorComponent) {
|
1022 | appDidLoad();
|
1023 | }
|
1024 | }
|
1025 | }
|
1026 | else {
|
1027 | endPostUpdate();
|
1028 | }
|
1029 |
|
1030 |
|
1031 | {
|
1032 | if (hostRef.$onRenderResolve$) {
|
1033 | hostRef.$onRenderResolve$();
|
1034 | hostRef.$onRenderResolve$ = undefined;
|
1035 | }
|
1036 | if (hostRef.$flags$ & 512 ) {
|
1037 | nextTick(function () { return scheduleUpdate(hostRef, false); });
|
1038 | }
|
1039 | hostRef.$flags$ &= ~(4 | 512 );
|
1040 | }
|
1041 |
|
1042 |
|
1043 |
|
1044 | };
|
1045 | var forceUpdate = function (ref) {
|
1046 | {
|
1047 | var hostRef = getHostRef(ref);
|
1048 | var isConnected = hostRef.$hostElement$.isConnected;
|
1049 | if (isConnected && (hostRef.$flags$ & (2 | 16 )) === 2 ) {
|
1050 | scheduleUpdate(hostRef, false);
|
1051 | }
|
1052 |
|
1053 | return isConnected;
|
1054 | }
|
1055 | };
|
1056 | var appDidLoad = function (who) {
|
1057 |
|
1058 |
|
1059 | {
|
1060 | addHydratedFlag(doc.documentElement);
|
1061 | }
|
1062 | {
|
1063 | plt.$flags$ |= 2 ;
|
1064 | }
|
1065 | nextTick(function () { return emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }); });
|
1066 | };
|
1067 | var then = function (promise, thenFn) {
|
1068 | return promise && promise.then ? promise.then(thenFn) : thenFn();
|
1069 | };
|
1070 | var addHydratedFlag = function (elm) { return (elm.classList.add('hydrated')); };
|
1071 | var initializeClientHydrate = function (hostElm, tagName, hostId, hostRef) {
|
1072 | var endHydrate = createTime('hydrateClient', tagName);
|
1073 | var shadowRoot = hostElm.shadowRoot;
|
1074 | var childRenderNodes = [];
|
1075 | var slotNodes = [];
|
1076 | var shadowRootNodes = null;
|
1077 | var vnode = (hostRef.$vnode$ = newVNode(tagName, null));
|
1078 | if (!plt.$orgLocNodes$) {
|
1079 | initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
|
1080 | }
|
1081 | hostElm[HYDRATE_ID] = hostId;
|
1082 | hostElm.removeAttribute(HYDRATE_ID);
|
1083 | clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
|
1084 | childRenderNodes.map(function (c) {
|
1085 | var orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
|
1086 | var orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
1087 | var node = c.$elm$;
|
1088 | if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {
|
1089 | orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
1090 | }
|
1091 | if (!shadowRoot) {
|
1092 | node['s-hn'] = tagName;
|
1093 | if (orgLocationNode) {
|
1094 | node['s-ol'] = orgLocationNode;
|
1095 | node['s-ol']['s-nr'] = node;
|
1096 | }
|
1097 | }
|
1098 | plt.$orgLocNodes$.delete(orgLocationId);
|
1099 | });
|
1100 | endHydrate();
|
1101 | };
|
1102 | var clientHydrate = function (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) {
|
1103 | var childNodeType;
|
1104 | var childIdSplt;
|
1105 | var childVNode;
|
1106 | var i;
|
1107 | if (node.nodeType === 1 ) {
|
1108 | childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
1109 | if (childNodeType) {
|
1110 |
|
1111 |
|
1112 | childIdSplt = childNodeType.split('.');
|
1113 | if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {
|
1114 | childVNode = {
|
1115 | $flags$: 0,
|
1116 | $hostId$: childIdSplt[0],
|
1117 | $nodeId$: childIdSplt[1],
|
1118 | $depth$: childIdSplt[2],
|
1119 | $index$: childIdSplt[3],
|
1120 | $tag$: node.tagName.toLowerCase(),
|
1121 | $elm$: node,
|
1122 | $attrs$: null,
|
1123 | $children$: null,
|
1124 | $key$: null,
|
1125 | $name$: null,
|
1126 | $text$: null,
|
1127 | };
|
1128 | childRenderNodes.push(childVNode);
|
1129 | node.removeAttribute(HYDRATE_CHILD_ID);
|
1130 |
|
1131 |
|
1132 | if (!parentVNode.$children$) {
|
1133 | parentVNode.$children$ = [];
|
1134 | }
|
1135 |
|
1136 | parentVNode.$children$[childVNode.$index$] = childVNode;
|
1137 |
|
1138 | parentVNode = childVNode;
|
1139 | if (shadowRootNodes && childVNode.$depth$ === '0') {
|
1140 | shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
1141 | }
|
1142 | }
|
1143 | }
|
1144 |
|
1145 | for (i = node.childNodes.length - 1; i >= 0; i--) {
|
1146 | clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i], hostId);
|
1147 | }
|
1148 | if (node.shadowRoot) {
|
1149 |
|
1150 | for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {
|
1151 | clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId);
|
1152 | }
|
1153 | }
|
1154 | }
|
1155 | else if (node.nodeType === 8 ) {
|
1156 |
|
1157 | childIdSplt = node.nodeValue.split('.');
|
1158 | if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {
|
1159 |
|
1160 | childNodeType = childIdSplt[0];
|
1161 | childVNode = {
|
1162 | $flags$: 0,
|
1163 | $hostId$: childIdSplt[1],
|
1164 | $nodeId$: childIdSplt[2],
|
1165 | $depth$: childIdSplt[3],
|
1166 | $index$: childIdSplt[4],
|
1167 | $elm$: node,
|
1168 | $attrs$: null,
|
1169 | $children$: null,
|
1170 | $key$: null,
|
1171 | $name$: null,
|
1172 | $tag$: null,
|
1173 | $text$: null,
|
1174 | };
|
1175 | if (childNodeType === TEXT_NODE_ID) {
|
1176 | childVNode.$elm$ = node.nextSibling;
|
1177 | if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 ) {
|
1178 | childVNode.$text$ = childVNode.$elm$.textContent;
|
1179 | childRenderNodes.push(childVNode);
|
1180 |
|
1181 | node.remove();
|
1182 | if (!parentVNode.$children$) {
|
1183 | parentVNode.$children$ = [];
|
1184 | }
|
1185 | parentVNode.$children$[childVNode.$index$] = childVNode;
|
1186 | if (shadowRootNodes && childVNode.$depth$ === '0') {
|
1187 | shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
1188 | }
|
1189 | }
|
1190 | }
|
1191 | else if (childVNode.$hostId$ === hostId) {
|
1192 |
|
1193 | if (childNodeType === SLOT_NODE_ID) {
|
1194 |
|
1195 | childVNode.$tag$ = 'slot';
|
1196 | if (childIdSplt[5]) {
|
1197 | node['s-sn'] = childVNode.$name$ = childIdSplt[5];
|
1198 | }
|
1199 | else {
|
1200 | node['s-sn'] = '';
|
1201 | }
|
1202 | node['s-sr'] = true;
|
1203 | slotNodes.push(childVNode);
|
1204 | if (!parentVNode.$children$) {
|
1205 | parentVNode.$children$ = [];
|
1206 | }
|
1207 | parentVNode.$children$[childVNode.$index$] = childVNode;
|
1208 | }
|
1209 | else if (childNodeType === CONTENT_REF_ID) {
|
1210 |
|
1211 | {
|
1212 | hostElm['s-cr'] = node;
|
1213 | node['s-cn'] = true;
|
1214 | }
|
1215 | }
|
1216 | }
|
1217 | }
|
1218 | }
|
1219 | else if (parentVNode && parentVNode.$tag$ === 'style') {
|
1220 | var vnode = newVNode(null, node.textContent);
|
1221 | vnode.$elm$ = node;
|
1222 | vnode.$index$ = '0';
|
1223 | parentVNode.$children$ = [vnode];
|
1224 | }
|
1225 | };
|
1226 | var initializeDocumentHydrate = function (node, orgLocNodes) {
|
1227 | if (node.nodeType === 1 ) {
|
1228 | var i = 0;
|
1229 | for (; i < node.childNodes.length; i++) {
|
1230 | initializeDocumentHydrate(node.childNodes[i], orgLocNodes);
|
1231 | }
|
1232 | if (node.shadowRoot) {
|
1233 | for (i = 0; i < node.shadowRoot.childNodes.length; i++) {
|
1234 | initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);
|
1235 | }
|
1236 | }
|
1237 | }
|
1238 | else if (node.nodeType === 8 ) {
|
1239 | var childIdSplt = node.nodeValue.split('.');
|
1240 | if (childIdSplt[0] === ORG_LOCATION_ID) {
|
1241 | orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);
|
1242 | node.nodeValue = '';
|
1243 |
|
1244 |
|
1245 | node['s-en'] = childIdSplt[3];
|
1246 | }
|
1247 | }
|
1248 | };
|
1249 | var parsePropertyValue = function (propValue, propType) {
|
1250 |
|
1251 | if (propValue != null && !isComplexType(propValue)) {
|
1252 | if (propType & 4 ) {
|
1253 |
|
1254 |
|
1255 | return propValue === 'false' ? false : propValue === '' || !!propValue;
|
1256 | }
|
1257 | if (propType & 2 ) {
|
1258 |
|
1259 | return parseFloat(propValue);
|
1260 | }
|
1261 | if (propType & 1 ) {
|
1262 |
|
1263 |
|
1264 | return String(propValue);
|
1265 | }
|
1266 |
|
1267 | return propValue;
|
1268 | }
|
1269 |
|
1270 |
|
1271 | return propValue;
|
1272 | };
|
1273 | var getValue = function (ref, propName) { return getHostRef(ref).$instanceValues$.get(propName); };
|
1274 | var setValue = function (ref, propName, newVal, cmpMeta) {
|
1275 |
|
1276 | var hostRef = getHostRef(ref);
|
1277 | var oldVal = hostRef.$instanceValues$.get(propName);
|
1278 | var flags = hostRef.$flags$;
|
1279 | var instance = hostRef.$lazyInstance$;
|
1280 | newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
1281 | if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && newVal !== oldVal) {
|
1282 |
|
1283 |
|
1284 | hostRef.$instanceValues$.set(propName, newVal);
|
1285 | if (instance) {
|
1286 | if ((flags & (2 | 16 )) === 2 ) {
|
1287 |
|
1288 |
|
1289 |
|
1290 |
|
1291 | scheduleUpdate(hostRef, false);
|
1292 | }
|
1293 | }
|
1294 | }
|
1295 | };
|
1296 | var proxyComponent = function (Cstr, cmpMeta, flags) {
|
1297 | if (cmpMeta.$members$) {
|
1298 |
|
1299 | var members = Object.entries(cmpMeta.$members$);
|
1300 | var prototype_1 = Cstr.prototype;
|
1301 | members.map(function (_a) {
|
1302 | var memberName = _a[0], memberFlags = _a[1][0];
|
1303 | if ((memberFlags & 31 || ((flags & 2 ) && memberFlags & 32 ))) {
|
1304 |
|
1305 | Object.defineProperty(prototype_1, memberName, {
|
1306 | get: function () {
|
1307 |
|
1308 | return getValue(this, memberName);
|
1309 | },
|
1310 | set: function (newValue) {
|
1311 |
|
1312 | setValue(this, memberName, newValue, cmpMeta);
|
1313 | },
|
1314 | configurable: true,
|
1315 | enumerable: true,
|
1316 | });
|
1317 | }
|
1318 | });
|
1319 | if ((flags & 1 )) {
|
1320 | var attrNameToPropName_1 = new Map();
|
1321 | prototype_1.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
1322 | var _this = this;
|
1323 | plt.jmp(function () {
|
1324 | var propName = attrNameToPropName_1.get(attrName);
|
1325 | _this[propName] = newValue === null && typeof _this[propName] === 'boolean' ? false : newValue;
|
1326 | });
|
1327 | };
|
1328 |
|
1329 |
|
1330 | Cstr.observedAttributes = members
|
1331 | .filter(function (_a) {
|
1332 | var _ = _a[0], m = _a[1];
|
1333 | return m[0] & 15;
|
1334 | } )
|
1335 | .map(function (_a) {
|
1336 | var propName = _a[0], m = _a[1];
|
1337 | var attrName = m[1] || propName;
|
1338 | attrNameToPropName_1.set(attrName, propName);
|
1339 | if (m[0] & 512 ) {
|
1340 | cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
1341 | }
|
1342 | return attrName;
|
1343 | });
|
1344 | }
|
1345 | }
|
1346 | return Cstr;
|
1347 | };
|
1348 | var initializeComponent = function (elm, hostRef, cmpMeta, hmrVersionId, Cstr) { return __awaiter(void 0, void 0, void 0, function () {
|
1349 | var endLoad, endNewInstance, scopeId, endRegisterStyles, style, ancestorComponent, schedule;
|
1350 | return __generator(this, function (_a) {
|
1351 | switch (_a.label) {
|
1352 | case 0:
|
1353 | if (!((hostRef.$flags$ & 32 ) === 0)) return [3 , 3];
|
1354 |
|
1355 | hostRef.$flags$ |= 32 ;
|
1356 |
|
1357 |
|
1358 |
|
1359 | Cstr = loadModule(cmpMeta);
|
1360 | if (!Cstr.then) return [3 , 2];
|
1361 | endLoad = uniqueTime();
|
1362 | return [4 , Cstr];
|
1363 | case 1:
|
1364 | Cstr = _a.sent();
|
1365 | endLoad();
|
1366 | _a.label = 2;
|
1367 | case 2:
|
1368 | if (!Cstr.isProxied) {
|
1369 | proxyComponent(Cstr, cmpMeta, 2 );
|
1370 | Cstr.isProxied = true;
|
1371 | }
|
1372 | endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
1373 |
|
1374 |
|
1375 |
|
1376 | {
|
1377 | hostRef.$flags$ |= 8 ;
|
1378 | }
|
1379 |
|
1380 |
|
1381 |
|
1382 |
|
1383 | try {
|
1384 | new Cstr(hostRef);
|
1385 | }
|
1386 | catch (e) {
|
1387 | consoleError(e);
|
1388 | }
|
1389 | {
|
1390 | hostRef.$flags$ &= ~8 ;
|
1391 | }
|
1392 | endNewInstance();
|
1393 | scopeId = getScopeId(cmpMeta.$tagName$);
|
1394 | if (!styles.has(scopeId) && Cstr.style) {
|
1395 | endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
1396 | style = Cstr.style;
|
1397 | registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 ));
|
1398 | endRegisterStyles();
|
1399 | }
|
1400 | _a.label = 3;
|
1401 | case 3:
|
1402 | ancestorComponent = hostRef.$ancestorComponent$;
|
1403 | schedule = function () { return scheduleUpdate(hostRef, true); };
|
1404 | if (ancestorComponent && ancestorComponent['s-rc']) {
|
1405 |
|
1406 |
|
1407 |
|
1408 |
|
1409 |
|
1410 |
|
1411 | ancestorComponent['s-rc'].push(schedule);
|
1412 | }
|
1413 | else {
|
1414 | schedule();
|
1415 | }
|
1416 | return [2 ];
|
1417 | }
|
1418 | });
|
1419 | }); };
|
1420 | var connectedCallback = function (elm) {
|
1421 | if ((plt.$flags$ & 1 ) === 0) {
|
1422 | var hostRef_1 = getHostRef(elm);
|
1423 | var cmpMeta_1 = hostRef_1.$cmpMeta$;
|
1424 | var endConnected = createTime('connectedCallback', cmpMeta_1.$tagName$);
|
1425 | if (!(hostRef_1.$flags$ & 1 )) {
|
1426 |
|
1427 | hostRef_1.$flags$ |= 1 ;
|
1428 | var hostId = void 0;
|
1429 | {
|
1430 | hostId = elm.getAttribute(HYDRATE_ID);
|
1431 | if (hostId) {
|
1432 | initializeClientHydrate(elm, cmpMeta_1.$tagName$, hostId, hostRef_1);
|
1433 | }
|
1434 | }
|
1435 | if (!hostId) {
|
1436 |
|
1437 |
|
1438 |
|
1439 |
|
1440 | if ((cmpMeta_1.$flags$ & (4 | 8 ))) {
|
1441 | setContentReference(elm);
|
1442 | }
|
1443 | }
|
1444 | {
|
1445 |
|
1446 |
|
1447 | var ancestorComponent = elm;
|
1448 | while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
|
1449 |
|
1450 |
|
1451 | if ((ancestorComponent.nodeType === 1 && ancestorComponent.hasAttribute('s-id')) || ancestorComponent['s-p']) {
|
1452 |
|
1453 |
|
1454 | attachToAncestor(hostRef_1, (hostRef_1.$ancestorComponent$ = ancestorComponent));
|
1455 | break;
|
1456 | }
|
1457 | }
|
1458 | }
|
1459 |
|
1460 |
|
1461 | if (cmpMeta_1.$members$) {
|
1462 | Object.entries(cmpMeta_1.$members$).map(function (_a) {
|
1463 | var memberName = _a[0], memberFlags = _a[1][0];
|
1464 | if (memberFlags & 31 && elm.hasOwnProperty(memberName)) {
|
1465 | var value = elm[memberName];
|
1466 | delete elm[memberName];
|
1467 | elm[memberName] = value;
|
1468 | }
|
1469 | });
|
1470 | }
|
1471 | {
|
1472 |
|
1473 |
|
1474 |
|
1475 |
|
1476 | nextTick(function () { return initializeComponent(elm, hostRef_1, cmpMeta_1); });
|
1477 | }
|
1478 | }
|
1479 | endConnected();
|
1480 | }
|
1481 | };
|
1482 | var setContentReference = function (elm) {
|
1483 |
|
1484 |
|
1485 |
|
1486 |
|
1487 |
|
1488 |
|
1489 | var contentRefElm = (elm['s-cr'] = doc.createComment(''));
|
1490 | contentRefElm['s-cn'] = true;
|
1491 | elm.insertBefore(contentRefElm, elm.firstChild);
|
1492 | };
|
1493 | var disconnectedCallback = function (elm) {
|
1494 | if ((plt.$flags$ & 1 ) === 0) {
|
1495 | var hostRef = getHostRef(elm);
|
1496 |
|
1497 | if (plt.$cssShim$) {
|
1498 | plt.$cssShim$.removeHost(elm);
|
1499 | }
|
1500 | }
|
1501 | };
|
1502 | var bootstrapLazy = function (lazyBundles, options) {
|
1503 | if (options === void 0) { options = {}; }
|
1504 | var endBootstrap = createTime();
|
1505 | var cmpTags = [];
|
1506 | var exclude = options.exclude || [];
|
1507 | var customElements = win.customElements;
|
1508 | var head = doc.head;
|
1509 | var metaCharset = head.querySelector('meta[charset]');
|
1510 | var visibilityStyle = doc.createElement('style');
|
1511 | var deferredConnectedCallbacks = [];
|
1512 | var appLoadFallback;
|
1513 | var isBootstrapping = true;
|
1514 | Object.assign(plt, options);
|
1515 | plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
1516 | {
|
1517 | if (options.syncQueue) {
|
1518 | plt.$flags$ |= 4 ;
|
1519 | }
|
1520 | }
|
1521 | {
|
1522 |
|
1523 |
|
1524 | plt.$flags$ |= 2 ;
|
1525 | }
|
1526 | lazyBundles.map(function (lazyBundle) { return lazyBundle[1].map(function (compactMeta) {
|
1527 | var cmpMeta = {
|
1528 | $flags$: compactMeta[0],
|
1529 | $tagName$: compactMeta[1],
|
1530 | $members$: compactMeta[2],
|
1531 | $listeners$: compactMeta[3],
|
1532 | };
|
1533 | {
|
1534 | cmpMeta.$members$ = compactMeta[2];
|
1535 | }
|
1536 | {
|
1537 | cmpMeta.$attrsToReflect$ = [];
|
1538 | }
|
1539 | var tagName = cmpMeta.$tagName$;
|
1540 | var HostElement = (function (_super) {
|
1541 | __extends(HostElement, _super);
|
1542 |
|
1543 | function HostElement(self) {
|
1544 | var _this =
|
1545 |
|
1546 | _super.call(this, self) || this;
|
1547 | self = _this;
|
1548 | registerHost(self, cmpMeta);
|
1549 | return _this;
|
1550 | }
|
1551 | HostElement.prototype.connectedCallback = function () {
|
1552 | var _this = this;
|
1553 | if (appLoadFallback) {
|
1554 | clearTimeout(appLoadFallback);
|
1555 | appLoadFallback = null;
|
1556 | }
|
1557 | if (isBootstrapping) {
|
1558 |
|
1559 | deferredConnectedCallbacks.push(this);
|
1560 | }
|
1561 | else {
|
1562 | plt.jmp(function () { return connectedCallback(_this); });
|
1563 | }
|
1564 | };
|
1565 | HostElement.prototype.disconnectedCallback = function () {
|
1566 | var _this = this;
|
1567 | plt.jmp(function () { return disconnectedCallback(_this); });
|
1568 | };
|
1569 | HostElement.prototype.forceUpdate = function () {
|
1570 | forceUpdate(this);
|
1571 | };
|
1572 | HostElement.prototype.componentOnReady = function () {
|
1573 | return getHostRef(this).$onReadyPromise$;
|
1574 | };
|
1575 | return HostElement;
|
1576 | }(HTMLElement));
|
1577 | cmpMeta.$lazyBundleIds$ = lazyBundle[0];
|
1578 | if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
1579 | cmpTags.push(tagName);
|
1580 | customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 ));
|
1581 | }
|
1582 | }); });
|
1583 | {
|
1584 | visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
1585 | visibilityStyle.setAttribute('data-styles', '');
|
1586 | head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
1587 | }
|
1588 |
|
1589 | isBootstrapping = false;
|
1590 | if (deferredConnectedCallbacks.length) {
|
1591 | deferredConnectedCallbacks.map(function (host) { return host.connectedCallback(); });
|
1592 | }
|
1593 | else {
|
1594 | {
|
1595 | plt.jmp(function () { return (appLoadFallback = setTimeout(appDidLoad, 30)); });
|
1596 | }
|
1597 | }
|
1598 |
|
1599 | endBootstrap();
|
1600 | };
|
1601 | var hostRefs = new WeakMap();
|
1602 | var getHostRef = function (ref) { return hostRefs.get(ref); };
|
1603 | var registerInstance = function (lazyInstance, hostRef) { return hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef); };
|
1604 | var registerHost = function (elm, cmpMeta) {
|
1605 | var hostRef = {
|
1606 | $flags$: 0,
|
1607 | $hostElement$: elm,
|
1608 | $cmpMeta$: cmpMeta,
|
1609 | $instanceValues$: new Map(),
|
1610 | };
|
1611 | {
|
1612 | hostRef.$onReadyPromise$ = new Promise(function (r) { return (hostRef.$onReadyResolve$ = r); });
|
1613 | elm['s-p'] = [];
|
1614 | elm['s-rc'] = [];
|
1615 | }
|
1616 | return hostRefs.set(elm, hostRef);
|
1617 | };
|
1618 | var isMemberInElement = function (elm, memberName) { return memberName in elm; };
|
1619 | var consoleError = function (e) { return console.error(e); };
|
1620 | var cmpModules = new Map();
|
1621 | var loadModule = function (cmpMeta, hostRef, hmrVersionId) {
|
1622 |
|
1623 | var exportName = cmpMeta.$tagName$.replace(/-/g, '_');
|
1624 | var bundleId = (cmpMeta.$lazyBundleIds$);
|
1625 | var module = cmpModules.get(bundleId);
|
1626 | if (module) {
|
1627 | return module[exportName];
|
1628 | }
|
1629 | return import(
|
1630 |
|
1631 |
|
1632 |
|
1633 | "./" + bundleId + ".entry.js" + '').then(function (importedModule) {
|
1634 | {
|
1635 | cmpModules.set(bundleId, importedModule);
|
1636 | }
|
1637 | return importedModule[exportName];
|
1638 | }, consoleError);
|
1639 | };
|
1640 | var styles = new Map();
|
1641 | var queueDomReads = [];
|
1642 | var queueDomWrites = [];
|
1643 | var queueDomWritesLow = [];
|
1644 | var queueTask = function (queue, write) { return function (cb) {
|
1645 | queue.push(cb);
|
1646 | if (!queuePending) {
|
1647 | queuePending = true;
|
1648 | if (write && plt.$flags$ & 4 ) {
|
1649 | nextTick(flush);
|
1650 | }
|
1651 | else {
|
1652 | plt.raf(flush);
|
1653 | }
|
1654 | }
|
1655 | }; };
|
1656 | var consume = function (queue) {
|
1657 | for (var i = 0; i < queue.length; i++) {
|
1658 | try {
|
1659 | queue[i](performance.now());
|
1660 | }
|
1661 | catch (e) {
|
1662 | consoleError(e);
|
1663 | }
|
1664 | }
|
1665 | queue.length = 0;
|
1666 | };
|
1667 | var consumeTimeout = function (queue, timeout) {
|
1668 | var i = 0;
|
1669 | var ts = 0;
|
1670 | while (i < queue.length && (ts = performance.now()) < timeout) {
|
1671 | try {
|
1672 | queue[i++](ts);
|
1673 | }
|
1674 | catch (e) {
|
1675 | consoleError(e);
|
1676 | }
|
1677 | }
|
1678 | if (i === queue.length) {
|
1679 | queue.length = 0;
|
1680 | }
|
1681 | else if (i !== 0) {
|
1682 | queue.splice(0, i);
|
1683 | }
|
1684 | };
|
1685 | var flush = function () {
|
1686 | {
|
1687 | queueCongestion++;
|
1688 | }
|
1689 |
|
1690 |
|
1691 |
|
1692 | consume(queueDomReads);
|
1693 |
|
1694 | {
|
1695 | var timeout = (plt.$flags$ & 6 ) === 2 ? performance.now() + 14 * Math.ceil(queueCongestion * (1.0 / 10.0)) : Infinity;
|
1696 | consumeTimeout(queueDomWrites, timeout);
|
1697 | consumeTimeout(queueDomWritesLow, timeout);
|
1698 | if (queueDomWrites.length > 0) {
|
1699 | queueDomWritesLow.push.apply(queueDomWritesLow, queueDomWrites);
|
1700 | queueDomWrites.length = 0;
|
1701 | }
|
1702 | if ((queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0)) {
|
1703 |
|
1704 |
|
1705 | plt.raf(flush);
|
1706 | }
|
1707 | else {
|
1708 | queueCongestion = 0;
|
1709 | }
|
1710 | }
|
1711 | };
|
1712 | var nextTick = function (cb) { return promiseResolve().then(cb); };
|
1713 | var writeTask = queueTask(queueDomWrites, true);
|
1714 | var patchEsm = function () {
|
1715 |
|
1716 | if (!(CSS && CSS.supports && CSS.supports('color', 'var(--c)'))) {
|
1717 |
|
1718 | return import( './css-shim-d64ae6d5.js').then(function () {
|
1719 | if ((plt.$cssShim$ = win.__cssshim)) {
|
1720 | return plt.$cssShim$.i();
|
1721 | }
|
1722 | else {
|
1723 |
|
1724 | return 0;
|
1725 | }
|
1726 | });
|
1727 | }
|
1728 | return promiseResolve();
|
1729 | };
|
1730 | var patchBrowser = function () {
|
1731 | {
|
1732 |
|
1733 | plt.$cssShim$ = win.__cssshim;
|
1734 | }
|
1735 |
|
1736 | var scriptElm = Array.from(doc.querySelectorAll('script')).find(function (s) { return new RegExp("/" + NAMESPACE + "(\\.esm)?\\.js($|\\?|#)").test(s.src) || s.getAttribute('data-stencil-namespace') === NAMESPACE; });
|
1737 | var opts = scriptElm['data-opts'] || {};
|
1738 | if ('onbeforeload' in scriptElm && !history.scrollRestoration ) {
|
1739 |
|
1740 |
|
1741 |
|
1742 |
|
1743 |
|
1744 |
|
1745 |
|
1746 | return {
|
1747 | then: function () {
|
1748 |
|
1749 | },
|
1750 | };
|
1751 | }
|
1752 | {
|
1753 | opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;
|
1754 | {
|
1755 | patchDynamicImport(opts.resourcesUrl, scriptElm);
|
1756 | }
|
1757 | if (!win.customElements) {
|
1758 |
|
1759 |
|
1760 | return import( './dom-59e43002.js').then(function () { return opts; });
|
1761 | }
|
1762 | }
|
1763 | return promiseResolve(opts);
|
1764 | };
|
1765 | var patchDynamicImport = function (base, orgScriptElm) {
|
1766 | var importFunctionName = getDynamicImportFunction(NAMESPACE);
|
1767 | try {
|
1768 |
|
1769 |
|
1770 |
|
1771 |
|
1772 | win[importFunctionName] = new Function('w', "return import(w);//" + Math.random());
|
1773 | }
|
1774 | catch (e) {
|
1775 |
|
1776 |
|
1777 |
|
1778 | var moduleMap_1 = new Map();
|
1779 | win[importFunctionName] = function (src) {
|
1780 | var url = new URL(src, base).href;
|
1781 | var mod = moduleMap_1.get(url);
|
1782 | if (!mod) {
|
1783 | var script_1 = doc.createElement('script');
|
1784 | script_1.type = 'module';
|
1785 | script_1.crossOrigin = orgScriptElm.crossOrigin;
|
1786 | script_1.src = URL.createObjectURL(new Blob(["import * as m from '" + url + "'; window." + importFunctionName + ".m = m;"], { type: 'application/javascript' }));
|
1787 | mod = new Promise(function (resolve) {
|
1788 | script_1.onload = function () {
|
1789 | resolve(win[importFunctionName].m);
|
1790 | script_1.remove();
|
1791 | };
|
1792 | });
|
1793 | moduleMap_1.set(url, mod);
|
1794 | doc.head.appendChild(script_1);
|
1795 | }
|
1796 | return mod;
|
1797 | };
|
1798 | }
|
1799 | };
|
1800 | export { Host as H, patchEsm as a, bootstrapLazy as b, h, patchBrowser as p, registerInstance as r };
|