flipclock
Version:
A full featured, themeable, type safe, and well tested library for clocks, timers, counters, and flipboards.
8 lines (7 loc) • 43.2 kB
JavaScript
(function(d,z){typeof exports=="object"&&typeof module<"u"?z(exports):typeof define=="function"&&define.amd?define(["exports"],z):(d=typeof globalThis<"u"?globalThis:d||self,z(d.FlipClock={}))})(this,(function(d){"use strict";class z{events=[];emit(e,...n){for(const i of this.events)i.key===e&&i.fn(...n)}on(e,n){const i=()=>{const o=this.events.findIndex(s=>s.key===e&&s.fn===n);this.events.splice(o,1)};return this.events.push({key:e,fn:n,unwatch:i}),i}once(e,n){const i=this.on(e,(...o)=>{n(...o),i()});return i}off(e,n){for(const i of this.events)i.key===e&&(!n||n===i.fn)&&i.unwatch()}reset(){this.events=[]}}function Ye(){return new z}const He=!1,Pe=(t,e)=>t===e,qe=Symbol("solid-track"),st={equals:Pe};let Nt=Ht;const L=1,ot=2,jt={owned:null,cleanups:null,context:null,owner:null};var D=null;let At=null,We=null,S=null,k=null,I=null,at=0;function R(t,e){const n=S,i=D,o=t.length===0,s=e===void 0?i:e,r=o?jt:{owned:null,cleanups:null,context:s?s.context:null,owner:s},a=o?t:()=>t(()=>V(()=>tt(r)));D=r,S=null;try{return Z(a,!0)}finally{S=n,D=i}}function Y(t,e){e=e?Object.assign({},st,e):st;const n={value:t,observers:null,observerSlots:null,comparator:e.equals||void 0},i=o=>(typeof o=="function"&&(o=o(n.value)),Yt(n,o));return[Rt.bind(n),i]}function H(t,e,n){const i=St(t,e,!1,L);Q(i)}function zt(t,e,n){Nt=Ge;const i=St(t,e,!1,L);i.user=!0,I?I.push(i):Q(i)}function $(t,e,n){n=n?Object.assign({},st,n):st;const i=St(t,e,!0,0);return i.observers=null,i.observerSlots=null,i.comparator=n.equals||void 0,Q(i),Rt.bind(i)}function V(t){if(S===null)return t();const e=S;S=null;try{return t()}finally{S=e}}function Be(t){return D===null||(D.cleanups===null?D.cleanups=[t]:D.cleanups.push(t)),t}const[fi,hi]=Y(!1);function Ue(t){const e=$(t),n=$(()=>Dt(e()));return n.toArray=()=>{const i=n();return Array.isArray(i)?i:i!=null?[i]:[]},n}function Rt(){if(this.sources&&this.state)if(this.state===L)Q(this);else{const t=k;k=null,Z(()=>ut(this),!1),k=t}if(S){const t=this.observers?this.observers.length:0;S.sources?(S.sources.push(this),S.sourceSlots.push(t)):(S.sources=[this],S.sourceSlots=[t]),this.observers?(this.observers.push(S),this.observerSlots.push(S.sources.length-1)):(this.observers=[S],this.observerSlots=[S.sources.length-1])}return this.value}function Yt(t,e,n){let i=t.value;return(!t.comparator||!t.comparator(i,e))&&(t.value=e,t.observers&&t.observers.length&&Z(()=>{for(let o=0;o<t.observers.length;o+=1){const s=t.observers[o],r=At&&At.running;r&&At.disposed.has(s),(r?!s.tState:!s.state)&&(s.pure?k.push(s):I.push(s),s.observers&&Pt(s)),r||(s.state=L)}if(k.length>1e6)throw k=[],new Error},!1)),e}function Q(t){if(!t.fn)return;tt(t);const e=at;Je(t,t.value,e)}function Je(t,e,n){let i;const o=D,s=S;S=D=t;try{i=t.fn(e)}catch(r){return t.pure&&(t.state=L,t.owned&&t.owned.forEach(tt),t.owned=null),t.updatedAt=n+1,qt(r)}finally{S=s,D=o}(!t.updatedAt||t.updatedAt<=n)&&(t.updatedAt!=null&&"observers"in t?Yt(t,i):t.value=i,t.updatedAt=n)}function St(t,e,n,i=L,o){const s={fn:t,state:i,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:D,context:D?D.context:null,pure:n};return D===null||D!==jt&&(D.owned?D.owned.push(s):D.owned=[s]),s}function lt(t){if(t.state===0)return;if(t.state===ot)return ut(t);if(t.suspense&&V(t.suspense.inFallback))return t.suspense.effects.push(t);const e=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt<at);)t.state&&e.push(t);for(let n=e.length-1;n>=0;n--)if(t=e[n],t.state===L)Q(t);else if(t.state===ot){const i=k;k=null,Z(()=>ut(t,e[0]),!1),k=i}}function Z(t,e){if(k)return t();let n=!1;e||(k=[]),I?n=!0:I=[],at++;try{const i=t();return Ke(n),i}catch(i){n||(I=null),k=null,qt(i)}}function Ke(t){if(k&&(Ht(k),k=null),t)return;const e=I;I=null,e.length&&Z(()=>Nt(e),!1)}function Ht(t){for(let e=0;e<t.length;e++)lt(t[e])}function Ge(t){let e,n=0;for(e=0;e<t.length;e++){const i=t[e];i.user?t[n++]=i:lt(i)}for(e=0;e<n;e++)lt(t[e])}function ut(t,e){t.state=0;for(let n=0;n<t.sources.length;n+=1){const i=t.sources[n];if(i.sources){const o=i.state;o===L?i!==e&&(!i.updatedAt||i.updatedAt<at)&<(i):o===ot&&ut(i,e)}}}function Pt(t){for(let e=0;e<t.observers.length;e+=1){const n=t.observers[e];n.state||(n.state=ot,n.pure?k.push(n):I.push(n),n.observers&&Pt(n))}}function tt(t){let e;if(t.sources)for(;t.sources.length;){const n=t.sources.pop(),i=t.sourceSlots.pop(),o=n.observers;if(o&&o.length){const s=o.pop(),r=n.observerSlots.pop();i<o.length&&(s.sourceSlots[r]=i,o[i]=s,n.observerSlots[i]=r)}}if(t.tOwned){for(e=t.tOwned.length-1;e>=0;e--)tt(t.tOwned[e]);delete t.tOwned}if(t.owned){for(e=t.owned.length-1;e>=0;e--)tt(t.owned[e]);t.owned=null}if(t.cleanups){for(e=t.cleanups.length-1;e>=0;e--)t.cleanups[e]();t.cleanups=null}t.state=0}function Xe(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function qt(t,e=D){throw Xe(t)}function Dt(t){if(typeof t=="function"&&!t.length)return Dt(t());if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++){const i=Dt(t[n]);Array.isArray(i)?e.push.apply(e,i):e.push(i)}return e}return t}const Wt=Symbol("fallback");function Bt(t){for(let e=0;e<t.length;e++)t[e]()}function Qe(t,e,n={}){let i=[],o=[],s=[],r=[],a=0,l;return Be(()=>Bt(s)),()=>{const u=t()||[],f=u.length;return u[qe],V(()=>{if(f===0)return a!==0&&(Bt(s),s=[],i=[],o=[],a=0,r=[]),n.fallback&&(i=[Wt],o[0]=R(h=>(s[0]=h,n.fallback())),a=1),o;for(i[0]===Wt&&(s[0](),s=[],i=[],o=[],a=0),l=0;l<f;l++)l<i.length&&i[l]!==u[l]?r[l](()=>u[l]):l>=i.length&&(o[l]=R(g));for(;l<i.length;l++)s[l]();return a=r.length=s.length=f,i=u.slice(0),o=o.slice(0,a)});function g(h){s[l]=h;const[c,w]=Y(u[l]);return r[l]=w,e(c,l)}}}function F(t,e){return V(()=>t(e||{}))}const Ut=t=>`Stale read from <${t}>.`;function Ze(t){const e="fallback"in t&&{fallback:()=>t.fallback};return $(Qe(()=>t.each,t.children,e||void 0))}function tn(t){const e=t.keyed,n=$(()=>t.when,void 0,void 0),i=e?n:$(n,void 0,{equals:(o,s)=>!o==!s});return $(()=>{const o=i();if(o){const s=t.children;return typeof s=="function"&&s.length>0?V(()=>s(e?o:()=>{if(!V(i))throw Ut("Show");return n()})):s}return t.fallback},void 0,void 0)}function en(t){const e=Ue(()=>t.children),n=$(()=>{const i=e(),o=Array.isArray(i)?i:[i];let s=()=>{};for(let r=0;r<o.length;r++){const a=r,l=o[r],u=s,f=$(()=>u()?void 0:l.when,void 0,void 0),g=l.keyed?f:$(f,void 0,{equals:(h,c)=>!h==!c});s=()=>u()||(g()?[a,f,l]:void 0)}return s});return $(()=>{const i=n()();if(!i)return t.fallback;const[o,s,r]=i,a=r.children;return typeof a=="function"&&a.length>0?V(()=>a(r.keyed?s():()=>{if(V(n)()?.[0]!==o)throw Ut("Match");return s()})):a},void 0,void 0)}function Mt(t){return t}class kt extends SyntaxError{constructor(e,n,i,o){super(e),this.expected=n,this.found=i,this.location=o,this.name="SyntaxError"}format(e){let n="Error: "+this.message;if(this.location){let i=null;const o=e.find(l=>l.source===this.location.source);o&&(i=o.text.split(/\r\n|\n|\r/g));const s=this.location.start,r=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(s):s,a=this.location.source+":"+r.line+":"+r.column;if(i){const l=this.location.end,u="".padEnd(r.line.toString().length," "),f=i[s.line-1],h=(s.line===l.line?l.column:f.length+1)-s.column||1;n+=`
--> `+a+`
`+u+` |
`+r.line+" | "+f+`
`+u+" | "+"".padEnd(s.column-1," ")+"".padEnd(h,"^")}else n+=`
at `+a}return n}static buildMessage(e,n){function i(h){return h.codePointAt(0).toString(16).toUpperCase()}const o=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function s(h){return o?h.replace(o,c=>"\\u{"+i(c)+"}"):h}function r(h){return s(h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,c=>"\\x0"+i(c)).replace(/[\x10-\x1F\x7F-\x9F]/g,c=>"\\x"+i(c)))}function a(h){return s(h.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,c=>"\\x0"+i(c)).replace(/[\x10-\x1F\x7F-\x9F]/g,c=>"\\x"+i(c)))}const l={literal(h){return'"'+r(h.text)+'"'},class(h){const c=h.parts.map(w=>Array.isArray(w)?a(w[0])+"-"+a(w[1]):a(w));return"["+(h.inverted?"^":"")+c.join("")+"]"+(h.unicode?"u":"")},any(){return"any character"},end(){return"end of input"},other(h){return h.description}};function u(h){return l[h.type](h)}function f(h){const c=h.map(u);if(c.sort(),c.length>0){let w=1;for(let v=1;v<c.length;v++)c[v-1]!==c[v]&&(c[w]=c[v],w++);c.length=w}switch(c.length){case 1:return c[0];case 2:return c[0]+" or "+c[1];default:return c.slice(0,-1).join(", ")+", or "+c[c.length-1]}}function g(h){return h?'"'+r(h)+'"':"end of input"}return"Expected "+f(e)+" but "+g(n)+" found."}}function Jt(t,e){e=e!==void 0?e:{};const n={},i=e.grammarSource,o={array:vt};let s=vt;const r="[",a="]",l=/^[[\]]/,u=_e("[",!1),f=_e("]",!1),g=ai(["[","]"],!1,!1,!1),h=li();function c(b){return()=>b}function w(b){return b}function v(b){for(const m of b)typeof m=="function"&&b.splice(b.indexOf(m),1,...m());return b}function M(b){return b.flat(1).filter(Boolean)}let y=e.peg$currPos|0;const B=[{line:1,column:1}];let x=y,wt=e.peg$maxFailExpected||[],j=e.peg$silentFails|0,rt;if(e.startRule){if(!(e.startRule in o))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');s=o[e.startRule]}function oi(b=y){const m=t.codePointAt(b);return m===void 0?"":String.fromCodePoint(m)}function _e(b,m){return{type:"literal",text:b,ignoreCase:m}}function ai(b,m,p,A){return{type:"class",parts:b,inverted:m,ignoreCase:p,unicode:A}}function li(){return{type:"any"}}function ui(){return{type:"end"}}function Le(b){let m=B[b],p;if(m)return m;if(b>=B.length)p=B.length-1;else for(p=b;!B[--p];);for(m=B[p],m={line:m.line,column:m.column};p<b;)t.charCodeAt(p)===10?(m.line++,m.column=1):m.column++,p++;return B[b]=m,m}function Ne(b,m,p){const A=Le(b),J=Le(m);return{source:i,start:{offset:b,line:A.line,column:A.column},end:{offset:m,line:J.line,column:J.column}}}function U(b){y<x||(y>x&&(x=y,wt=[]),wt.push(b))}function ci(b,m,p){return new kt(kt.buildMessage(b,m),b,m,p)}function vt(){let b,m,p,A,J,K;for(b=y,m=[],p=y,A=je(),A!==n&&(A=c(A)),p=A,p===n&&(p=y,t.charCodeAt(y)===91?(A=r,y++):(A=n,j===0&&U(u)),A!==n?(J=vt(),t.charCodeAt(y)===93?(K=a,y++):(K=n,j===0&&U(f)),K!==n?p=J:(y=p,p=n)):(y=p,p=n));p!==n;)m.push(p),p=y,A=je(),A!==n&&(A=c(A)),p=A,p===n&&(p=y,t.charCodeAt(y)===91?(A=r,y++):(A=n,j===0&&U(u)),A!==n?(J=vt(),t.charCodeAt(y)===93?(K=a,y++):(K=n,j===0&&U(f)),K!==n?p=J:(y=p,p=n)):(y=p,p=n));return m=v(m),b=m,b}function je(){let b,m,p;if(b=y,m=[],p=ze(),p!==n)for(;p!==n;)m.push(p),p=ze();else m=n;return m!==n&&(m=M(m)),b=m,b}function ze(){let b,m,p;return b=y,m=y,j++,p=t.charAt(y),l.test(p)?y++:(p=n,j===0&&U(g)),j--,p===n?m=void 0:(y=m,m=n),m!==n?(t.length>y?(p=t.charAt(y),y++):(p=n,j===0&&U(h)),p!==n?(m=[m,p],b=m):(y=b,b=n)):(y=b,b=n),b}rt=s();const Lt=rt!==n&&y===t.length;function Re(){throw rt!==n&&y<t.length&&U(ui()),ci(wt,x<t.length?oi(x):null,x<t.length?Ne(x,x+1):Ne(x,x))}if(e.peg$library)return{peg$result:rt,peg$currPos:y,peg$FAILED:n,peg$maxFailExpected:wt,peg$maxFailPos:x,peg$success:Lt,peg$throw:Lt?void 0:Re};if(Lt)return rt;Re()}const nn=["array"],Kt=" ";function Gt(){function t(n){if(n===void 0)return[];if(typeof n=="string")return n.match(/\[|\]/)?Jt(n):Array.from(n);if(typeof n=="number")return Array.from(n.toString());for(const i of n){const o=n.indexOf(i),s=t(i);typeof i=="string"?n.splice(o,1,...s):n.splice(o,1,s)}return n.filter(Boolean)}function e(n){if(!Array.isArray(n))return!1;for(const i in n)if(!(typeof n[i]=="string"&&n[i].length===1)){if(Array.isArray(n[i])){if(!n[i].length)continue}else return!1;if(!e(n[i]))return!1}return!0}return{digitize:t,isDigitized:e}}function Ct(t,e,n,i){typeof n=="function"?(i=n,n={}):n||(n={});const o=!n.backwards;function s(r,a){if(et(a)){r=Qt(r);const l=Math.max(a.length,r.length);for(let u=o?0:l-1;o?u<l:u>=0;o?u++:u--){const f=r[u]?s(r[u],a[u]):s([],a[u]);r[u]?r[u]=f:r.push(f)}for(let u=0;u<r.length;u++)r[u]===void 0&&r.splice(u,1);return r}if(Array.isArray(a)&&!et(a)){r=Xt(r);let l=0;for(;l<r.length;){const u=o?l:r.length-1-l,f=o?l:a.length-1-l;r[u]=s(r[u],a[f]),r[u]===void 0?r.splice(u,1):l++}for(let u=o?r.length:a.length-1;o?u<a.length:u>=r.length;o?u++:u--){const f=s(void 0,a[u]);if(f===void 0)break;r.push(f)}return r}return i?i(ct(r),a):ct(r)}return s(t,e)}function ct(t){return Array.isArray(t)?ct(t[0]):t}function Xt(t){return et(t)?t.flat(1/0):Array.isArray(t)?t:t===void 0?[]:[t]}function Qt(t){return et(t)?t:Array.isArray(t)?[t]:t===void 0?[[]]:[[t]]}function et(t){if(!Array.isArray(t)||!t.length)return!1;for(const e in t)if(Array.isArray(t[e]))return!0;return!1}function ft(t){function e(n,i=0){for(const o of n)Array.isArray(o)?i+=e(o):i+=o.length;return i}return e(t)}function Zt(){return{stop:!0}}function te(t){const e=[];return(...n)=>{const[i]=n,o=typeof i=="object"||Array.isArray(i)?JSON.stringify(i):i,s=t(e,...n);if(s&&typeof s=="object"&&"stop"in s)return i;const r=s,a=typeof r=="object"||Array.isArray(r)?JSON.stringify(r):r;return o!==a&&e.push({from:i,to:r}),r}}function ht(t,e){return te((n,...i)=>t(n,...i)?e(...i):Zt())}function rn(t,e){return ht((n,...i)=>n.length<t,e)}class dt{digitizer;$value;$digits;constructor(e,n){this.digitizer=n?.digitizer||Gt(),this.$value=Y(e),this.$digits=Y(n?.digits??this.digitizer.digitize(e))}get digits(){return this.$digits[0]()}set digits(e){this.$digits[1](e)}get length(){return ft(this.$digits[0]())}get value(){return this.$value[0]()}set value(e){this.$value[1](e),this.$digits[1](this.digitizer.digitize(e))}compare(e){return JSON.stringify(this.digits)===JSON.stringify(e?.digits)}copy(){return new dt(this.value,{digits:this.digits,digitizer:this.digitizer})}}function P(t,e){return new dt(t,e)}function ee(t=0,e){return Array.from(Array(e).keys()).map(n=>n+t)}function gt(t,e){return ee(t.charCodeAt(0),e.charCodeAt(0)+1-t.charCodeAt(0)).map(i=>String.fromCharCode(i))}function ne(t){const e=[];for(;t.length;){const n=Math.floor(Math.random()*t.length);e.push(...t.splice(n,1))}return e}function ie(){return[...gt("a","z"),...gt("A","Z"),...gt("0","9"),'"',"'",":","-",".",",","!","?"]}function re(t){const e=t?.blacklist??[],n=t?.whitelist??[],i=t?.emptyChar??Kt,o=typeof t?.shuffle=="function"?t.shuffle:t?.shuffle?ne:void 0;function s(){const c=t?.charset||ie;return o?o(c()):c()}const r=s();function a(c){const w=c.charCodeAt(0),v=r.map(M=>M.charCodeAt(0));return String.fromCharCode(v.reduce((M,y)=>Math.abs(y-w)<Math.abs(M-w)?y:M))}function l(c,w=1){let v=[i,...r,i,...r];w<0&&(v=v.reverse());let M=1;c===void 0?c=i:v.includes(c)||(c=i,M=0);const y=v.indexOf(c);return v.slice(y+M,v.indexOf(c,y+1)+M).splice(0,Math.abs(w))}function u(c,w,v=1){if(w===void 0&&c===i)return;if(typeof w=="string"&&!r.includes(w))return w;if(c&&(h(c)||w===c))return c;if(c&&g(c))return a(c);const M=l(c,v);if(typeof w=="string"&&M.includes(w))return w;const y=M[v-1];if(!(w===void 0&&c&&y&&r.indexOf(y)<r.indexOf(c)))return M[v-1]}function f(c,w,v=1){if(w===void 0&&c===i)return;if(typeof w=="string"&&!r.includes(w))return w;if(c&&(h(c)||w===c))return c;if(c&&g(c))return a(c);const M=l(c,-v);if(typeof w=="string"&&M.includes(w))return w;const y=M[v-1];if(!(w===void 0&&c&&y&&r.indexOf(y)>r.indexOf(c)))return M[v-1]}function g(c){return e.includes(c)}function h(c){return n.includes(c)}return{charset:r,chunk:l,emptyChar:i,isBlacklisted:g,isWhitelisted:h,next:u,prev:f}}let sn={data:""},on=t=>typeof window=="object"?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||sn,an=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ln=/\/\*[^]*?\*\/| +/g,se=/\n+/g,q=(t,e)=>{let n="",i="",o="";for(let s in t){let r=t[s];s[0]=="@"?s[1]=="i"?n=s+" "+r+";":i+=s[1]=="f"?q(r,s):s+"{"+q(r,s[1]=="k"?"":e)+"}":typeof r=="object"?i+=q(r,e?e.replace(/([^,])+/g,a=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):r!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=q.p?q.p(s,r):s+":"+r+";")}return n+(e&&o?e+"{"+o+"}":o)+i},_={},oe=t=>{if(typeof t=="object"){let e="";for(let n in t)e+=n+oe(t[n]);return e}return t},un=(t,e,n,i,o)=>{let s=oe(t),r=_[s]||(_[s]=(l=>{let u=0,f=11;for(;u<l.length;)f=101*f+l.charCodeAt(u++)>>>0;return"go"+f})(s));if(!_[r]){let l=s!==t?t:(u=>{let f,g,h=[{}];for(;f=an.exec(u.replace(ln,""));)f[4]?h.shift():f[3]?(g=f[3].replace(se," ").trim(),h.unshift(h[0][g]=h[0][g]||{})):h[0][f[1]]=f[2].replace(se," ").trim();return h[0]})(t);_[r]=q(o?{["@keyframes "+r]:l}:l,n?"":"."+r)}let a=n&&_.g?_.g:null;return n&&(_.g=_[r]),((l,u,f,g)=>{g?u.data=u.data.replace(g,l):u.data.indexOf(l)===-1&&(u.data=f?l+u.data:u.data+l)})(_[r],e,i,a),r},cn=(t,e,n)=>t.reduce((i,o,s)=>{let r=e[s];if(r&&r.call){let a=r(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;r=l?"."+l:a&&typeof a=="object"?a.props?"":q(a,""):a===!1?"":a}return i+o+(r??"")},"");function $t(t){let e=this||{},n=t.call?t(e.p):t;return un(n.unshift?n.raw?cn(n,[].slice.call(arguments,1),e.p):n.reduce((i,o)=>Object.assign(i,o&&o.call?o(e.p):o),{}):n,on(e.target),e.g,e.o,e.k)}$t.bind({g:1}),$t.bind({k:1});function Ft(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function nt(t,e){for(const n in e){const i=e[n],o=t[n];Ft(o)&&Ft(i)?t[n]=nt(o,i):Ft(i)?t[n]=nt({},i):t[n]=i}return t}function Et(t){const e=[];function n(...s){const r=e.reduce((a,l)=>nt(a,l(...s)),t(...s));return{css:r,toString(){return $t(r)}}}function i(s){return e.push(s),n}function o(s){return Et((...r)=>nt(n(...r).css,s(...r)))}return n.merge=i,n.extend=o,n}function xt(t){const e=new Map(Array.isArray(t)?t:Object.entries(t));function n(o,s){if(typeof o=="string"&&s!==void 0)e.set(o,s);else if(Array.isArray(o))for(const[r,a]of o)e.set(r,a);else if(typeof o=="object")for(const[r,a]of Object.entries(o))e.set(r,a)}function i(o){if(Array.isArray(o))for(const s of o)e.delete(s);else e.delete(o)}return{map:e,define:n,unset:i}}function fn(t){const{map:e,define:n,unset:i}=xt(Array.isArray(t)?t:Object.entries(t));function o(s,r){const a=e.get(s);return typeof a=="function"?a(s):a!==void 0?a:r!==void 0?r:s}return{map:e,define:n,translate:o,unset:i}}const hn=7,dn=864e5,gn=36e5,mn=6e4,ae=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],le=["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ue=["January","February","March","April","May","June","July","August","September","October","November","December"],ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ot(t){const{map:e,define:n,unset:i}=xt({A:r=>r.getHours()<12?"AM":"PM",a:r=>r.getHours()<12?"am":"pm",Q:r=>Math.ceil((r.getMonth()+1)/3).toString(),YYYY:r=>r.getFullYear().toString(),YY:r=>E(r.getFullYear().toString().slice(2),2),MMMM:r=>String(ue[r.getMonth()]),MMM:r=>String(ce[r.getMonth()]),MM:r=>E(r.getMonth()+1,2),M:r=>String(r.getMonth()+1),DDDD:r=>String(ae[r.getDay()]),DDD:r=>String(le[r.getDay()]),DD:r=>E(r.getDate(),2),D:r=>String(r.getDate()),HH:r=>E(r.getHours(),2),H:r=>String(r.getHours()),hh:r=>E(Tt(r),2),h:r=>Tt(r),mm:r=>E(r.getMinutes(),2),m:r=>String(r.getMinutes()),ss:r=>E(r.getSeconds(),2),s:r=>String(r.getSeconds()),vvvv:r=>E(r.getMilliseconds(),4),vvv:r=>E(r.getMilliseconds(),3),vv:r=>E(r.getMilliseconds(),2),v:r=>String(r.getMilliseconds()),...t?.formats}),o=typeof t?.translate=="function"?t.translate:t?.translate?.translate;function s(r,a){const l=new RegExp([...fe(e)].join("|"),"g");return a.replace(l,u=>{const f=e.get(u)(r);return o?.(f)??f})}return{map:e,define:n,format:s,unset:i}}function fe(t){return Array.from(t.keys()).sort((e,n)=>e.length<n.length?1:e.length>n.length?-1:0)}function E(t,e){return t===void 0?"":(typeof t=="number"&&(t=t.toString()),e<t.length?t:Array(e-t.length+1).join("0")+t)}function Tt(t){const e=t.getHours()%12;return String(e===0?12:e)}const yn=864e5,pn=6e4,bn=36e5,he=Symbol.for("constructDateFrom");function O(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&he in t?t[he](e):t instanceof Date?new t.constructor(e):new Date(e)}function C(t,e){return O(e||t,t)}function de(t,e,n){const i=C(t,n?.in);return isNaN(e)?O(n?.in||t,NaN):(e&&i.setDate(i.getDate()+e),i)}function ge(t,e,n){const i=C(t,n?.in);if(isNaN(e))return O(n?.in||t,NaN);if(!e)return i;const o=i.getDate(),s=O(n?.in||t,i.getTime());s.setMonth(i.getMonth()+e+1,0);const r=s.getDate();return o>=r?s:(i.setFullYear(s.getFullYear(),s.getMonth(),o),i)}function N(t,e,n){const{years:i=0,months:o=0,weeks:s=0,days:r=0,hours:a=0,minutes:l=0,seconds:u=0}=e,f=C(t,n?.in),g=o||i?ge(f,o+i*12):f,h=r||s?de(g,r+s*7):g,c=l+a*60,v=(u+c*60)*1e3;return O(n?.in||t,+h+v)}function me(t){const e=C(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function W(t,...e){const n=O.bind(null,t||e.find(i=>typeof i=="object"));return e.map(n)}function ye(t,e){const n=C(t,e?.in);return n.setHours(0,0,0,0),n}function wn(t,e,n){const[i,o]=W(n?.in,t,e),s=ye(i),r=ye(o),a=+s-me(s),l=+r-me(r);return Math.round((a-l)/yn)}function it(t,e){const n=+C(t)-+C(e);return n<0?-1:n>0?1:n}function vn(t,e,n){const[i,o]=W(n?.in,t,e),s=i.getFullYear()-o.getFullYear(),r=i.getMonth()-o.getMonth();return s*12+r}function An(t,e,n){const[i,o]=W(n?.in,t,e);return i.getFullYear()-o.getFullYear()}function pe(t,e,n){const[i,o]=W(n?.in,t,e),s=be(i,o),r=Math.abs(wn(i,o));i.setDate(i.getDate()-s*r);const a=+(be(i,o)===-s),l=s*(r-a);return l===0?0:l}function be(t,e){const n=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 n<0?-1:n>0?1:n}function mt(t){return e=>{const i=(t?Math[t]:Math.trunc)(e);return i===0?0:i}}function Sn(t,e,n){const[i,o]=W(n?.in,t,e),s=(+i-+o)/bn;return mt(n?.roundingMethod)(s)}function yt(t,e){return+C(t)-+C(e)}function Dn(t,e,n){const i=yt(t,e)/pn;return mt(n?.roundingMethod)(i)}function Mn(t,e){const n=C(t,e?.in);return n.setHours(23,59,59,999),n}function kn(t,e){const n=C(t,e?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function Cn(t,e){const n=C(t,e?.in);return+Mn(n,e)==+kn(n,e)}function $n(t,e,n){const[i,o,s]=W(n?.in,t,t,e),r=it(o,s),a=Math.abs(vn(o,s));if(a<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-r*a);let l=it(o,s)===-r;Cn(i)&&a===1&&it(i,s)===1&&(l=!1);const u=r*(a-+l);return u===0?0:u}function Fn(t,e,n){const i=yt(t,e)/1e3;return mt(n?.roundingMethod)(i)}function En(t,e,n){const i=pe(t,e,n)/7;return mt(n?.roundingMethod)(i)}function xn(t,e,n){const[i,o]=W(n?.in,t,e),s=it(i,o),r=Math.abs(An(i,o));i.setFullYear(1584),o.setFullYear(1584);const a=it(i,o)===-s,l=s*(r-+a);return l===0?0:l}function On(t,e){const n=C(t,e?.in),i=n.getFullYear(),o=n.getMonth(),s=O(n,0);return s.setFullYear(i,o+1,0),s.setHours(0,0,0,0),s.getDate()}function Tn(t,e,n){return de(t,-e,n)}function In(t,e,n){const i=C(t,n?.in),o=i.getFullYear(),s=i.getDate(),r=O(t,0);r.setFullYear(o,e,15),r.setHours(0,0,0,0);const a=On(r);return i.setMonth(e,Math.min(s,a)),i}function we(t,e,n){let i=C(t,n?.in);return isNaN(+i)?O(t,NaN):(e.year!=null&&i.setFullYear(e.year),e.month!=null&&(i=In(i,e.month)),e.date!=null&&i.setDate(e.date),e.hours!=null&&i.setHours(e.hours),e.minutes!=null&&i.setMinutes(e.minutes),e.seconds!=null&&i.setSeconds(e.seconds),e.milliseconds!=null&&i.setMilliseconds(e.milliseconds),i)}function Vn(t,e,n){return ge(t,-e,n)}function _n(t,e,n){const{years:i=0,months:o=0,weeks:s=0,days:r=0,hours:a=0,minutes:l=0,seconds:u=0}=e,f=Vn(t,o+i*12,n),g=Tn(f,r+s*7,n),h=l+a*60,w=(u+h*60)*1e3;return O(n?.in||t,+g-w)}const It={years:xn,months:$n,weeks:En,days:pe,hours:Sn,minutes:Dn,seconds:Fn},Ln={years:(t,e)=>N(t,{years:e}),months:(t,e)=>N(t,{months:e}),weeks:(t,e)=>N(t,{weeks:e}),days:(t,e)=>N(t,{days:e}),hours:(t,e)=>N(t,{hours:e}),minutes:(t,e)=>N(t,{minutes:e}),seconds:(t,e)=>N(t,{seconds:e})};function ve(t,e,n){return n.sort((i,o)=>Object.keys(It).indexOf(i)-Object.keys(It).indexOf(o)).reduce((i,o)=>{const s=It[o],r=Ln[o],a=s(i.end,i.start);return{...i,result:{...i.result,[o]:a},start:r(i.start,a)}},{result:{},start:new Date(t),end:new Date(e)}).result}function Ae(){const t={years:"Y",months:"M",weeks:"W",days:"D",hours:"h",minutes:"m",seconds:"s"};function e(n,i,o){const s=new RegExp(Object.values(t).map(u=>`${u}+`).join("|"),"g"),r=o.match(s)?.map(u=>u[0]).filter((u,f,g)=>g.indexOf(u)===f).reduce((u,f)=>{const g=Object.keys(t).find(h=>t[h]===f);return[...u,g]},[]),a=ve(we(new Date(n),{milliseconds:0}),we(new Date(i),{milliseconds:0}),r);return Object.entries(a).reduce((u,[f,g])=>{const h=new RegExp(`${t[f]}+`,"g");return u.replace(h,c=>E(Math.abs(g),c.length))},o)}return{format:e}}function Se(t){const e=t?.trim().split(",")[0]?.match(/^([+-]?(?:\d+\.?\d*|\.\d+))\s*(ms|s|m|h)$/i);if(!e)return 0;const[,n,i]=e;return parseFloat(n)*{ms:1,s:1e3,m:6e4,h:36e5}[i.toLowerCase()]}function De(t){return Se(getComputedStyle(t).getPropertyValue("--animation-duration"))}function Me(t){const{charset:e,next:n,prev:i}=t?.charset&&"next"in t.charset?t.charset:re(t?.charset);function o(r,a,l=1,u=!1){const f={backwards:u,...t?.matchArray};return r.digits=Ct(r.digits,a.digits,f,ht((g,h,c)=>t?.stopWhen?t.stopWhen(g,h,c):t?.stopAfterChanges?g.length<t.stopAfterChanges:!0,(g,h)=>g===h?g:i(g??"",h,l))),r}function s(r,a,l=1,u=!1){const f={...t?.matchArray,backwards:u};return r.digits=Ct(r.digits,a.digits,f,ht((g,h,c)=>t?.stopWhen?t.stopWhen(g,h,c):t?.stopAfterChanges?g.length<t.stopAfterChanges:!0,(g,h)=>g===h?g:n(g,h,l))),r}return{charset:e,decrement:o,increment:s}}class ke{method="increment";direction="auto";sequencer;skipChars;value;targetValue;currentValue;constructor(e){e.skipChars&&(this.skipChars=e.skipChars),e.direction&&(this.direction=e.direction),e.method&&(this.method=e.method),this.sequencer=e.sequencer&&"increment"in e.sequencer?e.sequencer:Me(e.sequencer),this.value=e.value,this.targetValue=e.targetValue??this.value.copy(),this.currentValue=P(this.value.digits)}get backwards(){return this.direction==="backwards"?!0:this.direction==="forwards"?!1:ft(this.value.digits)>ft(this.targetValue.digits)}faceValue(){return this.currentValue}interval(e){this[this.method](),this.currentValue.compare(this.targetValue)&&e.stop()}increment(){this.sequencer.increment(this.value,this.targetValue,this.skipChars,this.backwards),this.currentValue.value=this.value.digits}decrement(){this.sequencer.decrement(this.value,this.targetValue,this.skipChars,this.backwards),this.currentValue.value=this.value.digits}}function Nn(t){return new ke(t)}class Ce{date;value;format="[hh]:[mm]:[ss][A]";formatter;constructor(e){this.date=e?.date??new Date,e?.format&&(this.format=e.format),e?.formatter===void 0?this.formatter=Ot():"format"in e.formatter?this.formatter=e.formatter:this.formatter=Ot(e.formatter),this.value=R(()=>P(this.formatter.format(this.date,this.format)))}faceValue(){return this.value}interval(e){this.value.value=this.formatter.format(new Date(this.date.getTime()+e.timer.elapsed),this.format)}}function jn(t){return new Ce(t)}class $e{countdown=!1;step=1;formattedValue;targetValue;value;format;formatter;constructor(e){this.value=typeof e?.value=="number"||e?.value===void 0?P(e?.value??0):e.value,this.targetValue=typeof e?.targetValue=="number"?P(e.targetValue):e?.targetValue,this.format=e?.format,this.formatter=e?.formatter,this.formattedValue=R(()=>{const n=P(this.formattedString);return zt(()=>{n.value=this.formattedString}),n}),typeof e?.countdown=="boolean"&&(this.countdown=e.countdown),typeof e?.step=="number"&&(this.step=e.step)}get formattedString(){return this.formatter?this.formatter.format(this.value.value):this.format?this.format(this.value.value):this.value.value.toString()}faceValue(){return this.formattedValue}interval(e){this.countdown?this.decrement(this.step):this.increment(this.step),this.value.compare(this.targetValue)&&e.stop()}decrement(e){this.value.value=this.value.value-(e??this.step)}increment(e){this.value.value=this.value.value+(e??this.step)}}function zn(t){return new $e(t)}class Fe{start;current;from;to;format="[mm]:[ss]";formatter;value;constructor(e){this.from=e?.from,this.to=e?.to,this.start=new Date,this.current=new Date(this.start),e?.format&&(this.format=e.format),e?.formatter?this.formatter=e.formatter:this.formatter=Ae(),this.value=R(()=>P(this.formattedString))}get formattedString(){return this.from?this.formatter.format(this.from,this.current,this.format):this.to?this.formatter.format(this.to,this.current,this.format):this.formatter.format(this.start,this.current,this.format)}faceValue(){return this.value}interval(e){this.shouldStop()?e.stop():(this.current.setTime(e.timer.lastLoop),this.value.value=this.formattedString)}beforeStart(){this.start=new Date,this.current=new Date(this.start)}shouldStop(){return this.from&&this.from>this.start?yt(this.from,this.current)<=0:this.to?yt(this.to,this.current)<=0:!1}}function Rn(t){return new Fe(t)}class pt{$count=0;$handle;interval;$lastLoop;$startDate;constructor(e=1e3){this.interval=e}get count(){return this.$count}get elapsed(){return this.$startDate?Math.max(0,Date.now()-this.$startDate.getTime()):0}get elapsedSinceLastLoop(){return this.lastLoop?Date.now()-this.lastLoop:0}get isRunning(){return this.$handle!==void 0}get isStopped(){return!this.isRunning}get lastLoop(){return this.$lastLoop||0}set lastLoop(e){this.$lastLoop=e}get started(){return this.$startDate}reset(e){return this.stop(()=>{this.$count=0,this.$lastLoop=0,this.start(e)}),this}start(e){this.$startDate=new Date,this.$lastLoop=this.$startDate.getTime();const n=()=>(Date.now()-this.lastLoop>=this.interval&&(typeof e=="function"&&e(this),this.$lastLoop=Date.now(),this.$count++),this.$handle=requestAnimationFrame(n),this);return n()}stop(e){return this.isRunning&&this.$handle&&(window.cancelAnimationFrame(this.$handle),this.$lastLoop=0,this.$handle=void 0,typeof e=="function"&&e(this)),this}}function Yn(t=1e3){return new pt(t)}class Ee extends z{autoStart=!0;parent;el;face;theme;timer;dispose;constructor(e){super(),this.face=e.face,this.theme=e.theme,typeof e.autoStart=="boolean"&&(this.autoStart=e.autoStart),this.timer=e.timer instanceof pt?e.timer:new pt(e.timer),this.hook("afterCreate",this),e.parent&&this.mount(e.parent)}get animationRate(){return this.el?De(this.el):0}mount(e){this.hook("beforeMount",this),this.parent=e;const[n,i]=this.theme.render(this.parent,this);return this.el=n,this.dispose=i,this.hook("afterMount",this),this.autoStart&&this.timer.isStopped&&requestAnimationFrame(()=>this.start()),this}start(e){return this.hook("beforeStart",this),this.timer.start(()=>{requestAnimationFrame(()=>{this.hook("beforeInterval",this),this.face.interval(this),this.hook("afterInterval",this),typeof e=="function"&&e(this),this.hook("afterStart",this)})}),this}stop(e){return this.hook("beforeStop",this),this.timer.stop(()=>{typeof e=="function"&&e(this),this.hook("afterStop",this)}),this}toggle(e){return this.timer.isStopped?this.start(e):this.stop(e),this}unmount(){return this.hook("beforeUnmount",this),this.timer.stop(),this.el?.remove(),this.dispose?.(),this.hook("afterUnmount",this),this}hook(e,...n){if(e in this.face&&typeof this.face[e]=="function"&&this.face[e].apply(this.face,n),e in this.theme&&typeof this.theme[e]=="function"){const i=this.theme[e];i(...n)}this.emit(e,...n)}}function Hn(t){return new Ee(t)}const Pn=t=>$(()=>t());function qn(t,e,n){let i=n.length,o=e.length,s=i,r=0,a=0,l=e[o-1].nextSibling,u=null;for(;r<o||a<s;){if(e[r]===n[a]){r++,a++;continue}for(;e[o-1]===n[s-1];)o--,s--;if(o===r){const f=s<i?a?n[a-1].nextSibling:n[s-a]:l;for(;a<s;)t.insertBefore(n[a++],f)}else if(s===a)for(;r<o;)(!u||!u.has(e[r]))&&e[r].remove(),r++;else if(e[r]===n[s-1]&&n[a]===e[o-1]){const f=e[--o].nextSibling;t.insertBefore(n[a++],e[r++].nextSibling),t.insertBefore(n[--s],f),e[o]=n[s]}else{if(!u){u=new Map;let g=a;for(;g<s;)u.set(n[g],g++)}const f=u.get(e[r]);if(f!=null)if(a<f&&f<s){let g=r,h=1,c;for(;++g<o&&g<s&&!((c=u.get(e[g]))==null||c!==f+h);)h++;if(h>f-a){const w=e[r];for(;a<f;)t.insertBefore(n[a++],w)}else t.replaceChild(n[a++],e[r++])}else r++;else e[r++].remove()}}}function Wn(t,e,n,i={}){let o;return R(s=>{o=s,e===document?t():T(e,t(),e.firstChild?null:void 0,n)},i.owner),()=>{o(),e.textContent=""}}function G(t,e,n,i){let o;const s=()=>{const a=document.createElement("template");return a.innerHTML=t,a.content.firstChild},r=()=>(o||(o=s())).cloneNode(!0);return r.cloneNode=r,r}function Vt(t,e,n){n==null?t.removeAttribute(e):t.setAttribute(e,n)}function Bn(t,e,n,i){if(Array.isArray(n)){const o=n[0];t.addEventListener(e,n[0]=s=>o.call(t,n[1],s))}else t.addEventListener(e,n,typeof n!="function"&&n)}function xe(t,e,n={}){const i=Object.keys(e||{}),o=Object.keys(n);let s,r;for(s=0,r=o.length;s<r;s++){const a=o[s];!a||a==="undefined"||e[a]||(Oe(t,a,!1),delete n[a])}for(s=0,r=i.length;s<r;s++){const a=i[s],l=!!e[a];!a||a==="undefined"||n[a]===l||!l||(Oe(t,a,!0),n[a]=l)}return n}function Un(t,e,n){return V(()=>t(e,n))}function T(t,e,n,i){if(n!==void 0&&!i&&(i=[]),typeof e!="function")return bt(t,e,i,n);H(o=>bt(t,e(),o,n),i)}function Oe(t,e,n){const i=e.trim().split(/\s+/);for(let o=0,s=i.length;o<s;o++)t.classList.toggle(i[o],n)}function bt(t,e,n,i,o){for(;typeof n=="function";)n=n();if(e===n)return n;const s=typeof e,r=i!==void 0;if(t=r&&n[0]&&n[0].parentNode||t,s==="string"||s==="number"){if(s==="number"&&(e=e.toString(),e===n))return n;if(r){let a=n[0];a&&a.nodeType===3?a.data!==e&&(a.data=e):a=document.createTextNode(e),n=X(t,n,i,a)}else n!==""&&typeof n=="string"?n=t.firstChild.data=e:n=t.textContent=e}else if(e==null||s==="boolean")n=X(t,n,i);else{if(s==="function")return H(()=>{let a=e();for(;typeof a=="function";)a=a();n=bt(t,a,n,i)}),()=>n;if(Array.isArray(e)){const a=[],l=n&&Array.isArray(n);if(_t(a,e,n,o))return H(()=>n=bt(t,a,n,i,!0)),()=>n;if(a.length===0){if(n=X(t,n,i),r)return n}else l?n.length===0?Te(t,a,i):qn(t,n,a):(n&&X(t),Te(t,a));n=a}else if(e.nodeType){if(Array.isArray(n)){if(r)return n=X(t,n,i,e);X(t,n,null,e)}else n==null||n===""||!t.firstChild?t.appendChild(e):t.replaceChild(e,t.firstChild);n=e}}return n}function _t(t,e,n,i){let o=!1;for(let s=0,r=e.length;s<r;s++){let a=e[s],l=n&&n[t.length],u;if(!(a==null||a===!0||a===!1))if((u=typeof a)=="object"&&a.nodeType)t.push(a);else if(Array.isArray(a))o=_t(t,a,l)||o;else if(u==="function")if(i){for(;typeof a=="function";)a=a();o=_t(t,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else t.push(a),o=!0;else{const f=String(a);l&&l.nodeType===3&&l.data===f?t.push(l):t.push(document.createTextNode(f))}}return o}function Te(t,e,n=null){for(let i=0,o=e.length;i<o;i++)t.insertBefore(e[i],n)}function X(t,e,n,i){if(n===void 0)return t.textContent="";const o=i||document.createTextNode("");if(e.length){let s=!1;for(let r=e.length-1;r>=0;r--){const a=e[r];if(o!==a){const l=a.parentNode===t;!s&&!r?l?t.replaceChild(o,a):t.insertBefore(o,n):l&&a.remove()}else s=!0}}else t.insertBefore(o,n);return[o]}var Jn=G("<div class=flip-clock>"),Kn=G("<div class=flip-clock-label>"),Gn=G("<div class=flip-clock-group><div class=flip-clock-group-items>"),Xn=G("<div class=flip-clock-card>"),Qn=G("<div class=flip-clock-card-item><div class=flip-clock-card-item-inner><div class=top></div><div class=bottom>"),Zn=G("<div class=flip-clock-divider><div class=flip-clock-divider-inner>");function ti(t){return{render(e,n){return R(i=>{let o;const s=$(()=>(Array.isArray(t?.css)?t.css:[t?.css]).filter(Boolean).map(r=>String(r)).join(" "));return Wn(()=>(()=>{var r=Jn();return Un(a=>o=a,r),T(r,F(Ie,{get digits(){return n.face.faceValue().digits},get dividers(){return t?.dividers},get labels(){return Pn(()=>!!t?.labels)()?[...t.labels]:void 0}})),H(a=>xe(r,{[s()]:!0},a)),r})(),e),[o,i]})}}}function ei(t){if(t!==void 0)return t instanceof RegExp?t:new RegExp(`[${(Array.isArray(t)?t:[t]).join("|")}]`)}function ni(t,e){const n=ei(e);return n?!!t.match(n)?.length:!1}function Ie(t){const e=t.labels?.shift();let n=0;return(()=>{var i=Gn(),o=i.firstChild;return T(i,F(tn,{when:typeof e=="string",get children(){var s=Kn();return T(s,e),s}}),o),T(o,F(Ze,{get each(){return t.digits},children:s=>{const r=$(()=>{const a=s();return Array.isArray(a)?"group":ni(a,t.dividers)?"divider":"card"});return F(en,{get children(){return[F(Mt,{get when(){return r()==="group"},get children(){return(()=>{const a=Array.isArray(t.labels?.[n])?t.labels[n++]:void 0;return F(Ie,{get digits(){return s()},get dividers(){return t.dividers},labels:a})})()}}),F(Mt,{get when(){return r()==="divider"},get children(){return F(ri,{get value(){return s()}})}}),F(Mt,{get when(){return r()==="card"},get children(){return F(ii,{get value(){return s()}})}})]}})}})),i})()}function ii(t){const[e,n]=Y(t.value),[i,o]=Y(t.value),[s,r]=Y(!1);return o(t.value),n(t.value),zt(()=>{const a=t.value;r(!1),requestAnimationFrame(()=>{o(e()),n(a),a!==i()&&r(!0)})}),(()=>{var a=Xn();return T(a,F(Ve,{get value(){return e()},classList:{active:!0}}),null),T(a,F(Ve,{get value(){return i()},classList:{before:!0}}),null),H(l=>{var u=e(),f=i(),g=!!s();return u!==l.e&&Vt(a,"data-value",l.e=u),f!==l.t&&Vt(a,"data-before-value",l.t=f),g!==l.a&&a.classList.toggle("animate",l.a=g),l},{e:void 0,t:void 0,a:void 0}),a})()}function Ve(t){return(()=>{var e=Qn(),n=e.firstChild,i=n.firstChild,o=i.nextSibling;return Bn(e,"animationend",t.onAnimationEnd),T(i,()=>t.value),T(o,()=>t.value),H(s=>xe(e,t.classList,s)),e})()}function ri(t){return(()=>{var e=Zn(),n=e.firstChild;return T(n,()=>t.value),H(()=>Vt(e,"data-value",t.value)),e})()}const si=Et(t=>({"&":{"--border-radius":t?.borderRadius??".15em","--font-size":t?.fontSize??"4.5em","--font-family":t?.fontFamily??'"Helvetica Neue", Helvetica, sans-serif',"--width":t?.width??"1em","--height":t?.height??"1.45em","--animation-duration":t?.animationDuration??"250ms","--animation-delay":t?.animationDelay??"var(--animation-duration)",fontFamily:"var(--font-family)",fontSize:"var(--font-size)",userSelect:"none",textAlign:"center",position:"relative",width:"100%",display:"inline-flex",boxSizing:"border-box",alignItems:"flex-end",gap:".25rem"},".flip-clock-label":{fontSize:"1rem",marginBottom:".5rem"},".flip-clock-meridium":{lineHeight:"1em",top:"50%",left:"100%",flex:"0",width:"auto",textTransform:"uppercase",fontWeight:"200",transform:"translate(.5em, -50%)"},".flip-clock-divider":{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"serif",color:"#333",height:"var(--height)",".flip-clock-divider-inner":{fontSize:"1.25em"},'&[data-value=" "]':{minWidth:"1rem"},".dark &":{color:"#ccc"}},".flip-clock-group":{display:"flex",flexDirection:"column","+ .flip-clock-group":{marginLeft:"1rem"},".flip-clock-group-items":{display:"flex",alignItems:"end",gap:".25rem"}},".flip-clock-card":{width:"var(--width)",height:"var(--height)",position:"relative",borderRadius:"var(--border-radius)",boxShadow:"0 1.5px 3px rgba(0, 0, 0, 0.24), 0 3px 8px rgba(0, 0, 0, 0.05)",fontWeight:"bold",color:"#ccc",flexShrink:0,"&:not(.animate)":{".active .flip-clock-card-item-inner":{zIndex:"4"},".flip-clock-card-item-inner":{".top, .bottom":{"&:after":{display:"none"}}}},".flip-clock-card-item":{},".flip-clock-card-item-inner":{position:"absolute",width:"100%",height:"100%","&:first-child":{zIndex:"2"},".top, .bottom":{width:"100%",height:"50%",overflow:"hidden",position:"relative",fontSize:"1em",background:"#333",boxShadow:"inset 0 0 .2em rgba(0,0,0,.5)","&:after":{content:'" "',display:"block",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",overflow:"hidden"},"&:before":{content:'" "',display:"block",width:"100%",height:"1px",position:"absolute"}},".top":{borderRadius:"var(--border-radius) var(--border-radius) 0 0",lineHeight:"var(--height)","&:after":{borderRadius:"var(--border-radius) var(--border-radius) 0 0"},"&:before":{background:"#333",opacity:".4",bottom:"0"}},".bottom":{borderRadius:"0 0 var(--border-radius) var(--border-radius)",lineHeight:"0","&:after":{borderRadius:"0 0 var(--border-radius) var(--border-radius)"},"&:before":{background:"#ccc",opacity:".1"}}},"&.animate":{animationDuration:"var(--animation-duration)",animationDelay:"var(--animation-delay)",".flip-clock-card-item-inner":{perspective:"15em"},".top, .bottom, .active, .active > div, .before, .before > div":{animationDelay:"inherit",animationFillMode:"forwards",animationDuration:"inherit",animationTimingFunction:"inherit","&:after":{animationDuration:"inherit",animationFillMode:"inherit"}},".before":{animationDelay:"0s",animationTimingFunction:"ease-in",".top":{animationName:"flip-clock-top"},".top:after, .bottom:after":{animationName:"flip-clock-show-shadow"}},".active":{animationTimingFunction:"ease-out","& > div":{animationName:"flip-clock-indexing"},".top:after, .bottom:after":{animationName:"flip-clock-hide-shadow"},".bottom":{animationName:"flip-clock-bottom"}}},".active":{zIndex:"2",".bottom":{zIndex:"2",transformOrigin:"top center"}},".before":{zIndex:"3",".top":{zIndex:"2",transformOrigin:"bottom center","&:after":{background:"linear-gradient(to bottom, rgba(0,0,0,.1) 0%, rgba(0,0,0,1) 100%)"}},".bottom":{"&:after":{background:"linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,.1) 100%)"}}}},"@keyframes flip-clock-indexing":{"0%":{zIndex:"2"},"1%":{zIndex:"3"},"100%":{zIndex:"4"}},"@keyframes flip-clock-bottom":{"0%":{transform:"rotateX(90deg)"},"100%":{transform:"rotateX(0)"}},"@keyframes flip-clock-top":{"0%":{transform:"rotateX(0)"},"100%":{transform:"rotateX(-90deg)"}},"@keyframes flip-clock-show-shadow":{"0%":{opacity:"0"},"100%":{opacity:"1"}},"@keyframes flip-clock-hide-shadow":{"0%":{opacity:"1"},"100%":{opacity:"0"}}}));d.Alphanumeric=ke,d.Clock=Ce,d.Counter=$e,d.EMPTY_CHAR=Kt,d.ElapsedTime=Fe,d.EventEmitter=z,d.FaceValue=dt,d.FlipClock=Ee,d.StartRules=nn,d.SyntaxError=kt,d.Timer=pt,d.add=N,d.alphanumeric=Nn,d.castDigitizedGroup=Qt,d.castDigitizedString=ct,d.castDigitizedValues=Xt,d.characterRange=gt,d.clock=jn,d.count=ft,d.counter=zn,d.css=si,d.dayAbbreviations=le,d.days=ae,d.daysInWeek=hn,d.defaultCharset=ie,d.elapsedTime=Rn,d.eventEmitter=Ye,d.faceValue=P,d.fisherYatesShuffle=ne,d.flipClock=Hn,d.getAnimationRate=De,d.getFilteredDuration=ve,d.getTwelveHourFormat=Tt,d.isDigitizedGroup=et,d.matchArrayStructure=Ct,d.mergeCss=nt,d.millisecondsInDay=dn,d.millisecondsInHour=gn,d.millisecondsInMinute=mn,d.monthAbbreviations=ce,d.months=ue,d.pad=E,d.parse=Jt,d.parseDuration=Se,d.range=ee,d.sort=fe,d.stop=Zt,d.stopAfterChanges=rn,d.stopWhen=ht,d.sub=_n,d.theme=ti,d.timer=Yn,d.trackChanges=te,d.useCharset=re,d.useCss=Et,d.useDateFormats=Ot,d.useDefinitionMap=xt,d.useDictionary=fn,d.useDigitizer=Gt,d.useDurationFormats=Ae,d.useSequencer=Me,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
//# sourceMappingURL=FlipClock.umd.js.map