const e=[{maxApplicableTokenLifetimeInDays:7,warningThresholdInDays:2},{maxApplicableTokenLifetimeInDays:30,warningThresholdInDays:7},{maxApplicableTokenLifetimeInDays:60,warningThresholdInDays:10},{maxApplicableTokenLifetimeInDays:90,warningThresholdInDays:20},{maxApplicableTokenLifetimeInDays:365,warningThresholdInDays:30}];function n({creationDate:n,expirationDate:a},i=e){const l=new Date,s=864e5,t=a.getTime(),o=n.getTime(),r=Math.floor((t-o)/s),m=(a.getTime()-l.getTime())/s,T=[...i].sort(((e,n)=>e.maxApplicableTokenLifetimeInDays-n.maxApplicableTokenLifetimeInDays)),p=T.find((e=>r<=e.maxApplicableTokenLifetimeInDays)),D=T[T.length-1];return m<=(p?p.warningThresholdInDays:D.warningThresholdInDays)}export{n as isExpirationClose};
//# sourceMappingURL=tokens.js.map
