index.js 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088
  1. function writeTask(e) {
  2. queuedWriteTasks.push(e);
  3. }
  4. function readTask(e) {
  5. queuedReadTasks.push(e);
  6. }
  7. function flushQueue() {
  8. return new Promise(((e, t) => {
  9. process.nextTick((async function a() {
  10. try {
  11. if (queuedReadTasks.length > 0) {
  12. const e = queuedReadTasks.slice();
  13. let t;
  14. for (queuedReadTasks.length = 0; t = e.shift(); ) {
  15. const e = t(Date.now());
  16. null != e && "function" == typeof e.then && await e;
  17. }
  18. }
  19. if (queuedWriteTasks.length > 0) {
  20. const e = queuedWriteTasks.slice();
  21. let t;
  22. for (queuedWriteTasks.length = 0; t = e.shift(); ) {
  23. const e = t(Date.now());
  24. null != e && "function" == typeof e.then && await e;
  25. }
  26. }
  27. queuedReadTasks.length + queuedWriteTasks.length > 0 ? process.nextTick(a) : e();
  28. } catch (e) {
  29. t(`flushQueue: ${e}`);
  30. }
  31. }));
  32. }));
  33. }
  34. async function flushAll() {
  35. for (;queuedTicks.length + queuedLoadModules.length + queuedWriteTasks.length + queuedReadTasks.length > 0; ) await new Promise(((e, t) => {
  36. process.nextTick((function a() {
  37. try {
  38. if (queuedTicks.length > 0) {
  39. const e = queuedTicks.slice();
  40. let t;
  41. for (queuedTicks.length = 0; t = e.shift(); ) t(Date.now());
  42. }
  43. queuedTicks.length > 0 ? process.nextTick(a) : e();
  44. } catch (e) {
  45. t(`flushTicks: ${e}`);
  46. }
  47. }));
  48. })), await flushLoadModule(), await flushQueue();
  49. if (caughtErrors.length > 0) {
  50. const e = caughtErrors[0];
  51. if (null == e) throw new Error("Error!");
  52. if ("string" == typeof e) throw new Error(e);
  53. throw e;
  54. }
  55. return new Promise((e => process.nextTick(e)));
  56. }
  57. function loadModule(e, t, a) {
  58. return new Promise((t => {
  59. queuedLoadModules.push({
  60. bundleId: e.$lazyBundleId$,
  61. resolve: () => t(moduleLoaded.get(e.$lazyBundleId$))
  62. });
  63. }));
  64. }
  65. function flushLoadModule(e) {
  66. return new Promise(((t, a) => {
  67. try {
  68. process.nextTick((() => {
  69. if (null != e) for (let t = 0; t < queuedLoadModules.length; t++) queuedLoadModules[t].bundleId === e && (queuedLoadModules[t].resolve(),
  70. queuedLoadModules.splice(t, 1), t--); else {
  71. let e;
  72. for (;e = queuedLoadModules.shift(); ) e.resolve();
  73. }
  74. t();
  75. }));
  76. } catch (e) {
  77. a(`flushLoadModule: ${e}`);
  78. }
  79. }));
  80. }
  81. function stopAutoApplyChanges() {
  82. isAutoApplyingChanges = !1, autoApplyTimer && (clearTimeout(autoApplyTimer), autoApplyTimer = void 0);
  83. }
  84. const appData = require("@stencil/core/internal/app-data"), mockDoc = require("@stencil/core/mock-doc"), styles = new Map, modeResolutionChain = [], cstrs = new Map, queuedTicks = [], queuedWriteTasks = [], queuedReadTasks = [], moduleLoaded = new Map, queuedLoadModules = [], caughtErrors = [], hostRefs = new Map;
  85. let customError;
  86. const defaultConsoleError = e => {
  87. caughtErrors.push(e);
  88. }, consoleError = (e, t) => (customError || defaultConsoleError)(e, t), consoleDevError = (...e) => {
  89. caughtErrors.push(new Error(e.join(", ")));
  90. }, consoleDevWarn = (...e) => {
  91. const t = e.filter((e => "string" == typeof e || "number" == typeof e || "boolean" == typeof e));
  92. console.warn.apply(console, t);
  93. }, nextTick = e => {
  94. queuedTicks.push(e);
  95. }, win = mockDoc.setupGlobal(global), doc = win.document;
  96. exports.supportsShadow = !0;
  97. const plt = {
  98. $flags$: 0,
  99. $resourcesUrl$: "",
  100. jmp: e => e(),
  101. raf: e => requestAnimationFrame(e),
  102. ael: (e, t, a, o) => e.addEventListener(t, a, o),
  103. rel: (e, t, a, o) => e.removeEventListener(t, a, o),
  104. ce: (e, t) => new win.CustomEvent(e, t)
  105. }, Context = {};
  106. let autoApplyTimer, isAutoApplyingChanges = !1;
  107. const isMemberInElement = (e, t) => {
  108. if (null != e) {
  109. if (t in e) return !0;
  110. const a = e.nodeName;
  111. if (a) {
  112. const e = cstrs.get(a.toLowerCase());
  113. if (null != e && null != e.COMPILER_META && null != e.COMPILER_META.properties) return e.COMPILER_META.properties.some((e => e.name === t));
  114. }
  115. }
  116. return !1;
  117. }, addHostEventListeners = (e, t, a, o) => {
  118. appData.BUILD.hostListener && a && (appData.BUILD.hostListenerTargetParent && (a = o ? a.filter((([e]) => 32 & e)) : a.filter((([e]) => !(32 & e)))),
  119. a.map((([a, o, s]) => {
  120. const n = appData.BUILD.hostListenerTarget ? getHostListenerTarget(e, a) : e, l = hostListenerProxy(t, s), r = hostListenerOpts(a);
  121. plt.ael(n, o, l, r), (t.$rmListeners$ = t.$rmListeners$ || []).push((() => plt.rel(n, o, l, r)));
  122. })));
  123. }, hostListenerProxy = (e, t) => a => {
  124. try {
  125. appData.BUILD.lazyLoad ? 256 & e.$flags$ ? e.$lazyInstance$[t](a) : (e.$queuedListeners$ = e.$queuedListeners$ || []).push([ t, a ]) : e.$hostElement$[t](a);
  126. } catch (e) {
  127. consoleError(e);
  128. }
  129. }, getHostListenerTarget = (e, t) => appData.BUILD.hostListenerTargetDocument && 4 & t ? doc : appData.BUILD.hostListenerTargetWindow && 8 & t ? win : appData.BUILD.hostListenerTargetBody && 16 & t ? doc.body : appData.BUILD.hostListenerTargetParent && 32 & t ? e.parentElement : e, hostListenerOpts = e => ({
  130. passive: 0 != (1 & e),
  131. capture: 0 != (2 & e)
  132. }), XLINK_NS = "http://www.w3.org/1999/xlink";
  133. let i = 0;
  134. const createTime = (e, t = "") => {
  135. if (appData.BUILD.profile && performance.mark) {
  136. const a = `st:${e}:${t}:${i++}`;
  137. return performance.mark(a), () => performance.measure(`[Stencil] ${e}() <${t}>`, a);
  138. }
  139. return () => {};
  140. }, rootAppliedStyles = new WeakMap, registerStyle = (e, t, a) => {
  141. let o = styles.get(e);
  142. o = t, styles.set(e, o);
  143. }, addStyle = (e, t, a, o) => {
  144. let s = getScopeId(t, a), n = styles.get(s);
  145. if (!appData.BUILD.attachStyles) return s;
  146. if (e = 11 === e.nodeType ? e : doc, n) if ("string" == typeof n) {
  147. e = e.head || e;
  148. let a, l = rootAppliedStyles.get(e);
  149. if (l || rootAppliedStyles.set(e, l = new Set), !l.has(s)) {
  150. if (appData.BUILD.hydrateClientSide && e.host && (a = e.querySelector(`[sty-id="${s}"]`))) a.innerHTML = n; else {
  151. if (appData.BUILD.cssVarShim && plt.$cssShim$) {
  152. a = plt.$cssShim$.createHostStyle(o, s, n, !!(10 & t.$flags$));
  153. const e = a["s-sc"];
  154. e && (s = e, l = null);
  155. } else a = doc.createElement("style"), a.innerHTML = n;
  156. (appData.BUILD.hydrateServerSide || appData.BUILD.hotModuleReplacement) && a.setAttribute("sty-id", s),
  157. e.insertBefore(a, e.querySelector("link"));
  158. }
  159. l && l.add(s);
  160. }
  161. } else appData.BUILD.constructableCSS && !e.adoptedStyleSheets.includes(n) && (e.adoptedStyleSheets = [ ...e.adoptedStyleSheets, n ]);
  162. return s;
  163. }, attachStyles = e => {
  164. const t = e.$cmpMeta$, a = e.$hostElement$, o = t.$flags$, s = createTime("attachStyles", t.$tagName$), n = addStyle(appData.BUILD.shadowDom && exports.supportsShadow && a.shadowRoot ? a.shadowRoot : a.getRootNode(), t, e.$modeName$, a);
  165. (appData.BUILD.shadowDom || appData.BUILD.scoped) && appData.BUILD.cssAnnotations && 10 & o && (a["s-sc"] = n,
  166. a.classList.add(n + "-h"), appData.BUILD.scoped && 2 & o && a.classList.add(n + "-s")),
  167. s();
  168. }, getScopeId = (e, t) => "sc-" + (appData.BUILD.mode && t && 32 & e.$flags$ ? e.$tagName$ + "-" + t : e.$tagName$), computeMode = e => modeResolutionChain.map((t => t(e))).find((e => !!e)), EMPTY_OBJ = {}, isComplexType = e => "object" == (e = typeof e) || "function" === e, h = (e, t, ...a) => {
  169. let o = null, s = null, n = null, l = !1, r = !1, p = [];
  170. const i = t => {
  171. for (let a = 0; a < t.length; a++) o = t[a], Array.isArray(o) ? i(o) : null != o && "boolean" != typeof o && ((l = "function" != typeof e && !isComplexType(o)) ? o = String(o) : appData.BUILD.isDev && "function" != typeof e && void 0 === o.$flags$ && consoleDevError("vNode passed as children has unexpected type.\nMake sure it's using the correct h() function.\nEmpty objects can also be the cause, look for JSX comments that became objects."),
  172. l && r ? p[p.length - 1].$text$ += o : p.push(l ? newVNode(null, o) : o), r = l);
  173. };
  174. if (i(a), t && (appData.BUILD.isDev && "input" === e && validateInputProperties(t),
  175. appData.BUILD.vdomKey && t.key && (s = t.key), appData.BUILD.slotRelocation && t.name && (n = t.name),
  176. appData.BUILD.vdomClass)) {
  177. const e = t.className || t.class;
  178. e && (t.class = "object" != typeof e ? e : Object.keys(e).filter((t => e[t])).join(" "));
  179. }
  180. if (appData.BUILD.isDev && p.some(isHost) && consoleDevError("The <Host> must be the single root component. Make sure:\n- You are NOT using hostData() and <Host> in the same component.\n- <Host> is used once, and it's the single root component of the render() function."),
  181. appData.BUILD.vdomFunctional && "function" == typeof e) return e(null === t ? {} : t, p, vdomFnUtils);
  182. const d = newVNode(e, null);
  183. return d.$attrs$ = t, p.length > 0 && (d.$children$ = p), appData.BUILD.vdomKey && (d.$key$ = s),
  184. appData.BUILD.slotRelocation && (d.$name$ = n), d;
  185. }, newVNode = (e, t) => {
  186. const a = {
  187. $flags$: 0,
  188. $tag$: e,
  189. $text$: t,
  190. $elm$: null,
  191. $children$: null
  192. };
  193. return appData.BUILD.vdomAttribute && (a.$attrs$ = null), appData.BUILD.vdomKey && (a.$key$ = null),
  194. appData.BUILD.slotRelocation && (a.$name$ = null), a;
  195. }, Host = {}, isHost = e => e && e.$tag$ === Host, vdomFnUtils = {
  196. forEach: (e, t) => e.map(convertToPublic).forEach(t),
  197. map: (e, t) => e.map(convertToPublic).map(t).map(convertToPrivate)
  198. }, convertToPublic = e => ({
  199. vattrs: e.$attrs$,
  200. vchildren: e.$children$,
  201. vkey: e.$key$,
  202. vname: e.$name$,
  203. vtag: e.$tag$,
  204. vtext: e.$text$
  205. }), convertToPrivate = e => {
  206. if ("function" == typeof e.vtag) {
  207. const t = {
  208. ...e.vattrs
  209. };
  210. return e.vkey && (t.key = e.vkey), e.vname && (t.name = e.vname), h(e.vtag, t, ...e.vchildren || []);
  211. }
  212. const t = newVNode(e.vtag, e.vtext);
  213. return t.$attrs$ = e.vattrs, t.$children$ = e.vchildren, t.$key$ = e.vkey, t.$name$ = e.vname,
  214. t;
  215. }, validateInputProperties = e => {
  216. const t = Object.keys(e), a = t.indexOf("value");
  217. if (-1 === a) return;
  218. const o = t.indexOf("type"), s = t.indexOf("min"), n = t.indexOf("max"), l = t.indexOf("step");
  219. (a < o || a < s || a < n || a < l) && consoleDevWarn('The "value" prop of <input> should be set after "min", "max", "type" and "step"');
  220. }, setAccessor = (e, t, a, o, s, n) => {
  221. if (a !== o) {
  222. let l = isMemberInElement(e, t), r = t.toLowerCase();
  223. if (appData.BUILD.vdomClass && "class" === t) {
  224. const t = e.classList, s = parseClassList(a), n = parseClassList(o);
  225. t.remove(...s.filter((e => e && !n.includes(e)))), t.add(...n.filter((e => e && !s.includes(e))));
  226. } else if (appData.BUILD.vdomStyle && "style" === t) {
  227. if (appData.BUILD.updatable) for (const t in a) o && null != o[t] || (!appData.BUILD.hydrateServerSide && t.includes("-") ? e.style.removeProperty(t) : e.style[t] = "");
  228. for (const t in o) a && o[t] === a[t] || (!appData.BUILD.hydrateServerSide && t.includes("-") ? e.style.setProperty(t, o[t]) : e.style[t] = o[t]);
  229. } else if (appData.BUILD.vdomKey && "key" === t) ; else if (appData.BUILD.vdomRef && "ref" === t) o && o(e); else if (!appData.BUILD.vdomListener || (appData.BUILD.lazyLoad ? l : e.__lookupSetter__(t)) || "o" !== t[0] || "n" !== t[1]) {
  230. if (appData.BUILD.vdomPropOrAttr) {
  231. const p = isComplexType(o);
  232. if ((l || p && null !== o) && !s) try {
  233. if (e.tagName.includes("-")) e[t] = o; else {
  234. let s = null == o ? "" : o;
  235. "list" === t ? l = !1 : null != a && e[t] == s || (e[t] = s);
  236. }
  237. } catch (e) {}
  238. let i = !1;
  239. appData.BUILD.vdomXlink && r !== (r = r.replace(/^xlink\:?/, "")) && (t = r, i = !0),
  240. null == o || !1 === o ? !1 === o && "" !== e.getAttribute(t) || (appData.BUILD.vdomXlink && i ? e.removeAttributeNS(XLINK_NS, t) : e.removeAttribute(t)) : (!l || 4 & n || s) && !p && (o = !0 === o ? "" : o,
  241. appData.BUILD.vdomXlink && i ? e.setAttributeNS(XLINK_NS, t, o) : e.setAttribute(t, o));
  242. }
  243. } else t = "-" === t[2] ? t.slice(3) : isMemberInElement(win, r) ? r.slice(2) : r[2] + t.slice(3),
  244. a && plt.rel(e, t, a, !1), o && plt.ael(e, t, o, !1);
  245. }
  246. }, parseClassListRegex = /\s/, parseClassList = e => e ? e.split(parseClassListRegex) : [], updateElement = (e, t, a, o) => {
  247. const s = 11 === t.$elm$.nodeType && t.$elm$.host ? t.$elm$.host : t.$elm$, n = e && e.$attrs$ || EMPTY_OBJ, l = t.$attrs$ || EMPTY_OBJ;
  248. if (appData.BUILD.updatable) for (o in n) o in l || setAccessor(s, o, n[o], void 0, a, t.$flags$);
  249. for (o in l) setAccessor(s, o, n[o], l[o], a, t.$flags$);
  250. };
  251. let scopeId, contentRef, hostTagName, useNativeShadowDom = !1, checkSlotFallbackVisibility = !1, checkSlotRelocate = !1, isSvgMode = !1;
  252. const createElm = (e, t, a, o) => {
  253. let s, n, l, r = t.$children$[a], p = 0;
  254. if (appData.BUILD.slotRelocation && !useNativeShadowDom && (checkSlotRelocate = !0,
  255. "slot" === r.$tag$ && (scopeId && o.classList.add(scopeId + "-s"), r.$flags$ |= r.$children$ ? 2 : 1)),
  256. appData.BUILD.isDev && r.$elm$ && consoleDevError(`The JSX ${null !== r.$text$ ? `"${r.$text$}" text` : `"${r.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`),
  257. appData.BUILD.vdomText && null !== r.$text$) s = r.$elm$ = doc.createTextNode(r.$text$); else if (appData.BUILD.slotRelocation && 1 & r.$flags$) s = r.$elm$ = appData.BUILD.isDebug || appData.BUILD.hydrateServerSide ? slotReferenceDebugNode(r) : doc.createTextNode(""); else {
  258. if (appData.BUILD.svg && !isSvgMode && (isSvgMode = "svg" === r.$tag$), s = r.$elm$ = appData.BUILD.svg ? doc.createElementNS(isSvgMode ? "http://www.w3.org/2000/svg" : "http://www.w3.org/1999/xhtml", appData.BUILD.slotRelocation && 2 & r.$flags$ ? "slot-fb" : r.$tag$) : doc.createElement(appData.BUILD.slotRelocation && 2 & r.$flags$ ? "slot-fb" : r.$tag$),
  259. appData.BUILD.svg && isSvgMode && "foreignObject" === r.$tag$ && (isSvgMode = !1),
  260. appData.BUILD.vdomAttribute && updateElement(null, r, isSvgMode), (appData.BUILD.shadowDom || appData.BUILD.scoped) && null != scopeId && s["s-si"] !== scopeId && s.classList.add(s["s-si"] = scopeId),
  261. r.$children$) for (p = 0; p < r.$children$.length; ++p) n = createElm(e, r, p, s),
  262. n && s.appendChild(n);
  263. appData.BUILD.svg && ("svg" === r.$tag$ ? isSvgMode = !1 : "foreignObject" === s.tagName && (isSvgMode = !0));
  264. }
  265. return appData.BUILD.slotRelocation && (s["s-hn"] = hostTagName, 3 & r.$flags$ && (s["s-sr"] = !0,
  266. s["s-cr"] = contentRef, s["s-sn"] = r.$name$ || "", l = e && e.$children$ && e.$children$[a],
  267. l && l.$tag$ === r.$tag$ && e.$elm$ && putBackInOriginalLocation(e.$elm$, !1))),
  268. s;
  269. }, putBackInOriginalLocation = (e, t) => {
  270. plt.$flags$ |= 1;
  271. const a = e.childNodes;
  272. for (let e = a.length - 1; e >= 0; e--) {
  273. const o = a[e];
  274. o["s-hn"] !== hostTagName && o["s-ol"] && (parentReferenceNode(o).insertBefore(o, referenceNode(o)),
  275. o["s-ol"].remove(), o["s-ol"] = void 0, checkSlotRelocate = !0), t && putBackInOriginalLocation(o, t);
  276. }
  277. plt.$flags$ &= -2;
  278. }, addVnodes = (e, t, a, o, s, n) => {
  279. let l, r = appData.BUILD.slotRelocation && e["s-cr"] && e["s-cr"].parentNode || e;
  280. for (appData.BUILD.shadowDom && r.shadowRoot && r.tagName === hostTagName && (r = r.shadowRoot); s <= n; ++s) o[s] && (l = createElm(null, a, s, e),
  281. l && (o[s].$elm$ = l, r.insertBefore(l, appData.BUILD.slotRelocation ? referenceNode(t) : t)));
  282. }, removeVnodes = (e, t, a, o, s) => {
  283. for (;t <= a; ++t) (o = e[t]) && (s = o.$elm$, callNodeRefs(o), appData.BUILD.slotRelocation && (checkSlotFallbackVisibility = !0,
  284. s["s-ol"] ? s["s-ol"].remove() : putBackInOriginalLocation(s, !0)), s.remove());
  285. }, isSameVnode = (e, t) => e.$tag$ === t.$tag$ && (appData.BUILD.slotRelocation && "slot" === e.$tag$ ? e.$name$ === t.$name$ : !appData.BUILD.vdomKey || e.$key$ === t.$key$), referenceNode = e => e && e["s-ol"] || e, parentReferenceNode = e => (e["s-ol"] ? e["s-ol"] : e).parentNode, patch = (e, t) => {
  286. const a = t.$elm$ = e.$elm$, o = e.$children$, s = t.$children$, n = t.$tag$, l = t.$text$;
  287. let r;
  288. appData.BUILD.vdomText && null !== l ? appData.BUILD.vdomText && appData.BUILD.slotRelocation && (r = a["s-cr"]) ? r.parentNode.textContent = l : appData.BUILD.vdomText && e.$text$ !== l && (a.data = l) : (appData.BUILD.svg && (isSvgMode = "svg" === n || "foreignObject" !== n && isSvgMode),
  289. (appData.BUILD.vdomAttribute || appData.BUILD.reflect) && (appData.BUILD.slot && "slot" === n || updateElement(e, t, isSvgMode)),
  290. appData.BUILD.updatable && null !== o && null !== s ? ((e, t, a, o) => {
  291. let s, n, l = 0, r = 0, p = 0, i = 0, d = t.length - 1, c = t[0], $ = t[d], u = o.length - 1, m = o[0], h = o[u];
  292. for (;l <= d && r <= u; ) if (null == c) c = t[++l]; else if (null == $) $ = t[--d]; else if (null == m) m = o[++r]; else if (null == h) h = o[--u]; else if (isSameVnode(c, m)) patch(c, m),
  293. c = t[++l], m = o[++r]; else if (isSameVnode($, h)) patch($, h), $ = t[--d], h = o[--u]; else if (isSameVnode(c, h)) !appData.BUILD.slotRelocation || "slot" !== c.$tag$ && "slot" !== h.$tag$ || putBackInOriginalLocation(c.$elm$.parentNode, !1),
  294. patch(c, h), e.insertBefore(c.$elm$, $.$elm$.nextSibling), c = t[++l], h = o[--u]; else if (isSameVnode($, m)) !appData.BUILD.slotRelocation || "slot" !== c.$tag$ && "slot" !== h.$tag$ || putBackInOriginalLocation($.$elm$.parentNode, !1),
  295. patch($, m), e.insertBefore($.$elm$, c.$elm$), $ = t[--d], m = o[++r]; else {
  296. if (p = -1, appData.BUILD.vdomKey) for (i = l; i <= d; ++i) if (t[i] && null !== t[i].$key$ && t[i].$key$ === m.$key$) {
  297. p = i;
  298. break;
  299. }
  300. appData.BUILD.vdomKey && p >= 0 ? (n = t[p], n.$tag$ !== m.$tag$ ? s = createElm(t && t[r], a, p, e) : (patch(n, m),
  301. t[p] = void 0, s = n.$elm$), m = o[++r]) : (s = createElm(t && t[r], a, r, e), m = o[++r]),
  302. s && (appData.BUILD.slotRelocation ? parentReferenceNode(c.$elm$).insertBefore(s, referenceNode(c.$elm$)) : c.$elm$.parentNode.insertBefore(s, c.$elm$));
  303. }
  304. l > d ? addVnodes(e, null == o[u + 1] ? null : o[u + 1].$elm$, a, o, r, u) : appData.BUILD.updatable && r > u && removeVnodes(t, l, d);
  305. })(a, o, t, s) : null !== s ? (appData.BUILD.updatable && appData.BUILD.vdomText && null !== e.$text$ && (a.textContent = ""),
  306. addVnodes(a, null, t, s, 0, s.length - 1)) : appData.BUILD.updatable && null !== o && removeVnodes(o, 0, o.length - 1),
  307. appData.BUILD.svg && isSvgMode && "svg" === n && (isSvgMode = !1));
  308. }, updateFallbackSlotVisibility = e => {
  309. let t, a, o, s, n, l, r = e.childNodes;
  310. for (a = 0, o = r.length; a < o; a++) if (t = r[a], 1 === t.nodeType) {
  311. if (t["s-sr"]) for (n = t["s-sn"], t.hidden = !1, s = 0; s < o; s++) if (l = r[s].nodeType,
  312. r[s]["s-hn"] !== t["s-hn"] || "" !== n) {
  313. if (1 === l && n === r[s].getAttribute("slot")) {
  314. t.hidden = !0;
  315. break;
  316. }
  317. } else if (1 === l || 3 === l && "" !== r[s].textContent.trim()) {
  318. t.hidden = !0;
  319. break;
  320. }
  321. updateFallbackSlotVisibility(t);
  322. }
  323. }, relocateNodes = [], relocateSlotContent = e => {
  324. let t, a, o, s, n, l, r = 0, p = e.childNodes, i = p.length;
  325. for (;r < i; r++) {
  326. if (t = p[r], t["s-sr"] && (a = t["s-cr"]) && a.parentNode) for (o = a.parentNode.childNodes,
  327. s = t["s-sn"], l = o.length - 1; l >= 0; l--) a = o[l], a["s-cn"] || a["s-nr"] || a["s-hn"] === t["s-hn"] || (isNodeLocatedInSlot(a, s) ? (n = relocateNodes.find((e => e.$nodeToRelocate$ === a)),
  328. checkSlotFallbackVisibility = !0, a["s-sn"] = a["s-sn"] || s, n ? n.$slotRefNode$ = t : relocateNodes.push({
  329. $slotRefNode$: t,
  330. $nodeToRelocate$: a
  331. }), a["s-sr"] && relocateNodes.map((e => {
  332. isNodeLocatedInSlot(e.$nodeToRelocate$, a["s-sn"]) && (n = relocateNodes.find((e => e.$nodeToRelocate$ === a)),
  333. n && !e.$slotRefNode$ && (e.$slotRefNode$ = n.$slotRefNode$));
  334. }))) : relocateNodes.some((e => e.$nodeToRelocate$ === a)) || relocateNodes.push({
  335. $nodeToRelocate$: a
  336. }));
  337. 1 === t.nodeType && relocateSlotContent(t);
  338. }
  339. }, isNodeLocatedInSlot = (e, t) => 1 === e.nodeType ? null === e.getAttribute("slot") && "" === t || e.getAttribute("slot") === t : e["s-sn"] === t || "" === t, callNodeRefs = e => {
  340. appData.BUILD.vdomRef && (e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(callNodeRefs));
  341. }, renderVdom = (e, t) => {
  342. const a = e.$hostElement$, o = e.$cmpMeta$, s = e.$vnode$ || newVNode(null, null), n = isHost(t) ? t : h(null, null, t);
  343. if (hostTagName = a.tagName, appData.BUILD.isDev && Array.isArray(t) && t.some(isHost)) throw new Error(`The <Host> must be the single root component.\nLooks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.\n\nThe render() function should look like this instead:\n\nrender() {\n // Do not return an array\n return (\n <Host>{content}</Host>\n );\n}\n `);
  344. if (appData.BUILD.reflect && o.$attrsToReflect$ && (n.$attrs$ = n.$attrs$ || {},
  345. o.$attrsToReflect$.map((([e, t]) => n.$attrs$[t] = a[e]))), n.$tag$ = null, n.$flags$ |= 4,
  346. e.$vnode$ = n, n.$elm$ = s.$elm$ = appData.BUILD.shadowDom && a.shadowRoot || a,
  347. (appData.BUILD.scoped || appData.BUILD.shadowDom) && (scopeId = a["s-sc"]), appData.BUILD.slotRelocation && (contentRef = a["s-cr"],
  348. useNativeShadowDom = exports.supportsShadow && 0 != (1 & o.$flags$), checkSlotFallbackVisibility = !1),
  349. patch(s, n), appData.BUILD.slotRelocation) {
  350. if (plt.$flags$ |= 1, checkSlotRelocate) {
  351. let e, t, a, o, s, l;
  352. relocateSlotContent(n.$elm$);
  353. let r = 0;
  354. for (;r < relocateNodes.length; r++) e = relocateNodes[r], t = e.$nodeToRelocate$,
  355. t["s-ol"] || (a = appData.BUILD.isDebug || appData.BUILD.hydrateServerSide ? originalLocationDebugNode(t) : doc.createTextNode(""),
  356. a["s-nr"] = t, t.parentNode.insertBefore(t["s-ol"] = a, t));
  357. for (r = 0; r < relocateNodes.length; r++) if (e = relocateNodes[r], t = e.$nodeToRelocate$,
  358. e.$slotRefNode$) {
  359. for (o = e.$slotRefNode$.parentNode, s = e.$slotRefNode$.nextSibling, a = t["s-ol"]; a = a.previousSibling; ) if (l = a["s-nr"],
  360. l && l["s-sn"] === t["s-sn"] && o === l.parentNode && (l = l.nextSibling, !l || !l["s-nr"])) {
  361. s = l;
  362. break;
  363. }
  364. (!s && o !== t.parentNode || t.nextSibling !== s) && t !== s && (!t["s-hn"] && t["s-ol"] && (t["s-hn"] = t["s-ol"].parentNode.nodeName),
  365. o.insertBefore(t, s));
  366. } else 1 === t.nodeType && (t.hidden = !0);
  367. }
  368. checkSlotFallbackVisibility && updateFallbackSlotVisibility(n.$elm$), plt.$flags$ &= -2,
  369. relocateNodes.length = 0;
  370. }
  371. }, slotReferenceDebugNode = e => doc.createComment(`<slot${e.$name$ ? ' name="' + e.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`), originalLocationDebugNode = e => doc.createComment("org-location for " + (e.localName ? `<${e.localName}> (host=${e["s-hn"]})` : `[${e.textContent}]`)), getElement = e => appData.BUILD.lazyLoad ? getHostRef(e).$hostElement$ : e, emitEvent = (e, t, a) => {
  372. const o = plt.ce(t, a);
  373. return e.dispatchEvent(o), o;
  374. }, attachToAncestor = (e, t) => {
  375. appData.BUILD.asyncLoading && t && !e.$onRenderResolve$ && t["s-p"] && t["s-p"].push(new Promise((t => e.$onRenderResolve$ = t)));
  376. }, scheduleUpdate = (e, t) => {
  377. if (appData.BUILD.taskQueue && appData.BUILD.updatable && (e.$flags$ |= 16), appData.BUILD.asyncLoading && 4 & e.$flags$) return void (e.$flags$ |= 512);
  378. attachToAncestor(e, e.$ancestorComponent$);
  379. const a = () => dispatchHooks(e, t);
  380. return appData.BUILD.taskQueue ? writeTask(a) : a();
  381. }, dispatchHooks = (e, t) => {
  382. const a = e.$hostElement$, o = createTime("scheduleUpdate", e.$cmpMeta$.$tagName$), s = appData.BUILD.lazyLoad ? e.$lazyInstance$ : a;
  383. let n;
  384. return t ? (appData.BUILD.lazyLoad && appData.BUILD.hostListener && (e.$flags$ |= 256,
  385. e.$queuedListeners$ && (e.$queuedListeners$.map((([e, t]) => safeCall(s, e, t))),
  386. e.$queuedListeners$ = null)), emitLifecycleEvent(a, "componentWillLoad"), appData.BUILD.cmpWillLoad && (n = safeCall(s, "componentWillLoad"))) : (emitLifecycleEvent(a, "componentWillUpdate"),
  387. appData.BUILD.cmpWillUpdate && (n = safeCall(s, "componentWillUpdate"))), emitLifecycleEvent(a, "componentWillRender"),
  388. appData.BUILD.cmpWillRender && (n = then(n, (() => safeCall(s, "componentWillRender")))),
  389. o(), then(n, (() => updateComponent(e, s, t)));
  390. }, updateComponent = async (e, t, a) => {
  391. const o = e.$hostElement$, s = createTime("update", e.$cmpMeta$.$tagName$), n = o["s-rc"];
  392. appData.BUILD.style && a && attachStyles(e);
  393. const l = createTime("render", e.$cmpMeta$.$tagName$);
  394. if (appData.BUILD.isDev && (e.$flags$ |= 1024), appData.BUILD.hydrateServerSide ? await callRender(e, t, o) : callRender(e, t, o),
  395. appData.BUILD.cssVarShim && plt.$cssShim$ && plt.$cssShim$.updateHost(o), appData.BUILD.isDev && (e.$renderCount$++,
  396. e.$flags$ &= -1025), appData.BUILD.hydrateServerSide) try {
  397. serverSideConnected(o), a && (1 & e.$cmpMeta$.$flags$ ? o["s-en"] = "" : 2 & e.$cmpMeta$.$flags$ && (o["s-en"] = "c"));
  398. } catch (e) {
  399. consoleError(e, o);
  400. }
  401. if (appData.BUILD.asyncLoading && n && (n.map((e => e())), o["s-rc"] = void 0),
  402. l(), s(), appData.BUILD.asyncLoading) {
  403. const t = o["s-p"], a = () => postUpdateComponent(e);
  404. 0 === t.length ? a() : (Promise.all(t).then(a), e.$flags$ |= 4, t.length = 0);
  405. } else postUpdateComponent(e);
  406. };
  407. let renderingRef = null;
  408. const callRender = (e, t, a) => {
  409. const o = !!appData.BUILD.allRenderFn, s = !!appData.BUILD.lazyLoad, n = !!appData.BUILD.taskQueue, l = !!appData.BUILD.updatable;
  410. try {
  411. if (renderingRef = t, t = (o || t.render) && t.render(), l && n && (e.$flags$ &= -17),
  412. (l || s) && (e.$flags$ |= 2), appData.BUILD.hasRenderFn || appData.BUILD.reflect) if (appData.BUILD.vdomRender || appData.BUILD.reflect) {
  413. if (appData.BUILD.hydrateServerSide) return Promise.resolve(t).then((t => renderVdom(e, t)));
  414. renderVdom(e, t);
  415. } else a.textContent = t;
  416. } catch (t) {
  417. consoleError(t, e.$hostElement$);
  418. }
  419. return renderingRef = null, null;
  420. }, postUpdateComponent = e => {
  421. const t = e.$cmpMeta$.$tagName$, a = e.$hostElement$, o = createTime("postUpdate", t), s = appData.BUILD.lazyLoad ? e.$lazyInstance$ : a, n = e.$ancestorComponent$;
  422. appData.BUILD.cmpDidRender && (appData.BUILD.isDev && (e.$flags$ |= 1024), safeCall(s, "componentDidRender"),
  423. appData.BUILD.isDev && (e.$flags$ &= -1025)), emitLifecycleEvent(a, "componentDidRender"),
  424. 64 & e.$flags$ ? (appData.BUILD.cmpDidUpdate && (appData.BUILD.isDev && (e.$flags$ |= 1024),
  425. safeCall(s, "componentDidUpdate"), appData.BUILD.isDev && (e.$flags$ &= -1025)),
  426. emitLifecycleEvent(a, "componentDidUpdate"), o()) : (e.$flags$ |= 64, appData.BUILD.asyncLoading && appData.BUILD.cssAnnotations && addHydratedFlag(a),
  427. appData.BUILD.cmpDidLoad && (appData.BUILD.isDev && (e.$flags$ |= 2048), safeCall(s, "componentDidLoad"),
  428. appData.BUILD.isDev && (e.$flags$ &= -2049)), emitLifecycleEvent(a, "componentDidLoad"),
  429. o(), appData.BUILD.asyncLoading && (e.$onReadyResolve$(a), n || appDidLoad(t))),
  430. appData.BUILD.hotModuleReplacement && a["s-hmr-load"] && a["s-hmr-load"](), appData.BUILD.method && appData.BUILD.lazyLoad && e.$onInstanceResolve$(a),
  431. appData.BUILD.asyncLoading && (e.$onRenderResolve$ && (e.$onRenderResolve$(), e.$onRenderResolve$ = void 0),
  432. 512 & e.$flags$ && nextTick((() => scheduleUpdate(e, !1))), e.$flags$ &= -517);
  433. }, forceUpdate = e => {
  434. if (appData.BUILD.updatable) {
  435. const t = getHostRef(e), a = t.$hostElement$.isConnected;
  436. return a && 2 == (18 & t.$flags$) && scheduleUpdate(t, !1), a;
  437. }
  438. return !1;
  439. }, appDidLoad = e => {
  440. appData.BUILD.cssAnnotations && addHydratedFlag(doc.documentElement), appData.BUILD.asyncQueue && (plt.$flags$ |= 2),
  441. nextTick((() => emitEvent(win, "appload", {
  442. detail: {
  443. namespace: appData.NAMESPACE
  444. }
  445. }))), appData.BUILD.profile && performance.measure && performance.measure(`[Stencil] ${appData.NAMESPACE} initial load (by ${e})`, "st:app:start");
  446. }, safeCall = (e, t, a) => {
  447. if (e && e[t]) try {
  448. return e[t](a);
  449. } catch (e) {
  450. consoleError(e);
  451. }
  452. }, then = (e, t) => e && e.then ? e.then(t) : t(), emitLifecycleEvent = (e, t) => {
  453. appData.BUILD.lifecycleDOMEvents && emitEvent(e, "stencil_" + t, {
  454. bubbles: !0,
  455. composed: !0,
  456. detail: {
  457. namespace: appData.NAMESPACE
  458. }
  459. });
  460. }, addHydratedFlag = e => appData.BUILD.hydratedClass ? e.classList.add("hydrated") : appData.BUILD.hydratedAttribute ? e.setAttribute("hydrated", "") : void 0, serverSideConnected = e => {
  461. const t = e.children;
  462. if (null != t) for (let e = 0, a = t.length; e < a; e++) {
  463. const a = t[e];
  464. "function" == typeof a.connectedCallback && a.connectedCallback(), serverSideConnected(a);
  465. }
  466. }, clientHydrate = (e, t, a, o, s, n, l) => {
  467. let r, p, i, d;
  468. if (1 === n.nodeType) {
  469. for (r = n.getAttribute("c-id"), r && (p = r.split("."), p[0] !== l && "0" !== p[0] || (i = {
  470. $flags$: 0,
  471. $hostId$: p[0],
  472. $nodeId$: p[1],
  473. $depth$: p[2],
  474. $index$: p[3],
  475. $tag$: n.tagName.toLowerCase(),
  476. $elm$: n,
  477. $attrs$: null,
  478. $children$: null,
  479. $key$: null,
  480. $name$: null,
  481. $text$: null
  482. }, t.push(i), n.removeAttribute("c-id"), e.$children$ || (e.$children$ = []), e.$children$[i.$index$] = i,
  483. e = i, o && "0" === i.$depth$ && (o[i.$index$] = i.$elm$))), d = n.childNodes.length - 1; d >= 0; d--) clientHydrate(e, t, a, o, s, n.childNodes[d], l);
  484. if (n.shadowRoot) for (d = n.shadowRoot.childNodes.length - 1; d >= 0; d--) clientHydrate(e, t, a, o, s, n.shadowRoot.childNodes[d], l);
  485. } else if (8 === n.nodeType) p = n.nodeValue.split("."), p[1] !== l && "0" !== p[1] || (r = p[0],
  486. i = {
  487. $flags$: 0,
  488. $hostId$: p[1],
  489. $nodeId$: p[2],
  490. $depth$: p[3],
  491. $index$: p[4],
  492. $elm$: n,
  493. $attrs$: null,
  494. $children$: null,
  495. $key$: null,
  496. $name$: null,
  497. $tag$: null,
  498. $text$: null
  499. }, "t" === r ? (i.$elm$ = n.nextSibling, i.$elm$ && 3 === i.$elm$.nodeType && (i.$text$ = i.$elm$.textContent,
  500. t.push(i), n.remove(), e.$children$ || (e.$children$ = []), e.$children$[i.$index$] = i,
  501. o && "0" === i.$depth$ && (o[i.$index$] = i.$elm$))) : i.$hostId$ === l && ("s" === r ? (i.$tag$ = "slot",
  502. p[5] ? n["s-sn"] = i.$name$ = p[5] : n["s-sn"] = "", n["s-sr"] = !0, appData.BUILD.shadowDom && o && (i.$elm$ = doc.createElement(i.$tag$),
  503. i.$name$ && i.$elm$.setAttribute("name", i.$name$), n.parentNode.insertBefore(i.$elm$, n),
  504. n.remove(), "0" === i.$depth$ && (o[i.$index$] = i.$elm$)), a.push(i), e.$children$ || (e.$children$ = []),
  505. e.$children$[i.$index$] = i) : "r" === r && (appData.BUILD.shadowDom && o ? n.remove() : appData.BUILD.slotRelocation && (s["s-cr"] = n,
  506. n["s-cn"] = !0)))); else if (e && "style" === e.$tag$) {
  507. const t = newVNode(null, n.textContent);
  508. t.$elm$ = n, t.$index$ = "0", e.$children$ = [ t ];
  509. }
  510. }, initializeDocumentHydrate = (e, t) => {
  511. if (1 === e.nodeType) {
  512. let a = 0;
  513. for (;a < e.childNodes.length; a++) initializeDocumentHydrate(e.childNodes[a], t);
  514. if (e.shadowRoot) for (a = 0; a < e.shadowRoot.childNodes.length; a++) initializeDocumentHydrate(e.shadowRoot.childNodes[a], t);
  515. } else if (8 === e.nodeType) {
  516. const a = e.nodeValue.split(".");
  517. "o" === a[0] && (t.set(a[1] + "." + a[2], e), e.nodeValue = "", e["s-en"] = a[3]);
  518. }
  519. }, parsePropertyValue = (e, t) => null == e || isComplexType(e) ? e : appData.BUILD.propBoolean && 4 & t ? "false" !== e && ("" === e || !!e) : appData.BUILD.propNumber && 2 & t ? parseFloat(e) : appData.BUILD.propString && 1 & t ? String(e) : e, getValue = (e, t) => getHostRef(e).$instanceValues$.get(t), setValue = (e, t, a, o) => {
  520. const s = getHostRef(e), n = appData.BUILD.lazyLoad ? s.$hostElement$ : e, l = s.$instanceValues$.get(t), r = s.$flags$, p = appData.BUILD.lazyLoad ? s.$lazyInstance$ : n;
  521. a = parsePropertyValue(a, o.$members$[t][0]);
  522. const i = Number.isNaN(l) && Number.isNaN(a), d = a !== l && !i;
  523. if ((!appData.BUILD.lazyLoad || !(8 & r) || void 0 === l) && d && (s.$instanceValues$.set(t, a),
  524. appData.BUILD.isDev && (1024 & s.$flags$ ? consoleDevWarn(`The state/prop "${t}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`, "\nElement", n, "\nNew value", a, "\nOld value", l) : 2048 & s.$flags$ && consoleDevWarn(`The state/prop "${t}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`, "\nElement", n, "\nNew value", a, "\nOld value", l)),
  525. !appData.BUILD.lazyLoad || p)) {
  526. if (appData.BUILD.watchCallback && o.$watchers$ && 128 & r) {
  527. const e = o.$watchers$[t];
  528. e && e.map((e => {
  529. try {
  530. p[e](a, l, t);
  531. } catch (e) {
  532. consoleError(e, n);
  533. }
  534. }));
  535. }
  536. if (appData.BUILD.updatable && 2 == (18 & r)) {
  537. if (appData.BUILD.cmpShouldUpdate && p.componentShouldUpdate && !1 === p.componentShouldUpdate(a, l, t)) return;
  538. scheduleUpdate(s, !1);
  539. }
  540. }
  541. }, proxyComponent = (e, t, a) => {
  542. if (appData.BUILD.member && t.$members$) {
  543. appData.BUILD.watchCallback && e.watchers && (t.$watchers$ = e.watchers);
  544. const o = Object.entries(t.$members$), s = e.prototype;
  545. if (o.map((([e, [o]]) => {
  546. (appData.BUILD.prop || appData.BUILD.state) && (31 & o || (!appData.BUILD.lazyLoad || 2 & a) && 32 & o) ? Object.defineProperty(s, e, {
  547. get() {
  548. return getValue(this, e);
  549. },
  550. set(s) {
  551. if (appData.BUILD.isDev) {
  552. const s = getHostRef(this);
  553. 0 == (1 & a) && 0 == (8 & s.$flags$) && 0 != (31 & o) && 0 == (1024 & o) && consoleDevWarn(`@Prop() "${e}" on <${t.$tagName$}> is immutable but was modified from within the component.\nMore information: https://stenciljs.com/docs/properties#prop-mutability`);
  554. }
  555. setValue(this, e, s, t);
  556. },
  557. configurable: !0,
  558. enumerable: !0
  559. }) : appData.BUILD.lazyLoad && appData.BUILD.method && 1 & a && 64 & o && Object.defineProperty(s, e, {
  560. value(...t) {
  561. const a = getHostRef(this);
  562. return a.$onInstancePromise$.then((() => a.$lazyInstance$[e](...t)));
  563. }
  564. });
  565. })), appData.BUILD.observeAttribute && (!appData.BUILD.lazyLoad || 1 & a)) {
  566. const a = new Map;
  567. s.attributeChangedCallback = function(e, t, o) {
  568. plt.jmp((() => {
  569. const t = a.get(e);
  570. if (this.hasOwnProperty(t)) o = this[t], delete this[t]; else if (s.hasOwnProperty(t) && "number" == typeof this[t] && this[t] == o) return;
  571. this[t] = (null !== o || "boolean" != typeof this[t]) && o;
  572. }));
  573. }, e.observedAttributes = o.filter((([e, t]) => 15 & t[0])).map((([e, o]) => {
  574. const s = o[1] || e;
  575. return a.set(s, e), appData.BUILD.reflect && 512 & o[0] && t.$attrsToReflect$.push([ e, s ]),
  576. s;
  577. }));
  578. }
  579. }
  580. return e;
  581. }, initializeComponent = async (e, t, a, o, s) => {
  582. if ((appData.BUILD.lazyLoad || appData.BUILD.hydrateServerSide || appData.BUILD.style) && 0 == (32 & t.$flags$)) {
  583. if (appData.BUILD.lazyLoad || appData.BUILD.hydrateClientSide) {
  584. if (t.$flags$ |= 32, (s = loadModule(a)).then) {
  585. const e = (n = `st:load:${a.$tagName$}:${t.$modeName$}`, l = `[Stencil] Load module for <${a.$tagName$}>`,
  586. appData.BUILD.profile && performance.mark ? (0 === performance.getEntriesByName(n).length && performance.mark(n),
  587. () => {
  588. 0 === performance.getEntriesByName(l).length && performance.measure(l, n);
  589. }) : () => {});
  590. s = await s, e();
  591. }
  592. if ((appData.BUILD.isDev || appData.BUILD.isDebug) && !s) throw new Error(`Constructor for "${a.$tagName$}#${t.$modeName$}" was not found`);
  593. appData.BUILD.member && !s.isProxied && (appData.BUILD.watchCallback && (a.$watchers$ = s.watchers),
  594. proxyComponent(s, a, 2), s.isProxied = !0);
  595. const e = createTime("createInstance", a.$tagName$);
  596. appData.BUILD.member && (t.$flags$ |= 8);
  597. try {
  598. new s(t);
  599. } catch (e) {
  600. consoleError(e);
  601. }
  602. appData.BUILD.member && (t.$flags$ &= -9), appData.BUILD.watchCallback && (t.$flags$ |= 128),
  603. e(), fireConnectedCallback(t.$lazyInstance$);
  604. } else s = e.constructor, t.$flags$ |= 32, customElements.whenDefined(a.$tagName$).then((() => t.$flags$ |= 128));
  605. if (appData.BUILD.style && s.style) {
  606. let o = s.style;
  607. appData.BUILD.mode && "string" != typeof o && (o = o[t.$modeName$ = computeMode(e)],
  608. appData.BUILD.hydrateServerSide && t.$modeName$ && e.setAttribute("s-mode", t.$modeName$));
  609. const n = getScopeId(a, t.$modeName$);
  610. if (!styles.has(n)) {
  611. const e = createTime("registerStyles", a.$tagName$);
  612. !appData.BUILD.hydrateServerSide && appData.BUILD.shadowDom && appData.BUILD.shadowDomShim && 8 & a.$flags$ && (o = await Promise.resolve().then((function() {
  613. return require("./shadow-css.js");
  614. })).then((e => e.scopeCss(o, n, !1)))), registerStyle(n, o, a.$flags$), e();
  615. }
  616. }
  617. }
  618. var n, l;
  619. const r = t.$ancestorComponent$, p = () => scheduleUpdate(t, !0);
  620. appData.BUILD.asyncLoading && r && r["s-rc"] ? r["s-rc"].push(p) : p();
  621. }, fireConnectedCallback = e => {
  622. appData.BUILD.lazyLoad && appData.BUILD.connectedCallback && safeCall(e, "connectedCallback");
  623. }, connectedCallback = e => {
  624. if (0 == (1 & plt.$flags$)) {
  625. const t = getHostRef(e), a = t.$cmpMeta$, o = createTime("connectedCallback", a.$tagName$);
  626. if (appData.BUILD.hostListenerTargetParent && addHostEventListeners(e, t, a.$listeners$, !0),
  627. 1 & t.$flags$) addHostEventListeners(e, t, a.$listeners$, !1), fireConnectedCallback(t.$lazyInstance$); else {
  628. let o;
  629. if (t.$flags$ |= 1, appData.BUILD.hydrateClientSide && (o = e.getAttribute("s-id"),
  630. o)) {
  631. if (appData.BUILD.shadowDom && exports.supportsShadow && 1 & a.$flags$) {
  632. const t = appData.BUILD.mode ? addStyle(e.shadowRoot, a, e.getAttribute("s-mode")) : addStyle(e.shadowRoot, a);
  633. e.classList.remove(t + "-h", t + "-s");
  634. }
  635. ((e, t, a, o) => {
  636. const s = createTime("hydrateClient", t), n = e.shadowRoot, l = [], r = appData.BUILD.shadowDom && n ? [] : null, p = o.$vnode$ = newVNode(t, null);
  637. plt.$orgLocNodes$ || initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = new Map),
  638. e["s-id"] = a, e.removeAttribute("s-id"), clientHydrate(p, l, [], r, e, e, a), l.map((e => {
  639. const a = e.$hostId$ + "." + e.$nodeId$, o = plt.$orgLocNodes$.get(a), s = e.$elm$;
  640. o && exports.supportsShadow && "" === o["s-en"] && o.parentNode.insertBefore(s, o.nextSibling),
  641. n || (s["s-hn"] = t, o && (s["s-ol"] = o, s["s-ol"]["s-nr"] = s)), plt.$orgLocNodes$.delete(a);
  642. })), appData.BUILD.shadowDom && n && r.map((e => {
  643. e && n.appendChild(e);
  644. })), s();
  645. })(e, a.$tagName$, o, t);
  646. }
  647. if (appData.BUILD.slotRelocation && !o && (appData.BUILD.hydrateServerSide || (appData.BUILD.slot || appData.BUILD.shadowDom) && 12 & a.$flags$) && setContentReference(e),
  648. appData.BUILD.asyncLoading) {
  649. let a = e;
  650. for (;a = a.parentNode || a.host; ) if (appData.BUILD.hydrateClientSide && 1 === a.nodeType && a.hasAttribute("s-id") && a["s-p"] || a["s-p"]) {
  651. attachToAncestor(t, t.$ancestorComponent$ = a);
  652. break;
  653. }
  654. }
  655. appData.BUILD.prop && !appData.BUILD.hydrateServerSide && a.$members$ && Object.entries(a.$members$).map((([t, [a]]) => {
  656. if (31 & a && e.hasOwnProperty(t)) {
  657. const a = e[t];
  658. delete e[t], e[t] = a;
  659. }
  660. })), appData.BUILD.initializeNextTick ? nextTick((() => initializeComponent(e, t, a))) : initializeComponent(e, t, a);
  661. }
  662. o();
  663. }
  664. }, setContentReference = e => {
  665. const t = e["s-cr"] = doc.createComment(appData.BUILD.isDebug ? `content-ref (host=${e.localName})` : "");
  666. t["s-cn"] = !0, e.insertBefore(t, e.firstChild);
  667. }, disconnectedCallback = e => {
  668. if (0 == (1 & plt.$flags$)) {
  669. const t = getHostRef(e), a = appData.BUILD.lazyLoad ? t.$lazyInstance$ : e;
  670. appData.BUILD.hostListener && t.$rmListeners$ && (t.$rmListeners$.map((e => e())),
  671. t.$rmListeners$ = void 0), appData.BUILD.cssVarShim && plt.$cssShim$ && plt.$cssShim$.removeHost(e),
  672. appData.BUILD.lazyLoad && appData.BUILD.disconnectedCallback && safeCall(a, "disconnectedCallback"),
  673. appData.BUILD.cmpDidUnload && safeCall(a, "componentDidUnload");
  674. }
  675. }, proxyCustomElement = (e, t) => {
  676. const a = {
  677. $flags$: t[0],
  678. $tagName$: t[1]
  679. };
  680. appData.BUILD.member && (a.$members$ = t[2]), appData.BUILD.hostListener && (a.$listeners$ = t[3]),
  681. appData.BUILD.watchCallback && (a.$watchers$ = e.$watchers$), appData.BUILD.reflect && (a.$attrsToReflect$ = []),
  682. appData.BUILD.shadowDom && !exports.supportsShadow && 1 & a.$flags$ && (a.$flags$ |= 8);
  683. const o = e.prototype.connectedCallback, s = e.prototype.disconnectedCallback;
  684. return Object.assign(e.prototype, {
  685. __registerHost() {
  686. registerHost(this, a);
  687. },
  688. connectedCallback() {
  689. connectedCallback(this), appData.BUILD.connectedCallback && o && o.call(this);
  690. },
  691. disconnectedCallback() {
  692. disconnectedCallback(this), appData.BUILD.disconnectedCallback && s && s.call(this);
  693. },
  694. __attachShadow() {
  695. exports.supportsShadow ? appData.BUILD.shadowDelegatesFocus ? this.attachShadow({
  696. mode: "open",
  697. delegatesFocus: !!(16 & a.$flags$)
  698. }) : this.attachShadow({
  699. mode: "open"
  700. }) : this.shadowRoot = this;
  701. }
  702. }), e.is = a.$tagName$, proxyComponent(e, a, 3);
  703. }, patchCloneNode = e => {
  704. const t = e.cloneNode;
  705. e.cloneNode = function(e) {
  706. const a = this, o = !!appData.BUILD.shadowDom && a.shadowRoot && exports.supportsShadow, s = t.call(a, !!o && e);
  707. if (appData.BUILD.slot && !o && e) {
  708. let e, t, o = 0, n = [ "s-id", "s-cr", "s-lr", "s-rc", "s-sc", "s-p", "s-cn", "s-sr", "s-sn", "s-hn", "s-ol", "s-nr", "s-si" ];
  709. for (;o < a.childNodes.length; o++) e = a.childNodes[o]["s-nr"], t = n.every((e => !a.childNodes[o][e])),
  710. e && (appData.BUILD.appendChildSlotFix && s.__appendChild ? s.__appendChild(e.cloneNode(!0)) : s.appendChild(e.cloneNode(!0))),
  711. t && s.appendChild(a.childNodes[o].cloneNode(!0));
  712. }
  713. return s;
  714. };
  715. }, patchSlotAppendChild = e => {
  716. e.__appendChild = e.appendChild, e.appendChild = function(e) {
  717. const t = e["s-sn"] = getSlotName(e), a = getHostSlotNode(this.childNodes, t);
  718. if (a) {
  719. const o = getHostSlotChildNodes(a, t), s = o[o.length - 1];
  720. return s.parentNode.insertBefore(e, s.nextSibling);
  721. }
  722. return this.__appendChild(e);
  723. };
  724. }, patchTextContent = (e, t) => {
  725. if (appData.BUILD.scoped && 2 & t.$flags$) {
  726. const t = Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
  727. Object.defineProperty(e, "__textContent", t), Object.defineProperty(e, "textContent", {
  728. get() {
  729. var e;
  730. const t = getHostSlotNode(this.childNodes, "");
  731. return 3 === (null === (e = null == t ? void 0 : t.nextSibling) || void 0 === e ? void 0 : e.nodeType) ? t.nextSibling.textContent : t ? t.textContent : this.__textContent;
  732. },
  733. set(e) {
  734. var t;
  735. const a = getHostSlotNode(this.childNodes, "");
  736. if (3 === (null === (t = null == a ? void 0 : a.nextSibling) || void 0 === t ? void 0 : t.nodeType)) a.nextSibling.textContent = e; else if (a) a.textContent = e; else {
  737. this.__textContent = e;
  738. const t = this["s-cr"];
  739. t && this.insertBefore(t, this.firstChild);
  740. }
  741. }
  742. });
  743. }
  744. }, patchChildSlotNodes = (e, t) => {
  745. class a extends Array {
  746. item(e) {
  747. return this[e];
  748. }
  749. }
  750. if (8 & t.$flags$) {
  751. const t = e.__lookupGetter__("childNodes");
  752. Object.defineProperty(e, "children", {
  753. get() {
  754. return this.childNodes.map((e => 1 === e.nodeType));
  755. }
  756. }), Object.defineProperty(e, "childElementCount", {
  757. get: () => e.children.length
  758. }), Object.defineProperty(e, "childNodes", {
  759. get() {
  760. const e = t.call(this);
  761. if (0 == (1 & plt.$flags$) && 2 & getHostRef(this).$flags$) {
  762. const t = new a;
  763. for (let a = 0; a < e.length; a++) {
  764. const o = e[a]["s-nr"];
  765. o && t.push(o);
  766. }
  767. return t;
  768. }
  769. return a.from(e);
  770. }
  771. });
  772. }
  773. }, getSlotName = e => e["s-sn"] || 1 === e.nodeType && e.getAttribute("slot") || "", getHostSlotNode = (e, t) => {
  774. let a, o = 0;
  775. for (;o < e.length; o++) {
  776. if (a = e[o], a["s-sr"] && a["s-sn"] === t) return a;
  777. if (a = getHostSlotNode(a.childNodes, t), a) return a;
  778. }
  779. return null;
  780. }, getHostSlotChildNodes = (e, t) => {
  781. const a = [ e ];
  782. for (;(e = e.nextSibling) && e["s-sn"] === t; ) a.push(e);
  783. return a;
  784. }, getAssetPath = e => {
  785. const t = new URL(e, plt.$resourcesUrl$);
  786. return t.origin !== win.location.origin ? t.href : t.pathname;
  787. }, parseVNodeAnnotations = (e, t, a, o) => {
  788. null != t && (null != t["s-nr"] && o.push(t), 1 === t.nodeType && t.childNodes.forEach((t => {
  789. const s = getHostRef(t);
  790. if (null != s && !a.staticComponents.has(t.nodeName.toLowerCase())) {
  791. const o = {
  792. nodeIds: 0
  793. };
  794. insertVNodeAnnotations(e, t, s.$vnode$, a, o);
  795. }
  796. parseVNodeAnnotations(e, t, a, o);
  797. })));
  798. }, insertVNodeAnnotations = (e, t, a, o, s) => {
  799. if (null != a) {
  800. const n = ++o.hostIds;
  801. if (t.setAttribute("s-id", n), null != t["s-cr"] && (t["s-cr"].nodeValue = `r.${n}`),
  802. null != a.$children$) {
  803. const t = 0;
  804. a.$children$.forEach(((a, o) => {
  805. insertChildVNodeAnnotations(e, a, s, n, t, o);
  806. }));
  807. }
  808. if (t && a && a.$elm$ && !t.hasAttribute("c-id")) {
  809. const e = t.parentElement;
  810. if (e && e.childNodes) {
  811. const o = Array.from(e.childNodes), s = o.find((e => 8 === e.nodeType && e["s-sr"]));
  812. if (s) {
  813. const e = o.indexOf(t) - 1;
  814. a.$elm$.setAttribute("c-id", `${s["s-host-id"]}.${s["s-node-id"]}.0.${e}`);
  815. }
  816. }
  817. }
  818. }
  819. }, insertChildVNodeAnnotations = (e, t, a, o, s, n) => {
  820. const l = t.$elm$;
  821. if (null == l) return;
  822. const r = a.nodeIds++, p = `${o}.${r}.${s}.${n}`;
  823. if (l["s-host-id"] = o, l["s-node-id"] = r, 1 === l.nodeType) l.setAttribute("c-id", p); else if (3 === l.nodeType) {
  824. const t = l.parentNode, a = t.nodeName;
  825. if ("STYLE" !== a && "SCRIPT" !== a) {
  826. const a = `t.${p}`, o = e.createComment(a);
  827. t.insertBefore(o, l);
  828. }
  829. } else if (8 === l.nodeType && l["s-sr"]) {
  830. const e = `s.${p}.${l["s-sn"] || ""}`;
  831. l.nodeValue = e;
  832. }
  833. if (null != t.$children$) {
  834. const n = s + 1;
  835. t.$children$.forEach(((t, s) => {
  836. insertChildVNodeAnnotations(e, t, a, o, n, s);
  837. }));
  838. }
  839. }, getHostRef = e => hostRefs.get(e), registerHost = (e, t) => {
  840. const a = {
  841. $flags$: 0,
  842. $hostElement$: e,
  843. $cmpMeta$: t,
  844. $instanceValues$: new Map,
  845. $renderCount$: 0
  846. };
  847. a.$onInstancePromise$ = new Promise((e => a.$onInstanceResolve$ = e)), a.$onReadyPromise$ = new Promise((e => a.$onReadyResolve$ = e)),
  848. e["s-p"] = [], e["s-rc"] = [], addHostEventListeners(e, a, t.$listeners$, !1), hostRefs.set(e, a);
  849. };
  850. Object.defineProperty(exports, "Env", {
  851. enumerable: !0,
  852. get: function() {
  853. return appData.Env;
  854. }
  855. }), exports.Build = {
  856. isDev: !0,
  857. isBrowser: !1,
  858. isServer: !0,
  859. isTesting: !0
  860. }, exports.Context = Context, exports.Fragment = (e, t) => t, exports.Host = Host,
  861. exports.addHostEventListeners = addHostEventListeners, exports.bootstrapLazy = (e, t = {}) => {
  862. appData.BUILD.profile && performance.mark && performance.mark("st:app:start"), (() => {
  863. if (appData.BUILD.devTools) {
  864. const e = win.stencil = win.stencil || {}, t = e.inspect;
  865. e.inspect = e => {
  866. let a = (e => {
  867. const t = getHostRef(e);
  868. if (!t) return;
  869. const a = t.$flags$, o = t.$hostElement$;
  870. return {
  871. renderCount: t.$renderCount$,
  872. flags: {
  873. hasRendered: !!(2 & a),
  874. hasConnected: !!(1 & a),
  875. isWaitingForChildren: !!(4 & a),
  876. isConstructingInstance: !!(8 & a),
  877. isQueuedForUpdate: !!(16 & a),
  878. hasInitializedComponent: !!(32 & a),
  879. hasLoadedComponent: !!(64 & a),
  880. isWatchReady: !!(128 & a),
  881. isListenReady: !!(256 & a),
  882. needsRerender: !!(512 & a)
  883. },
  884. instanceValues: t.$instanceValues$,
  885. ancestorComponent: t.$ancestorComponent$,
  886. hostElement: o,
  887. lazyInstance: t.$lazyInstance$,
  888. vnode: t.$vnode$,
  889. modeName: t.$modeName$,
  890. onReadyPromise: t.$onReadyPromise$,
  891. onReadyResolve: t.$onReadyResolve$,
  892. onInstancePromise: t.$onInstancePromise$,
  893. onInstanceResolve: t.$onInstanceResolve$,
  894. onRenderResolve: t.$onRenderResolve$,
  895. queuedListeners: t.$queuedListeners$,
  896. rmListeners: t.$rmListeners$,
  897. "s-id": o["s-id"],
  898. "s-cr": o["s-cr"],
  899. "s-lr": o["s-lr"],
  900. "s-p": o["s-p"],
  901. "s-rc": o["s-rc"],
  902. "s-sc": o["s-sc"]
  903. };
  904. })(e);
  905. return a || "function" != typeof t || (a = t(e)), a;
  906. };
  907. }
  908. })();
  909. const a = createTime("bootstrapLazy"), o = [], s = t.exclude || [], n = win.customElements, l = doc.head, r = l.querySelector("meta[charset]"), p = doc.createElement("style"), i = [], d = doc.querySelectorAll("[sty-id]");
  910. let c, $ = !0, u = 0;
  911. if (Object.assign(plt, t), plt.$resourcesUrl$ = new URL(t.resourcesUrl || "./", doc.baseURI).href,
  912. appData.BUILD.asyncQueue && t.syncQueue && (plt.$flags$ |= 4), appData.BUILD.hydrateClientSide && (plt.$flags$ |= 2),
  913. appData.BUILD.hydrateClientSide && appData.BUILD.shadowDom) for (;u < d.length; u++) registerStyle(d[u].getAttribute("sty-id"), d[u].innerHTML.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{"));
  914. e.map((e => {
  915. e[1].map((a => {
  916. const l = {
  917. $flags$: a[0],
  918. $tagName$: a[1],
  919. $members$: a[2],
  920. $listeners$: a[3]
  921. };
  922. appData.BUILD.member && (l.$members$ = a[2]), appData.BUILD.hostListener && (l.$listeners$ = a[3]),
  923. appData.BUILD.reflect && (l.$attrsToReflect$ = []), appData.BUILD.watchCallback && (l.$watchers$ = {}),
  924. appData.BUILD.shadowDom && !exports.supportsShadow && 1 & l.$flags$ && (l.$flags$ |= 8);
  925. const r = appData.BUILD.transformTagName && t.transformTagName ? t.transformTagName(l.$tagName$) : l.$tagName$, p = class extends HTMLElement {
  926. constructor(e) {
  927. super(e), registerHost(e = this, l), appData.BUILD.shadowDom && 1 & l.$flags$ && (exports.supportsShadow ? appData.BUILD.shadowDelegatesFocus ? e.attachShadow({
  928. mode: "open",
  929. delegatesFocus: !!(16 & l.$flags$)
  930. }) : e.attachShadow({
  931. mode: "open"
  932. }) : appData.BUILD.hydrateServerSide || "shadowRoot" in e || (e.shadowRoot = e)),
  933. appData.BUILD.slotChildNodesFix && patchChildSlotNodes(e, l);
  934. }
  935. connectedCallback() {
  936. c && (clearTimeout(c), c = null), $ ? i.push(this) : plt.jmp((() => connectedCallback(this)));
  937. }
  938. disconnectedCallback() {
  939. plt.jmp((() => disconnectedCallback(this)));
  940. }
  941. componentOnReady() {
  942. return getHostRef(this).$onReadyPromise$;
  943. }
  944. };
  945. appData.BUILD.cloneNodeFix && patchCloneNode(p.prototype), appData.BUILD.appendChildSlotFix && patchSlotAppendChild(p.prototype),
  946. appData.BUILD.hotModuleReplacement && (p.prototype["s-hmr"] = function(e) {
  947. ((e, t, a) => {
  948. const o = getHostRef(e);
  949. o.$flags$ = 1, e["s-hmr-load"] = () => {
  950. delete e["s-hmr-load"];
  951. }, initializeComponent(e, o, t);
  952. })(this, l);
  953. }), appData.BUILD.scopedSlotTextContentFix && patchTextContent(p.prototype, l),
  954. l.$lazyBundleId$ = e[0], s.includes(r) || n.get(r) || (o.push(r), n.define(r, proxyComponent(p, l, 1)));
  955. }));
  956. })), appData.BUILD.invisiblePrehydration && (appData.BUILD.hydratedClass || appData.BUILD.hydratedAttribute) && (p.innerHTML = o + "{visibility:hidden}.hydrated{visibility:inherit}",
  957. p.setAttribute("data-styles", ""), l.insertBefore(p, r ? r.nextSibling : l.firstChild)),
  958. $ = !1, i.length ? i.map((e => e.connectedCallback())) : appData.BUILD.profile ? plt.jmp((() => c = setTimeout(appDidLoad, 30, "timeout"))) : plt.jmp((() => c = setTimeout(appDidLoad, 30))),
  959. a();
  960. }, exports.connectedCallback = connectedCallback, exports.consoleDevError = consoleDevError,
  961. exports.consoleDevInfo = (...e) => {}, exports.consoleDevWarn = consoleDevWarn,
  962. exports.consoleError = consoleError, exports.createEvent = (e, t, a) => {
  963. const o = getElement(e);
  964. return {
  965. emit: e => (appData.BUILD.isDev && !o.isConnected && consoleDevWarn(`The "${t}" event was emitted, but the dispatcher node is no longer connected to the dom.`),
  966. emitEvent(o, t, {
  967. bubbles: !!(4 & a),
  968. composed: !!(2 & a),
  969. cancelable: !!(1 & a),
  970. detail: e
  971. }))
  972. };
  973. }, exports.defineCustomElement = (e, t) => {
  974. customElements.define(t[1], proxyCustomElement(e, t));
  975. }, exports.disconnectedCallback = disconnectedCallback, exports.doc = doc, exports.flushAll = flushAll,
  976. exports.flushLoadModule = flushLoadModule, exports.flushQueue = flushQueue, exports.forceModeUpdate = e => {
  977. if (appData.BUILD.style && appData.BUILD.mode && !appData.BUILD.lazyLoad) {
  978. const t = computeMode(e), a = getHostRef(e);
  979. if (a.$modeName$ !== t) {
  980. const o = a.$cmpMeta$, s = e["s-sc"], n = getScopeId(o, t), l = e.constructor.style[t];
  981. o.$flags$, l && (styles.has(n) || registerStyle(n, l), a.$modeName$ = t, e.classList.remove(s + "-h", s + "-s"),
  982. attachStyles(a), forceUpdate(e));
  983. }
  984. }
  985. }, exports.forceUpdate = forceUpdate, exports.getAssetPath = getAssetPath, exports.getConnect = (e, t) => {
  986. const a = () => {
  987. let e = doc.querySelector(t);
  988. return e || (e = doc.createElement(t), doc.body.appendChild(e)), "function" == typeof e.componentOnReady ? e.componentOnReady() : Promise.resolve(e);
  989. };
  990. return {
  991. create: (...e) => a().then((t => t.create(...e))),
  992. componentOnReady: a
  993. };
  994. }, exports.getContext = (e, t) => t in Context ? Context[t] : "window" === t ? win : "document" === t ? doc : "isServer" === t || "isPrerender" === t ? !!appData.BUILD.hydrateServerSide : "isClient" === t ? !appData.BUILD.hydrateServerSide : "resourcesUrl" === t || "publicPath" === t ? getAssetPath(".") : "queue" === t ? {
  995. write: writeTask,
  996. read: readTask,
  997. tick: {
  998. then: e => nextTick(e)
  999. }
  1000. } : void 0, exports.getElement = getElement, exports.getHostRef = getHostRef, exports.getMode = e => getHostRef(e).$modeName$,
  1001. exports.getRenderingRef = () => renderingRef, exports.getValue = getValue, exports.h = h,
  1002. exports.insertVdomAnnotations = (e, t) => {
  1003. if (null != e) {
  1004. const a = {
  1005. hostIds: 0,
  1006. rootLevelIds: 0,
  1007. staticComponents: new Set(t)
  1008. }, o = [];
  1009. parseVNodeAnnotations(e, e.body, a, o), o.forEach((t => {
  1010. if (null != t) {
  1011. const o = t["s-nr"];
  1012. let s = o["s-host-id"], n = o["s-node-id"], l = `${s}.${n}`;
  1013. if (null == s) if (s = 0, a.rootLevelIds++, n = a.rootLevelIds, l = `${s}.${n}`,
  1014. 1 === o.nodeType) o.setAttribute("c-id", l); else if (3 === o.nodeType) {
  1015. if (0 === s && "" === o.nodeValue.trim()) return void t.remove();
  1016. const a = e.createComment(l);
  1017. a.nodeValue = `t.${l}`, o.parentNode.insertBefore(a, o);
  1018. }
  1019. let r = `o.${l}`;
  1020. const p = t.parentElement;
  1021. p && ("" === p["s-en"] ? r += "." : "c" === p["s-en"] && (r += ".c")), t.nodeValue = r;
  1022. }
  1023. }));
  1024. }
  1025. }, exports.isMemberInElement = isMemberInElement, exports.loadModule = loadModule,
  1026. exports.modeResolutionChain = modeResolutionChain, exports.nextTick = nextTick,
  1027. exports.parsePropertyValue = parsePropertyValue, exports.plt = plt, exports.postUpdateComponent = postUpdateComponent,
  1028. exports.proxyComponent = proxyComponent, exports.proxyCustomElement = proxyCustomElement,
  1029. exports.readTask = readTask, exports.registerComponents = e => {
  1030. e.forEach((e => {
  1031. cstrs.set(e.COMPILER_META.tagName, e);
  1032. }));
  1033. }, exports.registerContext = function registerContext(e) {
  1034. e && Object.assign(Context, e);
  1035. }, exports.registerHost = registerHost, exports.registerInstance = (e, t) => {
  1036. if (null == e || null == e.constructor) throw new Error("Invalid component constructor");
  1037. if (null == t) {
  1038. const a = e.constructor, o = a.COMPILER_META && a.COMPILER_META.tagName ? a.COMPILER_META.tagName : "div", s = document.createElement(o);
  1039. registerHost(s, {
  1040. $flags$: 0,
  1041. $tagName$: o
  1042. }), t = getHostRef(s);
  1043. }
  1044. return t.$lazyInstance$ = e, hostRefs.set(e, t);
  1045. }, exports.registerModule = function registerModule(e, t) {
  1046. moduleLoaded.set(e, t);
  1047. }, exports.renderVdom = renderVdom, exports.resetPlatform = function resetPlatform() {
  1048. win && "function" == typeof win.close && win.close(), hostRefs.clear(), styles.clear(),
  1049. plt.$flags$ = 0, Object.keys(Context).forEach((e => delete Context[e])), null != plt.$orgLocNodes$ && (plt.$orgLocNodes$.clear(),
  1050. plt.$orgLocNodes$ = void 0), win.location.href = plt.$resourcesUrl$ = "http://testing.stenciljs.com/",
  1051. function e() {
  1052. queuedTicks.length = 0, queuedWriteTasks.length = 0, queuedReadTasks.length = 0,
  1053. moduleLoaded.clear(), queuedLoadModules.length = 0, caughtErrors.length = 0;
  1054. }(), stopAutoApplyChanges(), cstrs.clear();
  1055. }, exports.setAssetPath = e => plt.$resourcesUrl$ = e, exports.setErrorHandler = e => customError = e,
  1056. exports.setMode = e => modeResolutionChain.push(e), exports.setPlatformHelpers = e => {
  1057. Object.assign(plt, e);
  1058. }, exports.setPlatformOptions = e => Object.assign(plt, e), exports.setSupportsShadowDom = e => {
  1059. exports.supportsShadow = e;
  1060. }, exports.setValue = setValue, exports.startAutoApplyChanges = async function e() {
  1061. isAutoApplyingChanges = !0, flushAll().then((() => {
  1062. isAutoApplyingChanges && (autoApplyTimer = setTimeout((() => {
  1063. e();
  1064. }), 100));
  1065. }));
  1066. }, exports.stopAutoApplyChanges = stopAutoApplyChanges, exports.styles = styles,
  1067. exports.supportsConstructibleStylesheets = !1, exports.supportsListenerOptions = !0,
  1068. exports.win = win, exports.writeTask = writeTask;