hypnagaga/docs/assets/time-Dt9E6jI9.js
github-actions[bot] 6874523868 docs
2024-08-28 08:09:11 +00:00

1 line
7 KiB
JavaScript

import{d as E}from"./advancedFormat-D5cdT3Ux.js";import{d as y}from"./dayjs.min-BIwLhz4I.js";import{c as S,g as w}from"./_commonjsHelpers-BosuxZz1.js";var U={exports:{}};(function(d,M){(function(i,a){d.exports=a()})(S,function(){var i={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(a,g,Y){var s=g.prototype,v=s.format;Y.en.formats=i,s.format=function(r){r===void 0&&(r="YYYY-MM-DDTHH:mm:ssZ");var u=this.$locale().formats,p=function(T,o){return T.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(h,n,t){var e=t&&t.toUpperCase();return n||o[t]||i[t]||o[e].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(m,l,f){return l||f.slice(1)})})}(r,u===void 0?{}:u);return v.call(this,p)}}})})(U);var N=U.exports;const A=w(N);var H={exports:{}};(function(d,M){(function(i,a){d.exports=a()})(S,function(){return function(i,a,g){i=i||{};var Y=a.prototype,s={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function v(u,p,T,o){return Y.fromToBase(u,p,T,o)}g.en.relativeTime=s,Y.fromToBase=function(u,p,T,o,h){for(var n,t,e,m=T.$locale().relativeTime||s,l=i.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],f=l.length,$=0;$<f;$+=1){var c=l[$];c.d&&(n=o?g(u).diff(T,c.d,!0):T.diff(u,c.d,!0));var x=(i.rounding||Math.round)(Math.abs(n));if(e=n>0,x<=c.r||!c.r){x<=1&&$>0&&(c=l[$-1]);var D=m[c.l];h&&(x=h(""+x)),t=typeof D=="string"?D.replace("%d",x):D(x,p,c.l,e);break}}if(p)return t;var L=e?m.future:m.past;return typeof L=="function"?L(t):L.replace("%s",t)},Y.to=function(u,p){return v(u,p,this,!0)},Y.from=function(u,p){return v(u,p,this)};var r=function(u){return u.$u?g.utc():g()};Y.toNow=function(u){return this.to(r(this),u)},Y.fromNow=function(u){return this.from(r(this),u)}}})})(H);var j=H.exports;const I=w(j);var F={exports:{}};(function(d,M){(function(i,a){d.exports=a()})(S,function(){var i={year:0,month:1,day:2,hour:3,minute:4,second:5},a={};return function(g,Y,s){var v,r=function(o,h,n){n===void 0&&(n={});var t=new Date(o),e=function(m,l){l===void 0&&(l={});var f=l.timeZoneName||"short",$=m+"|"+f,c=a[$];return c||(c=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:m,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:f}),a[$]=c),c}(h,n);return e.formatToParts(t)},u=function(o,h){for(var n=r(o,h),t=[],e=0;e<n.length;e+=1){var m=n[e],l=m.type,f=m.value,$=i[l];$>=0&&(t[$]=parseInt(f,10))}var c=t[3],x=c===24?0:c,D=t[0]+"-"+t[1]+"-"+t[2]+" "+x+":"+t[4]+":"+t[5]+":000",L=+o;return(s.utc(D).valueOf()-(L-=L%1e3))/6e4},p=Y.prototype;p.tz=function(o,h){o===void 0&&(o=v);var n,t=this.utcOffset(),e=this.toDate(),m=e.toLocaleString("en-US",{timeZone:o}),l=Math.round((e-new Date(m))/1e3/60),f=15*-Math.round(e.getTimezoneOffset()/15)-l;if(!Number(f))n=this.utcOffset(0,h);else if(n=s(m,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(f,!0),h){var $=n.utcOffset();n=n.add(t-$,"minute")}return n.$x.$timezone=o,n},p.offsetName=function(o){var h=this.$x.$timezone||s.tz.guess(),n=r(this.valueOf(),h,{timeZoneName:o}).find(function(t){return t.type.toLowerCase()==="timezonename"});return n&&n.value};var T=p.startOf;p.startOf=function(o,h){if(!this.$x||!this.$x.$timezone)return T.call(this,o,h);var n=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return T.call(n,o,h).tz(this.$x.$timezone,!0)},s.tz=function(o,h,n){var t=n&&h,e=n||h||v,m=u(+s(),e);if(typeof o!="string")return s(o).tz(e);var l=function(x,D,L){var z=x-60*D*1e3,O=u(z,L);if(D===O)return[z,D];var C=u(z-=60*(O-D)*1e3,L);return O===C?[z,O]:[x-60*Math.min(O,C)*1e3,Math.max(O,C)]}(s.utc(o,t).valueOf(),m,e),f=l[0],$=l[1],c=s(f).utcOffset($);return c.$x.$timezone=e,c},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(o){v=o}}})})(F);var k=F.exports;const B=w(k);var Z={exports:{}};(function(d,M){(function(i,a){d.exports=a()})(S,function(){return function(i,a,g){g.updateLocale=function(Y,s){var v=g.Ls[Y];if(v)return(s?Object.keys(s):[]).forEach(function(r){v[r]=s[r]}),v}}})})(Z);var G=Z.exports;const P=w(G);var b={exports:{}};(function(d,M){(function(i,a){d.exports=a()})(S,function(){var i="minute",a=/[+-]\d\d(?::?\d\d)?/g,g=/([+-]|\d\d)/g;return function(Y,s,v){var r=s.prototype;v.utc=function(t){var e={date:t,utc:!0,args:arguments};return new s(e)},r.utc=function(t){var e=v(this.toDate(),{locale:this.$L,utc:!0});return t?e.add(this.utcOffset(),i):e},r.local=function(){return v(this.toDate(),{locale:this.$L,utc:!1})};var u=r.parse;r.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),u.call(this,t)};var p=r.init;r.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else p.call(this)};var T=r.utcOffset;r.utcOffset=function(t,e){var m=this.$utils().u;if(m(t))return this.$u?0:m(this.$offset)?T.call(this):this.$offset;if(typeof t=="string"&&(t=function(c){c===void 0&&(c="");var x=c.match(a);if(!x)return null;var D=(""+x[0]).match(g)||["-",0,0],L=D[0],z=60*+D[1]+ +D[2];return z===0?0:L==="+"?z:-z}(t),t===null))return this;var l=Math.abs(t)<=16?60*t:t,f=this;if(e)return f.$offset=l,f.$u=t===0,f;if(t!==0){var $=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(f=this.local().add(l+$,i)).$offset=l,f.$x.$localOffset=$}else f=this.utc();return f};var o=r.format;r.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return o.call(this,e)},r.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},r.isUTC=function(){return!!this.$u},r.toISOString=function(){return this.toDate().toISOString()},r.toString=function(){return this.toDate().toUTCString()};var h=r.toDate;r.toDate=function(t){return t==="s"&&this.$offset?v(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var n=r.diff;r.diff=function(t,e,m){if(t&&this.$u===t.$u)return n.call(this,t,e,m);var l=this.local(),f=v(t).local();return n.call(l,f,e,m)}}})})(b);var R=b.exports;const W=w(R);y.extend(I);y.extend(A);y.extend(E);y.extend(W);y.extend(B);y.extend(P);y.updateLocale("en",{relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a min",mm:"%d min",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}});const q=d=>"UTC",J=(d,M,i="day")=>y(d).diff(y(M),i,!0),K=(d,M,i=1)=>J(d,M,"hour")<-i,Q=(d,M)=>{const i=new Date(d),a=new Date(M);return i.getFullYear()===a.getFullYear()&&i.getMonth()===a.getMonth()&&i.getDate()===a.getDate()},tt=d=>{const M=y(d,{utc:!0}),i=!K(M,Date.now()),a=Q(M,Date.now()),g=q();return i?y().to(M):a?y(d).tz(g).format("h:mm A z"):M.format("MMMM D, YYYY")};export{tt as g};