"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/testing/platform/index.ts var platform_exports = {}; __export(platform_exports, { Build: () => Build, Env: () => import_app_data21.Env, Fragment: () => Fragment, Host: () => Host, addHostEventListeners: () => addHostEventListeners, bootstrapLazy: () => bootstrapLazy, connectedCallback: () => connectedCallback, consoleDevError: () => consoleDevError, consoleDevInfo: () => consoleDevInfo, consoleDevWarn: () => consoleDevWarn, consoleError: () => consoleError, createEvent: () => createEvent, defineCustomElement: () => defineCustomElement, disconnectedCallback: () => disconnectedCallback, doc: () => doc, flushAll: () => flushAll, flushLoadModule: () => flushLoadModule, flushQueue: () => flushQueue, forceModeUpdate: () => forceModeUpdate, forceUpdate: () => forceUpdate, getAssetPath: () => getAssetPath, getElement: () => getElement, getHostRef: () => getHostRef, getMode: () => getMode, getRenderingRef: () => getRenderingRef, getValue: () => getValue, h: () => h, insertVdomAnnotations: () => insertVdomAnnotations, isMemberInElement: () => isMemberInElement, loadModule: () => loadModule, modeResolutionChain: () => modeResolutionChain, nextTick: () => nextTick, parsePropertyValue: () => parsePropertyValue, plt: () => plt, postUpdateComponent: () => postUpdateComponent, proxyComponent: () => proxyComponent, proxyCustomElement: () => proxyCustomElement, readTask: () => readTask, registerComponents: () => registerComponents, registerHost: () => registerHost, registerInstance: () => registerInstance, registerModule: () => registerModule, renderVdom: () => renderVdom, resetPlatform: () => resetPlatform, setAssetPath: () => setAssetPath, setErrorHandler: () => setErrorHandler, setMode: () => setMode, setNonce: () => setNonce, setPlatformHelpers: () => setPlatformHelpers, setPlatformOptions: () => setPlatformOptions, setSupportsShadowDom: () => setSupportsShadowDom, setValue: () => setValue, startAutoApplyChanges: () => startAutoApplyChanges, stopAutoApplyChanges: () => stopAutoApplyChanges, styles: () => styles, supportsConstructableStylesheets: () => supportsConstructableStylesheets, supportsListenerOptions: () => supportsListenerOptions, supportsShadow: () => supportsShadow, win: () => win, writeTask: () => writeTask }); module.exports = __toCommonJS(platform_exports); // src/testing/platform/testing-build.ts var Build = { isDev: true, isBrowser: false, isServer: true, isTesting: true }; // src/testing/platform/testing-constants.ts var styles = /* @__PURE__ */ new Map(); var modeResolutionChain = []; var cstrs = /* @__PURE__ */ new Map(); var queuedTicks = []; var queuedWriteTasks = []; var queuedReadTasks = []; var moduleLoaded = /* @__PURE__ */ new Map(); var queuedLoadModules = []; var caughtErrors = []; var hostRefs = /* @__PURE__ */ new Map(); // src/testing/platform/testing-host-ref.ts var getHostRef = (elm) => { return hostRefs.get(elm); }; var registerInstance = (lazyInstance, hostRef) => { if (lazyInstance == null || lazyInstance.constructor == null) { throw new Error(`Invalid component constructor`); } if (hostRef == null) { const Cstr = lazyInstance.constructor; const tagName = Cstr.COMPILER_META && Cstr.COMPILER_META.tagName ? Cstr.COMPILER_META.tagName : "div"; const elm = document.createElement(tagName); registerHost(elm, { $flags$: 0, $tagName$: tagName }); hostRef = getHostRef(elm); } hostRef.$lazyInstance$ = lazyInstance; return hostRefs.set(lazyInstance, hostRef); }; var registerHost = (elm, cmpMeta) => { const hostRef = { $flags$: 0, $hostElement$: elm, $cmpMeta$: cmpMeta, $instanceValues$: /* @__PURE__ */ new Map(), $renderCount$: 0 }; hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r); hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r); elm["s-p"] = []; elm["s-rc"] = []; hostRefs.set(elm, hostRef); }; // src/testing/platform/testing-log.ts var customError; var defaultConsoleError = (e) => { caughtErrors.push(e); }; var consoleError = (e, el) => (customError || defaultConsoleError)(e, el); var consoleDevError = (...e) => { caughtErrors.push(new Error(e.join(", "))); }; var consoleDevWarn = (...args) => { const params = args.filter((a) => typeof a === "string" || typeof a === "number" || typeof a === "boolean"); console.warn(...params); }; var consoleDevInfo = (..._) => { }; var setErrorHandler = (handler) => customError = handler; // src/testing/platform/testing-task-queue.ts function resetTaskQueue() { queuedTicks.length = 0; queuedWriteTasks.length = 0; queuedReadTasks.length = 0; moduleLoaded.clear(); queuedLoadModules.length = 0; caughtErrors.length = 0; } var nextTick = (cb) => { queuedTicks.push(cb); }; function flushTicks() { return new Promise((resolve, reject) => { function drain() { try { if (queuedTicks.length > 0) { const writeTasks = queuedTicks.slice(); queuedTicks.length = 0; let cb; while (cb = writeTasks.shift()) { cb(Date.now()); } } if (queuedTicks.length > 0) { process.nextTick(drain); } else { resolve(); } } catch (e) { reject(`flushTicks: ${e}`); } } process.nextTick(drain); }); } function writeTask(cb) { queuedWriteTasks.push(cb); } function readTask(cb) { queuedReadTasks.push(cb); } function flushQueue() { return new Promise((resolve, reject) => { async function drain() { try { if (queuedReadTasks.length > 0) { const readTasks = queuedReadTasks.slice(); queuedReadTasks.length = 0; let cb; while (cb = readTasks.shift()) { const result = cb(Date.now()); if (result != null && typeof result.then === "function") { await result; } } } if (queuedWriteTasks.length > 0) { const writeTasks = queuedWriteTasks.slice(); queuedWriteTasks.length = 0; let cb; while (cb = writeTasks.shift()) { const result = cb(Date.now()); if (result != null && typeof result.then === "function") { await result; } } } if (queuedReadTasks.length + queuedWriteTasks.length > 0) { process.nextTick(drain); } else { resolve(); } } catch (e) { reject(`flushQueue: ${e}`); } } process.nextTick(drain); }); } async function flushAll() { while (queuedTicks.length + queuedLoadModules.length + queuedWriteTasks.length + queuedReadTasks.length > 0) { await flushTicks(); await flushLoadModule(); await flushQueue(); } if (caughtErrors.length > 0) { const err2 = caughtErrors[0]; if (err2 == null) { throw new Error("Error!"); } if (typeof err2 === "string") { throw new Error(err2); } throw err2; } return new Promise((resolve) => process.nextTick(resolve)); } function loadModule(cmpMeta, _hostRef, _hmrVersionId) { return new Promise((resolve) => { queuedLoadModules.push({ bundleId: cmpMeta.$lazyBundleId$, resolve: () => resolve(moduleLoaded.get(cmpMeta.$lazyBundleId$)) }); }); } function flushLoadModule(bundleId) { return new Promise((resolve, reject) => { try { process.nextTick(() => { if (bundleId != null) { for (let i2 = 0; i2 < queuedLoadModules.length; i2++) { if (queuedLoadModules[i2].bundleId === bundleId) { queuedLoadModules[i2].resolve(); queuedLoadModules.splice(i2, 1); i2--; } } } else { let queuedLoadModule; while (queuedLoadModule = queuedLoadModules.shift()) { queuedLoadModule.resolve(); } } resolve(); }); } catch (e) { reject(`flushLoadModule: ${e}`); } }); } // src/testing/platform/testing-window.ts var import_mock_doc = require("../../mock-doc/index.cjs"); var win = (0, import_mock_doc.setupGlobal)(global); var doc = win.document; // src/testing/platform/testing-platform.ts var supportsShadow = true; var plt = { $flags$: 0, $resourcesUrl$: "", jmp: (h2) => h2(), raf: (h2) => requestAnimationFrame(h2), ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts), rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts), ce: (eventName, opts) => new win.CustomEvent(eventName, opts) }; var setPlatformHelpers = (helpers) => { Object.assign(plt, helpers); }; var supportsListenerOptions = true; var supportsConstructableStylesheets = false; var setSupportsShadowDom = (supports) => { supportsShadow = supports; }; function resetPlatform(defaults = {}) { if (win && typeof win.close === "function") { win.close(); } hostRefs.clear(); styles.clear(); plt.$flags$ = 0; Object.assign(plt, defaults); if (plt.$orgLocNodes$ != null) { plt.$orgLocNodes$.clear(); plt.$orgLocNodes$ = void 0; } win.location.href = plt.$resourcesUrl$ = `http://testing.stenciljs.com/`; resetTaskQueue(); stopAutoApplyChanges(); cstrs.clear(); } var isAutoApplyingChanges = false; var autoApplyTimer = void 0; function stopAutoApplyChanges() { isAutoApplyingChanges = false; if (autoApplyTimer) { clearTimeout(autoApplyTimer); autoApplyTimer = void 0; } } async function startAutoApplyChanges() { isAutoApplyingChanges = true; flushAll().then(() => { if (isAutoApplyingChanges) { autoApplyTimer = setTimeout(() => { startAutoApplyChanges(); }, 100); } }); } var registerComponents = (Cstrs) => { Cstrs.filter((Cstr) => Cstr.COMPILER_META).forEach((Cstr) => { cstrs.set(Cstr.COMPILER_META.tagName, Cstr); }); }; function registerModule(bundleId, Cstr) { moduleLoaded.set(bundleId, Cstr); } var isMemberInElement = (elm, memberName) => { if (elm != null) { if (memberName in elm) { return true; } const nodeName = elm.nodeName; if (nodeName) { const cstr = cstrs.get(nodeName.toLowerCase()); if (cstr != null && cstr.COMPILER_META != null && cstr.COMPILER_META.properties != null) { return cstr.COMPILER_META.properties.some((p) => p.name === memberName); } } } return false; }; // src/testing/platform/index.ts var import_app_data21 = require("@stencil/core/internal/app-data"); // src/runtime/asset-path.ts var getAssetPath = (path) => { const assetUrl = new URL(path, plt.$resourcesUrl$); return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname; }; var setAssetPath = (path) => plt.$resourcesUrl$ = path; // src/runtime/bootstrap-custom-element.ts var import_app_data18 = require("@stencil/core/internal/app-data"); // src/utils/constants.ts var EMPTY_OBJ = {}; var SVG_NS = "http://www.w3.org/2000/svg"; var HTML_NS = "http://www.w3.org/1999/xhtml"; // src/utils/helpers.ts var isDef = (v) => v != null; var isComplexType = (o) => { o = typeof o; return o === "object" || o === "function"; }; // src/utils/query-nonce-meta-tag-content.ts function queryNonceMetaTagContent(doc2) { var _a, _b, _c; return (_c = (_b = (_a = doc2.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0; } // src/utils/result.ts var result_exports = {}; __export(result_exports, { err: () => err, map: () => map, ok: () => ok, unwrap: () => unwrap, unwrapErr: () => unwrapErr }); var ok = (value) => ({ isOk: true, isErr: false, value }); var err = (value) => ({ isOk: false, isErr: true, value }); function map(result, fn) { if (result.isOk) { const val = fn(result.value); if (val instanceof Promise) { return val.then((newVal) => ok(newVal)); } else { return ok(val); } } if (result.isErr) { const value = result.value; return err(value); } throw "should never get here"; } var unwrap = (result) => { if (result.isOk) { return result.value; } else { throw result.value; } }; var unwrapErr = (result) => { if (result.isErr) { return result.value; } else { throw result.value; } }; // src/runtime/connected-callback.ts var import_app_data15 = require("@stencil/core/internal/app-data"); // src/runtime/client-hydrate.ts var import_app_data3 = require("@stencil/core/internal/app-data"); // src/runtime/profile.ts var import_app_data = require("@stencil/core/internal/app-data"); var i = 0; var createTime = (fnName, tagName = "") => { if (import_app_data.BUILD.profile && performance.mark) { const key = `st:${fnName}:${tagName}:${i++}`; performance.mark(key); return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key); } else { return () => { return; }; } }; var uniqueTime = (key, measureText) => { if (import_app_data.BUILD.profile && performance.mark) { if (performance.getEntriesByName(key, "mark").length === 0) { performance.mark(key); } return () => { if (performance.getEntriesByName(measureText, "measure").length === 0) { performance.measure(measureText, key); } }; } else { return () => { return; }; } }; var inspect = (ref) => { const hostRef = getHostRef(ref); if (!hostRef) { return void 0; } const flags = hostRef.$flags$; const hostElement = hostRef.$hostElement$; return { renderCount: hostRef.$renderCount$, flags: { hasRendered: !!(flags & 2 /* hasRendered */), hasConnected: !!(flags & 1 /* hasConnected */), isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */), isConstructingInstance: !!(flags & 8 /* isConstructingInstance */), isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */), hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */), hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */), isWatchReady: !!(flags & 128 /* isWatchReady */), isListenReady: !!(flags & 256 /* isListenReady */), needsRerender: !!(flags & 512 /* needsRerender */) }, instanceValues: hostRef.$instanceValues$, ancestorComponent: hostRef.$ancestorComponent$, hostElement, lazyInstance: hostRef.$lazyInstance$, vnode: hostRef.$vnode$, modeName: hostRef.$modeName$, onReadyPromise: hostRef.$onReadyPromise$, onReadyResolve: hostRef.$onReadyResolve$, onInstancePromise: hostRef.$onInstancePromise$, onInstanceResolve: hostRef.$onInstanceResolve$, onRenderResolve: hostRef.$onRenderResolve$, queuedListeners: hostRef.$queuedListeners$, rmListeners: hostRef.$rmListeners$, ["s-id"]: hostElement["s-id"], ["s-cr"]: hostElement["s-cr"], ["s-lr"]: hostElement["s-lr"], ["s-p"]: hostElement["s-p"], ["s-rc"]: hostElement["s-rc"], ["s-sc"]: hostElement["s-sc"] }; }; var installDevTools = () => { if (import_app_data.BUILD.devTools) { const stencil = win.stencil = win.stencil || {}; const originalInspect = stencil.inspect; stencil.inspect = (ref) => { let result = inspect(ref); if (!result && typeof originalInspect === "function") { result = originalInspect(ref); } return result; }; } }; // src/runtime/runtime-constants.ts var CONTENT_REF_ID = "r"; var ORG_LOCATION_ID = "o"; var SLOT_NODE_ID = "s"; var TEXT_NODE_ID = "t"; var HYDRATE_ID = "s-id"; var HYDRATED_STYLE_ID = "sty-id"; var HYDRATE_CHILD_ID = "c-id"; var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}"; var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}"; var XLINK_NS = "http://www.w3.org/1999/xlink"; var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [ "formAssociatedCallback", "formResetCallback", "formDisabledCallback", "formStateRestoreCallback" ]; // src/runtime/vdom/h.ts var import_app_data2 = require("@stencil/core/internal/app-data"); var h = (nodeName, vnodeData, ...children) => { let child = null; let key = null; let slotName = null; let simple = false; let lastSimple = false; const vNodeChildren = []; const walk = (c) => { for (let i2 = 0; i2 < c.length; i2++) { child = c[i2]; if (Array.isArray(child)) { walk(child); } else if (child != null && typeof child !== "boolean") { if (simple = typeof nodeName !== "function" && !isComplexType(child)) { child = String(child); } else if (import_app_data2.BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) { consoleDevError(`vNode passed as children has unexpected type. Make sure it's using the correct h() function. Empty objects can also be the cause, look for JSX comments that became objects.`); } if (simple && lastSimple) { vNodeChildren[vNodeChildren.length - 1].$text$ += child; } else { vNodeChildren.push(simple ? newVNode(null, child) : child); } lastSimple = simple; } } }; walk(children); if (vnodeData) { if (import_app_data2.BUILD.isDev && nodeName === "input") { validateInputProperties(vnodeData); } if (import_app_data2.BUILD.vdomKey && vnodeData.key) { key = vnodeData.key; } if (import_app_data2.BUILD.slotRelocation && vnodeData.name) { slotName = vnodeData.name; } if (import_app_data2.BUILD.vdomClass) { const classData = vnodeData.className || vnodeData.class; if (classData) { vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" "); } } } if (import_app_data2.BUILD.isDev && vNodeChildren.some(isHost)) { consoleDevError(`The must be the single root component. Make sure: - You are NOT using hostData() and in the same component. - is used once, and it's the single root component of the render() function.`); } if (import_app_data2.BUILD.vdomFunctional && typeof nodeName === "function") { return nodeName( vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils ); } const vnode = newVNode(nodeName, null); vnode.$attrs$ = vnodeData; if (vNodeChildren.length > 0) { vnode.$children$ = vNodeChildren; } if (import_app_data2.BUILD.vdomKey) { vnode.$key$ = key; } if (import_app_data2.BUILD.slotRelocation) { vnode.$name$ = slotName; } return vnode; }; var newVNode = (tag, text) => { const vnode = { $flags$: 0, $tag$: tag, $text$: text, $elm$: null, $children$: null }; if (import_app_data2.BUILD.vdomAttribute) { vnode.$attrs$ = null; } if (import_app_data2.BUILD.vdomKey) { vnode.$key$ = null; } if (import_app_data2.BUILD.slotRelocation) { vnode.$name$ = null; } return vnode; }; var Host = {}; var isHost = (node) => node && node.$tag$ === Host; var vdomFnUtils = { forEach: (children, cb) => children.map(convertToPublic).forEach(cb), map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate) }; var convertToPublic = (node) => ({ vattrs: node.$attrs$, vchildren: node.$children$, vkey: node.$key$, vname: node.$name$, vtag: node.$tag$, vtext: node.$text$ }); var convertToPrivate = (node) => { if (typeof node.vtag === "function") { const vnodeData = { ...node.vattrs }; if (node.vkey) { vnodeData.key = node.vkey; } if (node.vname) { vnodeData.name = node.vname; } return h(node.vtag, vnodeData, ...node.vchildren || []); } const vnode = newVNode(node.vtag, node.vtext); vnode.$attrs$ = node.vattrs; vnode.$children$ = node.vchildren; vnode.$key$ = node.vkey; vnode.$name$ = node.vname; return vnode; }; var validateInputProperties = (inputElm) => { const props = Object.keys(inputElm); const value = props.indexOf("value"); if (value === -1) { return; } const typeIndex = props.indexOf("type"); const minIndex = props.indexOf("min"); const maxIndex = props.indexOf("max"); const stepIndex = props.indexOf("step"); if (value < typeIndex || value < minIndex || value < maxIndex || value < stepIndex) { consoleDevWarn(`The "value" prop of should be set after "min", "max", "type" and "step"`); } }; // src/runtime/client-hydrate.ts var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => { const endHydrate = createTime("hydrateClient", tagName); const shadowRoot = hostElm.shadowRoot; const childRenderNodes = []; const slotNodes = []; const shadowRootNodes = import_app_data3.BUILD.shadowDom && shadowRoot ? [] : null; const vnode = hostRef.$vnode$ = newVNode(tagName, null); if (!plt.$orgLocNodes$) { initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map()); } hostElm[HYDRATE_ID] = hostId; hostElm.removeAttribute(HYDRATE_ID); clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId); childRenderNodes.map((c) => { const orgLocationId = c.$hostId$ + "." + c.$nodeId$; const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId); const node = c.$elm$; if (orgLocationNode && supportsShadow && orgLocationNode["s-en"] === "") { orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling); } if (!shadowRoot) { node["s-hn"] = tagName; if (orgLocationNode) { node["s-ol"] = orgLocationNode; node["s-ol"]["s-nr"] = node; } } plt.$orgLocNodes$.delete(orgLocationId); }); if (import_app_data3.BUILD.shadowDom && shadowRoot) { shadowRootNodes.map((shadowRootNode) => { if (shadowRootNode) { shadowRoot.appendChild(shadowRootNode); } }); } endHydrate(); }; var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => { let childNodeType; let childIdSplt; let childVNode; let i2; if (node.nodeType === 1 /* ElementNode */) { childNodeType = node.getAttribute(HYDRATE_CHILD_ID); if (childNodeType) { childIdSplt = childNodeType.split("."); if (childIdSplt[0] === hostId || childIdSplt[0] === "0") { childVNode = { $flags$: 0, $hostId$: childIdSplt[0], $nodeId$: childIdSplt[1], $depth$: childIdSplt[2], $index$: childIdSplt[3], $tag$: node.tagName.toLowerCase(), $elm$: node, $attrs$: null, $children$: null, $key$: null, $name$: null, $text$: null }; childRenderNodes.push(childVNode); node.removeAttribute(HYDRATE_CHILD_ID); if (!parentVNode.$children$) { parentVNode.$children$ = []; } parentVNode.$children$[childVNode.$index$] = childVNode; parentVNode = childVNode; if (shadowRootNodes && childVNode.$depth$ === "0") { shadowRootNodes[childVNode.$index$] = childVNode.$elm$; } } } if (node.shadowRoot) { for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) { clientHydrate( parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i2], hostId ); } } for (i2 = node.childNodes.length - 1; i2 >= 0; i2--) { clientHydrate( parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i2], hostId ); } } else if (node.nodeType === 8 /* CommentNode */) { childIdSplt = node.nodeValue.split("."); if (childIdSplt[1] === hostId || childIdSplt[1] === "0") { childNodeType = childIdSplt[0]; childVNode = { $flags$: 0, $hostId$: childIdSplt[1], $nodeId$: childIdSplt[2], $depth$: childIdSplt[3], $index$: childIdSplt[4], $elm$: node, $attrs$: null, $children$: null, $key$: null, $name$: null, $tag$: null, $text$: null }; if (childNodeType === TEXT_NODE_ID) { childVNode.$elm$ = node.nextSibling; if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) { childVNode.$text$ = childVNode.$elm$.textContent; childRenderNodes.push(childVNode); node.remove(); if (!parentVNode.$children$) { parentVNode.$children$ = []; } parentVNode.$children$[childVNode.$index$] = childVNode; if (shadowRootNodes && childVNode.$depth$ === "0") { shadowRootNodes[childVNode.$index$] = childVNode.$elm$; } } } else if (childVNode.$hostId$ === hostId) { if (childNodeType === SLOT_NODE_ID) { childVNode.$tag$ = "slot"; if (childIdSplt[5]) { node["s-sn"] = childVNode.$name$ = childIdSplt[5]; } else { node["s-sn"] = ""; } node["s-sr"] = true; if (import_app_data3.BUILD.shadowDom && shadowRootNodes) { childVNode.$elm$ = doc.createElement(childVNode.$tag$); if (childVNode.$name$) { childVNode.$elm$.setAttribute("name", childVNode.$name$); } node.parentNode.insertBefore(childVNode.$elm$, node); node.remove(); if (childVNode.$depth$ === "0") { shadowRootNodes[childVNode.$index$] = childVNode.$elm$; } } slotNodes.push(childVNode); if (!parentVNode.$children$) { parentVNode.$children$ = []; } parentVNode.$children$[childVNode.$index$] = childVNode; } else if (childNodeType === CONTENT_REF_ID) { if (import_app_data3.BUILD.shadowDom && shadowRootNodes) { node.remove(); } else if (import_app_data3.BUILD.slotRelocation) { hostElm["s-cr"] = node; node["s-cn"] = true; } } } } } else if (parentVNode && parentVNode.$tag$ === "style") { const vnode = newVNode(null, node.textContent); vnode.$elm$ = node; vnode.$index$ = "0"; parentVNode.$children$ = [vnode]; } }; var initializeDocumentHydrate = (node, orgLocNodes) => { if (node.nodeType === 1 /* ElementNode */) { let i2 = 0; if (node.shadowRoot) { for (; i2 < node.shadowRoot.childNodes.length; i2++) { initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes); } } for (i2 = 0; i2 < node.childNodes.length; i2++) { initializeDocumentHydrate(node.childNodes[i2], orgLocNodes); } } else if (node.nodeType === 8 /* CommentNode */) { const childIdSplt = node.nodeValue.split("."); if (childIdSplt[0] === ORG_LOCATION_ID) { orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node); node.nodeValue = ""; node["s-en"] = childIdSplt[3]; } } }; // src/runtime/initialize-component.ts var import_app_data14 = require("@stencil/core/internal/app-data"); // src/runtime/mode.ts var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m); var setMode = (handler) => modeResolutionChain.push(handler); var getMode = (ref) => getHostRef(ref).$modeName$; // src/runtime/proxy-component.ts var import_app_data13 = require("@stencil/core/internal/app-data"); // src/runtime/set-value.ts var import_app_data12 = require("@stencil/core/internal/app-data"); // src/runtime/parse-property-value.ts var import_app_data4 = require("@stencil/core/internal/app-data"); var parsePropertyValue = (propValue, propType) => { if (propValue != null && !isComplexType(propValue)) { if (import_app_data4.BUILD.propBoolean && propType & 4 /* Boolean */) { return propValue === "false" ? false : propValue === "" || !!propValue; } if (import_app_data4.BUILD.propNumber && propType & 2 /* Number */) { return parseFloat(propValue); } if (import_app_data4.BUILD.propString && propType & 1 /* String */) { return String(propValue); } return propValue; } return propValue; }; // src/runtime/update-component.ts var import_app_data11 = require("@stencil/core/internal/app-data"); // src/runtime/event-emitter.ts var import_app_data6 = require("@stencil/core/internal/app-data"); // src/runtime/element.ts var import_app_data5 = require("@stencil/core/internal/app-data"); var getElement = (ref) => import_app_data5.BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref; // src/runtime/event-emitter.ts var createEvent = (ref, name, flags) => { const elm = getElement(ref); return { emit: (detail) => { if (import_app_data6.BUILD.isDev && !elm.isConnected) { consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`); } return emitEvent(elm, name, { bubbles: !!(flags & 4 /* Bubbles */), composed: !!(flags & 2 /* Composed */), cancelable: !!(flags & 1 /* Cancellable */), detail }); } }; }; var emitEvent = (elm, name, opts) => { const ev = plt.ce(name, opts); elm.dispatchEvent(ev); return ev; }; // src/runtime/styles.ts var import_app_data7 = require("@stencil/core/internal/app-data"); var rootAppliedStyles = /* @__PURE__ */ new WeakMap(); var registerStyle = (scopeId2, cssText, allowCS) => { let style = styles.get(scopeId2); if (supportsConstructableStylesheets && allowCS) { style = style || new CSSStyleSheet(); if (typeof style === "string") { style = cssText; } else { style.replaceSync(cssText); } } else { style = cssText; } styles.set(scopeId2, style); }; var addStyle = (styleContainerNode, cmpMeta, mode) => { var _a; const scopeId2 = getScopeId(cmpMeta, mode); const style = styles.get(scopeId2); if (!import_app_data7.BUILD.attachStyles) { return scopeId2; } styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc; if (style) { if (typeof style === "string") { styleContainerNode = styleContainerNode.head || styleContainerNode; let appliedStyles = rootAppliedStyles.get(styleContainerNode); let styleElm; if (!appliedStyles) { rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set()); } if (!appliedStyles.has(scopeId2)) { if (import_app_data7.BUILD.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) { styleElm.innerHTML = style; } else { styleElm = doc.createElement("style"); styleElm.innerHTML = style; const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc); if (nonce != null) { styleElm.setAttribute("nonce", nonce); } if ((import_app_data7.BUILD.hydrateServerSide || import_app_data7.BUILD.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) { styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2); } const injectStyle = ( /** * we render a scoped component */ !(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) || /** * we are using shadow dom and render the style tag within the shadowRoot */ cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD" ); if (injectStyle) { styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link")); } } if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) { styleElm.innerHTML += SLOT_FB_CSS; } if (appliedStyles) { appliedStyles.add(scopeId2); } } } else if (import_app_data7.BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) { styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style]; } } return scopeId2; }; var attachStyles = (hostRef) => { const cmpMeta = hostRef.$cmpMeta$; const elm = hostRef.$hostElement$; const flags = cmpMeta.$flags$; const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$); const scopeId2 = addStyle( import_app_data7.BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$ ); if ((import_app_data7.BUILD.shadowDom || import_app_data7.BUILD.scoped) && import_app_data7.BUILD.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) { elm["s-sc"] = scopeId2; elm.classList.add(scopeId2 + "-h"); if (import_app_data7.BUILD.scoped && flags & 2 /* scopedCssEncapsulation */) { elm.classList.add(scopeId2 + "-s"); } } endAttachStyles(); }; var getScopeId = (cmp, mode) => "sc-" + (import_app_data7.BUILD.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$); // src/runtime/vdom/vdom-render.ts var import_app_data10 = require("@stencil/core/internal/app-data"); // src/runtime/vdom/update-element.ts var import_app_data9 = require("@stencil/core/internal/app-data"); // src/runtime/vdom/set-accessor.ts var import_app_data8 = require("@stencil/core/internal/app-data"); var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => { if (oldValue !== newValue) { let isProp = isMemberInElement(elm, memberName); let ln = memberName.toLowerCase(); if (import_app_data8.BUILD.vdomClass && memberName === "class") { const classList = elm.classList; const oldClasses = parseClassList(oldValue); const newClasses = parseClassList(newValue); classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c))); classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c))); } else if (import_app_data8.BUILD.vdomStyle && memberName === "style") { if (import_app_data8.BUILD.updatable) { for (const prop in oldValue) { if (!newValue || newValue[prop] == null) { if (!import_app_data8.BUILD.hydrateServerSide && prop.includes("-")) { elm.style.removeProperty(prop); } else { elm.style[prop] = ""; } } } } for (const prop in newValue) { if (!oldValue || newValue[prop] !== oldValue[prop]) { if (!import_app_data8.BUILD.hydrateServerSide && prop.includes("-")) { elm.style.setProperty(prop, newValue[prop]); } else { elm.style[prop] = newValue[prop]; } } } } else if (import_app_data8.BUILD.vdomKey && memberName === "key") { } else if (import_app_data8.BUILD.vdomRef && memberName === "ref") { if (newValue) { newValue(elm); } } else if (import_app_data8.BUILD.vdomListener && (import_app_data8.BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") { if (memberName[2] === "-") { memberName = memberName.slice(3); } else if (isMemberInElement(win, ln)) { memberName = ln.slice(2); } else { memberName = ln[2] + memberName.slice(3); } if (oldValue || newValue) { const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX); memberName = memberName.replace(CAPTURE_EVENT_REGEX, ""); if (oldValue) { plt.rel(elm, memberName, oldValue, capture); } if (newValue) { plt.ael(elm, memberName, newValue, capture); } } } else if (import_app_data8.BUILD.vdomPropOrAttr) { const isComplex = isComplexType(newValue); if ((isProp || isComplex && newValue !== null) && !isSvg) { try { if (!elm.tagName.includes("-")) { const n = newValue == null ? "" : newValue; if (memberName === "list") { isProp = false; } else if (oldValue == null || elm[memberName] != n) { elm[memberName] = n; } } else { elm[memberName] = newValue; } } catch (e) { } } let xlink = false; if (import_app_data8.BUILD.vdomXlink) { if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) { memberName = ln; xlink = true; } } if (newValue == null || newValue === false) { if (newValue !== false || elm.getAttribute(memberName) === "") { if (import_app_data8.BUILD.vdomXlink && xlink) { elm.removeAttributeNS(XLINK_NS, memberName); } else { elm.removeAttribute(memberName); } } } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) { newValue = newValue === true ? "" : newValue; if (import_app_data8.BUILD.vdomXlink && xlink) { elm.setAttributeNS(XLINK_NS, memberName, newValue); } else { elm.setAttribute(memberName, newValue); } } } } }; var parseClassListRegex = /\s/; var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex); var CAPTURE_EVENT_SUFFIX = "Capture"; var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$"); // src/runtime/vdom/update-element.ts var updateElement = (oldVnode, newVnode, isSvgMode2) => { const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$; const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ; const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ; if (import_app_data9.BUILD.updatable) { for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) { if (!(memberName in newVnodeAttrs)) { setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$); } } } for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) { setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$); } }; function sortedAttrNames(attrNames) { return attrNames.includes("ref") ? ( // we need to sort these to ensure that `'ref'` is the last attr [...attrNames.filter((attr) => attr !== "ref"), "ref"] ) : ( // no need to sort, return the original array attrNames ); } // src/runtime/vdom/vdom-render.ts var scopeId; var contentRef; var hostTagName; var useNativeShadowDom = false; var checkSlotFallbackVisibility = false; var checkSlotRelocate = false; var isSvgMode = false; var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => { var _a; const newVNode2 = newParentVNode.$children$[childIndex]; let i2 = 0; let elm; let childNode; let oldVNode; if (import_app_data10.BUILD.slotRelocation && !useNativeShadowDom) { checkSlotRelocate = true; if (newVNode2.$tag$ === "slot") { if (scopeId) { parentElm.classList.add(scopeId + "-s"); } newVNode2.$flags$ |= newVNode2.$children$ ? ( // slot element has fallback content // still create an element that "mocks" the slot element 2 /* isSlotFallback */ ) : ( // slot element does not have fallback content // create an html comment we'll use to always reference // where actual slot content should sit next to 1 /* isSlotReference */ ); } } if (import_app_data10.BUILD.isDev && newVNode2.$elm$) { consoleDevError( `The JSX ${newVNode2.$text$ !== null ? `"${newVNode2.$text$}" text` : `"${newVNode2.$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` ); } if (import_app_data10.BUILD.vdomText && newVNode2.$text$ !== null) { elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$); } else if (import_app_data10.BUILD.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) { elm = newVNode2.$elm$ = import_app_data10.BUILD.isDebug || import_app_data10.BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode(""); } else { if (import_app_data10.BUILD.svg && !isSvgMode) { isSvgMode = newVNode2.$tag$ === "svg"; } elm = newVNode2.$elm$ = import_app_data10.BUILD.svg ? doc.createElementNS( isSvgMode ? SVG_NS : HTML_NS, !useNativeShadowDom && import_app_data10.BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$ ) : doc.createElement( !useNativeShadowDom && import_app_data10.BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$ ); if (import_app_data10.BUILD.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") { isSvgMode = false; } if (import_app_data10.BUILD.vdomAttribute) { updateElement(null, newVNode2, isSvgMode); } const rootNode = elm.getRootNode(); const isElementWithinShadowRoot = !rootNode.querySelector("body"); if (!isElementWithinShadowRoot && import_app_data10.BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) { elm.classList.add(elm["s-si"] = scopeId); } if (import_app_data10.BUILD.scoped) { updateElementScopeIds(elm, parentElm); } if (newVNode2.$children$) { for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) { childNode = createElm(oldParentVNode, newVNode2, i2, elm); if (childNode) { elm.appendChild(childNode); } } } if (import_app_data10.BUILD.svg) { if (newVNode2.$tag$ === "svg") { isSvgMode = false; } else if (elm.tagName === "foreignObject") { isSvgMode = true; } } } elm["s-hn"] = hostTagName; if (import_app_data10.BUILD.slotRelocation) { if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) { elm["s-sr"] = true; elm["s-cr"] = contentRef; elm["s-sn"] = newVNode2.$name$ || ""; elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref; oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex]; if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) { if (import_app_data10.BUILD.experimentalSlotFixes) { relocateToHostRoot(oldParentVNode.$elm$); } else { putBackInOriginalLocation(oldParentVNode.$elm$, false); } } } } return elm; }; var relocateToHostRoot = (parentElm) => { plt.$flags$ |= 1 /* isTmpDisconnected */; const host = parentElm.closest(hostTagName.toLowerCase()); if (host != null) { const contentRefNode = Array.from(host.childNodes).find((ref) => ref["s-cr"]); const childNodeArray = Array.from(parentElm.childNodes); for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) { if (childNode["s-sh"] != null) { insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null); childNode["s-sh"] = void 0; checkSlotRelocate = true; } } } plt.$flags$ &= ~1 /* isTmpDisconnected */; }; var putBackInOriginalLocation = (parentElm, recursive) => { plt.$flags$ |= 1 /* isTmpDisconnected */; const oldSlotChildNodes = Array.from(parentElm.childNodes); if (parentElm["s-sr"] && import_app_data10.BUILD.experimentalSlotFixes) { let node = parentElm; while (node = node.nextSibling) { if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) { oldSlotChildNodes.push(node); } } } for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) { const childNode = oldSlotChildNodes[i2]; if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) { insertBefore(parentReferenceNode(childNode), childNode, referenceNode(childNode)); childNode["s-ol"].remove(); childNode["s-ol"] = void 0; childNode["s-sh"] = void 0; checkSlotRelocate = true; } if (recursive) { putBackInOriginalLocation(childNode, recursive); } } plt.$flags$ &= ~1 /* isTmpDisconnected */; }; var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => { let containerElm = import_app_data10.BUILD.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm; let childNode; if (import_app_data10.BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) { containerElm = containerElm.shadowRoot; } for (; startIdx <= endIdx; ++startIdx) { if (vnodes[startIdx]) { childNode = createElm(null, parentVNode, startIdx, parentElm); if (childNode) { vnodes[startIdx].$elm$ = childNode; insertBefore(containerElm, childNode, import_app_data10.BUILD.slotRelocation ? referenceNode(before) : before); } } } }; var removeVnodes = (vnodes, startIdx, endIdx) => { for (let index = startIdx; index <= endIdx; ++index) { const vnode = vnodes[index]; if (vnode) { const elm = vnode.$elm$; nullifyVNodeRefs(vnode); if (elm) { if (import_app_data10.BUILD.slotRelocation) { checkSlotFallbackVisibility = true; if (elm["s-ol"]) { elm["s-ol"].remove(); } else { putBackInOriginalLocation(elm, true); } } elm.remove(); } } } }; var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => { let oldStartIdx = 0; let newStartIdx = 0; let idxInOld = 0; let i2 = 0; let oldEndIdx = oldCh.length - 1; let oldStartVnode = oldCh[0]; let oldEndVnode = oldCh[oldEndIdx]; let newEndIdx = newCh.length - 1; let newStartVnode = newCh[0]; let newEndVnode = newCh[newEndIdx]; let node; let elmToMove; while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { if (oldStartVnode == null) { oldStartVnode = oldCh[++oldStartIdx]; } else if (oldEndVnode == null) { oldEndVnode = oldCh[--oldEndIdx]; } else if (newStartVnode == null) { newStartVnode = newCh[++newStartIdx]; } else if (newEndVnode == null) { newEndVnode = newCh[--newEndIdx]; } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) { patch(oldStartVnode, newStartVnode, isInitialRender); oldStartVnode = oldCh[++oldStartIdx]; newStartVnode = newCh[++newStartIdx]; } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) { patch(oldEndVnode, newEndVnode, isInitialRender); oldEndVnode = oldCh[--oldEndIdx]; newEndVnode = newCh[--newEndIdx]; } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) { if (import_app_data10.BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) { putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false); } patch(oldStartVnode, newEndVnode, isInitialRender); insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling); oldStartVnode = oldCh[++oldStartIdx]; newEndVnode = newCh[--newEndIdx]; } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) { if (import_app_data10.BUILD.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) { putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false); } patch(oldEndVnode, newStartVnode, isInitialRender); insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$); oldEndVnode = oldCh[--oldEndIdx]; newStartVnode = newCh[++newStartIdx]; } else { idxInOld = -1; if (import_app_data10.BUILD.vdomKey) { for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) { if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) { idxInOld = i2; break; } } } if (import_app_data10.BUILD.vdomKey && idxInOld >= 0) { elmToMove = oldCh[idxInOld]; if (elmToMove.$tag$ !== newStartVnode.$tag$) { node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm); } else { patch(elmToMove, newStartVnode, isInitialRender); oldCh[idxInOld] = void 0; node = elmToMove.$elm$; } newStartVnode = newCh[++newStartIdx]; } else { node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx, parentElm); newStartVnode = newCh[++newStartIdx]; } if (node) { if (import_app_data10.BUILD.slotRelocation) { insertBefore(parentReferenceNode(oldStartVnode.$elm$), node, referenceNode(oldStartVnode.$elm$)); } else { insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$); } } } } if (oldStartIdx > oldEndIdx) { addVnodes( parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode2, newCh, newStartIdx, newEndIdx ); } else if (import_app_data10.BUILD.updatable && newStartIdx > newEndIdx) { removeVnodes(oldCh, oldStartIdx, oldEndIdx); } }; var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => { if (leftVNode.$tag$ === rightVNode.$tag$) { if (import_app_data10.BUILD.slotRelocation && leftVNode.$tag$ === "slot") { if ( // The component gets hydrated and no VDOM has been initialized. // Here the comparison can't happen as $name$ property is not set for `leftNode`. "$nodeId$" in leftVNode && isInitialRender && // `leftNode` is not from type HTMLComment which would cause many // hydration comments to be removed leftVNode.$elm$.nodeType !== 8 ) { return false; } return leftVNode.$name$ === rightVNode.$name$; } if (import_app_data10.BUILD.vdomKey && !isInitialRender) { return leftVNode.$key$ === rightVNode.$key$; } return true; } return false; }; var referenceNode = (node) => { return node && node["s-ol"] || node; }; var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode; var patch = (oldVNode, newVNode2, isInitialRender = false) => { const elm = newVNode2.$elm$ = oldVNode.$elm$; const oldChildren = oldVNode.$children$; const newChildren = newVNode2.$children$; const tag = newVNode2.$tag$; const text = newVNode2.$text$; let defaultHolder; if (!import_app_data10.BUILD.vdomText || text === null) { if (import_app_data10.BUILD.svg) { isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode; } if (import_app_data10.BUILD.vdomAttribute || import_app_data10.BUILD.reflect) { if (import_app_data10.BUILD.slot && tag === "slot" && !useNativeShadowDom) { if (import_app_data10.BUILD.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) { newVNode2.$elm$["s-sn"] = newVNode2.$name$ || ""; relocateToHostRoot(newVNode2.$elm$.parentElement); } } else { updateElement(oldVNode, newVNode2, isSvgMode); } } if (import_app_data10.BUILD.updatable && oldChildren !== null && newChildren !== null) { updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender); } else if (newChildren !== null) { if (import_app_data10.BUILD.updatable && import_app_data10.BUILD.vdomText && oldVNode.$text$ !== null) { elm.textContent = ""; } addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1); } else if ( // don't do this on initial render as it can cause non-hydrated content to be removed !isInitialRender && import_app_data10.BUILD.updatable && oldChildren !== null ) { removeVnodes(oldChildren, 0, oldChildren.length - 1); } if (import_app_data10.BUILD.svg && isSvgMode && tag === "svg") { isSvgMode = false; } } else if (import_app_data10.BUILD.vdomText && import_app_data10.BUILD.slotRelocation && (defaultHolder = elm["s-cr"])) { defaultHolder.parentNode.textContent = text; } else if (import_app_data10.BUILD.vdomText && oldVNode.$text$ !== text) { elm.data = text; } }; var updateFallbackSlotVisibility = (elm) => { const childNodes = elm.childNodes; for (const childNode of childNodes) { if (childNode.nodeType === 1 /* ElementNode */) { if (childNode["s-sr"]) { const slotName = childNode["s-sn"]; childNode.hidden = false; for (const siblingNode of childNodes) { if (siblingNode !== childNode) { if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") { if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) { childNode.hidden = true; break; } } else { if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") { childNode.hidden = true; break; } } } } } updateFallbackSlotVisibility(childNode); } } }; var relocateNodes = []; var markSlotContentForRelocation = (elm) => { let node; let hostContentNodes; let j; for (const childNode of elm.childNodes) { if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) { hostContentNodes = node.parentNode.childNodes; const slotName = childNode["s-sn"]; for (j = hostContentNodes.length - 1; j >= 0; j--) { node = hostContentNodes[j]; if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!import_app_data10.BUILD.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) { if (isNodeLocatedInSlot(node, slotName)) { let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node); checkSlotFallbackVisibility = true; node["s-sn"] = node["s-sn"] || slotName; if (relocateNodeData) { relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"]; relocateNodeData.$slotRefNode$ = childNode; } else { node["s-sh"] = childNode["s-hn"]; relocateNodes.push({ $slotRefNode$: childNode, $nodeToRelocate$: node }); } if (node["s-sr"]) { relocateNodes.map((relocateNode) => { if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) { relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node); if (relocateNodeData && !relocateNode.$slotRefNode$) { relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$; } } }); } } else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) { relocateNodes.push({ $nodeToRelocate$: node }); } } } } if (childNode.nodeType === 1 /* ElementNode */) { markSlotContentForRelocation(childNode); } } }; var isNodeLocatedInSlot = (nodeToRelocate, slotName) => { if (nodeToRelocate.nodeType === 1 /* ElementNode */) { if (nodeToRelocate.getAttribute("slot") === null && slotName === "") { return true; } if (nodeToRelocate.getAttribute("slot") === slotName) { return true; } return false; } if (nodeToRelocate["s-sn"] === slotName) { return true; } return slotName === ""; }; var nullifyVNodeRefs = (vNode) => { if (import_app_data10.BUILD.vdomRef) { vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null); vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs); } }; var insertBefore = (parent, newNode, reference) => { const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference); if (import_app_data10.BUILD.scoped) { updateElementScopeIds(newNode, parent); } return inserted; }; var findScopeIds = (element) => { const scopeIds = []; if (element) { scopeIds.push( ...element["s-scs"] || [], element["s-si"], element["s-sc"], ...findScopeIds(element.parentElement) ); } return scopeIds; }; var updateElementScopeIds = (element, parent, iterateChildNodes = false) => { var _a; if (element && parent && element.nodeType === 1 /* ElementNode */) { const scopeIds = new Set(findScopeIds(parent).filter(Boolean)); if (scopeIds.size) { (_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = [...scopeIds]); if (element["s-ol"] || iterateChildNodes) { for (const childNode of Array.from(element.childNodes)) { updateElementScopeIds(childNode, element, true); } } } } }; var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => { var _a, _b, _c, _d, _e; const hostElm = hostRef.$hostElement$; const cmpMeta = hostRef.$cmpMeta$; const oldVNode = hostRef.$vnode$ || newVNode(null, null); const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults); hostTagName = hostElm.tagName; if (import_app_data10.BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) { throw new Error(`The must be the single root component. Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the . The render() function should look like this instead: render() { // Do not return an array return ( {content} ); } `); } if (import_app_data10.BUILD.reflect && cmpMeta.$attrsToReflect$) { rootVnode.$attrs$ = rootVnode.$attrs$ || {}; cmpMeta.$attrsToReflect$.map( ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName] ); } if (isInitialLoad && rootVnode.$attrs$) { for (const key of Object.keys(rootVnode.$attrs$)) { if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) { rootVnode.$attrs$[key] = hostElm[key]; } } } rootVnode.$tag$ = null; rootVnode.$flags$ |= 4 /* isHost */; hostRef.$vnode$ = rootVnode; rootVnode.$elm$ = oldVNode.$elm$ = import_app_data10.BUILD.shadowDom ? hostElm.shadowRoot || hostElm : hostElm; if (import_app_data10.BUILD.scoped || import_app_data10.BUILD.shadowDom) { scopeId = hostElm["s-sc"]; } useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0; if (import_app_data10.BUILD.slotRelocation) { contentRef = hostElm["s-cr"]; checkSlotFallbackVisibility = false; } patch(oldVNode, rootVnode, isInitialLoad); if (import_app_data10.BUILD.slotRelocation) { plt.$flags$ |= 1 /* isTmpDisconnected */; if (checkSlotRelocate) { markSlotContentForRelocation(rootVnode.$elm$); for (const relocateData of relocateNodes) { const nodeToRelocate = relocateData.$nodeToRelocate$; if (!nodeToRelocate["s-ol"]) { const orgLocationNode = import_app_data10.BUILD.isDebug || import_app_data10.BUILD.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode(""); orgLocationNode["s-nr"] = nodeToRelocate; insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate); } } for (const relocateData of relocateNodes) { const nodeToRelocate = relocateData.$nodeToRelocate$; const slotRefNode = relocateData.$slotRefNode$; if (slotRefNode) { const parentNodeRef = slotRefNode.parentNode; let insertBeforeNode = slotRefNode.nextSibling; if (!import_app_data10.BUILD.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) { let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling; while (orgLocationNode) { let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null; if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === refNode.parentNode) { refNode = refNode.nextSibling; while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) { refNode = refNode == null ? void 0 : refNode.nextSibling; } if (!refNode || !refNode["s-nr"]) { insertBeforeNode = refNode; break; } } orgLocationNode = orgLocationNode.previousSibling; } } if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) { if (nodeToRelocate !== insertBeforeNode) { if (!import_app_data10.BUILD.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) { nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName; } insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode); if (nodeToRelocate.nodeType === 1 /* ElementNode */) { nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false; } } } nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](nodeToRelocate); } else { if (nodeToRelocate.nodeType === 1 /* ElementNode */) { if (isInitialLoad) { nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false; } nodeToRelocate.hidden = true; } } } } if (checkSlotFallbackVisibility) { updateFallbackSlotVisibility(rootVnode.$elm$); } plt.$flags$ &= ~1 /* isTmpDisconnected */; relocateNodes.length = 0; } if (import_app_data10.BUILD.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) { for (const childNode of rootVnode.$elm$.childNodes) { if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) { if (isInitialLoad && childNode["s-ih"] == null) { childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false; } childNode.hidden = true; } } } contentRef = void 0; }; var slotReferenceDebugNode = (slotVNode) => doc.createComment( ` (host=${hostTagName.toLowerCase()})` ); var originalLocationDebugNode = (nodeToRelocate) => doc.createComment( `org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`) ); // src/runtime/update-component.ts var attachToAncestor = (hostRef, ancestorComponent) => { if (import_app_data11.BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) { ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r)); } }; var scheduleUpdate = (hostRef, isInitialLoad) => { if (import_app_data11.BUILD.taskQueue && import_app_data11.BUILD.updatable) { hostRef.$flags$ |= 16 /* isQueuedForUpdate */; } if (import_app_data11.BUILD.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) { hostRef.$flags$ |= 512 /* needsRerender */; return; } attachToAncestor(hostRef, hostRef.$ancestorComponent$); const dispatch = () => dispatchHooks(hostRef, isInitialLoad); return import_app_data11.BUILD.taskQueue ? writeTask(dispatch) : dispatch(); }; var dispatchHooks = (hostRef, isInitialLoad) => { const elm = hostRef.$hostElement$; const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$); const instance = import_app_data11.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm; if (!instance) { throw new Error( `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime` ); } let maybePromise; if (isInitialLoad) { if (import_app_data11.BUILD.lazyLoad && import_app_data11.BUILD.hostListener) { hostRef.$flags$ |= 256 /* isListenReady */; if (hostRef.$queuedListeners$) { hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event)); hostRef.$queuedListeners$ = void 0; } } emitLifecycleEvent(elm, "componentWillLoad"); if (import_app_data11.BUILD.cmpWillLoad) { maybePromise = safeCall(instance, "componentWillLoad"); } } else { emitLifecycleEvent(elm, "componentWillUpdate"); if (import_app_data11.BUILD.cmpWillUpdate) { maybePromise = safeCall(instance, "componentWillUpdate"); } } emitLifecycleEvent(elm, "componentWillRender"); if (import_app_data11.BUILD.cmpWillRender) { maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender")); } endSchedule(); return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad)); }; var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => { console.error(err2); fn(); }) : fn(); var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function"; var updateComponent = async (hostRef, instance, isInitialLoad) => { var _a; const elm = hostRef.$hostElement$; const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$); const rc = elm["s-rc"]; if (import_app_data11.BUILD.style && isInitialLoad) { attachStyles(hostRef); } const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$); if (import_app_data11.BUILD.isDev) { hostRef.$flags$ |= 1024 /* devOnRender */; } if (import_app_data11.BUILD.hydrateServerSide) { await callRender(hostRef, instance, elm, isInitialLoad); } else { callRender(hostRef, instance, elm, isInitialLoad); } if (import_app_data11.BUILD.isDev) { hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1; hostRef.$flags$ &= ~1024 /* devOnRender */; } if (import_app_data11.BUILD.hydrateServerSide) { try { serverSideConnected(elm); if (isInitialLoad) { if (hostRef.$cmpMeta$.$flags$ & 1 /* shadowDomEncapsulation */) { elm["s-en"] = ""; } else if (hostRef.$cmpMeta$.$flags$ & 2 /* scopedCssEncapsulation */) { elm["s-en"] = "c"; } } } catch (e) { consoleError(e, elm); } } if (import_app_data11.BUILD.asyncLoading && rc) { rc.map((cb) => cb()); elm["s-rc"] = void 0; } endRender(); endUpdate(); if (import_app_data11.BUILD.asyncLoading) { const childrenPromises = (_a = elm["s-p"]) != null ? _a : []; const postUpdate = () => postUpdateComponent(hostRef); if (childrenPromises.length === 0) { postUpdate(); } else { Promise.all(childrenPromises).then(postUpdate); hostRef.$flags$ |= 4 /* isWaitingForChildren */; childrenPromises.length = 0; } } else { postUpdateComponent(hostRef); } }; var renderingRef = null; var callRender = (hostRef, instance, elm, isInitialLoad) => { const allRenderFn = import_app_data11.BUILD.allRenderFn ? true : false; const lazyLoad = import_app_data11.BUILD.lazyLoad ? true : false; const taskQueue = import_app_data11.BUILD.taskQueue ? true : false; const updatable = import_app_data11.BUILD.updatable ? true : false; try { renderingRef = instance; instance = allRenderFn ? instance.render() : instance.render && instance.render(); if (updatable && taskQueue) { hostRef.$flags$ &= ~16 /* isQueuedForUpdate */; } if (updatable || lazyLoad) { hostRef.$flags$ |= 2 /* hasRendered */; } if (import_app_data11.BUILD.hasRenderFn || import_app_data11.BUILD.reflect) { if (import_app_data11.BUILD.vdomRender || import_app_data11.BUILD.reflect) { if (import_app_data11.BUILD.hydrateServerSide) { return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad)); } else { renderVdom(hostRef, instance, isInitialLoad); } } else { const shadowRoot = elm.shadowRoot; if (hostRef.$cmpMeta$.$flags$ & 1 /* shadowDomEncapsulation */) { shadowRoot.textContent = instance; } else { elm.textContent = instance; } } } } catch (e) { consoleError(e, hostRef.$hostElement$); } renderingRef = null; return null; }; var getRenderingRef = () => renderingRef; var postUpdateComponent = (hostRef) => { const tagName = hostRef.$cmpMeta$.$tagName$; const elm = hostRef.$hostElement$; const endPostUpdate = createTime("postUpdate", tagName); const instance = import_app_data11.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm; const ancestorComponent = hostRef.$ancestorComponent$; if (import_app_data11.BUILD.cmpDidRender) { if (import_app_data11.BUILD.isDev) { hostRef.$flags$ |= 1024 /* devOnRender */; } safeCall(instance, "componentDidRender"); if (import_app_data11.BUILD.isDev) { hostRef.$flags$ &= ~1024 /* devOnRender */; } } emitLifecycleEvent(elm, "componentDidRender"); if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) { hostRef.$flags$ |= 64 /* hasLoadedComponent */; if (import_app_data11.BUILD.asyncLoading && import_app_data11.BUILD.cssAnnotations) { addHydratedFlag(elm); } if (import_app_data11.BUILD.cmpDidLoad) { if (import_app_data11.BUILD.isDev) { hostRef.$flags$ |= 2048 /* devOnDidLoad */; } safeCall(instance, "componentDidLoad"); if (import_app_data11.BUILD.isDev) { hostRef.$flags$ &= ~2048 /* devOnDidLoad */; } } emitLifecycleEvent(elm, "componentDidLoad"); endPostUpdate(); if (import_app_data11.BUILD.asyncLoading) { hostRef.$onReadyResolve$(elm); if (!ancestorComponent) { appDidLoad(tagName); } } } else { if (import_app_data11.BUILD.cmpDidUpdate) { if (import_app_data11.BUILD.isDev) { hostRef.$flags$ |= 1024 /* devOnRender */; } safeCall(instance, "componentDidUpdate"); if (import_app_data11.BUILD.isDev) { hostRef.$flags$ &= ~1024 /* devOnRender */; } } emitLifecycleEvent(elm, "componentDidUpdate"); endPostUpdate(); } if (import_app_data11.BUILD.method && import_app_data11.BUILD.lazyLoad) { hostRef.$onInstanceResolve$(elm); } if (import_app_data11.BUILD.asyncLoading) { if (hostRef.$onRenderResolve$) { hostRef.$onRenderResolve$(); hostRef.$onRenderResolve$ = void 0; } if (hostRef.$flags$ & 512 /* needsRerender */) { nextTick(() => scheduleUpdate(hostRef, false)); } hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */); } }; var forceUpdate = (ref) => { if (import_app_data11.BUILD.updatable && (Build.isBrowser || Build.isTesting)) { const hostRef = getHostRef(ref); const isConnected = hostRef.$hostElement$.isConnected; if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { scheduleUpdate(hostRef, false); } return isConnected; } return false; }; var appDidLoad = (who) => { if (import_app_data11.BUILD.cssAnnotations) { addHydratedFlag(doc.documentElement); } if (import_app_data11.BUILD.asyncQueue) { plt.$flags$ |= 2 /* appLoaded */; } nextTick(() => emitEvent(win, "appload", { detail: { namespace: import_app_data11.NAMESPACE } })); if (import_app_data11.BUILD.profile && performance.measure) { performance.measure(`[Stencil] ${import_app_data11.NAMESPACE} initial load (by ${who})`, "st:app:start"); } }; var safeCall = (instance, method, arg) => { if (instance && instance[method]) { try { return instance[method](arg); } catch (e) { consoleError(e); } } return void 0; }; var emitLifecycleEvent = (elm, lifecycleName) => { if (import_app_data11.BUILD.lifecycleDOMEvents) { emitEvent(elm, "stencil_" + lifecycleName, { bubbles: true, composed: true, detail: { namespace: import_app_data11.NAMESPACE } }); } }; var addHydratedFlag = (elm) => { var _a, _b; return import_app_data11.BUILD.hydratedClass ? elm.classList.add((_a = import_app_data11.BUILD.hydratedSelectorName) != null ? _a : "hydrated") : import_app_data11.BUILD.hydratedAttribute ? elm.setAttribute((_b = import_app_data11.BUILD.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0; }; var serverSideConnected = (elm) => { const children = elm.children; if (children != null) { for (let i2 = 0, ii = children.length; i2 < ii; i2++) { const childElm = children[i2]; if (typeof childElm.connectedCallback === "function") { childElm.connectedCallback(); } serverSideConnected(childElm); } } }; // src/runtime/set-value.ts var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName); var setValue = (ref, propName, newVal, cmpMeta) => { const hostRef = getHostRef(ref); if (import_app_data12.BUILD.lazyLoad && !hostRef) { throw new Error( `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).` ); } const elm = import_app_data12.BUILD.lazyLoad ? hostRef.$hostElement$ : ref; const oldVal = hostRef.$instanceValues$.get(propName); const flags = hostRef.$flags$; const instance = import_app_data12.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm; newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]); const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal); const didValueChange = newVal !== oldVal && !areBothNaN; if ((!import_app_data12.BUILD.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) { hostRef.$instanceValues$.set(propName, newVal); if (import_app_data12.BUILD.isDev) { if (hostRef.$flags$ & 1024 /* devOnRender */) { consoleDevWarn( `The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`, "\nElement", elm, "\nNew value", newVal, "\nOld value", oldVal ); } else if (hostRef.$flags$ & 2048 /* devOnDidLoad */) { consoleDevWarn( `The state/prop "${propName}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`, "\nElement", elm, "\nNew value", newVal, "\nOld value", oldVal ); } } if (!import_app_data12.BUILD.lazyLoad || instance) { if (import_app_data12.BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) { const watchMethods = cmpMeta.$watchers$[propName]; if (watchMethods) { watchMethods.map((watchMethodName) => { try { instance[watchMethodName](newVal, oldVal, propName); } catch (e) { consoleError(e, elm); } }); } } if (import_app_data12.BUILD.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) { if (import_app_data12.BUILD.cmpShouldUpdate && instance.componentShouldUpdate) { if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) { return; } } scheduleUpdate(hostRef, false); } } } }; // src/runtime/proxy-component.ts var proxyComponent = (Cstr, cmpMeta, flags) => { var _a, _b; const prototype = Cstr.prototype; if (import_app_data13.BUILD.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) { FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach( (cbName) => Object.defineProperty(prototype, cbName, { value(...args) { const hostRef = getHostRef(this); const elm = import_app_data13.BUILD.lazyLoad ? hostRef.$hostElement$ : this; const instance = import_app_data13.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm; if (!instance) { hostRef.$onReadyPromise$.then((instance2) => { const cb = instance2[cbName]; typeof cb === "function" && cb.call(instance2, ...args); }); } else { const cb = instance[cbName]; typeof cb === "function" && cb.call(instance, ...args); } } }) ); } if (import_app_data13.BUILD.member && cmpMeta.$members$ || import_app_data13.BUILD.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) { if (import_app_data13.BUILD.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) { cmpMeta.$watchers$ = Cstr.watchers; } const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {}); members.map(([memberName, [memberFlags]]) => { if ((import_app_data13.BUILD.prop || import_app_data13.BUILD.state) && (memberFlags & 31 /* Prop */ || (!import_app_data13.BUILD.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) { Object.defineProperty(prototype, memberName, { get() { return getValue(this, memberName); }, set(newValue) { if (import_app_data13.BUILD.isDev) { const ref = getHostRef(this); if ( // we are proxying the instance (not element) (flags & 1 /* isElementConstructor */) === 0 && // the element is not constructing (ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop (memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable (memberFlags & 1024 /* Mutable */) === 0 ) { consoleDevWarn( `@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component. More information: https://stenciljs.com/docs/properties#prop-mutability` ); } } setValue(this, memberName, newValue, cmpMeta); }, configurable: true, enumerable: true }); } else if (import_app_data13.BUILD.lazyLoad && import_app_data13.BUILD.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) { Object.defineProperty(prototype, memberName, { value(...args) { var _a2; const ref = getHostRef(this); return (_a2 = ref == null ? void 0 : ref.$onInstancePromise$) == null ? void 0 : _a2.then(() => { var _a3; return (_a3 = ref.$lazyInstance$) == null ? void 0 : _a3[memberName](...args); }); } }); } }); if (import_app_data13.BUILD.observeAttribute && (!import_app_data13.BUILD.lazyLoad || flags & 1 /* isElementConstructor */)) { const attrNameToPropName = /* @__PURE__ */ new Map(); prototype.attributeChangedCallback = function(attrName, oldValue, newValue) { plt.jmp(() => { var _a2; const propName = attrNameToPropName.get(attrName); if (this.hasOwnProperty(propName)) { newValue = this[propName]; delete this[propName]; } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues this[propName] == newValue) { return; } else if (propName == null) { const hostRef = getHostRef(this); const flags2 = hostRef == null ? void 0 : hostRef.$flags$; if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) { const elm = import_app_data13.BUILD.lazyLoad ? hostRef.$hostElement$ : this; const instance = import_app_data13.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm; const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName]; entry == null ? void 0 : entry.forEach((callbackName) => { if (instance[callbackName] != null) { instance[callbackName].call(instance, newValue, oldValue, attrName); } }); } return; } this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue; }); }; Cstr.observedAttributes = Array.from( /* @__PURE__ */ new Set([ ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}), ...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => { var _a2; const attrName = m[1] || propName; attrNameToPropName.set(attrName, propName); if (import_app_data13.BUILD.reflect && m[0] & 512 /* ReflectAttr */) { (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]); } return attrName; }) ]) ); } } return Cstr; }; // src/runtime/initialize-component.ts var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => { let Cstr; if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) { hostRef.$flags$ |= 32 /* hasInitializedComponent */; const bundleId = cmpMeta.$lazyBundleId$; if ((import_app_data14.BUILD.lazyLoad || import_app_data14.BUILD.hydrateClientSide) && bundleId) { const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId); if (CstrImport && "then" in CstrImport) { const endLoad = uniqueTime( `st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`, `[Stencil] Load module for <${cmpMeta.$tagName$}>` ); Cstr = await CstrImport; endLoad(); } else { Cstr = CstrImport; } if (!Cstr) { throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`); } if (import_app_data14.BUILD.member && !Cstr.isProxied) { if (import_app_data14.BUILD.watchCallback) { cmpMeta.$watchers$ = Cstr.watchers; } proxyComponent(Cstr, cmpMeta, 2 /* proxyState */); Cstr.isProxied = true; } const endNewInstance = createTime("createInstance", cmpMeta.$tagName$); if (import_app_data14.BUILD.member) { hostRef.$flags$ |= 8 /* isConstructingInstance */; } try { new Cstr(hostRef); } catch (e) { consoleError(e); } if (import_app_data14.BUILD.member) { hostRef.$flags$ &= ~8 /* isConstructingInstance */; } if (import_app_data14.BUILD.watchCallback) { hostRef.$flags$ |= 128 /* isWatchReady */; } endNewInstance(); fireConnectedCallback(hostRef.$lazyInstance$); } else { Cstr = elm.constructor; const cmpTag = elm.localName; customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */); } if (import_app_data14.BUILD.style && Cstr && Cstr.style) { let style; if (typeof Cstr.style === "string") { style = Cstr.style; } else if (import_app_data14.BUILD.mode && typeof Cstr.style !== "string") { hostRef.$modeName$ = computeMode(elm); if (hostRef.$modeName$) { style = Cstr.style[hostRef.$modeName$]; } if (import_app_data14.BUILD.hydrateServerSide && hostRef.$modeName$) { elm.setAttribute("s-mode", hostRef.$modeName$); } } const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$); if (!styles.has(scopeId2)) { const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$); if (!import_app_data14.BUILD.hydrateServerSide && import_app_data14.BUILD.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field import_app_data14.BUILD.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) { style = await import("../client/shadow-css.js").then((m) => m.scopeCss(style, scopeId2)); } registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)); endRegisterStyles(); } } } const ancestorComponent = hostRef.$ancestorComponent$; const schedule = () => scheduleUpdate(hostRef, true); if (import_app_data14.BUILD.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) { ancestorComponent["s-rc"].push(schedule); } else { schedule(); } }; var fireConnectedCallback = (instance) => { if (import_app_data14.BUILD.lazyLoad && import_app_data14.BUILD.connectedCallback) { safeCall(instance, "connectedCallback"); } }; // src/runtime/connected-callback.ts var connectedCallback = (elm) => { if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { const hostRef = getHostRef(elm); const cmpMeta = hostRef.$cmpMeta$; const endConnected = createTime("connectedCallback", cmpMeta.$tagName$); if (import_app_data15.BUILD.hostListenerTargetParent) { addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true); } if (!(hostRef.$flags$ & 1 /* hasConnected */)) { hostRef.$flags$ |= 1 /* hasConnected */; let hostId; if (import_app_data15.BUILD.hydrateClientSide) { hostId = elm.getAttribute(HYDRATE_ID); if (hostId) { if (import_app_data15.BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { const scopeId2 = import_app_data15.BUILD.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta); elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s"); } initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef); } } if (import_app_data15.BUILD.slotRelocation && !hostId) { if (import_app_data15.BUILD.hydrateServerSide || (import_app_data15.BUILD.slot || import_app_data15.BUILD.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) { setContentReference(elm); } } if (import_app_data15.BUILD.asyncLoading) { let ancestorComponent = elm; while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) { if (import_app_data15.BUILD.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) { attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent); break; } } } if (import_app_data15.BUILD.prop && !import_app_data15.BUILD.hydrateServerSide && cmpMeta.$members$) { Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => { if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) { const value = elm[memberName]; delete elm[memberName]; elm[memberName] = value; } }); } if (import_app_data15.BUILD.initializeNextTick) { nextTick(() => initializeComponent(elm, hostRef, cmpMeta)); } else { initializeComponent(elm, hostRef, cmpMeta); } } else { addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false); if (hostRef == null ? void 0 : hostRef.$lazyInstance$) { fireConnectedCallback(hostRef.$lazyInstance$); } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) { hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$)); } } endConnected(); } }; var setContentReference = (elm) => { const contentRefElm = elm["s-cr"] = doc.createComment( import_app_data15.BUILD.isDebug ? `content-ref (host=${elm.localName})` : "" ); contentRefElm["s-cn"] = true; insertBefore(elm, contentRefElm, elm.firstChild); }; // src/runtime/disconnected-callback.ts var import_app_data16 = require("@stencil/core/internal/app-data"); var disconnectInstance = (instance) => { if (import_app_data16.BUILD.lazyLoad && import_app_data16.BUILD.disconnectedCallback) { safeCall(instance, "disconnectedCallback"); } if (import_app_data16.BUILD.cmpDidUnload) { safeCall(instance, "componentDidUnload"); } }; var disconnectedCallback = async (elm) => { if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) { const hostRef = getHostRef(elm); if (import_app_data16.BUILD.hostListener) { if (hostRef.$rmListeners$) { hostRef.$rmListeners$.map((rmListener) => rmListener()); hostRef.$rmListeners$ = void 0; } } if (!import_app_data16.BUILD.lazyLoad) { disconnectInstance(elm); } else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) { disconnectInstance(hostRef.$lazyInstance$); } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) { hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$)); } } }; // src/runtime/dom-extras.ts var import_app_data17 = require("@stencil/core/internal/app-data"); var patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => { patchCloneNode(hostElementPrototype); patchSlotAppendChild(hostElementPrototype); patchSlotAppend(hostElementPrototype); patchSlotPrepend(hostElementPrototype); patchSlotInsertAdjacentElement(hostElementPrototype); patchSlotInsertAdjacentHTML(hostElementPrototype); patchSlotInsertAdjacentText(hostElementPrototype); patchTextContent(hostElementPrototype); patchChildSlotNodes(hostElementPrototype, descriptorPrototype); patchSlotRemoveChild(hostElementPrototype); }; var patchCloneNode = (HostElementPrototype) => { const orgCloneNode = HostElementPrototype.cloneNode; HostElementPrototype.cloneNode = function(deep) { const srcNode = this; const isShadowDom = import_app_data17.BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false; const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false); if (import_app_data17.BUILD.slot && !isShadowDom && deep) { let i2 = 0; let slotted, nonStencilNode; const stencilPrivates = [ "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", "s-rf", "s-scs" ]; for (; i2 < srcNode.childNodes.length; i2++) { slotted = srcNode.childNodes[i2]["s-nr"]; nonStencilNode = stencilPrivates.every((privateField) => !srcNode.childNodes[i2][privateField]); if (slotted) { if (import_app_data17.BUILD.appendChildSlotFix && clonedNode.__appendChild) { clonedNode.__appendChild(slotted.cloneNode(true)); } else { clonedNode.appendChild(slotted.cloneNode(true)); } } if (nonStencilNode) { clonedNode.appendChild(srcNode.childNodes[i2].cloneNode(true)); } } } return clonedNode; }; }; var patchSlotAppendChild = (HostElementPrototype) => { HostElementPrototype.__appendChild = HostElementPrototype.appendChild; HostElementPrototype.appendChild = function(newChild) { const slotName = newChild["s-sn"] = getSlotName(newChild); const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName); if (slotNode) { const slotChildNodes = getHostSlotChildNodes(slotNode, slotName); const appendAfter = slotChildNodes[slotChildNodes.length - 1]; const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling); updateFallbackSlotVisibility(this); return insertedNode; } return this.__appendChild(newChild); }; }; var patchSlotRemoveChild = (ElementPrototype) => { ElementPrototype.__removeChild = ElementPrototype.removeChild; ElementPrototype.removeChild = function(toRemove) { if (toRemove && typeof toRemove["s-sn"] !== "undefined") { const slotNode = getHostSlotNode(this.childNodes, toRemove["s-sn"], this.tagName); if (slotNode) { const slotChildNodes = getHostSlotChildNodes(slotNode, toRemove["s-sn"]); const existingNode = slotChildNodes.find((n) => n === toRemove); if (existingNode) { existingNode.remove(); updateFallbackSlotVisibility(this); return; } } } return this.__removeChild(toRemove); }; }; var patchSlotPrepend = (HostElementPrototype) => { const originalPrepend = HostElementPrototype.prepend; HostElementPrototype.prepend = function(...newChildren) { newChildren.forEach((newChild) => { if (typeof newChild === "string") { newChild = this.ownerDocument.createTextNode(newChild); } const slotName = newChild["s-sn"] = getSlotName(newChild); const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName); if (slotNode) { const slotPlaceholder = document.createTextNode(""); slotPlaceholder["s-nr"] = newChild; slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder); newChild["s-ol"] = slotPlaceholder; const slotChildNodes = getHostSlotChildNodes(slotNode, slotName); const appendAfter = slotChildNodes[0]; return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling); } if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) { newChild.hidden = true; } return originalPrepend.call(this, newChild); }); }; }; var patchSlotAppend = (HostElementPrototype) => { HostElementPrototype.append = function(...newChildren) { newChildren.forEach((newChild) => { if (typeof newChild === "string") { newChild = this.ownerDocument.createTextNode(newChild); } this.appendChild(newChild); }); }; }; var patchSlotInsertAdjacentHTML = (HostElementPrototype) => { const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML; HostElementPrototype.insertAdjacentHTML = function(position, text) { if (position !== "afterbegin" && position !== "beforeend") { return originalInsertAdjacentHtml.call(this, position, text); } const container = this.ownerDocument.createElement("_"); let node; container.innerHTML = text; if (position === "afterbegin") { while (node = container.firstChild) { this.prepend(node); } } else if (position === "beforeend") { while (node = container.firstChild) { this.append(node); } } }; }; var patchSlotInsertAdjacentText = (HostElementPrototype) => { HostElementPrototype.insertAdjacentText = function(position, text) { this.insertAdjacentHTML(position, text); }; }; var patchSlotInsertAdjacentElement = (HostElementPrototype) => { const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement; HostElementPrototype.insertAdjacentElement = function(position, element) { if (position !== "afterbegin" && position !== "beforeend") { return originalInsertAdjacentElement.call(this, position, element); } if (position === "afterbegin") { this.prepend(element); return element; } else if (position === "beforeend") { this.append(element); return element; } return element; }; }; var patchTextContent = (hostElementPrototype) => { const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, "textContent"); Object.defineProperty(hostElementPrototype, "__textContent", descriptor); if (import_app_data17.BUILD.experimentalScopedSlotChanges) { Object.defineProperty(hostElementPrototype, "textContent", { // To mimic shadow root behavior, we need to return the text content of all // nodes in a slot reference node get() { const slotRefNodes = getAllChildSlotNodes(this.childNodes); const textContent = slotRefNodes.map((node) => { var _a, _b; const text = []; let slotContent = node.nextSibling; while (slotContent && slotContent["s-sn"] === node["s-sn"]) { if (slotContent.nodeType === 3 /* TEXT_NODE */ || slotContent.nodeType === 1 /* ELEMENT_NODE */) { text.push((_b = (_a = slotContent.textContent) == null ? void 0 : _a.trim()) != null ? _b : ""); } slotContent = slotContent.nextSibling; } return text.filter((ref) => ref !== "").join(" "); }).filter((text) => text !== "").join(" "); return " " + textContent + " "; }, // To mimic shadow root behavior, we need to overwrite all nodes in a slot // reference node. If a default slot reference node exists, the text content will be // placed there. Otherwise, the new text node will be hidden set(value) { const slotRefNodes = getAllChildSlotNodes(this.childNodes); slotRefNodes.forEach((node) => { let slotContent = node.nextSibling; while (slotContent && slotContent["s-sn"] === node["s-sn"]) { const tmp = slotContent; slotContent = slotContent.nextSibling; tmp.remove(); } if (node["s-sn"] === "") { const textNode = this.ownerDocument.createTextNode(value); textNode["s-sn"] = ""; insertBefore(node.parentElement, textNode, node.nextSibling); } else { node.remove(); } }); } }); } else { Object.defineProperty(hostElementPrototype, "textContent", { get() { var _a; const slotNode = getHostSlotNode(this.childNodes, "", this.tagName); if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) { return slotNode.nextSibling.textContent; } else if (slotNode) { return slotNode.textContent; } else { return this.__textContent; } }, set(value) { var _a; const slotNode = getHostSlotNode(this.childNodes, "", this.tagName); if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) { slotNode.nextSibling.textContent = value; } else if (slotNode) { slotNode.textContent = value; } else { this.__textContent = value; const contentRefElm = this["s-cr"]; if (contentRefElm) { insertBefore(this, contentRefElm, this.firstChild); } } } }); } }; var patchChildSlotNodes = (elm, cmpMeta) => { class FakeNodeList extends Array { item(n) { return this[n]; } } if (cmpMeta.$flags$ & 8 /* needsShadowDomShim */) { const childNodesFn = elm.__lookupGetter__("childNodes"); Object.defineProperty(elm, "children", { get() { return this.childNodes.map((n) => n.nodeType === 1); } }); Object.defineProperty(elm, "childElementCount", { get() { return elm.children.length; } }); Object.defineProperty(elm, "childNodes", { get() { const childNodes = childNodesFn.call(this); if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && getHostRef(this).$flags$ & 2 /* hasRendered */) { const result = new FakeNodeList(); for (let i2 = 0; i2 < childNodes.length; i2++) { const slot = childNodes[i2]["s-nr"]; if (slot) { result.push(slot); } } return result; } return FakeNodeList.from(childNodes); } }); } }; var getAllChildSlotNodes = (childNodes) => { const slotRefNodes = []; for (const childNode of Array.from(childNodes)) { if (childNode["s-sr"]) { slotRefNodes.push(childNode); } slotRefNodes.push(...getAllChildSlotNodes(childNode.childNodes)); } return slotRefNodes; }; var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || ""; var getHostSlotNode = (childNodes, slotName, hostName) => { let i2 = 0; let childNode; for (; i2 < childNodes.length; i2++) { childNode = childNodes[i2]; if (childNode["s-sr"] && childNode["s-sn"] === slotName && childNode["s-hn"] === hostName) { return childNode; } childNode = getHostSlotNode(childNode.childNodes, slotName, hostName); if (childNode) { return childNode; } } return null; }; var getHostSlotChildNodes = (n, slotName) => { const childNodes = [n]; while ((n = n.nextSibling) && n["s-sn"] === slotName) { childNodes.push(n); } return childNodes; }; // src/runtime/bootstrap-custom-element.ts var defineCustomElement = (Cstr, compactMeta) => { customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta)); }; var proxyCustomElement = (Cstr, compactMeta) => { const cmpMeta = { $flags$: compactMeta[0], $tagName$: compactMeta[1] }; if (import_app_data18.BUILD.member) { cmpMeta.$members$ = compactMeta[2]; } if (import_app_data18.BUILD.hostListener) { cmpMeta.$listeners$ = compactMeta[3]; } if (import_app_data18.BUILD.watchCallback) { cmpMeta.$watchers$ = Cstr.$watchers$; } if (import_app_data18.BUILD.reflect) { cmpMeta.$attrsToReflect$ = []; } if (import_app_data18.BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { cmpMeta.$flags$ |= 8 /* needsShadowDomShim */; } if (import_app_data18.BUILD.experimentalSlotFixes) { if (import_app_data18.BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) { patchPseudoShadowDom(Cstr.prototype, cmpMeta); } } else { if (import_app_data18.BUILD.slotChildNodesFix) { patchChildSlotNodes(Cstr.prototype, cmpMeta); } if (import_app_data18.BUILD.cloneNodeFix) { patchCloneNode(Cstr.prototype); } if (import_app_data18.BUILD.appendChildSlotFix) { patchSlotAppendChild(Cstr.prototype); } if (import_app_data18.BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) { patchTextContent(Cstr.prototype); } } const originalConnectedCallback = Cstr.prototype.connectedCallback; const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback; Object.assign(Cstr.prototype, { __registerHost() { registerHost(this, cmpMeta); }, connectedCallback() { const hostRef = getHostRef(this); addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false); connectedCallback(this); if (import_app_data18.BUILD.connectedCallback && originalConnectedCallback) { originalConnectedCallback.call(this); } }, disconnectedCallback() { disconnectedCallback(this); if (import_app_data18.BUILD.disconnectedCallback && originalDisconnectedCallback) { originalDisconnectedCallback.call(this); } }, __attachShadow() { if (supportsShadow) { if (!this.shadowRoot) { if (import_app_data18.BUILD.shadowDelegatesFocus) { this.attachShadow({ mode: "open", delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */) }); } else { this.attachShadow({ mode: "open" }); } } else { if (this.shadowRoot.mode !== "open") { throw new Error( `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.` ); } } } else { this.shadowRoot = this; } } }); Cstr.is = cmpMeta.$tagName$; return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */); }; var forceModeUpdate = (elm) => { if (import_app_data18.BUILD.style && import_app_data18.BUILD.mode && !import_app_data18.BUILD.lazyLoad) { const mode = computeMode(elm); const hostRef = getHostRef(elm); if (hostRef.$modeName$ !== mode) { const cmpMeta = hostRef.$cmpMeta$; const oldScopeId = elm["s-sc"]; const scopeId2 = getScopeId(cmpMeta, mode); const style = elm.constructor.style[mode]; const flags = cmpMeta.$flags$; if (style) { if (!styles.has(scopeId2)) { registerStyle(scopeId2, style, !!(flags & 1 /* shadowDomEncapsulation */)); } hostRef.$modeName$ = mode; elm.classList.remove(oldScopeId + "-h", oldScopeId + "-s"); attachStyles(hostRef); forceUpdate(elm); } } } }; // src/runtime/bootstrap-lazy.ts var import_app_data19 = require("@stencil/core/internal/app-data"); // src/runtime/hmr-component.ts var hmrStart = (hostElement, cmpMeta, hmrVersionId) => { const hostRef = getHostRef(hostElement); hostRef.$flags$ = 1 /* hasConnected */; initializeComponent(hostElement, hostRef, cmpMeta, hmrVersionId); }; // src/runtime/bootstrap-lazy.ts var bootstrapLazy = (lazyBundles, options = {}) => { var _a; if (import_app_data19.BUILD.profile && performance.mark) { performance.mark("st:app:start"); } installDevTools(); const endBootstrap = createTime("bootstrapLazy"); const cmpTags = []; const exclude = options.exclude || []; const customElements2 = win.customElements; const head = doc.head; const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]"); const dataStyles = /* @__PURE__ */ doc.createElement("style"); const deferredConnectedCallbacks = []; let appLoadFallback; let isBootstrapping = true; Object.assign(plt, options); plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href; if (import_app_data19.BUILD.asyncQueue) { if (options.syncQueue) { plt.$flags$ |= 4 /* queueSync */; } } if (import_app_data19.BUILD.hydrateClientSide) { plt.$flags$ |= 2 /* appLoaded */; } let hasSlotRelocation = false; lazyBundles.map((lazyBundle) => { lazyBundle[1].map((compactMeta) => { var _a2; const cmpMeta = { $flags$: compactMeta[0], $tagName$: compactMeta[1], $members$: compactMeta[2], $listeners$: compactMeta[3] }; if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) { hasSlotRelocation = true; } if (import_app_data19.BUILD.member) { cmpMeta.$members$ = compactMeta[2]; } if (import_app_data19.BUILD.hostListener) { cmpMeta.$listeners$ = compactMeta[3]; } if (import_app_data19.BUILD.reflect) { cmpMeta.$attrsToReflect$ = []; } if (import_app_data19.BUILD.watchCallback) { cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {}; } if (import_app_data19.BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { cmpMeta.$flags$ |= 8 /* needsShadowDomShim */; } const tagName = import_app_data19.BUILD.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$; const HostElement = class extends HTMLElement { // StencilLazyHost constructor(self) { super(self); this.hasRegisteredEventListeners = false; self = this; registerHost(self, cmpMeta); if (import_app_data19.BUILD.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) { if (supportsShadow) { if (!self.shadowRoot) { if (import_app_data19.BUILD.shadowDelegatesFocus) { self.attachShadow({ mode: "open", delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */) }); } else { self.attachShadow({ mode: "open" }); } } else { if (self.shadowRoot.mode !== "open") { throw new Error( `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${self.shadowRoot.mode} but Stencil only supports open shadow roots.` ); } } } else if (!import_app_data19.BUILD.hydrateServerSide && !("shadowRoot" in self)) { self.shadowRoot = self; } } } connectedCallback() { const hostRef = getHostRef(this); if (!this.hasRegisteredEventListeners) { this.hasRegisteredEventListeners = true; addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false); } if (appLoadFallback) { clearTimeout(appLoadFallback); appLoadFallback = null; } if (isBootstrapping) { deferredConnectedCallbacks.push(this); } else { plt.jmp(() => connectedCallback(this)); } } disconnectedCallback() { plt.jmp(() => disconnectedCallback(this)); } componentOnReady() { return getHostRef(this).$onReadyPromise$; } }; if (import_app_data19.BUILD.experimentalSlotFixes) { if (import_app_data19.BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) { patchPseudoShadowDom(HostElement.prototype, cmpMeta); } } else { if (import_app_data19.BUILD.slotChildNodesFix) { patchChildSlotNodes(HostElement.prototype, cmpMeta); } if (import_app_data19.BUILD.cloneNodeFix) { patchCloneNode(HostElement.prototype); } if (import_app_data19.BUILD.appendChildSlotFix) { patchSlotAppendChild(HostElement.prototype); } if (import_app_data19.BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) { patchTextContent(HostElement.prototype); } } if (import_app_data19.BUILD.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) { HostElement.formAssociated = true; } if (import_app_data19.BUILD.hotModuleReplacement) { HostElement.prototype["s-hmr"] = function(hmrVersionId) { hmrStart(this, cmpMeta, hmrVersionId); }; } cmpMeta.$lazyBundleId$ = lazyBundle[0]; if (!exclude.includes(tagName) && !customElements2.get(tagName)) { cmpTags.push(tagName); customElements2.define( tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */) ); } }); }); if (cmpTags.length > 0) { if (hasSlotRelocation) { dataStyles.textContent += SLOT_FB_CSS; } if (import_app_data19.BUILD.invisiblePrehydration && (import_app_data19.BUILD.hydratedClass || import_app_data19.BUILD.hydratedAttribute)) { dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS; } if (dataStyles.innerHTML.length) { dataStyles.setAttribute("data-styles", ""); const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc); if (nonce != null) { dataStyles.setAttribute("nonce", nonce); } head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild); } } isBootstrapping = false; if (deferredConnectedCallbacks.length) { deferredConnectedCallbacks.map((host) => host.connectedCallback()); } else { if (import_app_data19.BUILD.profile) { plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout")); } else { plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30)); } } endBootstrap(); }; // src/runtime/fragment.ts var Fragment = (_, children) => children; // src/runtime/host-listener.ts var import_app_data20 = require("@stencil/core/internal/app-data"); var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => { if (import_app_data20.BUILD.hostListener && listeners) { if (import_app_data20.BUILD.hostListenerTargetParent) { if (attachParentListeners) { listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */); } else { listeners = listeners.filter(([flags]) => !(flags & 32 /* TargetParent */)); } } listeners.map(([flags, name, method]) => { const target = import_app_data20.BUILD.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm; const handler = hostListenerProxy(hostRef, method); const opts = hostListenerOpts(flags); plt.ael(target, name, handler, opts); (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts)); }); } }; var hostListenerProxy = (hostRef, methodName) => (ev) => { var _a; try { if (import_app_data20.BUILD.lazyLoad) { if (hostRef.$flags$ & 256 /* isListenReady */) { (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev); } else { (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]); } } else { hostRef.$hostElement$[methodName](ev); } } catch (e) { consoleError(e); } }; var getHostListenerTarget = (elm, flags) => { if (import_app_data20.BUILD.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc; if (import_app_data20.BUILD.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win; if (import_app_data20.BUILD.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body; if (import_app_data20.BUILD.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement) return elm.parentElement; return elm; }; var hostListenerOpts = (flags) => supportsListenerOptions ? { passive: (flags & 1 /* Passive */) !== 0, capture: (flags & 2 /* Capture */) !== 0 } : (flags & 2 /* Capture */) !== 0; // src/runtime/nonce.ts var setNonce = (nonce) => plt.$nonce$ = nonce; // src/runtime/platform-options.ts var setPlatformOptions = (opts) => Object.assign(plt, opts); // src/runtime/vdom/vdom-annotations.ts var insertVdomAnnotations = (doc2, staticComponents) => { if (doc2 != null) { const docData = { hostIds: 0, rootLevelIds: 0, staticComponents: new Set(staticComponents) }; const orgLocationNodes = []; parseVNodeAnnotations(doc2, doc2.body, docData, orgLocationNodes); orgLocationNodes.forEach((orgLocationNode) => { var _a; if (orgLocationNode != null && orgLocationNode["s-nr"]) { const nodeRef = orgLocationNode["s-nr"]; let hostId = nodeRef["s-host-id"]; let nodeId = nodeRef["s-node-id"]; let childId = `${hostId}.${nodeId}`; if (hostId == null) { hostId = 0; docData.rootLevelIds++; nodeId = docData.rootLevelIds; childId = `${hostId}.${nodeId}`; if (nodeRef.nodeType === 1 /* ElementNode */) { nodeRef.setAttribute(HYDRATE_CHILD_ID, childId); } else if (nodeRef.nodeType === 3 /* TextNode */) { if (hostId === 0) { const textContent = (_a = nodeRef.nodeValue) == null ? void 0 : _a.trim(); if (textContent === "") { orgLocationNode.remove(); return; } } const commentBeforeTextNode = doc2.createComment(childId); commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`; insertBefore(nodeRef.parentNode, commentBeforeTextNode, nodeRef); } } let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`; const orgLocationParentNode = orgLocationNode.parentElement; if (orgLocationParentNode) { if (orgLocationParentNode["s-en"] === "") { orgLocationNodeId += `.`; } else if (orgLocationParentNode["s-en"] === "c") { orgLocationNodeId += `.c`; } } orgLocationNode.nodeValue = orgLocationNodeId; } }); } }; var parseVNodeAnnotations = (doc2, node, docData, orgLocationNodes) => { var _a; if (node == null) { return; } if (node["s-nr"] != null) { orgLocationNodes.push(node); } if (node.nodeType === 1 /* ElementNode */) { const childNodes = [...Array.from(node.childNodes), ...Array.from(((_a = node.shadowRoot) == null ? void 0 : _a.childNodes) || [])]; childNodes.forEach((childNode) => { const hostRef = getHostRef(childNode); if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) { const cmpData = { nodeIds: 0 }; insertVNodeAnnotations(doc2, childNode, hostRef.$vnode$, docData, cmpData); } parseVNodeAnnotations(doc2, childNode, docData, orgLocationNodes); }); } }; var insertVNodeAnnotations = (doc2, hostElm, vnode, docData, cmpData) => { if (vnode != null) { const hostId = ++docData.hostIds; hostElm.setAttribute(HYDRATE_ID, hostId); if (hostElm["s-cr"] != null) { hostElm["s-cr"].nodeValue = `${CONTENT_REF_ID}.${hostId}`; } if (vnode.$children$ != null) { const depth = 0; vnode.$children$.forEach((vnodeChild, index) => { insertChildVNodeAnnotations(doc2, vnodeChild, cmpData, hostId, depth, index); }); } if (hostElm && vnode && vnode.$elm$ && !hostElm.hasAttribute(HYDRATE_CHILD_ID)) { const parent = hostElm.parentElement; if (parent && parent.childNodes) { const parentChildNodes = Array.from(parent.childNodes); const comment = parentChildNodes.find( (node) => node.nodeType === 8 /* CommentNode */ && node["s-sr"] ); if (comment) { const index = parentChildNodes.indexOf(hostElm) - 1; vnode.$elm$.setAttribute( HYDRATE_CHILD_ID, `${comment["s-host-id"]}.${comment["s-node-id"]}.0.${index}` ); } } } } }; var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, index) => { const childElm = vnodeChild.$elm$; if (childElm == null) { return; } const nodeId = cmpData.nodeIds++; const childId = `${hostId}.${nodeId}.${depth}.${index}`; childElm["s-host-id"] = hostId; childElm["s-node-id"] = nodeId; if (childElm.nodeType === 1 /* ElementNode */) { childElm.setAttribute(HYDRATE_CHILD_ID, childId); } else if (childElm.nodeType === 3 /* TextNode */) { const parentNode = childElm.parentNode; const nodeName = parentNode == null ? void 0 : parentNode.nodeName; if (nodeName !== "STYLE" && nodeName !== "SCRIPT") { const textNodeId = `${TEXT_NODE_ID}.${childId}`; const commentBeforeTextNode = doc2.createComment(textNodeId); insertBefore(parentNode, commentBeforeTextNode, childElm); } } else if (childElm.nodeType === 8 /* CommentNode */) { if (childElm["s-sr"]) { const slotName = childElm["s-sn"] || ""; const slotNodeId = `${SLOT_NODE_ID}.${childId}.${slotName}`; childElm.nodeValue = slotNodeId; } } if (vnodeChild.$children$ != null) { const childDepth = depth + 1; vnodeChild.$children$.forEach((vnode, index2) => { insertChildVNodeAnnotations(doc2, vnode, cmpData, hostId, childDepth, index2); }); } }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { Build, Env, Fragment, Host, addHostEventListeners, bootstrapLazy, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, doc, flushAll, flushLoadModule, flushQueue, forceModeUpdate, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, getValue, h, insertVdomAnnotations, isMemberInElement, loadModule, modeResolutionChain, nextTick, parsePropertyValue, plt, postUpdateComponent, proxyComponent, proxyCustomElement, readTask, registerComponents, registerHost, registerInstance, registerModule, renderVdom, resetPlatform, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setPlatformOptions, setSupportsShadowDom, setValue, startAutoApplyChanges, stopAutoApplyChanges, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsShadow, win, writeTask });