Skip to content

The only tool you need to know what is happening and how to fix it.

1.5 KB
Raw Blame
import{j as s,g as o,l as i,k as m}from"./BKFspo1J.js";import{$ as n}from"./DJyUKrCa.js";import{g as a}from"./qSFdVk7G.js";import{t as h,c as p}from"./DbaB4N6s.js";import{p as l,g,b as c,d as u,a as f}from"./BYJ4QaOY.js";class C{#t=s(null);get preset(){return o(this.#t)}set preset(t){i(this.#t,t,!0)}#e=s(m(new n(1970,1,1)));get fromDate(){return o(this.#e)}set fromDate(t){i(this.#e,t,!0)}#r=s(m(new n(1970,1,1)));get toDate(){return o(this.#r)}set toDate(t){i(this.#r,t,!0)}#s=s("00:00");get fromTime(){return o(this.#s)}set fromTime(t){i(this.#s,t,!0)}#o=s("00:00");get toTime(){return o(this.#o)}set toTime(t){i(this.#o,t,!0)}defaultPreset;constructor(t){this.defaultPreset=t,this.readUrl()}readUrl(){const t=a(),e=l(t,this.defaultPreset),r=g(e,t);this.preset=e.preset,this.setRange(r.from,r.to,t)}resolvePreset(){if(!this.preset)return;const t=a(),e=c(this.preset,t);this.setRange(e.from,e.to,t)}apply(t,e,r){this.fromDate=t.date,this.toDate=e.date,this.fromTime=t.time,this.toTime=e.time,this.preset=r}fromUTC(){return h(this.toLuxon(this.fromDate,this.fromTime))}toUTC(){return h(this.toLuxon(this.toDate,this.toTime).endOf("minute"))}urlParams(){return this.preset?{preset:this.preset,from:null,to:null}:{preset:null,from:this.fromUTC(),to:this.toUTC()}}setRange(t,e,r){this.fromDate=u(t,r),this.toDate=u(e,r),this.fromTime=f(t,r),this.toTime=f(e,r)}toLuxon(t,e){const[r,T]=e.split(":").map(Number);return p({year:t.year,month:t.month,day:t.day,hour:r,minute:T},a())}}export{C as T};