Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ampproject/amp-date-countdown

Package Overview
Dependencies
Maintainers
16
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ampproject/amp-date-countdown - npm Package Compare versions

Comparing version 1.2110202310.0 to 1.2110212130.0

dist/web-component.js

2

dist/component-preact.module.js

@@ -1,2 +0,2 @@

function n(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function e(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,r)}return t}function t(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?e(Object(a),!0).forEach((function(e){n(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))}))}return t}function r(n,e){if(null==n)return{};var t,r,a={},o=Object.keys(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)>=0||(a[t]=n[t]);return a}var{hasOwnProperty:a,toString:o}=Object.prototype;function s(n){return n||{}}import{cloneElement as i,createContext as u,createElement as c,createRef as l}from"preact";import{hydrate as f,render as d}from"preact";import{useCallback as p,useContext as m,useEffect as h,useImperativeHandle as y,useLayoutEffect as b,useMemo as v,useRef as g,useState as j}from"preact/hooks";function w(n,e,t){return c.apply(void 0,arguments)}function S(n){return j(n)}function O(n,e){b(n,e)}function M(n,e){return v(n,e)}import{Children as $,createPortal as N,forwardRef as D}from"preact/compat";function k(n){return D(n)}var C=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],z=[null,"paint","layout","content","size","size paint","size layout","strict"],U={"position":"relative","width":"100%","height":"100%"};k((function(n,e){let{as:a="div",children:o,"class":s,contentAs:i="div",contentClassName:u,contentProps:c,contentRef:l,contentStyle:f,layout:d=!1,paint:p=!1,size:m=!1,"style":h,wrapperClassName:y,wrapperStyle:b}=n;const v=(m?4:0)+(d?2:0)+(p?1:0);return w(a,t(t({},r(n,C)),{},{ref:e,class:`${s||""} ${y||""}`.trim()||null,style:t(t(t({},h),b),{},{contain:z[v]})}),w(i,t(t({},c),{},{ref:l,class:u,style:t(t({},m&&U),{},{"overflow":p?"hidden":"visible"},f)}),o))}));var A,E=["as","children","class","style","wrapperClassName","wrapperStyle"],H=k((function(n,e){let{as:a="div",children:o,"class":s,"style":i,wrapperClassName:u,wrapperStyle:c}=n;return w(a,t(t({},r(n,E)),{},{ref:e,class:`${s||""} ${u||""}`.trim()||null,style:t(t({},i),c)}),o)}));function I(){const n=A||(A=u({renderable:!0,playable:!0,loading:"auto"},void 0));return m(n)}function P(n){return R[n]}new WeakMap,new WeakMap;var R={"de":["Jahren","Monaten","Tagen","Stunden","Minuten","Sekunden"],"en":["Years","Months","Days","Hours","Minutes","Seconds"],"es":["años","meses","días","horas","minutos","segundos"],"fr":["ans","mois","jours","heures","minutes","secondes"],"id":["tahun","bulan","hari","jam","menit","detik"],"it":["anni","mesi","giorni","ore","minuti","secondi"],"ja":["年","ヶ月","日","時間","分","秒"],"ko":["년","달","일","시간","분","초"],"nl":["jaar","maanden","dagen","uur","minuten","seconden"],"pt":["anos","meses","dias","horas","minutos","segundos"],"ru":["год","месяц","день","час","минута","секунда"],"th":["ปี","เดือน","วัน","ชั่วโมง","นาที","วินาที"],"tr":["yıl","ay","gün","saat","dakika","saniye"],"vi":["năm","tháng","ngày","giờ","phút","giây"],"zh-cn":["年","月","天","小时","分钟","秒"],"zh-tw":["年","月","天","小時","分鐘","秒"]},T=["datetime","whenEnded","locale","biggestUnit","countUp","render"],Y={DAYS:1,HOURS:2,MINUTES:3,SECONDS:4},W="en",_="stop",x="DAYS",J=!1,L=n=>`${n.days} ${n.dd}, ${n.hours} ${n.hh}, ${n.minutes} ${n.mm}, ${n.seconds} ${n.ss}`;function q(n){let{datetime:e,whenEnded:a=_,locale:o=W,biggestUnit:i=x,countUp:u=J,render:c=L}=n,l=r(n,T);!function(){const{notify:n}=I();O((()=>{n&&n()}))}();const{playable:f}=I(),d=M((()=>{return(n=e)?"number"==typeof n?n:"string"==typeof n?function(n){if(!n)return null;if("now"===n.toLowerCase())return Date.now();const e=Date.parse(n);return isNaN(e)?null:e}(n):(n=n).getTime():null;var n}),[e]),p=M((()=>function(n){var e;void 0===P(n)&&(e=`Invalid locale ${n}, defaulting to ${W}. DateCountdown`,console.warn(e),n=W);const t=P(n);return s({"years":t[0],"months":t[1],"days":t[2],"hours":t[3],"minutes":t[4],"seconds":t[5]})}(o)),[o]),[m,y]=S(d-Date.now()+1e3),b=M((()=>function(n,e,r,a){return t(t({},function(n,e,t){t&&(n*=-1);const r=Y[e]==Y.DAYS?F(Math.floor(n/864e5)):0,a=Y[e]==Y.HOURS?F(Math.floor(n/36e5)):Y[e]<Y.HOURS?F(Math.floor(n%864e5/36e5)):0,o=Y[e]==Y.MINUTES?F(Math.floor(n/6e4)):Y[e]<Y.MINUTES?F(Math.floor(n%36e5/6e4)):0,i=F(Y[e]==Y.SECONDS?Math.floor(n/1e3):Math.floor(n%6e4/1e3));return s({"d":r,"dd":B(r),"h":a,"hh":B(a),"m":o,"mm":B(o),"s":i,"ss":B(i)})}(n,e,a)),r)}(m,i,p,u)),[m,i,p,u]),v=g(null);h((()=>{if(!f||!v.current)return;const n=v.current.ownerDocument.defaultView,e=n.setInterval((()=>{const t=d-Date.now()+1e3;y(t),a===_&&t<1e3&&n.clearInterval(e)}),1e3);return()=>n.clearInterval(e)}),[f,d,a]);const j=function(n,e){const[t,r]=S(null);return O((()=>{const t=n&&n(e)||null;if(t&&"function"==typeof t.then){let n=!1;return t.then((e=>{n||r(e)})),()=>{n=!0}}r(t)}),[n,e]),t}(c,b),$=j&&"object"==typeof j&&"__html"in j;return w(H,t(t({},l),{},{ref:v,dangerouslySetInnerHTML:$?j:null}),$?null:j)}function B(n){return n<-9||n>9?String(n):n>=-9&&n<0?"-0"+-n:"0"+n}function F(n){return n<0?n+1:n}export{q as BentoDateCountdown};
function _(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function w(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,r)}return t}function A(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?w(Object(t),!0).forEach((function(e){_(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}function Ri(n,e){if(null==n)return{};var t,r,a={},o=Object.keys(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)>=0||(a[t]=n[t]);return a}var{hasOwnProperty:c,toString:a}=Object.prototype;function f(n){return n||{}}import{cloneElement as de,createContext as pe,createElement as Sn,createRef as me}from"preact";import{hydrate as ye,render as En}from"preact";import{useCallback as be,useContext as ve,useEffect as On,useImperativeHandle as ge,useLayoutEffect as Vn,useMemo as jn,useRef as In,useState as Tn}from"preact/hooks";function je(n,e,t){return Sn.apply(void 0,arguments)}function we(n){return Tn(n)}function Se(n,e){Vn(n,e)}function Oe(n,e){return jn(n,e)}import{Children as Me,createPortal as $e,forwardRef as Yi}from"preact/compat";function Ne(n){return Yi(n)}var Gi=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],Qi=[null,"paint","layout","content","size","size paint","size layout","strict"],Ji={"position":"relative","width":"100%","height":"100%"};Ne((function(n,e){let{as:t="div",children:r,"class":a,contentAs:o="div",contentClassName:s,contentProps:i,contentRef:u,contentStyle:c,layout:l=!1,paint:f=!1,size:d=!1,"style":p,wrapperClassName:m,wrapperStyle:h}=n;const y=(d?4:0)+(l?2:0)+(f?1:0);return je(t,A(A({},Ri(n,Gi)),{},{ref:e,class:`${a||""} ${m||""}`.trim()||null,style:A(A(A({},p),h),{},{contain:Qi[y]})}),je(o,A(A({},i),{},{ref:u,class:s,style:A(A({},d&&Ji),{},{"overflow":f?"hidden":"visible"},c)}),r))}));var wn,Ki=["as","children","class","style","wrapperClassName","wrapperStyle"],Xi=Ne((function(n,e){let{as:t="div",children:r,"class":a,"style":o,wrapperClassName:s,wrapperStyle:i}=n;return je(t,A(A({},Ri(n,Ki)),{},{ref:e,class:`${a||""} ${s||""}`.trim()||null,style:A(A({},o),i)}),r)}));function $n(){const n=wn||(wn=pe({renderable:!0,playable:!0,loading:"auto"},void 0));return ve(n)}function te(n){return ne[n]}new WeakMap,new WeakMap;var ne={"de":["Jahren","Monaten","Tagen","Stunden","Minuten","Sekunden"],"en":["Years","Months","Days","Hours","Minutes","Seconds"],"es":["años","meses","días","horas","minutos","segundos"],"fr":["ans","mois","jours","heures","minutes","secondes"],"id":["tahun","bulan","hari","jam","menit","detik"],"it":["anni","mesi","giorni","ore","minuti","secondi"],"ja":["年","ヶ月","日","時間","分","秒"],"ko":["년","달","일","시간","분","초"],"nl":["jaar","maanden","dagen","uur","minuten","seconden"],"pt":["anos","meses","dias","horas","minutos","segundos"],"ru":["год","месяц","день","час","минута","секунда"],"th":["ปี","เดือน","วัน","ชั่วโมง","นาที","วินาที"],"tr":["yıl","ay","gün","saat","dakika","saniye"],"vi":["năm","tháng","ngày","giờ","phút","giây"],"zh-cn":["年","月","天","小时","分钟","秒"],"zh-tw":["年","月","天","小時","分鐘","秒"]},ie=["datetime","whenEnded","locale","biggestUnit","countUp","render"],ee={DAYS:1,HOURS:2,MINUTES:3,SECONDS:4},oe="en",re="stop",se="DAYS",ue=!1,le=n=>`${n.days} ${n.dd}, ${n.hours} ${n.hh}, ${n.minutes} ${n.mm}, ${n.seconds} ${n.ss}`;function De(n){let{datetime:e,whenEnded:t=re,locale:r=oe,biggestUnit:a=se,countUp:o=ue,render:s=le}=n,i=Ri(n,ie);!function(){const{notify:n}=$n();Se((()=>{n&&n()}))}();const{playable:u}=$n(),c=Oe((()=>{return(n=e)?"number"==typeof n?n:"string"==typeof n?function(n){if(!n)return null;if("now"===n.toLowerCase())return Date.now();const e=Date.parse(n);return isNaN(e)?null:e}(n):(n=n).getTime():null;var n}),[e]),l=Oe((()=>function(n){var e;void 0===te(n)&&(e=`Invalid locale ${n}, defaulting to ${oe}. DateCountdown`,console.warn(e),n=oe);const t=te(n);return f({"years":t[0],"months":t[1],"days":t[2],"hours":t[3],"minutes":t[4],"seconds":t[5]})}(r)),[r]),[d,p]=we(c-Date.now()+1e3),m=Oe((()=>function(n,e,t,r){return A(A({},function(n,e,t){t&&(n*=-1);const r=ee[e]==ee.DAYS?ae(Math.floor(n/864e5)):0,a=ee[e]==ee.HOURS?ae(Math.floor(n/36e5)):ee[e]<ee.HOURS?ae(Math.floor(n%864e5/36e5)):0,o=ee[e]==ee.MINUTES?ae(Math.floor(n/6e4)):ee[e]<ee.MINUTES?ae(Math.floor(n%36e5/6e4)):0,s=ae(ee[e]==ee.SECONDS?Math.floor(n/1e3):Math.floor(n%6e4/1e3));return f({"d":r,"dd":ce(r),"h":a,"hh":ce(a),"m":o,"mm":ce(o),"s":s,"ss":ce(s)})}(n,e,r)),t)}(d,a,l,o)),[d,a,l,o]),h=In(null);On((()=>{if(!u||!h.current)return;const n=h.current.ownerDocument.defaultView,e=n.setInterval((()=>{const r=c-Date.now()+1e3;p(r),t===re&&r<1e3&&n.clearInterval(e)}),1e3);return()=>n.clearInterval(e)}),[u,c,t]);const y=function(n,e){const[t,r]=we(null);return Se((()=>{const t=n&&n(e)||null;if(t&&"function"==typeof t.then){let n=!1;return t.then((e=>{n||r(e)})),()=>{n=!0}}r(t)}),[n,e]),t}(s,m),b=y&&"object"==typeof y&&"__html"in y;return je(Xi,A(A({},i),{},{ref:h,dangerouslySetInnerHTML:b?y:null}),b?null:y)}function ce(n){return n<-9||n>9?String(n):n>=-9&&n<0?"-0"+-n:"0"+n}function ae(n){return n<0?n+1:n}export{De as BentoDateCountdown};
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */

@@ -1,2 +0,2 @@

function n(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function e(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,r)}return t}function t(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?e(Object(a),!0).forEach((function(e){n(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))}))}return t}function r(n,e){if(null==n)return{};var t,r,a={},o=Object.keys(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)>=0||(a[t]=n[t]);return a}var{hasOwnProperty:a,toString:o}=Object.prototype;function s(n){return n||{}}import{cloneElement as i,createContext as u,createElement as c,createRef as l}from"react";import{hydrate as f,render as d}from"react-dom";import{useCallback as p,useContext as m,useEffect as h,useImperativeHandle as y,useLayoutEffect as b,useMemo as v,useRef as g,useState as j}from"react";function w(n,e,t){return c.apply(void 0,arguments)}function S(n){return j(n)}function O(n,e){b(n,e)}function M(n,e){return v(n,e)}import{Children as $,createPortal as N,forwardRef as D}from"react";function k(n){return D(n)}var C=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],z=[null,"paint","layout","content","size","size paint","size layout","strict"],U={"position":"relative","width":"100%","height":"100%"};k((function(n,e){let{as:a="div",children:o,"class":s,contentAs:i="div",contentClassName:u,contentProps:c,contentRef:l,contentStyle:f,layout:d=!1,paint:p=!1,size:m=!1,"style":h,wrapperClassName:y,wrapperStyle:b}=n;const v=(m?4:0)+(d?2:0)+(p?1:0);return w(a,t(t({},r(n,C)),{},{ref:e,class:`${s||""} ${y||""}`.trim()||null,style:t(t(t({},h),b),{},{contain:z[v]})}),w(i,t(t({},c),{},{ref:l,class:u,style:t(t({},m&&U),{},{"overflow":p?"hidden":"visible"},f)}),o))}));var A,E=["as","children","class","style","wrapperClassName","wrapperStyle"],H=k((function(n,e){let{as:a="div",children:o,"class":s,"style":i,wrapperClassName:u,wrapperStyle:c}=n;return w(a,t(t({},r(n,E)),{},{ref:e,class:`${s||""} ${u||""}`.trim()||null,style:t(t({},i),c)}),o)}));function I(){const n=A||(A=u({renderable:!0,playable:!0,loading:"auto"},void 0));return m(n)}function P(n){return R[n]}new WeakMap,new WeakMap;var R={"de":["Jahren","Monaten","Tagen","Stunden","Minuten","Sekunden"],"en":["Years","Months","Days","Hours","Minutes","Seconds"],"es":["años","meses","días","horas","minutos","segundos"],"fr":["ans","mois","jours","heures","minutes","secondes"],"id":["tahun","bulan","hari","jam","menit","detik"],"it":["anni","mesi","giorni","ore","minuti","secondi"],"ja":["年","ヶ月","日","時間","分","秒"],"ko":["년","달","일","시간","분","초"],"nl":["jaar","maanden","dagen","uur","minuten","seconden"],"pt":["anos","meses","dias","horas","minutos","segundos"],"ru":["год","месяц","день","час","минута","секунда"],"th":["ปี","เดือน","วัน","ชั่วโมง","นาที","วินาที"],"tr":["yıl","ay","gün","saat","dakika","saniye"],"vi":["năm","tháng","ngày","giờ","phút","giây"],"zh-cn":["年","月","天","小时","分钟","秒"],"zh-tw":["年","月","天","小時","分鐘","秒"]},T=["datetime","whenEnded","locale","biggestUnit","countUp","render"],Y={DAYS:1,HOURS:2,MINUTES:3,SECONDS:4},W="en",_="stop",x="DAYS",J=!1,L=n=>`${n.days} ${n.dd}, ${n.hours} ${n.hh}, ${n.minutes} ${n.mm}, ${n.seconds} ${n.ss}`;function q(n){let{datetime:e,whenEnded:a=_,locale:o=W,biggestUnit:i=x,countUp:u=J,render:c=L}=n,l=r(n,T);!function(){const{notify:n}=I();O((()=>{n&&n()}))}();const{playable:f}=I(),d=M((()=>{return(n=e)?"number"==typeof n?n:"string"==typeof n?function(n){if(!n)return null;if("now"===n.toLowerCase())return Date.now();const e=Date.parse(n);return isNaN(e)?null:e}(n):(n=n).getTime():null;var n}),[e]),p=M((()=>function(n){var e;void 0===P(n)&&(e=`Invalid locale ${n}, defaulting to ${W}. DateCountdown`,console.warn(e),n=W);const t=P(n);return s({"years":t[0],"months":t[1],"days":t[2],"hours":t[3],"minutes":t[4],"seconds":t[5]})}(o)),[o]),[m,y]=S(d-Date.now()+1e3),b=M((()=>function(n,e,r,a){return t(t({},function(n,e,t){t&&(n*=-1);const r=Y[e]==Y.DAYS?F(Math.floor(n/864e5)):0,a=Y[e]==Y.HOURS?F(Math.floor(n/36e5)):Y[e]<Y.HOURS?F(Math.floor(n%864e5/36e5)):0,o=Y[e]==Y.MINUTES?F(Math.floor(n/6e4)):Y[e]<Y.MINUTES?F(Math.floor(n%36e5/6e4)):0,i=F(Y[e]==Y.SECONDS?Math.floor(n/1e3):Math.floor(n%6e4/1e3));return s({"d":r,"dd":B(r),"h":a,"hh":B(a),"m":o,"mm":B(o),"s":i,"ss":B(i)})}(n,e,a)),r)}(m,i,p,u)),[m,i,p,u]),v=g(null);h((()=>{if(!f||!v.current)return;const n=v.current.ownerDocument.defaultView,e=n.setInterval((()=>{const t=d-Date.now()+1e3;y(t),a===_&&t<1e3&&n.clearInterval(e)}),1e3);return()=>n.clearInterval(e)}),[f,d,a]);const j=function(n,e){const[t,r]=S(null);return O((()=>{const t=n&&n(e)||null;if(t&&"function"==typeof t.then){let n=!1;return t.then((e=>{n||r(e)})),()=>{n=!0}}r(t)}),[n,e]),t}(c,b),$=j&&"object"==typeof j&&"__html"in j;return w(H,t(t({},l),{},{ref:v,dangerouslySetInnerHTML:$?j:null}),$?null:j)}function B(n){return n<-9||n>9?String(n):n>=-9&&n<0?"-0"+-n:"0"+n}function F(n){return n<0?n+1:n}export{q as BentoDateCountdown};
function _(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function w(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,r)}return t}function A(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?w(Object(t),!0).forEach((function(e){_(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}function Ri(n,e){if(null==n)return{};var t,r,a={},o=Object.keys(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)>=0||(a[t]=n[t]);return a}var{hasOwnProperty:c,toString:a}=Object.prototype;function f(n){return n||{}}import{cloneElement as de,createContext as pe,createElement as Sn,createRef as me}from"react";import{hydrate as ye,render as En}from"react-dom";import{useCallback as be,useContext as ve,useEffect as On,useImperativeHandle as ge,useLayoutEffect as Vn,useMemo as jn,useRef as In,useState as Tn}from"react";function je(n,e,t){return Sn.apply(void 0,arguments)}function we(n){return Tn(n)}function Se(n,e){Vn(n,e)}function Oe(n,e){return jn(n,e)}import{Children as Me,createPortal as $e,forwardRef as Yi}from"react";function Ne(n){return Yi(n)}var Gi=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],Qi=[null,"paint","layout","content","size","size paint","size layout","strict"],Ji={"position":"relative","width":"100%","height":"100%"};Ne((function(n,e){let{as:t="div",children:r,"class":a,contentAs:o="div",contentClassName:s,contentProps:i,contentRef:u,contentStyle:c,layout:l=!1,paint:f=!1,size:d=!1,"style":p,wrapperClassName:m,wrapperStyle:h}=n;const y=(d?4:0)+(l?2:0)+(f?1:0);return je(t,A(A({},Ri(n,Gi)),{},{ref:e,class:`${a||""} ${m||""}`.trim()||null,style:A(A(A({},p),h),{},{contain:Qi[y]})}),je(o,A(A({},i),{},{ref:u,class:s,style:A(A({},d&&Ji),{},{"overflow":f?"hidden":"visible"},c)}),r))}));var wn,Ki=["as","children","class","style","wrapperClassName","wrapperStyle"],Xi=Ne((function(n,e){let{as:t="div",children:r,"class":a,"style":o,wrapperClassName:s,wrapperStyle:i}=n;return je(t,A(A({},Ri(n,Ki)),{},{ref:e,class:`${a||""} ${s||""}`.trim()||null,style:A(A({},o),i)}),r)}));function $n(){const n=wn||(wn=pe({renderable:!0,playable:!0,loading:"auto"},void 0));return ve(n)}function te(n){return ne[n]}new WeakMap,new WeakMap;var ne={"de":["Jahren","Monaten","Tagen","Stunden","Minuten","Sekunden"],"en":["Years","Months","Days","Hours","Minutes","Seconds"],"es":["años","meses","días","horas","minutos","segundos"],"fr":["ans","mois","jours","heures","minutes","secondes"],"id":["tahun","bulan","hari","jam","menit","detik"],"it":["anni","mesi","giorni","ore","minuti","secondi"],"ja":["年","ヶ月","日","時間","分","秒"],"ko":["년","달","일","시간","분","초"],"nl":["jaar","maanden","dagen","uur","minuten","seconden"],"pt":["anos","meses","dias","horas","minutos","segundos"],"ru":["год","месяц","день","час","минута","секунда"],"th":["ปี","เดือน","วัน","ชั่วโมง","นาที","วินาที"],"tr":["yıl","ay","gün","saat","dakika","saniye"],"vi":["năm","tháng","ngày","giờ","phút","giây"],"zh-cn":["年","月","天","小时","分钟","秒"],"zh-tw":["年","月","天","小時","分鐘","秒"]},ie=["datetime","whenEnded","locale","biggestUnit","countUp","render"],ee={DAYS:1,HOURS:2,MINUTES:3,SECONDS:4},oe="en",re="stop",se="DAYS",ue=!1,le=n=>`${n.days} ${n.dd}, ${n.hours} ${n.hh}, ${n.minutes} ${n.mm}, ${n.seconds} ${n.ss}`;function De(n){let{datetime:e,whenEnded:t=re,locale:r=oe,biggestUnit:a=se,countUp:o=ue,render:s=le}=n,i=Ri(n,ie);!function(){const{notify:n}=$n();Se((()=>{n&&n()}))}();const{playable:u}=$n(),c=Oe((()=>{return(n=e)?"number"==typeof n?n:"string"==typeof n?function(n){if(!n)return null;if("now"===n.toLowerCase())return Date.now();const e=Date.parse(n);return isNaN(e)?null:e}(n):(n=n).getTime():null;var n}),[e]),l=Oe((()=>function(n){var e;void 0===te(n)&&(e=`Invalid locale ${n}, defaulting to ${oe}. DateCountdown`,console.warn(e),n=oe);const t=te(n);return f({"years":t[0],"months":t[1],"days":t[2],"hours":t[3],"minutes":t[4],"seconds":t[5]})}(r)),[r]),[d,p]=we(c-Date.now()+1e3),m=Oe((()=>function(n,e,t,r){return A(A({},function(n,e,t){t&&(n*=-1);const r=ee[e]==ee.DAYS?ae(Math.floor(n/864e5)):0,a=ee[e]==ee.HOURS?ae(Math.floor(n/36e5)):ee[e]<ee.HOURS?ae(Math.floor(n%864e5/36e5)):0,o=ee[e]==ee.MINUTES?ae(Math.floor(n/6e4)):ee[e]<ee.MINUTES?ae(Math.floor(n%36e5/6e4)):0,s=ae(ee[e]==ee.SECONDS?Math.floor(n/1e3):Math.floor(n%6e4/1e3));return f({"d":r,"dd":ce(r),"h":a,"hh":ce(a),"m":o,"mm":ce(o),"s":s,"ss":ce(s)})}(n,e,r)),t)}(d,a,l,o)),[d,a,l,o]),h=In(null);On((()=>{if(!u||!h.current)return;const n=h.current.ownerDocument.defaultView,e=n.setInterval((()=>{const r=c-Date.now()+1e3;p(r),t===re&&r<1e3&&n.clearInterval(e)}),1e3);return()=>n.clearInterval(e)}),[u,c,t]);const y=function(n,e){const[t,r]=we(null);return Se((()=>{const t=n&&n(e)||null;if(t&&"function"==typeof t.then){let n=!1;return t.then((e=>{n||r(e)})),()=>{n=!0}}r(t)}),[n,e]),t}(s,m),b=y&&"object"==typeof y&&"__html"in y;return je(Xi,A(A({},i),{},{ref:h,dangerouslySetInnerHTML:b?y:null}),b?null:y)}function ce(n){return n<-9||n>9?String(n):n>=-9&&n<0?"-0"+-n:"0"+n}function ae(n){return n<0?n+1:n}export{De as BentoDateCountdown};
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
{
"name": "@ampproject/amp-date-countdown",
"version": "1.2110202310.0",
"version": "1.2110212130.0",
"description": "AMP HTML amp-date-countdown Component",

@@ -5,0 +5,0 @@ "author": "The AMP HTML Authors",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc