timered-counter 1.1.1 → 1.2.0

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.
@@ -15,7 +15,7 @@ const r=globalThis,s=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow
15
15
  * Copyright 2017 Google LLC
16
16
  * SPDX-License-Identifier: BSD-3-Clause
17
17
  */
18
- const D=globalThis,P=D.trustedTypes,x=P?P.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",w=`lit$${Math.random().toFixed(9).slice(2)}$`,O="?"+w,E=`<${O}>`,M=document,N=()=>M.createComment(""),k=t=>null===t||"object"!=typeof t&&"function"!=typeof t,I=Array.isArray,R="[ \t\n\f\r]",U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,V=/>/g,j=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,H=/"/g,z=/^(?:script|style|textarea|title)$/i,F=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),Y=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),Q=new WeakMap,q=M.createTreeWalker(M,129);function K(t,e){if(!I(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==x?x.createHTML(e):e}class G{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let s=0,n=0;const o=t.length-1,a=this.parts,[l,c]=((t,e)=>{const i=t.length-1,r=[];let s,n=2===e?"<svg>":3===e?"<math>":"",o=U;for(let e=0;e<i;e++){const i=t[e];let a,l,c=-1,u=0;for(;u<i.length&&(o.lastIndex=u,l=o.exec(i),null!==l);)u=o.lastIndex,o===U?"!--"===l[1]?o=L:void 0!==l[1]?o=V:void 0!==l[2]?(z.test(l[2])&&(s=RegExp("</"+l[2],"g")),o=j):void 0!==l[3]&&(o=j):o===j?">"===l[0]?(o=s??U,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?j:'"'===l[3]?H:B):o===H||o===B?o=j:o===L||o===V?o=U:(o=j,s=void 0);const h=o===j&&t[e+1].startsWith("/>")?" ":"";n+=o===U?i+E:c>=0?(r.push(a),i.slice(0,c)+C+i.slice(c)+w+h):i+w+(-2===c?e:h)}return[K(t,n+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),r]})(t,e);if(this.el=G.createElement(l,i),q.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=q.nextNode())&&a.length<o;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(C)){const e=c[n++],i=r.getAttribute(t).split(w),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:o[2],strings:i,ctor:"."===o[1]?et:"?"===o[1]?it:"@"===o[1]?rt:tt}),r.removeAttribute(t)}else t.startsWith(w)&&(a.push({type:6,index:s}),r.removeAttribute(t));if(z.test(r.tagName)){const t=r.textContent.split(w),e=t.length-1;if(e>0){r.textContent=P?P.emptyScript:"";for(let i=0;i<e;i++)r.append(t[i],N()),q.nextNode(),a.push({type:2,index:++s});r.append(t[e],N())}}}else if(8===r.nodeType)if(r.data===O)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=r.data.indexOf(w,t+1));)a.push({type:7,index:s}),t+=w.length-1}s++}}static createElement(t,e){const i=M.createElement("template");return i.innerHTML=t,i}}function J(t,e,i=t,r){if(e===Y)return e;let s=void 0!==r?i._$Co?.[r]:i._$Cl;const n=k(e)?void 0:e._$litDirective$;return s?.constructor!==n&&(s?._$AO?.(!1),void 0===n?s=void 0:(s=new n(t),s._$AT(t,i,r)),void 0!==r?(i._$Co??=[])[r]=s:i._$Cl=s),void 0!==s&&(e=J(t,s._$AS(t,e.values),s,r)),e}let Z=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,r=(t?.creationScope??M).importNode(e,!0);q.currentNode=r;let s=q.nextNode(),n=0,o=0,a=i[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new X(s,s.nextSibling,this,t):1===a.type?e=new a.ctor(s,a.name,a.strings,this,t):6===a.type&&(e=new st(s,this,t)),this._$AV.push(e),a=i[++o]}n!==a?.index&&(s=q.nextNode(),n++)}return q.currentNode=M,r}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}};class X{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=W,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=J(this,t,e),k(t)?t===W||null==t||""===t?(this._$AH!==W&&this._$AR(),this._$AH=W):t!==this._$AH&&t!==Y&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>I(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==W&&k(this._$AH)?this._$AA.nextSibling.data=t:this.T(M.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=G.createElement(K(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{const t=new Z(r,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=Q.get(t.strings);return void 0===e&&Q.set(t.strings,e=new G(t)),e}k(t){I(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const s of t)r===e.length?e.push(i=new X(this.O(N()),this.O(N()),this,this.options)):i=e[r],i._$AI(s),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}let tt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,s){this.type=1,this._$AH=W,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=W}_$AI(t,e=this,i,r){const s=this.strings;let n=!1;if(void 0===s)t=J(this,t,e,0),n=!k(t)||t!==this._$AH&&t!==Y,n&&(this._$AH=t);else{const r=t;let o,a;for(t=s[0],o=0;o<s.length-1;o++)a=J(this,r[i+o],e,o),a===Y&&(a=this._$AH[o]),n||=!k(a)||a!==this._$AH[o],a===W?t=W:t!==W&&(t+=(a??"")+s[o+1]),this._$AH[o]=a}n&&!r&&this.j(t)}j(t){t===W?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}};class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===W?void 0:t}}class it extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==W)}}class rt extends tt{constructor(t,e,i,r,s){super(t,e,i,r,s),this.type=5}_$AI(t,e=this){if((t=J(this,t,e,0)??W)===Y)return;const i=this._$AH,r=t===W&&i!==W||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,s=t!==W&&(i===W||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class st{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){J(this,t)}}const nt={I:X},ot=D.litHtmlPolyfillSupport;ot?.(G,X),(D.litHtmlVersions??=[]).push("3.2.1");
18
+ const P=globalThis,D=P.trustedTypes,x=D?D.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",w=`lit$${Math.random().toFixed(9).slice(2)}$`,O="?"+w,E=`<${O}>`,M=document,N=()=>M.createComment(""),k=t=>null===t||"object"!=typeof t&&"function"!=typeof t,I=Array.isArray,R="[ \t\n\f\r]",U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,V=/>/g,j=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,H=/"/g,z=/^(?:script|style|textarea|title)$/i,F=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),Y=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),Q=new WeakMap,q=M.createTreeWalker(M,129);function K(t,e){if(!I(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==x?x.createHTML(e):e}class G{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let s=0,n=0;const o=t.length-1,a=this.parts,[l,c]=((t,e)=>{const i=t.length-1,r=[];let s,n=2===e?"<svg>":3===e?"<math>":"",o=U;for(let e=0;e<i;e++){const i=t[e];let a,l,c=-1,u=0;for(;u<i.length&&(o.lastIndex=u,l=o.exec(i),null!==l);)u=o.lastIndex,o===U?"!--"===l[1]?o=L:void 0!==l[1]?o=V:void 0!==l[2]?(z.test(l[2])&&(s=RegExp("</"+l[2],"g")),o=j):void 0!==l[3]&&(o=j):o===j?">"===l[0]?(o=s??U,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?j:'"'===l[3]?H:B):o===H||o===B?o=j:o===L||o===V?o=U:(o=j,s=void 0);const h=o===j&&t[e+1].startsWith("/>")?" ":"";n+=o===U?i+E:c>=0?(r.push(a),i.slice(0,c)+C+i.slice(c)+w+h):i+w+(-2===c?e:h)}return[K(t,n+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),r]})(t,e);if(this.el=G.createElement(l,i),q.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=q.nextNode())&&a.length<o;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(C)){const e=c[n++],i=r.getAttribute(t).split(w),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:o[2],strings:i,ctor:"."===o[1]?et:"?"===o[1]?it:"@"===o[1]?rt:tt}),r.removeAttribute(t)}else t.startsWith(w)&&(a.push({type:6,index:s}),r.removeAttribute(t));if(z.test(r.tagName)){const t=r.textContent.split(w),e=t.length-1;if(e>0){r.textContent=D?D.emptyScript:"";for(let i=0;i<e;i++)r.append(t[i],N()),q.nextNode(),a.push({type:2,index:++s});r.append(t[e],N())}}}else if(8===r.nodeType)if(r.data===O)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=r.data.indexOf(w,t+1));)a.push({type:7,index:s}),t+=w.length-1}s++}}static createElement(t,e){const i=M.createElement("template");return i.innerHTML=t,i}}function J(t,e,i=t,r){if(e===Y)return e;let s=void 0!==r?i._$Co?.[r]:i._$Cl;const n=k(e)?void 0:e._$litDirective$;return s?.constructor!==n&&(s?._$AO?.(!1),void 0===n?s=void 0:(s=new n(t),s._$AT(t,i,r)),void 0!==r?(i._$Co??=[])[r]=s:i._$Cl=s),void 0!==s&&(e=J(t,s._$AS(t,e.values),s,r)),e}let Z=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,r=(t?.creationScope??M).importNode(e,!0);q.currentNode=r;let s=q.nextNode(),n=0,o=0,a=i[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new X(s,s.nextSibling,this,t):1===a.type?e=new a.ctor(s,a.name,a.strings,this,t):6===a.type&&(e=new st(s,this,t)),this._$AV.push(e),a=i[++o]}n!==a?.index&&(s=q.nextNode(),n++)}return q.currentNode=M,r}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}};class X{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=W,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=J(this,t,e),k(t)?t===W||null==t||""===t?(this._$AH!==W&&this._$AR(),this._$AH=W):t!==this._$AH&&t!==Y&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>I(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==W&&k(this._$AH)?this._$AA.nextSibling.data=t:this.T(M.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=G.createElement(K(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{const t=new Z(r,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=Q.get(t.strings);return void 0===e&&Q.set(t.strings,e=new G(t)),e}k(t){I(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const s of t)r===e.length?e.push(i=new X(this.O(N()),this.O(N()),this,this.options)):i=e[r],i._$AI(s),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}let tt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,s){this.type=1,this._$AH=W,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=W}_$AI(t,e=this,i,r){const s=this.strings;let n=!1;if(void 0===s)t=J(this,t,e,0),n=!k(t)||t!==this._$AH&&t!==Y,n&&(this._$AH=t);else{const r=t;let o,a;for(t=s[0],o=0;o<s.length-1;o++)a=J(this,r[i+o],e,o),a===Y&&(a=this._$AH[o]),n||=!k(a)||a!==this._$AH[o],a===W?t=W:t!==W&&(t+=(a??"")+s[o+1]),this._$AH[o]=a}n&&!r&&this.j(t)}j(t){t===W?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}};class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===W?void 0:t}}class it extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==W)}}class rt extends tt{constructor(t,e,i,r,s){super(t,e,i,r,s),this.type=5}_$AI(t,e=this){if((t=J(this,t,e,0)??W)===Y)return;const i=this._$AH,r=t===W&&i!==W||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,s=t!==W&&(i===W||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class st{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){J(this,t)}}const nt={I:X},ot=P.litHtmlPolyfillSupport;ot?.(G,X),(P.litHtmlVersions??=[]).push("3.2.1");
19
19
  /**
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
@@ -58,12 +58,12 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
58
58
  * @license
59
59
  * Copyright 2020 Google LLC
60
60
  * SPDX-License-Identifier: BSD-3-Clause
61
- */const{I:At}=nt,bt=()=>document.createComment(""),$t=(t,e,i)=>{const r=t._$AA.parentNode,s=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=r.insertBefore(bt(),s),n=r.insertBefore(bt(),s);i=new At(e,n,t,t.options)}else{const e=i._$AB.nextSibling,n=i._$AM,o=n!==t;if(o){let e;i._$AQ?.(t),i._$AM=t,void 0!==i._$AP&&(e=t._$AU)!==n._$AU&&i._$AP(e)}if(e!==s||o){let t=i._$AA;for(;t!==e;){const e=t.nextSibling;r.insertBefore(t,s),t=e}}}return i},vt=(t,e,i=t)=>(t._$AI(e,i),t),St={},Tt=t=>{t._$AP?.(!1,!0);let e=t._$AA;const i=t._$AB.nextSibling;for(;e!==i;){const t=e.nextSibling;e.remove(),e=t}},Dt=(t,e,i)=>{const r=new Map;for(let s=e;s<=i;s++)r.set(t[s],s);return r},Pt=_t(class extends gt{constructor(t){if(super(t),t.type!==yt)throw Error("repeat() can only be used in text expressions")}dt(t,e,i){let r;void 0===i?i=e:void 0!==e&&(r=e);const s=[],n=[];let o=0;for(const e of t)s[o]=r?r(e,o):o,n[o]=i(e,o),o++;return{values:n,keys:s}}render(t,e,i){return this.dt(t,e,i).values}update(t,[e,i,r]){const s=(t=>t._$AH)(t),{values:n,keys:o}=this.dt(e,i,r);if(!Array.isArray(s))return this.ut=o,n;const a=this.ut??=[],l=[];let c,u,h=0,p=s.length-1,d=0,f=n.length-1;for(;h<=p&&d<=f;)if(null===s[h])h++;else if(null===s[p])p--;else if(a[h]===o[d])l[d]=vt(s[h],n[d]),h++,d++;else if(a[p]===o[f])l[f]=vt(s[p],n[f]),p--,f--;else if(a[h]===o[f])l[f]=vt(s[h],n[f]),$t(t,l[f+1],s[h]),h++,f--;else if(a[p]===o[d])l[d]=vt(s[p],n[d]),$t(t,s[h],s[p]),p--,d++;else if(void 0===c&&(c=Dt(o,d,f),u=Dt(a,h,p)),c.has(a[h]))if(c.has(a[p])){const e=u.get(o[d]),i=void 0!==e?s[e]:null;if(null===i){const e=$t(t,s[h]);vt(e,n[d]),l[d]=e}else l[d]=vt(i,n[d]),$t(t,s[h],i),s[e]=null;d++}else Tt(s[p]),p--;else Tt(s[h]),h++;for(;d<=f;){const e=$t(t,l[f+1]);vt(e,n[d]),l[d++]=e}for(;h<=p;){const t=s[h++];null!==t&&Tt(t)}return this.ut=o,((t,e=St)=>{t._$AH=e})(t,l),Y}});
61
+ */const{I:At}=nt,bt=()=>document.createComment(""),$t=(t,e,i)=>{const r=t._$AA.parentNode,s=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=r.insertBefore(bt(),s),n=r.insertBefore(bt(),s);i=new At(e,n,t,t.options)}else{const e=i._$AB.nextSibling,n=i._$AM,o=n!==t;if(o){let e;i._$AQ?.(t),i._$AM=t,void 0!==i._$AP&&(e=t._$AU)!==n._$AU&&i._$AP(e)}if(e!==s||o){let t=i._$AA;for(;t!==e;){const e=t.nextSibling;r.insertBefore(t,s),t=e}}}return i},vt=(t,e,i=t)=>(t._$AI(e,i),t),St={},Tt=t=>{t._$AP?.(!1,!0);let e=t._$AA;const i=t._$AB.nextSibling;for(;e!==i;){const t=e.nextSibling;e.remove(),e=t}},Pt=(t,e,i)=>{const r=new Map;for(let s=e;s<=i;s++)r.set(t[s],s);return r},Dt=_t(class extends gt{constructor(t){if(super(t),t.type!==yt)throw Error("repeat() can only be used in text expressions")}dt(t,e,i){let r;void 0===i?i=e:void 0!==e&&(r=e);const s=[],n=[];let o=0;for(const e of t)s[o]=r?r(e,o):o,n[o]=i(e,o),o++;return{values:n,keys:s}}render(t,e,i){return this.dt(t,e,i).values}update(t,[e,i,r]){const s=(t=>t._$AH)(t),{values:n,keys:o}=this.dt(e,i,r);if(!Array.isArray(s))return this.ut=o,n;const a=this.ut??=[],l=[];let c,u,h=0,p=s.length-1,d=0,f=n.length-1;for(;h<=p&&d<=f;)if(null===s[h])h++;else if(null===s[p])p--;else if(a[h]===o[d])l[d]=vt(s[h],n[d]),h++,d++;else if(a[p]===o[f])l[f]=vt(s[p],n[f]),p--,f--;else if(a[h]===o[f])l[f]=vt(s[h],n[f]),$t(t,l[f+1],s[h]),h++,f--;else if(a[p]===o[d])l[d]=vt(s[p],n[d]),$t(t,s[h],s[p]),p--,d++;else if(void 0===c&&(c=Pt(o,d,f),u=Pt(a,h,p)),c.has(a[h]))if(c.has(a[p])){const e=u.get(o[d]),i=void 0!==e?s[e]:null;if(null===i){const e=$t(t,s[h]);vt(e,n[d]),l[d]=e}else l[d]=vt(i,n[d]),$t(t,s[h],i),s[e]=null;d++}else Tt(s[p]),p--;else Tt(s[h]),h++;for(;d<=f;){const e=$t(t,l[f+1]);vt(e,n[d]),l[d++]=e}for(;h<=p;){const t=s[h++];null!==t&&Tt(t)}return this.ut=o,((t,e=St)=>{t._$AH=e})(t,l),Y}});
62
62
  /**
63
63
  * @license
64
64
  * Copyright 2017 Google LLC
65
65
  * SPDX-License-Identifier: BSD-3-Clause
66
- */var xt={done:!0,hasNext:!1},Ct={done:!1,hasNext:!1},wt=()=>xt;function Ot(t,...e){let i=t,r=e.map((t=>"lazy"in t?function(t){let{lazy:e,lazyArgs:i}=t,r=e(...i);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}(t):void 0)),s=0;for(;s<e.length;){if(void 0===r[s]||!Mt(i)){i=(0,e[s])(i),s+=1;continue}let t=[];for(let i=s;i<e.length;i++){let e=r[i];if(void 0===e||(t.push(e),e.isSingle))break}let n=[];for(let e of i)if(Et(e,n,t))break;let{isSingle:o}=t.at(-1);i=o?n[0]:n,s+=t.length}return i}function Et(t,e,i){if(0===i.length)return e.push(t),!1;let r=t,s=Ct,n=!1;for(let[t,o]of i.entries()){let{index:a,items:l}=o;if(l.push(r),s=o(r,a,l),o.index+=1,s.hasNext){if(s.hasMany){for(let r of s.next)if(Et(r,e,i.slice(t+1)))return!0;return n}r=s.next}if(!s.hasNext)break;s.done&&(n=!0)}return s.hasNext&&e.push(r),n}function Mt(t){return"string"==typeof t||"object"==typeof t&&null!==t&&Symbol.iterator in t}function Nt(t,e,i){let r=t.length-e.length;if(0===r)return t(...e);if(1===r)return function(t,e,i){let r=i=>t(i,...e);return void 0===i?r:Object.assign(r,{lazy:i,lazyArgs:e})}(t,e,i);throw new Error("Wrong number of arguments")}function kt(...t){return Nt(It,t)}var It=(t,e)=>t.length>=e;function Rt(t,e){let i=[];for(let r=t;r<e;r++)i.push(r);return i}function Ut(t,e){if(!kt(e,1))return{...t};if(!kt(e,2)){let{[e[0]]:i,...r}=t;return r}let i={...t};for(let t of e)delete i[t];return i}function Lt(...t){return Nt(Vt,t)}var Vt=(t,e)=>({...t,...e});function jt(...t){return Nt(Bt,t,Ht)}var Bt=(t,e)=>t.map(e),Ht=t=>(e,i,r)=>({done:!1,hasNext:!0,next:t(e,i,r)});function zt(t){return"number"==typeof t&&!Number.isNaN(t)}function Ft(t){return"string"==typeof t}function Yt(t){return void 0===t||("string"==typeof t||Array.isArray(t)?0===t.length:0===Object.keys(t).length)}function Wt(t){return null==t}function Qt(t){return Array.isArray(t)}function qt(t){return"boolean"==typeof t}function Kt(t){return t instanceof Date}function Gt(...t){return Nt(Jt,t)}function Jt(t,e){if(t===e||Object.is(t,e))return!0;if("object"!=typeof t||"object"!=typeof e||null===t||null===e||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;if(Array.isArray(t))return function(t,e){if(t.length!==e.length)return!1;for(let[i,r]of t.entries())if(!Jt(r,e[i]))return!1;return!0}(t,e);if(t instanceof Map)return function(t,e){if(t.size!==e.size)return!1;for(let[i,r]of t.entries())if(!e.has(i)||!Jt(r,e.get(i)))return!1;return!0}(t,e);if(t instanceof Set)return function(t,e){if(t.size!==e.size)return!1;let i=[...e];for(let e of t){let t=!1;for(let[r,s]of i.entries())if(Jt(e,s)){t=!0,i.splice(r,1);break}if(!t)return!1}return!0}(t,e);if(t instanceof Date)return t.getTime()===e.getTime();if(t instanceof RegExp)return t.toString()===e.toString();if(Object.keys(t).length!==Object.keys(e).length)return!1;for(let[i,r]of Object.entries(t))if(!(i in e)||!Jt(r,e[i]))return!1;return!0}function Zt(...t){return function(t,e){let i=e.length-t.length;if(1===i){let[i,...r]=e;return Ot(i,{lazy:t,lazyArgs:r})}if(0===i){let i={lazy:t,lazyArgs:e};return Object.assign((t=>Ot(t,i)),i)}throw new Error("Wrong number of arguments")}(Xt,t)}function Xt(t){if(0===t.length)return wt;let e=new Map;for(let i of t)e.set(i,(e.get(i)??0)+1);return t=>{let i=e.get(t);return void 0===i||0===i?Ct:(1===i?e.delete(t):e.set(t,i-1),{hasNext:!0,next:t,done:0===e.size})}}function te(t,e){const i=function(t,e){return function(t){return"function"==typeof t}(t)?t(e):t}(t,e),{data:r}=e,s=[];for(let t=0;t<r.length;t+=1){const e=Qt(i)?i[t]:i;s.push(e)}return s}function ee(t,e){const i=te(t,e),{data:r}=e,s=[];for(let t=0;t<r.length;t+=1){const{digits:e}=r[t],n=i[t];s.push([]);for(let i=0;i<e.length;i+=1){const e=Qt(n)?n[i]:n;s[t].push(e)}}return s}function ie(t,e){const i=ee(t,e),{data:r}=e,s=[];for(let t=0;t<r.length;t+=1){const{digits:e}=r[t],n=i[t];s.push([]);for(let i=0;i<e.length;i+=1){const{data:r}=e[i],o=n[i];s[t].push([]);for(let e=0;e<r.length;e+=1){const r=Qt(o)?o[e]:o;s[t][i].push(r)}}}return s}function re(t,e){return Lt(t??{},e??{})}function se(t=[],e=[]){const i=Array.from(new Set(Object.keys(t).concat(Object.keys(e))));for(const r of i){const i=Number.parseInt(r,10);t[i]=re(t[i],e[i])}return t}function ne(t=[],e=[]){const i=Array.from(new Set(Object.keys(t).concat(Object.keys(e))));for(const r of i){const i=Number.parseInt(r,10);t[i]=se(t[i],e[i])}return t}const oe=t=>{class i extends t{constructor(){super(...arguments),this.cellStyles={},this.cachedCellStyles=[],this.digitStyles={},this.cachedDigitStyles=[],this.partStyles={},this.cachedPartStyles=[],this.color="inherit"}extractCellStyles(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=function(t=[],e=[]){const i=Array.from(new Set(Object.keys(t).concat(Object.keys(e))));for(const r of i){const i=Number.parseInt(r,10);t[i]=ne(t[i],e[i])}return t}(ie(this.cellStyles??{},t),ie(this.cellStylesDynamic??{},t));return Gt(this.cachedCellStyles,e)||(this.cachedCellStyles=e),this.cachedCellStyles}extractDigitStyles(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=ne(ee(this.digitStyles??{},t),ee(this.digitStylesDynamic??{},t));return Gt(this.cachedDigitStyles,e)||(this.cachedDigitStyles=e),this.cachedDigitStyles}extractPartStyles(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=se(te(this.partStyles??{},t),te(this.partStylesDynamic??{},t));return Gt(this.cachedPartStyles,e)||(this.cachedPartStyles=e),this.cachedPartStyles}}return e([pt({type:Object,attribute:"cell-styles",reflect:!0})],i.prototype,"cellStyles",void 0),e([pt({type:Object,attribute:"digit-styles",reflect:!0})],i.prototype,"digitStyles",void 0),e([pt({type:Object,attribute:"part-styles",reflect:!0})],i.prototype,"partStyles",void 0),e([pt({type:String,reflect:!0})],i.prototype,"color",void 0),i};function ae(t){return t.length}function le(){return function(t){if(!(s=t.length))return[];for(var e=-1,i=function(t,e){let i;if(void 0===e)for(const e of t)null!=e&&(i>e||void 0===i&&e>=e)&&(i=e);else{let r=-1;for(let s of t)null!=(s=e(s,++r,t))&&(i>s||void 0===i&&s>=s)&&(i=s)}return i}(t,ae),r=new Array(i);++e<i;)for(var s,n=-1,o=r[e]=new Array(s);++n<s;)o[n]=t[n][e];return r}(arguments)}function ce(t,e){const[i,r]=t,[s,n]=e,o={animate:!0,cancelPrevAnimation:!1};let a="";return 1===s.data.length&&(o.animate=!1,o.cancelPrevAnimation=!0,a="only one digit"),i!==r||(s.data[0]===s.data[s.data.length-1]&&(o.animate=!1,o.cancelPrevAnimation=!0,a="same head and tail"),Gt(s,n)&&(o.animate=!1,a="same digits"),a&&(o.earlyReturn=a)),o}function ue(t){try{return JSON.parse(t)}catch(e){return t}}function he(t){const e={};return Qt(t.digitToChar)?t.digitToChar.forEach(((t,i)=>{var r;e[(r=i,String.fromCodePoint(r+48))]=t})):function(t){return"object"==typeof t&&null!==t}(t.digitToChar)&&Object.entries(t.digitToChar).forEach((([t,i])=>{e[t]=i})),{...t,digitToChar:e}}const pe=t=>{var r,s;class n extends t{constructor(){super(...arguments),s.set(this,{...r.DEFAULT_PARTS_OPTIONS}),this.parts=[],this.oldParts=[],this.partPreprocessDataList=[]}get partsOptions(){return i(this,s,"f")}set partsOptions(t){const e=i(this,s,"f");!function(t,e,i,r,s){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?s.call(t,i):s?s.value=i:e.set(t,i)}(this,s,he({...r.DEFAULT_PARTS_OPTIONS,...t}),"f"),this.requestUpdate("partsOptions",e)}sampling(t,e){return function(t,e,i,r){let s=r;const n=t.isInteger(e)&&t.isInteger(i)?function(t,e,i){return function(r){return t.round(t.add(t.mul(e,t.sub(t.create(1),r)),t.mul(i,r)))}}(t,e,i):function(t,e,i){return function(r){return t.add(t.mul(e,t.sub(t.create(1),r)),t.mul(i,r))}}(t,e,i);t.eq(e,i)&&(s=1);const o=[];for(let e=0;e<s;e++){const i=t.div(t.create(e),t.create(Math.max(s-1,1)));o.push(n(i))}return o}(this.numberAdapter,this.numberAdapter.max(t,e),this.numberAdapter.min(t,e),this.partsOptions.sampleCount)}sampleSplit(t){return[t.slice()]}sampleToString(t){return this.numberAdapter.toString(t)}willUpdate(t){super.willUpdate(t),t.has("value")&&(this.oldParts=this.parts),(t.has("value")||t.has("partsOptions"))&&(this.parts=this.processPartData()),t.has("value")&&(this.partPreprocessDataList=function(t,e,i,r){const s=[];let n=0;for(let o=0;o<e.length;o++){const a=e[o],l=r?.[o],c=[];for(let e=0;e<a.digits.length;e++){const r=a.digits[e],s=l?.digits.find((t=>t.place===r.place));c.push({...ce([t,i],[r,s]),index:n++,partIndex:o,digitIndex:e})}s.push(c)}return s}(this.direction,this.parts,this.oldDirection,this.oldParts))}processPartData(){const{decimalSeparator:t,digitToChar:e,minPlaces:i,fillChar:r,type:s}=this.partsOptions,n=this.value,o=this.oldValue;let a=e=>this.sampleToString(e).split(t);"string"===s&&(a=t=>[this.sampleToString(t),""]);const l=[],c=this.sampleSplit(this.sampling(n,o));{const s=this.numberAdapter.gt(n,o)?"down":"up";for(let n=0;n<c.length;n++){const o=c[n],u=o["down"===s?0:o.length-1],[h=1,p=0]=i,d=a(u),f=Math.max(this.stringAdapter.stringToChars(d[0]).length,h),m=Math.max(this.stringAdapter.stringToChars(d[1]??"").length,p),y=le(...o.map((e=>{const[i="",s=""]=a(e),n=this.stringAdapter.stringToChars(i),o=this.stringAdapter.stringToChars(s),l=Math.max(f-n.length,0),c=Math.max(m-o.length,0);let u=[].concat(new Array(l).fill(r),n);return m>0&&(u=u.concat([t],o,new Array(c).fill(r))),u}))).map(((t,i,r)=>({data:t.filter(((t,e,i)=>0===e||t!==i[e-1])).map((t=>e[t]??t)),place:r.length-i})));l.push({digits:y})}}return l}}return r=n,s=new WeakMap,n.DEFAULT_PARTS_OPTIONS={sampleCount:16,decimalSeparator:".",fillChar:"0",minPlaces:[1,0],digitToChar:{},type:"number"},e([pt({type:Object,attribute:"parts-options",converter:t=>ue(t??"")??{},noAccessor:!0})],n.prototype,"partsOptions",null),n},de=()=>({create(t){const e=Number(t);return Number.isFinite(e)?e:0},add:(t,e)=>t+e,sub:(t,e)=>t-e,mul:(t,e)=>t*e,div:(t,e)=>t/e,compare:(t,e)=>t>e?1:t<e?-1:0,eq:(t,e)=>t===e,gt:(t,e)=>t>e,gte:(t,e)=>t>=e,lt:(t,e)=>t<e,lte:(t,e)=>t<=e,isInteger:t=>Number.isInteger(t),isNegative:t=>t<0,isPositive:t=>t>0,isZero:t=>0===t,isNaN:t=>Number.isNaN(t),isFinite:t=>Number.isFinite(t),abs:t=>Math.abs(t),ceil:t=>Math.ceil(t),floor:t=>Math.floor(t),round:t=>Math.round(t),max:(t,e)=>Math.max(t,e),min:(t,e)=>Math.min(t,e),toNumber:t=>Number(t),toString:t=>String(t)}),fe=()=>({stringToChars:t=>Array.from(t)});class me{static setNumberAdapter(t){let e=de();if(Ft(t)){for(const[i,r]of me.AVAILABLE_NUMBER_ADAPTERS)if(i.includes(t)){e=r();break}}else e=t;me.NUMBER_ADAPTER=e}static setStringAdapter(t){let e=fe();if(Ft(t)){for(const[i,r]of me.AVAILABLE_STRING_ADAPTERS)if(i.includes(t)){e=r();break}}else e=t;me.STRING_ADAPTER=e}static registerNumberAdapter(t,e){me.AVAILABLE_NUMBER_ADAPTERS.set(t,e)}static registerStringAdapter(t,e){me.AVAILABLE_STRING_ADAPTERS.set(t,e)}static registryAdapter(t){t.register(this)}}me.AVAILABLE_NUMBER_ADAPTERS=new Map([[["number"],de]]),me.AVAILABLE_STRING_ADAPTERS=new Map([[["string"],fe],[["intl-segmenter"],t=>{const e=new Intl.Segmenter(t,{granularity:"grapheme"});return{stringToChars:t=>Array.from(e.segment(t)).map((t=>t.segment))}}]]),me.NUMBER_ADAPTER=de(),me.STRING_ADAPTER=fe(),me.VALUE_CONVERTER={fromAttribute:t=>t,toAttribute:t=>Wt(t)?t:me.NUMBER_ADAPTER.toString(t)};const ye=t=>{class i extends t{get value(){return this.numberAdapter.create(this.__value)}set value(t){t=me.NUMBER_ADAPTER.create(Wt(t)||Ft(t)&&""===t.trim()?0:t);const e=this.__value;this.__value=t,this.numberAdapter.eq(this.__value,e)||this.requestUpdate("value",e)}get oldValue(){return this.numberAdapter.create(this.__oldValue)}set oldValue(t){const e=this.__oldValue;this.__oldValue=t,this.requestUpdate("oldValue",e)}get initialValue(){return Wt(this.__initialValue)?this.__initialValue:this.numberAdapter.create(this.__initialValue)}set initialValue(t){const e=this.__initialValue;this.__initialValue=t,this.requestUpdate("initialValue",e)}get locale(){return this.__locale}set locale(t){const e=this.__locale;this.__locale=t,this.requestUpdate("locale",e),this.localeInstance=Ft(this.__locale)?new Intl.Locale(this.__locale):new Intl.Locale(...this.__locale)}constructor(...t){super(...t),this.__value=me.NUMBER_ADAPTER.create(0),this.__oldValue=me.NUMBER_ADAPTER.create(0),this.__initialValue=null,this.__locale="en-US",this.localeInstance=Ft(this.locale)?new Intl.Locale(this.locale):new Intl.Locale(...this.locale),this.direction="up",this.oldDirection=this.direction,this.numberAdapter=me.NUMBER_ADAPTER,this.stringAdapter=me.STRING_ADAPTER}willUpdate(t){super.willUpdate(t),t.has("value")&&!t.has("oldValue")&&(this.oldValue=t.get("value")??this.value),this.oldDirection=this.direction,this.numberAdapter.eq(this.value,this.oldValue)||(this.direction=this.numberAdapter.gt(this.value,this.oldValue)?"down":"up")}connectedCallback(){super.connectedCallback(),this.oldValue=function(t){return null!=t}(this.initialValue)?this.initialValue:this.value}}return e([pt({attribute:"value",reflect:!0,converter:{toAttribute:me.VALUE_CONVERTER.toAttribute},noAccessor:!0})],i.prototype,"value",null),e([pt({attribute:"old-value",reflect:!0,converter:me.VALUE_CONVERTER,noAccessor:!0})],i.prototype,"oldValue",null),e([pt({attribute:"initial-value",reflect:!0,converter:me.VALUE_CONVERTER,noAccessor:!0})],i.prototype,"initialValue",null),e([pt({converter:t=>{if(Wt(t))return t;try{return JSON.parse(t)}catch(e){return t}},reflect:!0,noAccessor:!0})],i.prototype,"locale",null),e([dt()],i.prototype,"direction",void 0),e([dt()],i.prototype,"oldDirection",void 0),i},_e=l`
66
+ */var xt={done:!0,hasNext:!1},Ct={done:!1,hasNext:!1},wt=()=>xt;function Ot(t,...e){let i=t,r=e.map((t=>"lazy"in t?function(t){let{lazy:e,lazyArgs:i}=t,r=e(...i);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}(t):void 0)),s=0;for(;s<e.length;){if(void 0===r[s]||!Mt(i)){i=(0,e[s])(i),s+=1;continue}let t=[];for(let i=s;i<e.length;i++){let e=r[i];if(void 0===e||(t.push(e),e.isSingle))break}let n=[];for(let e of i)if(Et(e,n,t))break;let{isSingle:o}=t.at(-1);i=o?n[0]:n,s+=t.length}return i}function Et(t,e,i){if(0===i.length)return e.push(t),!1;let r=t,s=Ct,n=!1;for(let[t,o]of i.entries()){let{index:a,items:l}=o;if(l.push(r),s=o(r,a,l),o.index+=1,s.hasNext){if(s.hasMany){for(let r of s.next)if(Et(r,e,i.slice(t+1)))return!0;return n}r=s.next}if(!s.hasNext)break;s.done&&(n=!0)}return s.hasNext&&e.push(r),n}function Mt(t){return"string"==typeof t||"object"==typeof t&&null!==t&&Symbol.iterator in t}function Nt(t,e,i){let r=t.length-e.length;if(0===r)return t(...e);if(1===r)return function(t,e,i){let r=i=>t(i,...e);return void 0===i?r:Object.assign(r,{lazy:i,lazyArgs:e})}(t,e,i);throw new Error("Wrong number of arguments")}function kt(...t){return Nt(It,t)}var It=(t,e)=>t.length>=e;function Rt(t,e){let i=[];for(let r=t;r<e;r++)i.push(r);return i}function Ut(t,e){if(!kt(e,1))return{...t};if(!kt(e,2)){let{[e[0]]:i,...r}=t;return r}let i={...t};for(let t of e)delete i[t];return i}function Lt(...t){return Nt(Vt,t)}var Vt=(t,e)=>({...t,...e});function jt(...t){return Nt(Bt,t,Ht)}var Bt=(t,e)=>t.map(e),Ht=t=>(e,i,r)=>({done:!1,hasNext:!0,next:t(e,i,r)});function zt(t){return"number"==typeof t&&!Number.isNaN(t)}function Ft(t){return"string"==typeof t}function Yt(t){return void 0===t||("string"==typeof t||Array.isArray(t)?0===t.length:0===Object.keys(t).length)}function Wt(t){return null==t}function Qt(t){return Array.isArray(t)}function qt(t){return"boolean"==typeof t}function Kt(t){return t instanceof Date}function Gt(...t){return Nt(Jt,t)}function Jt(t,e){if(t===e||Object.is(t,e))return!0;if("object"!=typeof t||"object"!=typeof e||null===t||null===e||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;if(Array.isArray(t))return function(t,e){if(t.length!==e.length)return!1;for(let[i,r]of t.entries())if(!Jt(r,e[i]))return!1;return!0}(t,e);if(t instanceof Map)return function(t,e){if(t.size!==e.size)return!1;for(let[i,r]of t.entries())if(!e.has(i)||!Jt(r,e.get(i)))return!1;return!0}(t,e);if(t instanceof Set)return function(t,e){if(t.size!==e.size)return!1;let i=[...e];for(let e of t){let t=!1;for(let[r,s]of i.entries())if(Jt(e,s)){t=!0,i.splice(r,1);break}if(!t)return!1}return!0}(t,e);if(t instanceof Date)return t.getTime()===e.getTime();if(t instanceof RegExp)return t.toString()===e.toString();if(Object.keys(t).length!==Object.keys(e).length)return!1;for(let[i,r]of Object.entries(t))if(!(i in e)||!Jt(r,e[i]))return!1;return!0}function Zt(...t){return function(t,e){let i=e.length-t.length;if(1===i){let[i,...r]=e;return Ot(i,{lazy:t,lazyArgs:r})}if(0===i){let i={lazy:t,lazyArgs:e};return Object.assign((t=>Ot(t,i)),i)}throw new Error("Wrong number of arguments")}(Xt,t)}function Xt(t){if(0===t.length)return wt;let e=new Map;for(let i of t)e.set(i,(e.get(i)??0)+1);return t=>{let i=e.get(t);return void 0===i||0===i?Ct:(1===i?e.delete(t):e.set(t,i-1),{hasNext:!0,next:t,done:0===e.size})}}function te(t,e){const i=function(t,e){return function(t){return"function"==typeof t}(t)?t(e):t}(t,e),{data:r}=e,s=[];for(let t=0;t<r.length;t+=1){const e=Qt(i)?i[t]:i;s.push(e)}return s}function ee(t,e){const i=te(t,e),{data:r}=e,s=[];for(let t=0;t<r.length;t+=1){const{digits:e}=r[t],n=i[t];s.push([]);for(let i=0;i<e.length;i+=1){const e=Qt(n)?n[i]:n;s[t].push(e)}}return s}function ie(t,e){const i=ee(t,e),{data:r}=e,s=[];for(let t=0;t<r.length;t+=1){const{digits:e}=r[t],n=i[t];s.push([]);for(let i=0;i<e.length;i+=1){const{data:r}=e[i],o=n[i];s[t].push([]);for(let e=0;e<r.length;e+=1){const r=Qt(o)?o[e]:o;s[t][i].push(r)}}}return s}function re(t,e){return Lt(t??{},e??{})}function se(t=[],e=[]){const i=Array.from(new Set(Object.keys(t).concat(Object.keys(e))));for(const r of i){const i=Number.parseInt(r,10);t[i]=re(t[i],e[i])}return t}function ne(t=[],e=[]){const i=Array.from(new Set(Object.keys(t).concat(Object.keys(e))));for(const r of i){const i=Number.parseInt(r,10);t[i]=se(t[i],e[i])}return t}const oe=t=>{class i extends t{constructor(){super(...arguments),this.cellStyles={},this.cachedCellStyles=[],this.digitStyles={},this.cachedDigitStyles=[],this.partStyles={},this.cachedPartStyles=[],this.color="inherit"}extractCellStyles(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=function(t=[],e=[]){const i=Array.from(new Set(Object.keys(t).concat(Object.keys(e))));for(const r of i){const i=Number.parseInt(r,10);t[i]=ne(t[i],e[i])}return t}(ie(this.cellStyles??{},t),ie(this.cellStylesDynamic??{},t));return Gt(this.cachedCellStyles,e)||(this.cachedCellStyles=e),this.cachedCellStyles}extractDigitStyles(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=ne(ee(this.digitStyles??{},t),ee(this.digitStylesDynamic??{},t));return Gt(this.cachedDigitStyles,e)||(this.cachedDigitStyles=e),this.cachedDigitStyles}extractPartStyles(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=se(te(this.partStyles??{},t),te(this.partStylesDynamic??{},t));return Gt(this.cachedPartStyles,e)||(this.cachedPartStyles=e),this.cachedPartStyles}}return e([pt({type:Object,attribute:"cell-styles",reflect:!0})],i.prototype,"cellStyles",void 0),e([pt({type:Object,attribute:"digit-styles",reflect:!0})],i.prototype,"digitStyles",void 0),e([pt({type:Object,attribute:"part-styles",reflect:!0})],i.prototype,"partStyles",void 0),e([pt({type:String,reflect:!0})],i.prototype,"color",void 0),i};function ae(t){return t.length}function le(){return function(t){if(!(s=t.length))return[];for(var e=-1,i=function(t,e){let i;if(void 0===e)for(const e of t)null!=e&&(i>e||void 0===i&&e>=e)&&(i=e);else{let r=-1;for(let s of t)null!=(s=e(s,++r,t))&&(i>s||void 0===i&&s>=s)&&(i=s)}return i}(t,ae),r=new Array(i);++e<i;)for(var s,n=-1,o=r[e]=new Array(s);++n<s;)o[n]=t[n][e];return r}(arguments)}function ce(t,e){const[i,r]=t,[s,n]=e,o={animate:!0,cancelPrevAnimation:!1};let a="";return 1===s.data.length&&(o.animate=!1,o.cancelPrevAnimation=!0,a="only one digit"),i!==r||(s.data[0]===s.data[s.data.length-1]&&(o.animate=!1,o.cancelPrevAnimation=!0,a="same head and tail"),Gt(s,n)&&(o.animate=!1,a="same digits"),a&&(o.earlyReturn=a)),o}function ue(t){try{return JSON.parse(t)}catch(e){return t}}function he(t){const e={};return Qt(t.digitToChar)?t.digitToChar.forEach(((t,i)=>{var r;e[(r=i,String.fromCodePoint(r+48))]=t})):function(t){return"object"==typeof t&&null!==t}(t.digitToChar)&&Object.entries(t.digitToChar).forEach((([t,i])=>{e[t]=i})),{...t,digitToChar:e}}const pe=t=>{var r,s;class n extends t{constructor(){super(...arguments),s.set(this,{...r.DEFAULT_PARTS_OPTIONS}),this.parts=[],this.oldParts=[],this.partPreprocessDataList=[]}get partsOptions(){return i(this,s,"f")}set partsOptions(t){const e=i(this,s,"f");!function(t,e,i,r,s){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?s.call(t,i):s?s.value=i:e.set(t,i)}(this,s,he({...r.DEFAULT_PARTS_OPTIONS,...t}),"f"),this.requestUpdate("partsOptions",e)}sampling(t,e){return function(t,e,i,r){let s=r;const n=t.isInteger(e)&&t.isInteger(i)?function(t,e,i){return function(r){return t.round(t.add(t.mul(e,t.sub(t.create(1),r)),t.mul(i,r)))}}(t,e,i):function(t,e,i){return function(r){return t.add(t.mul(e,t.sub(t.create(1),r)),t.mul(i,r))}}(t,e,i);t.eq(e,i)&&(s=1);const o=[];for(let e=0;e<s;e++){const i=t.div(t.create(e),t.create(Math.max(s-1,1)));o.push(n(i))}return o}(this.numberAdapter,this.numberAdapter.max(t,e),this.numberAdapter.min(t,e),this.partsOptions.sampleCount)}sampleSplit(t){return[t.slice()]}sampleToString(t){return this.numberAdapter.toString(t)}shouldRebuildParts(t){return t.has("value")||t.has("partsOptions")}willUpdate(t){super.willUpdate(t),t.has("value")&&(this.oldParts=this.parts),this.shouldRebuildParts(t)&&(this.parts=this.processPartData()),t.has("value")&&(this.partPreprocessDataList=function(t,e,i,r){const s=[];let n=0;for(let o=0;o<e.length;o++){const a=e[o],l=r?.[o],c=[];for(let e=0;e<a.digits.length;e++){const r=a.digits[e],s=l?.digits.find((t=>t.place===r.place));c.push({...ce([t,i],[r,s]),index:n++,partIndex:o,digitIndex:e})}s.push(c)}return s}(this.direction,this.parts,this.oldDirection,this.oldParts))}processPartData(){const{decimalSeparator:t,digitToChar:e,minPlaces:i,fillChar:r,type:s}=this.partsOptions,n=this.value,o=this.oldValue;let a=e=>this.sampleToString(e).split(t);"string"===s&&(a=t=>[this.sampleToString(t),""]);const l=[],c=this.sampleSplit(this.sampling(n,o));{const s=this.numberAdapter.gt(n,o)?"down":"up";for(let n=0;n<c.length;n++){const o=c[n],u=o["down"===s?0:o.length-1],[h=1,p=0]=i,d=a(u),f=Math.max(this.stringAdapter.stringToChars(d[0]).length,h),m=Math.max(this.stringAdapter.stringToChars(d[1]??"").length,p),y=le(...o.map((e=>{const[i="",s=""]=a(e),n=this.stringAdapter.stringToChars(i),o=this.stringAdapter.stringToChars(s),l=Math.max(f-n.length,0),c=Math.max(m-o.length,0);let u=[].concat(new Array(l).fill(r),n);return m>0&&(u=u.concat([t],o,new Array(c).fill(r))),u}))).map(((t,i,r)=>({data:t.filter(((t,e,i)=>0===e||t!==i[e-1])).map((t=>e[t]??t)),place:r.length-i})));l.push({digits:y})}}return l}}return r=n,s=new WeakMap,n.DEFAULT_PARTS_OPTIONS={sampleCount:16,decimalSeparator:".",fillChar:"0",minPlaces:[1,0],digitToChar:{},type:"number"},e([pt({type:Object,attribute:"parts-options",converter:t=>ue(t??"")??{},noAccessor:!0})],n.prototype,"partsOptions",null),n},de=()=>({create(t){const e=Number(t);return Number.isFinite(e)?e:0},add:(t,e)=>t+e,sub:(t,e)=>t-e,mul:(t,e)=>t*e,div:(t,e)=>t/e,compare:(t,e)=>t>e?1:t<e?-1:0,eq:(t,e)=>t===e,gt:(t,e)=>t>e,gte:(t,e)=>t>=e,lt:(t,e)=>t<e,lte:(t,e)=>t<=e,isInteger:t=>Number.isInteger(t),isNegative:t=>t<0,isPositive:t=>t>0,isZero:t=>0===t,isNaN:t=>Number.isNaN(t),isFinite:t=>Number.isFinite(t),abs:t=>Math.abs(t),ceil:t=>Math.ceil(t),floor:t=>Math.floor(t),round:t=>Math.round(t),max:(t,e)=>Math.max(t,e),min:(t,e)=>Math.min(t,e),toNumber:t=>Number(t),toString:t=>String(t)}),fe=()=>({stringToChars:t=>Array.from(t)});class me{static setNumberAdapter(t){let e=de();if(Ft(t)){for(const[i,r]of me.AVAILABLE_NUMBER_ADAPTERS)if(i.includes(t)){e=r();break}}else e=t;me.NUMBER_ADAPTER=e}static setStringAdapter(t){let e=fe();if(Ft(t)){for(const[i,r]of me.AVAILABLE_STRING_ADAPTERS)if(i.includes(t)){e=r();break}}else e=t;me.STRING_ADAPTER=e}static registerNumberAdapter(t,e){me.AVAILABLE_NUMBER_ADAPTERS.set(t,e)}static registerStringAdapter(t,e){me.AVAILABLE_STRING_ADAPTERS.set(t,e)}static registryAdapter(t){t.register(this)}}me.AVAILABLE_NUMBER_ADAPTERS=new Map([[["number"],de]]),me.AVAILABLE_STRING_ADAPTERS=new Map([[["string"],fe],[["intl-segmenter"],t=>{const e=new Intl.Segmenter(t,{granularity:"grapheme"});return{stringToChars:t=>Array.from(e.segment(t)).map((t=>t.segment))}}]]),me.NUMBER_ADAPTER=de(),me.STRING_ADAPTER=fe(),me.VALUE_CONVERTER={fromAttribute:t=>t,toAttribute:t=>Wt(t)?t:me.NUMBER_ADAPTER.toString(t)};const ye=t=>{class i extends t{get value(){return this.numberAdapter.create(this.__value)}set value(t){t=me.NUMBER_ADAPTER.create(Wt(t)||Ft(t)&&""===t.trim()?0:t);const e=this.__value;this.__value=t,this.numberAdapter.eq(this.__value,e)||this.requestUpdate("value",e)}get oldValue(){return this.numberAdapter.create(this.__oldValue)}set oldValue(t){const e=this.__oldValue;this.__oldValue=t,this.requestUpdate("oldValue",e)}get initialValue(){return Wt(this.__initialValue)?this.__initialValue:this.numberAdapter.create(this.__initialValue)}set initialValue(t){const e=this.__initialValue;this.__initialValue=t,this.requestUpdate("initialValue",e)}get locale(){return this.__locale}set locale(t){const e=this.__locale;this.__locale=t,this.requestUpdate("locale",e),this.localeInstance=Ft(this.__locale)?new Intl.Locale(this.__locale):new Intl.Locale(...this.__locale)}constructor(...t){super(...t),this.__value=me.NUMBER_ADAPTER.create(0),this.__oldValue=me.NUMBER_ADAPTER.create(0),this.__initialValue=null,this.__locale="en-US",this.localeInstance=Ft(this.locale)?new Intl.Locale(this.locale):new Intl.Locale(...this.locale),this.direction="up",this.oldDirection=this.direction,this.numberAdapter=me.NUMBER_ADAPTER,this.stringAdapter=me.STRING_ADAPTER}willUpdate(t){super.willUpdate(t),t.has("value")&&!t.has("oldValue")&&(this.oldValue=t.get("value")??this.value),this.oldDirection=this.direction,this.numberAdapter.eq(this.value,this.oldValue)||(this.direction=this.numberAdapter.gt(this.value,this.oldValue)?"down":"up")}connectedCallback(){super.connectedCallback(),this.oldValue=function(t){return null!=t}(this.initialValue)?this.initialValue:this.value}}return e([pt({attribute:"value",reflect:!0,converter:{toAttribute:me.VALUE_CONVERTER.toAttribute},noAccessor:!0})],i.prototype,"value",null),e([pt({attribute:"old-value",reflect:!0,converter:me.VALUE_CONVERTER,noAccessor:!0})],i.prototype,"oldValue",null),e([pt({attribute:"initial-value",reflect:!0,converter:me.VALUE_CONVERTER,noAccessor:!0})],i.prototype,"initialValue",null),e([pt({converter:t=>{if(Wt(t))return t;try{return JSON.parse(t)}catch(e){return t}},reflect:!0,noAccessor:!0})],i.prototype,"locale",null),e([dt()],i.prototype,"direction",void 0),e([dt()],i.prototype,"oldDirection",void 0),i},_e=l`
67
67
  :host {
68
68
  position: relative;
69
69
  white-space: nowrap;
@@ -122,6 +122,7 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
122
122
 
123
123
  .roller-part .roller-part__wrapper {
124
124
  display: inline-block;
125
+ text-align: center;
125
126
  }
126
127
 
127
128
  .roller-part .roller-part__suffix {
@@ -180,7 +181,7 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
180
181
  position: absolute;
181
182
  bottom: 100%;
182
183
  }
183
- `,De=t=>t,Pe=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function xe(t,e,i,r){if(t===e&&i===r)return De;const s=e=>function(t,e,i,r,s){let n,o,a=0;do{o=e+(i-e)/2,n=Pe(o,r,s)-t,n>0?i=o:e=o}while(Math.abs(n)>1e-7&&++a<12);return o}(e,0,1,t,i);return t=>0===t||1===t?t:Pe(s(t),e,r)}const Ce=xe(.12,0,.39,0),we=xe(.61,1,.88,1),Oe=xe(.37,0,.63,1),Ee=xe(.11,0,.5,0),Me=xe(.5,1,.89,1),Ne=xe(.45,0,.55,1),ke=xe(.32,0,.67,0),Ie=xe(.33,1,.68,1),Re=xe(.65,0,.35,1),Ue=xe(.5,0,.75,0),Le=xe(.25,1,.5,1),Ve=xe(.76,0,.24,1),je=xe(.64,0,.78,0),Be=xe(.22,1,.36,1),He=xe(.83,0,.17,1),ze=xe(.7,0,.84,0),Fe=xe(.16,1,.3,1),Ye=xe(.87,0,.13,1),We=xe(.55,0,1,.45),Qe=xe(0,.55,.45,1),qe=xe(.85,0,.15,1),Ke=xe(.36,0,.66,-.56),Ge=xe(.34,1.56,.64,1),Je=xe(.68,-.6,.32,1.6);function Ze(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:-(2**(10*t-10))*Math.sin((10*t-10.75)*e)}function Xe(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:2**(-10*t)*Math.sin((10*t-.75)*e)+1}function ti(t){const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-(2**(20*t-10))*Math.sin((20*t-11.125)*e)/2:2**(-20*t+10)*Math.sin((20*t-11.125)*e)/2+1}function ei(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375}function ii(t){return 1-ei(1-t)}function ri(t){return t<.5?(1-ei(1-2*t))/2:(1+ei(2*t-1))/2}var si=Object.freeze({__proto__:null,easeInBack:Ke,easeInBounce:ii,easeInCirc:We,easeInCubic:ke,easeInElastic:Ze,easeInExpo:ze,easeInOutBack:Je,easeInOutBounce:ri,easeInOutCirc:qe,easeInOutCubic:Re,easeInOutElastic:ti,easeInOutExpo:Ye,easeInOutQuad:Ne,easeInOutQuart:Ve,easeInOutQuint:He,easeInOutSine:Oe,easeInQuad:Ee,easeInQuart:Ue,easeInQuint:je,easeInSine:Ce,easeOutBack:Ge,easeOutBounce:ei,easeOutCirc:Qe,easeOutCubic:Ie,easeOutElastic:Xe,easeOutExpo:Fe,easeOutQuad:Me,easeOutQuart:Le,easeOutQuint:Be,easeOutSine:we});class ni extends Event{}let oi=class extends at{constructor(){super(),this.digit={data:[],place:0},this.preprocessData={animate:!0,cancelPrevAnimation:!1,earlyReturn:"",index:0,partIndex:0,digitIndex:0},this.direction="up",this.textStyle={},this.cellStyle=[],this.animationOptions={},this.keyframes={},this.digitWidth=0,this.resizeObserver=new ResizeObserver((()=>{this.digitWidth=this.clonedRollDigitList?this.clonedRollDigitList.offsetWidth:0}))}firstUpdated(t){super.firstUpdated(t),this.clonedRollDigitList&&this.resizeObserver.observe(this.clonedRollDigitList)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.disconnect()}updated(t){super.updated(t),Zt(Array.from(t.keys()),["digit","preprocessData","direction","animationOptions","keyframes"]).length>0&&this.shouldAnimate()&&this.startAnimation().then()}render(){const t=this.cellStyle.map((t=>function(...t){return Nt(Ut,t)}(t,["position"])));return F`<span class="roller-part-digit">
184
+ `,Pe=t=>t,De=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function xe(t,e,i,r){if(t===e&&i===r)return Pe;const s=e=>function(t,e,i,r,s){let n,o,a=0;do{o=e+(i-e)/2,n=De(o,r,s)-t,n>0?i=o:e=o}while(Math.abs(n)>1e-7&&++a<12);return o}(e,0,1,t,i);return t=>0===t||1===t?t:De(s(t),e,r)}const Ce=xe(.12,0,.39,0),we=xe(.61,1,.88,1),Oe=xe(.37,0,.63,1),Ee=xe(.11,0,.5,0),Me=xe(.5,1,.89,1),Ne=xe(.45,0,.55,1),ke=xe(.32,0,.67,0),Ie=xe(.33,1,.68,1),Re=xe(.65,0,.35,1),Ue=xe(.5,0,.75,0),Le=xe(.25,1,.5,1),Ve=xe(.76,0,.24,1),je=xe(.64,0,.78,0),Be=xe(.22,1,.36,1),He=xe(.83,0,.17,1),ze=xe(.7,0,.84,0),Fe=xe(.16,1,.3,1),Ye=xe(.87,0,.13,1),We=xe(.55,0,1,.45),Qe=xe(0,.55,.45,1),qe=xe(.85,0,.15,1),Ke=xe(.36,0,.66,-.56),Ge=xe(.34,1.56,.64,1),Je=xe(.68,-.6,.32,1.6);function Ze(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:-(2**(10*t-10))*Math.sin((10*t-10.75)*e)}function Xe(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:2**(-10*t)*Math.sin((10*t-.75)*e)+1}function ti(t){const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-(2**(20*t-10))*Math.sin((20*t-11.125)*e)/2:2**(-20*t+10)*Math.sin((20*t-11.125)*e)/2+1}function ei(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375}function ii(t){return 1-ei(1-t)}function ri(t){return t<.5?(1-ei(1-2*t))/2:(1+ei(2*t-1))/2}var si=Object.freeze({__proto__:null,easeInBack:Ke,easeInBounce:ii,easeInCirc:We,easeInCubic:ke,easeInElastic:Ze,easeInExpo:ze,easeInOutBack:Je,easeInOutBounce:ri,easeInOutCirc:qe,easeInOutCubic:Re,easeInOutElastic:ti,easeInOutExpo:Ye,easeInOutQuad:Ne,easeInOutQuart:Ve,easeInOutQuint:He,easeInOutSine:Oe,easeInQuad:Ee,easeInQuart:Ue,easeInQuint:je,easeInSine:Ce,easeOutBack:Ge,easeOutBounce:ei,easeOutCirc:Qe,easeOutCubic:Ie,easeOutElastic:Xe,easeOutExpo:Fe,easeOutQuad:Me,easeOutQuart:Le,easeOutQuint:Be,easeOutSine:we});class ni extends Event{}let oi=class extends at{constructor(){super(),this.digit={data:[],place:0},this.preprocessData={animate:!0,cancelPrevAnimation:!1,earlyReturn:"",index:0,partIndex:0,digitIndex:0},this.direction="up",this.textStyle={},this.cellStyle=[],this.animationOptions={},this.keyframes={},this.digitWidth=0,this.resizeObserver=new ResizeObserver((()=>{this.digitWidth=this.clonedRollDigitList?this.clonedRollDigitList.offsetWidth:0}))}firstUpdated(t){super.firstUpdated(t),this.clonedRollDigitList&&this.resizeObserver.observe(this.clonedRollDigitList)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.disconnect()}updated(t){super.updated(t),Zt(Array.from(t.keys()),["digit","preprocessData","direction","animationOptions","keyframes"]).length>0&&this.shouldAnimate()&&this.startAnimation().then()}render(){const t=this.cellStyle.map((t=>function(...t){return Nt(Ut,t)}(t,["position"])));return F`<span class="roller-part-digit">
184
185
  <!-- 占位 -->
185
186
  <span
186
187
  class="placeholder"
@@ -189,14 +190,14 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
189
190
  >
190
191
  <!-- 一个不可见的滚动列表的复制, 用于计算该列表的最大宽度. -->
191
192
  <span class="roll-list__shadow">
192
- ${Pt(this.digit.data,((t,e)=>e),((e,i)=>F`<span style=${$e(t[i])}
193
+ ${Dt(this.digit.data,((t,e)=>e),((e,i)=>F`<span style=${$e(t[i])}
193
194
  >${e}</span
194
195
  >`))}
195
196
  </span>
196
197
  <span
197
198
  class=${ve({"roll-list__up":"up"===this.direction,"roll-list__down":"down"===this.direction,"roll-list":!0})}
198
199
  >
199
- ${this.digit.data.length>1?Pt(this.digit.data,((t,e)=>e),((t,e)=>"up"===this.direction&&e===this.digit.data.length-1?F`<span
200
+ ${this.digit.data.length>1?Dt(this.digit.data,((t,e)=>e),((t,e)=>"up"===this.direction&&e===this.digit.data.length-1?F`<span
200
201
  part="cell"
201
202
  class="roll-item roll-item__head"
202
203
  style=${$e(this.cellStyle[e])}
@@ -237,11 +238,11 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
237
238
  <slot part="prefix" name="prefix"></slot>
238
239
  </span>
239
240
  <span class="counter-parts">
240
- ${Pt(this.parts,((t,e)=>e),((t,e)=>F`<span
241
+ ${Dt(this.parts,((t,e)=>e),((t,e)=>F`<span
241
242
  part="part"
242
243
  class="roller-part"
243
244
  style=${$e(this.partStyles?.[e]??{})}
244
- >${Pt(t.digits,((e,i)=>""+(t.digits.length-i)),((t,i)=>F`<timered-counter-roller-digit
245
+ >${Dt(t.digits,((e,i)=>""+(t.digits.length-i)),((t,i)=>F`<timered-counter-roller-digit
245
246
  exportparts="digit, cell"
246
247
  part="digit"
247
248
  class="roller-part__wrapper"
@@ -294,7 +295,7 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
294
295
  >
295
296
  <slot name="prefix" slot="prefix"></slot>
296
297
  <slot name="suffix" slot="suffix"></slot>
297
- ${Pt(this.parts,((t,e)=>e),((t,e)=>F`<slot
298
+ ${Dt(this.parts,((t,e)=>e),((t,e)=>F`<slot
298
299
  name=${`part-suffix-${e}`}
299
300
  slot=${`part-suffix-${e}`}
300
301
  ></slot>`))}
@@ -320,7 +321,7 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
320
321
  >
321
322
  <slot name="prefix" slot="prefix"></slot>
322
323
  <slot name="suffix" slot="suffix"></slot>
323
- ${Pt(this.parts,((t,e)=>e),((t,e)=>F`<slot
324
+ ${Dt(this.parts,((t,e)=>e),((t,e)=>F`<slot
324
325
  name=${`part-suffix-${e}`}
325
326
  slot=${`part-suffix-${e}`}
326
327
  ></slot>`))}
@@ -328,12 +329,12 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
328
329
  `}willUpdate(t){if(t.has("localeNumber")||t.has("locale")){this.localeNumberInstance=new Intl.NumberFormat(this.localeInstance,qt(this.localeNumber)?{}:this.localeNumber);{const e=this.localeNumberInstance.formatToParts(123456.789),i=e.find((t=>"decimal"===t.type))?.value||".",r=e.find((t=>"group"===t.type))?.value||"";if(this.localDecimalSeparator!==i||this.localeGroupingSeparator!==r){this.localDecimalSeparator=i;const e=this.partsOptions;this.partsOptions={...e,decimalSeparator:this.localDecimalSeparator},t.set("partsOptions",e)}}}super.willUpdate(t)}},t.TimeredCounterNumber.styles=[...t.TimeredCounter.styles,hi],e([pt({converter:t=>{if(Wt(t))return!1;try{return JSON.parse(t)}catch(t){return!0}},reflect:!0,attribute:"locale-number"})],t.TimeredCounterNumber.prototype,"localeNumber",void 0),e([dt()],t.TimeredCounterNumber.prototype,"localDecimalSeparator",void 0),e([dt()],t.TimeredCounterNumber.prototype,"localeGroupingSeparator",void 0),t.TimeredCounterNumber=e([ct("timered-counter-number")],t.TimeredCounterNumber);const pi=l``
329
330
  /**
330
331
  * @license https://github.com/HarasimowiczKamil/any-base
331
- */;function di(t,e,i){return r=>function(t,e,i){let r,s,n,{length:o}=i;const a={},l=t.length,c=e.length,u=[];if(!function(t,e){for(const i of t)if(-1===e.indexOf(i))return!1;return!0}(i,t))throw new Error(`Number "${i}" contains of non-alphabetic digits (${t})`);if(Gt(t,e))return i.join("");for(r=0;r<o;r++)a[r]=t.indexOf(i[r]);do{for(s=0,n=0,r=0;r<o;r++)s=s*l+a[r],s>=c?(a[n++]=Math.floor(s/c),s%=c):n>0&&(a[n++]=0);o=n,u.push(e[s])}while(0!==n);return u.reverse().join("")}(t.stringToChars(e),t.stringToChars(i),t.stringToChars(r))}const fi=" ";t.TimeredCounterString=class extends t.TimeredCounter{constructor(){super(...arguments),this.__alphabet="",this.__initialValueString="",this.__valueString="",this.__oldValueString="",this.__partsOptions=null,this.__decimalToAnyBase=di(this.stringAdapter,"0123456789",this.__alphabet),this.__anyBaseToDecimal=di(this.stringAdapter,this.__alphabet,"0123456789")}get initialValue(){return super.initialValue}set initialValue(t){if(!Ft(t))try{t=t.toString()}catch(e){throw new Error(`value ${t} is not a string.`)}this.__initialValueString=t??"",Yt(this.__initialValueString)?super.initialValue=this.numberAdapter.create(0):(this.__updateAlphabet(this.__valueString,this.__initialValueString),super.initialValue=this.numberAdapter.create(this.__anyBaseToDecimal(this.__initialValueString)),super.value=this.numberAdapter.create(this.__anyBaseToDecimal(this.__valueString)))}get value(){return super.value}set value(t){if(Ft(t)){if(this.__valueString===t)return}else try{t=t.toString()}catch(e){throw new Error(`value ${t} is not a string.`)}this.__oldValueString=this.__valueString,this.__valueString=t??"",Yt(this.__valueString)?super.value=this.numberAdapter.create(0):(this.__updateAlphabet(this.__valueString,this.__oldValueString),super.oldValue=this.numberAdapter.create(this.__anyBaseToDecimal(this.__oldValueString)),super.value=this.numberAdapter.create(this.__anyBaseToDecimal(this.__valueString)))}get partsOptions(){return super.partsOptions}set partsOptions(t){this.__partsOptions=t,super.partsOptions={type:"string",fillChar:fi,...this.__partsOptions,digitToChar:{" ":fi,...this.__partsOptions.digitToChar}}}__updateAlphabet(t,e){const i=Yt(t)&&Yt(e)?"":`\0${e??""}${t??""}`,r=new Set(this.stringAdapter.stringToChars(i));this.__alphabet=Array.from(r).sort().join("");const s=this.stringAdapter,n=this.__alphabet;this.__decimalToAnyBase=di(s,"0123456789",n),this.__anyBaseToDecimal=di(s,n,"0123456789")}sampleToString(t){return this.__decimalToAnyBase(this.numberAdapter.toString(t))}connectedCallback(){this.__updateAlphabet(this.__valueString,this.__initialValueString),this.initialValue=this.__initialValueString,this.value=this.__valueString,this.partsOptions=this.__partsOptions??{},super.connectedCallback()}},t.TimeredCounterString.styles=[...t.TimeredCounter.styles,pi],t.TimeredCounterString=e([ct("timered-counter-string")],t.TimeredCounterString);const mi=36e5,yi=Symbol.for("constructDateFrom");function _i(t,e){return"function"==typeof t?t(e):t&&"object"==typeof t&&yi in t?t[yi](e):t instanceof Date?new t.constructor(e):new Date(e)}function gi(t,e){return _i(t,t)}function Ai(t,e,i){const r=gi(t);return isNaN(e)?_i(t,NaN):e?(r.setDate(r.getDate()+e),r):r}function bi(t,e,i){const r=gi(t);if(isNaN(e))return _i(t,NaN);if(!e)return r;const s=r.getDate(),n=_i(t,r.getTime());return n.setMonth(r.getMonth()+e+1,0),s>=n.getDate()?n:(r.setFullYear(n.getFullYear(),n.getMonth(),s),r)}function $i(t,e,i){return _i(t,+gi(t)+e)}function vi(t){const e=gi(t),i=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return i.setUTCFullYear(e.getFullYear()),+t-+i}function Si(t,...e){const i=_i.bind(null,e.find((t=>"object"==typeof t)));return e.map(i)}function Ti(t,e){const i=gi(t);return i.setHours(0,0,0,0),i}function Di(t,e){const i=+gi(t)-+gi(e);return i<0?-1:i>0?1:i}function Pi(t){return!(!((e=t)instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))&&"number"!=typeof t||isNaN(+gi(t)));var e}function xi(t,e,i){const[r,s]=Si(0,t,e),n=Ci(r,s),o=Math.abs(function(t,e){const[i,r]=Si(0,t,e),s=Ti(i),n=Ti(r),o=+s-vi(s),a=+n-vi(n);return Math.round((o-a)/864e5)}(r,s));r.setDate(r.getDate()-n*o);const a=n*(o-Number(Ci(r,s)===-n));return 0===a?0:a}function Ci(t,e){const i=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return i<0?-1:i>0?1:i}function wi(t){return e=>{const i=(t?Math[t]:Math.trunc)(e);return 0===i?0:i}}function Oi(t,e,i){const[r,s]=Si(0,t,e),n=(+r-+s)/mi;return wi(i?.roundingMethod)(n)}function Ei(t,e){return+gi(t)-+gi(e)}function Mi(t,e,i){const r=Ei(t,e)/6e4;return wi(i?.roundingMethod)(r)}function Ni(t,e){const i=gi(t);return+function(t){const e=gi(t);return e.setHours(23,59,59,999),e}(i)==+function(t){const e=gi(t),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}(i)}function ki(t,e,i){const[r,s,n]=Si(0,t,t,e),o=Di(s,n),a=Math.abs(function(t,e){const[i,r]=Si(0,t,e);return 12*(i.getFullYear()-r.getFullYear())+(i.getMonth()-r.getMonth())}(s,n));if(a<1)return 0;1===s.getMonth()&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let l=Di(s,n)===-o;Ni(r)&&1===a&&1===Di(r,n)&&(l=!1);const c=o*(a-+l);return 0===c?0:c}function Ii(t,e,i){const r=ki(t,e)/3;return wi(i?.roundingMethod)(r)}function Ri(t,e,i){const r=Ei(t,e)/1e3;return wi(i?.roundingMethod)(r)}function Ui(t,e,i){const r=xi(t,e)/7;return wi(i?.roundingMethod)(r)}function Li(t,e,i){const[r,s]=Si(0,t,e),n=Di(r,s),o=Math.abs(function(t,e){const[i,r]=Si(0,t,e);return i.getFullYear()-r.getFullYear()}(r,s));r.setFullYear(1584),s.setFullYear(1584);const a=n*(o-+(Di(r,s)===-n));return 0===a?0:a}function Vi(t,e){return+gi(t)<+gi(e)}function ji(t,e,i){return Ai(t,-e)}function Bi(t,e,i){return function(t,e){return $i(t,e*mi)}(t,-e)}function Hi(t,e,i){return $i(t,-e)}function zi(t,e,i){return function(t,e){const i=gi(t);return i.setTime(i.getTime()+6e4*e),i}(t,-e)}function Fi(t,e,i){return function(t,e){return bi(t,3*e)}(t,-e)}function Yi(t,e,i){return function(t,e){return $i(t,1e3*e)}(t,-e)}function Wi(t,e,i){return function(t,e){return Ai(t,7*e)}(t,-e)}function Qi(t,e,i){return function(t,e){return bi(t,12*e)}(t,-e)}var qi;t.DurationPartType=void 0,(qi=t.DurationPartType||(t.DurationPartType={})).Millisecond="millisecond",qi.Second="second",qi.Minute="minute",qi.Hour="hour",qi.Day="day",qi.Week="weekOfYear",qi.Month="month",qi.Quarter="quarter",qi.Year="year";const Ki={[t.DurationPartType.Millisecond]:1,[t.DurationPartType.Second]:1e3,[t.DurationPartType.Minute]:6e4,[t.DurationPartType.Hour]:36e5,[t.DurationPartType.Day]:864e5,[t.DurationPartType.Week]:6048e5,[t.DurationPartType.Month]:26298e5,[t.DurationPartType.Quarter]:78894e5,[t.DurationPartType.Year]:315576e5},Gi={1:t.DurationPartType.Millisecond,1e3:t.DurationPartType.Second,6e4:t.DurationPartType.Minute,36e5:t.DurationPartType.Hour,864e5:t.DurationPartType.Day,6048e5:t.DurationPartType.Week,26298e5:t.DurationPartType.Month,78894e5:t.DurationPartType.Quarter,315576e5:t.DurationPartType.Year},Ji=["era","year","quarter","month","weekOfYear","weekday","day","dayPeriod","hour","minute","second","timeZoneName"];function Zi(e,i,r){let s=i;const n={};for(const i of r){let r=0;switch(i){case t.DurationPartType.Year:r=Li(s,e),s=Qi(s,r);break;case t.DurationPartType.Quarter:r=Ii(s,e),s=Fi(s,r);break;case t.DurationPartType.Month:r=ki(s,e),s=bi(s,-r);break;case t.DurationPartType.Week:r=Ui(s,e),s=Wi(s,r);break;case t.DurationPartType.Day:r=xi(s,e),s=ji(s,r);break;case t.DurationPartType.Hour:r=Oi(s,e),s=Bi(s,r);break;case t.DurationPartType.Minute:r=Mi(s,e),s=zi(s,r);break;case t.DurationPartType.Second:r=Ri(s,e),s=Yi(s,r);break;case t.DurationPartType.Millisecond:r=Ei(s,e),s=Hi(s,r);break;default:throw new Error(`Unknown duration part: ${i}`)}n[i]=r}return n}function Xi(t,e,i){const r=Zi(t,e,i);return i.map((t=>r[t]))}const tr={[t.DurationPartType.Year]:"Y",[t.DurationPartType.Month]:"M",[t.DurationPartType.Week]:"W",[t.DurationPartType.Day]:"D",[t.DurationPartType.Hour]:"H",[t.DurationPartType.Minute]:"M",[t.DurationPartType.Second]:"S"},er=[t.DurationPartType.Year,t.DurationPartType.Month,t.DurationPartType.Week,t.DurationPartType.Day],ir=[t.DurationPartType.Hour,t.DurationPartType.Minute,t.DurationPartType.Second],rr=l`
332
+ */;function di(t,e,i){return r=>function(t,e,i){let r,s,n,{length:o}=i;const a={},l=t.length,c=e.length,u=[];if(!function(t,e){for(const i of t)if(-1===e.indexOf(i))return!1;return!0}(i,t))throw new Error(`Number "${i}" contains of non-alphabetic digits (${t})`);if(Gt(t,e))return i.join("");for(r=0;r<o;r++)a[r]=t.indexOf(i[r]);do{for(s=0,n=0,r=0;r<o;r++)s=s*l+a[r],s>=c?(a[n++]=Math.floor(s/c),s%=c):n>0&&(a[n++]=0);o=n,u.push(e[s])}while(0!==n);return u.reverse().join("")}(t.stringToChars(e),t.stringToChars(i),t.stringToChars(r))}const fi=" ";t.TimeredCounterString=class extends t.TimeredCounter{constructor(){super(...arguments),this.__alphabet="",this.__initialValueString="",this.__valueString="",this.__oldValueString="",this.__partsOptions=null,this.__decimalToAnyBase=di(this.stringAdapter,"0123456789",this.__alphabet),this.__anyBaseToDecimal=di(this.stringAdapter,this.__alphabet,"0123456789")}get initialValue(){return super.initialValue}set initialValue(t){if(!Ft(t))try{t=t.toString()}catch(e){throw new Error(`value ${t} is not a string.`)}this.__initialValueString=t??"",Yt(this.__initialValueString)?super.initialValue=this.numberAdapter.create(0):(this.__updateAlphabet(this.__valueString,this.__initialValueString),super.initialValue=this.numberAdapter.create(this.__anyBaseToDecimal(this.__initialValueString)),super.value=this.numberAdapter.create(this.__anyBaseToDecimal(this.__valueString)))}get value(){return super.value}set value(t){if(Ft(t)){if(this.__valueString===t)return}else try{t=t.toString()}catch(e){throw new Error(`value ${t} is not a string.`)}this.__oldValueString=this.__valueString,this.__valueString=t??"",Yt(this.__valueString)?super.value=this.numberAdapter.create(0):(this.__updateAlphabet(this.__valueString,this.__oldValueString),super.oldValue=this.numberAdapter.create(this.__anyBaseToDecimal(this.__oldValueString)),super.value=this.numberAdapter.create(this.__anyBaseToDecimal(this.__valueString)))}get partsOptions(){return super.partsOptions}set partsOptions(t){this.__partsOptions=t,super.partsOptions={type:"string",fillChar:fi,...this.__partsOptions,digitToChar:{" ":fi,...this.__partsOptions.digitToChar}}}__updateAlphabet(t,e){const i=Yt(t)&&Yt(e)?"":`\0${e??""}${t??""}`,r=new Set(this.stringAdapter.stringToChars(i));this.__alphabet=Array.from(r).sort().join("");const s=this.stringAdapter,n=this.__alphabet;this.__decimalToAnyBase=di(s,"0123456789",n),this.__anyBaseToDecimal=di(s,n,"0123456789")}sampleToString(t){return this.__decimalToAnyBase(this.numberAdapter.toString(t))}connectedCallback(){this.__updateAlphabet(this.__valueString,this.__initialValueString),this.initialValue=this.__initialValueString,this.value=this.__valueString,this.partsOptions=this.__partsOptions??{},super.connectedCallback()}},t.TimeredCounterString.styles=[...t.TimeredCounter.styles,pi],t.TimeredCounterString=e([ct("timered-counter-string")],t.TimeredCounterString);const mi=36e5,yi=Symbol.for("constructDateFrom");function _i(t,e){return"function"==typeof t?t(e):t&&"object"==typeof t&&yi in t?t[yi](e):t instanceof Date?new t.constructor(e):new Date(e)}function gi(t,e){return _i(t,t)}function Ai(t,e,i){const r=gi(t);return isNaN(e)?_i(t,NaN):e?(r.setDate(r.getDate()+e),r):r}function bi(t,e,i){const r=gi(t);if(isNaN(e))return _i(t,NaN);if(!e)return r;const s=r.getDate(),n=_i(t,r.getTime());return n.setMonth(r.getMonth()+e+1,0),s>=n.getDate()?n:(r.setFullYear(n.getFullYear(),n.getMonth(),s),r)}function $i(t,e,i){return _i(t,+gi(t)+e)}function vi(t){const e=gi(t),i=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return i.setUTCFullYear(e.getFullYear()),+t-+i}function Si(t,...e){const i=_i.bind(null,e.find((t=>"object"==typeof t)));return e.map(i)}function Ti(t,e){const i=gi(t);return i.setHours(0,0,0,0),i}function Pi(t,e){const i=+gi(t)-+gi(e);return i<0?-1:i>0?1:i}function Di(t){return!(!((e=t)instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))&&"number"!=typeof t||isNaN(+gi(t)));var e}function xi(t,e,i){const[r,s]=Si(0,t,e),n=Ci(r,s),o=Math.abs(function(t,e){const[i,r]=Si(0,t,e),s=Ti(i),n=Ti(r),o=+s-vi(s),a=+n-vi(n);return Math.round((o-a)/864e5)}(r,s));r.setDate(r.getDate()-n*o);const a=n*(o-Number(Ci(r,s)===-n));return 0===a?0:a}function Ci(t,e){const i=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return i<0?-1:i>0?1:i}function wi(t){return e=>{const i=(t?Math[t]:Math.trunc)(e);return 0===i?0:i}}function Oi(t,e,i){const[r,s]=Si(0,t,e),n=(+r-+s)/mi;return wi(i?.roundingMethod)(n)}function Ei(t,e){return+gi(t)-+gi(e)}function Mi(t,e,i){const r=Ei(t,e)/6e4;return wi(i?.roundingMethod)(r)}function Ni(t,e){const i=gi(t);return+function(t){const e=gi(t);return e.setHours(23,59,59,999),e}(i)==+function(t){const e=gi(t),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}(i)}function ki(t,e,i){const[r,s,n]=Si(0,t,t,e),o=Pi(s,n),a=Math.abs(function(t,e){const[i,r]=Si(0,t,e);return 12*(i.getFullYear()-r.getFullYear())+(i.getMonth()-r.getMonth())}(s,n));if(a<1)return 0;1===s.getMonth()&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let l=Pi(s,n)===-o;Ni(r)&&1===a&&1===Pi(r,n)&&(l=!1);const c=o*(a-+l);return 0===c?0:c}function Ii(t,e,i){const r=ki(t,e)/3;return wi(i?.roundingMethod)(r)}function Ri(t,e,i){const r=Ei(t,e)/1e3;return wi(i?.roundingMethod)(r)}function Ui(t,e,i){const r=xi(t,e)/7;return wi(i?.roundingMethod)(r)}function Li(t,e,i){const[r,s]=Si(0,t,e),n=Pi(r,s),o=Math.abs(function(t,e){const[i,r]=Si(0,t,e);return i.getFullYear()-r.getFullYear()}(r,s));r.setFullYear(1584),s.setFullYear(1584);const a=n*(o-+(Pi(r,s)===-n));return 0===a?0:a}function Vi(t,e){return+gi(t)<+gi(e)}function ji(t,e,i){return Ai(t,-e)}function Bi(t,e,i){return function(t,e){return $i(t,e*mi)}(t,-e)}function Hi(t,e,i){return $i(t,-e)}function zi(t,e,i){return function(t,e){const i=gi(t);return i.setTime(i.getTime()+6e4*e),i}(t,-e)}function Fi(t,e,i){return function(t,e){return bi(t,3*e)}(t,-e)}function Yi(t,e,i){return function(t,e){return $i(t,1e3*e)}(t,-e)}function Wi(t,e,i){return function(t,e){return Ai(t,7*e)}(t,-e)}function Qi(t,e,i){return function(t,e){return bi(t,12*e)}(t,-e)}var qi;t.DurationPartType=void 0,(qi=t.DurationPartType||(t.DurationPartType={})).Millisecond="millisecond",qi.Second="second",qi.Minute="minute",qi.Hour="hour",qi.Day="day",qi.Week="weekOfYear",qi.Month="month",qi.Quarter="quarter",qi.Year="year";const Ki={[t.DurationPartType.Millisecond]:1,[t.DurationPartType.Second]:1e3,[t.DurationPartType.Minute]:6e4,[t.DurationPartType.Hour]:36e5,[t.DurationPartType.Day]:864e5,[t.DurationPartType.Week]:6048e5,[t.DurationPartType.Month]:26298e5,[t.DurationPartType.Quarter]:78894e5,[t.DurationPartType.Year]:315576e5},Gi={1:t.DurationPartType.Millisecond,1e3:t.DurationPartType.Second,6e4:t.DurationPartType.Minute,36e5:t.DurationPartType.Hour,864e5:t.DurationPartType.Day,6048e5:t.DurationPartType.Week,26298e5:t.DurationPartType.Month,78894e5:t.DurationPartType.Quarter,315576e5:t.DurationPartType.Year},Ji=["era","year","quarter","month","weekOfYear","weekday","day","dayPeriod","hour","minute","second","timeZoneName"];function Zi(e,i,r){let s=i;const n={};for(const i of r){let r=0;switch(i){case t.DurationPartType.Year:r=Li(s,e),s=Qi(s,r);break;case t.DurationPartType.Quarter:r=Ii(s,e),s=Fi(s,r);break;case t.DurationPartType.Month:r=ki(s,e),s=bi(s,-r);break;case t.DurationPartType.Week:r=Ui(s,e),s=Wi(s,r);break;case t.DurationPartType.Day:r=xi(s,e),s=ji(s,r);break;case t.DurationPartType.Hour:r=Oi(s,e),s=Bi(s,r);break;case t.DurationPartType.Minute:r=Mi(s,e),s=zi(s,r);break;case t.DurationPartType.Second:r=Ri(s,e),s=Yi(s,r);break;case t.DurationPartType.Millisecond:r=Ei(s,e),s=Hi(s,r);break;default:throw new Error(`Unknown duration part: ${i}`)}n[i]=r}return n}function Xi(t,e,i){const r=Zi(t,e,i);return i.map((t=>r[t]))}const tr={[t.DurationPartType.Year]:"Y",[t.DurationPartType.Month]:"M",[t.DurationPartType.Week]:"W",[t.DurationPartType.Day]:"D",[t.DurationPartType.Hour]:"H",[t.DurationPartType.Minute]:"M",[t.DurationPartType.Second]:"S"},er=[t.DurationPartType.Year,t.DurationPartType.Month,t.DurationPartType.Week,t.DurationPartType.Day],ir=[t.DurationPartType.Hour,t.DurationPartType.Minute,t.DurationPartType.Second],rr=l`
332
333
  ::part(part-suffix) {
333
334
  font-size: 0.4em;
334
335
  line-height: 1;
335
336
  }
336
- `;function sr(t,e){Ft(t)&&(t=ue(t)),Qt(t)||(t=[t,t]);const i=[Kt(t[0])?t[0]:gi(t[0]),Kt(t[1])?t[1]:gi(t[1])];if(!Pi(i[0])||!Pi(i[1]))throw new Error(`value ${t[0]} or ${t[1]} is not a valid date.`);const r=Math.abs(i[1].getTime()-function(t,e,i){const r=Ki[i],s=t.getTime(),n=e.getTime();return s-s%r+(Math.abs(n-s)%r>0?(s<n?-1:1)*r:0)+n%r}(i[0],i[1],e));return{durationInMilliseconds:r,from:i[0],to:i[1]}}t.TimeredCounterDatetimeDuration=class extends t.TimeredCounter{constructor(){super(...arguments),this.__precision=[t.DurationPartType.Second,t.DurationPartType.Day],this.__initialValuePlain=null,this.__partsOptions=null,this.__from=new Date,this.__to=new Date,this.__minPrecision=t.DurationPartType.Second,this.__maxPrecision=t.DurationPartType.Day,this.__availableDurationParts=[],this.__dateTimeFieldLabels={}}get precision(){return this.__precision}set precision(e){Ft(e)&&(e=ue(e)),this.__precision=e,this.__minPrecision=Qt(this.__precision)?this.__precision[0]:this.__precision,this.__maxPrecision=Qt(this.__precision)?this.__precision[1]:this.__precision,this.__availableDurationParts=Object.values(t.DurationPartType).reverse().map((t=>{const e=Ki[this.__minPrecision],i=Ki[this.__maxPrecision],r=Ki[t];return{type:t,available:r>=e&&r<=i}})).filter((t=>t.available))}get value(){return super.value}set value(t){const{from:e,to:i,durationInMilliseconds:r}=sr(t,this.__minPrecision);this.__from=e,this.__to=i,super.value=r}get initialValue(){return super.initialValue}set initialValue(t){this.__initialValuePlain=t;const{durationInMilliseconds:e}=sr(t,this.__minPrecision);super.initialValue=e}get partsOptions(){return super.partsOptions}set partsOptions(t){this.__partsOptions=t,super.partsOptions={minPlaces:[2,void 0],...this.__partsOptions}}sampleSplit(t){const e=jt(this.__availableDurationParts,(t=>t.type)),i=e.map((()=>[]));for(const r of t){const t=this.numberAdapter.toNumber(r);Xi(new Date(Math.min(t,0)),new Date(Math.max(t,0)),e).forEach(((t,e)=>i[e].push(t)))}return i}generateAriaLabel(){return function(t){const e=er.map((e=>zt(t[e])?`${t[e]}${tr[e]}`:"")),i=ir.map((e=>zt(t[e])?`${t[e]}${tr[e]}`:""));return`P${e.join("")}T${i.join("")}`}(Zi(Vi(this.__from,this.__to)?this.__from:this.__to,Vi(this.__from,this.__to)?this.__to:this.__from,jt(this.__availableDurationParts,(t=>t.type))))}connectedCallback(){this.role="timer",this.partsOptions=this.__partsOptions??{},this.initialValue=this.__initialValuePlain,this.precision=this.__precision,super.connectedCallback()}willUpdate(t){super.willUpdate(t),t.has("locale")&&(this.__dateTimeFieldLabels=function(t){const e=new Intl.DisplayNames(t,{type:"dateTimeField"});return Ji.reduce(((t,i)=>(t[i]=e.of(i)??"",t)),{})}(this.localeInstance))}render(){const t=this.extractCellStyles(),e=this.extractDigitStyles(),i=this.extractPartStyles(),r=this.extractAnimationOptions(),s=this.extractKeyframes(),n=jt(this.__availableDurationParts,(t=>t.type));return F`
337
+ `;function sr(t,e){Ft(t)&&(t=ue(t)),Qt(t)||(t=[t,t]);const i=[Kt(t[0])?t[0]:gi(t[0]),Kt(t[1])?t[1]:gi(t[1])];if(!Di(i[0])||!Di(i[1]))throw new Error(`value ${t[0]} or ${t[1]} is not a valid date.`);const r=Math.abs(i[1].getTime()-function(t,e,i){const r=Ki[i],s=t.getTime();return s-s%r+e.getTime()%r}(i[0],i[1],e));return{durationInMilliseconds:r,from:i[0],to:i[1]}}t.TimeredCounterDatetimeDuration=class extends t.TimeredCounter{constructor(){super(...arguments),this.__precision=[t.DurationPartType.Second,t.DurationPartType.Day],this.__initialValuePlain=null,this.__partsOptions=null,this.__from=new Date,this.__to=new Date,this.__minPrecision=t.DurationPartType.Second,this.__maxPrecision=t.DurationPartType.Day,this.__availableDurationParts=[],this.__dateTimeFieldLabels={}}get precision(){return this.__precision}set precision(e){Ft(e)&&(e=ue(e)),this.__precision=e,this.__minPrecision=Qt(this.__precision)?this.__precision[0]:this.__precision,this.__maxPrecision=Qt(this.__precision)?this.__precision[1]:this.__precision,this.__availableDurationParts=Object.values(t.DurationPartType).reverse().map((t=>{const e=Ki[this.__minPrecision],i=Ki[this.__maxPrecision],r=Ki[t];return{type:t,available:r>=e&&r<=i}})).filter((t=>t.available))}get value(){return super.value}set value(t){const{from:e,to:i,durationInMilliseconds:r}=sr(t,this.__minPrecision);this.__from=e,this.__to=i,super.value=r}get initialValue(){return super.initialValue}set initialValue(t){this.__initialValuePlain=t;const{durationInMilliseconds:e}=sr(t,this.__minPrecision);super.initialValue=e}get partsOptions(){return super.partsOptions}set partsOptions(t){this.__partsOptions=t,super.partsOptions={minPlaces:[2,void 0],...this.__partsOptions}}sampleSplit(t){const e=jt(this.__availableDurationParts,(t=>t.type)),i=e.map((()=>[]));for(const r of t){const t=this.numberAdapter.toNumber(r);Xi(new Date(Math.min(t,0)),new Date(Math.max(t,0)),e).forEach(((t,e)=>i[e].push(t)))}return i}generateAriaLabel(){return function(t){const e=er.map((e=>zt(t[e])?`${t[e]}${tr[e]}`:"")),i=ir.map((e=>zt(t[e])?`${t[e]}${tr[e]}`:""));return`P${e.join("")}T${i.join("")}`}(Zi(Vi(this.__from,this.__to)?this.__from:this.__to,Vi(this.__from,this.__to)?this.__to:this.__from,jt(this.__availableDurationParts,(t=>t.type))))}connectedCallback(){this.role="timer",this.partsOptions=this.__partsOptions??{},this.initialValue=this.__initialValuePlain,this.precision=this.__precision,super.connectedCallback()}shouldRebuildParts(t){return super.shouldRebuildParts(t)||t.has("precision")}willUpdate(t){super.willUpdate(t),t.has("locale")&&(this.__dateTimeFieldLabels=function(t){const e=new Intl.DisplayNames(t,{type:"dateTimeField"});return Ji.reduce(((t,i)=>(t[i]=e.of(i)??"",t)),{})}(this.localeInstance))}render(){const t=this.extractCellStyles(),e=this.extractDigitStyles(),i=this.extractPartStyles(),r=this.extractAnimationOptions(),s=this.extractKeyframes(),n=jt(this.__availableDurationParts,(t=>t.type));return F`
337
338
  <timered-counter-roller
338
339
  class="timered-counter timered-counter-datetime-duration"
339
340
  exportparts="group, part, digit, cell, prefix, suffix, part-suffix"
@@ -352,9 +353,9 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
352
353
  @roller-animation-start=${this.dispatchTimeredCounterAnimationStart}
353
354
  @roller-animation-end=${this.dispatchTimeredCounterAnimationEnd}
354
355
  ><slot name="prefix" slot="prefix"></slot
355
- ><slot name="suffix" slot="suffix"></slot>${Pt(this.parts,((t,e)=>e),((t,e)=>F`<span slot=${`part-suffix-${e}`} class="duration-unit"
356
+ ><slot name="suffix" slot="suffix"></slot>${Dt(this.parts,((t,e)=>e),((t,e)=>F`<span slot=${`part-suffix-${e}`} class="duration-unit"
356
357
  >${this.__dateTimeFieldLabels[n[e]]}</span
357
358
  >`))}
358
359
  </timered-counter-roller>
359
- `}},t.TimeredCounterDatetimeDuration.styles=[...t.TimeredCounter.styles,rr],e([pt({reflect:!0,converter:t=>Wt(t)?t:ue(t)})],t.TimeredCounterDatetimeDuration.prototype,"precision",null),t.TimeredCounterDatetimeDuration=e([ct("timered-counter-datetime-duration")],t.TimeredCounterDatetimeDuration),t.DurationPartMillisecond=Ki,t.DurationPartMillisecondToType=Gi,t.TimeredCounterAdapter=me,t.cubicBezier=xe,t.easeInBack=Ke,t.easeInBounce=ii,t.easeInCirc=We,t.easeInCubic=ke,t.easeInElastic=Ze,t.easeInExpo=ze,t.easeInOutBack=Je,t.easeInOutBounce=ri,t.easeInOutCirc=qe,t.easeInOutCubic=Re,t.easeInOutElastic=ti,t.easeInOutExpo=Ye,t.easeInOutQuad=Ne,t.easeInOutQuart=Ve,t.easeInOutQuint=He,t.easeInOutSine=Oe,t.easeInQuad=Ee,t.easeInQuart=Ue,t.easeInQuint=je,t.easeInSine=Ce,t.easeOutBack=Ge,t.easeOutBounce=ei,t.easeOutCirc=Qe,t.easeOutCubic=Ie,t.easeOutElastic=Xe,t.easeOutExpo=Fe,t.easeOutQuad=Me,t.easeOutQuart=Le,t.easeOutQuint=Be,t.easeOutSine=we,t.linear=t=>t,t.noop=De,t.registerNumberAdapter=function(...t){me.registerNumberAdapter(...t)},t.registerStringAdapter=function(...t){me.registerStringAdapter(...t)},t.setNumberAdapter=function(...t){me.setNumberAdapter(...t)},t.setStringAdapter=function(...t){me.setStringAdapter(...t)}},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TimeredCounter={});
360
+ `}},t.TimeredCounterDatetimeDuration.styles=[...t.TimeredCounter.styles,rr],e([pt({reflect:!0,converter:t=>Wt(t)?t:ue(t)})],t.TimeredCounterDatetimeDuration.prototype,"precision",null),t.TimeredCounterDatetimeDuration=e([ct("timered-counter-datetime-duration")],t.TimeredCounterDatetimeDuration),t.DurationPartMillisecond=Ki,t.DurationPartMillisecondToType=Gi,t.TimeredCounterAdapter=me,t.cubicBezier=xe,t.easeInBack=Ke,t.easeInBounce=ii,t.easeInCirc=We,t.easeInCubic=ke,t.easeInElastic=Ze,t.easeInExpo=ze,t.easeInOutBack=Je,t.easeInOutBounce=ri,t.easeInOutCirc=qe,t.easeInOutCubic=Re,t.easeInOutElastic=ti,t.easeInOutExpo=Ye,t.easeInOutQuad=Ne,t.easeInOutQuart=Ve,t.easeInOutQuint=He,t.easeInOutSine=Oe,t.easeInQuad=Ee,t.easeInQuart=Ue,t.easeInQuint=je,t.easeInSine=Ce,t.easeOutBack=Ge,t.easeOutBounce=ei,t.easeOutCirc=Qe,t.easeOutCubic=Ie,t.easeOutElastic=Xe,t.easeOutExpo=Fe,t.easeOutQuad=Me,t.easeOutQuart=Le,t.easeOutQuint=Be,t.easeOutSine=we,t.linear=t=>t,t.noop=Pe,t.registerNumberAdapter=function(...t){me.registerNumberAdapter(...t)},t.registerStringAdapter=function(...t){me.registerStringAdapter(...t)},t.setNumberAdapter=function(...t){me.setNumberAdapter(...t)},t.setStringAdapter=function(...t){me.setStringAdapter(...t)}},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).TimeredCounter={});
360
361
  //# sourceMappingURL=timered-counter.global.js.map