timered-counter 1.0.0 → 1.1.1

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.
Files changed (53) hide show
  1. package/custom-elements.json +253 -103
  2. package/dist/custom-elements.json +253 -103
  3. package/dist/decimal-js-number-adapter.esm-browser.js +9 -0
  4. package/dist/decimal-js-number-adapter.esm-browser.js.map +1 -0
  5. package/dist/decimal-js-number-adapter.global.js +10 -0
  6. package/dist/decimal-js-number-adapter.global.js.map +1 -0
  7. package/dist/grapheme-splitter-string-adapter.esm-browser.js +2 -0
  8. package/dist/grapheme-splitter-string-adapter.esm-browser.js.map +1 -0
  9. package/dist/grapheme-splitter-string-adapter.global.js +2 -0
  10. package/dist/grapheme-splitter-string-adapter.global.js.map +1 -0
  11. package/dist/src/index.d.ts +1 -5
  12. package/dist/src/index.js +1 -7
  13. package/dist/src/index.js.map +1 -1
  14. package/dist/src/mixins/counter-base.js +9 -9
  15. package/dist/src/mixins/counter-base.js.map +1 -1
  16. package/dist/src/number-adapter/decimal-js.d.ts +8 -1
  17. package/dist/src/number-adapter/decimal-js.js +7 -0
  18. package/dist/src/number-adapter/decimal-js.js.map +1 -1
  19. package/dist/src/number-adapter/index.d.ts +6 -4
  20. package/dist/src/number-adapter/index.js +7 -4
  21. package/dist/src/number-adapter/index.js.map +1 -1
  22. package/dist/src/string-adapter/grapheme-splitter.d.ts +7 -0
  23. package/dist/src/string-adapter/grapheme-splitter.js +7 -0
  24. package/dist/src/string-adapter/grapheme-splitter.js.map +1 -1
  25. package/dist/src/string-adapter/index.d.ts +6 -4
  26. package/dist/src/string-adapter/index.js +7 -4
  27. package/dist/src/string-adapter/index.js.map +1 -1
  28. package/dist/src/timered-counter-adapter.d.ts +65 -0
  29. package/dist/src/timered-counter-adapter.js +120 -0
  30. package/dist/src/timered-counter-adapter.js.map +1 -0
  31. package/dist/src/transitions/roller/roller-digit.js +3 -3
  32. package/dist/src/transitions/roller/roller-digit.js.map +1 -1
  33. package/dist/src/transitions/roller/roller.js +1 -1
  34. package/dist/src/transitions/roller/roller.js.map +1 -1
  35. package/dist/stories/timered-counter/decimaljs.stories.js +4 -2
  36. package/dist/stories/timered-counter/decimaljs.stories.js.map +1 -1
  37. package/dist/stories/timered-counter-number/decimaljs.stories.js +4 -2
  38. package/dist/stories/timered-counter-number/decimaljs.stories.js.map +1 -1
  39. package/dist/stories/timered-counter-string/decimaljs.stories.js +4 -2
  40. package/dist/stories/timered-counter-string/decimaljs.stories.js.map +1 -1
  41. package/dist/stories/timered-counter-string/grapheme-splitter.stories.js +7 -3
  42. package/dist/stories/timered-counter-string/grapheme-splitter.stories.js.map +1 -1
  43. package/dist/stories/timered-counter-string/intl-segmenter.stories.js +5 -3
  44. package/dist/stories/timered-counter-string/intl-segmenter.stories.js.map +1 -1
  45. package/dist/timered-counter.esm-browser.js +51 -58
  46. package/dist/timered-counter.esm-browser.js.map +1 -1
  47. package/dist/timered-counter.global.js +51 -58
  48. package/dist/timered-counter.global.js.map +1 -1
  49. package/dist/tsconfig.tsbuildinfo +1 -1
  50. package/package.json +2 -2
  51. package/dist/src/counter-adapter.d.ts +0 -38
  52. package/dist/src/counter-adapter.js +0 -71
  53. package/dist/src/counter-adapter.js.map +0 -1
@@ -1,43 +1,43 @@
1
- var t,e;t=this,e=function(t){function e(t,e,i,r){var n,s=arguments.length,o=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(s<3?n(o):s>3?n(e,i,o):n(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o}function i(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)}"function"==typeof SuppressedError&&SuppressedError;
1
+ var t,e;t=this,e=function(t){function e(t,e,i,r){var s,n=arguments.length,o=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,i,o):s(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o}function i(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)}"function"==typeof SuppressedError&&SuppressedError;
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2019 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
6
  */
7
- const r=globalThis,n=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;let a=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(n&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&o.set(e,t))}return t}toString(){return this.cssText}};const l=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,r)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1]),t[0]);return new a(i,t,s)},u=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,s))(e)})(t):t
7
+ const r=globalThis,s=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),o=new WeakMap;let a=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(s&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&o.set(e,t))}return t}toString(){return this.cssText}};const l=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,r)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1]),t[0]);return new a(i,t,n)},c=s?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,n))(e)})(t):t
8
8
  /**
9
9
  * @license
10
10
  * Copyright 2017 Google LLC
11
11
  * SPDX-License-Identifier: BSD-3-Clause
12
- */,{is:c,defineProperty:h,getOwnPropertyDescriptor:d,getOwnPropertyNames:p,getOwnPropertySymbols:f,getPrototypeOf:m}=Object,g=globalThis,y=g.trustedTypes,_=y?y.emptyScript:"",v=g.reactiveElementPolyfillSupport,b=(t,e)=>t,w={toAttribute(t,e){switch(e){case Boolean:t=t?_:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},A=(t,e)=>!c(t,e),$={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:A};Symbol.metadata??=Symbol("metadata"),g.litPropertyMetadata??=new WeakMap;class S extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=$){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);void 0!==r&&h(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:n}=d(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return r?.call(this)},set(e){const s=r?.call(this);n.call(this,e),this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??$}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=m(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,e=[...p(t),...f(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(u(t))}else void 0!==t&&e.push(u(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(n)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),n=r.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&!0===i.reflect){const n=(void 0!==i.converter?.toAttribute?i.converter:w).toAttribute(e,i.type);this._$Em=t,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(t,e){const i=this.constructor,r=i._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=i.getPropertyOptions(r),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:w;this._$Em=r,this[r]=n.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??A)(this[t],e))return;this.P(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t)!0!==i.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],i)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[b("elementProperties")]=new Map,S[b("finalized")]=new Map,v?.({ReactiveElement:S}),(g.reactiveElementVersions??=[]).push("2.0.4");
12
+ */,{is:u,defineProperty:h,getOwnPropertyDescriptor:p,getOwnPropertyNames:d,getOwnPropertySymbols:f,getPrototypeOf:m}=Object,y=globalThis,_=y.trustedTypes,g=_?_.emptyScript:"",A=y.reactiveElementPolyfillSupport,b=(t,e)=>t,$={toAttribute(t,e){switch(e){case Boolean:t=t?g:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},v=(t,e)=>!u(t,e),S={attribute:!0,type:String,converter:$,reflect:!1,hasChanged:v};Symbol.metadata??=Symbol("metadata"),y.litPropertyMetadata??=new WeakMap;class T extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=S){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);void 0!==r&&h(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:s}=p(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return r?.call(this)},set(e){const n=r?.call(this);s.call(this,e),this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??S}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=m(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,e=[...d(t),...f(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(c(t))}else void 0!==t&&e.push(c(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(s)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),s=r.litNonce;void 0!==s&&e.setAttribute("nonce",s),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&!0===i.reflect){const s=(void 0!==i.converter?.toAttribute?i.converter:$).toAttribute(e,i.type);this._$Em=t,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(t,e){const i=this.constructor,r=i._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=i.getPropertyOptions(r),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:$;this._$Em=r,this[r]=s.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??v)(this[t],e))return;this.P(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t)!0!==i.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],i)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}T.elementStyles=[],T.shadowRootOptions={mode:"open"},T[b("elementProperties")]=new Map,T[b("finalized")]=new Map,A?.({ReactiveElement:T}),(y.reactiveElementVersions??=[]).push("2.0.4");
13
13
  /**
14
14
  * @license
15
15
  * Copyright 2017 Google LLC
16
16
  * SPDX-License-Identifier: BSD-3-Clause
17
17
  */
18
- const x=globalThis,N=x.trustedTypes,O=N?N.createPolicy("lit-html",{createHTML:t=>t}):void 0,T="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,D="?"+E,C=`<${D}>`,P=document,M=()=>P.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,j=/>/g,V=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,H=/"/g,F=/^(?:script|style|textarea|title)$/i,q=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),z=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),Z=new WeakMap,W=P.createTreeWalker(P,129);function Q(t,e){if(!I(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==O?O.createHTML(e):e}class G{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,s=0;const o=t.length-1,a=this.parts,[l,u]=((t,e)=>{const i=t.length-1,r=[];let n,s=2===e?"<svg>":3===e?"<math>":"",o=U;for(let e=0;e<i;e++){const i=t[e];let a,l,u=-1,c=0;for(;c<i.length&&(o.lastIndex=c,l=o.exec(i),null!==l);)c=o.lastIndex,o===U?"!--"===l[1]?o=L:void 0!==l[1]?o=j:void 0!==l[2]?(F.test(l[2])&&(n=RegExp("</"+l[2],"g")),o=V):void 0!==l[3]&&(o=V):o===V?">"===l[0]?(o=n??U,u=-1):void 0===l[1]?u=-2:(u=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?V:'"'===l[3]?H:B):o===H||o===B?o=V:o===L||o===j?o=U:(o=V,n=void 0);const h=o===V&&t[e+1].startsWith("/>")?" ":"";s+=o===U?i+C:u>=0?(r.push(a),i.slice(0,u)+T+i.slice(u)+E+h):i+E+(-2===u?e:h)}return[Q(t,s+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),r]})(t,e);if(this.el=G.createElement(l,i),W.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=W.nextNode())&&a.length<o;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(T)){const e=u[s++],i=r.getAttribute(t).split(E),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:n,name:o[2],strings:i,ctor:"."===o[1]?et:"?"===o[1]?it:"@"===o[1]?rt:tt}),r.removeAttribute(t)}else t.startsWith(E)&&(a.push({type:6,index:n}),r.removeAttribute(t));if(F.test(r.tagName)){const t=r.textContent.split(E),e=t.length-1;if(e>0){r.textContent=N?N.emptyScript:"";for(let i=0;i<e;i++)r.append(t[i],M()),W.nextNode(),a.push({type:2,index:++n});r.append(t[e],M())}}}else if(8===r.nodeType)if(r.data===D)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=r.data.indexOf(E,t+1));)a.push({type:7,index:n}),t+=E.length-1}n++}}static createElement(t,e){const i=P.createElement("template");return i.innerHTML=t,i}}function K(t,e,i=t,r){if(e===z)return e;let n=void 0!==r?i._$Co?.[r]:i._$Cl;const s=k(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),void 0===s?n=void 0:(n=new s(t),n._$AT(t,i,r)),void 0!==r?(i._$Co??=[])[r]=n:i._$Cl=n),void 0!==n&&(e=K(t,n._$AS(t,e.values),n,r)),e}let J=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??P).importNode(e,!0);W.currentNode=r;let n=W.nextNode(),s=0,o=0,a=i[0];for(;void 0!==a;){if(s===a.index){let e;2===a.type?e=new X(n,n.nextSibling,this,t):1===a.type?e=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(e=new nt(n,this,t)),this._$AV.push(e),a=i[++o]}s!==a?.index&&(n=W.nextNode(),s++)}return W.currentNode=P,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=Y,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=K(this,t,e),k(t)?t===Y||null==t||""===t?(this._$AH!==Y&&this._$AR(),this._$AH=Y):t!==this._$AH&&t!==z&&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!==Y&&k(this._$AH)?this._$AA.nextSibling.data=t:this.T(P.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(Q(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{const t=new J(r,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=Z.get(t.strings);return void 0===e&&Z.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 n of t)r===e.length?e.push(i=new X(this.O(M()),this.O(M()),this,this.options)):i=e[r],i._$AI(n),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,n){this.type=1,this._$AH=Y,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Y}_$AI(t,e=this,i,r){const n=this.strings;let s=!1;if(void 0===n)t=K(this,t,e,0),s=!k(t)||t!==this._$AH&&t!==z,s&&(this._$AH=t);else{const r=t;let o,a;for(t=n[0],o=0;o<n.length-1;o++)a=K(this,r[i+o],e,o),a===z&&(a=this._$AH[o]),s||=!k(a)||a!==this._$AH[o],a===Y?t=Y:t!==Y&&(t+=(a??"")+n[o+1]),this._$AH[o]=a}s&&!r&&this.j(t)}j(t){t===Y?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===Y?void 0:t}}class it extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==Y)}}class rt extends tt{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){if((t=K(this,t,e,0)??Y)===z)return;const i=this._$AH,r=t===Y&&i!==Y||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==Y&&(i===Y||r);r&&this.element.removeEventListener(this.name,this,i),n&&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 nt{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){K(this,t)}}const st={I:X},ot=x.litHtmlPolyfillSupport;ot?.(G,X),(x.litHtmlVersions??=[]).push("3.2.1");
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");
19
19
  /**
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
23
23
  */
24
- let at=class extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const r=i?.renderBefore??e;let n=r._$litPart$;if(void 0===n){const t=i?.renderBefore??null;r._$litPart$=n=new X(e.insertBefore(M(),t),t,void 0,i??{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return z}};at._$litElement$=!0,at.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:at});const lt=globalThis.litElementPolyfillSupport;lt?.({LitElement:at}),(globalThis.litElementVersions??=[]).push("4.1.1");
24
+ let at=class extends T{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const r=i?.renderBefore??e;let s=r._$litPart$;if(void 0===s){const t=i?.renderBefore??null;r._$litPart$=s=new X(e.insertBefore(N(),t),t,void 0,i??{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Y}};at._$litElement$=!0,at.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:at});const lt=globalThis.litElementPolyfillSupport;lt?.({LitElement:at}),(globalThis.litElementVersions??=[]).push("4.1.1");
25
25
  /**
26
26
  * @license
27
27
  * Copyright 2017 Google LLC
28
28
  * SPDX-License-Identifier: BSD-3-Clause
29
29
  */
