Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

analog-clock-components

Package Overview
Dependencies
Maintainers
1
Versions
657
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

analog-clock-components - npm Package Compare versions

Comparing version
0.2.85
to
0.2.86
+2
dist/analog-clock/p-Dbd0iDJa.js
var t,e=(t,e)=>{var n;Object.entries(null!=(n=e.o.t)?n:{}).map((([n,[o]])=>{if(31&o||32&o){const o=t[n],l=function(t,e){for(;t;){const n=Object.getOwnPropertyDescriptor(t,e);if(null==n?void 0:n.get)return n;t=Object.getPrototypeOf(t)}}(Object.getPrototypeOf(t),n)||Object.getOwnPropertyDescriptor(t,n);l&&Object.defineProperty(t,n,{get(){return l.get.call(this)},set(t){l.set.call(this,t)},configurable:!0,enumerable:!0}),t[n]=e.l.has(n)?e.l.get(n):o}}))},n=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,n)=>{n&&(t.__stencil__getHostRef=()=>n,n.i=t,512&n.o.u&&e(t,n))},l=(t,e)=>(0,console.error)(t,e),i=new Map,s=new Map,r="undefined"!=typeof window?window:{},c={u:0,h:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},u=t=>Promise.resolve(t),a=(()=>{try{return!!r.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),f=!!a&&(()=>!!r.document&&Object.getOwnPropertyDescriptor(r.document.adoptedStyleSheets,"length").writable)(),d=!1,h=[],p=[],m=(t,e)=>n=>{t.push(n),d||(d=!0,e&&4&c.u?b(y):c.raf(y))},v=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){l(t)}t.length=0},y=()=>{v(h),v(p),(d=h.length>0)&&c.raf(y)},b=t=>u().then(t),w=m(p,!0);function $(){const e=this.attachShadow({mode:"open"});void 0===t&&(t=null),t&&(f?e.adoptedStyleSheets.push(t):e.adoptedStyleSheets=[...e.adoptedStyleSheets,t])}function g(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}var j,O=new WeakMap,S=t=>"sc-"+t.p,k=t=>"object"==(t=typeof t)||"function"===t,M=(t,e,...n)=>{let o=null,l=null,i=!1,s=!1;const r=[],c=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof t&&!k(o))&&(o+=""),i&&s?r[r.length-1].m+=o:r.push(i?C(null,o):o),s=i)};if(c(n),e){e.key&&(l=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const u=C(t,null);return u.v=e,r.length>0&&(u.$=r),u.j=l,u},C=(t,e)=>({u:0,O:t,m:null!=e?e:null,S:null,$:null,v:null,j:null}),E={},x=(t,e)=>null==t||k(t)?t:2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:t,N=(t,e,o,l,i,s)=>{if(o===l)return;let r=((t,e)=>e in t)(t,e);if(e.toLowerCase(),"class"===e){const e=t.classList,n=P(o);let i=P(l);e.remove(...n.filter((t=>t&&!i.includes(t)))),e.add(...i.filter((t=>t&&!n.includes(t))))}else if("key"===e);else{if("a"===e[0]&&e.startsWith("attr:")){const o=e.slice(5);let i;{const e=n(t);if(e&&e.o&&e.o.t){const t=e.o.t[o];t&&t[1]&&(i=t[1])}}return i||(i=o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==l||!1===l?!1===l&&""!==t.getAttribute(i)||t.removeAttribute(i):t.setAttribute(i,!0===l?"":l))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=l}catch(t){}return}{const n=k(l);if((r||n&&null!==l)&&!i)try{if(t.tagName.includes("-"))t[e]!==l&&(t[e]=l);else{const n=null==l?"":l;"list"===e?r=!1:null!=o&&t[e]===n||("function"==typeof t.__lookupSetter__(e)?t[e]=n:t.setAttribute(e,n))}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(e)||t.removeAttribute(e):(!r||4&s||i)&&!n&&1===t.nodeType&&t.setAttribute(e,l=!0===l?"":l)}}},D=/\s/,P=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(D):[]),R=(t,e,n)=>{const o=11===e.S.nodeType&&e.S.host?e.S.host:e.S,l=t&&t.v||{},i=e.v||{};for(const t of A(Object.keys(l)))t in i||N(o,t,l[t],void 0,n,e.u);for(const t of A(Object.keys(i)))N(o,t,l[t],i[t],n,e.u)};function A(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var L=!1,U=(t,e,n)=>{const o=e.$[n];let l,i,s=0;if(L||(L="svg"===o.O),!r.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.S=r.document.createElementNS(L?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.O),L&&"foreignObject"===o.O&&(L=!1),R(null,o,L),o.$){const e="template"===o.O?l.content:l;for(s=0;s<o.$.length;++s)i=U(t,o,s),i&&e.appendChild(i)}return"svg"===o.O?L=!1:"foreignObject"===l.tagName&&(L=!0),l["s-hn"]=j,l},T=(t,e,n,o,l,i)=>{let s,r=t;for(r.shadowRoot&&r.tagName===j&&(r=r.shadowRoot),"template"===n.O&&(r=r.content);l<=i;++l)o[l]&&(s=U(null,n,l),s&&(o[l].S=s,H(r,s,e)))},W=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.S;t&&t.remove()}}},z=(t,e,n=!1)=>t.O===e.O&&(n?(n&&!t.j&&e.j&&(t.j=e.j),!0):t.j===e.j),F=(t,e,n=!1)=>{const o=e.S=t.S,l=t.$,i=e.$,s=e.O;R(t,e,L="svg"===s||"foreignObject"!==s&&L),null!==l&&null!==i?((t,e,n,o,l=!1)=>{let i,s,r=0,c=0,u=0,a=0,f=e.length-1,d=e[0],h=e[f],p=o.length-1,m=o[0],v=o[p];const y="template"===n.O?t.content:t;for(;r<=f&&c<=p;)if(null==d)d=e[++r];else if(null==h)h=e[--f];else if(null==m)m=o[++c];else if(null==v)v=o[--p];else if(z(d,m,l))F(d,m,l),d=e[++r],m=o[++c];else if(z(h,v,l))F(h,v,l),h=e[--f],v=o[--p];else if(z(d,v,l))F(d,v,l),H(y,d.S,h.S.nextSibling),d=e[++r],v=o[--p];else if(z(h,m,l))F(h,m,l),H(y,h.S,d.S),h=e[--f],m=o[++c];else{for(u=-1,a=r;a<=f;++a)if(e[a]&&null!==e[a].j&&e[a].j===m.j){u=a;break}u>=0?(s=e[u],s.O!==m.O?i=U(e&&e[c],n,u):(F(s,m,l),e[u]=void 0,i=s.S),m=o[++c]):(i=U(e&&e[c],n,c),m=o[++c]),i&&H(d.S.parentNode,i,d.S)}r>f?T(t,null==o[p+1]?null:o[p+1].S,n,o,c,p):c>p&&W(e,r,f)})(o,l,e,i,n):null!==i?T(o,null,e,i,0,i.length-1):!n&&null!==l&&W(l,0,l.length-1),L&&"svg"===s&&(L=!1)},H=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),V=(t,e)=>{if(e&&!t.k&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.k=()=>{e["s-p"].splice(n-1,1),o()})))}},q=(t,e)=>{if(t.u|=16,4&t.u)return void(t.u|=512);V(t,t.M);const n=()=>G(t,e);if(!e)return w(n);queueMicrotask((()=>{n()}))},G=(t,e)=>{const n=t.$hostElement$,o=t.i;if(!o)throw Error(`Can't render component <${n.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 l;return e?(t.C.length&&t.C.forEach((t=>t(n))),l=K(o,"componentWillLoad",void 0,n)):l=K(o,"componentWillUpdate",void 0,n),l=Y(l,(()=>K(o,"componentWillRender",void 0,n))),Y(l,(()=>_(t,o,e)))},Y=(t,e)=>Z(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),Z=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,_=async(t,e,n)=>{var o;const l=t.$hostElement$,i=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.u,l=((t,e)=>{var n,o,l;const i=S(e),u=s.get(i);if(!r.document)return i;if(t=11===t.nodeType?t:r.document,u)if("string"==typeof u){let l,s=O.get(t=t.head||t);if(s||O.set(t,s=new Set),!s.has(i)){l=r.document.createElement("style"),l.textContent=u;const d=null!=(n=c.N)?n:g(r.document);if(null!=d&&l.setAttribute("nonce",d),!(1&e.u))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(a){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(u),f?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=u+e.textContent:t.prepend(l)}else t.append(l);1&e.u&&t.insertBefore(l,null),4&e.u&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),s&&s.add(i)}}else{let e=O.get(t);if(e||O.set(t,e=new Set),!e.has(i)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(u.constructor===n.CSSStyleSheet)o=u;else{o=new n.CSSStyleSheet;for(let t=0;t<u.cssRules.length;t++)o.insertRule(u.cssRules[t].cssText,t)}f?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(i)}}return i})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);B(t,e,l,n),i&&(i.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>I(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.u|=4,e.length=0)}},B=(t,e,n,o)=>{try{e=e.render(),t.u&=-17,t.u|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.D||C(null,null),i=(t=>t&&t.O===E)(e)?e:M(null,null,e);if(j=o.tagName,n&&i.v)for(const t of Object.keys(i.v))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.v[t]=o[t]);i.O=null,i.u|=4,t.D=i,i.S=l.S=o.shadowRoot||o,F(l,i,n)})(t,e,o)}catch(e){l(e,t.$hostElement$)}return null},I=t=>{const e=t.$hostElement$,n=t.i,o=t.M;K(n,"componentDidRender",void 0,e),64&t.u?K(n,"componentDidUpdate",void 0,e):(t.u|=64,Q(e),K(n,"componentDidLoad",void 0,e),t.P(e),o||J()),t.k&&(t.k(),t.k=void 0),512&t.u&&b((()=>q(t,!1))),t.u&=-517},J=()=>{b((()=>(t=>{const e=c.ce("appload",{detail:{namespace:"analog-clock"}});return t.dispatchEvent(e),e})(r)))},K=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){l(t,o)}},Q=t=>t.classList.add("hydrated"),X=(t,e,o,l)=>{const i=n(t);if(!i)return;if(!i)throw Error(`Couldn't find host element for "${l.p}" 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/stenciljs/core/issues/5457).`);const s=i.l.get(e),r=i.u,c=i.i;if(o=x(o,l.t[e][0]),(!(8&r)||void 0===s)&&o!==s&&(!Number.isNaN(s)||!Number.isNaN(o))&&(i.l.set(e,o),2&r)){if(c.componentShouldUpdate&&!1===c.componentShouldUpdate(o,s,e)&&!(16&r))return;16&r||q(i,!1)}},tt=(t,e,o)=>{var l,i;const s=t.prototype;if(e.t){const r=Object.entries(null!=(l=e.t)?l:{});if(r.map((([t,[l]])=>{if(31&l||2&o&&32&l){const{get:i,set:r}=Object.getOwnPropertyDescriptor(s,t)||{};i&&(e.t[t][0]|=2048),r&&(e.t[t][0]|=4096),(1&o||!i)&&Object.defineProperty(s,t,{get(){{if(!(2048&e.t[t][0]))return((t,e)=>n(this).l.get(e))(0,t);const o=n(this),l=o?o.i:s;if(!l)return;return l[t]}},configurable:!0,enumerable:!0}),Object.defineProperty(s,t,{set(i){const s=n(this);if(s){if(r)return void 0===(32&l?this[t]:s.$hostElement$[t])&&s.l.get(t)&&(i=s.l.get(t)),r.call(this,x(i,l)),void X(this,t,i=32&l?this[t]:s.$hostElement$[t],e);{if(!(1&o&&4096&e.t[t][0]))return X(this,t,i,e),void(1&o&&!s.i&&s.C.push((()=>{4096&e.t[t][0]&&s.i[t]!==s.l.get(t)&&(s.i[t]=i)})));const n=()=>{const n=s.i[t];!s.l.get(t)&&n&&s.l.set(t,n),s.i[t]=x(i,l),X(this,t,s.i[t],e)};s.i?n():s.C.push((()=>{n()}))}}}})}})),1&o){const o=new Map;s.attributeChangedCallback=function(t,l,i){c.jmp((()=>{var c;const u=o.get(t),a=n(this);if(this.hasOwnProperty(u)&&(i=this[u],delete this[u]),s.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==i)return;if(null==u){const n=null==a?void 0:a.u;if(a&&n&&!(8&n)&&i!==l){const o=a.i,s=null==(c=e.R)?void 0:c[t];null==s||s.forEach((e=>{const[[s,r]]=Object.entries(e);null!=o[s]&&(128&n||1&r)&&o[s].call(o,i,l,t)}))}return}const f=r.find((([t])=>t===u));f&&4&f[1][0]&&(i=null!==i&&"false"!==i);const d=Object.getOwnPropertyDescriptor(s,u);i==this[u]||d.get&&!d.set||(this[u]=i)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=e.R)?i:{}),...r.filter((([t,e])=>31&e[0])).map((([t,e])=>{const n=e[1]||t;return o.set(n,t),n}))]))}}return t},et=(t,e)=>{K(t,"connectedCallback",void 0,e)},nt=(t,e)=>{K(t,"disconnectedCallback",void 0,e||t)},ot=(t,e={})=>{var o;if(!r.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const u=[],f=e.exclude||[],d=r.customElements,h=r.document.head,p=h.querySelector("meta[charset]"),m=r.document.createElement("style"),v=[];let y,b=!0;if(Object.assign(c,e),c.h=new URL(e.resourcesUrl||"./",r.document.baseURI).href,t.map((t=>{t[1].map((e=>{const o={u:e[0],p:e[1],t:e[2],A:e[3]};o.t=e[2];const r=o.p,h=class extends HTMLElement{"s-p";"s-rc";hasRegisteredEventListeners=!1;constructor(t){if(super(t),((t,e)=>{const n={u:0,$hostElement$:t,o:e,l:new Map,L:new Map};n.U=new Promise((t=>n.P=t)),t["s-p"]=[],t["s-rc"]=[],n.C=[];const o=n;t.__stencil__getHostRef=()=>o})(t=this,o),1&o.u)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${o.p}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else $.call(t,o)}connectedCallback(){n(this)&&(this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),y&&(clearTimeout(y),y=null),b?v.push(this):c.jmp((()=>(t=>{if(!(1&c.u)){const e=n(t);if(!e)return;const o=e.o,r=()=>{};if(1&e.u)(null==e?void 0:e.i)?et(e.i,t):(null==e?void 0:e.U)&&e.U.then((()=>et(e.i,t)));else{e.u|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){V(e,e.M=n);break}}o.t&&Object.entries(o.t).map((([e,[n]])=>{if(31&n&&e in t&&t[e]!==Object.prototype[e]){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;try{if(!(32&e.u)){if(e.u|=32,n.T){const s=((t,e)=>{const n=t.p.replace(/-/g,"_"),o=t.T;if(!o)return;const s=i.get(o);return s?s[n]:import(`./${o}.entry.js`).then((t=>(i.set(o,t),t[n])),(t=>{l(t,e.$hostElement$)}))
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,e);if(s&&"then"in s){const t=()=>{};o=await s,t()}else o=s;if(!o)throw Error(`Constructor for "${n.p}#${e.W}" was not found`);o.isProxied||(tt(o,n,2),o.isProxied=!0);const r=()=>{};e.u|=8;try{new o(e)}catch(e){l(e,t)}e.u&=-9,r(),et(e.i,t)}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.u|=128));if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=S(n);if(!s.has(e)){const o=()=>{};((t,e,n)=>{let o=s.get(t);a&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,s.set(t,o)})(e,t,!!(1&n.u)),o()}}}const r=e.M,c=()=>q(e,!0);r&&r["s-rc"]?r["s-rc"].push(c):c()}catch(n){l(n,t),e.k&&(e.k(),e.k=void 0),e.P&&e.P(t)}})(t,e,o)}r()}})(this))))}disconnectedCallback(){c.jmp((()=>(async t=>{if(!(1&c.u)){const e=n(t);(null==e?void 0:e.i)?nt(e.i,t):(null==e?void 0:e.U)&&e.U.then((()=>nt(e.i,t)))}O.has(t)&&O.delete(t),t.shadowRoot&&O.has(t.shadowRoot)&&O.delete(t.shadowRoot)})(this))),c.raf((()=>{var t;const e=n(this);if(!e)return;const o=v.findIndex((t=>t===this));o>-1&&v.splice(o,1),(null==(t=null==e?void 0:e.D)?void 0:t.S)instanceof Node&&!e.D.S.isConnected&&delete e.D.S}))}componentOnReady(){var t;return null==(t=n(this))?void 0:t.U}};o.T=t[0],f.includes(r)||d.get(r)||(u.push(r),d.define(r,tt(h,o,1)))}))})),u.length>0&&(m.textContent+=u.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",m.innerHTML.length)){m.setAttribute("data-styles","");const t=null!=(o=c.N)?o:g(r.document);null!=t&&m.setAttribute("nonce",t),h.insertBefore(m,p?p.nextSibling:h.firstChild)}b=!1,v.length?v.map((t=>t.connectedCallback())):c.jmp((()=>y=setTimeout(J,30)))},lt=t=>c.N=t;export{ot as b,M as h,u as p,o as r,lt as s}
import{r as e,h as t}from"./p-Dbd0iDJa.js";const c=class{constructor(t){e(this,t),this.size=void 0,this.timeZone=0,this.time=Date.now()}componentDidLoad(){this.timer=window.setInterval((()=>{this.time=Date.now()}),250)}disconnectedCallback(){clearInterval(this.timer)}get hour(){return new Date(this.time).getHours()}get minute(){return new Date(this.time).getMinutes()}get second(){return new Date(this.time).getSeconds()}hourToDegrees(){const e=this.hour+this.timeZone;return Math.floor(this.minute/2)+30*e}minuteToDegrees(){return Math.floor(this.second/10)+6*this.minute}secondToDegrees(){return 6*this.second}render(){return t("svg",{key:"39e3465d3bf04035966b00bb15186d1f712163cd",class:"clock",viewBox:"0 0 200 200",width:this.size,height:this.size},t("circle",{key:"e4c4288aa0efc9cf98027eef1f5bd7c550c23a18",id:"circle",cx:"100",cy:"100",r:"95","stroke-width":"10",fill:"transparent"}),t("line",{key:"296fb8ac19749103439f2ce1878db5ccfb214c20",id:"hour",transform:`rotate(${this.hourToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"60","stroke-width":"10","stroke-linecap":"round"}),t("line",{key:"acbe2c6ebdf05ff46e06144839dec43c45e8b40d",id:"minute",transform:`rotate(${this.minuteToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"30","stroke-width":"8","stroke-linecap":"round"}),t("line",{key:"f275abf7169379b2f61c9cdd185068f5e2373d4a",id:"second",transform:`rotate(${this.secondToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"20","stroke-width":"2","stroke-linecap":"round"}))}};c.style=".clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}";export{c as analog_clock}
'use strict';
const NAMESPACE = 'analog-clock';
const BUILD = /* analog-clock */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: false, state: true, updatable: true};
/*
Stencil Client Platform v4.42.1 | MIT Licensed | https://stenciljs.com
*/
// src/utils/constants.ts
var SVG_NS = "http://www.w3.org/2000/svg";
var HTML_NS = "http://www.w3.org/1999/xhtml";
var reWireGetterSetter = (instance, hostRef) => {
var _a;
const cmpMeta = hostRef.$cmpMeta$;
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
members.map(([memberName, [memberFlags]]) => {
if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
const ogValue = instance[memberName];
const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName) || Object.getOwnPropertyDescriptor(instance, memberName);
if (ogDescriptor) {
Object.defineProperty(instance, memberName, {
get() {
return ogDescriptor.get.call(this);
},
set(newValue) {
ogDescriptor.set.call(this, newValue);
},
configurable: true,
enumerable: true
});
}
instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;
}
});
};
function getPropertyDescriptor(obj, memberName) {
while (obj) {
const desc = Object.getOwnPropertyDescriptor(obj, memberName);
if (desc == null ? void 0 : desc.get) return desc;
obj = Object.getPrototypeOf(obj);
}
return void 0;
}
// src/client/client-host-ref.ts
var getHostRef = (ref) => {
if (ref.__stencil__getHostRef) {
return ref.__stencil__getHostRef();
}
return void 0;
};
var registerInstance = (lazyInstance, hostRef) => {
if (!hostRef) return;
lazyInstance.__stencil__getHostRef = () => hostRef;
hostRef.$lazyInstance$ = lazyInstance;
if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.state)) {
reWireGetterSetter(lazyInstance, hostRef);
}
};
var registerHost = (hostElement, cmpMeta) => {
const hostRef = {
$flags$: 0,
$hostElement$: hostElement,
$cmpMeta$: cmpMeta,
$instanceValues$: /* @__PURE__ */ new Map(),
$serializerValues$: /* @__PURE__ */ new Map()
};
{
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
hostElement["s-p"] = [];
hostElement["s-rc"] = [];
}
{
hostRef.$fetchedCbList$ = [];
}
const ref = hostRef;
hostElement.__stencil__getHostRef = () => ref;
return ref;
};
var isMemberInElement = (elm, memberName) => memberName in elm;
var consoleError = (e, el) => (0, console.error)(e, el);
// src/client/client-load-module.ts
var cmpModules = /* @__PURE__ */ new Map();
var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
const bundleId = cmpMeta.$lazyBundleId$;
if (!bundleId) {
return void 0;
}
const module = cmpModules.get(bundleId) ;
if (module) {
return module[exportName];
}
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
return import(
/* @vite-ignore */
/* webpackInclude: /\.entry\.js$/ */
/* webpackExclude: /\.system\.entry\.js$/ */
/* webpackMode: "lazy" */
`./${bundleId}.entry.js${""}`
).then(
(importedModule) => {
{
cmpModules.set(bundleId, importedModule);
}
return importedModule[exportName];
},
(e) => {
consoleError(e, hostRef.$hostElement$);
}
);
};
// src/client/client-style.ts
var styles = /* @__PURE__ */ new Map();
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
var win = typeof window !== "undefined" ? window : {};
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 CustomEvent(eventName, opts)
};
var promiseResolve = (v) => Promise.resolve(v);
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
try {
if (!win.document.adoptedStyleSheets) {
return false;
}
new CSSStyleSheet();
return typeof new CSSStyleSheet().replaceSync === "function";
} catch (e) {
}
return false;
})() ;
var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @__PURE__ */ (() => !!win.document && Object.getOwnPropertyDescriptor(win.document.adoptedStyleSheets, "length").writable)() : false;
var queuePending = false;
var queueDomReads = [];
var queueDomWrites = [];
var queueTask = (queue, write) => (cb) => {
queue.push(cb);
if (!queuePending) {
queuePending = true;
if (write && plt.$flags$ & 4 /* queueSync */) {
nextTick(flush);
} else {
plt.raf(flush);
}
}
};
var consume = (queue) => {
for (let i2 = 0; i2 < queue.length; i2++) {
try {
queue[i2](performance.now());
} catch (e) {
consoleError(e);
}
}
queue.length = 0;
};
var flush = () => {
consume(queueDomReads);
{
consume(queueDomWrites);
if (queuePending = queueDomReads.length > 0) {
plt.raf(flush);
}
}
};
var nextTick = (cb) => promiseResolve().then(cb);
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
// src/utils/style.ts
function createStyleSheetIfNeededAndSupported(styles2) {
return void 0;
}
// src/utils/shadow-root.ts
var globalStyleSheet;
function createShadowRoot(cmpMeta) {
var _a;
const opts = { mode: "open" };
const shadowRoot = this.attachShadow(opts);
if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
if (globalStyleSheet) {
if (supportsMutableAdoptedStyleSheets) {
shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
} else {
shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
}
}
}
var createTime = (fnName, tagName = "") => {
{
return () => {
return;
};
}
};
var uniqueTime = (key, measureText) => {
{
return () => {
return;
};
}
};
// src/utils/query-nonce-meta-tag-content.ts
function queryNonceMetaTagContent(doc) {
var _a, _b, _c;
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
}
// src/runtime/styles.ts
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, _b, _c;
const scopeId2 = getScopeId(cmpMeta);
const style = styles.get(scopeId2);
if (!win.document) {
return scopeId2;
}
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
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)) {
styleElm = win.document.createElement("style");
styleElm.textContent = style;
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
if (nonce != null) {
styleElm.setAttribute("nonce", nonce);
}
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
if (styleContainerNode.nodeName === "HEAD") {
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
styleContainerNode.insertBefore(
styleElm,
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
);
} else if ("host" in styleContainerNode) {
if (supportsConstructableStylesheets) {
const currentWindow = (_b = styleContainerNode.defaultView) != null ? _b : styleContainerNode.ownerDocument.defaultView;
const stylesheet = new currentWindow.CSSStyleSheet();
stylesheet.replaceSync(style);
if (supportsMutableAdoptedStyleSheets) {
styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
} else {
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
}
} else {
const existingStyleContainer = styleContainerNode.querySelector("style");
if (existingStyleContainer) {
existingStyleContainer.textContent = style + existingStyleContainer.textContent;
} else {
styleContainerNode.prepend(styleElm);
}
}
} else {
styleContainerNode.append(styleElm);
}
}
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
styleContainerNode.insertBefore(styleElm, null);
}
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
styleElm.textContent += SLOT_FB_CSS;
}
if (appliedStyles) {
appliedStyles.add(scopeId2);
}
}
} else {
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
if (!appliedStyles) {
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
}
if (!appliedStyles.has(scopeId2)) {
const currentWindow = (_c = styleContainerNode.defaultView) != null ? _c : styleContainerNode.ownerDocument.defaultView;
let stylesheet;
if (style.constructor === currentWindow.CSSStyleSheet) {
stylesheet = style;
} else {
stylesheet = new currentWindow.CSSStyleSheet();
for (let i2 = 0; i2 < style.cssRules.length; i2++) {
stylesheet.insertRule(style.cssRules[i2].cssText, i2);
}
}
if (supportsMutableAdoptedStyleSheets) {
styleContainerNode.adoptedStyleSheets.push(stylesheet);
} else {
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
}
appliedStyles.add(scopeId2);
}
}
}
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(
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
cmpMeta);
if (flags & 10 /* needsScopedEncapsulation */) {
elm["s-sc"] = scopeId2;
elm.classList.add(scopeId2 + "-h");
}
endAttachStyles();
};
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
var isComplexType = (o) => {
o = typeof o;
return o === "object" || o === "function";
};
// src/runtime/vdom/h.ts
var h = (nodeName, vnodeData, ...children) => {
if (typeof nodeName === "string") {
nodeName = transformTag(nodeName);
}
let child = null;
let key = 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);
}
if (simple && lastSimple) {
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
} else {
vNodeChildren.push(simple ? newVNode(null, child) : child);
}
lastSimple = simple;
}
}
};
walk(children);
if (vnodeData) {
if (vnodeData.key) {
key = vnodeData.key;
}
{
const classData = vnodeData.className || vnodeData.class;
if (classData) {
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
}
}
}
const vnode = newVNode(nodeName, null);
vnode.$attrs$ = vnodeData;
if (vNodeChildren.length > 0) {
vnode.$children$ = vNodeChildren;
}
{
vnode.$key$ = key;
}
return vnode;
};
var newVNode = (tag, text) => {
const vnode = {
$flags$: 0,
$tag$: tag,
// Normalize undefined to null to prevent rendering "undefined" as text
$text$: text != null ? text : null,
$elm$: null,
$children$: null
};
{
vnode.$attrs$ = null;
}
{
vnode.$key$ = null;
}
return vnode;
};
var Host = {};
var isHost = (node) => node && node.$tag$ === Host;
// src/runtime/parse-property-value.ts
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
if (propValue != null && !isComplexType(propValue)) {
if (propType & 2 /* Number */) {
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
}
return propValue;
}
return propValue;
};
var emitEvent = (elm, name, opts) => {
const ev = plt.ce(name, opts);
elm.dispatchEvent(ev);
return ev;
};
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
if (oldValue === newValue) {
return;
}
let isProp = isMemberInElement(elm, memberName);
memberName.toLowerCase();
if (memberName === "class") {
const classList = elm.classList;
const oldClasses = parseClassList(oldValue);
let newClasses = parseClassList(newValue);
{
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
}
} else if (memberName === "key") ; else if (memberName[0] === "a" && memberName.startsWith("attr:")) {
const propName = memberName.slice(5);
let attrName;
{
const hostRef = getHostRef(elm);
if (hostRef && hostRef.$cmpMeta$ && hostRef.$cmpMeta$.$members$) {
const memberMeta = hostRef.$cmpMeta$.$members$[propName];
if (memberMeta && memberMeta[1]) {
attrName = memberMeta[1];
}
}
}
if (!attrName) {
attrName = propName.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
}
if (newValue == null || newValue === false) {
if (newValue !== false || elm.getAttribute(attrName) === "") {
elm.removeAttribute(attrName);
}
} else {
elm.setAttribute(attrName, newValue === true ? "" : newValue);
}
return;
} else if (memberName[0] === "p" && memberName.startsWith("prop:")) {
const propName = memberName.slice(5);
try {
elm[propName] = newValue;
} catch (e) {
}
return;
} else {
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) {
if (typeof elm.__lookupSetter__(memberName) === "function") {
elm[memberName] = n;
} else {
elm.setAttribute(memberName, n);
}
}
} else if (elm[memberName] !== newValue) {
elm[memberName] = newValue;
}
} catch (e) {
}
}
if (newValue == null || newValue === false) {
if (newValue !== false || elm.getAttribute(memberName) === "") {
{
elm.removeAttribute(memberName);
}
}
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
newValue = newValue === true ? "" : newValue;
{
elm.setAttribute(memberName, newValue);
}
}
}
};
var parseClassListRegex = /\s/;
var parseClassList = (value) => {
if (typeof value === "object" && value && "baseVal" in value) {
value = value.baseVal;
}
if (!value || typeof value !== "string") {
return [];
}
return value.split(parseClassListRegex);
};
// src/runtime/vdom/update-element.ts
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
const newVnodeAttrs = newVnode.$attrs$ || {};
{
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
);
}
var hostTagName;
var isSvgMode = false;
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
const newVNode2 = newParentVNode.$children$[childIndex];
let i2 = 0;
let elm;
let childNode;
{
if (!isSvgMode) {
isSvgMode = newVNode2.$tag$ === "svg";
}
if (!win.document) {
throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");
}
elm = newVNode2.$elm$ = win.document.createElementNS(
isSvgMode ? SVG_NS : HTML_NS,
newVNode2.$tag$
) ;
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
isSvgMode = false;
}
{
updateElement(null, newVNode2, isSvgMode);
}
if (newVNode2.$children$) {
const appendTarget = newVNode2.$tag$ === "template" ? elm.content : elm;
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
childNode = createElm(oldParentVNode, newVNode2, i2);
if (childNode) {
appendTarget.appendChild(childNode);
}
}
}
{
if (newVNode2.$tag$ === "svg") {
isSvgMode = false;
} else if (elm.tagName === "foreignObject") {
isSvgMode = true;
}
}
}
elm["s-hn"] = hostTagName;
return elm;
};
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
let containerElm = parentElm;
let childNode;
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
containerElm = containerElm.shadowRoot;
}
if (parentVNode.$tag$ === "template") {
containerElm = containerElm.content;
}
for (; startIdx <= endIdx; ++startIdx) {
if (vnodes[startIdx]) {
childNode = createElm(null, parentVNode, startIdx);
if (childNode) {
vnodes[startIdx].$elm$ = childNode;
insertBefore(containerElm, childNode, before);
}
}
}
};
var removeVnodes = (vnodes, startIdx, endIdx) => {
for (let index = startIdx; index <= endIdx; ++index) {
const vnode = vnodes[index];
if (vnode) {
const elm = vnode.$elm$;
if (elm) {
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;
const containerElm = newVNode2.$tag$ === "template" ? parentElm.content : parentElm;
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)) {
patch(oldStartVnode, newEndVnode, isInitialRender);
insertBefore(containerElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
oldStartVnode = oldCh[++oldStartIdx];
newEndVnode = newCh[--newEndIdx];
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
patch(oldEndVnode, newStartVnode, isInitialRender);
insertBefore(containerElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
oldEndVnode = oldCh[--oldEndIdx];
newStartVnode = newCh[++newStartIdx];
} else {
idxInOld = -1;
{
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
idxInOld = i2;
break;
}
}
}
if (idxInOld >= 0) {
elmToMove = oldCh[idxInOld];
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
} else {
patch(elmToMove, newStartVnode, isInitialRender);
oldCh[idxInOld] = void 0;
node = elmToMove.$elm$;
}
newStartVnode = newCh[++newStartIdx];
} else {
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
newStartVnode = newCh[++newStartIdx];
}
if (node) {
{
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 (newStartIdx > newEndIdx) {
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
}
};
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
if (leftVNode.$tag$ === rightVNode.$tag$) {
if (!isInitialRender) {
return leftVNode.$key$ === rightVNode.$key$;
}
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
leftVNode.$key$ = rightVNode.$key$;
}
return true;
}
return false;
};
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
const elm = newVNode2.$elm$ = oldVNode.$elm$;
const oldChildren = oldVNode.$children$;
const newChildren = newVNode2.$children$;
const tag = newVNode2.$tag$;
{
{
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
}
{
updateElement(oldVNode, newVNode2, isSvgMode);
}
if (oldChildren !== null && newChildren !== null) {
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
} else if (newChildren !== null) {
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 && BUILD.updatable && oldChildren !== null
) {
removeVnodes(oldChildren, 0, oldChildren.length - 1);
} else ;
if (isSvgMode && tag === "svg") {
isSvgMode = false;
}
}
};
var insertBefore = (parent, newNode, reference, isInitialLoad) => {
if (parent.__insertBefore) {
return parent.__insertBefore(newNode, reference);
} else {
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
}
};
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
const hostElm = hostRef.$hostElement$;
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
const isHostElement = isHost(renderFnResults);
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
hostTagName = hostElm.tagName;
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$ = hostElm.shadowRoot || hostElm ;
patch(oldVNode, rootVnode, isInitialLoad);
};
// src/runtime/update-component.ts
var attachToAncestor = (hostRef, ancestorComponent) => {
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
const index = ancestorComponent["s-p"].push(
new Promise(
(r) => hostRef.$onRenderResolve$ = () => {
ancestorComponent["s-p"].splice(index - 1, 1);
r();
}
)
);
}
};
var scheduleUpdate = (hostRef, isInitialLoad) => {
{
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
}
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
hostRef.$flags$ |= 512 /* needsRerender */;
return;
}
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
if (isInitialLoad) {
queueMicrotask(() => {
dispatch();
});
return;
}
return writeTask(dispatch) ;
};
var dispatchHooks = (hostRef, isInitialLoad) => {
const elm = hostRef.$hostElement$;
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
const instance = hostRef.$lazyInstance$ ;
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 (hostRef.$fetchedCbList$.length) {
hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
}
}
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
} else {
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
}
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
endSchedule();
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
};
var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err) => {
console.error(err);
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 (isInitialLoad) {
attachStyles(hostRef);
}
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
{
callRender(hostRef, instance, elm, isInitialLoad);
}
if (rc) {
rc.map((cb) => cb());
elm["s-rc"] = void 0;
}
endRender();
endUpdate();
{
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
const postUpdate = () => postUpdateComponent(hostRef);
if (childrenPromises.length === 0) {
postUpdate();
} else {
Promise.all(childrenPromises).then(postUpdate).catch(postUpdate);
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
childrenPromises.length = 0;
}
}
};
var callRender = (hostRef, instance, elm, isInitialLoad) => {
try {
instance = instance.render() ;
{
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
}
{
hostRef.$flags$ |= 2 /* hasRendered */;
}
{
{
{
renderVdom(hostRef, instance, isInitialLoad);
}
}
}
} catch (e) {
consoleError(e, hostRef.$hostElement$);
}
return null;
};
var postUpdateComponent = (hostRef) => {
const tagName = hostRef.$cmpMeta$.$tagName$;
const elm = hostRef.$hostElement$;
const endPostUpdate = createTime("postUpdate", tagName);
const instance = hostRef.$lazyInstance$ ;
const ancestorComponent = hostRef.$ancestorComponent$;
safeCall(instance, "componentDidRender", void 0, elm);
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
{
addHydratedFlag(elm);
}
safeCall(instance, "componentDidLoad", void 0, elm);
endPostUpdate();
{
hostRef.$onReadyResolve$(elm);
if (!ancestorComponent) {
appDidLoad();
}
}
} else {
safeCall(instance, "componentDidUpdate", void 0, elm);
endPostUpdate();
}
{
if (hostRef.$onRenderResolve$) {
hostRef.$onRenderResolve$();
hostRef.$onRenderResolve$ = void 0;
}
if (hostRef.$flags$ & 512 /* needsRerender */) {
nextTick(() => scheduleUpdate(hostRef, false));
}
hostRef.$flags$ &= -517;
}
};
var appDidLoad = (who) => {
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
};
var safeCall = (instance, method, arg, elm) => {
if (instance && instance[method]) {
try {
return instance[method](arg);
} catch (e) {
consoleError(e, elm);
}
}
return void 0;
};
var addHydratedFlag = (elm) => {
var _a;
return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
};
// 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 (!hostRef) {
return;
}
if (!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/stenciljs/core/issues/5457).`
);
}
const oldVal = hostRef.$instanceValues$.get(propName);
const flags = hostRef.$flags$;
const instance = hostRef.$lazyInstance$ ;
newVal = parsePropertyValue(
newVal,
cmpMeta.$members$[propName][0]);
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
const didValueChange = newVal !== oldVal && !areBothNaN;
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
hostRef.$instanceValues$.set(propName, newVal);
if (flags & 2 /* hasRendered */) {
if (instance.componentShouldUpdate) {
const shouldUpdate = instance.componentShouldUpdate(newVal, oldVal, propName);
if (shouldUpdate === false && !(flags & 16 /* isQueuedForUpdate */)) {
return;
}
}
if (!(flags & 16 /* isQueuedForUpdate */)) {
scheduleUpdate(hostRef, false);
}
}
}
};
// src/runtime/proxy-component.ts
var proxyComponent = (Cstr, cmpMeta, flags) => {
var _a, _b;
const prototype = Cstr.prototype;
if (cmpMeta.$members$ || BUILD.propChangeCallback) {
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
members.map(([memberName, [memberFlags]]) => {
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
if (flags & 1 /* isElementConstructor */ || !origGetter) {
Object.defineProperty(prototype, memberName, {
get() {
{
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
return getValue(this, memberName);
}
const ref = getHostRef(this);
const instance = ref ? ref.$lazyInstance$ : prototype;
if (!instance) return;
return instance[memberName];
}
},
configurable: true,
enumerable: true
});
}
Object.defineProperty(prototype, memberName, {
set(newValue) {
const ref = getHostRef(this);
if (!ref) {
return;
}
if (origSetter) {
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
newValue = ref.$instanceValues$.get(memberName);
}
origSetter.apply(this, [
parsePropertyValue(
newValue,
memberFlags)
]);
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
setValue(this, memberName, newValue, cmpMeta);
return;
}
{
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
setValue(this, memberName, newValue, cmpMeta);
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
ref.$fetchedCbList$.push(() => {
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
ref.$lazyInstance$[memberName] = newValue;
}
});
}
return;
}
const setterSetVal = () => {
const currentValue = ref.$lazyInstance$[memberName];
if (!ref.$instanceValues$.get(memberName) && currentValue) {
ref.$instanceValues$.set(memberName, currentValue);
}
ref.$lazyInstance$[memberName] = parsePropertyValue(
newValue,
memberFlags);
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
};
if (ref.$lazyInstance$) {
setterSetVal();
} else {
ref.$fetchedCbList$.push(() => {
setterSetVal();
});
}
}
}
});
}
});
if ((flags & 1 /* isElementConstructor */)) {
const attrNameToPropName = /* @__PURE__ */ new Map();
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
plt.jmp(() => {
var _a2;
const propName = attrNameToPropName.get(attrName);
const hostRef = getHostRef(this);
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
newValue = this[propName];
delete this[propName];
}
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 flags2 = hostRef == null ? void 0 : hostRef.$flags$;
if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && newValue !== oldValue) {
const instance = hostRef.$lazyInstance$ ;
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
entry == null ? void 0 : entry.forEach((watcher) => {
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
if (instance[watchMethodName] != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
instance[watchMethodName].call(instance, newValue, oldValue, attrName);
}
});
}
return;
}
const propFlags = members.find(([m]) => m === propName);
if (propFlags && propFlags[1][0] & 4 /* Boolean */) {
newValue = newValue === null || newValue === "false" ? false : true;
}
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
this[propName] = newValue;
}
});
};
Cstr.observedAttributes = Array.from(
/* @__PURE__ */ new Set([
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
const attrName = m[1] || propName;
attrNameToPropName.set(attrName, propName);
return attrName;
})
])
);
}
}
return Cstr;
};
// src/runtime/initialize-component.ts
var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
let Cstr;
try {
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
const bundleId = cmpMeta.$lazyBundleId$;
if (bundleId) {
const CstrImport = loadModule(cmpMeta, hostRef);
if (CstrImport && "then" in CstrImport) {
const endLoad = uniqueTime();
Cstr = await CstrImport;
endLoad();
} else {
Cstr = CstrImport;
}
if (!Cstr) {
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
}
if (!Cstr.isProxied) {
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
Cstr.isProxied = true;
}
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
{
hostRef.$flags$ |= 8 /* isConstructingInstance */;
}
try {
new Cstr(hostRef);
} catch (e) {
consoleError(e, elm);
}
{
hostRef.$flags$ &= -9 /* isConstructingInstance */;
}
endNewInstance();
{
fireConnectedCallback(hostRef.$lazyInstance$, elm);
}
} else {
Cstr = elm.constructor;
const cmpTag = elm.localName;
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
}
if (Cstr && Cstr.style) {
let style;
if (typeof Cstr.style === "string") {
style = Cstr.style;
}
const scopeId2 = getScopeId(cmpMeta);
if (!styles.has(scopeId2) || BUILD.hotModuleReplacement) {
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
endRegisterStyles();
}
}
}
const ancestorComponent = hostRef.$ancestorComponent$;
const schedule = () => scheduleUpdate(hostRef, true);
if (ancestorComponent && ancestorComponent["s-rc"]) {
ancestorComponent["s-rc"].push(schedule);
} else {
schedule();
}
} catch (e) {
consoleError(e, elm);
if (hostRef.$onRenderResolve$) {
hostRef.$onRenderResolve$();
hostRef.$onRenderResolve$ = void 0;
}
if (hostRef.$onReadyResolve$) {
hostRef.$onReadyResolve$(elm);
}
}
};
var fireConnectedCallback = (instance, elm) => {
{
safeCall(instance, "connectedCallback", void 0, elm);
}
};
// src/runtime/connected-callback.ts
var connectedCallback = (elm) => {
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
const hostRef = getHostRef(elm);
if (!hostRef) {
return;
}
const cmpMeta = hostRef.$cmpMeta$;
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
hostRef.$flags$ |= 1 /* hasConnected */;
{
let ancestorComponent = elm;
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
if (ancestorComponent["s-p"]) {
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
break;
}
}
}
if (cmpMeta.$members$) {
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
if (memberFlags & 31 /* Prop */ && memberName in elm && elm[memberName] !== Object.prototype[memberName]) {
const value = elm[memberName];
delete elm[memberName];
elm[memberName] = value;
}
});
}
{
initializeComponent(elm, hostRef, cmpMeta);
}
} else {
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
fireConnectedCallback(hostRef.$lazyInstance$, elm);
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
}
}
endConnected();
}
};
var disconnectInstance = (instance, elm) => {
{
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
}
};
var disconnectedCallback = async (elm) => {
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
const hostRef = getHostRef(elm);
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
disconnectInstance(hostRef.$lazyInstance$, elm);
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
}
}
if (rootAppliedStyles.has(elm)) {
rootAppliedStyles.delete(elm);
}
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
rootAppliedStyles.delete(elm.shadowRoot);
}
};
// src/runtime/bootstrap-lazy.ts
var bootstrapLazy = (lazyBundles, options = {}) => {
var _a;
if (!win.document) {
console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
return;
}
const endBootstrap = createTime();
const cmpTags = [];
const exclude = options.exclude || [];
const customElements2 = win.customElements;
const head = win.document.head;
const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
const dataStyles = /* @__PURE__ */ win.document.createElement("style");
const deferredConnectedCallbacks = [];
let appLoadFallback;
let isBootstrapping = true;
Object.assign(plt, options);
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
lazyBundles.map((lazyBundle) => {
lazyBundle[1].map((compactMeta) => {
const cmpMeta = {
$flags$: compactMeta[0],
$tagName$: compactMeta[1],
$members$: compactMeta[2],
$listeners$: compactMeta[3]
};
{
cmpMeta.$members$ = compactMeta[2];
}
const tagName = transformTag(cmpMeta.$tagName$);
const HostElement = class extends HTMLElement {
["s-p"];
["s-rc"];
hasRegisteredEventListeners = false;
// StencilLazyHost
constructor(self) {
super(self);
self = this;
registerHost(self, cmpMeta);
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
{
if (!self.shadowRoot) {
createShadowRoot.call(self, cmpMeta);
} 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.`
);
}
}
}
}
}
connectedCallback() {
const hostRef = getHostRef(this);
if (!hostRef) {
return;
}
if (!this.hasRegisteredEventListeners) {
this.hasRegisteredEventListeners = true;
}
if (appLoadFallback) {
clearTimeout(appLoadFallback);
appLoadFallback = null;
}
if (isBootstrapping) {
deferredConnectedCallbacks.push(this);
} else {
plt.jmp(() => connectedCallback(this));
}
}
disconnectedCallback() {
plt.jmp(() => disconnectedCallback(this));
plt.raf(() => {
var _a3;
const hostRef = getHostRef(this);
if (!hostRef) {
return;
}
const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
if (i2 > -1) {
deferredConnectedCallbacks.splice(i2, 1);
}
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
delete hostRef.$vnode$.$elm$;
}
});
}
componentOnReady() {
var _a3;
return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
}
};
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) {
{
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
}
if (dataStyles.innerHTML.length) {
dataStyles.setAttribute("data-styles", "");
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
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 {
{
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
}
}
endBootstrap();
};
// src/runtime/nonce.ts
var setNonce = (nonce) => plt.$nonce$ = nonce;
function transformTag(tag) {
return tag;
}
exports.bootstrapLazy = bootstrapLazy;
exports.h = h;
exports.promiseResolve = promiseResolve;
exports.registerInstance = registerInstance;
exports.setNonce = setNonce;
const NAMESPACE = 'analog-clock';
const BUILD = /* analog-clock */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: false, state: true, updatable: true};
/*
Stencil Client Platform v4.42.1 | MIT Licensed | https://stenciljs.com
*/
// src/utils/constants.ts
var SVG_NS = "http://www.w3.org/2000/svg";
var HTML_NS = "http://www.w3.org/1999/xhtml";
var reWireGetterSetter = (instance, hostRef) => {
var _a;
const cmpMeta = hostRef.$cmpMeta$;
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
members.map(([memberName, [memberFlags]]) => {
if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
const ogValue = instance[memberName];
const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName) || Object.getOwnPropertyDescriptor(instance, memberName);
if (ogDescriptor) {
Object.defineProperty(instance, memberName, {
get() {
return ogDescriptor.get.call(this);
},
set(newValue) {
ogDescriptor.set.call(this, newValue);
},
configurable: true,
enumerable: true
});
}
instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;
}
});
};
function getPropertyDescriptor(obj, memberName) {
while (obj) {
const desc = Object.getOwnPropertyDescriptor(obj, memberName);
if (desc == null ? void 0 : desc.get) return desc;
obj = Object.getPrototypeOf(obj);
}
return void 0;
}
// src/client/client-host-ref.ts
var getHostRef = (ref) => {
if (ref.__stencil__getHostRef) {
return ref.__stencil__getHostRef();
}
return void 0;
};
var registerInstance = (lazyInstance, hostRef) => {
if (!hostRef) return;
lazyInstance.__stencil__getHostRef = () => hostRef;
hostRef.$lazyInstance$ = lazyInstance;
if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.state)) {
reWireGetterSetter(lazyInstance, hostRef);
}
};
var registerHost = (hostElement, cmpMeta) => {
const hostRef = {
$flags$: 0,
$hostElement$: hostElement,
$cmpMeta$: cmpMeta,
$instanceValues$: /* @__PURE__ */ new Map(),
$serializerValues$: /* @__PURE__ */ new Map()
};
{
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
hostElement["s-p"] = [];
hostElement["s-rc"] = [];
}
{
hostRef.$fetchedCbList$ = [];
}
const ref = hostRef;
hostElement.__stencil__getHostRef = () => ref;
return ref;
};
var isMemberInElement = (elm, memberName) => memberName in elm;
var consoleError = (e, el) => (0, console.error)(e, el);
// src/client/client-load-module.ts
var cmpModules = /* @__PURE__ */ new Map();
var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
const bundleId = cmpMeta.$lazyBundleId$;
if (!bundleId) {
return void 0;
}
const module = cmpModules.get(bundleId) ;
if (module) {
return module[exportName];
}
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
return import(
/* @vite-ignore */
/* webpackInclude: /\.entry\.js$/ */
/* webpackExclude: /\.system\.entry\.js$/ */
/* webpackMode: "lazy" */
`./${bundleId}.entry.js${""}`
).then(
(importedModule) => {
{
cmpModules.set(bundleId, importedModule);
}
return importedModule[exportName];
},
(e) => {
consoleError(e, hostRef.$hostElement$);
}
);
};
// src/client/client-style.ts
var styles = /* @__PURE__ */ new Map();
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
var win = typeof window !== "undefined" ? window : {};
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 CustomEvent(eventName, opts)
};
var promiseResolve = (v) => Promise.resolve(v);
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
try {
if (!win.document.adoptedStyleSheets) {
return false;
}
new CSSStyleSheet();
return typeof new CSSStyleSheet().replaceSync === "function";
} catch (e) {
}
return false;
})() ;
var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @__PURE__ */ (() => !!win.document && Object.getOwnPropertyDescriptor(win.document.adoptedStyleSheets, "length").writable)() : false;
var queuePending = false;
var queueDomReads = [];
var queueDomWrites = [];
var queueTask = (queue, write) => (cb) => {
queue.push(cb);
if (!queuePending) {
queuePending = true;
if (write && plt.$flags$ & 4 /* queueSync */) {
nextTick(flush);
} else {
plt.raf(flush);
}
}
};
var consume = (queue) => {
for (let i2 = 0; i2 < queue.length; i2++) {
try {
queue[i2](performance.now());
} catch (e) {
consoleError(e);
}
}
queue.length = 0;
};
var flush = () => {
consume(queueDomReads);
{
consume(queueDomWrites);
if (queuePending = queueDomReads.length > 0) {
plt.raf(flush);
}
}
};
var nextTick = (cb) => promiseResolve().then(cb);
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
// src/utils/style.ts
function createStyleSheetIfNeededAndSupported(styles2) {
return void 0;
}
// src/utils/shadow-root.ts
var globalStyleSheet;
function createShadowRoot(cmpMeta) {
var _a;
const opts = { mode: "open" };
const shadowRoot = this.attachShadow(opts);
if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
if (globalStyleSheet) {
if (supportsMutableAdoptedStyleSheets) {
shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
} else {
shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
}
}
}
var createTime = (fnName, tagName = "") => {
{
return () => {
return;
};
}
};
var uniqueTime = (key, measureText) => {
{
return () => {
return;
};
}
};
// src/utils/query-nonce-meta-tag-content.ts
function queryNonceMetaTagContent(doc) {
var _a, _b, _c;
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
}
// src/runtime/styles.ts
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, _b, _c;
const scopeId2 = getScopeId(cmpMeta);
const style = styles.get(scopeId2);
if (!win.document) {
return scopeId2;
}
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
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)) {
styleElm = win.document.createElement("style");
styleElm.textContent = style;
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
if (nonce != null) {
styleElm.setAttribute("nonce", nonce);
}
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
if (styleContainerNode.nodeName === "HEAD") {
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
styleContainerNode.insertBefore(
styleElm,
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
);
} else if ("host" in styleContainerNode) {
if (supportsConstructableStylesheets) {
const currentWindow = (_b = styleContainerNode.defaultView) != null ? _b : styleContainerNode.ownerDocument.defaultView;
const stylesheet = new currentWindow.CSSStyleSheet();
stylesheet.replaceSync(style);
if (supportsMutableAdoptedStyleSheets) {
styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
} else {
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
}
} else {
const existingStyleContainer = styleContainerNode.querySelector("style");
if (existingStyleContainer) {
existingStyleContainer.textContent = style + existingStyleContainer.textContent;
} else {
styleContainerNode.prepend(styleElm);
}
}
} else {
styleContainerNode.append(styleElm);
}
}
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
styleContainerNode.insertBefore(styleElm, null);
}
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
styleElm.textContent += SLOT_FB_CSS;
}
if (appliedStyles) {
appliedStyles.add(scopeId2);
}
}
} else {
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
if (!appliedStyles) {
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
}
if (!appliedStyles.has(scopeId2)) {
const currentWindow = (_c = styleContainerNode.defaultView) != null ? _c : styleContainerNode.ownerDocument.defaultView;
let stylesheet;
if (style.constructor === currentWindow.CSSStyleSheet) {
stylesheet = style;
} else {
stylesheet = new currentWindow.CSSStyleSheet();
for (let i2 = 0; i2 < style.cssRules.length; i2++) {
stylesheet.insertRule(style.cssRules[i2].cssText, i2);
}
}
if (supportsMutableAdoptedStyleSheets) {
styleContainerNode.adoptedStyleSheets.push(stylesheet);
} else {
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
}
appliedStyles.add(scopeId2);
}
}
}
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(
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
cmpMeta);
if (flags & 10 /* needsScopedEncapsulation */) {
elm["s-sc"] = scopeId2;
elm.classList.add(scopeId2 + "-h");
}
endAttachStyles();
};
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
var isComplexType = (o) => {
o = typeof o;
return o === "object" || o === "function";
};
// src/runtime/vdom/h.ts
var h = (nodeName, vnodeData, ...children) => {
if (typeof nodeName === "string") {
nodeName = transformTag(nodeName);
}
let child = null;
let key = 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);
}
if (simple && lastSimple) {
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
} else {
vNodeChildren.push(simple ? newVNode(null, child) : child);
}
lastSimple = simple;
}
}
};
walk(children);
if (vnodeData) {
if (vnodeData.key) {
key = vnodeData.key;
}
{
const classData = vnodeData.className || vnodeData.class;
if (classData) {
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
}
}
}
const vnode = newVNode(nodeName, null);
vnode.$attrs$ = vnodeData;
if (vNodeChildren.length > 0) {
vnode.$children$ = vNodeChildren;
}
{
vnode.$key$ = key;
}
return vnode;
};
var newVNode = (tag, text) => {
const vnode = {
$flags$: 0,
$tag$: tag,
// Normalize undefined to null to prevent rendering "undefined" as text
$text$: text != null ? text : null,
$elm$: null,
$children$: null
};
{
vnode.$attrs$ = null;
}
{
vnode.$key$ = null;
}
return vnode;
};
var Host = {};
var isHost = (node) => node && node.$tag$ === Host;
// src/runtime/parse-property-value.ts
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
if (propValue != null && !isComplexType(propValue)) {
if (propType & 2 /* Number */) {
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
}
return propValue;
}
return propValue;
};
var emitEvent = (elm, name, opts) => {
const ev = plt.ce(name, opts);
elm.dispatchEvent(ev);
return ev;
};
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
if (oldValue === newValue) {
return;
}
let isProp = isMemberInElement(elm, memberName);
memberName.toLowerCase();
if (memberName === "class") {
const classList = elm.classList;
const oldClasses = parseClassList(oldValue);
let newClasses = parseClassList(newValue);
{
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
}
} else if (memberName === "key") ; else if (memberName[0] === "a" && memberName.startsWith("attr:")) {
const propName = memberName.slice(5);
let attrName;
{
const hostRef = getHostRef(elm);
if (hostRef && hostRef.$cmpMeta$ && hostRef.$cmpMeta$.$members$) {
const memberMeta = hostRef.$cmpMeta$.$members$[propName];
if (memberMeta && memberMeta[1]) {
attrName = memberMeta[1];
}
}
}
if (!attrName) {
attrName = propName.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
}
if (newValue == null || newValue === false) {
if (newValue !== false || elm.getAttribute(attrName) === "") {
elm.removeAttribute(attrName);
}
} else {
elm.setAttribute(attrName, newValue === true ? "" : newValue);
}
return;
} else if (memberName[0] === "p" && memberName.startsWith("prop:")) {
const propName = memberName.slice(5);
try {
elm[propName] = newValue;
} catch (e) {
}
return;
} else {
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) {
if (typeof elm.__lookupSetter__(memberName) === "function") {
elm[memberName] = n;
} else {
elm.setAttribute(memberName, n);
}
}
} else if (elm[memberName] !== newValue) {
elm[memberName] = newValue;
}
} catch (e) {
}
}
if (newValue == null || newValue === false) {
if (newValue !== false || elm.getAttribute(memberName) === "") {
{
elm.removeAttribute(memberName);
}
}
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
newValue = newValue === true ? "" : newValue;
{
elm.setAttribute(memberName, newValue);
}
}
}
};
var parseClassListRegex = /\s/;
var parseClassList = (value) => {
if (typeof value === "object" && value && "baseVal" in value) {
value = value.baseVal;
}
if (!value || typeof value !== "string") {
return [];
}
return value.split(parseClassListRegex);
};
// src/runtime/vdom/update-element.ts
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
const newVnodeAttrs = newVnode.$attrs$ || {};
{
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
);
}
var hostTagName;
var isSvgMode = false;
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
const newVNode2 = newParentVNode.$children$[childIndex];
let i2 = 0;
let elm;
let childNode;
{
if (!isSvgMode) {
isSvgMode = newVNode2.$tag$ === "svg";
}
if (!win.document) {
throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");
}
elm = newVNode2.$elm$ = win.document.createElementNS(
isSvgMode ? SVG_NS : HTML_NS,
newVNode2.$tag$
) ;
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
isSvgMode = false;
}
{
updateElement(null, newVNode2, isSvgMode);
}
if (newVNode2.$children$) {
const appendTarget = newVNode2.$tag$ === "template" ? elm.content : elm;
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
childNode = createElm(oldParentVNode, newVNode2, i2);
if (childNode) {
appendTarget.appendChild(childNode);
}
}
}
{
if (newVNode2.$tag$ === "svg") {
isSvgMode = false;
} else if (elm.tagName === "foreignObject") {
isSvgMode = true;
}
}
}
elm["s-hn"] = hostTagName;
return elm;
};
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
let containerElm = parentElm;
let childNode;
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
containerElm = containerElm.shadowRoot;
}
if (parentVNode.$tag$ === "template") {
containerElm = containerElm.content;
}
for (; startIdx <= endIdx; ++startIdx) {
if (vnodes[startIdx]) {
childNode = createElm(null, parentVNode, startIdx);
if (childNode) {
vnodes[startIdx].$elm$ = childNode;
insertBefore(containerElm, childNode, before);
}
}
}
};
var removeVnodes = (vnodes, startIdx, endIdx) => {
for (let index = startIdx; index <= endIdx; ++index) {
const vnode = vnodes[index];
if (vnode) {
const elm = vnode.$elm$;
if (elm) {
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;
const containerElm = newVNode2.$tag$ === "template" ? parentElm.content : parentElm;
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)) {
patch(oldStartVnode, newEndVnode, isInitialRender);
insertBefore(containerElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
oldStartVnode = oldCh[++oldStartIdx];
newEndVnode = newCh[--newEndIdx];
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
patch(oldEndVnode, newStartVnode, isInitialRender);
insertBefore(containerElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
oldEndVnode = oldCh[--oldEndIdx];
newStartVnode = newCh[++newStartIdx];
} else {
idxInOld = -1;
{
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
idxInOld = i2;
break;
}
}
}
if (idxInOld >= 0) {
elmToMove = oldCh[idxInOld];
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
} else {
patch(elmToMove, newStartVnode, isInitialRender);
oldCh[idxInOld] = void 0;
node = elmToMove.$elm$;
}
newStartVnode = newCh[++newStartIdx];
} else {
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
newStartVnode = newCh[++newStartIdx];
}
if (node) {
{
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 (newStartIdx > newEndIdx) {
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
}
};
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
if (leftVNode.$tag$ === rightVNode.$tag$) {
if (!isInitialRender) {
return leftVNode.$key$ === rightVNode.$key$;
}
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
leftVNode.$key$ = rightVNode.$key$;
}
return true;
}
return false;
};
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
const elm = newVNode2.$elm$ = oldVNode.$elm$;
const oldChildren = oldVNode.$children$;
const newChildren = newVNode2.$children$;
const tag = newVNode2.$tag$;
{
{
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
}
{
updateElement(oldVNode, newVNode2, isSvgMode);
}
if (oldChildren !== null && newChildren !== null) {
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
} else if (newChildren !== null) {
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 && BUILD.updatable && oldChildren !== null
) {
removeVnodes(oldChildren, 0, oldChildren.length - 1);
} else ;
if (isSvgMode && tag === "svg") {
isSvgMode = false;
}
}
};
var insertBefore = (parent, newNode, reference, isInitialLoad) => {
if (parent.__insertBefore) {
return parent.__insertBefore(newNode, reference);
} else {
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
}
};
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
const hostElm = hostRef.$hostElement$;
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
const isHostElement = isHost(renderFnResults);
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
hostTagName = hostElm.tagName;
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$ = hostElm.shadowRoot || hostElm ;
patch(oldVNode, rootVnode, isInitialLoad);
};
// src/runtime/update-component.ts
var attachToAncestor = (hostRef, ancestorComponent) => {
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
const index = ancestorComponent["s-p"].push(
new Promise(
(r) => hostRef.$onRenderResolve$ = () => {
ancestorComponent["s-p"].splice(index - 1, 1);
r();
}
)
);
}
};
var scheduleUpdate = (hostRef, isInitialLoad) => {
{
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
}
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
hostRef.$flags$ |= 512 /* needsRerender */;
return;
}
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
if (isInitialLoad) {
queueMicrotask(() => {
dispatch();
});
return;
}
return writeTask(dispatch) ;
};
var dispatchHooks = (hostRef, isInitialLoad) => {
const elm = hostRef.$hostElement$;
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
const instance = hostRef.$lazyInstance$ ;
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 (hostRef.$fetchedCbList$.length) {
hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
}
}
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
} else {
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
}
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
endSchedule();
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
};
var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err) => {
console.error(err);
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 (isInitialLoad) {
attachStyles(hostRef);
}
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
{
callRender(hostRef, instance, elm, isInitialLoad);
}
if (rc) {
rc.map((cb) => cb());
elm["s-rc"] = void 0;
}
endRender();
endUpdate();
{
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
const postUpdate = () => postUpdateComponent(hostRef);
if (childrenPromises.length === 0) {
postUpdate();
} else {
Promise.all(childrenPromises).then(postUpdate).catch(postUpdate);
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
childrenPromises.length = 0;
}
}
};
var callRender = (hostRef, instance, elm, isInitialLoad) => {
try {
instance = instance.render() ;
{
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
}
{
hostRef.$flags$ |= 2 /* hasRendered */;
}
{
{
{
renderVdom(hostRef, instance, isInitialLoad);
}
}
}
} catch (e) {
consoleError(e, hostRef.$hostElement$);
}
return null;
};
var postUpdateComponent = (hostRef) => {
const tagName = hostRef.$cmpMeta$.$tagName$;
const elm = hostRef.$hostElement$;
const endPostUpdate = createTime("postUpdate", tagName);
const instance = hostRef.$lazyInstance$ ;
const ancestorComponent = hostRef.$ancestorComponent$;
safeCall(instance, "componentDidRender", void 0, elm);
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
{
addHydratedFlag(elm);
}
safeCall(instance, "componentDidLoad", void 0, elm);
endPostUpdate();
{
hostRef.$onReadyResolve$(elm);
if (!ancestorComponent) {
appDidLoad();
}
}
} else {
safeCall(instance, "componentDidUpdate", void 0, elm);
endPostUpdate();
}
{
if (hostRef.$onRenderResolve$) {
hostRef.$onRenderResolve$();
hostRef.$onRenderResolve$ = void 0;
}
if (hostRef.$flags$ & 512 /* needsRerender */) {
nextTick(() => scheduleUpdate(hostRef, false));
}
hostRef.$flags$ &= -517;
}
};
var appDidLoad = (who) => {
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
};
var safeCall = (instance, method, arg, elm) => {
if (instance && instance[method]) {
try {
return instance[method](arg);
} catch (e) {
consoleError(e, elm);
}
}
return void 0;
};
var addHydratedFlag = (elm) => {
var _a;
return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
};
// 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 (!hostRef) {
return;
}
if (!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/stenciljs/core/issues/5457).`
);
}
const oldVal = hostRef.$instanceValues$.get(propName);
const flags = hostRef.$flags$;
const instance = hostRef.$lazyInstance$ ;
newVal = parsePropertyValue(
newVal,
cmpMeta.$members$[propName][0]);
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
const didValueChange = newVal !== oldVal && !areBothNaN;
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
hostRef.$instanceValues$.set(propName, newVal);
if (flags & 2 /* hasRendered */) {
if (instance.componentShouldUpdate) {
const shouldUpdate = instance.componentShouldUpdate(newVal, oldVal, propName);
if (shouldUpdate === false && !(flags & 16 /* isQueuedForUpdate */)) {
return;
}
}
if (!(flags & 16 /* isQueuedForUpdate */)) {
scheduleUpdate(hostRef, false);
}
}
}
};
// src/runtime/proxy-component.ts
var proxyComponent = (Cstr, cmpMeta, flags) => {
var _a, _b;
const prototype = Cstr.prototype;
if (cmpMeta.$members$ || BUILD.propChangeCallback) {
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
members.map(([memberName, [memberFlags]]) => {
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
if (flags & 1 /* isElementConstructor */ || !origGetter) {
Object.defineProperty(prototype, memberName, {
get() {
{
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
return getValue(this, memberName);
}
const ref = getHostRef(this);
const instance = ref ? ref.$lazyInstance$ : prototype;
if (!instance) return;
return instance[memberName];
}
},
configurable: true,
enumerable: true
});
}
Object.defineProperty(prototype, memberName, {
set(newValue) {
const ref = getHostRef(this);
if (!ref) {
return;
}
if (origSetter) {
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
newValue = ref.$instanceValues$.get(memberName);
}
origSetter.apply(this, [
parsePropertyValue(
newValue,
memberFlags)
]);
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
setValue(this, memberName, newValue, cmpMeta);
return;
}
{
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
setValue(this, memberName, newValue, cmpMeta);
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
ref.$fetchedCbList$.push(() => {
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
ref.$lazyInstance$[memberName] = newValue;
}
});
}
return;
}
const setterSetVal = () => {
const currentValue = ref.$lazyInstance$[memberName];
if (!ref.$instanceValues$.get(memberName) && currentValue) {
ref.$instanceValues$.set(memberName, currentValue);
}
ref.$lazyInstance$[memberName] = parsePropertyValue(
newValue,
memberFlags);
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
};
if (ref.$lazyInstance$) {
setterSetVal();
} else {
ref.$fetchedCbList$.push(() => {
setterSetVal();
});
}
}
}
});
}
});
if ((flags & 1 /* isElementConstructor */)) {
const attrNameToPropName = /* @__PURE__ */ new Map();
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
plt.jmp(() => {
var _a2;
const propName = attrNameToPropName.get(attrName);
const hostRef = getHostRef(this);
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
newValue = this[propName];
delete this[propName];
}
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 flags2 = hostRef == null ? void 0 : hostRef.$flags$;
if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && newValue !== oldValue) {
const instance = hostRef.$lazyInstance$ ;
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
entry == null ? void 0 : entry.forEach((watcher) => {
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
if (instance[watchMethodName] != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
instance[watchMethodName].call(instance, newValue, oldValue, attrName);
}
});
}
return;
}
const propFlags = members.find(([m]) => m === propName);
if (propFlags && propFlags[1][0] & 4 /* Boolean */) {
newValue = newValue === null || newValue === "false" ? false : true;
}
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
this[propName] = newValue;
}
});
};
Cstr.observedAttributes = Array.from(
/* @__PURE__ */ new Set([
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
const attrName = m[1] || propName;
attrNameToPropName.set(attrName, propName);
return attrName;
})
])
);
}
}
return Cstr;
};
// src/runtime/initialize-component.ts
var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
let Cstr;
try {
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
const bundleId = cmpMeta.$lazyBundleId$;
if (bundleId) {
const CstrImport = loadModule(cmpMeta, hostRef);
if (CstrImport && "then" in CstrImport) {
const endLoad = uniqueTime();
Cstr = await CstrImport;
endLoad();
} else {
Cstr = CstrImport;
}
if (!Cstr) {
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
}
if (!Cstr.isProxied) {
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
Cstr.isProxied = true;
}
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
{
hostRef.$flags$ |= 8 /* isConstructingInstance */;
}
try {
new Cstr(hostRef);
} catch (e) {
consoleError(e, elm);
}
{
hostRef.$flags$ &= -9 /* isConstructingInstance */;
}
endNewInstance();
{
fireConnectedCallback(hostRef.$lazyInstance$, elm);
}
} else {
Cstr = elm.constructor;
const cmpTag = elm.localName;
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
}
if (Cstr && Cstr.style) {
let style;
if (typeof Cstr.style === "string") {
style = Cstr.style;
}
const scopeId2 = getScopeId(cmpMeta);
if (!styles.has(scopeId2) || BUILD.hotModuleReplacement) {
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
endRegisterStyles();
}
}
}
const ancestorComponent = hostRef.$ancestorComponent$;
const schedule = () => scheduleUpdate(hostRef, true);
if (ancestorComponent && ancestorComponent["s-rc"]) {
ancestorComponent["s-rc"].push(schedule);
} else {
schedule();
}
} catch (e) {
consoleError(e, elm);
if (hostRef.$onRenderResolve$) {
hostRef.$onRenderResolve$();
hostRef.$onRenderResolve$ = void 0;
}
if (hostRef.$onReadyResolve$) {
hostRef.$onReadyResolve$(elm);
}
}
};
var fireConnectedCallback = (instance, elm) => {
{
safeCall(instance, "connectedCallback", void 0, elm);
}
};
// src/runtime/connected-callback.ts
var connectedCallback = (elm) => {
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
const hostRef = getHostRef(elm);
if (!hostRef) {
return;
}
const cmpMeta = hostRef.$cmpMeta$;
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
hostRef.$flags$ |= 1 /* hasConnected */;
{
let ancestorComponent = elm;
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
if (ancestorComponent["s-p"]) {
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
break;
}
}
}
if (cmpMeta.$members$) {
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
if (memberFlags & 31 /* Prop */ && memberName in elm && elm[memberName] !== Object.prototype[memberName]) {
const value = elm[memberName];
delete elm[memberName];
elm[memberName] = value;
}
});
}
{
initializeComponent(elm, hostRef, cmpMeta);
}
} else {
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
fireConnectedCallback(hostRef.$lazyInstance$, elm);
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
}
}
endConnected();
}
};
var disconnectInstance = (instance, elm) => {
{
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
}
};
var disconnectedCallback = async (elm) => {
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
const hostRef = getHostRef(elm);
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
disconnectInstance(hostRef.$lazyInstance$, elm);
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
}
}
if (rootAppliedStyles.has(elm)) {
rootAppliedStyles.delete(elm);
}
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
rootAppliedStyles.delete(elm.shadowRoot);
}
};
// src/runtime/bootstrap-lazy.ts
var bootstrapLazy = (lazyBundles, options = {}) => {
var _a;
if (!win.document) {
console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
return;
}
const endBootstrap = createTime();
const cmpTags = [];
const exclude = options.exclude || [];
const customElements2 = win.customElements;
const head = win.document.head;
const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
const dataStyles = /* @__PURE__ */ win.document.createElement("style");
const deferredConnectedCallbacks = [];
let appLoadFallback;
let isBootstrapping = true;
Object.assign(plt, options);
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
lazyBundles.map((lazyBundle) => {
lazyBundle[1].map((compactMeta) => {
const cmpMeta = {
$flags$: compactMeta[0],
$tagName$: compactMeta[1],
$members$: compactMeta[2],
$listeners$: compactMeta[3]
};
{
cmpMeta.$members$ = compactMeta[2];
}
const tagName = transformTag(cmpMeta.$tagName$);
const HostElement = class extends HTMLElement {
["s-p"];
["s-rc"];
hasRegisteredEventListeners = false;
// StencilLazyHost
constructor(self) {
super(self);
self = this;
registerHost(self, cmpMeta);
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
{
if (!self.shadowRoot) {
createShadowRoot.call(self, cmpMeta);
} 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.`
);
}
}
}
}
}
connectedCallback() {
const hostRef = getHostRef(this);
if (!hostRef) {
return;
}
if (!this.hasRegisteredEventListeners) {
this.hasRegisteredEventListeners = true;
}
if (appLoadFallback) {
clearTimeout(appLoadFallback);
appLoadFallback = null;
}
if (isBootstrapping) {
deferredConnectedCallbacks.push(this);
} else {
plt.jmp(() => connectedCallback(this));
}
}
disconnectedCallback() {
plt.jmp(() => disconnectedCallback(this));
plt.raf(() => {
var _a3;
const hostRef = getHostRef(this);
if (!hostRef) {
return;
}
const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
if (i2 > -1) {
deferredConnectedCallbacks.splice(i2, 1);
}
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
delete hostRef.$vnode$.$elm$;
}
});
}
componentOnReady() {
var _a3;
return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
}
};
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) {
{
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
}
if (dataStyles.innerHTML.length) {
dataStyles.setAttribute("data-styles", "");
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
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 {
{
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
}
}
endBootstrap();
};
// src/runtime/nonce.ts
var setNonce = (nonce) => plt.$nonce$ = nonce;
function transformTag(tag) {
return tag;
}
export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };
+1
-1

@@ -1,1 +0,1 @@

import{p as e,b as o}from"./p-CEu1VQJ3.js";export{s as setNonce}from"./p-CEu1VQJ3.js";import{g as t}from"./p-DQuL1Twl.js";(()=>{const o=import.meta.url,s={};return""!==o&&(s.resourcesUrl=new URL(".",o).href),e(s)})().then((async e=>(await t(),o([["p-d57bbdde",[[1,"analog-clock",{size:[2],timeZone:[2,"time-zone"],time:[32]}]]]],e))));
import{p as a,b as o}from"./p-Dbd0iDJa.js";export{s as setNonce}from"./p-Dbd0iDJa.js";import{g as e}from"./p-DQuL1Twl.js";(()=>{const o=import.meta.url,e={};return""!==o&&(e.resourcesUrl=new URL(".",o).href),a(e)})().then((async a=>(await e(),o([["p-f331dba3",[[1,"analog-clock",{size:[2],timeZone:[2,"time-zone"],time:[32]}]]]],a))));
'use strict';
var index = require('./index-DEcvsyme.js');
var index = require('./index-DcA-IKwV.js');

@@ -5,0 +5,0 @@ const analogClockCss = () => `.clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}`;

'use strict';
var index = require('./index-DEcvsyme.js');
var index = require('./index-DcA-IKwV.js');
var appGlobals = require('./app-globals-V2Kpy_OQ.js');

@@ -8,3 +8,3 @@

/*
Stencil Client Patch Browser v4.42.0 | MIT Licensed | https://stenciljs.com
Stencil Client Patch Browser v4.42.1 | MIT Licensed | https://stenciljs.com
*/

@@ -11,0 +11,0 @@

'use strict';
var index = require('./index-DEcvsyme.js');
var index = require('./index-DcA-IKwV.js');
var appGlobals = require('./app-globals-V2Kpy_OQ.js');

@@ -5,0 +5,0 @@

@@ -7,3 +7,3 @@ {

"name": "@stencil/core",
"version": "4.42.0",
"version": "4.42.1",
"typescriptVersion": "5.8.3"

@@ -10,0 +10,0 @@ },

@@ -1,2 +0,2 @@

import { r as registerInstance, h } from './index-CEu1VQJ3.js';
import { r as registerInstance, h } from './index-Dbd0iDJa.js';

@@ -3,0 +3,0 @@ const analogClockCss = () => `.clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}`;

@@ -1,7 +0,7 @@

import { p as promiseResolve, b as bootstrapLazy } from './index-CEu1VQJ3.js';
export { s as setNonce } from './index-CEu1VQJ3.js';
import { p as promiseResolve, b as bootstrapLazy } from './index-Dbd0iDJa.js';
export { s as setNonce } from './index-Dbd0iDJa.js';
import { g as globalScripts } from './app-globals-DQuL1Twl.js';
/*
Stencil Client Patch Browser v4.42.0 | MIT Licensed | https://stenciljs.com
Stencil Client Patch Browser v4.42.1 | MIT Licensed | https://stenciljs.com
*/

@@ -8,0 +8,0 @@

@@ -1,3 +0,3 @@

import { b as bootstrapLazy } from './index-CEu1VQJ3.js';
export { s as setNonce } from './index-CEu1VQJ3.js';
import { b as bootstrapLazy } from './index-Dbd0iDJa.js';
export { s as setNonce } from './index-Dbd0iDJa.js';
import { g as globalScripts } from './app-globals-DQuL1Twl.js';

@@ -4,0 +4,0 @@

{
"name": "analog-clock-components",
"version": "0.2.85",
"version": "0.2.86",
"description": "Stencil Component Starter",

@@ -18,3 +18,3 @@ "main": "dist/index.cjs.js",

"dependencies": {
"@stencil/core": "4.42.0"
"@stencil/core": "4.42.1"
},

@@ -21,0 +21,0 @@ "license": "MIT",

var t,e=(t,e)=>{var n;Object.entries(null!=(n=e.o.t)?n:{}).map((([n,[o]])=>{if(31&o||32&o){const o=t[n],l=function(t,e){for(;t;){const n=Object.getOwnPropertyDescriptor(t,e);if(null==n?void 0:n.get)return n;t=Object.getPrototypeOf(t)}}(Object.getPrototypeOf(t),n)||Object.getOwnPropertyDescriptor(t,n);l&&Object.defineProperty(t,n,{get(){return l.get.call(this)},set(t){l.set.call(this,t)},configurable:!0,enumerable:!0}),t[n]=e.l.has(n)?e.l.get(n):o}}))},n=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,n)=>{n&&(t.__stencil__getHostRef=()=>n,n.i=t,512&n.o.u&&e(t,n))},l=(t,e)=>(0,console.error)(t,e),i=new Map,s=new Map,r="undefined"!=typeof window?window:{},c={u:0,h:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},u=t=>Promise.resolve(t),a=(()=>{try{return!!r.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),f=!!a&&(()=>!!r.document&&Object.getOwnPropertyDescriptor(r.document.adoptedStyleSheets,"length").writable)(),d=!1,h=[],p=[],m=(t,e)=>n=>{t.push(n),d||(d=!0,e&&4&c.u?y(b):c.raf(b))},v=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){l(t)}t.length=0},b=()=>{v(h),v(p),(d=h.length>0)&&c.raf(b)},y=t=>u().then(t),w=m(p,!0);function $(){const e=this.attachShadow({mode:"open"});void 0===t&&(t=null),t&&(f?e.adoptedStyleSheets.push(t):e.adoptedStyleSheets=[...e.adoptedStyleSheets,t])}function g(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}var j,O=new WeakMap,S=t=>"sc-"+t.p,k=t=>"object"==(t=typeof t)||"function"===t,M=(t,e,...n)=>{let o=null,l=null,i=!1,s=!1;const r=[],c=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof t&&!k(o))&&(o+=""),i&&s?r[r.length-1].m+=o:r.push(i?C(null,o):o),s=i)};if(c(n),e){e.key&&(l=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const u=C(t,null);return u.v=e,r.length>0&&(u.$=r),u.j=l,u},C=(t,e)=>({u:0,O:t,m:null!=e?e:null,S:null,$:null,v:null,j:null}),E={},x=(t,e)=>null==t||k(t)?t:2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:t,N=(t,e,n,o,l,i)=>{if(n===o)return;let s=((t,e)=>e in t)(t,e);if(e.toLowerCase(),"class"===e){const e=t.classList,l=P(n);let i=P(o);e.remove(...l.filter((t=>t&&!i.includes(t)))),e.add(...i.filter((t=>t&&!l.includes(t))))}else if("key"===e);else{if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);return void(null==o||!1===o?!1===o&&""!==t.getAttribute(n)||t.removeAttribute(n):t.setAttribute(n,!0===o?"":o))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=o}catch(t){}return}{const r=k(o);if((s||r&&null!==o)&&!l)try{if(t.tagName.includes("-"))t[e]!==o&&(t[e]=o);else{const l=null==o?"":o;"list"===e?s=!1:null!=n&&t[e]===l||("function"==typeof t.__lookupSetter__(e)?t[e]=l:t.setAttribute(e,l))}}catch(t){}null==o||!1===o?!1===o&&""!==t.getAttribute(e)||t.removeAttribute(e):(!s||4&i||l)&&!r&&1===t.nodeType&&t.setAttribute(e,o=!0===o?"":o)}}},D=/\s/,P=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(D):[]),R=(t,e,n)=>{const o=11===e.S.nodeType&&e.S.host?e.S.host:e.S,l=t&&t.v||{},i=e.v||{};for(const t of L(Object.keys(l)))t in i||N(o,t,l[t],void 0,n,e.u);for(const t of L(Object.keys(i)))N(o,t,l[t],i[t],n,e.u)};function L(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var U=!1,A=(t,e,n)=>{const o=e.$[n];let l,i,s=0;if(U||(U="svg"===o.O),!r.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.S=r.document.createElementNS(U?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.O),U&&"foreignObject"===o.O&&(U=!1),R(null,o,U),o.$){const e="template"===o.O?l.content:l;for(s=0;s<o.$.length;++s)i=A(t,o,s),i&&e.appendChild(i)}return"svg"===o.O?U=!1:"foreignObject"===l.tagName&&(U=!0),l["s-hn"]=j,l},T=(t,e,n,o,l,i)=>{let s,r=t;for(r.shadowRoot&&r.tagName===j&&(r=r.shadowRoot),"template"===n.O&&(r=r.content);l<=i;++l)o[l]&&(s=A(null,n,l),s&&(o[l].S=s,V(r,s,e)))},W=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.S;t&&t.remove()}}},F=(t,e,n=!1)=>t.O===e.O&&(n?(n&&!t.j&&e.j&&(t.j=e.j),!0):t.j===e.j),H=(t,e,n=!1)=>{const o=e.S=t.S,l=t.$,i=e.$,s=e.O;R(t,e,U="svg"===s||"foreignObject"!==s&&U),null!==l&&null!==i?((t,e,n,o,l=!1)=>{let i,s,r=0,c=0,u=0,a=0,f=e.length-1,d=e[0],h=e[f],p=o.length-1,m=o[0],v=o[p];const b="template"===n.O?t.content:t;for(;r<=f&&c<=p;)if(null==d)d=e[++r];else if(null==h)h=e[--f];else if(null==m)m=o[++c];else if(null==v)v=o[--p];else if(F(d,m,l))H(d,m,l),d=e[++r],m=o[++c];else if(F(h,v,l))H(h,v,l),h=e[--f],v=o[--p];else if(F(d,v,l))H(d,v,l),V(b,d.S,h.S.nextSibling),d=e[++r],v=o[--p];else if(F(h,m,l))H(h,m,l),V(b,h.S,d.S),h=e[--f],m=o[++c];else{for(u=-1,a=r;a<=f;++a)if(e[a]&&null!==e[a].j&&e[a].j===m.j){u=a;break}u>=0?(s=e[u],s.O!==m.O?i=A(e&&e[c],n,u):(H(s,m,l),e[u]=void 0,i=s.S),m=o[++c]):(i=A(e&&e[c],n,c),m=o[++c]),i&&V(d.S.parentNode,i,d.S)}r>f?T(t,null==o[p+1]?null:o[p+1].S,n,o,c,p):c>p&&W(e,r,f)})(o,l,e,i,n):null!==i?T(o,null,e,i,0,i.length-1):!n&&null!==l&&W(l,0,l.length-1),U&&"svg"===s&&(U=!1)},V=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),q=(t,e)=>{if(e&&!t.k&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.k=()=>{e["s-p"].splice(n-1,1),o()})))}},z=(t,e)=>{if(t.u|=16,4&t.u)return void(t.u|=512);q(t,t.M);const n=()=>G(t,e);if(!e)return w(n);queueMicrotask((()=>{n()}))},G=(t,e)=>{const n=t.$hostElement$,o=t.i;if(!o)throw Error(`Can't render component <${n.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 l;return e?(t.C.length&&t.C.forEach((t=>t(n))),l=Q(o,"componentWillLoad",void 0,n)):l=Q(o,"componentWillUpdate",void 0,n),l=Y(l,(()=>Q(o,"componentWillRender",void 0,n))),Y(l,(()=>B(t,o,e)))},Y=(t,e)=>_(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),_=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,B=async(t,e,n)=>{var o;const l=t.$hostElement$,i=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.u,l=((t,e)=>{var n,o,l;const i=S(e),u=s.get(i);if(!r.document)return i;if(t=11===t.nodeType?t:r.document,u)if("string"==typeof u){let l,s=O.get(t=t.head||t);if(s||O.set(t,s=new Set),!s.has(i)){l=r.document.createElement("style"),l.textContent=u;const d=null!=(n=c.N)?n:g(r.document);if(null!=d&&l.setAttribute("nonce",d),!(1&e.u))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(a){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(u),f?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=u+e.textContent:t.prepend(l)}else t.append(l);1&e.u&&t.insertBefore(l,null),4&e.u&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),s&&s.add(i)}}else{let e=O.get(t);if(e||O.set(t,e=new Set),!e.has(i)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(u.constructor===n.CSSStyleSheet)o=u;else{o=new n.CSSStyleSheet;for(let t=0;t<u.cssRules.length;t++)o.insertRule(u.cssRules[t].cssText,t)}f?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(i)}}return i})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);I(t,e,l,n),i&&(i.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>J(t);0===e.length?n():(Promise.all(e).then(n),t.u|=4,e.length=0)}},I=(t,e,n,o)=>{try{e=e.render(),t.u&=-17,t.u|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.D||C(null,null),i=(t=>t&&t.O===E)(e)?e:M(null,null,e);if(j=o.tagName,n&&i.v)for(const t of Object.keys(i.v))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.v[t]=o[t]);i.O=null,i.u|=4,t.D=i,i.S=l.S=o.shadowRoot||o,H(l,i,n)})(t,e,o)}catch(e){l(e,t.$hostElement$)}return null},J=t=>{const e=t.$hostElement$,n=t.i,o=t.M;Q(n,"componentDidRender",void 0,e),64&t.u?Q(n,"componentDidUpdate",void 0,e):(t.u|=64,X(e),Q(n,"componentDidLoad",void 0,e),t.P(e),o||K()),t.k&&(t.k(),t.k=void 0),512&t.u&&y((()=>z(t,!1))),t.u&=-517},K=()=>{y((()=>(t=>{const e=c.ce("appload",{detail:{namespace:"analog-clock"}});return t.dispatchEvent(e),e})(r)))},Q=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){l(t,o)}},X=t=>t.classList.add("hydrated"),Z=(t,e,o,l)=>{const i=n(t);if(!i)return;if(!i)throw Error(`Couldn't find host element for "${l.p}" 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/stenciljs/core/issues/5457).`);const s=i.l.get(e),r=i.u,c=i.i;if(o=x(o,l.t[e][0]),!(8&r&&void 0!==s||o===s||Number.isNaN(s)&&Number.isNaN(o)||(i.l.set(e,o),2!=(18&r)))){if(c.componentShouldUpdate&&!1===c.componentShouldUpdate(o,s,e))return;z(i,!1)}},tt=(t,e,o)=>{var l,i;const s=t.prototype;if(e.t){const r=Object.entries(null!=(l=e.t)?l:{});if(r.map((([t,[l]])=>{if(31&l||2&o&&32&l){const{get:i,set:r}=Object.getOwnPropertyDescriptor(s,t)||{};i&&(e.t[t][0]|=2048),r&&(e.t[t][0]|=4096),(1&o||!i)&&Object.defineProperty(s,t,{get(){{if(!(2048&e.t[t][0]))return((t,e)=>n(this).l.get(e))(0,t);const o=n(this),l=o?o.i:s;if(!l)return;return l[t]}},configurable:!0,enumerable:!0}),Object.defineProperty(s,t,{set(i){const s=n(this);if(s){if(r)return void 0===(32&l?this[t]:s.$hostElement$[t])&&s.l.get(t)&&(i=s.l.get(t)),r.call(this,x(i,l)),void Z(this,t,i=32&l?this[t]:s.$hostElement$[t],e);{if(!(1&o&&4096&e.t[t][0]))return Z(this,t,i,e),void(1&o&&!s.i&&s.C.push((()=>{4096&e.t[t][0]&&s.i[t]!==s.l.get(t)&&(s.i[t]=i)})));const n=()=>{const n=s.i[t];!s.l.get(t)&&n&&s.l.set(t,n),s.i[t]=x(i,l),Z(this,t,s.i[t],e)};s.i?n():s.C.push((()=>{n()}))}}}})}})),1&o){const o=new Map;s.attributeChangedCallback=function(t,l,i){c.jmp((()=>{var c;const u=o.get(t),a=n(this);if(this.hasOwnProperty(u)&&(i=this[u],delete this[u]),s.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==i)return;if(null==u){const n=null==a?void 0:a.u;if(a&&n&&!(8&n)&&i!==l){const o=a.i,s=null==(c=e.R)?void 0:c[t];null==s||s.forEach((e=>{const[[s,r]]=Object.entries(e);null!=o[s]&&(128&n||1&r)&&o[s].call(o,i,l,t)}))}return}const f=r.find((([t])=>t===u));f&&4&f[1][0]&&(i=null!==i&&"false"!==i);const d=Object.getOwnPropertyDescriptor(s,u);i==this[u]||d.get&&!d.set||(this[u]=i)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=e.R)?i:{}),...r.filter((([t,e])=>31&e[0])).map((([t,e])=>{const n=e[1]||t;return o.set(n,t),n}))]))}}return t},et=(t,e)=>{Q(t,"connectedCallback",void 0,e)},nt=(t,e)=>{Q(t,"disconnectedCallback",void 0,e||t)},ot=(t,e={})=>{var o;if(!r.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const u=[],f=e.exclude||[],d=r.customElements,h=r.document.head,p=h.querySelector("meta[charset]"),m=r.document.createElement("style"),v=[];let b,y=!0;if(Object.assign(c,e),c.h=new URL(e.resourcesUrl||"./",r.document.baseURI).href,t.map((t=>{t[1].map((e=>{const o={u:e[0],p:e[1],t:e[2],L:e[3]};o.t=e[2];const r=o.p,h=class extends HTMLElement{"s-p";"s-rc";hasRegisteredEventListeners=!1;constructor(t){if(super(t),((t,e)=>{const n={u:0,$hostElement$:t,o:e,l:new Map,U:new Map};n.A=new Promise((t=>n.P=t)),t["s-p"]=[],t["s-rc"]=[],n.C=[];const o=n;t.__stencil__getHostRef=()=>o})(t=this,o),1&o.u)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${o.p}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else $.call(t,o)}connectedCallback(){n(this)&&(this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),b&&(clearTimeout(b),b=null),y?v.push(this):c.jmp((()=>(t=>{if(!(1&c.u)){const e=n(t);if(!e)return;const o=e.o,r=()=>{};if(1&e.u)(null==e?void 0:e.i)?et(e.i,t):(null==e?void 0:e.A)&&e.A.then((()=>et(e.i,t)));else{e.u|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){q(e,e.M=n);break}}o.t&&Object.entries(o.t).map((([e,[n]])=>{if(31&n&&e in t&&t[e]!==Object.prototype[e]){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;if(!(32&e.u)){if(e.u|=32,n.T){const s=((t,e)=>{const n=t.p.replace(/-/g,"_"),o=t.T;if(!o)return;const s=i.get(o);return s?s[n]:import(`./${o}.entry.js`).then((t=>(i.set(o,t),t[n])),(t=>{l(t,e.$hostElement$)}))
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,e);if(s&&"then"in s){const t=()=>{};o=await s,t()}else o=s;if(!o)throw Error(`Constructor for "${n.p}#${e.W}" was not found`);o.isProxied||(tt(o,n,2),o.isProxied=!0);const r=()=>{};e.u|=8;try{new o(e)}catch(e){l(e,t)}e.u&=-9,r(),et(e.i,t)}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.u|=128));if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=S(n);if(!s.has(e)){const o=()=>{};((t,e,n)=>{let o=s.get(t);a&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,s.set(t,o)})(e,t,!!(1&n.u)),o()}}}const r=e.M,c=()=>z(e,!0);r&&r["s-rc"]?r["s-rc"].push(c):c()})(t,e,o)}r()}})(this))))}disconnectedCallback(){c.jmp((()=>(async t=>{if(!(1&c.u)){const e=n(t);(null==e?void 0:e.i)?nt(e.i,t):(null==e?void 0:e.A)&&e.A.then((()=>nt(e.i,t)))}O.has(t)&&O.delete(t),t.shadowRoot&&O.has(t.shadowRoot)&&O.delete(t.shadowRoot)})(this))),c.raf((()=>{var t;const e=n(this);if(!e)return;const o=v.findIndex((t=>t===this));o>-1&&v.splice(o,1),(null==(t=null==e?void 0:e.D)?void 0:t.S)instanceof Node&&!e.D.S.isConnected&&delete e.D.S}))}componentOnReady(){var t;return null==(t=n(this))?void 0:t.A}};o.T=t[0],f.includes(r)||d.get(r)||(u.push(r),d.define(r,tt(h,o,1)))}))})),u.length>0&&(m.textContent+=u.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",m.innerHTML.length)){m.setAttribute("data-styles","");const t=null!=(o=c.N)?o:g(r.document);null!=t&&m.setAttribute("nonce",t),h.insertBefore(m,p?p.nextSibling:h.firstChild)}y=!1,v.length?v.map((t=>t.connectedCallback())):c.jmp((()=>b=setTimeout(K,30)))},lt=t=>c.N=t;export{ot as b,M as h,u as p,o as r,lt as s}
import{r as e,h as t}from"./p-CEu1VQJ3.js";const c=class{constructor(t){e(this,t),this.size=void 0,this.timeZone=0,this.time=Date.now()}componentDidLoad(){this.timer=window.setInterval((()=>{this.time=Date.now()}),250)}disconnectedCallback(){clearInterval(this.timer)}get hour(){return new Date(this.time).getHours()}get minute(){return new Date(this.time).getMinutes()}get second(){return new Date(this.time).getSeconds()}hourToDegrees(){const e=this.hour+this.timeZone;return Math.floor(this.minute/2)+30*e}minuteToDegrees(){return Math.floor(this.second/10)+6*this.minute}secondToDegrees(){return 6*this.second}render(){return t("svg",{key:"39e3465d3bf04035966b00bb15186d1f712163cd",class:"clock",viewBox:"0 0 200 200",width:this.size,height:this.size},t("circle",{key:"e4c4288aa0efc9cf98027eef1f5bd7c550c23a18",id:"circle",cx:"100",cy:"100",r:"95","stroke-width":"10",fill:"transparent"}),t("line",{key:"296fb8ac19749103439f2ce1878db5ccfb214c20",id:"hour",transform:`rotate(${this.hourToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"60","stroke-width":"10","stroke-linecap":"round"}),t("line",{key:"acbe2c6ebdf05ff46e06144839dec43c45e8b40d",id:"minute",transform:`rotate(${this.minuteToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"30","stroke-width":"8","stroke-linecap":"round"}),t("line",{key:"f275abf7169379b2f61c9cdd185068f5e2373d4a",id:"second",transform:`rotate(${this.secondToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"20","stroke-width":"2","stroke-linecap":"round"}))}};c.style=".clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}";export{c as analog_clock}
'use strict';
const NAMESPACE = 'analog-clock';
const BUILD = /* analog-clock */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: false, state: true, updatable: true};
/*
Stencil Client Platform v4.42.0 | MIT Licensed | https://stenciljs.com
*/
// src/utils/constants.ts
var SVG_NS = "http://www.w3.org/2000/svg";
var HTML_NS = "http://www.w3.org/1999/xhtml";
var reWireGetterSetter = (instance, hostRef) => {
var _a;
const cmpMeta = hostRef.$cmpMeta$;
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
members.map(([memberName, [memberFlags]]) => {
if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
const ogValue = instance[memberName];
const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName) || Object.getOwnPropertyDescriptor(instance, memberName);
if (ogDescriptor) {
Object.defineProperty(instance, memberName, {
get() {
return ogDescriptor.get.call(this);
},
set(newValue) {
ogDescriptor.set.call(this, newValue);
},
configurable: true,
enumerable: true
});
}
instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;
}
});
};
function getPropertyDescriptor(obj, memberName) {
while (obj) {
const desc = Object.getOwnPropertyDescriptor(obj, memberName);
if (desc == null ? void 0 : desc.get) return desc;
obj = Object.getPrototypeOf(obj);
}
return void 0;
}
// src/client/client-host-ref.ts
var getHostRef = (ref) => {
if (ref.__stencil__getHostRef) {
return ref.__stencil__getHostRef();
}
return void 0;
};
var registerInstance = (lazyInstance, hostRef) => {
if (!hostRef) return;
lazyInstance.__stencil__getHostRef = () => hostRef;
hostRef.$lazyInstance$ = lazyInstance;
if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.state)) {
reWireGetterSetter(lazyInstance, hostRef);
}
};
var registerHost = (hostElement, cmpMeta) => {
const hostRef = {
$flags$: 0,
$hostElement$: hostElement,
$cmpMeta$: cmpMeta,
$instanceValues$: /* @__PURE__ */ new Map(),
$serializerValues$: /* @__PURE__ */ new Map()
};
{
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
hostElement["s-p"] = [];
hostElement["s-rc"] = [];
}
{
hostRef.$fetchedCbList$ = [];
}
const ref = hostRef;
hostElement.__stencil__getHostRef = () => ref;
return ref;
};
var isMemberInElement = (elm, memberName) => memberName in elm;
var consoleError = (e, el) => (0, console.error)(e, el);
// src/client/client-load-module.ts
var cmpModules = /* @__PURE__ */ new Map();
var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
const bundleId = cmpMeta.$lazyBundleId$;
if (!bundleId) {
return void 0;
}
const module = cmpModules.get(bundleId) ;
if (module) {
return module[exportName];
}
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
return import(
/* @vite-ignore */
/* webpackInclude: /\.entry\.js$/ */
/* webpackExclude: /\.system\.entry\.js$/ */
/* webpackMode: "lazy" */
`./${bundleId}.entry.js${""}`
).then(
(importedModule) => {
{
cmpModules.set(bundleId, importedModule);
}
return importedModule[exportName];
},
(e) => {
consoleError(e, hostRef.$hostElement$);
}
);
};
// src/client/client-style.ts
var styles = /* @__PURE__ */ new Map();
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
var win = typeof window !== "undefined" ? window : {};
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 CustomEvent(eventName, opts)
};
var promiseResolve = (v) => Promise.resolve(v);
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
try {
if (!win.document.adoptedStyleSheets) {
return false;
}
new CSSStyleSheet();
return typeof new CSSStyleSheet().replaceSync === "function";
} catch (e) {
}
return false;
})() ;
var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @__PURE__ */ (() => !!win.document && Object.getOwnPropertyDescriptor(win.document.adoptedStyleSheets, "length").writable)() : false;
var queuePending = false;
var queueDomReads = [];
var queueDomWrites = [];
var queueTask = (queue, write) => (cb) => {
queue.push(cb);
if (!queuePending) {
queuePending = true;
if (write && plt.$flags$ & 4 /* queueSync */) {
nextTick(flush);
} else {
plt.raf(flush);
}
}
};
var consume = (queue) => {
for (let i2 = 0; i2 < queue.length; i2++) {
try {
queue[i2](performance.now());
} catch (e) {
consoleError(e);
}
}
queue.length = 0;
};
var flush = () => {
consume(queueDomReads);
{
consume(queueDomWrites);
if (queuePending = queueDomReads.length > 0) {
plt.raf(flush);
}
}
};
var nextTick = (cb) => promiseResolve().then(cb);
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
// src/utils/style.ts
function createStyleSheetIfNeededAndSupported(styles2) {
return void 0;
}
// src/utils/shadow-root.ts
var globalStyleSheet;
function createShadowRoot(cmpMeta) {
var _a;
const opts = { mode: "open" };
const shadowRoot = this.attachShadow(opts);
if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
if (globalStyleSheet) {
if (supportsMutableAdoptedStyleSheets) {
shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
} else {
shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
}
}
}
var createTime = (fnName, tagName = "") => {
{
return () => {
return;
};
}
};
var uniqueTime = (key, measureText) => {
{
return () => {
return;
};
}
};
// src/utils/query-nonce-meta-tag-content.ts
function queryNonceMetaTagContent(doc) {
var _a, _b, _c;
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
}
// src/runtime/styles.ts
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, _b, _c;
const scopeId2 = getScopeId(cmpMeta);
const style = styles.get(scopeId2);
if (!win.document) {
return scopeId2;
}
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
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)) {
styleElm = win.document.createElement("style");
styleElm.textContent = style;
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
if (nonce != null) {
styleElm.setAttribute("nonce", nonce);
}
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
if (styleContainerNode.nodeName === "HEAD") {
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
styleContainerNode.insertBefore(
styleElm,
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
);
} else if ("host" in styleContainerNode) {
if (supportsConstructableStylesheets) {
const currentWindow = (_b = styleContainerNode.defaultView) != null ? _b : styleContainerNode.ownerDocument.defaultView;
const stylesheet = new currentWindow.CSSStyleSheet();
stylesheet.replaceSync(style);
if (supportsMutableAdoptedStyleSheets) {
styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
} else {
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
}
} else {
const existingStyleContainer = styleContainerNode.querySelector("style");
if (existingStyleContainer) {
existingStyleContainer.textContent = style + existingStyleContainer.textContent;
} else {
styleContainerNode.prepend(styleElm);
}
}
} else {
styleContainerNode.append(styleElm);
}
}
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
styleContainerNode.insertBefore(styleElm, null);
}
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
styleElm.textContent += SLOT_FB_CSS;
}
if (appliedStyles) {
appliedStyles.add(scopeId2);
}
}
} else {
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
if (!appliedStyles) {
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
}
if (!appliedStyles.has(scopeId2)) {
const currentWindow = (_c = styleContainerNode.defaultView) != null ? _c : styleContainerNode.ownerDocument.defaultView;
let stylesheet;
if (style.constructor === currentWindow.CSSStyleSheet) {
stylesheet = style;
} else {
stylesheet = new currentWindow.CSSStyleSheet();
for (let i2 = 0; i2 < style.cssRules.length; i2++) {
stylesheet.insertRule(style.cssRules[i2].cssText, i2);
}
}
if (supportsMutableAdoptedStyleSheets) {
styleContainerNode.adoptedStyleSheets.push(stylesheet);
} else {
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
}
appliedStyles.add(scopeId2);
}
}
}
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(
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
cmpMeta);
if (flags & 10 /* needsScopedEncapsulation */) {
elm["s-sc"] = scopeId2;
elm.classList.add(scopeId2 + "-h");
}
endAttachStyles();
};
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
var isComplexType = (o) => {
o = typeof o;
return o === "object" || o === "function";
};
// src/runtime/vdom/h.ts
var h = (nodeName, vnodeData, ...children) => {
if (typeof nodeName === "string") {
nodeName = transformTag(nodeName);
}
let child = null;
let key = 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);
}
if (simple && lastSimple) {
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
} else {
vNodeChildren.push(simple ? newVNode(null, child) : child);
}
lastSimple = simple;
}
}
};
walk(children);
if (vnodeData) {
if (vnodeData.key) {
key = vnodeData.key;
}
{
const classData = vnodeData.className || vnodeData.class;
if (classData) {
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
}
}
}
const vnode = newVNode(nodeName, null);
vnode.$attrs$ = vnodeData;
if (vNodeChildren.length > 0) {
vnode.$children$ = vNodeChildren;
}
{
vnode.$key$ = key;
}
return vnode;
};
var newVNode = (tag, text) => {
const vnode = {
$flags$: 0,
$tag$: tag,
// Normalize undefined to null to prevent rendering "undefined" as text
$text$: text != null ? text : null,
$elm$: null,
$children$: null
};
{
vnode.$attrs$ = null;
}
{
vnode.$key$ = null;
}
return vnode;
};
var Host = {};
var isHost = (node) => node && node.$tag$ === Host;
// src/runtime/parse-property-value.ts
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
if (propValue != null && !isComplexType(propValue)) {
if (propType & 2 /* Number */) {
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
}
return propValue;
}
return propValue;
};
var emitEvent = (elm, name, opts) => {
const ev = plt.ce(name, opts);
elm.dispatchEvent(ev);
return ev;
};
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
if (oldValue === newValue) {
return;
}
let isProp = isMemberInElement(elm, memberName);
memberName.toLowerCase();
if (memberName === "class") {
const classList = elm.classList;
const oldClasses = parseClassList(oldValue);
let newClasses = parseClassList(newValue);
{
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
}
} else if (memberName === "key") ; else if (memberName[0] === "a" && memberName.startsWith("attr:")) {
const attrName = memberName.slice(5);
if (newValue == null || newValue === false) {
if (newValue !== false || elm.getAttribute(attrName) === "") {
elm.removeAttribute(attrName);
}
} else {
elm.setAttribute(attrName, newValue === true ? "" : newValue);
}
return;
} else if (memberName[0] === "p" && memberName.startsWith("prop:")) {
const propName = memberName.slice(5);
try {
elm[propName] = newValue;
} catch (e) {
}
return;
} else {
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) {
if (typeof elm.__lookupSetter__(memberName) === "function") {
elm[memberName] = n;
} else {
elm.setAttribute(memberName, n);
}
}
} else if (elm[memberName] !== newValue) {
elm[memberName] = newValue;
}
} catch (e) {
}
}
if (newValue == null || newValue === false) {
if (newValue !== false || elm.getAttribute(memberName) === "") {
{
elm.removeAttribute(memberName);
}
}
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
newValue = newValue === true ? "" : newValue;
{
elm.setAttribute(memberName, newValue);
}
}
}
};
var parseClassListRegex = /\s/;
var parseClassList = (value) => {
if (typeof value === "object" && value && "baseVal" in value) {
value = value.baseVal;
}
if (!value || typeof value !== "string") {
return [];
}
return value.split(parseClassListRegex);
};
// src/runtime/vdom/update-element.ts
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
const newVnodeAttrs = newVnode.$attrs$ || {};
{
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
);
}
var hostTagName;
var isSvgMode = false;
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
const newVNode2 = newParentVNode.$children$[childIndex];
let i2 = 0;
let elm;
let childNode;
{
if (!isSvgMode) {
isSvgMode = newVNode2.$tag$ === "svg";
}
if (!win.document) {
throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");
}
elm = newVNode2.$elm$ = win.document.createElementNS(
isSvgMode ? SVG_NS : HTML_NS,
newVNode2.$tag$
) ;
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
isSvgMode = false;
}
{
updateElement(null, newVNode2, isSvgMode);
}
if (newVNode2.$children$) {
const appendTarget = newVNode2.$tag$ === "template" ? elm.content : elm;
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
childNode = createElm(oldParentVNode, newVNode2, i2);
if (childNode) {
appendTarget.appendChild(childNode);
}
}
}
{
if (newVNode2.$tag$ === "svg") {
isSvgMode = false;
} else if (elm.tagName === "foreignObject") {
isSvgMode = true;
}
}
}
elm["s-hn"] = hostTagName;
return elm;
};
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
let containerElm = parentElm;
let childNode;
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
containerElm = containerElm.shadowRoot;
}
if (parentVNode.$tag$ === "template") {
containerElm = containerElm.content;
}
for (; startIdx <= endIdx; ++startIdx) {
if (vnodes[startIdx]) {
childNode = createElm(null, parentVNode, startIdx);
if (childNode) {
vnodes[startIdx].$elm$ = childNode;
insertBefore(containerElm, childNode, before);
}
}
}
};
var removeVnodes = (vnodes, startIdx, endIdx) => {
for (let index = startIdx; index <= endIdx; ++index) {
const vnode = vnodes[index];
if (vnode) {
const elm = vnode.$elm$;
if (elm) {
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;
const containerElm = newVNode2.$tag$ === "template" ? parentElm.content : parentElm;
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)) {
patch(oldStartVnode, newEndVnode, isInitialRender);
insertBefore(containerElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
oldStartVnode = oldCh[++oldStartIdx];
newEndVnode = newCh[--newEndIdx];
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
patch(oldEndVnode, newStartVnode, isInitialRender);
insertBefore(containerElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
oldEndVnode = oldCh[--oldEndIdx];
newStartVnode = newCh[++newStartIdx];
} else {
idxInOld = -1;
{
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
idxInOld = i2;
break;
}
}
}
if (idxInOld >= 0) {
elmToMove = oldCh[idxInOld];
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
} else {
patch(elmToMove, newStartVnode, isInitialRender);
oldCh[idxInOld] = void 0;
node = elmToMove.$elm$;
}
newStartVnode = newCh[++newStartIdx];
} else {
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
newStartVnode = newCh[++newStartIdx];
}
if (node) {
{
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 (newStartIdx > newEndIdx) {
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
}
};
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
if (leftVNode.$tag$ === rightVNode.$tag$) {
if (!isInitialRender) {
return leftVNode.$key$ === rightVNode.$key$;
}
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
leftVNode.$key$ = rightVNode.$key$;
}
return true;
}
return false;
};
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
const elm = newVNode2.$elm$ = oldVNode.$elm$;
const oldChildren = oldVNode.$children$;
const newChildren = newVNode2.$children$;
const tag = newVNode2.$tag$;
{
{
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
}
{
updateElement(oldVNode, newVNode2, isSvgMode);
}
if (oldChildren !== null && newChildren !== null) {
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
} else if (newChildren !== null) {
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 && BUILD.updatable && oldChildren !== null
) {
removeVnodes(oldChildren, 0, oldChildren.length - 1);
} else ;
if (isSvgMode && tag === "svg") {
isSvgMode = false;
}
}
};
var insertBefore = (parent, newNode, reference, isInitialLoad) => {
if (parent.__insertBefore) {
return parent.__insertBefore(newNode, reference);
} else {
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
}
};
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
const hostElm = hostRef.$hostElement$;
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
const isHostElement = isHost(renderFnResults);
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
hostTagName = hostElm.tagName;
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$ = hostElm.shadowRoot || hostElm ;
patch(oldVNode, rootVnode, isInitialLoad);
};
// src/runtime/update-component.ts
var attachToAncestor = (hostRef, ancestorComponent) => {
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
const index = ancestorComponent["s-p"].push(
new Promise(
(r) => hostRef.$onRenderResolve$ = () => {
ancestorComponent["s-p"].splice(index - 1, 1);
r();
}
)
);
}
};
var scheduleUpdate = (hostRef, isInitialLoad) => {
{
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
}
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
hostRef.$flags$ |= 512 /* needsRerender */;
return;
}
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
if (isInitialLoad) {
queueMicrotask(() => {
dispatch();
});
return;
}
return writeTask(dispatch) ;
};
var dispatchHooks = (hostRef, isInitialLoad) => {
const elm = hostRef.$hostElement$;
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
const instance = hostRef.$lazyInstance$ ;
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 (hostRef.$fetchedCbList$.length) {
hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
}
}
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
} else {
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
}
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
endSchedule();
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
};
var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err) => {
console.error(err);
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 (isInitialLoad) {
attachStyles(hostRef);
}
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
{
callRender(hostRef, instance, elm, isInitialLoad);
}
if (rc) {
rc.map((cb) => cb());
elm["s-rc"] = void 0;
}
endRender();
endUpdate();
{
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;
}
}
};
var callRender = (hostRef, instance, elm, isInitialLoad) => {
try {
instance = instance.render() ;
{
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
}
{
hostRef.$flags$ |= 2 /* hasRendered */;
}
{
{
{
renderVdom(hostRef, instance, isInitialLoad);
}
}
}
} catch (e) {
consoleError(e, hostRef.$hostElement$);
}
return null;
};
var postUpdateComponent = (hostRef) => {
const tagName = hostRef.$cmpMeta$.$tagName$;
const elm = hostRef.$hostElement$;
const endPostUpdate = createTime("postUpdate", tagName);
const instance = hostRef.$lazyInstance$ ;
const ancestorComponent = hostRef.$ancestorComponent$;
safeCall(instance, "componentDidRender", void 0, elm);
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
{
addHydratedFlag(elm);
}
safeCall(instance, "componentDidLoad", void 0, elm);
endPostUpdate();
{
hostRef.$onReadyResolve$(elm);
if (!ancestorComponent) {
appDidLoad();
}
}
} else {
safeCall(instance, "componentDidUpdate", void 0, elm);
endPostUpdate();
}
{
if (hostRef.$onRenderResolve$) {
hostRef.$onRenderResolve$();
hostRef.$onRenderResolve$ = void 0;
}
if (hostRef.$flags$ & 512 /* needsRerender */) {
nextTick(() => scheduleUpdate(hostRef, false));
}
hostRef.$flags$ &= -517;
}
};
var appDidLoad = (who) => {
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
};
var safeCall = (instance, method, arg, elm) => {
if (instance && instance[method]) {
try {
return instance[method](arg);
} catch (e) {
consoleError(e, elm);
}
}
return void 0;
};
var addHydratedFlag = (elm) => {
var _a;
return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
};
// 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 (!hostRef) {
return;
}
if (!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/stenciljs/core/issues/5457).`
);
}
const oldVal = hostRef.$instanceValues$.get(propName);
const flags = hostRef.$flags$;
const instance = hostRef.$lazyInstance$ ;
newVal = parsePropertyValue(
newVal,
cmpMeta.$members$[propName][0]);
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
const didValueChange = newVal !== oldVal && !areBothNaN;
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
hostRef.$instanceValues$.set(propName, newVal);
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
if (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 (cmpMeta.$members$ || BUILD.propChangeCallback) {
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
members.map(([memberName, [memberFlags]]) => {
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
if (flags & 1 /* isElementConstructor */ || !origGetter) {
Object.defineProperty(prototype, memberName, {
get() {
{
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
return getValue(this, memberName);
}
const ref = getHostRef(this);
const instance = ref ? ref.$lazyInstance$ : prototype;
if (!instance) return;
return instance[memberName];
}
},
configurable: true,
enumerable: true
});
}
Object.defineProperty(prototype, memberName, {
set(newValue) {
const ref = getHostRef(this);
if (!ref) {
return;
}
if (origSetter) {
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
newValue = ref.$instanceValues$.get(memberName);
}
origSetter.apply(this, [
parsePropertyValue(
newValue,
memberFlags)
]);
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
setValue(this, memberName, newValue, cmpMeta);
return;
}
{
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
setValue(this, memberName, newValue, cmpMeta);
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
ref.$fetchedCbList$.push(() => {
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
ref.$lazyInstance$[memberName] = newValue;
}
});
}
return;
}
const setterSetVal = () => {
const currentValue = ref.$lazyInstance$[memberName];
if (!ref.$instanceValues$.get(memberName) && currentValue) {
ref.$instanceValues$.set(memberName, currentValue);
}
ref.$lazyInstance$[memberName] = parsePropertyValue(
newValue,
memberFlags);
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
};
if (ref.$lazyInstance$) {
setterSetVal();
} else {
ref.$fetchedCbList$.push(() => {
setterSetVal();
});
}
}
}
});
}
});
if ((flags & 1 /* isElementConstructor */)) {
const attrNameToPropName = /* @__PURE__ */ new Map();
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
plt.jmp(() => {
var _a2;
const propName = attrNameToPropName.get(attrName);
const hostRef = getHostRef(this);
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
newValue = this[propName];
delete this[propName];
}
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 flags2 = hostRef == null ? void 0 : hostRef.$flags$;
if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && newValue !== oldValue) {
const instance = hostRef.$lazyInstance$ ;
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
entry == null ? void 0 : entry.forEach((watcher) => {
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
if (instance[watchMethodName] != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
instance[watchMethodName].call(instance, newValue, oldValue, attrName);
}
});
}
return;
}
const propFlags = members.find(([m]) => m === propName);
if (propFlags && propFlags[1][0] & 4 /* Boolean */) {
newValue = newValue === null || newValue === "false" ? false : true;
}
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
this[propName] = newValue;
}
});
};
Cstr.observedAttributes = Array.from(
/* @__PURE__ */ new Set([
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
const attrName = m[1] || propName;
attrNameToPropName.set(attrName, propName);
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 (bundleId) {
const CstrImport = loadModule(cmpMeta, hostRef);
if (CstrImport && "then" in CstrImport) {
const endLoad = uniqueTime();
Cstr = await CstrImport;
endLoad();
} else {
Cstr = CstrImport;
}
if (!Cstr) {
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
}
if (!Cstr.isProxied) {
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
Cstr.isProxied = true;
}
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
{
hostRef.$flags$ |= 8 /* isConstructingInstance */;
}
try {
new Cstr(hostRef);
} catch (e) {
consoleError(e, elm);
}
{
hostRef.$flags$ &= -9 /* isConstructingInstance */;
}
endNewInstance();
{
fireConnectedCallback(hostRef.$lazyInstance$, elm);
}
} else {
Cstr = elm.constructor;
const cmpTag = elm.localName;
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
}
if (Cstr && Cstr.style) {
let style;
if (typeof Cstr.style === "string") {
style = Cstr.style;
}
const scopeId2 = getScopeId(cmpMeta);
if (!styles.has(scopeId2) || BUILD.hotModuleReplacement) {
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
endRegisterStyles();
}
}
}
const ancestorComponent = hostRef.$ancestorComponent$;
const schedule = () => scheduleUpdate(hostRef, true);
if (ancestorComponent && ancestorComponent["s-rc"]) {
ancestorComponent["s-rc"].push(schedule);
} else {
schedule();
}
};
var fireConnectedCallback = (instance, elm) => {
{
safeCall(instance, "connectedCallback", void 0, elm);
}
};
// src/runtime/connected-callback.ts
var connectedCallback = (elm) => {
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
const hostRef = getHostRef(elm);
if (!hostRef) {
return;
}
const cmpMeta = hostRef.$cmpMeta$;
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
hostRef.$flags$ |= 1 /* hasConnected */;
{
let ancestorComponent = elm;
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
if (ancestorComponent["s-p"]) {
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
break;
}
}
}
if (cmpMeta.$members$) {
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
if (memberFlags & 31 /* Prop */ && memberName in elm && elm[memberName] !== Object.prototype[memberName]) {
const value = elm[memberName];
delete elm[memberName];
elm[memberName] = value;
}
});
}
{
initializeComponent(elm, hostRef, cmpMeta);
}
} else {
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
fireConnectedCallback(hostRef.$lazyInstance$, elm);
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
}
}
endConnected();
}
};
var disconnectInstance = (instance, elm) => {
{
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
}
};
var disconnectedCallback = async (elm) => {
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
const hostRef = getHostRef(elm);
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
disconnectInstance(hostRef.$lazyInstance$, elm);
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
}
}
if (rootAppliedStyles.has(elm)) {
rootAppliedStyles.delete(elm);
}
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
rootAppliedStyles.delete(elm.shadowRoot);
}
};
// src/runtime/bootstrap-lazy.ts
var bootstrapLazy = (lazyBundles, options = {}) => {
var _a;
if (!win.document) {
console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
return;
}
const endBootstrap = createTime();
const cmpTags = [];
const exclude = options.exclude || [];
const customElements2 = win.customElements;
const head = win.document.head;
const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
const dataStyles = /* @__PURE__ */ win.document.createElement("style");
const deferredConnectedCallbacks = [];
let appLoadFallback;
let isBootstrapping = true;
Object.assign(plt, options);
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
lazyBundles.map((lazyBundle) => {
lazyBundle[1].map((compactMeta) => {
const cmpMeta = {
$flags$: compactMeta[0],
$tagName$: compactMeta[1],
$members$: compactMeta[2],
$listeners$: compactMeta[3]
};
{
cmpMeta.$members$ = compactMeta[2];
}
const tagName = transformTag(cmpMeta.$tagName$);
const HostElement = class extends HTMLElement {
["s-p"];
["s-rc"];
hasRegisteredEventListeners = false;
// StencilLazyHost
constructor(self) {
super(self);
self = this;
registerHost(self, cmpMeta);
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
{
if (!self.shadowRoot) {
createShadowRoot.call(self, cmpMeta);
} 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.`
);
}
}
}
}
}
connectedCallback() {
const hostRef = getHostRef(this);
if (!hostRef) {
return;
}
if (!this.hasRegisteredEventListeners) {
this.hasRegisteredEventListeners = true;
}
if (appLoadFallback) {
clearTimeout(appLoadFallback);
appLoadFallback = null;
}
if (isBootstrapping) {
deferredConnectedCallbacks.push(this);
} else {
plt.jmp(() => connectedCallback(this));
}
}
disconnectedCallback() {
plt.jmp(() => disconnectedCallback(this));
plt.raf(() => {
var _a3;
const hostRef = getHostRef(this);
if (!hostRef) {
return;
}
const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
if (i2 > -1) {
deferredConnectedCallbacks.splice(i2, 1);
}
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
delete hostRef.$vnode$.$elm$;
}
});
}
componentOnReady() {
var _a3;
return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
}
};
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) {
{
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
}
if (dataStyles.innerHTML.length) {
dataStyles.setAttribute("data-styles", "");
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
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 {
{
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
}
}
endBootstrap();
};
// src/runtime/nonce.ts
var setNonce = (nonce) => plt.$nonce$ = nonce;
function transformTag(tag) {
return tag;
}
exports.bootstrapLazy = bootstrapLazy;
exports.h = h;
exports.promiseResolve = promiseResolve;
exports.registerInstance = registerInstance;
exports.setNonce = setNonce;
const NAMESPACE = 'analog-clock';
const BUILD = /* analog-clock */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: false, state: true, updatable: true};
/*
Stencil Client Platform v4.42.0 | MIT Licensed | https://stenciljs.com
*/
// src/utils/constants.ts
var SVG_NS = "http://www.w3.org/2000/svg";
var HTML_NS = "http://www.w3.org/1999/xhtml";
var reWireGetterSetter = (instance, hostRef) => {
var _a;
const cmpMeta = hostRef.$cmpMeta$;
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
members.map(([memberName, [memberFlags]]) => {
if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
const ogValue = instance[memberName];
const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName) || Object.getOwnPropertyDescriptor(instance, memberName);
if (ogDescriptor) {
Object.defineProperty(instance, memberName, {
get() {
return ogDescriptor.get.call(this);
},
set(newValue) {
ogDescriptor.set.call(this, newValue);
},
configurable: true,
enumerable: true
});
}
instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;
}
});
};
function getPropertyDescriptor(obj, memberName) {
while (obj) {
const desc = Object.getOwnPropertyDescriptor(obj, memberName);
if (desc == null ? void 0 : desc.get) return desc;
obj = Object.getPrototypeOf(obj);
}
return void 0;
}
// src/client/client-host-ref.ts
var getHostRef = (ref) => {
if (ref.__stencil__getHostRef) {
return ref.__stencil__getHostRef();
}
return void 0;
};
var registerInstance = (lazyInstance, hostRef) => {
if (!hostRef) return;
lazyInstance.__stencil__getHostRef = () => hostRef;
hostRef.$lazyInstance$ = lazyInstance;
if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.state)) {
reWireGetterSetter(lazyInstance, hostRef);
}
};
var registerHost = (hostElement, cmpMeta) => {
const hostRef = {
$flags$: 0,
$hostElement$: hostElement,
$cmpMeta$: cmpMeta,
$instanceValues$: /* @__PURE__ */ new Map(),
$serializerValues$: /* @__PURE__ */ new Map()
};
{
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
hostElement["s-p"] = [];
hostElement["s-rc"] = [];
}
{
hostRef.$fetchedCbList$ = [];
}
const ref = hostRef;
hostElement.__stencil__getHostRef = () => ref;
return ref;
};
var isMemberInElement = (elm, memberName) => memberName in elm;
var consoleError = (e, el) => (0, console.error)(e, el);
// src/client/client-load-module.ts
var cmpModules = /* @__PURE__ */ new Map();
var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
const bundleId = cmpMeta.$lazyBundleId$;
if (!bundleId) {
return void 0;
}
const module = cmpModules.get(bundleId) ;
if (module) {
return module[exportName];
}
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
return import(
/* @vite-ignore */
/* webpackInclude: /\.entry\.js$/ */
/* webpackExclude: /\.system\.entry\.js$/ */
/* webpackMode: "lazy" */
`./${bundleId}.entry.js${""}`
).then(
(importedModule) => {
{
cmpModules.set(bundleId, importedModule);
}
return importedModule[exportName];
},
(e) => {
consoleError(e, hostRef.$hostElement$);
}
);
};
// src/client/client-style.ts
var styles = /* @__PURE__ */ new Map();
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
var win = typeof window !== "undefined" ? window : {};
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 CustomEvent(eventName, opts)
};
var promiseResolve = (v) => Promise.resolve(v);
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
try {
if (!win.document.adoptedStyleSheets) {
return false;
}
new CSSStyleSheet();
return typeof new CSSStyleSheet().replaceSync === "function";
} catch (e) {
}
return false;
})() ;
var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @__PURE__ */ (() => !!win.document && Object.getOwnPropertyDescriptor(win.document.adoptedStyleSheets, "length").writable)() : false;
var queuePending = false;
var queueDomReads = [];
var queueDomWrites = [];
var queueTask = (queue, write) => (cb) => {
queue.push(cb);
if (!queuePending) {
queuePending = true;
if (write && plt.$flags$ & 4 /* queueSync */) {
nextTick(flush);
} else {
plt.raf(flush);
}
}
};
var consume = (queue) => {
for (let i2 = 0; i2 < queue.length; i2++) {
try {
queue[i2](performance.now());
} catch (e) {
consoleError(e);
}
}
queue.length = 0;
};
var flush = () => {
consume(queueDomReads);
{
consume(queueDomWrites);
if (queuePending = queueDomReads.length > 0) {
plt.raf(flush);
}
}
};
var nextTick = (cb) => promiseResolve().then(cb);
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
// src/utils/style.ts
function createStyleSheetIfNeededAndSupported(styles2) {
return void 0;
}
// src/utils/shadow-root.ts
var globalStyleSheet;
function createShadowRoot(cmpMeta) {
var _a;
const opts = { mode: "open" };
const shadowRoot = this.attachShadow(opts);
if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
if (globalStyleSheet) {
if (supportsMutableAdoptedStyleSheets) {
shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
} else {
shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
}
}
}
var createTime = (fnName, tagName = "") => {
{
return () => {
return;
};
}
};
var uniqueTime = (key, measureText) => {
{
return () => {
return;
};
}
};
// src/utils/query-nonce-meta-tag-content.ts
function queryNonceMetaTagContent(doc) {
var _a, _b, _c;
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
}
// src/runtime/styles.ts
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, _b, _c;
const scopeId2 = getScopeId(cmpMeta);
const style = styles.get(scopeId2);
if (!win.document) {
return scopeId2;
}
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
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)) {
styleElm = win.document.createElement("style");
styleElm.textContent = style;
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
if (nonce != null) {
styleElm.setAttribute("nonce", nonce);
}
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
if (styleContainerNode.nodeName === "HEAD") {
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
styleContainerNode.insertBefore(
styleElm,
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
);
} else if ("host" in styleContainerNode) {
if (supportsConstructableStylesheets) {
const currentWindow = (_b = styleContainerNode.defaultView) != null ? _b : styleContainerNode.ownerDocument.defaultView;
const stylesheet = new currentWindow.CSSStyleSheet();
stylesheet.replaceSync(style);
if (supportsMutableAdoptedStyleSheets) {
styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
} else {
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
}
} else {
const existingStyleContainer = styleContainerNode.querySelector("style");
if (existingStyleContainer) {
existingStyleContainer.textContent = style + existingStyleContainer.textContent;
} else {
styleContainerNode.prepend(styleElm);
}
}
} else {
styleContainerNode.append(styleElm);
}
}
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
styleContainerNode.insertBefore(styleElm, null);
}
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
styleElm.textContent += SLOT_FB_CSS;
}
if (appliedStyles) {
appliedStyles.add(scopeId2);
}
}
} else {
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
if (!appliedStyles) {
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
}
if (!appliedStyles.has(scopeId2)) {
const currentWindow = (_c = styleContainerNode.defaultView) != null ? _c : styleContainerNode.ownerDocument.defaultView;
let stylesheet;
if (style.constructor === currentWindow.CSSStyleSheet) {
stylesheet = style;
} else {
stylesheet = new currentWindow.CSSStyleSheet();
for (let i2 = 0; i2 < style.cssRules.length; i2++) {
stylesheet.insertRule(style.cssRules[i2].cssText, i2);
}
}
if (supportsMutableAdoptedStyleSheets) {
styleContainerNode.adoptedStyleSheets.push(stylesheet);
} else {
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
}
appliedStyles.add(scopeId2);
}
}
}
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(
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
cmpMeta);
if (flags & 10 /* needsScopedEncapsulation */) {
elm["s-sc"] = scopeId2;
elm.classList.add(scopeId2 + "-h");
}
endAttachStyles();
};
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
var isComplexType = (o) => {
o = typeof o;
return o === "object" || o === "function";
};
// src/runtime/vdom/h.ts
var h = (nodeName, vnodeData, ...children) => {
if (typeof nodeName === "string") {
nodeName = transformTag(nodeName);
}
let child = null;
let key = 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);
}
if (simple && lastSimple) {
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
} else {
vNodeChildren.push(simple ? newVNode(null, child) : child);
}
lastSimple = simple;
}
}
};
walk(children);
if (vnodeData) {
if (vnodeData.key) {
key = vnodeData.key;
}
{
const classData = vnodeData.className || vnodeData.class;
if (classData) {
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
}
}
}
const vnode = newVNode(nodeName, null);
vnode.$attrs$ = vnodeData;
if (vNodeChildren.length > 0) {
vnode.$children$ = vNodeChildren;
}
{
vnode.$key$ = key;
}
return vnode;
};
var newVNode = (tag, text) => {
const vnode = {
$flags$: 0,
$tag$: tag,
// Normalize undefined to null to prevent rendering "undefined" as text
$text$: text != null ? text : null,
$elm$: null,
$children$: null
};
{
vnode.$attrs$ = null;
}
{
vnode.$key$ = null;
}
return vnode;
};
var Host = {};
var isHost = (node) => node && node.$tag$ === Host;
// src/runtime/parse-property-value.ts
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
if (propValue != null && !isComplexType(propValue)) {
if (propType & 2 /* Number */) {
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
}
return propValue;
}
return propValue;
};
var emitEvent = (elm, name, opts) => {
const ev = plt.ce(name, opts);
elm.dispatchEvent(ev);
return ev;
};
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
if (oldValue === newValue) {
return;
}
let isProp = isMemberInElement(elm, memberName);
memberName.toLowerCase();
if (memberName === "class") {
const classList = elm.classList;
const oldClasses = parseClassList(oldValue);
let newClasses = parseClassList(newValue);
{
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
}
} else if (memberName === "key") ; else if (memberName[0] === "a" && memberName.startsWith("attr:")) {
const attrName = memberName.slice(5);
if (newValue == null || newValue === false) {
if (newValue !== false || elm.getAttribute(attrName) === "") {
elm.removeAttribute(attrName);
}
} else {
elm.setAttribute(attrName, newValue === true ? "" : newValue);
}
return;
} else if (memberName[0] === "p" && memberName.startsWith("prop:")) {
const propName = memberName.slice(5);
try {
elm[propName] = newValue;
} catch (e) {
}
return;
} else {
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) {
if (typeof elm.__lookupSetter__(memberName) === "function") {
elm[memberName] = n;
} else {
elm.setAttribute(memberName, n);
}
}
} else if (elm[memberName] !== newValue) {
elm[memberName] = newValue;
}
} catch (e) {
}
}
if (newValue == null || newValue === false) {
if (newValue !== false || elm.getAttribute(memberName) === "") {
{
elm.removeAttribute(memberName);
}
}
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
newValue = newValue === true ? "" : newValue;
{
elm.setAttribute(memberName, newValue);
}
}
}
};
var parseClassListRegex = /\s/;
var parseClassList = (value) => {
if (typeof value === "object" && value && "baseVal" in value) {
value = value.baseVal;
}
if (!value || typeof value !== "string") {
return [];
}
return value.split(parseClassListRegex);
};
// src/runtime/vdom/update-element.ts
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
const newVnodeAttrs = newVnode.$attrs$ || {};
{
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
);
}
var hostTagName;
var isSvgMode = false;
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
const newVNode2 = newParentVNode.$children$[childIndex];
let i2 = 0;
let elm;
let childNode;
{
if (!isSvgMode) {
isSvgMode = newVNode2.$tag$ === "svg";
}
if (!win.document) {
throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");
}
elm = newVNode2.$elm$ = win.document.createElementNS(
isSvgMode ? SVG_NS : HTML_NS,
newVNode2.$tag$
) ;
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
isSvgMode = false;
}
{
updateElement(null, newVNode2, isSvgMode);
}
if (newVNode2.$children$) {
const appendTarget = newVNode2.$tag$ === "template" ? elm.content : elm;
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
childNode = createElm(oldParentVNode, newVNode2, i2);
if (childNode) {
appendTarget.appendChild(childNode);
}
}
}
{
if (newVNode2.$tag$ === "svg") {
isSvgMode = false;
} else if (elm.tagName === "foreignObject") {
isSvgMode = true;
}
}
}
elm["s-hn"] = hostTagName;
return elm;
};
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
let containerElm = parentElm;
let childNode;
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
containerElm = containerElm.shadowRoot;
}
if (parentVNode.$tag$ === "template") {
containerElm = containerElm.content;
}
for (; startIdx <= endIdx; ++startIdx) {
if (vnodes[startIdx]) {
childNode = createElm(null, parentVNode, startIdx);
if (childNode) {
vnodes[startIdx].$elm$ = childNode;
insertBefore(containerElm, childNode, before);
}
}
}
};
var removeVnodes = (vnodes, startIdx, endIdx) => {
for (let index = startIdx; index <= endIdx; ++index) {
const vnode = vnodes[index];
if (vnode) {
const elm = vnode.$elm$;
if (elm) {
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;
const containerElm = newVNode2.$tag$ === "template" ? parentElm.content : parentElm;
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)) {
patch(oldStartVnode, newEndVnode, isInitialRender);
insertBefore(containerElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
oldStartVnode = oldCh[++oldStartIdx];
newEndVnode = newCh[--newEndIdx];
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
patch(oldEndVnode, newStartVnode, isInitialRender);
insertBefore(containerElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
oldEndVnode = oldCh[--oldEndIdx];
newStartVnode = newCh[++newStartIdx];
} else {
idxInOld = -1;
{
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
idxInOld = i2;
break;
}
}
}
if (idxInOld >= 0) {
elmToMove = oldCh[idxInOld];
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
} else {
patch(elmToMove, newStartVnode, isInitialRender);
oldCh[idxInOld] = void 0;
node = elmToMove.$elm$;
}
newStartVnode = newCh[++newStartIdx];
} else {
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
newStartVnode = newCh[++newStartIdx];
}
if (node) {
{
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 (newStartIdx > newEndIdx) {
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
}
};
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
if (leftVNode.$tag$ === rightVNode.$tag$) {
if (!isInitialRender) {
return leftVNode.$key$ === rightVNode.$key$;
}
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
leftVNode.$key$ = rightVNode.$key$;
}
return true;
}
return false;
};
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
const elm = newVNode2.$elm$ = oldVNode.$elm$;
const oldChildren = oldVNode.$children$;
const newChildren = newVNode2.$children$;
const tag = newVNode2.$tag$;
{
{
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
}
{
updateElement(oldVNode, newVNode2, isSvgMode);
}
if (oldChildren !== null && newChildren !== null) {
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
} else if (newChildren !== null) {
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 && BUILD.updatable && oldChildren !== null
) {
removeVnodes(oldChildren, 0, oldChildren.length - 1);
} else ;
if (isSvgMode && tag === "svg") {
isSvgMode = false;
}
}
};
var insertBefore = (parent, newNode, reference, isInitialLoad) => {
if (parent.__insertBefore) {
return parent.__insertBefore(newNode, reference);
} else {
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
}
};
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
const hostElm = hostRef.$hostElement$;
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
const isHostElement = isHost(renderFnResults);
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
hostTagName = hostElm.tagName;
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$ = hostElm.shadowRoot || hostElm ;
patch(oldVNode, rootVnode, isInitialLoad);
};
// src/runtime/update-component.ts
var attachToAncestor = (hostRef, ancestorComponent) => {
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
const index = ancestorComponent["s-p"].push(
new Promise(
(r) => hostRef.$onRenderResolve$ = () => {
ancestorComponent["s-p"].splice(index - 1, 1);
r();
}
)
);
}
};
var scheduleUpdate = (hostRef, isInitialLoad) => {
{
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
}
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
hostRef.$flags$ |= 512 /* needsRerender */;
return;
}
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
if (isInitialLoad) {
queueMicrotask(() => {
dispatch();
});
return;
}
return writeTask(dispatch) ;
};
var dispatchHooks = (hostRef, isInitialLoad) => {
const elm = hostRef.$hostElement$;
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
const instance = hostRef.$lazyInstance$ ;
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 (hostRef.$fetchedCbList$.length) {
hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
}
}
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
} else {
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
}
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
endSchedule();
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
};
var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err) => {
console.error(err);
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 (isInitialLoad) {
attachStyles(hostRef);
}
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
{
callRender(hostRef, instance, elm, isInitialLoad);
}
if (rc) {
rc.map((cb) => cb());
elm["s-rc"] = void 0;
}
endRender();
endUpdate();
{
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;
}
}
};
var callRender = (hostRef, instance, elm, isInitialLoad) => {
try {
instance = instance.render() ;
{
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
}
{
hostRef.$flags$ |= 2 /* hasRendered */;
}
{
{
{
renderVdom(hostRef, instance, isInitialLoad);
}
}
}
} catch (e) {
consoleError(e, hostRef.$hostElement$);
}
return null;
};
var postUpdateComponent = (hostRef) => {
const tagName = hostRef.$cmpMeta$.$tagName$;
const elm = hostRef.$hostElement$;
const endPostUpdate = createTime("postUpdate", tagName);
const instance = hostRef.$lazyInstance$ ;
const ancestorComponent = hostRef.$ancestorComponent$;
safeCall(instance, "componentDidRender", void 0, elm);
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
{
addHydratedFlag(elm);
}
safeCall(instance, "componentDidLoad", void 0, elm);
endPostUpdate();
{
hostRef.$onReadyResolve$(elm);
if (!ancestorComponent) {
appDidLoad();
}
}
} else {
safeCall(instance, "componentDidUpdate", void 0, elm);
endPostUpdate();
}
{
if (hostRef.$onRenderResolve$) {
hostRef.$onRenderResolve$();
hostRef.$onRenderResolve$ = void 0;
}
if (hostRef.$flags$ & 512 /* needsRerender */) {
nextTick(() => scheduleUpdate(hostRef, false));
}
hostRef.$flags$ &= -517;
}
};
var appDidLoad = (who) => {
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
};
var safeCall = (instance, method, arg, elm) => {
if (instance && instance[method]) {
try {
return instance[method](arg);
} catch (e) {
consoleError(e, elm);
}
}
return void 0;
};
var addHydratedFlag = (elm) => {
var _a;
return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
};
// 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 (!hostRef) {
return;
}
if (!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/stenciljs/core/issues/5457).`
);
}
const oldVal = hostRef.$instanceValues$.get(propName);
const flags = hostRef.$flags$;
const instance = hostRef.$lazyInstance$ ;
newVal = parsePropertyValue(
newVal,
cmpMeta.$members$[propName][0]);
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
const didValueChange = newVal !== oldVal && !areBothNaN;
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
hostRef.$instanceValues$.set(propName, newVal);
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
if (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 (cmpMeta.$members$ || BUILD.propChangeCallback) {
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
members.map(([memberName, [memberFlags]]) => {
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
if (flags & 1 /* isElementConstructor */ || !origGetter) {
Object.defineProperty(prototype, memberName, {
get() {
{
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
return getValue(this, memberName);
}
const ref = getHostRef(this);
const instance = ref ? ref.$lazyInstance$ : prototype;
if (!instance) return;
return instance[memberName];
}
},
configurable: true,
enumerable: true
});
}
Object.defineProperty(prototype, memberName, {
set(newValue) {
const ref = getHostRef(this);
if (!ref) {
return;
}
if (origSetter) {
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
newValue = ref.$instanceValues$.get(memberName);
}
origSetter.apply(this, [
parsePropertyValue(
newValue,
memberFlags)
]);
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
setValue(this, memberName, newValue, cmpMeta);
return;
}
{
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
setValue(this, memberName, newValue, cmpMeta);
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
ref.$fetchedCbList$.push(() => {
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
ref.$lazyInstance$[memberName] = newValue;
}
});
}
return;
}
const setterSetVal = () => {
const currentValue = ref.$lazyInstance$[memberName];
if (!ref.$instanceValues$.get(memberName) && currentValue) {
ref.$instanceValues$.set(memberName, currentValue);
}
ref.$lazyInstance$[memberName] = parsePropertyValue(
newValue,
memberFlags);
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
};
if (ref.$lazyInstance$) {
setterSetVal();
} else {
ref.$fetchedCbList$.push(() => {
setterSetVal();
});
}
}
}
});
}
});
if ((flags & 1 /* isElementConstructor */)) {
const attrNameToPropName = /* @__PURE__ */ new Map();
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
plt.jmp(() => {
var _a2;
const propName = attrNameToPropName.get(attrName);
const hostRef = getHostRef(this);
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
newValue = this[propName];
delete this[propName];
}
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 flags2 = hostRef == null ? void 0 : hostRef.$flags$;
if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && newValue !== oldValue) {
const instance = hostRef.$lazyInstance$ ;
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
entry == null ? void 0 : entry.forEach((watcher) => {
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
if (instance[watchMethodName] != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
instance[watchMethodName].call(instance, newValue, oldValue, attrName);
}
});
}
return;
}
const propFlags = members.find(([m]) => m === propName);
if (propFlags && propFlags[1][0] & 4 /* Boolean */) {
newValue = newValue === null || newValue === "false" ? false : true;
}
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
this[propName] = newValue;
}
});
};
Cstr.observedAttributes = Array.from(
/* @__PURE__ */ new Set([
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
const attrName = m[1] || propName;
attrNameToPropName.set(attrName, propName);
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 (bundleId) {
const CstrImport = loadModule(cmpMeta, hostRef);
if (CstrImport && "then" in CstrImport) {
const endLoad = uniqueTime();
Cstr = await CstrImport;
endLoad();
} else {
Cstr = CstrImport;
}
if (!Cstr) {
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
}
if (!Cstr.isProxied) {
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
Cstr.isProxied = true;
}
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
{
hostRef.$flags$ |= 8 /* isConstructingInstance */;
}
try {
new Cstr(hostRef);
} catch (e) {
consoleError(e, elm);
}
{
hostRef.$flags$ &= -9 /* isConstructingInstance */;
}
endNewInstance();
{
fireConnectedCallback(hostRef.$lazyInstance$, elm);
}
} else {
Cstr = elm.constructor;
const cmpTag = elm.localName;
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
}
if (Cstr && Cstr.style) {
let style;
if (typeof Cstr.style === "string") {
style = Cstr.style;
}
const scopeId2 = getScopeId(cmpMeta);
if (!styles.has(scopeId2) || BUILD.hotModuleReplacement) {
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
endRegisterStyles();
}
}
}
const ancestorComponent = hostRef.$ancestorComponent$;
const schedule = () => scheduleUpdate(hostRef, true);
if (ancestorComponent && ancestorComponent["s-rc"]) {
ancestorComponent["s-rc"].push(schedule);
} else {
schedule();
}
};
var fireConnectedCallback = (instance, elm) => {
{
safeCall(instance, "connectedCallback", void 0, elm);
}
};
// src/runtime/connected-callback.ts
var connectedCallback = (elm) => {
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
const hostRef = getHostRef(elm);
if (!hostRef) {
return;
}
const cmpMeta = hostRef.$cmpMeta$;
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
hostRef.$flags$ |= 1 /* hasConnected */;
{
let ancestorComponent = elm;
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
if (ancestorComponent["s-p"]) {
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
break;
}
}
}
if (cmpMeta.$members$) {
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
if (memberFlags & 31 /* Prop */ && memberName in elm && elm[memberName] !== Object.prototype[memberName]) {
const value = elm[memberName];
delete elm[memberName];
elm[memberName] = value;
}
});
}
{
initializeComponent(elm, hostRef, cmpMeta);
}
} else {
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
fireConnectedCallback(hostRef.$lazyInstance$, elm);
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
}
}
endConnected();
}
};
var disconnectInstance = (instance, elm) => {
{
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
}
};
var disconnectedCallback = async (elm) => {
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
const hostRef = getHostRef(elm);
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
disconnectInstance(hostRef.$lazyInstance$, elm);
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
}
}
if (rootAppliedStyles.has(elm)) {
rootAppliedStyles.delete(elm);
}
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
rootAppliedStyles.delete(elm.shadowRoot);
}
};
// src/runtime/bootstrap-lazy.ts
var bootstrapLazy = (lazyBundles, options = {}) => {
var _a;
if (!win.document) {
console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
return;
}
const endBootstrap = createTime();
const cmpTags = [];
const exclude = options.exclude || [];
const customElements2 = win.customElements;
const head = win.document.head;
const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
const dataStyles = /* @__PURE__ */ win.document.createElement("style");
const deferredConnectedCallbacks = [];
let appLoadFallback;
let isBootstrapping = true;
Object.assign(plt, options);
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
lazyBundles.map((lazyBundle) => {
lazyBundle[1].map((compactMeta) => {
const cmpMeta = {
$flags$: compactMeta[0],
$tagName$: compactMeta[1],
$members$: compactMeta[2],
$listeners$: compactMeta[3]
};
{
cmpMeta.$members$ = compactMeta[2];
}
const tagName = transformTag(cmpMeta.$tagName$);
const HostElement = class extends HTMLElement {
["s-p"];
["s-rc"];
hasRegisteredEventListeners = false;
// StencilLazyHost
constructor(self) {
super(self);
self = this;
registerHost(self, cmpMeta);
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
{
if (!self.shadowRoot) {
createShadowRoot.call(self, cmpMeta);
} 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.`
);
}
}
}
}
}
connectedCallback() {
const hostRef = getHostRef(this);
if (!hostRef) {
return;
}
if (!this.hasRegisteredEventListeners) {
this.hasRegisteredEventListeners = true;
}
if (appLoadFallback) {
clearTimeout(appLoadFallback);
appLoadFallback = null;
}
if (isBootstrapping) {
deferredConnectedCallbacks.push(this);
} else {
plt.jmp(() => connectedCallback(this));
}
}
disconnectedCallback() {
plt.jmp(() => disconnectedCallback(this));
plt.raf(() => {
var _a3;
const hostRef = getHostRef(this);
if (!hostRef) {
return;
}
const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
if (i2 > -1) {
deferredConnectedCallbacks.splice(i2, 1);
}
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
delete hostRef.$vnode$.$elm$;
}
});
}
componentOnReady() {
var _a3;
return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
}
};
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) {
{
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
}
if (dataStyles.innerHTML.length) {
dataStyles.setAttribute("data-styles", "");
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
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 {
{
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
}
}
endBootstrap();
};
// src/runtime/nonce.ts
var setNonce = (nonce) => plt.$nonce$ = nonce;
function transformTag(tag) {
return tag;
}
export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };

Sorry, the diff of this file is too big to display