analog-clock-components 0.1.456 → 0.1.458

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{p as e,b as a}from"./p-39f2a83a.js";export{s as setNonce}from"./p-39f2a83a.js";(()=>{const a=import.meta.url,o={};return""!==a&&(o.resourcesUrl=new URL(".",a).href),e(o)})().then((e=>a([["p-b7ad2b84",[[1,"analog-clock",{size:[2],timeZone:[2,"time-zone"],time:[32]}]]]],e)));
1
+ import{p as e,b as o}from"./p-9ed18211.js";export{s as setNonce}from"./p-9ed18211.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-39d42f01",[[1,"analog-clock",{size:[2],timeZone:[2,"time-zone"],time:[32]}]]]],e)));
@@ -0,0 +1 @@
1
+ import{r as e,h as t}from"./p-9ed18211.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}
@@ -0,0 +1,2 @@
1
+ let e,n,t=!1,l=!1;const o="slot-fb{display:contents}slot-fb[hidden]{display:none}",s={},i=e=>"object"==(e=typeof e)||"function"===e;function c(e){var n,t,l;return null!==(l=null===(t=null===(n=e.head)||void 0===n?void 0:n.querySelector('meta[name="csp-nonce"]'))||void 0===t?void 0:t.getAttribute("content"))&&void 0!==l?l:void 0}const r=(e,n,...t)=>{let l=null,o=null,s=!1,c=!1;const r=[],a=n=>{for(let t=0;t<n.length;t++)l=n[t],Array.isArray(l)?a(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!i(l))&&(l+=""),s&&c?r[r.length-1].t+=l:r.push(s?u(null,l):l),c=s)};if(a(t),n){n.key&&(o=n.key);{const e=n.className||n.class;e&&(n.class="object"!=typeof e?e:Object.keys(e).filter((n=>e[n])).join(" "))}}const f=u(e,null);return f.l=n,r.length>0&&(f.o=r),f.i=o,f},u=(e,n)=>({u:0,h:e,t:n,v:null,o:null,l:null,i:null}),a={},f=new WeakMap,d=e=>"sc-"+e.p,y=(e,n,t,l,o,s)=>{if(t!==l){let c=H(e,n);if(n.toLowerCase(),"class"===n){const n=e.classList,o=v(t),s=v(l);n.remove(...o.filter((e=>e&&!s.includes(e)))),n.add(...s.filter((e=>e&&!o.includes(e))))}else if("key"===n);else{const r=i(l);if((c||r&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[n]=l;else{const o=null==l?"":l;"list"===n?c=!1:null!=t&&e[n]==o||(e[n]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(n)||e.removeAttribute(n):(!c||4&s||o)&&!r&&e.setAttribute(n,l=!0===l?"":l)}}},h=/\s/,v=e=>e?e.split(h):[],p=(e,n,t,l)=>{const o=11===n.v.nodeType&&n.v.host?n.v.host:n.v,i=e&&e.l||s,c=n.l||s;for(l in i)l in c||y(o,l,i[l],void 0,t,n.u);for(l in c)y(o,l,i[l],c[l],t,n.u)},$=(l,o,s)=>{const i=o.o[s];let c,r,u=0;if(t||(t="svg"===i.h),c=i.v=I.createElementNS(t?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",i.h),t&&"foreignObject"===i.h&&(t=!1),p(null,i,t),null!=e&&c["s-si"]!==e&&c.classList.add(c["s-si"]=e),i.o)for(u=0;u<i.o.length;++u)r=$(l,i,u),r&&c.appendChild(r);return"svg"===i.h?t=!1:"foreignObject"===c.tagName&&(t=!0),c["s-hn"]=n,c},m=(e,t,l,o,s,i)=>{let c,r=e;for(r.shadowRoot&&r.tagName===n&&(r=r.shadowRoot);s<=i;++s)o[s]&&(c=$(null,l,s),c&&(o[s].v=c,r.insertBefore(c,t)))},b=(e,n,t)=>{for(let l=n;l<=t;++l){const n=e[l];if(n){const e=n.v;e&&e.remove()}}},w=(e,n,t=!1)=>e.h===n.h&&(!!t||e.i===n.i),g=(e,n,l=!1)=>{const o=n.v=e.v,s=e.o,i=n.o,c=n.h;t="svg"===c||"foreignObject"!==c&&t,p(e,n,t),null!==s&&null!==i?((e,n,t,l,o=!1)=>{let s,i,c=0,r=0,u=0,a=0,f=n.length-1,d=n[0],y=n[f],h=l.length-1,v=l[0],p=l[h];for(;c<=f&&r<=h;)if(null==d)d=n[++c];else if(null==y)y=n[--f];else if(null==v)v=l[++r];else if(null==p)p=l[--h];else if(w(d,v,o))g(d,v,o),d=n[++c],v=l[++r];else if(w(y,p,o))g(y,p,o),y=n[--f],p=l[--h];else if(w(d,p,o))g(d,p,o),e.insertBefore(d.v,y.v.nextSibling),d=n[++c],p=l[--h];else if(w(y,v,o))g(y,v,o),e.insertBefore(y.v,d.v),y=n[--f],v=l[++r];else{for(u=-1,a=c;a<=f;++a)if(n[a]&&null!==n[a].i&&n[a].i===v.i){u=a;break}u>=0?(i=n[u],i.h!==v.h?s=$(n&&n[r],t,u):(g(i,v,o),n[u]=void 0,s=i.v),v=l[++r]):(s=$(n&&n[r],t,r),v=l[++r]),s&&d.v.parentNode.insertBefore(s,d.v)}c>f?m(e,null==l[h+1]?null:l[h+1].v,t,l,r,h):r>h&&b(n,c,f)})(o,s,n,i,l):null!==i?m(o,null,n,i,0,i.length-1):null!==s&&b(s,0,s.length-1),t&&"svg"===c&&(t=!1)},j=(e,n)=>{n&&!e.$&&n["s-p"]&&n["s-p"].push(new Promise((n=>e.$=n)))},S=(e,n)=>{if(e.u|=16,!(4&e.u))return j(e,e.m),le((()=>k(e,n)));e.u|=512},k=(e,n)=>{const t=e.j;return O(void 0,(()=>C(e,t,n)))},O=(e,n)=>M(e)?e.then(n):n(),M=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,C=async(e,n,t)=>{var l;const s=e.$hostElement$,i=s["s-rc"];t&&(e=>{const n=e.S,t=e.$hostElement$,l=n.u,s=((e,n)=>{var t;const l=d(n),s=B.get(l);if(e=11===e.nodeType?e:I,s)if("string"==typeof s){let i,r=f.get(e=e.head||e);if(r||f.set(e,r=new Set),!r.has(l)){{i=I.createElement("style"),i.innerHTML=s;const n=null!==(t=J.k)&&void 0!==t?t:c(I);null!=n&&i.setAttribute("nonce",n),e.insertBefore(i,e.querySelector("link"))}4&n.u&&(i.innerHTML+=o),r&&r.add(l)}}else e.adoptedStyleSheets.includes(s)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,s]);return l})(t.shadowRoot?t.shadowRoot:t.getRootNode(),n);10&l&&(t["s-sc"]=s,t.classList.add(s+"-h"))})(e);P(e,n,s,t),i&&(i.map((e=>e())),s["s-rc"]=void 0);{const n=null!==(l=s["s-p"])&&void 0!==l?l:[],t=()=>x(e);0===n.length?t():(Promise.all(n).then(t),e.u|=4,n.length=0)}},P=(t,l,o,s)=>{try{l=l.render(),t.u&=-17,t.u|=2,((t,l,o=!1)=>{const s=t.$hostElement$,i=t.O||u(null,null),c=(e=>e&&e.h===a)(l)?l:r(null,null,l);if(n=s.tagName,o&&c.l)for(const e of Object.keys(c.l))s.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(c.l[e]=s[e]);c.h=null,c.u|=4,t.O=c,c.v=i.v=s.shadowRoot||s,e=s["s-sc"],g(i,c,o)})(t,l,s)}catch(e){V(e,t.$hostElement$)}return null},x=e=>{const n=e.$hostElement$,t=e.j,l=e.m;64&e.u||(e.u|=64,L(n),E(t,"componentDidLoad"),e.M(n),l||A()),e.$&&(e.$(),e.$=void 0),512&e.u&&te((()=>S(e,!1))),e.u&=-517},A=()=>{L(I.documentElement),te((()=>(e=>{const n=J.ce("appload",{detail:{namespace:"analog-clock"}});return e.dispatchEvent(n),n})(G)))},E=(e,n,t)=>{if(e&&e[n])try{return e[n](t)}catch(e){V(e)}},L=e=>e.classList.add("hydrated"),N=(e,n,t)=>{var l;const o=e.prototype;if(n.C){const s=Object.entries(n.C);if(s.map((([e,[l]])=>{(31&l||2&t&&32&l)&&Object.defineProperty(o,e,{get(){return((e,n)=>W(this).P.get(n))(0,e)},set(t){((e,n,t,l)=>{const o=W(e),s=o.P.get(n),c=o.u,r=o.j;t=((e,n)=>null==e||i(e)?e:2&n?parseFloat(e):e)(t,l.C[n][0]),8&c&&void 0!==s||t===s||Number.isNaN(s)&&Number.isNaN(t)||(o.P.set(n,t),r&&2==(18&c)&&S(o,!1))})(this,e,t,n)},configurable:!0,enumerable:!0})})),1&t){const t=new Map;o.attributeChangedCallback=function(e,l,s){J.jmp((()=>{var i;const c=t.get(e);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(o.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const t=W(this),o=null==t?void 0:t.u;if(o&&!(8&o)&&128&o&&s!==l){const o=t.j,c=null===(i=n.A)||void 0===i?void 0:i[e];null==c||c.forEach((n=>{null!=o[n]&&o[n].call(o,s,l,e)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!==(l=n.A)&&void 0!==l?l:{}),...s.filter((([e,n])=>15&n[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))]))}}return e},T=e=>{E(e,"disconnectedCallback")},F=(e,n={})=>{var t;const l=[],s=n.exclude||[],i=G.customElements,r=I.head,u=r.querySelector("meta[charset]"),a=I.createElement("style"),f=[];let y,h=!0;Object.assign(J,n),J.L=new URL(n.resourcesUrl||"./",I.baseURI).href;let v=!1;if(e.map((e=>{e[1].map((n=>{const t={u:n[0],p:n[1],C:n[2],N:n[3]};4&t.u&&(v=!0),t.C=n[2];const o=t.p,c=class extends HTMLElement{constructor(e){super(e),D(e=this,t),1&t.u&&e.attachShadow({mode:"open"})}connectedCallback(){y&&(clearTimeout(y),y=null),h?f.push(this):J.jmp((()=>(e=>{if(0==(1&J.u)){const n=W(e),t=n.S,l=()=>{};if(1&n.u)(null==n?void 0:n.j)||(null==n?void 0:n.T)&&n.T.then((()=>{}));else{n.u|=1;{let t=e;for(;t=t.parentNode||t.host;)if(t["s-p"]){j(n,n.m=t);break}}t.C&&Object.entries(t.C).map((([n,[t]])=>{if(31&t&&e.hasOwnProperty(n)){const t=e[n];delete e[n],e[n]=t}})),(async(e,n,t)=>{let l;if(0==(32&n.u)){n.u|=32;{if(l=z(t),l.then){const e=()=>{};l=await l,e()}l.isProxied||(N(l,t,2),l.isProxied=!0);const e=()=>{};n.u|=8;try{new l(n)}catch(e){V(e)}n.u&=-9,e()}if(l.style){let e=l.style;const n=d(t);if(!B.has(n)){const l=()=>{};((e,n,t)=>{let l=B.get(e);Q&&t?(l=l||new CSSStyleSheet,"string"==typeof l?l=n:l.replaceSync(n)):l=n,B.set(e,l)})(n,e,!!(1&t.u)),l()}}}const o=n.m,s=()=>S(n,!0);o&&o["s-rc"]?o["s-rc"].push(s):s()})(0,n,t)}l()}})(this)))}disconnectedCallback(){J.jmp((()=>(async()=>{if(0==(1&J.u)){const e=W(this);(null==e?void 0:e.j)?T(e.j):(null==e?void 0:e.T)&&e.T.then((()=>T(e.j)))}})()))}componentOnReady(){return W(this).T}};t.F=e[0],s.includes(o)||i.get(o)||(l.push(o),i.define(o,N(c,t,1)))}))})),v&&(a.innerHTML+=o),a.innerHTML+=l+"{visibility:hidden}.hydrated{visibility:inherit}",a.innerHTML.length){a.setAttribute("data-styles","");const e=null!==(t=J.k)&&void 0!==t?t:c(I);null!=e&&a.setAttribute("nonce",e),r.insertBefore(a,u?u.nextSibling:r.firstChild)}h=!1,f.length?f.map((e=>e.connectedCallback())):J.jmp((()=>y=setTimeout(A,30)))},R=e=>J.k=e,U=new WeakMap,W=e=>U.get(e),q=(e,n)=>U.set(n.j=e,n),D=(e,n)=>{const t={u:0,$hostElement$:e,S:n,P:new Map};return t.T=new Promise((e=>t.M=e)),e["s-p"]=[],e["s-rc"]=[],U.set(e,t)},H=(e,n)=>n in e,V=(e,n)=>(0,console.error)(e,n),_=new Map,z=e=>{const n=e.p.replace(/-/g,"_"),t=e.F,l=_.get(t);return l?l[n]:import(`./${t}.entry.js`).then((e=>(_.set(t,e),e[n])),V)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},B=new Map,G="undefined"!=typeof window?window:{},I=G.document||{head:{}},J={u:0,L:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,n,t,l)=>e.addEventListener(n,t,l),rel:(e,n,t,l)=>e.removeEventListener(n,t,l),ce:(e,n)=>new CustomEvent(e,n)},K=e=>Promise.resolve(e),Q=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),X=[],Y=[],Z=(e,n)=>t=>{e.push(t),l||(l=!0,n&&4&J.u?te(ne):J.raf(ne))},ee=e=>{for(let n=0;n<e.length;n++)try{e[n](performance.now())}catch(e){V(e)}e.length=0},ne=()=>{ee(X),ee(Y),(l=X.length>0)&&J.raf(ne)},te=e=>K().then(e),le=Z(Y,!0);export{F as b,r as h,K as p,q as r,R as s}
@@ -2,9 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-4f7a9af9.js');
5
+ const index = require('./index-a27f167b.js');
6
6
 
7
7
  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)}";
8
+ const AnalogClockStyle0 = analogClockCss;
8
9
 
9
10
  const AnalogClock = class {
10
11
  constructor(hostRef) {
@@ -41,9 +42,9 @@ const AnalogClock = class {
41
42
  return this.second * 6;
42
43
  }
43
44
  render() {
44
- return (index.h("svg", { class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, index.h("circle", { id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), index.h("line", { id: "hour", transform: `rotate(${this.hourToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "60", "stroke-width": "10", "stroke-linecap": "round" }), index.h("line", { id: "minute", transform: `rotate(${this.minuteToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "30", "stroke-width": "8", "stroke-linecap": "round" }), index.h("line", { id: "second", transform: `rotate(${this.secondToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "20", "stroke-width": "2", "stroke-linecap": "round" })));
45
+ return (index.h("svg", { key: '39e3465d3bf04035966b00bb15186d1f712163cd', class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, index.h("circle", { key: 'e4c4288aa0efc9cf98027eef1f5bd7c550c23a18', id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), index.h("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" }), index.h("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" }), index.h("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" })));
45
46
  }
46
47
  };
47
- AnalogClock.style = analogClockCss;
48
+ AnalogClock.style = AnalogClockStyle0;
48
49
 
49
50
  exports.analog_clock = AnalogClock;
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-4f7a9af9.js');
5
+ const index = require('./index-a27f167b.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Browser v4.10.0 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v4.12.0 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchBrowser = () => {
11
11
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('analog-clock.cjs.js', document.baseURI).href));
@@ -106,6 +106,7 @@ function queryNonceMetaTagContent(doc) {
106
106
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
107
107
  const h = (nodeName, vnodeData, ...children) => {
108
108
  let child = null;
109
+ let key = null;
109
110
  let simple = false;
110
111
  let lastSimple = false;
111
112
  const vNodeChildren = [];
@@ -133,6 +134,9 @@ const h = (nodeName, vnodeData, ...children) => {
133
134
  };
134
135
  walk(children);
135
136
  if (vnodeData) {
137
+ if (vnodeData.key) {
138
+ key = vnodeData.key;
139
+ }
136
140
  // normalize class / className attributes
137
141
  {
138
142
  const classData = vnodeData.className || vnodeData.class;
@@ -151,6 +155,9 @@ const h = (nodeName, vnodeData, ...children) => {
151
155
  if (vNodeChildren.length > 0) {
152
156
  vnode.$children$ = vNodeChildren;
153
157
  }
158
+ {
159
+ vnode.$key$ = key;
160
+ }
154
161
  return vnode;
155
162
  };
156
163
  /**
@@ -172,6 +179,9 @@ const newVNode = (tag, text) => {
172
179
  {
173
180
  vnode.$attrs$ = null;
174
181
  }
182
+ {
183
+ vnode.$key$ = null;
184
+ }
175
185
  return vnode;
176
186
  };
177
187
  const Host = {};
@@ -343,6 +353,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
343
353
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
344
354
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
345
355
  }
356
+ else if (memberName === 'key')
357
+ ;
346
358
  else {
347
359
  // Set property if it exists and it's not a SVG
348
360
  const isComplex = isComplexType(newValue);
@@ -601,6 +613,8 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
601
613
  const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
602
614
  let oldStartIdx = 0;
603
615
  let newStartIdx = 0;
616
+ let idxInOld = 0;
617
+ let i = 0;
604
618
  let oldEndIdx = oldCh.length - 1;
605
619
  let oldStartVnode = oldCh[0];
606
620
  let oldEndVnode = oldCh[oldEndIdx];
@@ -608,6 +622,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
608
622
  let newStartVnode = newCh[0];
609
623
  let newEndVnode = newCh[newEndIdx];
610
624
  let node;
625
+ let elmToMove;
611
626
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
612
627
  if (oldStartVnode == null) {
613
628
  // VNode might have been moved left
@@ -674,7 +689,41 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
674
689
  newStartVnode = newCh[++newStartIdx];
675
690
  }
676
691
  else {
692
+ // Here we do some checks to match up old and new nodes based on the
693
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
694
+ // in the JSX for a DOM element in the implementation of a Stencil
695
+ // component.
696
+ //
697
+ // First we check to see if there are any nodes in the array of old
698
+ // children which have the same key as the first node in the new
699
+ // children.
700
+ idxInOld = -1;
677
701
  {
702
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
703
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
704
+ idxInOld = i;
705
+ break;
706
+ }
707
+ }
708
+ }
709
+ if (idxInOld >= 0) {
710
+ // We found a node in the old children which matches up with the first
711
+ // node in the new children! So let's deal with that
712
+ elmToMove = oldCh[idxInOld];
713
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
714
+ // the tag doesn't match so we'll need a new DOM element
715
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
716
+ }
717
+ else {
718
+ patch(elmToMove, newStartVnode, isInitialRender);
719
+ // invalidate the matching old node so that we won't try to update it
720
+ // again later on
721
+ oldCh[idxInOld] = undefined;
722
+ node = elmToMove.$elm$;
723
+ }
724
+ newStartVnode = newCh[++newStartIdx];
725
+ }
726
+ else {
678
727
  // We either didn't find an element in the old children that matches
679
728
  // the key of the first new child OR the build is not using `key`
680
729
  // attributes at all. In either case we need to create a new element
@@ -724,6 +773,14 @@ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
724
773
  // compare if two vnode to see if they're "technically" the same
725
774
  // need to have the same element tag, and same key to be the same
726
775
  if (leftVNode.$tag$ === rightVNode.$tag$) {
776
+ // this will be set if JSX tags in the build have `key` attrs set on them
777
+ // we only want to check this if we're not on the first render since on
778
+ // first render `leftVNode.$key$` will always be `null`, so we can be led
779
+ // astray and, for instance, accidentally delete a DOM node that we want to
780
+ // keep around.
781
+ if (!isInitialRender) {
782
+ return leftVNode.$key$ === rightVNode.$key$;
783
+ }
727
784
  return true;
728
785
  }
729
786
  return false;
@@ -1488,8 +1545,19 @@ const setNonce = (nonce) => (plt.$nonce$ = nonce);
1488
1545
  /**
1489
1546
  * A WeakMap mapping runtime component references to their corresponding host reference
1490
1547
  * instances.
1548
+ *
1549
+ * **Note**: If we're in an HMR context we need to store a reference to this
1550
+ * value on `window` in order to maintain the mapping of {@link d.RuntimeRef}
1551
+ * to {@link d.HostRef} across HMR updates.
1552
+ *
1553
+ * This is necessary because when HMR updates for a component are processed by
1554
+ * the browser-side dev server client the JS bundle for that component is
1555
+ * re-fetched. Since the module containing {@link hostRefs} is included in
1556
+ * that bundle, if we do not store a reference to it the new iteration of the
1557
+ * component will not have access to the previous hostRef map, leading to a
1558
+ * bug where the new version of the component cannot properly initialize.
1491
1559
  */
1492
- const hostRefs = /*@__PURE__*/ new WeakMap();
1560
+ const hostRefs = new WeakMap();
1493
1561
  /**
1494
1562
  * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
1495
1563
  *
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-4f7a9af9.js');
5
+ const index = require('./index-a27f167b.js');
6
6
 
7
7
  const defineCustomElements = (win, options) => {
8
8
  if (typeof window === 'undefined') return undefined;
@@ -4,7 +4,7 @@
4
4
  ],
5
5
  "compiler": {
6
6
  "name": "@stencil/core",
7
- "version": "4.10.0",
7
+ "version": "4.12.0",
8
8
  "typescriptVersion": "5.3.3"
9
9
  },
10
10
  "collections": [],
@@ -33,7 +33,7 @@ export class AnalogClock {
33
33
  return this.second * 6;
34
34
  }
35
35
  render() {
36
- return (h("svg", { class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, h("circle", { id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), h("line", { id: "hour", transform: `rotate(${this.hourToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "60", "stroke-width": "10", "stroke-linecap": "round" }), h("line", { id: "minute", transform: `rotate(${this.minuteToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "30", "stroke-width": "8", "stroke-linecap": "round" }), h("line", { id: "second", transform: `rotate(${this.secondToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "20", "stroke-width": "2", "stroke-linecap": "round" })));
36
+ return (h("svg", { key: '39e3465d3bf04035966b00bb15186d1f712163cd', class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, h("circle", { key: 'e4c4288aa0efc9cf98027eef1f5bd7c550c23a18', id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), h("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" }), h("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" }), h("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" })));
37
37
  }
38
38
  static get is() { return "analog-clock"; }
39
39
  static get encapsulation() { return "shadow"; }
@@ -1,6 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
2
 
3
3
  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)}";
4
+ const AnalogClockStyle0 = analogClockCss;
4
5
 
5
6
  const AnalogClock$1 = /*@__PURE__*/ proxyCustomElement(class AnalogClock extends HTMLElement {
6
7
  constructor() {
@@ -39,9 +40,9 @@ const AnalogClock$1 = /*@__PURE__*/ proxyCustomElement(class AnalogClock extends
39
40
  return this.second * 6;
40
41
  }
41
42
  render() {
42
- return (h("svg", { class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, h("circle", { id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), h("line", { id: "hour", transform: `rotate(${this.hourToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "60", "stroke-width": "10", "stroke-linecap": "round" }), h("line", { id: "minute", transform: `rotate(${this.minuteToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "30", "stroke-width": "8", "stroke-linecap": "round" }), h("line", { id: "second", transform: `rotate(${this.secondToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "20", "stroke-width": "2", "stroke-linecap": "round" })));
43
+ return (h("svg", { key: '39e3465d3bf04035966b00bb15186d1f712163cd', class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, h("circle", { key: 'e4c4288aa0efc9cf98027eef1f5bd7c550c23a18', id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), h("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" }), h("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" }), h("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" })));
43
44
  }
44
- static get style() { return analogClockCss; }
45
+ static get style() { return AnalogClockStyle0; }
45
46
  }, [1, "analog-clock", {
46
47
  "size": [2],
47
48
  "timeZone": [2, "time-zone"],
@@ -1,6 +1,7 @@
1
- import { r as registerInstance, h } from './index-d4cf96a1.js';
1
+ import { r as registerInstance, h } from './index-c29bec78.js';
2
2
 
3
3
  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)}";
4
+ const AnalogClockStyle0 = analogClockCss;
4
5
 
5
6
  const AnalogClock = class {
6
7
  constructor(hostRef) {
@@ -37,9 +38,9 @@ const AnalogClock = class {
37
38
  return this.second * 6;
38
39
  }
39
40
  render() {
40
- return (h("svg", { class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, h("circle", { id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), h("line", { id: "hour", transform: `rotate(${this.hourToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "60", "stroke-width": "10", "stroke-linecap": "round" }), h("line", { id: "minute", transform: `rotate(${this.minuteToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "30", "stroke-width": "8", "stroke-linecap": "round" }), h("line", { id: "second", transform: `rotate(${this.secondToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "20", "stroke-width": "2", "stroke-linecap": "round" })));
41
+ return (h("svg", { key: '39e3465d3bf04035966b00bb15186d1f712163cd', class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, h("circle", { key: 'e4c4288aa0efc9cf98027eef1f5bd7c550c23a18', id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), h("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" }), h("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" }), h("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" })));
41
42
  }
42
43
  };
43
- AnalogClock.style = analogClockCss;
44
+ AnalogClock.style = AnalogClockStyle0;
44
45
 
45
46
  export { AnalogClock as analog_clock };
@@ -1,8 +1,8 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-d4cf96a1.js';
2
- export { s as setNonce } from './index-d4cf96a1.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-c29bec78.js';
2
+ export { s as setNonce } from './index-c29bec78.js';
3
3
 
4
4
  /*
5
- Stencil Client Patch Browser v4.10.0 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Patch Browser v4.12.0 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  const patchBrowser = () => {
8
8
  const importMeta = import.meta.url;
@@ -84,6 +84,7 @@ function queryNonceMetaTagContent(doc) {
84
84
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
85
85
  const h = (nodeName, vnodeData, ...children) => {
86
86
  let child = null;
87
+ let key = null;
87
88
  let simple = false;
88
89
  let lastSimple = false;
89
90
  const vNodeChildren = [];
@@ -111,6 +112,9 @@ const h = (nodeName, vnodeData, ...children) => {
111
112
  };
112
113
  walk(children);
113
114
  if (vnodeData) {
115
+ if (vnodeData.key) {
116
+ key = vnodeData.key;
117
+ }
114
118
  // normalize class / className attributes
115
119
  {
116
120
  const classData = vnodeData.className || vnodeData.class;
@@ -129,6 +133,9 @@ const h = (nodeName, vnodeData, ...children) => {
129
133
  if (vNodeChildren.length > 0) {
130
134
  vnode.$children$ = vNodeChildren;
131
135
  }
136
+ {
137
+ vnode.$key$ = key;
138
+ }
132
139
  return vnode;
133
140
  };
134
141
  /**
@@ -150,6 +157,9 @@ const newVNode = (tag, text) => {
150
157
  {
151
158
  vnode.$attrs$ = null;
152
159
  }
160
+ {
161
+ vnode.$key$ = null;
162
+ }
153
163
  return vnode;
154
164
  };
155
165
  const Host = {};
@@ -321,6 +331,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
321
331
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
322
332
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
323
333
  }
334
+ else if (memberName === 'key')
335
+ ;
324
336
  else {
325
337
  // Set property if it exists and it's not a SVG
326
338
  const isComplex = isComplexType(newValue);
@@ -579,6 +591,8 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
579
591
  const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
580
592
  let oldStartIdx = 0;
581
593
  let newStartIdx = 0;
594
+ let idxInOld = 0;
595
+ let i = 0;
582
596
  let oldEndIdx = oldCh.length - 1;
583
597
  let oldStartVnode = oldCh[0];
584
598
  let oldEndVnode = oldCh[oldEndIdx];
@@ -586,6 +600,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
586
600
  let newStartVnode = newCh[0];
587
601
  let newEndVnode = newCh[newEndIdx];
588
602
  let node;
603
+ let elmToMove;
589
604
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
590
605
  if (oldStartVnode == null) {
591
606
  // VNode might have been moved left
@@ -652,7 +667,41 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
652
667
  newStartVnode = newCh[++newStartIdx];
653
668
  }
654
669
  else {
670
+ // Here we do some checks to match up old and new nodes based on the
671
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
672
+ // in the JSX for a DOM element in the implementation of a Stencil
673
+ // component.
674
+ //
675
+ // First we check to see if there are any nodes in the array of old
676
+ // children which have the same key as the first node in the new
677
+ // children.
678
+ idxInOld = -1;
655
679
  {
680
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
681
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
682
+ idxInOld = i;
683
+ break;
684
+ }
685
+ }
686
+ }
687
+ if (idxInOld >= 0) {
688
+ // We found a node in the old children which matches up with the first
689
+ // node in the new children! So let's deal with that
690
+ elmToMove = oldCh[idxInOld];
691
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
692
+ // the tag doesn't match so we'll need a new DOM element
693
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
694
+ }
695
+ else {
696
+ patch(elmToMove, newStartVnode, isInitialRender);
697
+ // invalidate the matching old node so that we won't try to update it
698
+ // again later on
699
+ oldCh[idxInOld] = undefined;
700
+ node = elmToMove.$elm$;
701
+ }
702
+ newStartVnode = newCh[++newStartIdx];
703
+ }
704
+ else {
656
705
  // We either didn't find an element in the old children that matches
657
706
  // the key of the first new child OR the build is not using `key`
658
707
  // attributes at all. In either case we need to create a new element
@@ -702,6 +751,14 @@ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
702
751
  // compare if two vnode to see if they're "technically" the same
703
752
  // need to have the same element tag, and same key to be the same
704
753
  if (leftVNode.$tag$ === rightVNode.$tag$) {
754
+ // this will be set if JSX tags in the build have `key` attrs set on them
755
+ // we only want to check this if we're not on the first render since on
756
+ // first render `leftVNode.$key$` will always be `null`, so we can be led
757
+ // astray and, for instance, accidentally delete a DOM node that we want to
758
+ // keep around.
759
+ if (!isInitialRender) {
760
+ return leftVNode.$key$ === rightVNode.$key$;
761
+ }
705
762
  return true;
706
763
  }
707
764
  return false;
@@ -1466,8 +1523,19 @@ const setNonce = (nonce) => (plt.$nonce$ = nonce);
1466
1523
  /**
1467
1524
  * A WeakMap mapping runtime component references to their corresponding host reference
1468
1525
  * instances.
1526
+ *
1527
+ * **Note**: If we're in an HMR context we need to store a reference to this
1528
+ * value on `window` in order to maintain the mapping of {@link d.RuntimeRef}
1529
+ * to {@link d.HostRef} across HMR updates.
1530
+ *
1531
+ * This is necessary because when HMR updates for a component are processed by
1532
+ * the browser-side dev server client the JS bundle for that component is
1533
+ * re-fetched. Since the module containing {@link hostRefs} is included in
1534
+ * that bundle, if we do not store a reference to it the new iteration of the
1535
+ * component will not have access to the previous hostRef map, leading to a
1536
+ * bug where the new version of the component cannot properly initialize.
1469
1537
  */
1470
- const hostRefs = /*@__PURE__*/ new WeakMap();
1538
+ const hostRefs = new WeakMap();
1471
1539
  /**
1472
1540
  * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
1473
1541
  *
@@ -1,5 +1,5 @@
1
- import { b as bootstrapLazy } from './index-d4cf96a1.js';
2
- export { s as setNonce } from './index-d4cf96a1.js';
1
+ import { b as bootstrapLazy } from './index-c29bec78.js';
2
+ export { s as setNonce } from './index-c29bec78.js';
3
3
 
4
4
  const defineCustomElements = (win, options) => {
5
5
  if (typeof window === 'undefined') return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "analog-clock-components",
3
- "version": "0.1.456",
3
+ "version": "0.1.458",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -25,7 +25,7 @@
25
25
  "format": "prettier --write src"
26
26
  },
27
27
  "dependencies": {
28
- "@stencil/core": "4.10.0"
28
+ "@stencil/core": "4.12.0"
29
29
  },
30
30
  "license": "MIT",
31
31
  "devDependencies": {
@@ -1,2 +0,0 @@
1
- let n,t,e=!1,l=!1;const o="slot-fb{display:contents}slot-fb[hidden]{display:none}",s={},i=n=>"object"==(n=typeof n)||"function"===n;function c(n){var t,e,l;return null!==(l=null===(e=null===(t=n.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===e?void 0:e.getAttribute("content"))&&void 0!==l?l:void 0}const r=(n,t,...e)=>{let l=null,o=!1,s=!1;const c=[],r=t=>{for(let e=0;e<t.length;e++)l=t[e],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof n&&!i(l))&&(l+=""),o&&s?c[c.length-1].t+=l:c.push(o?u(null,l):l),s=o)};if(r(e),t){const n=t.className||t.class;n&&(t.class="object"!=typeof n?n:Object.keys(n).filter((t=>n[t])).join(" "))}const a=u(n,null);return a.l=t,c.length>0&&(a.o=c),a},u=(n,t)=>({i:0,u:n,t,h:null,o:null,l:null}),a={},f=new WeakMap,d=n=>"sc-"+n.p,y=(n,t,e,l,o,s)=>{if(e!==l){let c=H(n,t);if(t.toLowerCase(),"class"===t){const t=n.classList,o=p(e),s=p(l);t.remove(...o.filter((n=>n&&!s.includes(n)))),t.add(...s.filter((n=>n&&!o.includes(n))))}else{const r=i(l);if((c||r&&null!==l)&&!o)try{if(n.tagName.includes("-"))n[t]=l;else{const o=null==l?"":l;"list"===t?c=!1:null!=e&&n[t]==o||(n[t]=o)}}catch(n){}null==l||!1===l?!1===l&&""!==n.getAttribute(t)||n.removeAttribute(t):(!c||4&s||o)&&!r&&n.setAttribute(t,l=!0===l?"":l)}}},h=/\s/,p=n=>n?n.split(h):[],v=(n,t,e,l)=>{const o=11===t.h.nodeType&&t.h.host?t.h.host:t.h,i=n&&n.l||s,c=t.l||s;for(l in i)l in c||y(o,l,i[l],void 0,e,t.i);for(l in c)y(o,l,i[l],c[l],e,t.i)},$=(l,o,s)=>{const i=o.o[s];let c,r,u=0;if(e||(e="svg"===i.u),c=i.h=I.createElementNS(e?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",i.u),e&&"foreignObject"===i.u&&(e=!1),v(null,i,e),null!=n&&c["s-si"]!==n&&c.classList.add(c["s-si"]=n),i.o)for(u=0;u<i.o.length;++u)r=$(l,i,u),r&&c.appendChild(r);return"svg"===i.u?e=!1:"foreignObject"===c.tagName&&(e=!0),c["s-hn"]=t,c},m=(n,e,l,o,s,i)=>{let c,r=n;for(r.shadowRoot&&r.tagName===t&&(r=r.shadowRoot);s<=i;++s)o[s]&&(c=$(null,l,s),c&&(o[s].h=c,r.insertBefore(c,e)))},b=(n,t,e)=>{for(let l=t;l<=e;++l){const t=n[l];if(t){const n=t.h;n&&n.remove()}}},w=(n,t)=>n.u===t.u,g=(n,t,l=!1)=>{const o=t.h=n.h,s=n.o,i=t.o,c=t.u;e="svg"===c||"foreignObject"!==c&&e,v(n,t,e),null!==s&&null!==i?((n,t,e,l,o=!1)=>{let s,i=0,c=0,r=t.length-1,u=t[0],a=t[r],f=l.length-1,d=l[0],y=l[f];for(;i<=r&&c<=f;)null==u?u=t[++i]:null==a?a=t[--r]:null==d?d=l[++c]:null==y?y=l[--f]:w(u,d)?(g(u,d,o),u=t[++i],d=l[++c]):w(a,y)?(g(a,y,o),a=t[--r],y=l[--f]):w(u,y)?(g(u,y,o),n.insertBefore(u.h,a.h.nextSibling),u=t[++i],y=l[--f]):w(a,d)?(g(a,d,o),n.insertBefore(a.h,u.h),a=t[--r],d=l[++c]):(s=$(t&&t[c],e,c),d=l[++c],s&&u.h.parentNode.insertBefore(s,u.h));i>r?m(n,null==l[f+1]?null:l[f+1].h,e,l,c,f):c>f&&b(t,i,r)})(o,s,t,i,l):null!==i?m(o,null,t,i,0,i.length-1):null!==s&&b(s,0,s.length-1),e&&"svg"===c&&(e=!1)},j=(n,t)=>{t&&!n.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>n.v=t)))},S=(n,t)=>{if(n.i|=16,!(4&n.i))return j(n,n.$),ln((()=>O(n,t)));n.i|=512},O=(n,t)=>{const e=n.m;return k(void 0,(()=>C(n,e,t)))},k=(n,t)=>M(n)?n.then(t):t(),M=n=>n instanceof Promise||n&&n.then&&"function"==typeof n.then,C=async(n,t,e)=>{var l;const s=n.$hostElement$,i=s["s-rc"];e&&(n=>{const t=n.j,e=n.$hostElement$,l=t.i,s=((n,t)=>{var e;const l=d(t),s=B.get(l);if(n=11===n.nodeType?n:I,s)if("string"==typeof s){let i,r=f.get(n=n.head||n);if(r||f.set(n,r=new Set),!r.has(l)){{i=I.createElement("style"),i.innerHTML=s;const t=null!==(e=J.S)&&void 0!==e?e:c(I);null!=t&&i.setAttribute("nonce",t),n.insertBefore(i,n.querySelector("link"))}4&t.i&&(i.innerHTML+=o),r&&r.add(l)}}else n.adoptedStyleSheets.includes(s)||(n.adoptedStyleSheets=[...n.adoptedStyleSheets,s]);return l})(e.shadowRoot?e.shadowRoot:e.getRootNode(),t);10&l&&(e["s-sc"]=s,e.classList.add(s+"-h"))})(n);P(n,t,s,e),i&&(i.map((n=>n())),s["s-rc"]=void 0);{const t=null!==(l=s["s-p"])&&void 0!==l?l:[],e=()=>x(n);0===t.length?e():(Promise.all(t).then(e),n.i|=4,t.length=0)}},P=(e,l,o,s)=>{try{l=l.render(),e.i&=-17,e.i|=2,((e,l,o=!1)=>{const s=e.$hostElement$,i=e.O||u(null,null),c=(n=>n&&n.u===a)(l)?l:r(null,null,l);if(t=s.tagName,o&&c.l)for(const n of Object.keys(c.l))s.hasAttribute(n)&&!["key","ref","style","class"].includes(n)&&(c.l[n]=s[n]);c.u=null,c.i|=4,e.O=c,c.h=i.h=s.shadowRoot||s,n=s["s-sc"],g(i,c,o)})(e,l,s)}catch(n){V(n,e.$hostElement$)}return null},x=n=>{const t=n.$hostElement$,e=n.m,l=n.$;64&n.i||(n.i|=64,L(t),E(e,"componentDidLoad"),n.k(t),l||A()),n.v&&(n.v(),n.v=void 0),512&n.i&&en((()=>S(n,!1))),n.i&=-517},A=()=>{L(I.documentElement),en((()=>(n=>{const t=J.ce("appload",{detail:{namespace:"analog-clock"}});return n.dispatchEvent(t),t})(G)))},E=(n,t,e)=>{if(n&&n[t])try{return n[t](e)}catch(n){V(n)}},L=n=>n.classList.add("hydrated"),N=(n,t,e)=>{var l;const o=n.prototype;if(t.M){const s=Object.entries(t.M);if(s.map((([n,[l]])=>{(31&l||2&e&&32&l)&&Object.defineProperty(o,n,{get(){return((n,t)=>W(this).C.get(t))(0,n)},set(e){((n,t,e,l)=>{const o=W(n),s=o.C.get(t),c=o.i,r=o.m;e=((n,t)=>null==n||i(n)?n:2&t?parseFloat(n):n)(e,l.M[t][0]),8&c&&void 0!==s||e===s||Number.isNaN(s)&&Number.isNaN(e)||(o.C.set(t,e),r&&2==(18&c)&&S(o,!1))})(this,n,e,t)},configurable:!0,enumerable:!0})})),1&e){const e=new Map;o.attributeChangedCallback=function(n,l,s){J.jmp((()=>{var i;const c=e.get(n);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(o.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const e=W(this),o=null==e?void 0:e.i;if(o&&!(8&o)&&128&o&&s!==l){const o=e.m,c=null===(i=t.P)||void 0===i?void 0:i[n];null==c||c.forEach((t=>{null!=o[t]&&o[t].call(o,s,l,n)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},n.observedAttributes=Array.from(new Set([...Object.keys(null!==(l=t.P)&&void 0!==l?l:{}),...s.filter((([n,t])=>15&t[0])).map((([n,t])=>{const l=t[1]||n;return e.set(l,n),l}))]))}}return n},T=n=>{E(n,"disconnectedCallback")},F=(n,t={})=>{var e;const l=[],s=t.exclude||[],i=G.customElements,r=I.head,u=r.querySelector("meta[charset]"),a=I.createElement("style"),f=[];let y,h=!0;Object.assign(J,t),J.A=new URL(t.resourcesUrl||"./",I.baseURI).href;let p=!1;if(n.map((n=>{n[1].map((t=>{const e={i:t[0],p:t[1],M:t[2],L:t[3]};4&e.i&&(p=!0),e.M=t[2];const o=e.p,c=class extends HTMLElement{constructor(n){super(n),D(n=this,e),1&e.i&&n.attachShadow({mode:"open"})}connectedCallback(){y&&(clearTimeout(y),y=null),h?f.push(this):J.jmp((()=>(n=>{if(0==(1&J.i)){const t=W(n),e=t.j,l=()=>{};if(1&t.i)(null==t?void 0:t.m)||(null==t?void 0:t.N)&&t.N.then((()=>{}));else{t.i|=1;{let e=n;for(;e=e.parentNode||e.host;)if(e["s-p"]){j(t,t.$=e);break}}e.M&&Object.entries(e.M).map((([t,[e]])=>{if(31&e&&n.hasOwnProperty(t)){const e=n[t];delete n[t],n[t]=e}})),(async(n,t,e)=>{let l;if(0==(32&t.i)){t.i|=32;{if(l=z(e),l.then){const n=()=>{};l=await l,n()}l.isProxied||(N(l,e,2),l.isProxied=!0);const n=()=>{};t.i|=8;try{new l(t)}catch(n){V(n)}t.i&=-9,n()}if(l.style){let n=l.style;const t=d(e);if(!B.has(t)){const l=()=>{};((n,t,e)=>{let l=B.get(n);Q&&e?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,B.set(n,l)})(t,n,!!(1&e.i)),l()}}}const o=t.$,s=()=>S(t,!0);o&&o["s-rc"]?o["s-rc"].push(s):s()})(0,t,e)}l()}})(this)))}disconnectedCallback(){J.jmp((()=>(async()=>{if(0==(1&J.i)){const n=W(this);(null==n?void 0:n.m)?T(n.m):(null==n?void 0:n.N)&&n.N.then((()=>T(n.m)))}})()))}componentOnReady(){return W(this).N}};e.T=n[0],s.includes(o)||i.get(o)||(l.push(o),i.define(o,N(c,e,1)))}))})),p&&(a.innerHTML+=o),a.innerHTML+=l+"{visibility:hidden}.hydrated{visibility:inherit}",a.innerHTML.length){a.setAttribute("data-styles","");const n=null!==(e=J.S)&&void 0!==e?e:c(I);null!=n&&a.setAttribute("nonce",n),r.insertBefore(a,u?u.nextSibling:r.firstChild)}h=!1,f.length?f.map((n=>n.connectedCallback())):J.jmp((()=>y=setTimeout(A,30)))},R=n=>J.S=n,U=new WeakMap,W=n=>U.get(n),q=(n,t)=>U.set(t.m=n,t),D=(n,t)=>{const e={i:0,$hostElement$:n,j:t,C:new Map};return e.N=new Promise((n=>e.k=n)),n["s-p"]=[],n["s-rc"]=[],U.set(n,e)},H=(n,t)=>t in n,V=(n,t)=>(0,console.error)(n,t),_=new Map,z=n=>{const t=n.p.replace(/-/g,"_"),e=n.T,l=_.get(e);return l?l[t]:import(`./${e}.entry.js`).then((n=>(_.set(e,n),n[t])),V)
2
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},B=new Map,G="undefined"!=typeof window?window:{},I=G.document||{head:{}},J={i:0,A:"",jmp:n=>n(),raf:n=>requestAnimationFrame(n),ael:(n,t,e,l)=>n.addEventListener(t,e,l),rel:(n,t,e,l)=>n.removeEventListener(t,e,l),ce:(n,t)=>new CustomEvent(n,t)},K=n=>Promise.resolve(n),Q=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(n){}return!1})(),X=[],Y=[],Z=(n,t)=>e=>{n.push(e),l||(l=!0,t&&4&J.i?en(tn):J.raf(tn))},nn=n=>{for(let t=0;t<n.length;t++)try{n[t](performance.now())}catch(n){V(n)}n.length=0},tn=()=>{nn(X),nn(Y),(l=X.length>0)&&J.raf(tn)},en=n=>K().then(n),ln=Z(Y,!0);export{F as b,r as h,K as p,q as r,R as s}
@@ -1 +0,0 @@
1
- import{r as t,h as e}from"./p-39f2a83a.js";const r=class{constructor(e){t(this,e),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 t=this.hour+this.timeZone;return Math.floor(this.minute/2)+30*t}minuteToDegrees(){return Math.floor(this.second/10)+6*this.minute}secondToDegrees(){return 6*this.second}render(){return e("svg",{class:"clock",viewBox:"0 0 200 200",width:this.size,height:this.size},e("circle",{id:"circle",cx:"100",cy:"100",r:"95","stroke-width":"10",fill:"transparent"}),e("line",{id:"hour",transform:`rotate(${this.hourToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"60","stroke-width":"10","stroke-linecap":"round"}),e("line",{id:"minute",transform:`rotate(${this.minuteToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"30","stroke-width":"8","stroke-linecap":"round"}),e("line",{id:"second",transform:`rotate(${this.secondToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"20","stroke-width":"2","stroke-linecap":"round"}))}};r.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{r as analog_clock}