30
- const ut=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)}
30
+ const ct=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)}
31
31
  /**
32
32
  * @license
33
33
  * Copyright 2017 Google LLC
34
34
  * SPDX-License-Identifier: BSD-3-Clause
35
- */,ct={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:A},ht=(t=ct,e,i)=>{const{kind:r,metadata:n}=i;let s=globalThis.litPropertyMetadata.get(n);if(void 0===s&&globalThis.litPropertyMetadata.set(n,s=new Map),s.set(i.name,t),"accessor"===r){const{name:r}=i;return{set(i){const n=e.get.call(this);e.set.call(this,i),this.requestUpdate(r,n,t)},init(e){return void 0!==e&&this.P(r,void 0,t),e}}}if("setter"===r){const{name:r}=i;return function(i){const n=this[r];e.call(this,i),this.requestUpdate(r,n,t)}}throw Error("Unsupported decorator location: "+r)};function dt(t){return(e,i)=>"object"==typeof i?ht(t,e,i):((t,e,i)=>{const r=e.hasOwnProperty(i);return e.constructor.createProperty(i,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)
35
+ */,ut={attribute:!0,type:String,converter:$,reflect:!1,hasChanged:v},ht=(t=ut,e,i)=>{const{kind:r,metadata:s}=i;let n=globalThis.litPropertyMetadata.get(s);if(void 0===n&&globalThis.litPropertyMetadata.set(s,n=new Map),n.set(i.name,t),"accessor"===r){const{name:r}=i;return{set(i){const s=e.get.call(this);e.set.call(this,i),this.requestUpdate(r,s,t)},init(e){return void 0!==e&&this.P(r,void 0,t),e}}}if("setter"===r){const{name:r}=i;return function(i){const s=this[r];e.call(this,i),this.requestUpdate(r,s,t)}}throw Error("Unsupported decorator location: "+r)};function pt(t){return(e,i)=>"object"==typeof i?ht(t,e,i):((t,e,i)=>{const r=e.hasOwnProperty(i);return e.constructor.createProperty(i,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)
36
36
  /**
37
37
  * @license
38
38
  * Copyright 2017 Google LLC
39
39
  * SPDX-License-Identifier: BSD-3-Clause
40
- */}function pt(t){return dt({...t,state:!0,attribute:!1})}
40
+ */}function dt(t){return pt({...t,state:!0,attribute:!1})}
41
41
  /**
42
42
  * @license
43
43
  * Copyright 2017 Google LLC
@@ -53,24 +53,17 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
53
53
  * @license
54
54
  * Copyright 2017 Google LLC
55
55
  * SPDX-License-Identifier: BSD-3-Clause
56
- */const mt=1,gt=2,yt=t=>(...e)=>({_$litDirective$:t,values:e});let _t=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
56
+ */const mt=1,yt=2,_t=t=>(...e)=>({_$litDirective$:t,values:e});let gt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
57
57
  /**
58
58
  * @license
59
59
  * Copyright 2020 Google LLC
60
60
  * SPDX-License-Identifier: BSD-3-Clause
61
- */const{I:vt}=st,bt=()=>document.createComment(""),wt=(t,e,i)=>{const r=t._$AA.parentNode,n=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=r.insertBefore(bt(),n),s=r.insertBefore(bt(),n);i=new vt(e,s,t,t.options)}else{const e=i._$AB.nextSibling,s=i._$AM,o=s!==t;if(o){let e;i._$AQ?.(t),i._$AM=t,void 0!==i._$AP&&(e=t._$AU)!==s._$AU&&i._$AP(e)}if(e!==n||o){let t=i._$AA;for(;t!==e;){const e=t.nextSibling;r.insertBefore(t,n),t=e}}}return i},At=(t,e,i=t)=>(t._$AI(e,i),t),$t={},St=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}},xt=(t,e,i)=>{const r=new Map;for(let n=e;n<=i;n++)r.set(t[n],n);return r},Nt=yt(class extends _t{constructor(t){if(super(t),t.type!==gt)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 n=[],s=[];let o=0;for(const e of t)n[o]=r?r(e,o):o,s[o]=i(e,o),o++;return{values:s,keys:n}}render(t,e,i){return this.dt(t,e,i).values}update(t,[e,i,r]){const n=(t=>t._$AH)(t),{values:s,keys:o}=this.dt(e,i,r);if(!Array.isArray(n))return this.ut=o,s;const a=this.ut??=[],l=[];let u,c,h=0,d=n.length-1,p=0,f=s.length-1;for(;h<=d&&p<=f;)if(null===n[h])h++;else if(null===n[d])d--;else if(a[h]===o[p])l[p]=At(n[h],s[p]),h++,p++;else if(a[d]===o[f])l[f]=At(n[d],s[f]),d--,f--;else if(a[h]===o[f])l[f]=At(n[h],s[f]),wt(t,l[f+1],n[h]),h++,f--;else if(a[d]===o[p])l[p]=At(n[d],s[p]),wt(t,n[h],n[d]),d--,p++;else if(void 0===u&&(u=xt(o,p,f),c=xt(a,h,d)),u.has(a[h]))if(u.has(a[d])){const e=c.get(o[p]),i=void 0!==e?n[e]:null;if(null===i){const e=wt(t,n[h]);At(e,s[p]),l[p]=e}else l[p]=At(i,s[p]),wt(t,n[h],i),n[e]=null;p++}else St(n[d]),d--;else St(n[h]),h++;for(;p<=f;){const e=wt(t,l[f+1]);At(e,s[p]),l[p++]=e}for(;h<=d;){const t=n[h++];null!==t&&St(t)}return this.ut=o,((t,e=$t)=>{t._$AH=e})(t,l),z}});
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}});
62
62
  /**
63
63
  * @license
64
64
  * Copyright 2017 Google LLC
65
65
  * SPDX-License-Identifier: BSD-3-Clause
66
- */var Ot={done:!0,hasNext:!1},Tt={done:!1,hasNext:!1},Et=()=>Ot;function Dt(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)),n=0;for(;n<e.length;){if(void 0===r[n]||!Pt(i)){i=(0,e[n])(i),n+=1;continue}let t=[];for(let i=n;i<e.length;i++){let e=r[i];if(void 0===e||(t.push(e),e.isSingle))break}let s=[];for(let e of i)if(Ct(e,s,t))break;let{isSingle:o}=t.at(-1);i=o?s[0]:s,n+=t.length}return i}function Ct(t,e,i){if(0===i.length)return e.push(t),!1;let r=t,n=Tt,s=!1;for(let[t,o]of i.entries()){let{index:a,items:l}=o;if(l.push(r),n=o(r,a,l),o.index+=1,n.hasNext){if(n.hasMany){for(let r of n.next)if(Ct(r,e,i.slice(t+1)))return!0;return s}r=n.next}if(!n.hasNext)break;n.done&&(s=!0)}return n.hasNext&&e.push(r),s}function Pt(t){return"string"==typeof t||"object"==typeof t&&null!==t&&Symbol.iterator in t}function Mt(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 Mt(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 Mt(jt,t)}var jt=(t,e)=>({...t,...e});function Vt(...t){return Mt(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 Ft(t){return"number"==typeof t&&!Number.isNaN(t)}function qt(t){return"string"==typeof t}function zt(t){return void 0===t||("string"==typeof t||Array.isArray(t)?0===t.length:0===Object.keys(t).length)}function Yt(t){return null==t}function Zt(t){return Array.isArray(t)}function Wt(t){return"boolean"==typeof t}function Qt(t){return t instanceof Date}function Gt(...t){return Mt(Kt,t)}function Kt(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(!Kt(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)||!Kt(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,n]of i.entries())if(Kt(e,n)){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)||!Kt(r,e[i]))return!1;return!0}function Jt(...t){return function(t,e){let i=e.length-t.length;if(1===i){let[i,...r]=e;return Dt(i,{lazy:t,lazyArgs:r})}if(0===i){let i={lazy:t,lazyArgs:e};return Object.assign((t=>Dt(t,i)),i)}throw new Error("Wrong number of arguments")}(Xt,t)}function Xt(t){if(0===t.length)return Et;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?Tt:(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,n=[];for(let t=0;t<r.length;t+=1){const e=Zt(i)?i[t]:i;n.push(e)}return n}function ee(t,e){const i=te(t,e),{data:r}=e,n=[];for(let t=0;t<r.length;t+=1){const{digits:e}=r[t],s=i[t];n.push([]);for(let i=0;i<e.length;i+=1){const e=Zt(s)?s[i]:s;n[t].push(e)}}return n}function ie(t,e){const i=ee(t,e),{data:r}=e,n=[];for(let t=0;t<r.length;t+=1){const{digits:e}=r[t],s=i[t];n.push([]);for(let i=0;i<e.length;i+=1){const{data:r}=e[i],o=s[i];n[t].push([]);for(let e=0;e<r.length;e+=1){const r=Zt(o)?o[e]:o;n[t][i].push(r)}}}return n}function re(t,e){return Lt(t??{},e??{})}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]=re(t[i],e[i])}return t}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]=ne(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]=se(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=se(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=ne(te(this.partStyles??{},t),te(this.partStylesDynamic??{},t));return Gt(this.cachedPartStyles,e)||(this.cachedPartStyles=e),this.cachedPartStyles}}return e([dt({type:Object,attribute:"cell-styles",reflect:!0})],i.prototype,"cellStyles",void 0),e([dt({type:Object,attribute:"digit-styles",reflect:!0})],i.prototype,"digitStyles",void 0),e([dt({type:Object,attribute:"part-styles",reflect:!0})],i.prototype,"partStyles",void 0),e([dt({type:String,reflect:!0})],i.prototype,"color",void 0),i};function ae(t){return t.length}function le(){return function(t){if(!(n=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 n of t)null!=(n=e(n,++r,t))&&(i>n||void 0===i&&n>=n)&&(i=n)}return i}(t,ae),r=new Array(i);++e<i;)for(var n,s=-1,o=r[e]=new Array(n);++s<n;)o[s]=t[s][e];return r}(arguments)}function ue(t,e){const[i,r]=t,[n,s]=e,o={animate:!0,cancelPrevAnimation:!1};let a="";return 1===n.data.length&&(o.animate=!1,o.cancelPrevAnimation=!0,a="only one digit"),i!==r||(n.data[0]===n.data[n.data.length-1]&&(o.animate=!1,o.cancelPrevAnimation=!0,a="same head and tail"),Gt(n,s)&&(o.animate=!1,a="same digits"),a&&(o.earlyReturn=a)),o}function ce(t){try{return JSON.parse(t)}catch(e){return t}}function he(t){const e={};return Zt(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 de=t=>{var r,n;class s extends t{constructor(){super(...arguments),n.set(this,{...r.DEFAULT_PARTS_OPTIONS}),this.parts=[],this.oldParts=[],this.partPreprocessDataList=[]}get partsOptions(){return i(this,n,"f")}set partsOptions(t){const e=i(this,n,"f");!function(t,e,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?n.call(t,i):n?n.value=i:e.set(t,i)}(this,n,he({...r.DEFAULT_PARTS_OPTIONS,...t}),"f"),this.requestUpdate("partsOptions",e)}sampling(t,e){return function(t,e,i,r){let n=r;const s=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)&&(n=1);const o=[];for(let e=0;e<n;e++){const i=t.div(t.create(e),t.create(Math.max(n-1,1)));o.push(s(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 n=[];let s=0;for(let o=0;o<e.length;o++){const a=e[o],l=r?.[o],u=[];for(let e=0;e<a.digits.length;e++){const r=a.digits[e],n=l?.digits.find((t=>t.place===r.place));u.push({...ue([t,i],[r,n]),index:s++,partIndex:o,digitIndex:e})}n.push(u)}return n}(this.direction,this.parts,this.oldDirection,this.oldParts))}processPartData(){const{decimalSeparator:t,digitToChar:e,minPlaces:i,fillChar:r,type:n}=this.partsOptions,s=this.value,o=this.oldValue;let a=e=>this.sampleToString(e).split(t);"string"===n&&(a=t=>[this.sampleToString(t),""]);const l=[],u=this.sampleSplit(this.sampling(s,o));{const n=this.numberAdapter.gt(s,o)?"down":"up";for(let s=0;s<u.length;s++){const o=u[s],c=o["down"===n?0:o.length-1],[h=1,d=0]=i,p=a(c),f=Math.max(this.stringAdapter.stringToChars(p[0]).length,h),m=Math.max(this.stringAdapter.stringToChars(p[1]??"").length,d),g=le(...o.map((e=>{const[i="",n=""]=a(e),s=this.stringAdapter.stringToChars(i),o=this.stringAdapter.stringToChars(n),l=Math.max(f-s.length,0),u=Math.max(m-o.length,0);let c=[].concat(new Array(l).fill(r),s);return m>0&&(c=c.concat([t],o,new Array(u).fill(r))),c}))).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:g})}}return l}}return r=s,n=new WeakMap,s.DEFAULT_PARTS_OPTIONS={sampleCount:16,decimalSeparator:".",fillChar:"0",minPlaces:[1,0],digitToChar:{},type:"number"},e([dt({type:Object,attribute:"parts-options",converter:t=>ce(t??"")??{},noAccessor:!0})],s.prototype,"partsOptions",null),s},pe=()=>({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)})
67
- /*!
68
- * decimal.js v10.4.3
69
- * An arbitrary-precision Decimal type for JavaScript.
70
- * https://github.com/MikeMcl/decimal.js
71
- * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
72
- * MIT Licence
73
- */;var fe,me,ge=9e15,ye=1e9,_e="0123456789abcdef",ve="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",be="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",we={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:ge,crypto:!1},Ae=!0,$e="[DecimalError] ",Se=$e+"Invalid argument: ",xe=$e+"Precision limit exceeded",Ne=$e+"crypto unavailable",Oe="[object Decimal]",Te=Math.floor,Ee=Math.pow,De=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Ce=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Pe=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Me=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ke=1e7,Ie=ve.length-1,Re=be.length-1,Ue={toStringTag:Oe};function Le(t){var e,i,r,n=t.length-1,s="",o=t[0];if(n>0){for(s+=o,e=1;e<n;e++)(i=7-(r=t[e]+"").length)&&(s+=Qe(i)),s+=r;(i=7-(r=(o=t[e])+"").length)&&(s+=Qe(i))}else if(0===o)return"0";for(;o%10==0;)o/=10;return s+o}function je(t,e,i){if(t!==~~t||t<e||t>i)throw Error(Se+t)}function Ve(t,e,i,r){var n,s,o,a;for(s=t[0];s>=10;s/=10)--e;return--e<0?(e+=7,n=0):(n=Math.ceil((e+1)/7),e%=7),s=Ee(10,7-e),a=t[n]%s|0,null==r?e<3?(0==e?a=a/100|0:1==e&&(a=a/10|0),o=i<4&&99999==a||i>3&&49999==a||5e4==a||0==a):o=(i<4&&a+1==s||i>3&&a+1==s/2)&&(t[n+1]/s/100|0)==Ee(10,e-2)-1||(a==s/2||0==a)&&!(t[n+1]/s/100|0):e<4?(0==e?a=a/1e3|0:1==e?a=a/100|0:2==e&&(a=a/10|0),o=(r||i<4)&&9999==a||!r&&i>3&&4999==a):o=((r||i<4)&&a+1==s||!r&&i>3&&a+1==s/2)&&(t[n+1]/s/1e3|0)==Ee(10,e-3)-1,o}function Be(t,e,i){for(var r,n,s=[0],o=0,a=t.length;o<a;){for(n=s.length;n--;)s[n]*=e;for(s[0]+=_e.indexOf(t.charAt(o++)),r=0;r<s.length;r++)s[r]>i-1&&(void 0===s[r+1]&&(s[r+1]=0),s[r+1]+=s[r]/i|0,s[r]%=i)}return s.reverse()}Ue.absoluteValue=Ue.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),Fe(t)},Ue.ceil=function(){return Fe(new this.constructor(this),this.e+1,2)},Ue.clampedTo=Ue.clamp=function(t,e){var i=this,r=i.constructor;if(t=new r(t),e=new r(e),!t.s||!e.s)return new r(NaN);if(t.gt(e))throw Error(Se+e);return i.cmp(t)<0?t:i.cmp(e)>0?e:new r(i)},Ue.comparedTo=Ue.cmp=function(t){var e,i,r,n,s=this,o=s.d,a=(t=new s.constructor(t)).d,l=s.s,u=t.s;if(!o||!a)return l&&u?l!==u?l:o===a?0:!o^l<0?1:-1:NaN;if(!o[0]||!a[0])return o[0]?l:a[0]?-u:0;if(l!==u)return l;if(s.e!==t.e)return s.e>t.e^l<0?1:-1;for(e=0,i=(r=o.length)<(n=a.length)?r:n;e<i;++e)if(o[e]!==a[e])return o[e]>a[e]^l<0?1:-1;return r===n?0:r>n^l<0?1:-1},Ue.cosine=Ue.cos=function(){var t,e,i=this,r=i.constructor;return i.d?i.d[0]?(t=r.precision,e=r.rounding,r.precision=t+Math.max(i.e,i.sd())+7,r.rounding=1,i=function(t,e){var i,r,n;if(e.isZero())return e;(r=e.d.length)<32?n=(1/si(4,i=Math.ceil(r/3))).toString():(i=16,n="2.3283064365386962890625e-10"),t.precision+=i,e=ni(t,1,e.times(n),new t(1));for(var s=i;s--;){var o=e.times(e);e=o.times(o).minus(o).times(8).plus(1)}return t.precision-=i,e}(r,oi(r,i)),r.precision=t,r.rounding=e,Fe(2==me||3==me?i.neg():i,t,e,!0)):new r(1):new r(NaN)},Ue.cubeRoot=Ue.cbrt=function(){var t,e,i,r,n,s,o,a,l,u,c=this,h=c.constructor;if(!c.isFinite()||c.isZero())return new h(c);for(Ae=!1,(s=c.s*Ee(c.s*c,1/3))&&Math.abs(s)!=1/0?r=new h(s.toString()):(i=Le(c.d),(s=((t=c.e)-i.length+1)%3)&&(i+=1==s||-2==s?"0":"00"),s=Ee(i,1/3),t=Te((t+1)/3)-(t%3==(t<0?-1:2)),(r=new h(i=s==1/0?"5e"+t:(i=s.toExponential()).slice(0,i.indexOf("e")+1)+t)).s=c.s),o=(t=h.precision)+3;;)if(u=(l=(a=r).times(a).times(a)).plus(c),r=He(u.plus(c).times(a),u.plus(l),o+2,1),Le(a.d).slice(0,o)===(i=Le(r.d)).slice(0,o)){if("9999"!=(i=i.slice(o-3,o+1))&&(n||"4999"!=i)){+i&&(+i.slice(1)||"5"!=i.charAt(0))||(Fe(r,t+1,1),e=!r.times(r).times(r).eq(c));break}if(!n&&(Fe(a,t+1,0),a.times(a).times(a).eq(c))){r=a;break}o+=4,n=1}return Ae=!0,Fe(r,t,h.rounding,e)},Ue.decimalPlaces=Ue.dp=function(){var t,e=this.d,i=NaN;if(e){if(i=7*((t=e.length-1)-Te(this.e/7)),t=e[t])for(;t%10==0;t/=10)i--;i<0&&(i=0)}return i},Ue.dividedBy=Ue.div=function(t){return He(this,new this.constructor(t))},Ue.dividedToIntegerBy=Ue.divToInt=function(t){var e=this.constructor;return Fe(He(this,new e(t),0,1,1),e.precision,e.rounding)},Ue.equals=Ue.eq=function(t){return 0===this.cmp(t)},Ue.floor=function(){return Fe(new this.constructor(this),this.e+1,3)},Ue.greaterThan=Ue.gt=function(t){return this.cmp(t)>0},Ue.greaterThanOrEqualTo=Ue.gte=function(t){var e=this.cmp(t);return 1==e||0===e},Ue.hyperbolicCosine=Ue.cosh=function(){var t,e,i,r,n,s=this,o=s.constructor,a=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return a;i=o.precision,r=o.rounding,o.precision=i+Math.max(s.e,s.sd())+4,o.rounding=1,(n=s.d.length)<32?e=(1/si(4,t=Math.ceil(n/3))).toString():(t=16,e="2.3283064365386962890625e-10"),s=ni(o,1,s.times(e),new o(1),!0);for(var l,u=t,c=new o(8);u--;)l=s.times(s),s=a.minus(l.times(c.minus(l.times(c))));return Fe(s,o.precision=i,o.rounding=r,!0)},Ue.hyperbolicSine=Ue.sinh=function(){var t,e,i,r,n=this,s=n.constructor;if(!n.isFinite()||n.isZero())return new s(n);if(e=s.precision,i=s.rounding,s.precision=e+Math.max(n.e,n.sd())+4,s.rounding=1,(r=n.d.length)<3)n=ni(s,2,n,n,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,n=ni(s,2,n=n.times(1/si(5,t)),n,!0);for(var o,a=new s(5),l=new s(16),u=new s(20);t--;)o=n.times(n),n=n.times(a.plus(o.times(l.times(o).plus(u))))}return s.precision=e,s.rounding=i,Fe(n,e,i,!0)},Ue.hyperbolicTangent=Ue.tanh=function(){var t,e,i=this,r=i.constructor;return i.isFinite()?i.isZero()?new r(i):(t=r.precision,e=r.rounding,r.precision=t+7,r.rounding=1,He(i.sinh(),i.cosh(),r.precision=t,r.rounding=e)):new r(i.s)},Ue.inverseCosine=Ue.acos=function(){var t,e=this,i=e.constructor,r=e.abs().cmp(1),n=i.precision,s=i.rounding;return-1!==r?0===r?e.isNeg()?Ze(i,n,s):new i(0):new i(NaN):e.isZero()?Ze(i,n+4,s).times(.5):(i.precision=n+6,i.rounding=1,e=e.asin(),t=Ze(i,n+4,s).times(.5),i.precision=n,i.rounding=s,t.minus(e))},Ue.inverseHyperbolicCosine=Ue.acosh=function(){var t,e,i=this,r=i.constructor;return i.lte(1)?new r(i.eq(1)?0:NaN):i.isFinite()?(t=r.precision,e=r.rounding,r.precision=t+Math.max(Math.abs(i.e),i.sd())+4,r.rounding=1,Ae=!1,i=i.times(i).minus(1).sqrt().plus(i),Ae=!0,r.precision=t,r.rounding=e,i.ln()):new r(i)},Ue.inverseHyperbolicSine=Ue.asinh=function(){var t,e,i=this,r=i.constructor;return!i.isFinite()||i.isZero()?new r(i):(t=r.precision,e=r.rounding,r.precision=t+2*Math.max(Math.abs(i.e),i.sd())+6,r.rounding=1,Ae=!1,i=i.times(i).plus(1).sqrt().plus(i),Ae=!0,r.precision=t,r.rounding=e,i.ln())},Ue.inverseHyperbolicTangent=Ue.atanh=function(){var t,e,i,r,n=this,s=n.constructor;return n.isFinite()?n.e>=0?new s(n.abs().eq(1)?n.s/0:n.isZero()?n:NaN):(t=s.precision,e=s.rounding,r=n.sd(),Math.max(r,t)<2*-n.e-1?Fe(new s(n),t,e,!0):(s.precision=i=r-n.e,n=He(n.plus(1),new s(1).minus(n),i+t,1),s.precision=t+4,s.rounding=1,n=n.ln(),s.precision=t,s.rounding=e,n.times(.5))):new s(NaN)},Ue.inverseSine=Ue.asin=function(){var t,e,i,r,n=this,s=n.constructor;return n.isZero()?new s(n):(e=n.abs().cmp(1),i=s.precision,r=s.rounding,-1!==e?0===e?((t=Ze(s,i+4,r).times(.5)).s=n.s,t):new s(NaN):(s.precision=i+6,s.rounding=1,n=n.div(new s(1).minus(n.times(n)).sqrt().plus(1)).atan(),s.precision=i,s.rounding=r,n.times(2)))},Ue.inverseTangent=Ue.atan=function(){var t,e,i,r,n,s,o,a,l,u=this,c=u.constructor,h=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&h+4<=Re)return(o=Ze(c,h+4,d).times(.25)).s=u.s,o}else{if(!u.s)return new c(NaN);if(h+4<=Re)return(o=Ze(c,h+4,d).times(.5)).s=u.s,o}for(c.precision=a=h+10,c.rounding=1,t=i=Math.min(28,a/7+2|0);t;--t)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(Ae=!1,e=Math.ceil(a/7),r=1,l=u.times(u),o=new c(u),n=u;-1!==t;)if(n=n.times(l),s=o.minus(n.div(r+=2)),n=n.times(l),void 0!==(o=s.plus(n.div(r+=2))).d[e])for(t=e;o.d[t]===s.d[t]&&t--;);return i&&(o=o.times(2<<i-1)),Ae=!0,Fe(o,c.precision=h,c.rounding=d,!0)},Ue.isFinite=function(){return!!this.d},Ue.isInteger=Ue.isInt=function(){return!!this.d&&Te(this.e/7)>this.d.length-2},Ue.isNaN=function(){return!this.s},Ue.isNegative=Ue.isNeg=function(){return this.s<0},Ue.isPositive=Ue.isPos=function(){return this.s>0},Ue.isZero=function(){return!!this.d&&0===this.d[0]},Ue.lessThan=Ue.lt=function(t){return this.cmp(t)<0},Ue.lessThanOrEqualTo=Ue.lte=function(t){return this.cmp(t)<1},Ue.logarithm=Ue.log=function(t){var e,i,r,n,s,o,a,l,u=this,c=u.constructor,h=c.precision,d=c.rounding;if(null==t)t=new c(10),e=!0;else{if(i=(t=new c(t)).d,t.s<0||!i||!i[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(i=u.d,u.s<0||!i||!i[0]||u.eq(1))return new c(i&&!i[0]?-1/0:1!=u.s?NaN:i?0:1/0);if(e)if(i.length>1)s=!0;else{for(n=i[0];n%10==0;)n/=10;s=1!==n}if(Ae=!1,o=ti(u,a=h+5),r=e?Ye(c,a+10):ti(t,a),Ve((l=He(o,r,a,1)).d,n=h,d))do{if(o=ti(u,a+=10),r=e?Ye(c,a+10):ti(t,a),l=He(o,r,a,1),!s){+Le(l.d).slice(n+1,n+15)+1==1e14&&(l=Fe(l,h+1,0));break}}while(Ve(l.d,n+=10,d));return Ae=!0,Fe(l,h,d)},Ue.minus=Ue.sub=function(t){var e,i,r,n,s,o,a,l,u,c,h,d,p=this,f=p.constructor;if(t=new f(t),!p.d||!t.d)return p.s&&t.s?p.d?t.s=-t.s:t=new f(t.d||p.s!==t.s?p:NaN):t=new f(NaN),t;if(p.s!=t.s)return t.s=-t.s,p.plus(t);if(u=p.d,d=t.d,a=f.precision,l=f.rounding,!u[0]||!d[0]){if(d[0])t.s=-t.s;else{if(!u[0])return new f(3===l?-0:0);t=new f(p)}return Ae?Fe(t,a,l):t}if(i=Te(t.e/7),c=Te(p.e/7),u=u.slice(),s=c-i){for((h=s<0)?(e=u,s=-s,o=d.length):(e=d,i=c,o=u.length),s>(r=Math.max(Math.ceil(a/7),o)+2)&&(s=r,e.length=1),e.reverse(),r=s;r--;)e.push(0);e.reverse()}else{for((h=(r=u.length)<(o=d.length))&&(o=r),r=0;r<o;r++)if(u[r]!=d[r]){h=u[r]<d[r];break}s=0}for(h&&(e=u,u=d,d=e,t.s=-t.s),o=u.length,r=d.length-o;r>0;--r)u[o++]=0;for(r=d.length;r>s;){if(u[--r]<d[r]){for(n=r;n&&0===u[--n];)u[n]=ke-1;--u[n],u[r]+=ke}u[r]-=d[r]}for(;0===u[--o];)u.pop();for(;0===u[0];u.shift())--i;return u[0]?(t.d=u,t.e=ze(u,i),Ae?Fe(t,a,l):t):new f(3===l?-0:0)},Ue.modulo=Ue.mod=function(t){var e,i=this,r=i.constructor;return t=new r(t),!i.d||!t.s||t.d&&!t.d[0]?new r(NaN):!t.d||i.d&&!i.d[0]?Fe(new r(i),r.precision,r.rounding):(Ae=!1,9==r.modulo?(e=He(i,t.abs(),0,3,1)).s*=t.s:e=He(i,t,0,r.modulo,1),e=e.times(t),Ae=!0,i.minus(e))},Ue.naturalExponential=Ue.exp=function(){return Xe(this)},Ue.naturalLogarithm=Ue.ln=function(){return ti(this)},Ue.negated=Ue.neg=function(){var t=new this.constructor(this);return t.s=-t.s,Fe(t)},Ue.plus=Ue.add=function(t){var e,i,r,n,s,o,a,l,u,c,h=this,d=h.constructor;if(t=new d(t),!h.d||!t.d)return h.s&&t.s?h.d||(t=new d(t.d||h.s===t.s?h:NaN)):t=new d(NaN),t;if(h.s!=t.s)return t.s=-t.s,h.minus(t);if(u=h.d,c=t.d,a=d.precision,l=d.rounding,!u[0]||!c[0])return c[0]||(t=new d(h)),Ae?Fe(t,a,l):t;if(s=Te(h.e/7),r=Te(t.e/7),u=u.slice(),n=s-r){for(n<0?(i=u,n=-n,o=c.length):(i=c,r=s,o=u.length),n>(o=(s=Math.ceil(a/7))>o?s+1:o+1)&&(n=o,i.length=1),i.reverse();n--;)i.push(0);i.reverse()}for((o=u.length)-(n=c.length)<0&&(n=o,i=c,c=u,u=i),e=0;n;)e=(u[--n]=u[n]+c[n]+e)/ke|0,u[n]%=ke;for(e&&(u.unshift(e),++r),o=u.length;0==u[--o];)u.pop();return t.d=u,t.e=ze(u,r),Ae?Fe(t,a,l):t},Ue.precision=Ue.sd=function(t){var e,i=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(Se+t);return i.d?(e=We(i.d),t&&i.e+1>e&&(e=i.e+1)):e=NaN,e},Ue.round=function(){var t=this,e=t.constructor;return Fe(new e(t),t.e+1,e.rounding)},Ue.sine=Ue.sin=function(){var t,e,i=this,r=i.constructor;return i.isFinite()?i.isZero()?new r(i):(t=r.precision,e=r.rounding,r.precision=t+Math.max(i.e,i.sd())+7,r.rounding=1,i=function(t,e){var i,r=e.d.length;if(r<3)return e.isZero()?e:ni(t,2,e,e);i=(i=1.4*Math.sqrt(r))>16?16:0|i,e=e.times(1/si(5,i)),e=ni(t,2,e,e);for(var n,s=new t(5),o=new t(16),a=new t(20);i--;)n=e.times(e),e=e.times(s.plus(n.times(o.times(n).minus(a))));return e}(r,oi(r,i)),r.precision=t,r.rounding=e,Fe(me>2?i.neg():i,t,e,!0)):new r(NaN)},Ue.squareRoot=Ue.sqrt=function(){var t,e,i,r,n,s,o=this,a=o.d,l=o.e,u=o.s,c=o.constructor;if(1!==u||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?o:1/0);for(Ae=!1,0==(u=Math.sqrt(+o))||u==1/0?(((e=Le(a)).length+l)%2==0&&(e+="0"),u=Math.sqrt(e),l=Te((l+1)/2)-(l<0||l%2),r=new c(e=u==1/0?"5e"+l:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+l)):r=new c(u.toString()),i=(l=c.precision)+3;;)if(r=(s=r).plus(He(o,s,i+2,1)).times(.5),Le(s.d).slice(0,i)===(e=Le(r.d)).slice(0,i)){if("9999"!=(e=e.slice(i-3,i+1))&&(n||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(Fe(r,l+1,1),t=!r.times(r).eq(o));break}if(!n&&(Fe(s,l+1,0),s.times(s).eq(o))){r=s;break}i+=4,n=1}return Ae=!0,Fe(r,l,c.rounding,t)},Ue.tangent=Ue.tan=function(){var t,e,i=this,r=i.constructor;return i.isFinite()?i.isZero()?new r(i):(t=r.precision,e=r.rounding,r.precision=t+10,r.rounding=1,(i=i.sin()).s=1,i=He(i,new r(1).minus(i.times(i)).sqrt(),t+10,0),r.precision=t,r.rounding=e,Fe(2==me||4==me?i.neg():i,t,e,!0)):new r(NaN)},Ue.times=Ue.mul=function(t){var e,i,r,n,s,o,a,l,u,c=this,h=c.constructor,d=c.d,p=(t=new h(t)).d;if(t.s*=c.s,!(d&&d[0]&&p&&p[0]))return new h(!t.s||d&&!d[0]&&!p||p&&!p[0]&&!d?NaN:d&&p?0*t.s:t.s/0);for(i=Te(c.e/7)+Te(t.e/7),(l=d.length)<(u=p.length)&&(s=d,d=p,p=s,o=l,l=u,u=o),s=[],r=o=l+u;r--;)s.push(0);for(r=u;--r>=0;){for(e=0,n=l+r;n>r;)a=s[n]+p[r]*d[n-r-1]+e,s[n--]=a%ke|0,e=a/ke|0;s[n]=(s[n]+e)%ke|0}for(;!s[--o];)s.pop();return e?++i:s.shift(),t.d=s,t.e=ze(s,i),Ae?Fe(t,h.precision,h.rounding):t},Ue.toBinary=function(t,e){return ai(this,2,t,e)},Ue.toDecimalPlaces=Ue.toDP=function(t,e){var i=this,r=i.constructor;return i=new r(i),void 0===t?i:(je(t,0,ye),void 0===e?e=r.rounding:je(e,0,8),Fe(i,t+i.e+1,e))},Ue.toExponential=function(t,e){var i,r=this,n=r.constructor;return void 0===t?i=qe(r,!0):(je(t,0,ye),void 0===e?e=n.rounding:je(e,0,8),i=qe(r=Fe(new n(r),t+1,e),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+i:i},Ue.toFixed=function(t,e){var i,r,n=this,s=n.constructor;return void 0===t?i=qe(n):(je(t,0,ye),void 0===e?e=s.rounding:je(e,0,8),i=qe(r=Fe(new s(n),t+n.e+1,e),!1,t+r.e+1)),n.isNeg()&&!n.isZero()?"-"+i:i},Ue.toFraction=function(t){var e,i,r,n,s,o,a,l,u,c,h,d,p=this,f=p.d,m=p.constructor;if(!f)return new m(p);if(u=i=new m(1),r=l=new m(0),o=(s=(e=new m(r)).e=We(f)-p.e-1)%7,e.d[0]=Ee(10,o<0?7+o:o),null==t)t=s>0?e:u;else{if(!(a=new m(t)).isInt()||a.lt(u))throw Error(Se+a);t=a.gt(e)?s>0?e:u:a}for(Ae=!1,a=new m(Le(f)),c=m.precision,m.precision=s=7*f.length*2;h=He(a,e,0,1,1),1!=(n=i.plus(h.times(r))).cmp(t);)i=r,r=n,n=u,u=l.plus(h.times(n)),l=n,n=e,e=a.minus(h.times(n)),a=n;return n=He(t.minus(i),r,0,1,1),l=l.plus(n.times(u)),i=i.plus(n.times(r)),l.s=u.s=p.s,d=He(u,r,s,1).minus(p).abs().cmp(He(l,i,s,1).minus(p).abs())<1?[u,r]:[l,i],m.precision=c,Ae=!0,d},Ue.toHexadecimal=Ue.toHex=function(t,e){return ai(this,16,t,e)},Ue.toNearest=function(t,e){var i=this,r=i.constructor;if(i=new r(i),null==t){if(!i.d)return i;t=new r(1),e=r.rounding}else{if(t=new r(t),void 0===e?e=r.rounding:je(e,0,8),!i.d)return t.s?i:t;if(!t.d)return t.s&&(t.s=i.s),t}return t.d[0]?(Ae=!1,i=He(i,t,0,e,1).times(t),Ae=!0,Fe(i)):(t.s=i.s,i=t),i},Ue.toNumber=function(){return+this},Ue.toOctal=function(t,e){return ai(this,8,t,e)},Ue.toPower=Ue.pow=function(t){var e,i,r,n,s,o,a=this,l=a.constructor,u=+(t=new l(t));if(!(a.d&&t.d&&a.d[0]&&t.d[0]))return new l(Ee(+a,u));if((a=new l(a)).eq(1))return a;if(r=l.precision,s=l.rounding,t.eq(1))return Fe(a,r,s);if((e=Te(t.e/7))>=t.d.length-1&&(i=u<0?-u:u)<=9007199254740991)return n=Ge(l,a,i,r),t.s<0?new l(1).div(n):Fe(n,r,s);if((o=a.s)<0){if(e<t.d.length-1)return new l(NaN);if(1&t.d[e]||(o=1),0==a.e&&1==a.d[0]&&1==a.d.length)return a.s=o,a}return(e=0!=(i=Ee(+a,u))&&isFinite(i)?new l(i+"").e:Te(u*(Math.log("0."+Le(a.d))/Math.LN10+a.e+1)))>l.maxE+1||e<l.minE-1?new l(e>0?o/0:0):(Ae=!1,l.rounding=a.s=1,i=Math.min(12,(e+"").length),(n=Xe(t.times(ti(a,r+i)),r)).d&&Ve((n=Fe(n,r+5,1)).d,r,s)&&(e=r+10,+Le((n=Fe(Xe(t.times(ti(a,e+i)),e),e+5,1)).d).slice(r+1,r+15)+1==1e14&&(n=Fe(n,r+1,0))),n.s=o,Ae=!0,l.rounding=s,Fe(n,r,s))},Ue.toPrecision=function(t,e){var i,r=this,n=r.constructor;return void 0===t?i=qe(r,r.e<=n.toExpNeg||r.e>=n.toExpPos):(je(t,1,ye),void 0===e?e=n.rounding:je(e,0,8),i=qe(r=Fe(new n(r),t,e),t<=r.e||r.e<=n.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+i:i},Ue.toSignificantDigits=Ue.toSD=function(t,e){var i=this.constructor;return void 0===t?(t=i.precision,e=i.rounding):(je(t,1,ye),void 0===e?e=i.rounding:je(e,0,8)),Fe(new i(this),t,e)},Ue.toString=function(){var t=this,e=t.constructor,i=qe(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+i:i},Ue.truncated=Ue.trunc=function(){return Fe(new this.constructor(this),this.e+1,1)},Ue.valueOf=Ue.toJSON=function(){var t=this,e=t.constructor,i=qe(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+i:i};var He=function(){function t(t,e,i){var r,n=0,s=t.length;for(t=t.slice();s--;)r=t[s]*e+n,t[s]=r%i|0,n=r/i|0;return n&&t.unshift(n),t}function e(t,e,i,r){var n,s;if(i!=r)s=i>r?1:-1;else for(n=s=0;n<i;n++)if(t[n]!=e[n]){s=t[n]>e[n]?1:-1;break}return s}function i(t,e,i,r){for(var n=0;i--;)t[i]-=n,n=t[i]<e[i]?1:0,t[i]=n*r+t[i]-e[i];for(;!t[0]&&t.length>1;)t.shift()}return function(r,n,s,o,a,l){var u,c,h,d,p,f,m,g,y,_,v,b,w,A,$,S,x,N,O,T,E=r.constructor,D=r.s==n.s?1:-1,C=r.d,P=n.d;if(!(C&&C[0]&&P&&P[0]))return new E(r.s&&n.s&&(C?!P||C[0]!=P[0]:P)?C&&0==C[0]||!P?0*D:D/0:NaN);for(l?(p=1,c=r.e-n.e):(l=ke,p=7,c=Te(r.e/p)-Te(n.e/p)),O=P.length,x=C.length,_=(y=new E(D)).d=[],h=0;P[h]==(C[h]||0);h++);if(P[h]>(C[h]||0)&&c--,null==s?(A=s=E.precision,o=E.rounding):A=a?s+(r.e-n.e)+1:s,A<0)_.push(1),f=!0;else{if(A=A/p+2|0,h=0,1==O){for(d=0,P=P[0],A++;(h<x||d)&&A--;h++)$=d*l+(C[h]||0),_[h]=$/P|0,d=$%P|0;f=d||h<x}else{for((d=l/(P[0]+1)|0)>1&&(P=t(P,d,l),C=t(C,d,l),O=P.length,x=C.length),S=O,b=(v=C.slice(0,O)).length;b<O;)v[b++]=0;(T=P.slice()).unshift(0),N=P[0],P[1]>=l/2&&++N;do{d=0,(u=e(P,v,O,b))<0?(w=v[0],O!=b&&(w=w*l+(v[1]||0)),(d=w/N|0)>1?(d>=l&&(d=l-1),1==(u=e(m=t(P,d,l),v,g=m.length,b=v.length))&&(d--,i(m,O<g?T:P,g,l))):(0==d&&(u=d=1),m=P.slice()),(g=m.length)<b&&m.unshift(0),i(v,m,b,l),-1==u&&(u=e(P,v,O,b=v.length))<1&&(d++,i(v,O<b?T:P,b,l)),b=v.length):0===u&&(d++,v=[0]),_[h++]=d,u&&v[0]?v[b++]=C[S]||0:(v=[C[S]],b=1)}while((S++<x||void 0!==v[0])&&A--);f=void 0!==v[0]}_[0]||_.shift()}if(1==p)y.e=c,fe=f;else{for(h=1,d=_[0];d>=10;d/=10)h++;y.e=h+c*p-1,Fe(y,a?s+y.e+1:s,o,f)}return y}}();function Fe(t,e,i,r){var n,s,o,a,l,u,c,h,d,p=t.constructor;t:if(null!=e){if(!(h=t.d))return t;for(n=1,a=h[0];a>=10;a/=10)n++;if((s=e-n)<0)s+=7,o=e,l=(c=h[d=0])/Ee(10,n-o-1)%10|0;else if((d=Math.ceil((s+1)/7))>=(a=h.length)){if(!r)break t;for(;a++<=d;)h.push(0);c=l=0,n=1,o=(s%=7)-7+1}else{for(c=a=h[d],n=1;a>=10;a/=10)n++;l=(o=(s%=7)-7+n)<0?0:c/Ee(10,n-o-1)%10|0}if(r=r||e<0||void 0!==h[d+1]||(o<0?c:c%Ee(10,n-o-1)),u=i<4?(l||r)&&(0==i||i==(t.s<0?3:2)):l>5||5==l&&(4==i||r||6==i&&(s>0?o>0?c/Ee(10,n-o):0:h[d-1])%10&1||i==(t.s<0?8:7)),e<1||!h[0])return h.length=0,u?(e-=t.e+1,h[0]=Ee(10,(7-e%7)%7),t.e=-e||0):h[0]=t.e=0,t;if(0==s?(h.length=d,a=1,d--):(h.length=d+1,a=Ee(10,7-s),h[d]=o>0?(c/Ee(10,n-o)%Ee(10,o)|0)*a:0),u)for(;;){if(0==d){for(s=1,o=h[0];o>=10;o/=10)s++;for(o=h[0]+=a,a=1;o>=10;o/=10)a++;s!=a&&(t.e++,h[0]==ke&&(h[0]=1));break}if(h[d]+=a,h[d]!=ke)break;h[d--]=0,a=1}for(s=h.length;0===h[--s];)h.pop()}return Ae&&(t.e>p.maxE?(t.d=null,t.e=NaN):t.e<p.minE&&(t.e=0,t.d=[0])),t}function qe(t,e,i){if(!t.isFinite())return ei(t);var r,n=t.e,s=Le(t.d),o=s.length;return e?(i&&(r=i-o)>0?s=s.charAt(0)+"."+s.slice(1)+Qe(r):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(t.e<0?"e":"e+")+t.e):n<0?(s="0."+Qe(-n-1)+s,i&&(r=i-o)>0&&(s+=Qe(r))):n>=o?(s+=Qe(n+1-o),i&&(r=i-n-1)>0&&(s=s+"."+Qe(r))):((r=n+1)<o&&(s=s.slice(0,r)+"."+s.slice(r)),i&&(r=i-o)>0&&(n+1===o&&(s+="."),s+=Qe(r))),s}function ze(t,e){var i=t[0];for(e*=7;i>=10;i/=10)e++;return e}function Ye(t,e,i){if(e>Ie)throw Ae=!0,i&&(t.precision=i),Error(xe);return Fe(new t(ve),e,1,!0)}function Ze(t,e,i){if(e>Re)throw Error(xe);return Fe(new t(be),e,i,!0)}function We(t){var e=t.length-1,i=7*e+1;if(e=t[e]){for(;e%10==0;e/=10)i--;for(e=t[0];e>=10;e/=10)i++}return i}function Qe(t){for(var e="";t--;)e+="0";return e}function Ge(t,e,i,r){var n,s=new t(1),o=Math.ceil(r/7+4);for(Ae=!1;;){if(i%2&&li((s=s.times(e)).d,o)&&(n=!0),0===(i=Te(i/2))){i=s.d.length-1,n&&0===s.d[i]&&++s.d[i];break}li((e=e.times(e)).d,o)}return Ae=!0,s}function Ke(t){return 1&t.d[t.d.length-1]}function Je(t,e,i){for(var r,n=new t(e[0]),s=0;++s<e.length;){if(!(r=new t(e[s])).s){n=r;break}n[i](r)&&(n=r)}return n}function Xe(t,e){var i,r,n,s,o,a,l,u=0,c=0,h=0,d=t.constructor,p=d.rounding,f=d.precision;if(!t.d||!t.d[0]||t.e>17)return new d(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(Ae=!1,l=f):l=e,a=new d(.03125);t.e>-2;)t=t.times(a),h+=5;for(l+=r=Math.log(Ee(2,h))/Math.LN10*2+5|0,i=s=o=new d(1),d.precision=l;;){if(s=Fe(s.times(t),l,1),i=i.times(++c),Le((a=o.plus(He(s,i,l,1))).d).slice(0,l)===Le(o.d).slice(0,l)){for(n=h;n--;)o=Fe(o.times(o),l,1);if(null!=e)return d.precision=f,o;if(!(u<3&&Ve(o.d,l-r,p,u)))return Fe(o,d.precision=f,p,Ae=!0);d.precision=l+=10,i=s=a=new d(1),c=0,u++}o=a}}function ti(t,e){var i,r,n,s,o,a,l,u,c,h,d,p=1,f=t,m=f.d,g=f.constructor,y=g.rounding,_=g.precision;if(f.s<0||!m||!m[0]||!f.e&&1==m[0]&&1==m.length)return new g(m&&!m[0]?-1/0:1!=f.s?NaN:m?0:f);if(null==e?(Ae=!1,c=_):c=e,g.precision=c+=10,r=(i=Le(m)).charAt(0),!(Math.abs(s=f.e)<15e14))return u=Ye(g,c+2,_).times(s+""),f=ti(new g(r+"."+i.slice(1)),c-10).plus(u),g.precision=_,null==e?Fe(f,_,y,Ae=!0):f;for(;r<7&&1!=r||1==r&&i.charAt(1)>3;)r=(i=Le((f=f.times(t)).d)).charAt(0),p++;for(s=f.e,r>1?(f=new g("0."+i),s++):f=new g(r+"."+i.slice(1)),h=f,l=o=f=He(f.minus(1),f.plus(1),c,1),d=Fe(f.times(f),c,1),n=3;;){if(o=Fe(o.times(d),c,1),Le((u=l.plus(He(o,new g(n),c,1))).d).slice(0,c)===Le(l.d).slice(0,c)){if(l=l.times(2),0!==s&&(l=l.plus(Ye(g,c+2,_).times(s+""))),l=He(l,new g(p),c,1),null!=e)return g.precision=_,l;if(!Ve(l.d,c-10,y,a))return Fe(l,g.precision=_,y,Ae=!0);g.precision=c+=10,u=o=f=He(h.minus(1),h.plus(1),c,1),d=Fe(f.times(f),c,1),n=a=1}l=u,n+=2}}function ei(t){return String(t.s*t.s/0)}function ii(t,e){var i,r,n;for((i=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(i<0&&(i=r),i+=+e.slice(r+1),e=e.substring(0,r)):i<0&&(i=e.length),r=0;48===e.charCodeAt(r);r++);for(n=e.length;48===e.charCodeAt(n-1);--n);if(e=e.slice(r,n)){if(n-=r,t.e=i=i-r-1,t.d=[],r=(i+1)%7,i<0&&(r+=7),r<n){for(r&&t.d.push(+e.slice(0,r)),n-=7;r<n;)t.d.push(+e.slice(r,r+=7));r=7-(e=e.slice(r)).length}else r-=n;for(;r--;)e+="0";t.d.push(+e),Ae&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function ri(t,e){var i,r,n,s,o,a,l,u,c;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),Me.test(e))return ii(t,e)}else if("Infinity"===e||"NaN"===e)return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(Ce.test(e))i=16,e=e.toLowerCase();else if(De.test(e))i=2;else{if(!Pe.test(e))throw Error(Se+e);i=8}for((s=e.search(/p/i))>0?(l=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),o=(s=e.indexOf("."))>=0,r=t.constructor,o&&(s=(a=(e=e.replace(".","")).length)-s,n=Ge(r,new r(i),s,2*s)),s=c=(u=Be(e,i,ke)).length-1;0===u[s];--s)u.pop();return s<0?new r(0*t.s):(t.e=ze(u,c),t.d=u,Ae=!1,o&&(t=He(t,n,4*a)),l&&(t=t.times(Math.abs(l)<54?Ee(2,l):Qi.pow(2,l))),Ae=!0,t)}function ni(t,e,i,r,n){var s,o,a,l,u=t.precision,c=Math.ceil(u/7);for(Ae=!1,l=i.times(i),a=new t(r);;){if(o=He(a.times(l),new t(e++*e++),u,1),a=n?r.plus(o):r.minus(o),r=He(o.times(l),new t(e++*e++),u,1),void 0!==(o=a.plus(r)).d[c]){for(s=c;o.d[s]===a.d[s]&&s--;);if(-1==s)break}s=a,a=r,r=o,o=s}return Ae=!0,o.d.length=c+1,o}function si(t,e){for(var i=t;--e;)i*=t;return i}function oi(t,e){var i,r=e.s<0,n=Ze(t,t.precision,1),s=n.times(.5);if((e=e.abs()).lte(s))return me=r?4:1,e;if((i=e.divToInt(n)).isZero())me=r?3:2;else{if((e=e.minus(i.times(n))).lte(s))return me=Ke(i)?r?2:3:r?4:1,e;me=Ke(i)?r?1:4:r?3:2}return e.minus(n).abs()}function ai(t,e,i,r){var n,s,o,a,l,u,c,h,d,p=t.constructor,f=void 0!==i;if(f?(je(i,1,ye),void 0===r?r=p.rounding:je(r,0,8)):(i=p.precision,r=p.rounding),t.isFinite()){for(f?(n=2,16==e?i=4*i-3:8==e&&(i=3*i-2)):n=e,(o=(c=qe(t)).indexOf("."))>=0&&(c=c.replace(".",""),(d=new p(1)).e=c.length-o,d.d=Be(qe(d),10,n),d.e=d.d.length),s=l=(h=Be(c,10,n)).length;0==h[--l];)h.pop();if(h[0]){if(o<0?s--:((t=new p(t)).d=h,t.e=s,h=(t=He(t,d,i,r,0,n)).d,s=t.e,u=fe),o=h[i],a=n/2,u=u||void 0!==h[i+1],u=r<4?(void 0!==o||u)&&(0===r||r===(t.s<0?3:2)):o>a||o===a&&(4===r||u||6===r&&1&h[i-1]||r===(t.s<0?8:7)),h.length=i,u)for(;++h[--i]>n-1;)h[i]=0,i||(++s,h.unshift(1));for(l=h.length;!h[l-1];--l);for(o=0,c="";o<l;o++)c+=_e.charAt(h[o]);if(f){if(l>1)if(16==e||8==e){for(o=16==e?4:3,--l;l%o;l++)c+="0";for(l=(h=Be(c,n,e)).length;!h[l-1];--l);for(o=1,c="1.";o<l;o++)c+=_e.charAt(h[o])}else c=c.charAt(0)+"."+c.slice(1);c=c+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)c="0"+c;c="0."+c}else if(++s>l)for(s-=l;s--;)c+="0";else s<l&&(c=c.slice(0,s)+"."+c.slice(s))}else c=f?"0p+0":"0";c=(16==e?"0x":2==e?"0b":8==e?"0o":"")+c}else c=ei(t);return t.s<0?"-"+c:c}function li(t,e){if(t.length>e)return t.length=e,!0}function ui(t){return new this(t).abs()}function ci(t){return new this(t).acos()}function hi(t){return new this(t).acosh()}function di(t,e){return new this(t).plus(e)}function pi(t){return new this(t).asin()}function fi(t){return new this(t).asinh()}function mi(t){return new this(t).atan()}function gi(t){return new this(t).atanh()}function yi(t,e){t=new this(t),e=new this(e);var i,r=this.precision,n=this.rounding,s=r+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(i=e.s<0?Ze(this,r,n):new this(0)).s=t.s:!t.d||e.isZero()?(i=Ze(this,s,1).times(.5)).s=t.s:e.s<0?(this.precision=s,this.rounding=1,i=this.atan(He(t,e,s,1)),e=Ze(this,s,1),this.precision=r,this.rounding=n,i=t.s<0?i.minus(e):i.plus(e)):i=this.atan(He(t,e,s,1)):(i=Ze(this,s,1).times(e.s>0?.25:.75)).s=t.s:i=new this(NaN),i}function _i(t){return new this(t).cbrt()}function vi(t){return Fe(t=new this(t),t.e+1,2)}function bi(t,e,i){return new this(t).clamp(e,i)}function wi(t){if(!t||"object"!=typeof t)throw Error($e+"Object expected");var e,i,r,n=!0===t.defaults,s=["precision",1,ye,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,ge,"maxE",0,ge,"minE",-9e15,0,"modulo",0,9];for(e=0;e<s.length;e+=3)if(i=s[e],n&&(this[i]=we[i]),void 0!==(r=t[i])){if(!(Te(r)===r&&r>=s[e+1]&&r<=s[e+2]))throw Error(Se+i+": "+r);this[i]=r}if(i="crypto",n&&(this[i]=we[i]),void 0!==(r=t[i])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(Se+i+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(Ne);this[i]=!0}else this[i]=!1}return this}function Ai(t){return new this(t).cos()}function $i(t){return new this(t).cosh()}function Si(t,e){return new this(t).div(e)}function xi(t){return new this(t).exp()}function Ni(t){return Fe(t=new this(t),t.e+1,3)}function Oi(){var t,e,i=new this(0);for(Ae=!1,t=0;t<arguments.length;)if((e=new this(arguments[t++])).d)i.d&&(i=i.plus(e.times(e)));else{if(e.s)return Ae=!0,new this(1/0);i=e}return Ae=!0,i.sqrt()}function Ti(t){return t instanceof Qi||t&&t.toStringTag===Oe||!1}function Ei(t){return new this(t).ln()}function Di(t,e){return new this(t).log(e)}function Ci(t){return new this(t).log(2)}function Pi(t){return new this(t).log(10)}function Mi(){return Je(this,arguments,"lt")}function ki(){return Je(this,arguments,"gt")}function Ii(t,e){return new this(t).mod(e)}function Ri(t,e){return new this(t).mul(e)}function Ui(t,e){return new this(t).pow(e)}function Li(t){var e,i,r,n,s=0,o=new this(1),a=[];if(void 0===t?t=this.precision:je(t,1,ye),r=Math.ceil(t/7),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(r));s<r;)(n=e[s])>=429e7?e[s]=crypto.getRandomValues(new Uint32Array(1))[0]:a[s++]=n%1e7;else{if(!crypto.randomBytes)throw Error(Ne);for(e=crypto.randomBytes(r*=4);s<r;)(n=e[s]+(e[s+1]<<8)+(e[s+2]<<16)+((127&e[s+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,s):(a.push(n%1e7),s+=4);s=r/4}else for(;s<r;)a[s++]=1e7*Math.random()|0;for(t%=7,(r=a[--s])&&t&&(n=Ee(10,7-t),a[s]=(r/n|0)*n);0===a[s];s--)a.pop();if(s<0)i=0,a=[0];else{for(i=-1;0===a[0];i-=7)a.shift();for(r=1,n=a[0];n>=10;n/=10)r++;r<7&&(i-=7-r)}return o.e=i,o.d=a,o}function ji(t){return Fe(t=new this(t),t.e+1,this.rounding)}function Vi(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function Bi(t){return new this(t).sin()}function Hi(t){return new this(t).sinh()}function Fi(t){return new this(t).sqrt()}function qi(t,e){return new this(t).sub(e)}function zi(){var t=0,e=arguments,i=new this(e[t]);for(Ae=!1;i.s&&++t<e.length;)i=i.plus(e[t]);return Ae=!0,Fe(i,this.precision,this.rounding)}function Yi(t){return new this(t).tan()}function Zi(t){return new this(t).tanh()}function Wi(t){return Fe(t=new this(t),t.e+1,1)}Ue[Symbol.for("nodejs.util.inspect.custom")]=Ue.toString,Ue[Symbol.toStringTag]="Decimal";var Qi=Ue.constructor=function t(e){var i,r,n;function s(t){var e,i,r,n=this;if(!(n instanceof s))return new s(t);if(n.constructor=s,Ti(t))return n.s=t.s,void(Ae?!t.d||t.e>s.maxE?(n.e=NaN,n.d=null):t.e<s.minE?(n.e=0,n.d=[0]):(n.e=t.e,n.d=t.d.slice()):(n.e=t.e,n.d=t.d?t.d.slice():t.d));if("number"==(r=typeof t)){if(0===t)return n.s=1/t<0?-1:1,n.e=0,void(n.d=[0]);if(t<0?(t=-t,n.s=-1):n.s=1,t===~~t&&t<1e7){for(e=0,i=t;i>=10;i/=10)e++;return void(Ae?e>s.maxE?(n.e=NaN,n.d=null):e<s.minE?(n.e=0,n.d=[0]):(n.e=e,n.d=[t]):(n.e=e,n.d=[t]))}return 0*t!=0?(t||(n.s=NaN),n.e=NaN,void(n.d=null)):ii(n,t.toString())}if("string"!==r)throw Error(Se+t);return 45===(i=t.charCodeAt(0))?(t=t.slice(1),n.s=-1):(43===i&&(t=t.slice(1)),n.s=1),Me.test(t)?ii(n,t):ri(n,t)}if(s.prototype=Ue,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=wi,s.clone=t,s.isDecimal=Ti,s.abs=ui,s.acos=ci,s.acosh=hi,s.add=di,s.asin=pi,s.asinh=fi,s.atan=mi,s.atanh=gi,s.atan2=yi,s.cbrt=_i,s.ceil=vi,s.clamp=bi,s.cos=Ai,s.cosh=$i,s.div=Si,s.exp=xi,s.floor=Ni,s.hypot=Oi,s.ln=Ei,s.log=Di,s.log10=Pi,s.log2=Ci,s.max=Mi,s.min=ki,s.mod=Ii,s.mul=Ri,s.pow=Ui,s.random=Li,s.round=ji,s.sign=Vi,s.sin=Bi,s.sinh=Hi,s.sqrt=Fi,s.sub=qi,s.sum=zi,s.tan=Yi,s.tanh=Zi,s.trunc=Wi,void 0===e&&(e={}),e&&!0!==e.defaults)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],i=0;i<n.length;)e.hasOwnProperty(r=n[i++])||(e[r]=this[r]);return s.config(e),s}(we);ve=new Qi(ve),be=new Qi(be);const Gi=/^-?\d+(\.\d+)?$/,Ki=()=>({stringToChars:t=>Array.from(t)});function Ji(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xi,tr={exports:{}},er=(Xi||(Xi=1,function(t){t.exports&&(t.exports=function(){var t=3,e=4,i=12,r=13,n=16,s=17;function o(t,e){void 0===e&&(e=0);var i=t.charCodeAt(e);if(55296<=i&&i<=56319&&e<t.length-1){var r=i;return 56320<=(n=t.charCodeAt(e+1))&&n<=57343?1024*(r-55296)+(n-56320)+65536:r}if(56320<=i&&i<=57343&&e>=1){var n=i;return 55296<=(r=t.charCodeAt(e-1))&&r<=56319?1024*(r-55296)+(n-56320)+65536:n}return i}function a(o,a,l){var u=[o].concat(a).concat([l]),c=u[u.length-2],h=l,d=u.lastIndexOf(14);if(d>1&&u.slice(1,d).every((function(e){return e==t}))&&-1==[t,r,s].indexOf(o))return 2;var p=u.lastIndexOf(e);if(p>0&&u.slice(1,p).every((function(t){return t==e}))&&-1==[i,e].indexOf(c))return u.filter((function(t){return t==e})).length%2==1?3:4;if(0==c&&1==h)return 0;if(2==c||0==c||1==c)return 14==h&&a.every((function(e){return e==t}))?2:1;if(2==h||0==h||1==h)return 1;if(6==c&&(6==h||7==h||9==h||10==h))return 0;if(!(9!=c&&7!=c||7!=h&&8!=h))return 0;if((10==c||8==c)&&8==h)return 0;if(h==t||15==h)return 0;if(5==h)return 0;if(c==i)return 0;var f=-1!=u.indexOf(t)?u.lastIndexOf(t)-1:u.length-2;return-1!=[r,s].indexOf(u[f])&&u.slice(f+1,-1).every((function(e){return e==t}))&&14==h||15==c&&-1!=[n,s].indexOf(h)?0:-1!=a.indexOf(e)?2:c==e&&h==e?0:1}function l(o){return 1536<=o&&o<=1541||1757==o||1807==o||2274==o||3406==o||69821==o||70082<=o&&o<=70083||72250==o||72326<=o&&o<=72329||73030==o?i:13==o?0:10==o?1:0<=o&&o<=9||11<=o&&o<=12||14<=o&&o<=31||127<=o&&o<=159||173==o||1564==o||6158==o||8203==o||8206<=o&&o<=8207||8232==o||8233==o||8234<=o&&o<=8238||8288<=o&&o<=8292||8293==o||8294<=o&&o<=8303||55296<=o&&o<=57343||65279==o||65520<=o&&o<=65528||65529<=o&&o<=65531||113824<=o&&o<=113827||119155<=o&&o<=119162||917504==o||917505==o||917506<=o&&o<=917535||917632<=o&&o<=917759||918e3<=o&&o<=921599?2:768<=o&&o<=879||1155<=o&&o<=1159||1160<=o&&o<=1161||1425<=o&&o<=1469||1471==o||1473<=o&&o<=1474||1476<=o&&o<=1477||1479==o||1552<=o&&o<=1562||1611<=o&&o<=1631||1648==o||1750<=o&&o<=1756||1759<=o&&o<=1764||1767<=o&&o<=1768||1770<=o&&o<=1773||1809==o||1840<=o&&o<=1866||1958<=o&&o<=1968||2027<=o&&o<=2035||2070<=o&&o<=2073||2075<=o&&o<=2083||2085<=o&&o<=2087||2089<=o&&o<=2093||2137<=o&&o<=2139||2260<=o&&o<=2273||2275<=o&&o<=2306||2362==o||2364==o||2369<=o&&o<=2376||2381==o||2385<=o&&o<=2391||2402<=o&&o<=2403||2433==o||2492==o||2494==o||2497<=o&&o<=2500||2509==o||2519==o||2530<=o&&o<=2531||2561<=o&&o<=2562||2620==o||2625<=o&&o<=2626||2631<=o&&o<=2632||2635<=o&&o<=2637||2641==o||2672<=o&&o<=2673||2677==o||2689<=o&&o<=2690||2748==o||2753<=o&&o<=2757||2759<=o&&o<=2760||2765==o||2786<=o&&o<=2787||2810<=o&&o<=2815||2817==o||2876==o||2878==o||2879==o||2881<=o&&o<=2884||2893==o||2902==o||2903==o||2914<=o&&o<=2915||2946==o||3006==o||3008==o||3021==o||3031==o||3072==o||3134<=o&&o<=3136||3142<=o&&o<=3144||3146<=o&&o<=3149||3157<=o&&o<=3158||3170<=o&&o<=3171||3201==o||3260==o||3263==o||3266==o||3270==o||3276<=o&&o<=3277||3285<=o&&o<=3286||3298<=o&&o<=3299||3328<=o&&o<=3329||3387<=o&&o<=3388||3390==o||3393<=o&&o<=3396||3405==o||3415==o||3426<=o&&o<=3427||3530==o||3535==o||3538<=o&&o<=3540||3542==o||3551==o||3633==o||3636<=o&&o<=3642||3655<=o&&o<=3662||3761==o||3764<=o&&o<=3769||3771<=o&&o<=3772||3784<=o&&o<=3789||3864<=o&&o<=3865||3893==o||3895==o||3897==o||3953<=o&&o<=3966||3968<=o&&o<=3972||3974<=o&&o<=3975||3981<=o&&o<=3991||3993<=o&&o<=4028||4038==o||4141<=o&&o<=4144||4146<=o&&o<=4151||4153<=o&&o<=4154||4157<=o&&o<=4158||4184<=o&&o<=4185||4190<=o&&o<=4192||4209<=o&&o<=4212||4226==o||4229<=o&&o<=4230||4237==o||4253==o||4957<=o&&o<=4959||5906<=o&&o<=5908||5938<=o&&o<=5940||5970<=o&&o<=5971||6002<=o&&o<=6003||6068<=o&&o<=6069||6071<=o&&o<=6077||6086==o||6089<=o&&o<=6099||6109==o||6155<=o&&o<=6157||6277<=o&&o<=6278||6313==o||6432<=o&&o<=6434||6439<=o&&o<=6440||6450==o||6457<=o&&o<=6459||6679<=o&&o<=6680||6683==o||6742==o||6744<=o&&o<=6750||6752==o||6754==o||6757<=o&&o<=6764||6771<=o&&o<=6780||6783==o||6832<=o&&o<=6845||6846==o||6912<=o&&o<=6915||6964==o||6966<=o&&o<=6970||6972==o||6978==o||7019<=o&&o<=7027||7040<=o&&o<=7041||7074<=o&&o<=7077||7080<=o&&o<=7081||7083<=o&&o<=7085||7142==o||7144<=o&&o<=7145||7149==o||7151<=o&&o<=7153||7212<=o&&o<=7219||7222<=o&&o<=7223||7376<=o&&o<=7378||7380<=o&&o<=7392||7394<=o&&o<=7400||7405==o||7412==o||7416<=o&&o<=7417||7616<=o&&o<=7673||7675<=o&&o<=7679||8204==o||8400<=o&&o<=8412||8413<=o&&o<=8416||8417==o||8418<=o&&o<=8420||8421<=o&&o<=8432||11503<=o&&o<=11505||11647==o||11744<=o&&o<=11775||12330<=o&&o<=12333||12334<=o&&o<=12335||12441<=o&&o<=12442||42607==o||42608<=o&&o<=42610||42612<=o&&o<=42621||42654<=o&&o<=42655||42736<=o&&o<=42737||43010==o||43014==o||43019==o||43045<=o&&o<=43046||43204<=o&&o<=43205||43232<=o&&o<=43249||43302<=o&&o<=43309||43335<=o&&o<=43345||43392<=o&&o<=43394||43443==o||43446<=o&&o<=43449||43452==o||43493==o||43561<=o&&o<=43566||43569<=o&&o<=43570||43573<=o&&o<=43574||43587==o||43596==o||43644==o||43696==o||43698<=o&&o<=43700||43703<=o&&o<=43704||43710<=o&&o<=43711||43713==o||43756<=o&&o<=43757||43766==o||44005==o||44008==o||44013==o||64286==o||65024<=o&&o<=65039||65056<=o&&o<=65071||65438<=o&&o<=65439||66045==o||66272==o||66422<=o&&o<=66426||68097<=o&&o<=68099||68101<=o&&o<=68102||68108<=o&&o<=68111||68152<=o&&o<=68154||68159==o||68325<=o&&o<=68326||69633==o||69688<=o&&o<=69702||69759<=o&&o<=69761||69811<=o&&o<=69814||69817<=o&&o<=69818||69888<=o&&o<=69890||69927<=o&&o<=69931||69933<=o&&o<=69940||70003==o||70016<=o&&o<=70017||70070<=o&&o<=70078||70090<=o&&o<=70092||70191<=o&&o<=70193||70196==o||70198<=o&&o<=70199||70206==o||70367==o||70371<=o&&o<=70378||70400<=o&&o<=70401||70460==o||70462==o||70464==o||70487==o||70502<=o&&o<=70508||70512<=o&&o<=70516||70712<=o&&o<=70719||70722<=o&&o<=70724||70726==o||70832==o||70835<=o&&o<=70840||70842==o||70845==o||70847<=o&&o<=70848||70850<=o&&o<=70851||71087==o||71090<=o&&o<=71093||71100<=o&&o<=71101||71103<=o&&o<=71104||71132<=o&&o<=71133||71219<=o&&o<=71226||71229==o||71231<=o&&o<=71232||71339==o||71341==o||71344<=o&&o<=71349||71351==o||71453<=o&&o<=71455||71458<=o&&o<=71461||71463<=o&&o<=71467||72193<=o&&o<=72198||72201<=o&&o<=72202||72243<=o&&o<=72248||72251<=o&&o<=72254||72263==o||72273<=o&&o<=72278||72281<=o&&o<=72283||72330<=o&&o<=72342||72344<=o&&o<=72345||72752<=o&&o<=72758||72760<=o&&o<=72765||72767==o||72850<=o&&o<=72871||72874<=o&&o<=72880||72882<=o&&o<=72883||72885<=o&&o<=72886||73009<=o&&o<=73014||73018==o||73020<=o&&o<=73021||73023<=o&&o<=73029||73031==o||92912<=o&&o<=92916||92976<=o&&o<=92982||94095<=o&&o<=94098||113821<=o&&o<=113822||119141==o||119143<=o&&o<=119145||119150<=o&&o<=119154||119163<=o&&o<=119170||119173<=o&&o<=119179||119210<=o&&o<=119213||119362<=o&&o<=119364||121344<=o&&o<=121398||121403<=o&&o<=121452||121461==o||121476==o||121499<=o&&o<=121503||121505<=o&&o<=121519||122880<=o&&o<=122886||122888<=o&&o<=122904||122907<=o&&o<=122913||122915<=o&&o<=122916||122918<=o&&o<=122922||125136<=o&&o<=125142||125252<=o&&o<=125258||917536<=o&&o<=917631||917760<=o&&o<=917999?t:127462<=o&&o<=127487?e:2307==o||2363==o||2366<=o&&o<=2368||2377<=o&&o<=2380||2382<=o&&o<=2383||2434<=o&&o<=2435||2495<=o&&o<=2496||2503<=o&&o<=2504||2507<=o&&o<=2508||2563==o||2622<=o&&o<=2624||2691==o||2750<=o&&o<=2752||2761==o||2763<=o&&o<=2764||2818<=o&&o<=2819||2880==o||2887<=o&&o<=2888||2891<=o&&o<=2892||3007==o||3009<=o&&o<=3010||3014<=o&&o<=3016||3018<=o&&o<=3020||3073<=o&&o<=3075||3137<=o&&o<=3140||3202<=o&&o<=3203||3262==o||3264<=o&&o<=3265||3267<=o&&o<=3268||3271<=o&&o<=3272||3274<=o&&o<=3275||3330<=o&&o<=3331||3391<=o&&o<=3392||3398<=o&&o<=3400||3402<=o&&o<=3404||3458<=o&&o<=3459||3536<=o&&o<=3537||3544<=o&&o<=3550||3570<=o&&o<=3571||3635==o||3763==o||3902<=o&&o<=3903||3967==o||4145==o||4155<=o&&o<=4156||4182<=o&&o<=4183||4228==o||6070==o||6078<=o&&o<=6085||6087<=o&&o<=6088||6435<=o&&o<=6438||6441<=o&&o<=6443||6448<=o&&o<=6449||6451<=o&&o<=6456||6681<=o&&o<=6682||6741==o||6743==o||6765<=o&&o<=6770||6916==o||6965==o||6971==o||6973<=o&&o<=6977||6979<=o&&o<=6980||7042==o||7073==o||7078<=o&&o<=7079||7082==o||7143==o||7146<=o&&o<=7148||7150==o||7154<=o&&o<=7155||7204<=o&&o<=7211||7220<=o&&o<=7221||7393==o||7410<=o&&o<=7411||7415==o||43043<=o&&o<=43044||43047==o||43136<=o&&o<=43137||43188<=o&&o<=43203||43346<=o&&o<=43347||43395==o||43444<=o&&o<=43445||43450<=o&&o<=43451||43453<=o&&o<=43456||43567<=o&&o<=43568||43571<=o&&o<=43572||43597==o||43755==o||43758<=o&&o<=43759||43765==o||44003<=o&&o<=44004||44006<=o&&o<=44007||44009<=o&&o<=44010||44012==o||69632==o||69634==o||69762==o||69808<=o&&o<=69810||69815<=o&&o<=69816||69932==o||70018==o||70067<=o&&o<=70069||70079<=o&&o<=70080||70188<=o&&o<=70190||70194<=o&&o<=70195||70197==o||70368<=o&&o<=70370||70402<=o&&o<=70403||70463==o||70465<=o&&o<=70468||70471<=o&&o<=70472||70475<=o&&o<=70477||70498<=o&&o<=70499||70709<=o&&o<=70711||70720<=o&&o<=70721||70725==o||70833<=o&&o<=70834||70841==o||70843<=o&&o<=70844||70846==o||70849==o||71088<=o&&o<=71089||71096<=o&&o<=71099||71102==o||71216<=o&&o<=71218||71227<=o&&o<=71228||71230==o||71340==o||71342<=o&&o<=71343||71350==o||71456<=o&&o<=71457||71462==o||72199<=o&&o<=72200||72249==o||72279<=o&&o<=72280||72343==o||72751==o||72766==o||72873==o||72881==o||72884==o||94033<=o&&o<=94078||119142==o||119149==o?5:4352<=o&&o<=4447||43360<=o&&o<=43388?6:4448<=o&&o<=4519||55216<=o&&o<=55238?7:4520<=o&&o<=4607||55243<=o&&o<=55291?8:44032==o||44060==o||44088==o||44116==o||44144==o||44172==o||44200==o||44228==o||44256==o||44284==o||44312==o||44340==o||44368==o||44396==o||44424==o||44452==o||44480==o||44508==o||44536==o||44564==o||44592==o||44620==o||44648==o||44676==o||44704==o||44732==o||44760==o||44788==o||44816==o||44844==o||44872==o||44900==o||44928==o||44956==o||44984==o||45012==o||45040==o||45068==o||45096==o||45124==o||45152==o||45180==o||45208==o||45236==o||45264==o||45292==o||45320==o||45348==o||45376==o||45404==o||45432==o||45460==o||45488==o||45516==o||45544==o||45572==o||45600==o||45628==o||45656==o||45684==o||45712==o||45740==o||45768==o||45796==o||45824==o||45852==o||45880==o||45908==o||45936==o||45964==o||45992==o||46020==o||46048==o||46076==o||46104==o||46132==o||46160==o||46188==o||46216==o||46244==o||46272==o||46300==o||46328==o||46356==o||46384==o||46412==o||46440==o||46468==o||46496==o||46524==o||46552==o||46580==o||46608==o||46636==o||46664==o||46692==o||46720==o||46748==o||46776==o||46804==o||46832==o||46860==o||46888==o||46916==o||46944==o||46972==o||47e3==o||47028==o||47056==o||47084==o||47112==o||47140==o||47168==o||47196==o||47224==o||47252==o||47280==o||47308==o||47336==o||47364==o||47392==o||47420==o||47448==o||47476==o||47504==o||47532==o||47560==o||47588==o||47616==o||47644==o||47672==o||47700==o||47728==o||47756==o||47784==o||47812==o||47840==o||47868==o||47896==o||47924==o||47952==o||47980==o||48008==o||48036==o||48064==o||48092==o||48120==o||48148==o||48176==o||48204==o||48232==o||48260==o||48288==o||48316==o||48344==o||48372==o||48400==o||48428==o||48456==o||48484==o||48512==o||48540==o||48568==o||48596==o||48624==o||48652==o||48680==o||48708==o||48736==o||48764==o||48792==o||48820==o||48848==o||48876==o||48904==o||48932==o||48960==o||48988==o||49016==o||49044==o||49072==o||49100==o||49128==o||49156==o||49184==o||49212==o||49240==o||49268==o||49296==o||49324==o||49352==o||49380==o||49408==o||49436==o||49464==o||49492==o||49520==o||49548==o||49576==o||49604==o||49632==o||49660==o||49688==o||49716==o||49744==o||49772==o||49800==o||49828==o||49856==o||49884==o||49912==o||49940==o||49968==o||49996==o||50024==o||50052==o||50080==o||50108==o||50136==o||50164==o||50192==o||50220==o||50248==o||50276==o||50304==o||50332==o||50360==o||50388==o||50416==o||50444==o||50472==o||50500==o||50528==o||50556==o||50584==o||50612==o||50640==o||50668==o||50696==o||50724==o||50752==o||50780==o||50808==o||50836==o||50864==o||50892==o||50920==o||50948==o||50976==o||51004==o||51032==o||51060==o||51088==o||51116==o||51144==o||51172==o||51200==o||51228==o||51256==o||51284==o||51312==o||51340==o||51368==o||51396==o||51424==o||51452==o||51480==o||51508==o||51536==o||51564==o||51592==o||51620==o||51648==o||51676==o||51704==o||51732==o||51760==o||51788==o||51816==o||51844==o||51872==o||51900==o||51928==o||51956==o||51984==o||52012==o||52040==o||52068==o||52096==o||52124==o||52152==o||52180==o||52208==o||52236==o||52264==o||52292==o||52320==o||52348==o||52376==o||52404==o||52432==o||52460==o||52488==o||52516==o||52544==o||52572==o||52600==o||52628==o||52656==o||52684==o||52712==o||52740==o||52768==o||52796==o||52824==o||52852==o||52880==o||52908==o||52936==o||52964==o||52992==o||53020==o||53048==o||53076==o||53104==o||53132==o||53160==o||53188==o||53216==o||53244==o||53272==o||53300==o||53328==o||53356==o||53384==o||53412==o||53440==o||53468==o||53496==o||53524==o||53552==o||53580==o||53608==o||53636==o||53664==o||53692==o||53720==o||53748==o||53776==o||53804==o||53832==o||53860==o||53888==o||53916==o||53944==o||53972==o||54e3==o||54028==o||54056==o||54084==o||54112==o||54140==o||54168==o||54196==o||54224==o||54252==o||54280==o||54308==o||54336==o||54364==o||54392==o||54420==o||54448==o||54476==o||54504==o||54532==o||54560==o||54588==o||54616==o||54644==o||54672==o||54700==o||54728==o||54756==o||54784==o||54812==o||54840==o||54868==o||54896==o||54924==o||54952==o||54980==o||55008==o||55036==o||55064==o||55092==o||55120==o||55148==o||55176==o?9:44033<=o&&o<=44059||44061<=o&&o<=44087||44089<=o&&o<=44115||44117<=o&&o<=44143||44145<=o&&o<=44171||44173<=o&&o<=44199||44201<=o&&o<=44227||44229<=o&&o<=44255||44257<=o&&o<=44283||44285<=o&&o<=44311||44313<=o&&o<=44339||44341<=o&&o<=44367||44369<=o&&o<=44395||44397<=o&&o<=44423||44425<=o&&o<=44451||44453<=o&&o<=44479||44481<=o&&o<=44507||44509<=o&&o<=44535||44537<=o&&o<=44563||44565<=o&&o<=44591||44593<=o&&o<=44619||44621<=o&&o<=44647||44649<=o&&o<=44675||44677<=o&&o<=44703||44705<=o&&o<=44731||44733<=o&&o<=44759||44761<=o&&o<=44787||44789<=o&&o<=44815||44817<=o&&o<=44843||44845<=o&&o<=44871||44873<=o&&o<=44899||44901<=o&&o<=44927||44929<=o&&o<=44955||44957<=o&&o<=44983||44985<=o&&o<=45011||45013<=o&&o<=45039||45041<=o&&o<=45067||45069<=o&&o<=45095||45097<=o&&o<=45123||45125<=o&&o<=45151||45153<=o&&o<=45179||45181<=o&&o<=45207||45209<=o&&o<=45235||45237<=o&&o<=45263||45265<=o&&o<=45291||45293<=o&&o<=45319||45321<=o&&o<=45347||45349<=o&&o<=45375||45377<=o&&o<=45403||45405<=o&&o<=45431||45433<=o&&o<=45459||45461<=o&&o<=45487||45489<=o&&o<=45515||45517<=o&&o<=45543||45545<=o&&o<=45571||45573<=o&&o<=45599||45601<=o&&o<=45627||45629<=o&&o<=45655||45657<=o&&o<=45683||45685<=o&&o<=45711||45713<=o&&o<=45739||45741<=o&&o<=45767||45769<=o&&o<=45795||45797<=o&&o<=45823||45825<=o&&o<=45851||45853<=o&&o<=45879||45881<=o&&o<=45907||45909<=o&&o<=45935||45937<=o&&o<=45963||45965<=o&&o<=45991||45993<=o&&o<=46019||46021<=o&&o<=46047||46049<=o&&o<=46075||46077<=o&&o<=46103||46105<=o&&o<=46131||46133<=o&&o<=46159||46161<=o&&o<=46187||46189<=o&&o<=46215||46217<=o&&o<=46243||46245<=o&&o<=46271||46273<=o&&o<=46299||46301<=o&&o<=46327||46329<=o&&o<=46355||46357<=o&&o<=46383||46385<=o&&o<=46411||46413<=o&&o<=46439||46441<=o&&o<=46467||46469<=o&&o<=46495||46497<=o&&o<=46523||46525<=o&&o<=46551||46553<=o&&o<=46579||46581<=o&&o<=46607||46609<=o&&o<=46635||46637<=o&&o<=46663||46665<=o&&o<=46691||46693<=o&&o<=46719||46721<=o&&o<=46747||46749<=o&&o<=46775||46777<=o&&o<=46803||46805<=o&&o<=46831||46833<=o&&o<=46859||46861<=o&&o<=46887||46889<=o&&o<=46915||46917<=o&&o<=46943||46945<=o&&o<=46971||46973<=o&&o<=46999||47001<=o&&o<=47027||47029<=o&&o<=47055||47057<=o&&o<=47083||47085<=o&&o<=47111||47113<=o&&o<=47139||47141<=o&&o<=47167||47169<=o&&o<=47195||47197<=o&&o<=47223||47225<=o&&o<=47251||47253<=o&&o<=47279||47281<=o&&o<=47307||47309<=o&&o<=47335||47337<=o&&o<=47363||47365<=o&&o<=47391||47393<=o&&o<=47419||47421<=o&&o<=47447||47449<=o&&o<=47475||47477<=o&&o<=47503||47505<=o&&o<=47531||47533<=o&&o<=47559||47561<=o&&o<=47587||47589<=o&&o<=47615||47617<=o&&o<=47643||47645<=o&&o<=47671||47673<=o&&o<=47699||47701<=o&&o<=47727||47729<=o&&o<=47755||47757<=o&&o<=47783||47785<=o&&o<=47811||47813<=o&&o<=47839||47841<=o&&o<=47867||47869<=o&&o<=47895||47897<=o&&o<=47923||47925<=o&&o<=47951||47953<=o&&o<=47979||47981<=o&&o<=48007||48009<=o&&o<=48035||48037<=o&&o<=48063||48065<=o&&o<=48091||48093<=o&&o<=48119||48121<=o&&o<=48147||48149<=o&&o<=48175||48177<=o&&o<=48203||48205<=o&&o<=48231||48233<=o&&o<=48259||48261<=o&&o<=48287||48289<=o&&o<=48315||48317<=o&&o<=48343||48345<=o&&o<=48371||48373<=o&&o<=48399||48401<=o&&o<=48427||48429<=o&&o<=48455||48457<=o&&o<=48483||48485<=o&&o<=48511||48513<=o&&o<=48539||48541<=o&&o<=48567||48569<=o&&o<=48595||48597<=o&&o<=48623||48625<=o&&o<=48651||48653<=o&&o<=48679||48681<=o&&o<=48707||48709<=o&&o<=48735||48737<=o&&o<=48763||48765<=o&&o<=48791||48793<=o&&o<=48819||48821<=o&&o<=48847||48849<=o&&o<=48875||48877<=o&&o<=48903||48905<=o&&o<=48931||48933<=o&&o<=48959||48961<=o&&o<=48987||48989<=o&&o<=49015||49017<=o&&o<=49043||49045<=o&&o<=49071||49073<=o&&o<=49099||49101<=o&&o<=49127||49129<=o&&o<=49155||49157<=o&&o<=49183||49185<=o&&o<=49211||49213<=o&&o<=49239||49241<=o&&o<=49267||49269<=o&&o<=49295||49297<=o&&o<=49323||49325<=o&&o<=49351||49353<=o&&o<=49379||49381<=o&&o<=49407||49409<=o&&o<=49435||49437<=o&&o<=49463||49465<=o&&o<=49491||49493<=o&&o<=49519||49521<=o&&o<=49547||49549<=o&&o<=49575||49577<=o&&o<=49603||49605<=o&&o<=49631||49633<=o&&o<=49659||49661<=o&&o<=49687||49689<=o&&o<=49715||49717<=o&&o<=49743||49745<=o&&o<=49771||49773<=o&&o<=49799||49801<=o&&o<=49827||49829<=o&&o<=49855||49857<=o&&o<=49883||49885<=o&&o<=49911||49913<=o&&o<=49939||49941<=o&&o<=49967||49969<=o&&o<=49995||49997<=o&&o<=50023||50025<=o&&o<=50051||50053<=o&&o<=50079||50081<=o&&o<=50107||50109<=o&&o<=50135||50137<=o&&o<=50163||50165<=o&&o<=50191||50193<=o&&o<=50219||50221<=o&&o<=50247||50249<=o&&o<=50275||50277<=o&&o<=50303||50305<=o&&o<=50331||50333<=o&&o<=50359||50361<=o&&o<=50387||50389<=o&&o<=50415||50417<=o&&o<=50443||50445<=o&&o<=50471||50473<=o&&o<=50499||50501<=o&&o<=50527||50529<=o&&o<=50555||50557<=o&&o<=50583||50585<=o&&o<=50611||50613<=o&&o<=50639||50641<=o&&o<=50667||50669<=o&&o<=50695||50697<=o&&o<=50723||50725<=o&&o<=50751||50753<=o&&o<=50779||50781<=o&&o<=50807||50809<=o&&o<=50835||50837<=o&&o<=50863||50865<=o&&o<=50891||50893<=o&&o<=50919||50921<=o&&o<=50947||50949<=o&&o<=50975||50977<=o&&o<=51003||51005<=o&&o<=51031||51033<=o&&o<=51059||51061<=o&&o<=51087||51089<=o&&o<=51115||51117<=o&&o<=51143||51145<=o&&o<=51171||51173<=o&&o<=51199||51201<=o&&o<=51227||51229<=o&&o<=51255||51257<=o&&o<=51283||51285<=o&&o<=51311||51313<=o&&o<=51339||51341<=o&&o<=51367||51369<=o&&o<=51395||51397<=o&&o<=51423||51425<=o&&o<=51451||51453<=o&&o<=51479||51481<=o&&o<=51507||51509<=o&&o<=51535||51537<=o&&o<=51563||51565<=o&&o<=51591||51593<=o&&o<=51619||51621<=o&&o<=51647||51649<=o&&o<=51675||51677<=o&&o<=51703||51705<=o&&o<=51731||51733<=o&&o<=51759||51761<=o&&o<=51787||51789<=o&&o<=51815||51817<=o&&o<=51843||51845<=o&&o<=51871||51873<=o&&o<=51899||51901<=o&&o<=51927||51929<=o&&o<=51955||51957<=o&&o<=51983||51985<=o&&o<=52011||52013<=o&&o<=52039||52041<=o&&o<=52067||52069<=o&&o<=52095||52097<=o&&o<=52123||52125<=o&&o<=52151||52153<=o&&o<=52179||52181<=o&&o<=52207||52209<=o&&o<=52235||52237<=o&&o<=52263||52265<=o&&o<=52291||52293<=o&&o<=52319||52321<=o&&o<=52347||52349<=o&&o<=52375||52377<=o&&o<=52403||52405<=o&&o<=52431||52433<=o&&o<=52459||52461<=o&&o<=52487||52489<=o&&o<=52515||52517<=o&&o<=52543||52545<=o&&o<=52571||52573<=o&&o<=52599||52601<=o&&o<=52627||52629<=o&&o<=52655||52657<=o&&o<=52683||52685<=o&&o<=52711||52713<=o&&o<=52739||52741<=o&&o<=52767||52769<=o&&o<=52795||52797<=o&&o<=52823||52825<=o&&o<=52851||52853<=o&&o<=52879||52881<=o&&o<=52907||52909<=o&&o<=52935||52937<=o&&o<=52963||52965<=o&&o<=52991||52993<=o&&o<=53019||53021<=o&&o<=53047||53049<=o&&o<=53075||53077<=o&&o<=53103||53105<=o&&o<=53131||53133<=o&&o<=53159||53161<=o&&o<=53187||53189<=o&&o<=53215||53217<=o&&o<=53243||53245<=o&&o<=53271||53273<=o&&o<=53299||53301<=o&&o<=53327||53329<=o&&o<=53355||53357<=o&&o<=53383||53385<=o&&o<=53411||53413<=o&&o<=53439||53441<=o&&o<=53467||53469<=o&&o<=53495||53497<=o&&o<=53523||53525<=o&&o<=53551||53553<=o&&o<=53579||53581<=o&&o<=53607||53609<=o&&o<=53635||53637<=o&&o<=53663||53665<=o&&o<=53691||53693<=o&&o<=53719||53721<=o&&o<=53747||53749<=o&&o<=53775||53777<=o&&o<=53803||53805<=o&&o<=53831||53833<=o&&o<=53859||53861<=o&&o<=53887||53889<=o&&o<=53915||53917<=o&&o<=53943||53945<=o&&o<=53971||53973<=o&&o<=53999||54001<=o&&o<=54027||54029<=o&&o<=54055||54057<=o&&o<=54083||54085<=o&&o<=54111||54113<=o&&o<=54139||54141<=o&&o<=54167||54169<=o&&o<=54195||54197<=o&&o<=54223||54225<=o&&o<=54251||54253<=o&&o<=54279||54281<=o&&o<=54307||54309<=o&&o<=54335||54337<=o&&o<=54363||54365<=o&&o<=54391||54393<=o&&o<=54419||54421<=o&&o<=54447||54449<=o&&o<=54475||54477<=o&&o<=54503||54505<=o&&o<=54531||54533<=o&&o<=54559||54561<=o&&o<=54587||54589<=o&&o<=54615||54617<=o&&o<=54643||54645<=o&&o<=54671||54673<=o&&o<=54699||54701<=o&&o<=54727||54729<=o&&o<=54755||54757<=o&&o<=54783||54785<=o&&o<=54811||54813<=o&&o<=54839||54841<=o&&o<=54867||54869<=o&&o<=54895||54897<=o&&o<=54923||54925<=o&&o<=54951||54953<=o&&o<=54979||54981<=o&&o<=55007||55009<=o&&o<=55035||55037<=o&&o<=55063||55065<=o&&o<=55091||55093<=o&&o<=55119||55121<=o&&o<=55147||55149<=o&&o<=55175||55177<=o&&o<=55203?10:9757==o||9977==o||9994<=o&&o<=9997||127877==o||127938<=o&&o<=127940||127943==o||127946<=o&&o<=127948||128066<=o&&o<=128067||128070<=o&&o<=128080||128110==o||128112<=o&&o<=128120||128124==o||128129<=o&&o<=128131||128133<=o&&o<=128135||128170==o||128372<=o&&o<=128373||128378==o||128400==o||128405<=o&&o<=128406||128581<=o&&o<=128583||128587<=o&&o<=128591||128675==o||128692<=o&&o<=128694||128704==o||128716==o||129304<=o&&o<=129308||129310<=o&&o<=129311||129318==o||129328<=o&&o<=129337||129341<=o&&o<=129342||129489<=o&&o<=129501?r:127995<=o&&o<=127999?14:8205==o?15:9792==o||9794==o||9877<=o&&o<=9878||9992==o||10084==o||127752==o||127806==o||127859==o||127891==o||127908==o||127912==o||127979==o||127981==o||128139==o||128187<=o&&o<=128188||128295==o||128300==o||128488==o||128640==o||128658==o?n:128102<=o&&o<=128105?s:11}return this.nextBreak=function(t,e){if(void 0===e&&(e=0),e<0)return 0;if(e>=t.length-1)return t.length;for(var i,r,n=l(o(t,e)),s=[],u=e+1;u<t.length;u++)if(r=u-1,!(55296<=(i=t).charCodeAt(r)&&i.charCodeAt(r)<=56319&&56320<=i.charCodeAt(r+1)&&i.charCodeAt(r+1)<=57343)){var c=l(o(t,u));if(a(n,s,c))return u;s.push(c)}return t.length},this.splitGraphemes=function(t){for(var e,i=[],r=0;(e=this.nextBreak(t,r))<t.length;)i.push(t.slice(r,e)),r=e;return r<t.length&&i.push(t.slice(r)),i},this.iterateGraphemes=function(t){var e=0,i={next:function(){var i,r;return(r=this.nextBreak(t,e))<t.length?(i=t.slice(e,r),e=r,{value:i,done:!1}):e<t.length?(i=t.slice(e),e=t.length,{value:i,done:!1}):{value:void 0,done:!0}}.bind(this)};return"undefined"!=typeof Symbol&&Symbol.iterator&&(i[Symbol.iterator]=function(){return i}),i},this.countGraphemes=function(t){for(var e,i=0,r=0;(e=this.nextBreak(t,r))<t.length;)r=e,i++;return r<t.length&&i++,i},this})}(tr)),tr.exports),ir=Ji(er);class rr{static setNumberAdapter(t,e){let i=pe();qt(t)?"number"===t?i=pe():["decimal.js","decimaljs"].includes(t)&&(i=((t={precision:1e3})=>{const e=Qi.clone(t);return{create:t=>(qt(t)&&!Gi.test(t)&&(t=0),new e(t)),add:(t,e)=>t.plus(e),sub:(t,e)=>t.minus(e),mul:(t,e)=>t.times(e),div:(t,e)=>t.div(e),compare:(t,e)=>t.cmp(e),eq:(t,e)=>t.eq(e),gt:(t,e)=>t.gt(e),gte:(t,e)=>t.gte(e),lt:(t,e)=>t.lt(e),lte:(t,e)=>t.lte(e),isInteger:t=>t.isInteger(),isNegative:t=>t.isNegative(),isPositive:t=>t.isPositive(),isZero:t=>t.isZero(),isNaN:t=>t.isNaN(),isFinite:t=>t.isFinite(),abs:t=>t.abs(),ceil:t=>t.ceil(),floor:t=>t.floor(),round:t=>t.round(),max:(t,i)=>e.max(t,i),min:(t,i)=>e.min(t,i),toNumber:t=>t.toNumber(),toString:t=>t.toFixed()}})(e)):i=t,rr.NUMBER_ADAPTER=i}static setStringAdapter(t){let e=Ki();qt(t)?"string"===t?e=Ki():"intl-segmenter"===t?e=(t=>{const e=new Intl.Segmenter(t,{granularity:"grapheme"});return{stringToChars:t=>Array.from(e.segment(t)).map((t=>t.segment))}})():"grapheme-splitter"===t&&(e=(()=>{const t=new ir;return{stringToChars:e=>t.splitGraphemes(e)}})()):e=t,rr.STRING_ADAPTER=e}}rr.NUMBER_ADAPTER=pe(),rr.STRING_ADAPTER=Ki(),rr.VALUE_CONVERTER={fromAttribute:t=>t,toAttribute:t=>Yt(t)?t:rr.NUMBER_ADAPTER.toString(t)};const nr=t=>{class i extends t{get value(){return this.numberAdapter.create(this.__value)}set value(t){t=rr.NUMBER_ADAPTER.create(Yt(t)||qt(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 Yt(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=qt(this.__locale)?new Intl.Locale(this.__locale):new Intl.Locale(...this.__locale)}constructor(...t){super(...t),this.__value=rr.NUMBER_ADAPTER.create(0),this.__oldValue=rr.NUMBER_ADAPTER.create(0),this.__initialValue=null,this.__locale="en-US",this.localeInstance=qt(this.locale)?new Intl.Locale(this.locale):new Intl.Locale(...this.locale),this.direction="up",this.oldDirection=this.direction,this.numberAdapter=rr.NUMBER_ADAPTER,this.stringAdapter=rr.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([dt({attribute:"value",reflect:!0,converter:{toAttribute:rr.VALUE_CONVERTER.toAttribute},noAccessor:!0})],i.prototype,"value",null),e([dt({attribute:"old-value",reflect:!0,converter:rr.VALUE_CONVERTER,noAccessor:!0})],i.prototype,"oldValue",null),e([dt({attribute:"initial-value",reflect:!0,converter:rr.VALUE_CONVERTER,noAccessor:!0})],i.prototype,"initialValue",null),e([dt({converter:t=>{if(Yt(t))return t;try{return JSON.parse(t)}catch(e){return t}},reflect:!0,noAccessor:!0})],i.prototype,"locale",null),e([pt()],i.prototype,"direction",void 0),e([pt()],i.prototype,"oldDirection",void 0),i},sr=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)}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`
74
67
  :host {
75
68
  position: relative;
76
69
  white-space: nowrap;
@@ -99,7 +92,7 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
99
92
  // font-size: 0.4em;
100
93
  // line-height: 1;
101
94
  //}
102
- `,or=t=>{class i extends t{constructor(){super(...arguments),this.animationOptions={},this.cachedAnimationOptions=[],this.keyframes={},this.cachedKeyframes=[]}extractAnimationOptions(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=se(ee(this.animationOptions??{},t),ee(this.animationOptionsDynamic??{},t));return Gt(this.cachedAnimationOptions,e)||(this.cachedAnimationOptions=e),this.cachedAnimationOptions}extractKeyframes(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=se(ee(this.keyframes??{},t),ee(this.keyframesDynamic??{},t));return Gt(this.cachedKeyframes,e)||(this.cachedKeyframes=e),this.cachedKeyframes}}return e([dt({type:Object,attribute:"animation-options",reflect:!0})],i.prototype,"animationOptions",void 0),e([dt({type:Object,attribute:"keyframes",reflect:!0})],i.prototype,"keyframes",void 0),i},ar="important",lr=" !"+ar,ur=yt(class extends _t{constructor(t){if(super(t),t.type!==mt||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const r=t[i];return null==r?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`}),"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?i.removeProperty(t):i[t]=null);for(const t in e){const r=e[t];if(null!=r){this.ft.add(t);const e="string"==typeof r&&r.endsWith(lr);t.includes("-")||e?i.setProperty(t,e?r.slice(0,-11):r,e?ar:""):i[t]=r}}return z}}),cr=yt(class extends _t{constructor(t){if(super(t),t.type!==mt||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.st)t in e||(i.remove(t),this.st.delete(t));for(const t in e){const r=!!e[t];r===this.st.has(t)||this.nt?.has(t)||(r?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return z}}),hr=l`
95
+ `,ge=t=>{class i extends t{constructor(){super(...arguments),this.animationOptions={},this.cachedAnimationOptions=[],this.keyframes={},this.cachedKeyframes=[]}extractAnimationOptions(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=ne(ee(this.animationOptions??{},t),ee(this.animationOptionsDynamic??{},t));return Gt(this.cachedAnimationOptions,e)||(this.cachedAnimationOptions=e),this.cachedAnimationOptions}extractKeyframes(){const t={preprocessData:this.partPreprocessDataList,data:this.parts,direction:this.direction,value:[this.value,this.oldValue]},e=ne(ee(this.keyframes??{},t),ee(this.keyframesDynamic??{},t));return Gt(this.cachedKeyframes,e)||(this.cachedKeyframes=e),this.cachedKeyframes}}return e([pt({type:Object,attribute:"animation-options",reflect:!0})],i.prototype,"animationOptions",void 0),e([pt({type:Object,attribute:"keyframes",reflect:!0})],i.prototype,"keyframes",void 0),i},Ae="important",be=" !"+Ae,$e=_t(class extends gt{constructor(t){if(super(t),t.type!==mt||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const r=t[i];return null==r?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`}),"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?i.removeProperty(t):i[t]=null);for(const t in e){const r=e[t];if(null!=r){this.ft.add(t);const e="string"==typeof r&&r.endsWith(be);t.includes("-")||e?i.setProperty(t,e?r.slice(0,-11):r,e?Ae:""):i[t]=r}}return Y}}),ve=_t(class extends gt{constructor(t){if(super(t),t.type!==mt||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.st)t in e||(i.remove(t),this.st.delete(t));for(const t in e){const r=!!e[t];r===this.st.has(t)||this.nt?.has(t)||(r?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return Y}}),Se=l`
103
96
  :host {
104
97
  display: inline-flex;
105
98
  overflow: hidden;
@@ -134,7 +127,7 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
134
127
  .roller-part .roller-part__suffix {
135
128
  display: inline-block;
136
129
  }
137
- `,dr=l`
130
+ `,Te=l`
138
131
  .roller-part-digit {
139
132
  position: relative;
140
133
  display: inline-block;
@@ -187,72 +180,72 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
187
180
  position: absolute;
188
181
  bottom: 100%;
189
182
  }
190
- `,pr=t=>t,fr=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function mr(t,e,i,r){if(t===e&&i===r)return pr;const n=e=>function(t,e,i,r,n){let s,o,a=0;do{o=e+(i-e)/2,s=fr(o,r,n)-t,s>0?i=o:e=o}while(Math.abs(s)>1e-7&&++a<12);return o}(e,0,1,t,i);return t=>0===t||1===t?t:fr(n(t),e,r)}const gr=mr(.12,0,.39,0),yr=mr(.61,1,.88,1),_r=mr(.37,0,.63,1),vr=mr(.11,0,.5,0),br=mr(.5,1,.89,1),wr=mr(.45,0,.55,1),Ar=mr(.32,0,.67,0),$r=mr(.33,1,.68,1),Sr=mr(.65,0,.35,1),xr=mr(.5,0,.75,0),Nr=mr(.25,1,.5,1),Or=mr(.76,0,.24,1),Tr=mr(.64,0,.78,0),Er=mr(.22,1,.36,1),Dr=mr(.83,0,.17,1),Cr=mr(.7,0,.84,0),Pr=mr(.16,1,.3,1),Mr=mr(.87,0,.13,1),kr=mr(.55,0,1,.45),Ir=mr(0,.55,.45,1),Rr=mr(.85,0,.15,1),Ur=mr(.36,0,.66,-.56),Lr=mr(.34,1.56,.64,1),jr=mr(.68,-.6,.32,1.6);function Vr(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 Br(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 Hr(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 Fr(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 qr(t){return 1-Fr(1-t)}function zr(t){return t<.5?(1-Fr(1-2*t))/2:(1+Fr(2*t-1))/2}var Yr=Object.freeze({__proto__:null,easeInBack:Ur,easeInBounce:qr,easeInCirc:kr,easeInCubic:Ar,easeInElastic:Vr,easeInExpo:Cr,easeInOutBack:jr,easeInOutBounce:zr,easeInOutCirc:Rr,easeInOutCubic:Sr,easeInOutElastic:Hr,easeInOutExpo:Mr,easeInOutQuad:wr,easeInOutQuart:Or,easeInOutQuint:Dr,easeInOutSine:_r,easeInQuad:vr,easeInQuart:xr,easeInQuint:Tr,easeInSine:gr,easeOutBack:Lr,easeOutBounce:Fr,easeOutCirc:Ir,easeOutCubic:$r,easeOutElastic:Br,easeOutExpo:Pr,easeOutQuad:br,easeOutQuart:Nr,easeOutQuint:Er,easeOutSine:yr});class Zr extends Event{}let Wr=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.getBoundingClientRect():new DOMRect).width}))}firstUpdated(t){super.firstUpdated(t),this.clonedRollDigitList&&this.resizeObserver.observe(this.clonedRollDigitList)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.disconnect()}updated(t){super.updated(t),Jt(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 Mt(Ut,t)}(t,["position"])));return q`<span class="roller-part-digit">
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">
191
184
  <!-- 占位 -->
192
185
  <span
193
186
  class="placeholder"
194
- style=${ur({width:`${Math.round(this.digitWidth)}px`})}
187
+ style=${$e({width:`${Math.round(this.digitWidth)}px`})}
195
188
  >0</span
196
189
  >
197
190
  <!-- 一个不可见的滚动列表的复制, 用于计算该列表的最大宽度. -->
198
191
  <span class="roll-list__shadow">
199
- ${Nt(this.digit.data,((t,e)=>e),((e,i)=>q`<span style=${ur(t[i])}
192
+ ${Pt(this.digit.data,((t,e)=>e),((e,i)=>F`<span style=${$e(t[i])}
200
193
  >${e}</span
201
194
  >`))}
202
195
  </span>
203
196
  <span
204
- class=${cr({"roll-list__up":"up"===this.direction,"roll-list__down":"down"===this.direction,"roll-list":!0})}
197
+ class=${ve({"roll-list__up":"up"===this.direction,"roll-list__down":"down"===this.direction,"roll-list":!0})}
205
198
  >
206
- ${this.digit.data.length>1?Nt(this.digit.data,((t,e)=>e),((t,e)=>"up"===this.direction&&e===this.digit.data.length-1?q`<span
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
207
200
  part="cell"
208
201
  class="roll-item roll-item__head"
209
- style=${ur(this.cellStyle[e])}
210
- ><span style=${ur(this.textStyle)}
202
+ style=${$e(this.cellStyle[e])}
203
+ ><span style=${$e(this.textStyle)}
211
204
  >${t}</span
212
205
  ></span
213
- >`:"down"===this.direction&&0===e?q`
206
+ >`:"down"===this.direction&&0===e?F`
214
207
  <span
215
208
  part="cell"
216
209
  class="roll-item roll-item__tail"
217
- style=${ur(this.cellStyle[e])}
218
- ><span style=${ur(this.textStyle)}
210
+ style=${$e(this.cellStyle[e])}
211
+ ><span style=${$e(this.textStyle)}
219
212
  >${t}</span
220
213
  ></span
221
214
  >
222
- `:q`<span
215
+ `:F`<span
223
216
  part="cell"
224
217
  class="roll-item"
225
- style=${ur(this.cellStyle[e])}
226
- ><span style=${ur(this.textStyle)}
218
+ style=${$e(this.cellStyle[e])}
219
+ ><span style=${$e(this.textStyle)}
227
220
  >${t}</span
228
221
  ></span
229
- >`)):q`<span
222
+ >`)):F`<span
230
223
  part="cell"
231
224
  class="roll-item"
232
- style=${ur(this.cellStyle[0])}
233
- ><span style=${ur(this.textStyle)}
225
+ style=${$e(this.cellStyle[0])}
226
+ ><span style=${$e(this.textStyle)}
234
227
  >${this.digit.data[0]}</span
235
228
  ></span
236
229
  >`}</span
237
230
  ></span
238
- > `}shouldAnimate(){const{cancelPrevAnimation:t,animate:e}=this.preprocessData;return t&&(this.animation&&this.animation.cancel(),this.rollList&&this.rollList.style&&this.rollList.style.cssText&&(this.rollList.style.cssText="")),!!e}async startAnimation(){if(Yt(this.rollList))return;this.__emitAnimationStart();const t=Lt({duration:1e3,iterations:1,easing:"ease-out",fill:"forwards"},this.animationOptions),e=zt(this.keyframes)?{up:{transform:["translateY(0)","translateY(-100%)"]},down:{transform:["translateY(0)","translateY(100%)"]}}[this.direction]:this.keyframes;if(qt(t.easing)&&Yr[t.easing]){const e=Yr[t.easing];t.easing=`linear(${function(...t){return Mt(Rt,t)}(0,64).map(((t,i)=>e(i/63))).join(",")})`}try{this.clearAnimation(),this.animation=this.rollList.animate(e,t),this.animation.addEventListener("finish",(()=>this.__emitAnimationEnd()),{once:!0})}catch(t){console.error(t)}}clearAnimation(){this.animation?.removeEventListener("finish",this.__emitAnimationEnd),this.animation?.cancel()}__emitAnimationStart(){this.isConnected&&this.dispatchEvent(new Zr("roller-digit-animation-start"))}__emitAnimationEnd(){this.isConnected&&this.dispatchEvent(new Zr("roller-digit-animation-end"))}};Wr.styles=[dr],e([dt({type:Object})],Wr.prototype,"digit",void 0),e([dt({type:Object})],Wr.prototype,"preprocessData",void 0),e([dt({type:String})],Wr.prototype,"direction",void 0),e([dt({type:Object})],Wr.prototype,"textStyle",void 0),e([dt({type:Array})],Wr.prototype,"cellStyle",void 0),e([dt({type:Object})],Wr.prototype,"animationOptions",void 0),e([dt({type:Object})],Wr.prototype,"keyframes",void 0),e([ft(".roll-list__shadow")],Wr.prototype,"clonedRollDigitList",void 0),e([ft(".roll-list")],Wr.prototype,"rollList",void 0),e([pt()],Wr.prototype,"digitWidth",void 0),Wr=e([ut("timered-counter-roller-digit")],Wr);class Qr extends Event{}let Gr=class extends at{constructor(){super(...arguments),this.color="",this.direction="up",this.parts=[],this.partPreprocessDataList=[],this.animationOptions=[],this.keyframes=[],this.cellStyles=[],this.digitStyles=[],this.partStyles=[],this.parentContainerRect={},this.__partDigitsColorStyles=[],this.digitAnimateEndCount=0,this.digitAnimatedCount=0}render(){return q`<span
231
+ > `}shouldAnimate(){const{cancelPrevAnimation:t,animate:e}=this.preprocessData;return t&&(this.animation&&this.animation.cancel(),this.rollList&&this.rollList.style&&this.rollList.style.cssText&&(this.rollList.style.cssText="")),!!e}async startAnimation(){if(Wt(this.rollList))return;this.__emitAnimationStart();const t=Lt({duration:1e3,iterations:1,easing:"ease-out",fill:"forwards"},this.animationOptions),e=Yt(this.keyframes)?{up:{transform:["translateY(0)","translateY(-100%)"]},down:{transform:["translateY(0)","translateY(100%)"]}}[this.direction]:this.keyframes;if(Ft(t.easing)&&si[t.easing]){const e=si[t.easing];t.easing=`linear(${function(...t){return Nt(Rt,t)}(0,64).map(((t,i)=>e(i/63))).join(",")})`}try{this.clearAnimation(),this.animation=this.rollList.animate(e,t),this.animation.addEventListener("finish",(()=>this.__emitAnimationEnd()),{once:!0})}catch(t){console.error(t)}}clearAnimation(){this.animation?.removeEventListener("finish",this.__emitAnimationEnd),this.animation?.cancel()}__emitAnimationStart(){this.isConnected&&this.dispatchEvent(new ni("roller-digit-animation-start"))}__emitAnimationEnd(){this.isConnected&&this.dispatchEvent(new ni("roller-digit-animation-end"))}};oi.styles=[Te],e([pt({type:Object})],oi.prototype,"digit",void 0),e([pt({type:Object})],oi.prototype,"preprocessData",void 0),e([pt({type:String})],oi.prototype,"direction",void 0),e([pt({type:Object})],oi.prototype,"textStyle",void 0),e([pt({type:Array})],oi.prototype,"cellStyle",void 0),e([pt({type:Object})],oi.prototype,"animationOptions",void 0),e([pt({type:Object})],oi.prototype,"keyframes",void 0),e([ft(".roll-list__shadow")],oi.prototype,"clonedRollDigitList",void 0),e([ft(".roll-list")],oi.prototype,"rollList",void 0),e([dt()],oi.prototype,"digitWidth",void 0),oi=e([ct("timered-counter-roller-digit")],oi);class ai extends Event{}let li=class extends at{constructor(){super(...arguments),this.color="",this.direction="up",this.parts=[],this.partPreprocessDataList=[],this.animationOptions=[],this.keyframes=[],this.cellStyles=[],this.digitStyles=[],this.partStyles=[],this.parentContainerRect={},this.__partDigitsColorStyles=[],this.digitAnimateEndCount=0,this.digitAnimatedCount=0}render(){return F`<span
239
232
  class="roller__prefix"
240
233
  data-part-id="-1"
241
234
  data-digit-id="0"
242
- style=${ur(this.__partDigitsColorStyles?.[-1]?.[0]??{})}
235
+ style=${$e(this.__partDigitsColorStyles?.[-1]?.[0]??{})}
243
236
  >
244
237
  <slot part="prefix" name="prefix"></slot>
245
238
  </span>
246
239
  <span class="counter-parts">
247
- ${Nt(this.parts,((t,e)=>e),((t,e)=>q`<span
240
+ ${Pt(this.parts,((t,e)=>e),((t,e)=>F`<span
248
241
  part="part"
249
242
  class="roller-part"
250
- style=${ur(this.partStyles?.[e]??{})}
251
- >${Nt(t.digits,((e,i)=>""+(t.digits.length-i)),((t,i)=>q`<timered-counter-roller-digit
243
+ style=${$e(this.partStyles?.[e]??{})}
244
+ >${Pt(t.digits,((e,i)=>""+(t.digits.length-i)),((t,i)=>F`<timered-counter-roller-digit
252
245
  exportparts="digit, cell"
253
246
  part="digit"
254
247
  class="roller-part__wrapper"
255
- style=${ur(this.digitStyles?.[e]?.[i]??{})}
248
+ style=${$e(this.digitStyles?.[e]?.[i]??{})}
256
249
  data-part-id="${e}"
257
250
  data-digit-id="${i}"
258
251
  .digit=${t}
@@ -263,11 +256,11 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
263
256
  .animationOptions=${this.animationOptions[e][i]}
264
257
  .keyframes=${this.keyframes[e][i]}
265
258
  @roller-digit-animation-end=${this.__handleDigitAnimationEnd}
266
- ></timered-counter-roller-digit>`))}${q`<span
259
+ ></timered-counter-roller-digit>`))}${F`<span
267
260
  class="roller-part__suffix"
268
261
  data-part-id="${e}"
269
262
  data-digit-id="-1"
270
- style=${ur(this.__partDigitsColorStyles?.[e]?.[-1]??{})}
263
+ style=${$e(this.__partDigitsColorStyles?.[e]?.[-1]??{})}
271
264
  ><slot
272
265
  part="part-suffix"
273
266
  name=${`part-suffix-${e}`}
@@ -278,9 +271,9 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
278
271
  class="roller__suffix"
279
272
  data-part-id="-2"
280
273
  data-digit-id="0"
281
- style=${ur(this.__partDigitsColorStyles?.[-2]?.[0]??{})}
274
+ style=${$e(this.__partDigitsColorStyles?.[-2]?.[0]??{})}
282
275
  ><slot part="suffix" name="suffix"></slot
283
- ></span>`}willUpdate(t){super.willUpdate(t),(t.has("direction")||t.has("parts"))&&(this.digitAnimateEndCount=0,this.digitAnimatedCount=this.partPreprocessDataList.flat().filter((({animate:t})=>t)).length,this.digitAnimatedCount>0&&this.__emitAnimationStart()),this.__partDigitsColorStyles=this.__generatePartDigitsColorStyles()}__handleDigitAnimationEnd(){this.digitAnimateEndCount++,this.digitAnimateEndCount<this.digitAnimatedCount||this.__emitAnimationEnd()}__emitAnimationStart(){this.isConnected&&this.dispatchEvent(new Qr("roller-animation-start"))}__emitAnimationEnd(){this.isConnected&&this.dispatchEvent(new Qr("roller-animation-end"))}__generatePartDigitsColorStyles(){const t=[],e=this.parentContainerRect,{prefixContainer:i,suffixContainer:r,color:n}=this,s=Array.from(this.shadowRoot?.querySelectorAll("[data-part-id]").values()??[]);if(!e)return t;i&&(s[-1]=i),r&&(s[-2]=r);for(const i of function(...t){return Mt(Object.values,t)}(s)){const r=Number.parseInt(i.dataset.partId??"-1",10),s=Number.parseInt(i.dataset.digitId??"-1",10);if(!Ft(r)||!Ft(s))throw new Error("The data-part-id and data-digit-id attributes are required.");t[r]||(t[r]=[]),CSS.supports("color",n)?t[r][s]={color:n}:CSS.supports("background-image",n)?t[r][s]={backgroundImage:n,backgroundClip:"text",backgroundSize:`${e.width}px ${e.height}px`,backgroundPositionX:-i.offsetLeft+"px",backgroundPositionY:-i.offsetTop+"px",backgroundRepeat:"no-repeat",color:"transparent","-webkit-text-fill-color":"transparent"}:(t[r][s]={},console.warn(new Error("The color property is not supported.")))}return t}};Gr.styles=[hr],e([dt({type:String})],Gr.prototype,"color",void 0),e([dt({type:String})],Gr.prototype,"direction",void 0),e([dt({type:Array})],Gr.prototype,"parts",void 0),e([dt({type:Array})],Gr.prototype,"partPreprocessDataList",void 0),e([dt({type:Array})],Gr.prototype,"animationOptions",void 0),e([dt({type:Array})],Gr.prototype,"keyframes",void 0),e([dt({type:Array})],Gr.prototype,"cellStyles",void 0),e([dt({type:Array})],Gr.prototype,"digitStyles",void 0),e([dt({type:Array})],Gr.prototype,"partStyles",void 0),e([dt({type:Object})],Gr.prototype,"parentContainerRect",void 0),e([ft(".roller__prefix")],Gr.prototype,"prefixContainer",void 0),e([ft(".roller__suffix")],Gr.prototype,"suffixContainer",void 0),Gr=e([ut("timered-counter-roller")],Gr);const Kr=t=>{class i extends t{constructor(){super(...arguments),this.ariaLabel="",this.ariaLive="polite"}generateAriaLabel(){let t="";const{direction:e}=this;for(const i of this.parts)for(const r of i.digits)t+=`${r.data["up"===e?r.data.length-1:0]}`;return t}willUpdate(t){super.willUpdate(t),this.ariaLabel=this.generateAriaLabel()}}return e([dt({attribute:"aria-label",reflect:!0})],i.prototype,"ariaLabel",void 0),e([dt({attribute:"aira-live",reflect:!0})],i.prototype,"ariaLive",void 0),i};class Jr extends Event{}t.TimeredCounter=class extends(Kr(or(oe(de(nr(at)))))){constructor(){super(),this.resizeObserver=new ResizeObserver((()=>{this.partsContainerRect=this.partsContainer?this.partsContainer.getBoundingClientRect():new DOMRect}))}firstUpdated(t){super.firstUpdated(t),this.partsContainer&&this.resizeObserver.observe(this.partsContainer)}render(){const t=this.extractCellStyles(),e=this.extractDigitStyles(),i=this.extractPartStyles(),r=this.extractAnimationOptions(),n=this.extractKeyframes();return q`
276
+ ></span>`}willUpdate(t){super.willUpdate(t),(t.has("direction")||t.has("parts"))&&(this.digitAnimateEndCount=0,this.digitAnimatedCount=this.partPreprocessDataList.flat().filter((({animate:t})=>t)).length,this.digitAnimatedCount>0&&this.__emitAnimationStart()),this.__partDigitsColorStyles=this.__generatePartDigitsColorStyles()}__handleDigitAnimationEnd(){this.digitAnimateEndCount++,this.digitAnimateEndCount<this.digitAnimatedCount||this.__emitAnimationEnd()}__emitAnimationStart(){this.isConnected&&this.dispatchEvent(new ai("roller-animation-start"))}__emitAnimationEnd(){this.isConnected&&this.dispatchEvent(new ai("roller-animation-end"))}__generatePartDigitsColorStyles(){const t=[],e=this.parentContainerRect,{prefixContainer:i,suffixContainer:r,color:s}=this,n=Array.from(this.shadowRoot?.querySelectorAll("[data-part-id]").values()??[]);if(!e)return t;i&&(n[-1]=i),r&&(n[-2]=r);for(const e of function(...t){return Nt(Object.values,t)}(n)){const i=Number.parseInt(e.dataset.partId??"-1",10),r=Number.parseInt(e.dataset.digitId??"-1",10);if(!zt(i)||!zt(r))throw new Error("The data-part-id and data-digit-id attributes are required.");t[i]||(t[i]=[]),CSS.supports("color",s)?t[i][r]={color:s}:CSS.supports("background-image",s)?t[i][r]={backgroundImage:s,backgroundClip:"text",backgroundSize:`${this.offsetWidth}px ${this.offsetHeight}px`,backgroundPositionX:-e.offsetLeft+"px",backgroundPositionY:-e.offsetTop+"px",backgroundRepeat:"no-repeat",color:"transparent","-webkit-text-fill-color":"transparent"}:(t[i][r]={},console.warn(new Error("The color property is not supported.")))}return t}};li.styles=[Se],e([pt({type:String})],li.prototype,"color",void 0),e([pt({type:String})],li.prototype,"direction",void 0),e([pt({type:Array})],li.prototype,"parts",void 0),e([pt({type:Array})],li.prototype,"partPreprocessDataList",void 0),e([pt({type:Array})],li.prototype,"animationOptions",void 0),e([pt({type:Array})],li.prototype,"keyframes",void 0),e([pt({type:Array})],li.prototype,"cellStyles",void 0),e([pt({type:Array})],li.prototype,"digitStyles",void 0),e([pt({type:Array})],li.prototype,"partStyles",void 0),e([pt({type:Object})],li.prototype,"parentContainerRect",void 0),e([ft(".roller__prefix")],li.prototype,"prefixContainer",void 0),e([ft(".roller__suffix")],li.prototype,"suffixContainer",void 0),li=e([ct("timered-counter-roller")],li);const ci=t=>{class i extends t{constructor(){super(...arguments),this.ariaLabel="",this.ariaLive="polite"}generateAriaLabel(){let t="";const{direction:e}=this;for(const i of this.parts)for(const r of i.digits)t+=`${r.data["up"===e?r.data.length-1:0]}`;return t}willUpdate(t){super.willUpdate(t),this.ariaLabel=this.generateAriaLabel()}}return e([pt({attribute:"aria-label",reflect:!0})],i.prototype,"ariaLabel",void 0),e([pt({attribute:"aira-live",reflect:!0})],i.prototype,"ariaLive",void 0),i};class ui extends Event{}t.TimeredCounter=class extends(ci(ge(oe(pe(ye(at)))))){constructor(){super(),this.resizeObserver=new ResizeObserver((()=>{this.partsContainerRect=this.partsContainer?this.partsContainer.getBoundingClientRect():new DOMRect}))}firstUpdated(t){super.firstUpdated(t),this.partsContainer&&this.resizeObserver.observe(this.partsContainer)}render(){const t=this.extractCellStyles(),e=this.extractDigitStyles(),i=this.extractPartStyles(),r=this.extractAnimationOptions(),s=this.extractKeyframes();return F`
284
277
  <timered-counter-roller
285
278
  exportparts="group, part, digit, cell, prefix, suffix, part-suffix"
286
279
  part="group"
@@ -291,7 +284,7 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
291
284
  .parts=${this.parts}
292
285
  .partPreprocessDataList=${this.partPreprocessDataList}
293
286
  .animationOptions=${r}
294
- .keyframes=${n}
287
+ .keyframes=${s}
295
288
  .cellStyles=${t}
296
289
  .digitStyles=${e}
297
290
  .partStyles=${i}
@@ -301,12 +294,12 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
301
294
  >
302
295
  <slot name="prefix" slot="prefix"></slot>
303
296
  <slot name="suffix" slot="suffix"></slot>
304
- ${Nt(this.parts,((t,e)=>e),((t,e)=>q`<slot
297
+ ${Pt(this.parts,((t,e)=>e),((t,e)=>F`<slot
305
298
  name=${`part-suffix-${e}`}
306
299
  slot=${`part-suffix-${e}`}
307
300
  ></slot>`))}
308
301
  </timered-counter-roller>
309
- `}dispatchTimeredCounterAnimationStart(){this.dispatchEvent(new Jr("timered-counter-animation-start"))}dispatchTimeredCounterAnimationEnd(){this.dispatchEvent(new Jr("timered-counter-animation-end"))}},t.TimeredCounter.styles=[sr],e([pt()],t.TimeredCounter.prototype,"partsContainerRect",void 0),e([ft("timered-counter-roller")],t.TimeredCounter.prototype,"partsContainer",void 0),t.TimeredCounter=e([ut("timered-counter")],t.TimeredCounter);const Xr=l``;t.TimeredCounterNumber=class extends t.TimeredCounter{constructor(){super(...arguments),this.localeNumber=!1,this.localeNumberInstance=new Intl.NumberFormat(this.localeInstance,Wt(this.localeNumber)?{}:this.localeNumber),this.localDecimalSeparator="",this.localeGroupingSeparator=""}sampleToString(t){return this.localeNumber?this.localeNumberInstance.format(this.numberAdapter.toNumber(t)):this.numberAdapter.toString(t)}render(){const t=this.extractCellStyles(),e=this.extractDigitStyles(),i=this.extractPartStyles(),r=this.extractAnimationOptions(),n=this.extractKeyframes();return q`
302
+ `}dispatchTimeredCounterAnimationStart(){this.dispatchEvent(new ui("timered-counter-animation-start"))}dispatchTimeredCounterAnimationEnd(){this.dispatchEvent(new ui("timered-counter-animation-end"))}},t.TimeredCounter.styles=[_e],e([dt()],t.TimeredCounter.prototype,"partsContainerRect",void 0),e([ft("timered-counter-roller")],t.TimeredCounter.prototype,"partsContainer",void 0),t.TimeredCounter=e([ct("timered-counter")],t.TimeredCounter);const hi=l``;t.TimeredCounterNumber=class extends t.TimeredCounter{constructor(){super(...arguments),this.localeNumber=!1,this.localeNumberInstance=new Intl.NumberFormat(this.localeInstance,qt(this.localeNumber)?{}:this.localeNumber),this.localDecimalSeparator="",this.localeGroupingSeparator=""}sampleToString(t){return this.localeNumber?this.localeNumberInstance.format(this.numberAdapter.toNumber(t)):this.numberAdapter.toString(t)}render(){const t=this.extractCellStyles(),e=this.extractDigitStyles(),i=this.extractPartStyles(),r=this.extractAnimationOptions(),s=this.extractKeyframes();return F`
310
303
  <timered-counter-roller
311
304
  class="timered-counter timered-counter-datetime-duration"
312
305
  exportparts="group, part, digit, cell, prefix, suffix, part-suffix"
@@ -317,7 +310,7 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
317
310
  .parts=${this.parts}
318
311
  .partPreprocessDataList=${this.partPreprocessDataList}
319
312
  .animationOptions=${r}
320
- .keyframes=${n}
313
+ .keyframes=${s}
321
314
  .cellStyles=${t}
322
315
  .digitStyles=${e}
323
316
  .partStyles=${i}
@@ -327,20 +320,20 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
327
320
  >
328
321
  <slot name="prefix" slot="prefix"></slot>
329
322
  <slot name="suffix" slot="suffix"></slot>
330
- ${Nt(this.parts,((t,e)=>e),((t,e)=>q`<slot
323
+ ${Pt(this.parts,((t,e)=>e),((t,e)=>F`<slot
331
324
  name=${`part-suffix-${e}`}
332
325
  slot=${`part-suffix-${e}`}
333
326
  ></slot>`))}
334
327
  </timered-counter-roller>
335
- `}willUpdate(t){if(t.has("localeNumber")||t.has("locale")){this.localeNumberInstance=new Intl.NumberFormat(this.localeInstance,Wt(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,Xr],e([dt({converter:t=>{if(Yt(t))return!1;try{return JSON.parse(t)}catch(t){return!0}},reflect:!0,attribute:"locale-number"})],t.TimeredCounterNumber.prototype,"localeNumber",void 0),e([pt()],t.TimeredCounterNumber.prototype,"localDecimalSeparator",void 0),e([pt()],t.TimeredCounterNumber.prototype,"localeGroupingSeparator",void 0),t.TimeredCounterNumber=e([ut("timered-counter-number")],t.TimeredCounterNumber);const tn=l``
328
+ `}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``
336
329
  /**
337
330
  * @license https://github.com/HarasimowiczKamil/any-base
338
- */;function en(t,e,i){return r=>function(t,e,i){let r,n,s,{length:o}=i;const a={},l=t.length,u=e.length,c=[];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(n=0,s=0,r=0;r<o;r++)n=n*l+a[r],n>=u?(a[s++]=Math.floor(n/u),n%=u):s>0&&(a[s++]=0);o=s,c.push(e[n])}while(0!==s);return c.reverse().join("")}(t.stringToChars(e),t.stringToChars(i),t.stringToChars(r))}const rn=" ";t.TimeredCounterString=class extends t.TimeredCounter{constructor(){super(...arguments),this.__alphabet="",this.__initialValueString="",this.__valueString="",this.__oldValueString="",this.__partsOptions=null,this.__decimalToAnyBase=en(this.stringAdapter,"0123456789",this.__alphabet),this.__anyBaseToDecimal=en(this.stringAdapter,this.__alphabet,"0123456789")}get initialValue(){return super.initialValue}set initialValue(t){if(!qt(t))try{t=t.toString()}catch(e){throw new Error(`value ${t} is not a string.`)}this.__initialValueString=t??"",zt(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(qt(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??"",zt(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:rn,...this.__partsOptions,digitToChar:{" ":rn,...this.__partsOptions.digitToChar}}}__updateAlphabet(t,e){const i=zt(t)&&zt(e)?"":`\0${e??""}${t??""}`,r=new Set(this.stringAdapter.stringToChars(i));this.__alphabet=Array.from(r).sort().join("");const n=this.stringAdapter,s=this.__alphabet;this.__decimalToAnyBase=en(n,"0123456789",s),this.__anyBaseToDecimal=en(n,s,"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,tn],t.TimeredCounterString=e([ut("timered-counter-string")],t.TimeredCounterString);const nn=36e5,sn=Symbol.for("constructDateFrom");function on(t,e){return"function"==typeof t?t(e):t&&"object"==typeof t&&sn in t?t[sn](e):t instanceof Date?new t.constructor(e):new Date(e)}function an(t,e){return on(t,t)}function ln(t,e,i){const r=an(t);return isNaN(e)?on(t,NaN):e?(r.setDate(r.getDate()+e),r):r}function un(t,e,i){const r=an(t);if(isNaN(e))return on(t,NaN);if(!e)return r;const n=r.getDate(),s=on(t,r.getTime());return s.setMonth(r.getMonth()+e+1,0),n>=s.getDate()?s:(r.setFullYear(s.getFullYear(),s.getMonth(),n),r)}function cn(t,e,i){return on(t,+an(t)+e)}function hn(t){const e=an(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 dn(t,...e){const i=on.bind(null,e.find((t=>"object"==typeof t)));return e.map(i)}function pn(t,e){const i=an(t);return i.setHours(0,0,0,0),i}function fn(t,e){const i=+an(t)-+an(e);return i<0?-1:i>0?1:i}function mn(t){return!(!((e=t)instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))&&"number"!=typeof t||isNaN(+an(t)));var e}function gn(t,e,i){const[r,n]=dn(0,t,e),s=yn(r,n),o=Math.abs(function(t,e){const[i,r]=dn(0,t,e),n=pn(i),s=pn(r),o=+n-hn(n),a=+s-hn(s);return Math.round((o-a)/864e5)}(r,n));r.setDate(r.getDate()-s*o);const a=s*(o-Number(yn(r,n)===-s));return 0===a?0:a}function yn(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 _n(t){return e=>{const i=(t?Math[t]:Math.trunc)(e);return 0===i?0:i}}function vn(t,e,i){const[r,n]=dn(0,t,e),s=(+r-+n)/nn;return _n(i?.roundingMethod)(s)}function bn(t,e){return+an(t)-+an(e)}function wn(t,e,i){const r=bn(t,e)/6e4;return _n(i?.roundingMethod)(r)}function An(t,e){const i=an(t);return+function(t){const e=an(t);return e.setHours(23,59,59,999),e}(i)==+function(t){const e=an(t),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}(i)}function $n(t,e,i){const[r,n,s]=dn(0,t,t,e),o=fn(n,s),a=Math.abs(function(t,e){const[i,r]=dn(0,t,e);return 12*(i.getFullYear()-r.getFullYear())+(i.getMonth()-r.getMonth())}(n,s));if(a<1)return 0;1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-o*a);let l=fn(n,s)===-o;An(r)&&1===a&&1===fn(r,s)&&(l=!1);const u=o*(a-+l);return 0===u?0:u}function Sn(t,e,i){const r=$n(t,e)/3;return _n(i?.roundingMethod)(r)}function xn(t,e,i){const r=bn(t,e)/1e3;return _n(i?.roundingMethod)(r)}function Nn(t,e,i){const r=gn(t,e)/7;return _n(i?.roundingMethod)(r)}function On(t,e,i){const[r,n]=dn(0,t,e),s=fn(r,n),o=Math.abs(function(t,e){const[i,r]=dn(0,t,e);return i.getFullYear()-r.getFullYear()}(r,n));r.setFullYear(1584),n.setFullYear(1584);const a=s*(o-+(fn(r,n)===-s));return 0===a?0:a}function Tn(t,e){return+an(t)<+an(e)}function En(t,e,i){return ln(t,-e)}function Dn(t,e,i){return function(t,e){return cn(t,e*nn)}(t,-e)}function Cn(t,e,i){return cn(t,-e)}function Pn(t,e,i){return function(t,e){const i=an(t);return i.setTime(i.getTime()+6e4*e),i}(t,-e)}function Mn(t,e,i){return function(t,e){return un(t,3*e)}(t,-e)}function kn(t,e,i){return function(t,e){return cn(t,1e3*e)}(t,-e)}function In(t,e,i){return function(t,e){return ln(t,7*e)}(t,-e)}function Rn(t,e,i){return function(t,e){return un(t,12*e)}(t,-e)}var Un;t.DurationPartType=void 0,(Un=t.DurationPartType||(t.DurationPartType={})).Millisecond="millisecond",Un.Second="second",Un.Minute="minute",Un.Hour="hour",Un.Day="day",Un.Week="weekOfYear",Un.Month="month",Un.Quarter="quarter",Un.Year="year";const Ln={[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},jn={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},Vn=["era","year","quarter","month","weekOfYear","weekday","day","dayPeriod","hour","minute","second","timeZoneName"];function Bn(e,i,r){let n=i;const s={};for(const i of r){let r=0;switch(i){case t.DurationPartType.Year:r=On(n,e),n=Rn(n,r);break;case t.DurationPartType.Quarter:r=Sn(n,e),n=Mn(n,r);break;case t.DurationPartType.Month:r=$n(n,e),n=un(n,-r);break;case t.DurationPartType.Week:r=Nn(n,e),n=In(n,r);break;case t.DurationPartType.Day:r=gn(n,e),n=En(n,r);break;case t.DurationPartType.Hour:r=vn(n,e),n=Dn(n,r);break;case t.DurationPartType.Minute:r=wn(n,e),n=Pn(n,r);break;case t.DurationPartType.Second:r=xn(n,e),n=kn(n,r);break;case t.DurationPartType.Millisecond:r=bn(n,e),n=Cn(n,r);break;default:throw new Error(`Unknown duration part: ${i}`)}s[i]=r}return s}function Hn(t,e,i){const r=Bn(t,e,i);return i.map((t=>r[t]))}const Fn={[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"},qn=[t.DurationPartType.Year,t.DurationPartType.Month,t.DurationPartType.Week,t.DurationPartType.Day],zn=[t.DurationPartType.Hour,t.DurationPartType.Minute,t.DurationPartType.Second],Yn=l`
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`
339
332
  ::part(part-suffix) {
340
333
  font-size: 0.4em;
341
334
  line-height: 1;
342
335
  }
343
- `;function Zn(t,e){qt(t)&&(t=ce(t)),Zt(t)||(t=[t,t]);const i=[Qt(t[0])?t[0]:an(t[0]),Qt(t[1])?t[1]:an(t[1])];if(!mn(i[0])||!mn(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=Ln[i],n=t.getTime(),s=e.getTime();return n-n%r+(Math.abs(s-n)%r>0?(n<s?-1:1)*r:0)+s%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){qt(e)&&(e=ce(e)),this.__precision=e,this.__minPrecision=Zt(this.__precision)?this.__precision[0]:this.__precision,this.__maxPrecision=Zt(this.__precision)?this.__precision[1]:this.__precision,this.__availableDurationParts=Object.values(t.DurationPartType).reverse().map((t=>{const e=Ln[this.__minPrecision],i=Ln[this.__maxPrecision],r=Ln[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}=Zn(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}=Zn(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=Vt(this.__availableDurationParts,(t=>t.type)),i=e.map((()=>[]));for(const r of t){const t=this.numberAdapter.toNumber(r);Hn(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=qn.map((e=>Ft(t[e])?`${t[e]}${Fn[e]}`:"")),i=zn.map((e=>Ft(t[e])?`${t[e]}${Fn[e]}`:""));return`P${e.join("")}T${i.join("")}`}(Bn(Tn(this.__from,this.__to)?this.__from:this.__to,Tn(this.__from,this.__to)?this.__to:this.__from,Vt(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 Vn.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(),n=this.extractKeyframes(),s=Vt(this.__availableDurationParts,(t=>t.type));return q`
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`
344
337
  <timered-counter-roller
345
338
  class="timered-counter timered-counter-datetime-duration"
346
339
  exportparts="group, part, digit, cell, prefix, suffix, part-suffix"
@@ -351,7 +344,7 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
351
344
  .parts=${this.parts}
352
345
  .partPreprocessDataList=${this.partPreprocessDataList}
353
346
  .animationOptions=${r}
354
- .keyframes=${n}
347
+ .keyframes=${s}
355
348
  .cellStyles=${t}
356
349
  .digitStyles=${e}
357
350
  .partStyles=${i}
@@ -359,9 +352,9 @@ function ft(t,e){return(e,i,r)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Ref
359
352
  @roller-animation-start=${this.dispatchTimeredCounterAnimationStart}
360
353
  @roller-animation-end=${this.dispatchTimeredCounterAnimationEnd}
361
354
  ><slot name="prefix" slot="prefix"></slot
362
- ><slot name="suffix" slot="suffix"></slot>${Nt(this.parts,((t,e)=>e),((t,e)=>q`<span slot=${`part-suffix-${e}`} class="duration-unit"
363
- >${this.__dateTimeFieldLabels[s[e]]}</span
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
+ >${this.__dateTimeFieldLabels[n[e]]}</span
364
357
  >`))}
365
358
  </timered-counter-roller>
366
- `}},t.TimeredCounterDatetimeDuration.styles=[...t.TimeredCounter.styles,Yn],e([dt({reflect:!0,converter:t=>Yt(t)?t:ce(t)})],t.TimeredCounterDatetimeDuration.prototype,"precision",null),t.TimeredCounterDatetimeDuration=e([ut("timered-counter-datetime-duration")],t.TimeredCounterDatetimeDuration),t.DurationPartMillisecond=Ln,t.DurationPartMillisecondToType=jn,t.cubicBezier=mr,t.easeInBack=Ur,t.easeInBounce=qr,t.easeInCirc=kr,t.easeInCubic=Ar,t.easeInElastic=Vr,t.easeInExpo=Cr,t.easeInOutBack=jr,t.easeInOutBounce=zr,t.easeInOutCirc=Rr,t.easeInOutCubic=Sr,t.easeInOutElastic=Hr,t.easeInOutExpo=Mr,t.easeInOutQuad=wr,t.easeInOutQuart=Or,t.easeInOutQuint=Dr,t.easeInOutSine=_r,t.easeInQuad=vr,t.easeInQuart=xr,t.easeInQuint=Tr,t.easeInSine=gr,t.easeOutBack=Lr,t.easeOutBounce=Fr,t.easeOutCirc=Ir,t.easeOutCubic=$r,t.easeOutElastic=Br,t.easeOutExpo=Pr,t.easeOutQuad=br,t.easeOutQuart=Nr,t.easeOutQuint=Er,t.easeOutSine=yr,t.linear=t=>t,t.noop=pr,t.setNumberAdapter=function(t,e){rr.setNumberAdapter(t,e)},t.setStringAdapter=function(t){rr.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={});
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={});
367
360
  //# sourceMappingURL=timered-counter.global.js.map