"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=[["Y",1e3*60*60*24*365],["M",1e3*60*60*24*30],["D",1e3*60*60*24],["H",1e3*60*60],["m",1e3*60],["s",1e3],["S",1]];function m(r,n){let o=r;const t=/\[[^\]]*\]/g,c=(n.match(t)||[]).map(e=>e.slice(1,-1)),a=n.replace(t,"[]"),f=g.reduce((e,[i,l])=>{if(e.includes(i)){const u=Math.floor(o/l);return o-=u*l,e.replace(new RegExp(`${i}+`,"g"),p=>{const d=p.length;return u.toString().padStart(d,"0")})}return e},a);let s=0;return f.replace(t,()=>{const e=c[s];return s+=1,e})}function S(r,n){const{format:o=""}=n,t=new Date(r).getTime(),c=Date.now(),a=Math.max(t-c,0);return m(a,o)}exports.formatCountdown=S;exports.formatTimeStr=m;
