@aiquants/period-slider 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +73 -0
- package/README.md +69 -31
- package/dist/DateSelector.d.ts +2 -2
- package/dist/DateSelector.d.ts.map +1 -1
- package/dist/MonthSelector.d.ts +2 -2
- package/dist/MonthSelector.d.ts.map +1 -1
- package/dist/PeriodSlider.d.ts +126 -16
- package/dist/PeriodSlider.d.ts.map +1 -1
- package/dist/StepperButton.d.ts +58 -0
- package/dist/StepperButton.d.ts.map +1 -0
- package/dist/YearSelector.d.ts +2 -2
- package/dist/YearSelector.d.ts.map +1 -1
- package/dist/dragPresentation.d.ts +191 -0
- package/dist/dragPresentation.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1960 -1813
- package/dist/rangeAreaWheel.d.ts +111 -0
- package/dist/rangeAreaWheel.d.ts.map +1 -0
- package/dist/styles/period-slider.css +1 -1
- package/dist/styles/period-slider.standalone.css +1 -1
- package/dist/usePeriodSlider.d.ts +4 -2
- package/dist/usePeriodSlider.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/DateSelector.tsx +12 -28
- package/src/MonthSelector.tsx +10 -26
- package/src/PeriodSlider.tsx +1235 -568
- package/src/StepperButton.tsx +251 -0
- package/src/YearSelector.tsx +9 -23
- package/src/dragPresentation.ts +273 -0
- package/src/index.ts +1 -1
- package/src/rangeAreaWheel.ts +285 -0
- package/src/styles/period-slider.css +307 -108
- package/src/usePeriodSlider.ts +30 -17
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),Ye=require("date-fns"),o=require("react"),uo={"blue-rose":{macro:"#0284c7",macroLight:"#38bdf8",micro:"#e11d48",microLight:"#fb7185",accent:"#0284c7"},"indigo-amber":{macro:"#4f46e5",macroLight:"#818cf8",micro:"#d97706",microLight:"#fbbf24",accent:"#4f46e5"},"teal-emerald":{macro:"#0d9488",macroLight:"#2dd4bf",micro:"#059669",microLight:"#34d399",accent:"#0d9488"},"violet-fuchsia":{macro:"#7c3aed",macroLight:"#a78bfa",micro:"#c026d3",microLight:"#e879f9",accent:"#7c3aed"},"slate-sky":{macro:"#475569",macroLight:"#94a3b8",micro:"#0284c7",microLight:"#38bdf8",accent:"#475569"},monochrome:{macro:"#52525b",macroLight:"#a1a1aa",micro:"#18181b",microLight:"#71717a",accent:"#27272a"}},ot=e=>e instanceof Date&&!Number.isNaN(e.getTime()),xe=e=>e instanceof Date?Number.isNaN(e.getTime())?"Invalid Date":e.toISOString():String(e),Ke=(e,t)=>{if(!ot(t))throw new RangeError(`normalizeDateByUnit: d must be a valid Date (received: ${xe(t)})`);const r=new Date(t.getTime());return e==="year"?(r.setMonth(0,1),r.setHours(0,0,0,0)):(e==="month"&&r.setDate(1),r.setHours(0,0,0,0)),r},de=(e,t)=>{const r=Ke(e,t),n=r.getFullYear(),a=r.getMonth()+1,c=r.getDate();if(e==="year")return n;if(e==="month")return n*12+(a-1);const l=new Date(0);return l.setUTCFullYear(n,a-1,c),l.setUTCHours(0,0,0,0),Math.floor(l.getTime()/(1440*60*1e3))},ae=(e,t)=>{const r=new Date(0);if(r.setHours(0,0,0,0),e==="year")return r.setFullYear(t,0,1),r;if(e==="month"){const a=Math.floor(t/12),c=t-a*12;return r.setFullYear(a,c,1),r}const n=new Date(t*24*60*60*1e3);return r.setFullYear(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()),r},Ee=(e,t,r)=>{if(!ot(t))throw new RangeError(`addUnit: d must be a valid Date (received: ${xe(t)})`);return e==="year"?Ye.addYears(t,r):e==="month"?Ye.addMonths(t,r):Ye.addDays(t,r)},mo=(e,t,r)=>{if(!ot(r))throw new RangeError(`getMacroWindowStartDate: d must be a valid Date (received: ${xe(r)})`);return Ke(t,Ke(e,r))},fo=(e,t,r)=>{if(!ot(r))throw new RangeError(`getMacroWindowEndDate: d must be a valid Date (received: ${xe(r)})`);if(e===t)return Ke(t,r);const n=r.getFullYear(),a=r.getMonth();if(e==="year"){if(t==="month")return new Date(n,11,1);if(t==="day")return new Date(n,11,31)}return e==="month"&&t==="day"?new Date(n,a+1,0):Ke(t,r)},Jn=(e,t,r)=>e<t?t:e>r?r:e,ht=(e,t,r,n,a)=>{if(Dr("macroRange",r,"resolveMacroWindow"),!ot(n))throw new RangeError(`resolveMacroWindow: minDate must be a valid Date (received: ${xe(n)})`);if(!ot(a))throw new RangeError(`resolveMacroWindow: maxDate must be a valid Date (received: ${xe(a)})`);if(a.getTime()<n.getTime())throw new RangeError(`resolveMacroWindow: maxDate must not precede minDate (minDate: ${xe(n)}, maxDate: ${xe(a)})`);return[Ke(t,Jn(mo(e,t,r[0]),n,a)),Ke(t,Jn(fo(e,t,r[1]),n,a))]},sa={year:{year:"numeric"},month:{year:"numeric",month:"2-digit"},day:{year:"numeric",month:"2-digit",day:"2-digit"}},Qn=new Map,ca=(e,t)=>{const r=`${e}\0${t}`,n=Qn.get(r);if(n!==void 0)return n;const a=new Intl.DateTimeFormat(t,sa[e]);return Qn.set(r,a),a},ua=(e,t)=>{const r=String(t.getFullYear()).padStart(4,"0");if(e==="year")return r;const n=String(t.getMonth()+1).padStart(2,"0");if(e==="month")return`${r}-${n}`;const a=String(t.getDate()).padStart(2,"0");return`${r}-${n}-${a}`},qe=(e,t,r,n)=>ot(t)?r?r(t):n===void 0?ua(e,t):ca(e,n).format(t):"",Yt=(e,t,r,n)=>qe(e,t,r,n),be=(e,t,r)=>{if(!e||e.length===0||e.length===1)return 0;const n=de(r,t);let a=0,c=e.length-1;if(n<=de(r,e[a]))return 0;if(n>=de(r,e[c]))return c;for(;a<=c;){const w=a+c>>1,f=de(r,e[w]);if(f===n)return w;f<n?a=w+1:c=w-1}const l=Math.abs(de(r,e[a])-n),u=Math.abs(de(r,e[c])-n);return l<u?a:c},vt=(e,t,r,n)=>{if(!Array.isArray(e)||e.length===0)return[];const a=de(t,r),c=de(t,n),l=new Map;for(const u of e){const w=Ke(t,u),f=de(t,w);f<a||f>c||l.has(f)||l.set(f,w)}if(l.size===0)throw new RangeError(`getSortedAllowedDates: every allowedDates entry falls outside [minDate, maxDate] (minDate: ${xe(r)}, maxDate: ${xe(n)}, entries: ${e.length})`);return Array.from(l.keys()).sort((u,w)=>u-w).map(u=>l.get(u))},Er=(e,t,r,n)=>{const a=e.length-1;if(a<=0)return 0;const c=be(e,n,t);if(r==="time"){const l=e[0].getTime(),u=e[a].getTime()-l;return u<=0?0:Math.max(0,Math.min(1,(e[c].getTime()-l)/u))}return c/a},Nr=(e,t,r,n)=>{const a=e.length-1;if(a<=0)return 0;const c=Math.max(0,Math.min(1,n));if(r==="time"){const l=e[0].getTime(),u=e[a].getTime()-l;return u<=0?0:be(e,new Date(l+c*u),t)}return Math.max(0,Math.min(a,Math.round(c*a)))},hn=(e,t,r,n,a,c,l)=>{let u=r,w=n;return l?(u=t,w=t):e==="low"?t>n?(u=n,w=t):u=t:t<r?(w=r,u=t):w=t,[Math.max(a,Math.min(c,u)),Math.max(a,Math.min(c,w))]},go=(e,t,r,n,a)=>a?"low":e==="low"?t>n?"high":"low":t<r?"low":"high",ho=({posDiffPct:e,startLowVal:t,startHighVal:r,rangeMin:n,rangeMax:a,isDiscrete:c,sortedAllowedDates:l,snapMode:u,unit:w})=>{if(c){const ee=l.length-1;if(ee<=0)return[0,0];const ne=Math.max(0,Math.min(ee,Math.round(t))),C=Math.max(ne,Math.min(ee,Math.round(r)));if(u==="time"){const V=l[0].getTime(),W=l[ee].getTime(),te=l[ne].getTime(),q=l[C].getTime()-te;let F=te+e*(W-V),p=F+q;F<V&&(F=V,p=V+q),p>W&&(p=W,F=W-q);const D=be(l,new Date(F),w),y=be(l,new Date(p),w);return[D,Math.max(D,y)]}const ce=Math.round(e*ee);let oe=ne+ce,$=C+ce;return oe<0&&($+=-oe,oe=0),$>ee&&(oe-=$-ee,$=ee),[Math.max(0,Math.min(ee,oe)),Math.max(0,Math.min(ee,$))]}const f=ee=>Math.max(n,Math.min(a,ee)),T=a-n;if(T<=0)return[f(t),f(r)];const L=Math.round(e*T);let s=t+L,k=r+L;return s<n&&(k+=n-s,s=n),k>a&&(s-=k-a,k=a),[f(s),f(k)]},bo=(e,t,r,n,a,c,l,u)=>{let w=0,f=!1,T=!1;switch(e){case"ArrowRight":case"ArrowUp":w=u;break;case"ArrowLeft":case"ArrowDown":w=-u;break;case"PageUp":w=u*5;break;case"PageDown":w=-u*5;break;case"Home":f=!0;break;case"End":T=!0;break;default:return null}if(l){let k=r;return f?k=a:T?k=c:k=Math.max(a,Math.min(c,r+w)),[k,k]}let L=r,s=n;return t==="low"?f?L=a:T?L=n:L=Math.max(a,Math.min(n,r+w)):f?s=r:T?s=c:s=Math.max(r,Math.min(c,n+w)),[L,s]},wo=8,Mo=2,xo=16,da=12,ma=90,wn=(e,t)=>{const r=t?.estimatedHeightPx??xo,a=wo+(t?.anchorGapY??Mo)+r/2,c=e==="top"?-a:a;return{lowAngleDeg:0,highAngleDeg:0,lowOffsetX:0,highOffsetX:0,lowOffsetY:c,highOffsetY:c,isSlanted:!1,proximity:0}},Mn=(e,t,r,n="top",a)=>{const c=a?.estimatedWidthPx,l=a?.estimatedHeightPx??xo,u=a?.paddingPx??da,w=a?.maxAngleDeg??ma,f=wo+(a?.anchorGapY??Mo),T=wn(n,a);if(!(Number.isFinite(r)&&r>0)||c===void 0||!Number.isFinite(c)||c<=0)return T;const L=Math.max(0,t-e)/100*r,s=c+u;if(L>=s)return T;const k=Math.max(0,Math.min(1,(s-L)/s)),ne=k*k*k*(k*(k*6-15)+10)*w,C=n==="top"?-ne:ne,ce=ne*Math.PI/180,oe=c/2*Math.abs(Math.sin(ce))+l/2*Math.abs(Math.cos(ce)),$=f+oe,V=n==="top"?-$:+$,W=c*Math.abs(Math.cos(ce))+l*Math.abs(Math.sin(ce)),te=Math.max(0,(W+u-L)/2);return{lowAngleDeg:C,highAngleDeg:C,lowOffsetX:-te,highOffsetX:te,lowOffsetY:V,highOffsetY:V,isSlanted:k>.001,proximity:k}},Do=e=>({...e,lowOffsetX:0,highOffsetX:0}),xn=(e,t)=>{const r=t==="macro-top"||t==="macro-left",n=e<=0;return r&&n||!(r||n)?"macro":"micro"},vo=(e,t,r)=>{const n=Math.abs(e)>Math.abs(t)?e:t;return!Number.isFinite(n)||n===0?0:(r?n<0:n>0)?1:-1};function po(e,t,r,n,a,c,l="macro-top",u=.05,w=!0,f="range"){if(xn(t,l)==="macro"){const s=Math.abs(e-r),k=Math.abs(e-n);return s<=u&&s<=k?"macro-low":k<=u&&k<s?"macro-high":w&&e>=r&&e<=n?"macro-connect":s<k?"macro-low":"macro-high"}if(f==="point")return"micro-point";const T=Math.abs(e-a),L=Math.abs(e-c);return T<=u&&T<=L?"micro-low":L<=u&&L<T?"micro-high":w&&e>=a&&e<=c?"micro-connect":T<L?"micro-low":"micro-high"}function yo(e,t,r,n,a){if(e==="macro-connect"){const l=t-r,u=a-n,w=Math.max(0,Math.min(1-u,n+l)),f=w+u;return[w,f,"macro-connect"]}if(e==="macro-low"){const l=Math.max(0,Math.min(1,t));return l>a?[a,l,"macro-high"]:[l,a,"macro-low"]}const c=Math.max(0,Math.min(1,t));return c<n?[c,n,"macro-low"]:[n,c,"macro-high"]}function Ro(e,t,r,n,a){if(e==="micro-point"){const l=Math.max(0,Math.min(1,t));return[l,l,"micro-point"]}if(e==="micro-connect"){const l=t-r,u=a-n,w=Math.max(0,Math.min(1-u,n+l)),f=w+u;return[w,f,"micro-connect"]}if(e==="micro-low"){const l=Math.max(0,Math.min(1,t));return l>a?[a,l,"micro-high"]:[l,a,"micro-low"]}const c=Math.max(0,Math.min(1,t));return c<n?[c,n,"micro-low"]:[n,c,"micro-high"]}const Mr=o.memo(({type:e,isTop:t=!0,isVertical:r=!1,isLeft:n=!0})=>{let a,c;r?(a=n?"M 7.375 0.625 A 7.375 7.375 0 0 0 7.375 15.375 Z":"M 0.625 0.625 A 7.375 7.375 0 0 1 0.625 15.375 Z",c=`period-slider-knob period-slider-knob-svg is-vertical ${n?"is-semicircle-left":"is-semicircle-right"}`):(a=t?"M 0.625 7.375 A 7.375 7.375 0 0 1 15.375 7.375 Z":"M 0.625 0.625 A 7.375 7.375 0 0 0 15.375 0.625 Z",c=`period-slider-knob period-slider-knob-svg ${t?"is-semicircle-top":"is-semicircle-bottom"}`);const l=e==="macro"?"period-slider-knob-path-macro":"period-slider-knob-path-micro";return h.jsx("svg",{className:c,width:r?"8":"16",height:r?"16":"8",viewBox:r?"0 0 8 16":"0 0 16 8",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:h.jsx("path",{d:a,className:l,shapeRendering:"geometricPrecision",strokeWidth:"1.25"})})});Mr.displayName="VernierKnobSvg";const fa=(e,t)=>{if(!ot(e))throw new RangeError(`PeriodSlider: minDate is required and must be a valid Date (received: ${xe(e)})`);if(!ot(t))throw new RangeError(`PeriodSlider: maxDate is required and must be a valid Date (received: ${xe(t)})`);if(t.getTime()<=e.getTime())throw new RangeError(`PeriodSlider: maxDate must be strictly later than minDate (minDate: ${xe(e)}, maxDate: ${xe(t)})`)},Dr=(e,t,r="PeriodSlider")=>{if(!Array.isArray(t)||t.length!==2)throw new RangeError(`${r}: ${e} is required and must be a [start, end] Date tuple (received: ${xe(t)})`);const[n,a]=t;if(!ot(n))throw new RangeError(`${r}: ${e}[0] must be a valid Date (received: ${xe(n)})`);if(!ot(a))throw new RangeError(`${r}: ${e}[1] must be a valid Date (received: ${xe(a)})`);if(a.getTime()<n.getTime())throw new RangeError(`${r}: ${e} must not be inverted (start: ${xe(n)}, end: ${xe(a)})`)},bn=(e,t)=>{if(!ot(t))throw new RangeError(`PeriodSlider: ${e} must be a valid Date (received: ${xe(t)})`)},Dt=(e,t,r,n)=>{if(t.getTime()<r.getTime()||t.getTime()>n.getTime())throw new RangeError(`PeriodSlider: ${e} must lie within [minDate, maxDate] (received: ${xe(t)}, minDate: ${xe(r)}, maxDate: ${xe(n)})`)},ga=(e,t,r)=>{if(e.mode==="range"){for(const n of["range","defaultRange"]){const a=e[n];a!==void 0&&(Dr(n,a),Dt(`${n}[0]`,a[0],t,r),Dt(`${n}[1]`,a[1],t,r))}return}if(e.mode==="point")for(const n of["value","defaultValue"]){const a=e[n];a!==void 0&&(bn(n,a),Dt(n,a,t,r))}},ha=(e,t,r)=>{Dr("macroRange",e.macroRange);const n=e.microRange!==void 0||e.defaultMicroRange!==void 0||e.onChangeMicroRange!==void 0,a=e.microValue!==void 0||e.defaultMicroValue!==void 0||e.onChangeMicroPoint!==void 0;if(n&&a)throw new RangeError("PeriodSlider: vernier mode takes either a micro range (microRange / defaultMicroRange / onChangeMicroRange) or a micro point (microValue / defaultMicroValue / onChangeMicroPoint), never both");if(a){if(e.microValue!==void 0)return bn("microValue",e.microValue),Dt("microValue",e.microValue,t,r),{shape:"point",selection:[e.microValue,e.microValue]};if(e.defaultMicroValue!==void 0)return bn("defaultMicroValue",e.defaultMicroValue),Dt("defaultMicroValue",e.defaultMicroValue,t,r),{shape:"point",selection:[e.defaultMicroValue,e.defaultMicroValue]};throw new RangeError("PeriodSlider: vernier point mode requires a micro selection; supply microValue (controlled) or defaultMicroValue (uncontrolled)")}if(e.microRange!==void 0)return Dr("microRange",e.microRange),Dt("microRange[0]",e.microRange[0],t,r),Dt("microRange[1]",e.microRange[1],t,r),{shape:"range",selection:e.microRange};if(e.defaultMicroRange!==void 0)return Dr("defaultMicroRange",e.defaultMicroRange),Dt("defaultMicroRange[0]",e.defaultMicroRange[0],t,r),Dt("defaultMicroRange[1]",e.defaultMicroRange[1],t,r),{shape:"range",selection:e.defaultMicroRange};throw n?new RangeError("PeriodSlider: vernier range mode requires a micro selection; supply microRange (controlled) or defaultMicroRange (uncontrolled)"):new RangeError("PeriodSlider: vernier mode requires a micro selection; supply microRange / defaultMicroRange for a period, or microValue / defaultMicroValue for a point")},br=(e,t,r,n,a,c,l,u)=>{const w=be(e,n,t),f=be(e,a,t);return l?w:u?f:Math.max(w,Math.min(f,be(e,r,t)+c))},dn=e=>{e.timerId!==null&&clearTimeout(e.timerId),e.timerId=null,e.emit=null},ba=(e,t)=>{try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{throw new RangeError(`PeriodSlider: ${e} must be a valid BCP 47 language tag (received: ${JSON.stringify(t)})`)}},er=()=>{const[e,t]=o.useState(null),r=o.useRef(null),n=o.useCallback(a=>{if(r.current?.disconnect(),r.current=null,a===null){t(null);return}if(typeof ResizeObserver>"u")return;const c=new ResizeObserver(l=>{for(const u of l){const w=u.borderBoxSize?.[0];w!==void 0&&t(f=>f!==null&&Math.abs(f.widthPx-w.inlineSize)<.5&&Math.abs(f.heightPx-w.blockSize)<.5?f:{widthPx:w.inlineSize,heightPx:w.blockSize})}});c.observe(a),r.current=c},[]);return o.useEffect(()=>()=>{r.current?.disconnect(),r.current=null},[]),[n,e]},mn=(e,t)=>{if(!(e===null||t===null))return{estimatedWidthPx:Math.max(e.widthPx,t.widthPx),estimatedHeightPx:Math.max(e.heightPx,t.heightPx)}},eo=(e,t,r)=>({"--ps-tooltip-tx":`calc(-50% + ${e}px)`,"--ps-tooltip-ty":`${t}px`,"--ps-tooltip-rot":`${r}deg`}),to=(e,t,r,n,a,c,l)=>{const u=wn(n,a);if(!l)return{slant:u,lowStyle:void 0,highStyle:void 0};const w=Mn(e*100,t*100,r,n,a),f=c?Do(w):w;return{slant:f,lowStyle:eo(f.lowOffsetX,f.lowOffsetY-u.lowOffsetY,f.lowAngleDeg),highStyle:eo(f.highOffsetX,f.highOffsetY-u.highOffsetY,f.highAngleDeg)}},wa={horizontal:{decrease:"◀",increase:"▶"},vertical:{decrease:"▼",increase:"▲"}},Ma={horizontal:{decrease:"period-slider-stepper-prev",increase:"period-slider-stepper-next"},vertical:{decrease:"period-slider-stepper-prev period-slider-stepper-down",increase:"period-slider-stepper-next period-slider-stepper-up"}},xa=e=>{const{unit:t,minDate:r,maxDate:n,allowedDates:a,snapMode:c="index",disabled:l=!1,className:u="",showStepper:w=!0,tooltipStyle:f="always",labelPosition:T="top",autoSlantLabels:L=!0,isVertical:s=!1,hideConnectBar:k=!1,showTicks:ee=!1,colorScheme:ne="blue-rose",locale:C,decreaseAriaLabel:ce="Decrease",increaseAriaLabel:oe="Increase"}=e;fa(r,n),ga(e,r,n),C!==void 0&&ba("locale",C);const $=e.mode==="vernier"?ha(e,r,n):null,V=$!==null&&$.shape==="point",W=uo[ne],te=o.useId(),q=o.useRef(e);q.current=e;const F=r.getTime(),p=n.getTime(),D=o.useMemo(()=>vt(a,t,r,n),[a,t,F,p]),y=D.length>0,{rangeMin:E,rangeMax:P}=o.useMemo(()=>y?{rangeMin:0,rangeMax:D.length-1}:{rangeMin:de(t,r),rangeMax:de(t,n)},[y,D,t,F,p]),G=e.mode==="point",me=o.useCallback(i=>{if(y){const d=Math.max(0,Math.min(D.length-1,Math.round(i)));return D[d]}return ae(t,Math.round(i))},[y,D,t]),B=o.useCallback(i=>{if(i===void 0)return E;const d=Ke(t,i);return y?be(D,d,t):de(t,d)},[y,D,t,E]),[Z,se]=o.useState(()=>$===null?null:$.selection);let _=Z??($===null?null:$.selection);if(V&&_!==null&&_[0].getTime()!==_[1].getTime()){const i=[_[0],_[0]];_=i,se(i)}const z=e.mode==="vernier"?e.microValue?.getTime():void 0,re=o.useMemo(()=>e.mode!=="vernier"||e.microValue===void 0?null:[e.microValue,e.microValue],[e.mode,z]),ie=e.mode!=="vernier"?null:V?re??_:e.microRange!==void 0?e.microRange:_,We=e.mode==="range"?e.range?.[0]??e.defaultRange?.[0]:e.mode==="vernier"?ie?.[0]:void 0,Se=e.mode==="range"?e.range?.[1]??e.defaultRange?.[1]:e.mode==="vernier"?ie?.[1]:void 0,Le=e.mode==="point"?e.value??e.defaultValue:void 0,ye=e.mode==="point"?Le?.getTime():We?.getTime(),Ge=e.mode==="range"?Se?.getTime():ye,[Ze,at]=o.useMemo(()=>{if(e.mode==="point"){const m=B(Le);return[m,m]}const i=B(We),d=B(Se);return[Math.min(i,d),Math.max(i,d)]},[e.mode,ye,Ge,B,Le,We,Se]),Ve=e.mode==="point"?e.value!==void 0:e.mode==="range"?e.range!==void 0:V?e.microValue!==void 0:e.microRange!==void 0,[st,X]=o.useState(()=>[Ze,at]),[Q,ge]=o.useState(null),[b,S]=o.useState(null),j=o.useRef(null);j.current=b;const[Me,A]=o.useState("high"),[K,Ce]=o.useState(null),[Ne,He]=o.useState(null),fe=Q?Q[0]:Ve?Ze:st[0],we=Q?Q[1]:Ve?at:st[1],or=o.useRef([fe,we]);or.current=[fe,we];const he=e.mode==="vernier",kt=e.mode==="vernier"?e.vernierOrientation??(s?"macro-left":"macro-top"):"macro-top",I=kt==="macro-top"||kt==="macro-left",zr=e.mode==="vernier"?e.showVernierProjection??!0:!1,_r=e.mode==="vernier"?e.showVernierTicks??!0:!1,bt=e.mode==="vernier"?e.showHairline??!0:!1,O=he?e.macroUnit??t:t,x=he?e.microUnit??t:t,M=he?e.macroIsDiscrete??!1:y,Y=he?e.microIsDiscrete??!1:y,Be=he?e.macroAllowedDates??a:a,jt=he?e.microAllowedDates??a:a,ct=he?e.formatMacroLabel??e.formatLabel:e.formatLabel,Qe=he?e.formatMicroLabel??e.formatLabel:e.formatLabel,Po=e.mode==="vernier"?e.macroRange[0].getTime():void 0,ko=e.mode==="vernier"?e.macroRange[1].getTime():void 0,Ao=We?.getTime(),Io=Se?.getTime(),[ze,vr]=o.useState(null),pt=o.useRef(null);pt.current=ze;const[ar,Ot]=o.useState(()=>V?"micro-point":"micro-high");let ke=ar;const Xr=V?ar==="micro-low"||ar==="micro-high"||ar==="micro-connect"?"micro-point":null:ar==="micro-point"?"micro-high":null;Xr!==null&&(ke=Xr,Ot(Xr));const Re=o.useMemo(()=>de(O,r),[F,O]),et=o.useMemo(()=>{const i=de(O,n);if(he&&i<=Re)throw new RangeError(`PeriodSlider: macroUnit "${O}" cannot distinguish minDate from maxDate (minDate: ${xe(r)}, maxDate: ${xe(n)})`);return i},[he,F,p,Re,O]),ve=o.useMemo(()=>he?vt(Be,O,r,n):[],[he,Be,O,F,p]),je=o.useMemo(()=>e.mode!=="vernier"?Re:Math.max(Re,Math.min(et,de(O,e.macroRange[0]))),[e.mode,Po,Re,et,O]),Oe=o.useMemo(()=>e.mode!=="vernier"?et:Math.max(Re,Math.min(et,de(O,e.macroRange[1]))),[e.mode,ko,Re,et,O]),wt=o.useMemo(()=>ae(O,je),[O,je]),At=o.useMemo(()=>ae(O,Oe),[O,Oe]),pr=o.useMemo(()=>e.mode!=="vernier"?[r,n]:ht(O,x,[wt,At],r,n),[e.mode,wt,At,O,x,F,p]),De=o.useMemo(()=>de(x,pr[0]),[x,pr]),Te=o.useMemo(()=>de(x,pr[1]),[x,pr]),qr=o.useMemo(()=>he?vt(jt,x,r,n):[],[he,jt,x,F,p]),Kr=(i,d)=>qr.filter(m=>{const g=de(x,m);return g>=i&&g<=d}),le=o.useMemo(()=>Kr(De,Te),[qr,x,De,Te]),It=M&&ve.length>0,tt=Y&&le.length>0,yt=(i,d,m,g)=>d.length>0?de(x,d[be(d,i,x)]):Math.max(m,Math.min(g,de(x,i))),Ft=tt?le:[],$e=o.useMemo(()=>ie===null?De:yt(ie[0],Ft,De,Te),[Ao,De,Te,x,ie,Ft]),Fe=o.useMemo(()=>ie===null?Te:yt(ie[1],Ft,De,Te),[Io,De,Te,x,ie,Ft]),Rt=o.useMemo(()=>ae(x,$e),[x,$e]),Tt=o.useMemo(()=>ae(x,Fe),[x,Fe]),ir=Math.max(1,et-Re),Ae=It?Er(ve,O,c,wt):Math.max(0,Math.min(1,(je-Re)/ir)),_e=Math.max(Ae,It?Er(ve,O,c,At):Math.min(1,(Oe-Re)/ir)),lr=Math.max(1,Te-De),rt=tt?Er(le,x,c,Rt):Math.max(0,Math.min(1,($e-De)/lr)),Mt=Math.max(rt,tt?Er(le,x,c,Tt):Math.min(1,(Fe-De)/lr)),Gr=o.useRef({timerId:null,emit:null}),Zr=o.useRef({timerId:null,emit:null}),Jr=o.useRef({timerId:null,emit:null});o.useEffect(()=>{const i=[Gr,Zr,Jr];return()=>{for(const d of i)dn(d.current)}},[]);const Ut=o.useCallback((i,d,m)=>{dn(i);const{debounceMs:g}=q.current;if(m||!g||g<=0){d();return}i.emit=d,i.timerId=setTimeout(()=>{i.timerId=null,i.emit=null,d()},g)},[]),Qr=o.useCallback(i=>{const d=i.emit;dn(i),d?.()},[]),Wt=o.useCallback(i=>new Date(Math.min(Math.max(i.getTime(),F),p)),[F,p]),ut=o.useCallback((i,d,m=!1)=>{const[g,R]=or.current;if((q.current.mode==="point"?i===g:i===g&&d===R)&&Gr.current.timerId===null)return;const H=me(i),N=me(d),J=()=>{const v=q.current;v.mode==="point"?v.onChangePoint?.(H):v.mode==="range"&&v.onChangeRange?.(H,N)};Ut(Gr.current,J,m)},[me,Ut]),St=o.useCallback((i,d,m=!1)=>{if(q.current.mode!=="vernier")return;const g=Wt(i),R=Wt(d);Ut(Zr.current,()=>{const U=q.current;U.mode==="vernier"&&U.onChangeMacroRange?.(g,R)},m)},[Wt,Ut]),Je=o.useCallback((i,d,m=!1)=>{const g=q.current;if(g.mode!=="vernier")return;const R=Wt(i),U=Wt(d);(V?g.microValue===void 0:g.microRange===void 0)&&se([R,U]),Ut(Jr.current,()=>{const H=q.current;if(H.mode==="vernier"){if(V){H.onChangeMicroPoint?.(R);return}H.onChangeMicroRange?.(R,U)}},m)},[Wt,Ut,V]),Dn=o.useCallback((i,d=!1)=>{Je(i,i,d)},[Je]),yr=o.useCallback(i=>{if(y&&c==="time"&&D.length>1){const g=Math.max(0,Math.min(D.length-1,Math.round(i))),R=D[0].getTime(),H=D[D.length-1].getTime()-R;if(H<=0)return 0;const N=D[g].getTime();return Math.max(0,Math.min(100,(N-R)/H*100))}const d=P-E;if(d<=0)return 0;const m=(i-E)/d*100;return Math.max(0,Math.min(100,m))},[y,c,D,E,P]),Rr=o.useCallback(i=>{const d=Math.max(0,Math.min(100,i));if(y){if(c==="time"&&D.length>1){const R=D[0].getTime(),H=D[D.length-1].getTime()-R,N=R+d/100*H;return be(D,new Date(N),t)}const g=Math.round(d/100*(D.length-1));return Math.max(0,Math.min(D.length-1,g))}const m=E+d/100*(P-E);return Math.round(m)},[y,c,D,E,P,t]),it=o.useRef(null),[Bt,vn]=o.useState(0),[Eo,sr]=er(),[No,pn]=er(),[Yo,yn]=er(),[Vo,Rn]=er(),[Ho,Tn]=er(),[jo,Sn]=er();o.useEffect(()=>{const i=it.current;if(!i)return;const d=()=>{const m=i.getBoundingClientRect(),g=s?m.height:m.width;g>0&&vn(R=>Math.abs(R-g)<.5?R:g)};if(d(),typeof ResizeObserver<"u"){const m=new ResizeObserver(g=>{for(const R of g){const U=s?R.contentRect.height:R.contentRect.width;U>0&&vn(H=>Math.abs(H-U)<.5?H:U)}});return m.observe(i),()=>m.disconnect()}return window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[s]);const Et=o.useCallback((i,d,m)=>{const g=s?m.height:m.width;if(!(Number.isFinite(g)&&g>0))return null;const R=s?m.bottom-d:i-m.left;return Number.isFinite(R)?Math.max(0,Math.min(1,R/g)):null},[s]),Ln=o.useCallback((i,d)=>{const m=it.current;if(!m)return null;const g=Et(i,d,m.getBoundingClientRect());return g===null?null:g*100},[Et]),Tr=o.useRef(null),en=o.useRef(null),dt=o.useRef(null),tn=o.useRef(null),cr=o.useRef(null),Cn=o.useCallback(i=>{if(l)return;if(he){const v=en.current;if(!v||i.pointerId!==0&&i.pointerId!==v.pointerId||!it.current)return;const ue=Et(i.clientX,i.clientY,it.current.getBoundingClientRect());if(ue===null)return;if(v.handle==="macro-low"||v.handle==="macro-high"||v.handle==="macro-connect"){const[Ie,lt,Pe]=yo(v.handle,ue,v.startPointerRatio,v.startMacroLowRatio,v.startMacroHighRatio);Pe!==pt.current&&(pt.current=Pe,vr(Pe),Ot(Pe));let pe,ft;if(It){const Ct=Nr(ve,O,c,Ie),$t=Math.max(Ct,Nr(ve,O,c,lt));pe=ve[Ct],ft=ve[$t]}else{const Ct=Math.round(Re+Ie*ir),$t=Math.round(Re+lt*ir);pe=ae(O,Ct),ft=ae(O,$t)}const mr=`${pe.getTime()}_${ft.getTime()}`;mr!==tn.current&&(tn.current=mr,St(pe,ft));const[xt,Nt]=ht(O,x,[pe,ft],r,n),cn=de(x,xt),un=de(x,Nt),qn=Y?Kr(cn,un):[];let Kt,Gt;if(v.handle==="macro-connect"){const Ct=xt,$t=Nt;let Zt,Jt;if(O==="year"){const Pt=pe.getFullYear()-v.startMacroLowDate.getFullYear();Zt=Ee("year",v.initialMicroLowDate,Pt),Jt=Ee("year",v.initialMicroHighDate,Pt)}else if(O==="month"){const Pt=(pe.getFullYear()-v.startMacroLowDate.getFullYear())*12+(pe.getMonth()-v.startMacroLowDate.getMonth());Zt=Ee("month",v.initialMicroLowDate,Pt),Jt=Ee("month",v.initialMicroHighDate,Pt)}else{const Pt=Math.round((pe.getTime()-v.startMacroLowDate.getTime())/864e5);Zt=Ee("day",v.initialMicroLowDate,Pt),Jt=Ee("day",v.initialMicroHighDate,Pt)}const Qt=Ct.getTime(),fr=$t.getTime(),Zn=v.initialMicroHighDate.getTime()-v.initialMicroLowDate.getTime();let gr=Zt.getTime(),hr=Jt.getTime();gr<Qt&&(gr=Qt,hr=Math.min(fr,gr+Zn)),hr>fr&&(hr=fr,gr=Math.max(Qt,hr-Zn)),Kt=Ke(x,new Date(gr)),Gt=Ke(x,new Date(hr))}else{const Ct=xt.getTime(),$t=Nt.getTime(),Zt=v.initialMicroLowDate.getTime(),Jt=v.initialMicroHighDate.getTime(),Qt=Math.max(Ct,Math.min($t,Zt)),fr=Math.max(Qt,Math.min($t,Jt));Kt=Ke(x,new Date(Qt)),Gt=Ke(x,new Date(fr))}const Kn=yt(Kt,qn,cn,un),la=Math.max(Kn,yt(Gt,qn,cn,un));Kt=ae(x,Kn),Gt=ae(x,la);const Gn=`${Kt.getTime()}_${Gt.getTime()}`;Gn!==cr.current&&(cr.current=Gn,Je(Kt,Gt))}else if(v.handle==="micro-low"||v.handle==="micro-high"||v.handle==="micro-connect"||v.handle==="micro-point"){const[Ie,lt,Pe]=Ro(v.handle,ue,v.startPointerRatio,v.startMicroLowRatio,v.startMicroHighRatio);Pe!==pt.current&&(pt.current=Pe,vr(Pe),Ot(Pe));let pe,ft;if(tt){const xt=Nr(le,x,c,Ie),Nt=Math.max(xt,Nr(le,x,c,lt));pe=le[xt],ft=le[Nt]}else{const xt=yt(ae(x,Math.round(De+Ie*lr)),Ft,De,Te),Nt=Math.max(xt,yt(ae(x,Math.round(De+lt*lr)),Ft,De,Te));pe=ae(x,xt),ft=ae(x,Nt)}const mr=`${pe.getTime()}_${ft.getTime()}`;mr!==cr.current&&(cr.current=mr,Je(pe,ft))}return}const d=Tr.current;if(!d||i.pointerId!==0&&i.pointerId!==d.pointerId||!it.current)return;const m=it.current.getBoundingClientRect(),g=s?i.clientY:i.clientX,R=s?m.height:m.width;if(!(Number.isFinite(R)&&R>0))return;if(d.handle==="connect"){const v=s?(d.startPointerPos-g)/R:(g-d.startPointerPos)/R,ue=ho({posDiffPct:v,startLowVal:d.startLowVal,startHighVal:d.startHighVal,rangeMin:E,rangeMax:P,isDiscrete:y,sortedAllowedDates:D,snapMode:c,unit:t});if(dt.current&&dt.current[0]===ue[0]&&dt.current[1]===ue[1])return;dt.current=ue,ge(ue),ut(ue[0],ue[1],!1);return}const U=Et(i.clientX,i.clientY,m);if(U===null)return;const H=Rr(U*100),[N,J]=hn(d.handle,H,d.startLowVal,d.startHighVal,E,P,G);if((!dt.current||dt.current[0]!==N||dt.current[1]!==J)&&(dt.current=[N,J],ge([N,J]),ut(N,J,!1)),!G&&(d.handle==="low"||d.handle==="high")){const v=go(d.handle,H,d.startLowVal,d.startHighVal,G);j.current!==v&&(j.current=v,S(v),A(v))}},[l,he,s,O,x,It,tt,Y,F,p,ve,le,qr,Re,ir,De,lr,E,P,y,D,c,t,Et,Rr,ut,St,Je,G]),$n=o.useCallback(i=>{if(he){tn.current=null,cr.current=null,en.current=null,pt.current=null,vr(null),Qr(Zr.current),Qr(Jr.current);return}const d=Tr.current;if(!d||i.pointerId!==0&&i.pointerId!==d.pointerId)return;const m=dt.current??Q;m&&(ut(m[0],m[1],!0),X(m)),dt.current=null,ge(null),Tr.current=null,j.current=null,S(null)},[he,Q,ut,Qr]),Pn=o.useRef(Cn);Pn.current=Cn;const kn=o.useRef($n);kn.current=$n;const An=b!==null||ze!==null;o.useEffect(()=>{if(!An)return;const i=m=>Pn.current(m),d=m=>kn.current(m);return window.addEventListener("pointermove",i),window.addEventListener("pointerup",d),window.addEventListener("pointercancel",d),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d)}},[An]);const rn=o.useCallback((i,d,m)=>{Tr.current={pointerId:i,handle:d,startPointerPos:m,startLowVal:fe,startHighVal:we},j.current=d,S(d),d!=="connect"&&A(d)},[fe,we]),In=o.useCallback((i,d,m)=>{q.current.mode==="vernier"&&(en.current={pointerId:i,handle:d,startPointerRatio:m,startMacroLowRatio:Ae,startMacroHighRatio:_e,startMicroLowRatio:rt,startMicroHighRatio:Mt,startMacroLowDate:wt,initialMicroLowDate:Rt,initialMicroHighDate:Tt},pt.current=d,vr(d),Ot(d))},[Ae,_e,rt,Mt,wt,Rt,Tt]),En=i=>d=>{if(l)return;d.stopPropagation(),d.preventDefault(),A(i);const m=s?d.clientY:d.clientX;rn(d.pointerId,i,m)},Nn=i=>()=>{l||j.current!==null||A(i)},Sr=i=>()=>{l||pt.current!==null||Ot(i)},zt=i=>d=>{if(l)return;d.stopPropagation(),d.preventDefault();const m=it.current;if(!m)return;const g=Et(d.clientX,d.clientY,m.getBoundingClientRect());g!==null&&In(d.pointerId,i,g)},Oo=i=>{if(l||k)return;i.stopPropagation(),i.preventDefault();const d=s?i.clientY:i.clientX;rn(i.pointerId,"connect",d)},Fo=i=>{if(l)return;if(he){const N=it.current;if(!N)return;const J=N.getBoundingClientRect(),v=Et(i.clientX,i.clientY,J);if(v===null)return;const ue=s?i.clientX-(J.left+J.width/2):i.clientY-(J.top+J.height/2),Ie=po(v,ue,Ae,_e,rt,Mt,kt,void 0,!k,V?"point":"range");In(i.pointerId,Ie,v);return}const d=Ln(i.clientX,i.clientY);if(d===null)return;const m=Rr(d);let g="low";if(!G){const N=Math.abs(m-fe),J=Math.abs(m-we);N<J?g="low":J<N?g="high":g=m>we?"high":"low"}A(g);const[R,U]=hn(g,m,fe,we,E,P,G);ge([R,U]),ut(R,U,!0);const H=s?i.clientY:i.clientX;rn(i.pointerId,g,H)},Uo=i=>{if(l||b!==null)return;const d=Ln(i.clientX,i.clientY);if(d===null)return;const m=Rr(d);Ce(m),He(yr(m))},Wo=()=>{Ce(null),He(null)},Yn=i=>d=>{if(l)return;A(i);const m=bo(d.key,i,fe,we,E,P,G,1);m&&(d.preventDefault(),Ve||X(m),ut(m[0],m[1],!0))},_t=(i,d)=>{if(ie===null)return;const[m,g]=ht(O,x,[i,d],r,n),R=de(x,m),U=de(x,g),H=Y?Kr(R,U):[],N=de(x,ie[0]),J=de(x,ie[1]),v=yt(ie[0],H,R,U),ue=Math.max(v,yt(ie[1],H,R,U));v===N&&ue===J||Je(ae(x,v),ae(x,ue),!0)},Lr=i=>d=>{if(l||!he||e.mode!=="vernier")return;Ot(i);let m=0,g=!1,R=!1;switch(d.key){case"ArrowRight":case"ArrowUp":m=1;break;case"ArrowLeft":case"ArrowDown":m=-1;break;case"PageUp":m=5;break;case"PageDown":m=-5;break;case"Home":g=!0;break;case"End":R=!0;break;default:return}if(d.preventDefault(),i==="macro-low"){const U=ae(O,je),H=ae(O,Oe);if(It){const v=br(ve,O,U,ve[0],H,m,g,R);if(v===be(ve,U,O))return;const ue=ve[v];St(ue,H,!0),_t(ue,H);return}let N;if(g?N=Re:R?N=Oe:N=Math.max(Re,Math.min(Oe,je+m)),N===je)return;const J=ae(O,N);St(J,H,!0),_t(J,H)}else if(i==="macro-high"){const U=ae(O,je),H=ae(O,Oe);if(It){const v=br(ve,O,H,U,ve[ve.length-1],m,g,R);if(v===be(ve,H,O))return;const ue=ve[v];St(U,ue,!0),_t(U,ue);return}let N;if(g?N=je:R?N=et:N=Math.max(je,Math.min(et,Oe+m)),N===Oe)return;const J=ae(O,N);St(U,J,!0),_t(U,J)}else if(i==="micro-low"){const U=ae(x,$e),H=ae(x,Fe);if(tt){const J=br(le,x,U,le[0],H,m,g,R);if(J===be(le,U,x))return;Je(le[J],H,!0);return}let N;if(g?N=De:R?N=Fe:N=Math.max(De,Math.min(Fe,$e+m)),N===$e)return;Je(ae(x,N),H,!0)}else if(i==="micro-high"){const U=ae(x,$e),H=ae(x,Fe);if(tt){const J=br(le,x,H,U,le[le.length-1],m,g,R);if(J===be(le,H,x))return;Je(U,le[J],!0);return}let N;if(g?N=$e:R?N=Te:N=Math.max($e,Math.min(Te,Fe+m)),N===Fe)return;Je(U,ae(x,N),!0)}else if(i==="micro-point"){const U=ae(x,$e);if(tt){const N=br(le,x,U,le[0],le[le.length-1],m,g,R);if(N===be(le,U,x))return;Dn(le[N],!0);return}let H;if(g?H=De:R?H=Te:H=Math.max(De,Math.min(Te,$e+m)),H===$e)return;Dn(ae(x,H),!0)}},Bo=i=>{if(e.mode!=="vernier")return;if(It){const H=ve.length-1,N=be(ve,wt,O),J=be(ve,At,O),v=J-N;let ue=N+i,Ie=J+i;if(i<0&&ue<0?(ue=0,Ie=Math.min(H,v)):i>0&&Ie>H&&(Ie=H,ue=Math.max(0,H-v)),ue===N&&Ie===J)return;const lt=ve[ue],Pe=ve[Ie];St(lt,Pe,!0),_t(lt,Pe);return}const d=Oe-je;let m=je+i,g=Oe+i;if(i<0&&m<Re?(m=Re,g=Math.min(et,m+d)):i>0&&g>et&&(g=et,m=Math.max(Re,g-d)),m===je&&g===Oe)return;const R=ae(O,m),U=ae(O,g);St(R,U,!0),_t(R,U)},nn=o.useCallback(i=>{const d=q.current;if(!d.disabled)if(d.mode==="point"){const m=Math.max(E,Math.min(P,fe+i));Ve||X([m,m]),ut(m,m,!0)}else if(d.mode==="vernier"){if(tt){const v=le.length-1,ue=be(le,Rt,x),Ie=be(le,Tt,x),lt=Ie-ue;let Pe=ue+i,pe=Ie+i;i<0&&Pe<0?(Pe=0,pe=Math.min(v,lt)):i>0&&pe>v&&(pe=v,Pe=Math.max(0,v-lt)),(Pe!==ue||pe!==Ie)&&Je(le[Pe],le[pe],!0);return}const m=$e,g=Fe,R=De,U=Te,H=g-m;let N=m+i,J=g+i;i<0&&N<R?(N=R,J=Math.min(U,N+H)):i>0&&J>U&&(J=U,N=Math.max(R,J-H)),(N!==m||J!==g)&&Je(ae(x,N),ae(x,J),!0)}else{const m=we-fe;let g=fe+i,R=we+i;i<0&&g<E?(g=E,R=Math.min(P,g+m)):i>0&&R>P&&(R=P,g=Math.max(E,R-m)),g<=R&&(Ve||X([g,R]),ut(g,R,!0))}},[fe,we,E,P,Ve,ut,Je,$e,Fe,De,Te,x,tt,le,Rt,Tt]),Vn=i=>{if(l||!i.shiftKey)return;const d=vo(i.deltaX,i.deltaY,s);if(d===0)return;if(i.preventDefault(),!he){nn(d);return}const m=it.current;if(!m)return;const g=m.getBoundingClientRect(),R=s?i.clientX-(g.left+g.width/2):i.clientY-(g.top+g.height/2);if(xn(R,kt)==="macro"){Bo(d);return}nn(d)},Hn=o.useRef(Vn);Hn.current=Vn,o.useEffect(()=>{const i=it.current;if(!i)return;const d=m=>Hn.current(m);return i.addEventListener("wheel",d,{passive:!1}),()=>i.removeEventListener("wheel",d)},[]);const Xt=yr(fe),qt=yr(we),on=me(fe),an=me(we),ln=o.useMemo(()=>G?sr===null?void 0:{estimatedWidthPx:sr.widthPx,estimatedHeightPx:sr.heightPx}:mn(sr,pn),[G,sr,pn]),Cr=!G&&fe===we,Xe=o.useMemo(()=>{if(G||!L||s)return wn(T,ln);const i=Mn(Xt,qt,Bt,T,ln);return Cr?Do(i):i},[G,Cr,L,s,Xt,qt,Bt,T,ln]),ur=b==="low"||b!=="high"&&Me==="low",dr=!G&&(b==="high"||b!=="low"&&Me==="high"),$r=je===Oe,Pr=!V&&$e===Fe,zo=$r&&ke!=="macro-low",_o=$r&&ke==="macro-low",Xo=Pr&&ke!=="micro-low",qo=Pr&&ke==="micro-low",jn=I?"top":"bottom",On=I?"bottom":"top",Fn=o.useMemo(()=>mn(yn,Rn),[yn,Rn]),Un=o.useMemo(()=>mn(Tn,Sn),[Tn,Sn]),sn=L&&!s,kr=o.useMemo(()=>to(Ae,_e,Bt,jn,Fn,$r,sn),[Ae,_e,Bt,jn,Fn,$r,sn]),Wn=sn&&!V,Ar=o.useMemo(()=>to(rt,Mt,Bt,On,Un,Pr,Wn),[rt,Mt,Bt,On,Un,Pr,Wn]),Ko=o.useMemo(()=>s?{"--ps-tooltip-origin":"100% 50%","--ps-tooltip-tx":"0px","--ps-tooltip-ty":"-50%","--ps-tooltip-rot":"0deg"}:{"--ps-tooltip-origin":"50% 50%","--ps-tooltip-tx":`calc(-50% + ${Xe.lowOffsetX}px)`,"--ps-tooltip-ty":`calc(-50% + ${Xe.lowOffsetY}px)`,"--ps-tooltip-rot":`${Xe.lowAngleDeg}deg`},[s,Xe.lowOffsetX,Xe.lowOffsetY,Xe.lowAngleDeg]),Go=o.useMemo(()=>s?{"--ps-tooltip-origin":"100% 50%","--ps-tooltip-tx":"0px","--ps-tooltip-ty":"-50%","--ps-tooltip-rot":"0deg"}:{"--ps-tooltip-origin":"50% 50%","--ps-tooltip-tx":`calc(-50% + ${Xe.highOffsetX}px)`,"--ps-tooltip-ty":`calc(-50% + ${Xe.highOffsetY}px)`,"--ps-tooltip-rot":`${Xe.highAngleDeg}deg`},[s,Xe.highOffsetX,Xe.highOffsetY,Xe.highAngleDeg]),Ir=Math.min(Xt,qt),Bn=Math.max(Xt,qt),Zo=s?{bottom:`${Ir}%`,height:`${Bn-Ir}%`,top:"auto",left:"0",right:"0"}:{left:`${Ir}%`,width:`${Bn-Ir}%`,top:"0",bottom:"0"},Jo=Math.max(.01,_e-Ae),zn=Math.max(.06,Math.min(.25,.28*Math.sqrt(Jo))),Qo=s?{bottom:`${Xt}%`,left:"50%",transform:"translate(-50%, 50%)",zIndex:ur?40:30}:{left:`${Xt}%`,top:"50%",transform:"translate(-50%, -50%)",zIndex:ur?40:30},ea=s?{bottom:`${qt}%`,left:"50%",transform:"translate(-50%, 50%)",zIndex:dr?40:30}:{left:`${qt}%`,top:"50%",transform:"translate(-50%, -50%)",zIndex:dr?40:30},ta=s?{bottom:`${Ne}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${Ne}%`,top:"50%",transform:"translate(-50%, -50%)"},_n=K!==null?me(K):null,ra=f!=="hover"&&K!==null&&(K===fe||!G&&K===we),na=tt?de(x,le[0]):De,oa=tt?de(x,le[le.length-1]):Te,aa=l||(he?$e<=na:G?fe<=E:fe<=E&&we<=E),ia=l||(he?Fe>=oa:(G||fe>=P)&&we>=P),mt=V?"micro-point":"micro-low",Lt=l?"cursor-not-allowed opacity-50":"cursor-pointer",Xn=i=>{const d=s?"vertical":"horizontal",m=i==="decrease",g=Ma[d][i];return h.jsx("button",{type:"button",className:`period-slider-stepper-btn relative after:absolute after:inset-[-11px] after:content-[''] ${g} flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-slate-300 bg-white font-bold text-[10px] text-slate-700 leading-none shadow-2xs transition-all hover:bg-slate-100 hover:text-indigo-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 active:scale-95 disabled:cursor-not-allowed disabled:opacity-30 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 ${Lt}`,onClick:()=>nn(m?-1:1),disabled:m?aa:ia,"aria-label":m?ce:oe,children:wa[d][i]})};return h.jsxs("div",{style:e.style,className:`period-slider flex select-none items-center gap-2 ${s?"flex-col":"flex-row"} ${u}`,"data-disabled":l?"true":void 0,"data-unit":t,"data-mode":e.mode,"data-orientation":s?"vertical":"horizontal","data-label-position":T,"data-color-scheme":ne,children:[w&&Xn(s?"increase":"decrease"),h.jsx("div",{ref:it,"data-testid":"period-slider-track","data-orientation":s?"vertical":"horizontal","data-vernier-orientation":he?kt:void 0,className:`period-slider-track relative flex-1 touch-none rounded-full bg-slate-200 dark:bg-slate-700 ${s?"h-48 w-2":"h-2 w-full"} ${Lt}`,onPointerDown:Fo,onPointerMove:Uo,onPointerLeave:Wo,children:he?h.jsxs(h.Fragment,{children:[zr&&(s?h.jsxs("svg",{className:"period-slider-vernier-projection is-vertical",role:"presentation","aria-hidden":"true",width:"32",height:"100%",viewBox:"0 0 32 100",preserveAspectRatio:"none",children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:te,x1:"0",y1:"0",x2:"1",y2:"0",children:[h.jsx("stop",{offset:"0%",stopColor:I?W.macro:W.micro,stopOpacity:"0.28"}),h.jsx("stop",{offset:"100%",stopColor:I?W.micro:W.macro,stopOpacity:zn})]})}),h.jsx("polygon",{points:I?`12,${(1-_e)*100} 12,${(1-Ae)*100} 20,100 20,0`:`12,0 12,100 20,${(1-Ae)*100} 20,${(1-_e)*100}`,fill:`url(#${te})`})]}):h.jsxs("svg",{className:"period-slider-vernier-projection",role:"presentation","aria-hidden":"true",width:"100%",height:"32",viewBox:"0 0 100 32",preserveAspectRatio:"none",children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:te,x1:"0",y1:"0",x2:"0",y2:"1",children:[h.jsx("stop",{offset:"0%",stopColor:I?W.macro:W.micro,stopOpacity:"0.28"}),h.jsx("stop",{offset:"100%",stopColor:I?W.micro:W.macro,stopOpacity:zn})]})}),h.jsx("polygon",{points:I?`${Ae*100},12 ${_e*100},12 100,20 0,20`:`0,12 100,12 ${_e*100},20 ${Ae*100},20`,fill:`url(#${te})`})]})),!k&&h.jsxs(h.Fragment,{children:[h.jsx("div",{"data-testid":"period-slider-connect-macro",className:"period-slider-connect-macro",style:s?{bottom:`calc(${Ae*100}% - 8px)`,height:`calc(${Math.max(0,(_e-Ae)*100)}% + 16px)`}:{left:`calc(${Ae*100}% - 8px)`,width:`calc(${Math.max(0,(_e-Ae)*100)}% + 16px)`},onPointerDown:zt("macro-connect")}),!V&&h.jsx("div",{"data-testid":"period-slider-connect-micro",className:"period-slider-connect-micro",style:s?{bottom:`calc(${rt*100}% - 8px)`,height:`calc(${Math.max(0,(Mt-rt)*100)}% + 16px)`}:{left:`calc(${rt*100}% - 8px)`,width:`calc(${Math.max(0,(Mt-rt)*100)}% + 16px)`},onPointerDown:zt("micro-connect")})]}),_r&&h.jsxs("div",{className:"period-slider-vernier-ticks pointer-events-none absolute inset-0",children:[[.2,.4,.6,.8].map(i=>h.jsx("div",{"data-testid":"period-slider-tick","data-tick-scale":"macro",className:"period-slider-tick period-slider-tick-macro",style:s?{bottom:`${i*100}%`}:{left:`${i*100}%`}},`macro-tick-${i}`)),[.1,.2,.3,.4,.5,.6,.7,.8,.9].map(i=>h.jsx("div",{"data-testid":"period-slider-tick","data-tick-scale":"micro",className:"period-slider-tick period-slider-tick-micro",style:s?{bottom:`${i*100}%`}:{left:`${i*100}%`}},`micro-tick-${i}`))]}),h.jsxs("div",{tabIndex:l?-1:0,role:"slider","aria-label":e.macroLowerAriaLabel??"Macro range start","aria-disabled":l?"true":void 0,"aria-valuemin":Re,"aria-valuemax":Oe,"aria-valuenow":je,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(wt,O):Yt(O,wt,ct,C),"aria-orientation":s?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${s?"is-vertical":""} group absolute touch-none ${s?I?"after:absolute after:-inset-y-3 after:right-0 after:-left-4":"after:absolute after:-inset-y-3 after:-right-4 after:left-0":I?"after:absolute after:-inset-x-3 after:-top-4 after:bottom-0":"after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${Lt}`,style:s?{bottom:`${Ae*100}%`,left:I?0:"auto",right:I?"auto":0,transform:I?"translate(-100%, 50%)":"translate(100%, 50%)",zIndex:ze==="macro-low"||ke==="macro-low"?30:15}:{left:`${Ae*100}%`,top:I?0:"auto",bottom:I?"auto":0,transform:I?"translate(-50%, -100%)":"translate(-50%, 100%)",zIndex:ze==="macro-low"||ke==="macro-low"?30:15},onPointerDown:zt("macro-low"),onKeyDown:Lr("macro-low"),onFocus:Sr("macro-low"),"data-active":ze==="macro-low"?"true":void 0,"data-front":ke==="macro-low"?"true":void 0,"data-vernier-pos":s?I?"left":"right":I?"top":"bottom","data-handle-type":"macro-low",children:[h.jsx(Mr,{type:"macro",isTop:I,isVertical:s,isLeft:I}),bt&&h.jsx("div",{className:"period-slider-hairline"}),f!=="hover"&&h.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${f==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":f,"data-duplicate":zo?"true":void 0,"data-slanted":kr.slant.isSlanted?"true":void 0,ref:Yo,style:kr.lowStyle,children:qe(O,wt,ct,C)})]}),h.jsxs("div",{tabIndex:l?-1:0,role:"slider","aria-label":e.macroUpperAriaLabel??"Macro range end","aria-disabled":l?"true":void 0,"aria-valuemin":je,"aria-valuemax":et,"aria-valuenow":Oe,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(At,O):Yt(O,At,ct,C),"aria-orientation":s?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${s?"is-vertical":""} group absolute touch-none ${s?I?"after:absolute after:-inset-y-3 after:right-0 after:-left-4":"after:absolute after:-inset-y-3 after:-right-4 after:left-0":I?"after:absolute after:-inset-x-3 after:-top-4 after:bottom-0":"after:absolute after:-inset-x-3 after:top-0 after:-bottom-4"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${Lt}`,style:s?{bottom:`${_e*100}%`,left:I?0:"auto",right:I?"auto":0,transform:I?"translate(-100%, 50%)":"translate(100%, 50%)",zIndex:ze==="macro-high"||ke==="macro-high"?30:15}:{left:`${_e*100}%`,top:I?0:"auto",bottom:I?"auto":0,transform:I?"translate(-50%, -100%)":"translate(-50%, 100%)",zIndex:ze==="macro-high"||ke==="macro-high"?30:15},onPointerDown:zt("macro-high"),onKeyDown:Lr("macro-high"),onFocus:Sr("macro-high"),"data-active":ze==="macro-high"?"true":void 0,"data-front":ke==="macro-high"?"true":void 0,"data-vernier-pos":s?I?"left":"right":I?"top":"bottom","data-handle-type":"macro-high",children:[h.jsx(Mr,{type:"macro",isTop:I,isVertical:s,isLeft:I}),bt&&h.jsx("div",{className:"period-slider-hairline"}),f!=="hover"&&h.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${f==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":f,"data-duplicate":_o?"true":void 0,"data-slanted":kr.slant.isSlanted?"true":void 0,ref:Vo,style:kr.highStyle,children:qe(O,At,ct,C)})]}),h.jsxs("div",{tabIndex:l?-1:0,role:"slider","aria-label":V?e.pointAriaLabel??"Micro selected date":e.lowerAriaLabel??"Micro range start","aria-disabled":l?"true":void 0,"aria-valuemin":De,"aria-valuemax":V?Te:Fe,"aria-valuenow":$e,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(Rt,x):Yt(x,Rt,Qe,C),"aria-orientation":s?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${s?"is-vertical":""} group absolute touch-none ${s?I?"after:absolute after:-inset-y-3 after:-right-4 after:left-0":"after:absolute after:-inset-y-3 after:right-0 after:-left-4":I?"after:absolute after:-inset-x-3 after:top-0 after:-bottom-4":"after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${Lt}`,style:s?{bottom:`${rt*100}%`,left:I?"auto":0,right:I?0:"auto",transform:I?"translate(100%, 50%)":"translate(-100%, 50%)",zIndex:ze===mt||ke===mt?30:20}:{left:`${rt*100}%`,top:I?"auto":0,bottom:I?0:"auto",transform:I?"translate(-50%, 100%)":"translate(-50%, -100%)",zIndex:ze===mt||ke===mt?30:20},onPointerDown:zt(mt),onKeyDown:Lr(mt),onFocus:Sr(mt),"data-active":ze===mt?"true":void 0,"data-front":ke===mt?"true":void 0,"data-vernier-pos":s?I?"right":"left":I?"bottom":"top","data-handle-type":mt,children:[h.jsx(Mr,{type:"micro",isTop:!I,isVertical:s,isLeft:!I}),bt&&h.jsx("div",{className:"period-slider-hairline"}),f!=="hover"&&h.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${f==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":f,"data-duplicate":Xo?"true":void 0,"data-slanted":Ar.slant.isSlanted?"true":void 0,ref:Ho,style:Ar.lowStyle,children:qe(x,Rt,Qe,C)})]}),!V&&h.jsxs("div",{tabIndex:l?-1:0,role:"slider","aria-label":e.upperAriaLabel??"Micro range end","aria-disabled":l?"true":void 0,"aria-valuemin":$e,"aria-valuemax":Te,"aria-valuenow":Fe,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(Tt,x):Yt(x,Tt,Qe,C),"aria-orientation":s?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${s?"is-vertical":""} group absolute touch-none ${s?I?"after:absolute after:-inset-y-3 after:-right-4 after:left-0":"after:absolute after:-inset-y-3 after:right-0 after:-left-4":I?"after:absolute after:-inset-x-3 after:top-0 after:-bottom-4":"after:absolute after:-inset-x-3 after:-top-4 after:bottom-0"} after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 ${Lt}`,style:s?{bottom:`${Mt*100}%`,left:I?"auto":0,right:I?0:"auto",transform:I?"translate(100%, 50%)":"translate(-100%, 50%)",zIndex:ze==="micro-high"||ke==="micro-high"?30:20}:{left:`${Mt*100}%`,top:I?"auto":0,bottom:I?0:"auto",transform:I?"translate(-50%, 100%)":"translate(-50%, -100%)",zIndex:ze==="micro-high"||ke==="micro-high"?30:20},onPointerDown:zt("micro-high"),onKeyDown:Lr("micro-high"),onFocus:Sr("micro-high"),"data-active":ze==="micro-high"?"true":void 0,"data-front":ke==="micro-high"?"true":void 0,"data-vernier-pos":s?I?"right":"left":I?"bottom":"top","data-handle-type":"micro-high",children:[h.jsx(Mr,{type:"micro",isTop:!I,isVertical:s,isLeft:!I}),bt&&h.jsx("div",{className:"period-slider-hairline"}),f!=="hover"&&h.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${f==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":f,"data-duplicate":qo?"true":void 0,"data-slanted":Ar.slant.isSlanted?"true":void 0,ref:jo,style:Ar.highStyle,children:qe(x,Tt,Qe,C)})]})]}):h.jsxs(h.Fragment,{children:[!k&&h.jsx("div",{"data-testid":"period-slider-connect",className:"period-slider-connect absolute rounded-full",style:Zo,onPointerDown:Oo}),ee&&y&&D.length>1&&h.jsx("div",{className:"period-slider-ticks pointer-events-none absolute inset-0",children:D.map((i,d)=>{const m=de(t,i),g=yr(d),R=s?{bottom:`${g}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${g}%`,top:"50%",transform:"translate(-50%, -50%)"};return h.jsx("div",{"data-testid":"period-slider-tick",className:"period-slider-tick absolute h-1.5 w-1.5 rounded-full bg-slate-400/60 dark:bg-slate-500/60",style:R},`tick-${m}`)})}),!l&&K!==null&&Ne!==null&&b===null&&_n&&h.jsxs("div",{"data-testid":"period-slider-hover-guide",className:"period-slider-hover-guide pointer-events-none absolute h-2 w-2",style:ta,children:[h.jsx("div",{"data-testid":"period-slider-hover-dot",className:"period-slider-hover-dot h-full w-full rounded-full border border-white/80 bg-[var(--aqps-accent-light)] shadow-[0_0_6px_var(--aqps-accent-glow)] dark:border-slate-800"}),h.jsx("div",{"data-testid":"period-slider-hover-tooltip","data-duplicate":ra?"true":void 0,className:`period-slider-hover-tooltip ${T==="bottom"&&!s?"period-slider-hover-tooltip-bottom":""} rounded bg-slate-800/90 px-2 py-0.5 font-medium text-white text-xs shadow-lg backdrop-blur-xs dark:bg-slate-900/90`,children:qe(t,_n,e.formatLabel,C)})]}),h.jsxs("div",{tabIndex:l?-1:0,role:"slider","aria-label":G?e.pointAriaLabel??"Selected date":e.lowerAriaLabel??"Range start","aria-disabled":l?"true":void 0,"aria-valuemin":E,"aria-valuemax":G?P:we,"aria-valuenow":fe,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(on,t):Yt(t,on,e.formatLabel,C),"aria-orientation":s?"vertical":"horizontal",className:`period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${Lt}`,style:Qo,onPointerDown:En("low"),onKeyDown:Yn("low"),onFocus:Nn("low"),"data-active":b==="low"?"true":void 0,"data-front":ur?"true":void 0,children:[h.jsx("div",{"data-testid":"period-slider-knob",className:`period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${b==="low"?"":"shadow-md"}`}),f!=="hover"&&h.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${f==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":f,"data-label-position":T,"data-slanted":Xe.isSlanted?"true":void 0,"data-front":ur?"true":void 0,"data-duplicate":Cr&&!ur?"true":void 0,ref:Eo,style:Ko,children:qe(t,on,e.formatLabel,C)})]}),!G&&h.jsxs("div",{tabIndex:l?-1:0,role:"slider","aria-label":e.upperAriaLabel??"Range end","aria-disabled":l?"true":void 0,"aria-valuemin":fe,"aria-valuemax":P,"aria-valuenow":we,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(an,t):Yt(t,an,e.formatLabel,C),"aria-orientation":s?"vertical":"horizontal",className:`period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:outline-none ${Lt}`,style:ea,onPointerDown:En("high"),onKeyDown:Yn("high"),onFocus:Nn("high"),"data-active":b==="high"?"true":void 0,"data-front":dr?"true":void 0,children:[h.jsx("div",{"data-testid":"period-slider-knob",className:`period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] ${b==="high"?"":"shadow-md"}`}),f!=="hover"&&h.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${f==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":f,"data-label-position":T,"data-slanted":Xe.isSlanted?"true":void 0,"data-front":dr?"true":void 0,"data-duplicate":Cr&&!dr?"true":void 0,ref:No,style:Go,children:qe(t,an,e.formatLabel,C)})]})]})}),w&&Xn(s?"decrease":"increase")]})},fn=(e,t)=>{if(e===t)return!0;if(!(e&&t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r].getTime()!==t[r].getTime())return!1;return!0},To=(e,t)=>{if(e===t)return!0;if(!(e&&t))return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const a of r)if(e[a]!==t[a])return!1;return!0},Da=(e,t)=>e===t?!0:e.mode!==t.mode||e.unit!==t.unit||e.minDate.getTime()!==t.minDate.getTime()||e.maxDate.getTime()!==t.maxDate.getTime()||e.labelPosition!==t.labelPosition||e.autoSlantLabels!==t.autoSlantLabels||e.isVertical!==t.isVertical||e.hideConnectBar!==t.hideConnectBar||e.showTicks!==t.showTicks||e.disabled!==t.disabled||e.showStepper!==t.showStepper||e.debounceMs!==t.debounceMs||e.tooltipStyle!==t.tooltipStyle||e.colorScheme!==t.colorScheme||e.className!==t.className||!To(e.style,t.style)||e.snapMode!==t.snapMode||e.formatLabel!==t.formatLabel||e.locale!==t.locale||e.lowerAriaLabel!==t.lowerAriaLabel||e.upperAriaLabel!==t.upperAriaLabel||e.pointAriaLabel!==t.pointAriaLabel||e.macroLowerAriaLabel!==t.macroLowerAriaLabel||e.macroUpperAriaLabel!==t.macroUpperAriaLabel||e.decreaseAriaLabel!==t.decreaseAriaLabel||e.increaseAriaLabel!==t.increaseAriaLabel||e.formatAriaValueText!==t.formatAriaValueText||!fn(e.allowedDates,t.allowedDates)?!1:e.mode==="point"&&t.mode==="point"?!((e.value?.getTime()??null)!==(t.value?.getTime()??null)||(e.defaultValue?.getTime()??null)!==(t.defaultValue?.getTime()??null)||e.onChangePoint!==t.onChangePoint):e.mode==="range"&&t.mode==="range"?!((e.range?.[0]?.getTime()??null)!==(t.range?.[0]?.getTime()??null)||(e.range?.[1]?.getTime()??null)!==(t.range?.[1]?.getTime()??null)||(e.defaultRange?.[0]?.getTime()??null)!==(t.defaultRange?.[0]?.getTime()??null)||(e.defaultRange?.[1]?.getTime()??null)!==(t.defaultRange?.[1]?.getTime()??null)||e.onChangeRange!==t.onChangeRange):e.mode==="vernier"&&t.mode==="vernier"?!((e.microRange?.[0]?.getTime()??null)!==(t.microRange?.[0]?.getTime()??null)||(e.microRange?.[1]?.getTime()??null)!==(t.microRange?.[1]?.getTime()??null)||(e.defaultMicroRange?.[0]?.getTime()??null)!==(t.defaultMicroRange?.[0]?.getTime()??null)||(e.defaultMicroRange?.[1]?.getTime()??null)!==(t.defaultMicroRange?.[1]?.getTime()??null)||(e.microValue?.getTime()??null)!==(t.microValue?.getTime()??null)||(e.defaultMicroValue?.getTime()??null)!==(t.defaultMicroValue?.getTime()??null)||e.macroRange[0].getTime()!==t.macroRange[0].getTime()||e.macroRange[1].getTime()!==t.macroRange[1].getTime()||e.vernierOrientation!==t.vernierOrientation||e.showVernierProjection!==t.showVernierProjection||e.showVernierTicks!==t.showVernierTicks||e.showHairline!==t.showHairline||e.macroUnit!==t.macroUnit||e.microUnit!==t.microUnit||e.macroIsDiscrete!==t.macroIsDiscrete||e.microIsDiscrete!==t.microIsDiscrete||e.formatMacroLabel!==t.formatMacroLabel||e.formatMicroLabel!==t.formatMicroLabel||e.onChangeMicroRange!==t.onChangeMicroRange||e.onChangeMicroPoint!==t.onChangeMicroPoint||e.onChangeMacroRange!==t.onChangeMacroRange||!fn(e.macroAllowedDates,t.macroAllowedDates)||!fn(e.microAllowedDates,t.microAllowedDates)):!1,So=o.memo(xa,Da);So.displayName="PeriodSlider";const gt=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t},xr=(e,t)=>{if(Number.isNaN(t.getTime()))throw new RangeError(`DateSelector: "${e}" must be a valid Date (received ${String(t)})`)},va=e=>{if(e!==void 0)try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{throw new RangeError(`DateSelector: "locale" must be a valid BCP 47 language tag (received ${JSON.stringify(e)})`)}},Ht=(e,t,r)=>{const n=new Date(e,t-1,r);return n.setFullYear(e),n.setHours(0,0,0,0),n},ro=e=>Ht(e,1,1),pa=e=>Ht(e,12,31),ya={year:{year:"numeric"},month:{month:"2-digit"},day:{day:"2-digit"}},Ra={year:4,month:2,day:2},Ta={year:e=>e.getFullYear(),month:e=>e.getMonth()+1,day:e=>e.getDate()},no=new Map,Sa=(e,t)=>{const r=`${e}\0${t}`,n=no.get(r);if(n!==void 0)return n;const a=new Intl.DateTimeFormat(t,ya[e]);return no.set(r,a),a},gn=(e,t,r)=>r===void 0?String(Ta[e](t)).padStart(Ra[e],"0"):Sa(e,r).format(t),La=(e,t,r)=>{const n=t?.getTime()??null,a=r?.getTime()??null,c=new Map;return e.forEach((l,u)=>{xr(`allowedDates[${u}]`,l);const w=gt(l),f=w.getTime();n!==null&&f<n||a!==null&&f>a||c.has(f)||c.set(f,w)}),Array.from(c.keys()).sort((l,u)=>l-u).map(l=>c.get(l))},Ca=(e,t)=>{const r=[];let n=gt(e);const a=gt(t).getTime();for(;n.getTime()<=a;)r.push(n),n=Ye.addDays(n,1);return r},oo=(e,t)=>{const r=[];for(let n=e.length-1;n>=0;n--)r.push({label:qe("day",e[n],void 0,t),value:Ye.format(e[n],"yyyy-MM-dd")});return r},$a=e=>{const{value:t,initialDate:r,onChange:n,children:a,minYear:c,maxYear:l,minDate:u,maxDate:w,allowedDates:f,variant:T="date",className:L="",style:s,disabled:k=!1,prevDateAriaLabel:ee="Previous day",nextDateAriaLabel:ne="Next day",selectAriaLabel:C="Date",yearAriaLabel:ce="Year",monthAriaLabel:oe="Month",dayAriaLabel:$="Day",locale:V,formatYearOption:W,formatMonthOption:te,formatDayOption:q}=e;if(va(V),t!==void 0&&xr("value",t),r!==void 0&&xr("initialDate",r),u!==void 0&&xr("minDate",u),w!==void 0&&xr("maxDate",w),c!==void 0&&!Number.isInteger(c))throw new RangeError(`DateSelector: "minYear" must be an integer year (received ${String(c)})`);if(l!==void 0&&!Number.isInteger(l))throw new RangeError(`DateSelector: "maxYear" must be an integer year (received ${String(l)})`);if(T==="split-dropdown"&&f!==void 0)throw new RangeError('DateSelector: variant="split-dropdown" cannot honour "allowedDates"; use variant="dropdown" or variant="date" for a discrete date set');const F=t??r;if(F===void 0)throw new RangeError("DateSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected date is never inferred from the wall clock.");const[p,D]=o.useState(()=>gt(F)),y=t!==void 0,E=t?.getTime(),P=o.useMemo(()=>t!==void 0?gt(t):p,[E,p]),G=u?.getTime(),me=w?.getTime(),B=o.useMemo(()=>{const M=u?gt(u):null,Y=c!==void 0?ro(c):null;return M===null?Y:Y===null||M.getTime()>=Y.getTime()?M:Y},[G,c]),Z=o.useMemo(()=>{const M=w?gt(w):null,Y=l!==void 0?pa(l):null;return M===null?Y:Y===null||M.getTime()<=Y.getTime()?M:Y},[me,l]),se=B?.getTime()??null,_=Z?.getTime()??null;if(B!==null&&Z!==null&&B.getTime()>Z.getTime())throw new RangeError(`DateSelector: the resolved range is empty (min ${Ye.format(B,"yyyy-MM-dd")} is after max ${Ye.format(Z,"yyyy-MM-dd")})`);if(T!=="date"&&f===void 0&&(B===null||Z===null))throw new RangeError(`DateSelector: variant="${T}" needs a bounded range; supply minDate/minYear and maxDate/maxYear${T==="dropdown"?' or supply "allowedDates"':""}`);const z=f===void 0?null:f.map(M=>M.getTime()).join(","),re=o.useMemo(()=>f===void 0?null:La(f,B,Z),[z,se,_]),ie=M=>{const Y=M.getTime();return re!==null?re.some(Be=>Be.getTime()===Y):!(se!==null&&Y<se||_!==null&&Y>_)},We=F.getTime();o.useEffect(()=>{y||D(gt(F))},[y,We]);const Se=M=>{if(k)return;const Y=gt(M);ie(Y)&&(y||D(Y),n?.(Y))},Le=P.getTime(),ye=ie(P),Ge=o.useMemo(()=>{if(re!==null){for(let Y=re.length-1;Y>=0;Y--)if(re[Y].getTime()<Le)return re[Y];return null}const M=Ye.addDays(new Date(Le),-1);return ie(M)?M:null},[re,Le,se,_]),Ze=o.useMemo(()=>{if(re!==null){for(const Y of re)if(Y.getTime()>Le)return Y;return null}const M=Ye.addDays(new Date(Le),1);return ie(M)?M:null},[re,Le,se,_]),at=k||Ge===null,Ve=k||Ze===null,st=()=>{Ge!==null&&Se(Ge)},X=()=>{Ze!==null&&Se(Ze)},Q=M=>{if(M.target.value){const Y=Ye.parseISO(M.target.value);Number.isNaN(Y.getTime())||Se(Y)}},ge=M=>{if(M.target.value){const Y=Ye.parseISO(M.target.value);Number.isNaN(Y.getTime())||Se(Y)}},b=P.getFullYear(),S=P.getMonth()+1,j=P.getDate(),Me=o.useMemo(()=>T!=="dropdown"?[]:re!==null?oo(re,V):B===null||Z===null?[]:oo(Ca(B,Z),V),[T,re,se,_,V]),A=o.useMemo(()=>{if(T!=="split-dropdown"||B===null||Z===null)return[];const M=[];for(let Y=Z.getFullYear();Y>=B.getFullYear();Y--)M.push(Y);return M},[T,se,_]),K=o.useMemo(()=>{if(T!=="split-dropdown"||B===null||Z===null)return[];const M=B,Y=Z,Be=b===M.getFullYear()?M.getMonth()+1:1,jt=b===Y.getFullYear()?Y.getMonth()+1:12,ct=[];for(let Qe=Be;Qe<=jt;Qe++)ct.push(Qe);return ct},[T,se,_,b]),Ce=o.useMemo(()=>{if(T!=="split-dropdown"||B===null||Z===null)return[];const M=B,Y=Z,Be=b===M.getFullYear()&&S===M.getMonth()+1?M.getDate():1,jt=b===Y.getFullYear()&&S===Y.getMonth()+1?Y.getDate():Ye.getDaysInMonth(new Date(Le)),ct=[];for(let Qe=Be;Qe<=jt;Qe++)ct.push(Qe);return ct},[T,se,_,Le,b,S]),Ne=(M,Y,Be)=>Be>Ye.getDaysInMonth(Ht(M,Y,1))?!1:ie(Ht(M,Y,Be)),He=(M,Y,Be)=>{Ne(M,Y,Be)&&Se(Ht(M,Y,Be))},fe=M=>W?W(M):gn("year",ro(M),V),we=M=>te?te(M):gn("month",Ht(b,M,1),V),or=M=>q?q(M):gn("day",Ht(b,S,M),V),he=Ye.format(P,"yyyy-MM-dd"),kt=qe("day",P,void 0,V),I=B?Ye.format(B,"yyyy-MM-dd"):void 0,zr=Z?Ye.format(Z,"yyyy-MM-dd"):void 0,_r=ye?he:"",bt="text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400",O=T==="split-dropdown"?"w-auto":"w-38";return h.jsxs("div",{className:`inline-flex items-center ${O} ${L}`,style:s,"data-variant":T,"data-out-of-range":ye?void 0:"true",children:[h.jsx("button",{type:"button","aria-label":ee,disabled:at,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:st,children:h.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200"})}),T==="dropdown"?h.jsxs("select",{"aria-label":C,disabled:k,className:"mx-1 my-auto w-28 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500",value:_r,onChange:ge,children:[ye?null:h.jsx("option",{value:"",disabled:!0,className:bt,children:kt}),Me.map(M=>h.jsx("option",{value:M.value,className:"text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100",children:M.label},M.value))]}):T==="split-dropdown"?h.jsxs("div",{className:"mx-1 my-auto inline-flex items-center gap-1",children:[h.jsxs("select",{"aria-label":ce,disabled:k,className:"rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",value:ye?b:"",onChange:M=>He(Number(M.target.value),S,j),children:[ye?null:h.jsx("option",{value:"",disabled:!0,className:bt,children:fe(b)}),A.map(M=>h.jsx("option",{value:M,disabled:!Ne(M,S,j),className:"dark:bg-slate-700 dark:text-slate-100",children:fe(M)},M))]}),h.jsxs("select",{"aria-label":oe,disabled:k,className:"rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",value:ye?S:"",onChange:M=>He(b,Number(M.target.value),j),children:[ye?null:h.jsx("option",{value:"",disabled:!0,className:bt,children:we(S)}),K.map(M=>h.jsx("option",{value:M,disabled:!Ne(b,M,j),className:"dark:bg-slate-700 dark:text-slate-100",children:we(M)},M))]}),h.jsxs("select",{"aria-label":$,disabled:k,className:"rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",value:ye?j:"",onChange:M=>He(b,S,Number(M.target.value)),children:[ye?null:h.jsx("option",{value:"",disabled:!0,className:bt,children:or(j)}),Ce.map(M=>h.jsx("option",{value:M,className:"dark:bg-slate-700 dark:text-slate-100",children:or(M)},M))]})]}):h.jsx("input",{"aria-label":C,disabled:k,className:"period-slider-native-date-field mx-1 my-auto w-28 rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500 dark:placeholder:text-gray-400",value:he,min:I,max:zr,onChange:Q,type:"date"}),h.jsx("button",{type:"button","aria-label":ne,disabled:Ve,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:X,children:h.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200"})}),a]})},tr=e=>e===void 0?null:gt(e).getTime(),Lo=o.memo($a,(e,t)=>!(tr(e.value??e.initialDate)!==tr(t.value??t.initialDate)||tr(e.minDate)!==tr(t.minDate)||tr(e.maxDate)!==tr(t.maxDate)||e.variant!==t.variant||e.disabled!==t.disabled||e.className!==t.className||e.style!==t.style||e.minYear!==t.minYear||e.maxYear!==t.maxYear||e.onChange!==t.onChange||e.allowedDates!==t.allowedDates||e.children!==t.children||e.prevDateAriaLabel!==t.prevDateAriaLabel||e.nextDateAriaLabel!==t.nextDateAriaLabel||e.selectAriaLabel!==t.selectAriaLabel||e.yearAriaLabel!==t.yearAriaLabel||e.monthAriaLabel!==t.monthAriaLabel||e.dayAriaLabel!==t.dayAriaLabel||e.locale!==t.locale||e.formatYearOption!==t.formatYearOption||e.formatMonthOption!==t.formatMonthOption||e.formatDayOption!==t.formatDayOption));Lo.displayName="DateSelector";function nt(e,t){const r=e+Math.floor(t/12),n=(t%12+12)%12,a=new Date(r,n,1);return a.setFullYear(r),a}function Vt(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function wr(e,t){if(e!==void 0&&(!(e instanceof Date)||Number.isNaN(e.getTime())))throw new RangeError(`MonthSelector: \`${t}\` must be a valid Date, received ${String(e)}.`)}function ao(e,t){if(e!==void 0&&!Number.isInteger(e))throw new RangeError(`MonthSelector: \`${t}\` must be an integer year, received ${String(e)}.`)}function Pa(e){if(e!==void 0)try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{throw new RangeError(`MonthSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`)}}function ka(e,t){const r=e===void 0?null:nt(e,0),n=t===void 0?null:nt(t.getFullYear(),t.getMonth());return r!==null&&n!==null?r>=n?r:n:r!==null?r:n}function Aa(e,t){const r=e===void 0?null:nt(e,11),n=t===void 0?null:nt(t.getFullYear(),t.getMonth());return r!==null&&n!==null?r<=n?r:n:r!==null?r:n}function Ia(e,t,r){const n=new Map;for(const a of e){const c=nt(a.getFullYear(),a.getMonth());t!==null&&c<t||r!==null&&c>r||n.has(c.getTime())||n.set(c.getTime(),c)}return Array.from(n.values()).sort((a,c)=>a.getTime()-c.getTime())}function Ea(e,t){const r=e.getFullYear()*12+e.getMonth(),n=t.getFullYear()*12+t.getMonth(),a=[];for(let c=r;c<=n;c++)a.push(nt(Math.floor(c/12),c%12));return a}function io(e,t){const r=[];for(let n=e.length-1;n>=0;n--)r.push({label:qe("month",e[n],void 0,t),value:Vt(e[n])});return r}const Na=e=>{const{value:t,initialDate:r,onChange:n,children:a,variant:c="date",minYear:l,maxYear:u,minDate:w,maxDate:f,allowedMonths:T,isWarning:L=!1,className:s="",style:k,disabled:ee=!1,prevMonthAriaLabel:ne="Previous month",nextMonthAriaLabel:C="Next month",selectAriaLabel:ce="Month",locale:oe}=e;Pa(oe),wr(t,"value"),wr(r,"initialDate"),wr(w,"minDate"),wr(f,"maxDate"),ao(l,"minYear"),ao(u,"maxYear"),T?.forEach((A,K)=>{wr(A,`allowedMonths[${K}]`)});const $=t??r;if($===void 0)throw new RangeError("MonthSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected month is never inferred from the wall clock.");const[V,W]=o.useState(()=>nt($.getFullYear(),$.getMonth())),te=t!==void 0,q=o.useMemo(()=>t!==void 0?nt(t.getFullYear(),t.getMonth()):V,[t?.getTime(),V]),F=w?.getTime(),p=f?.getTime(),D=o.useMemo(()=>ka(l,w),[l,F]),y=o.useMemo(()=>Aa(u,f),[u,p]),E=D?.getTime()??null,P=y?.getTime()??null;if(D!==null&&y!==null&&D>y)throw new RangeError(`MonthSelector: the resolved lower bound ${Vt(D)} is after the resolved upper bound ${Vt(y)}.`);if(c==="dropdown"&&T===void 0&&(D===null||y===null))throw new RangeError('MonthSelector: variant="dropdown" requires a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`), or `allowedMonths`; the option window is never invented.');const G=T===void 0?null:T.map(A=>A.getTime()).join(","),me=o.useMemo(()=>T===void 0?null:Ia(T,D,y),[G,E,P]),B=A=>{const K=A.getTime();return me!==null?me.some(Ce=>Ce.getTime()===K):!(E!==null&&K<E||P!==null&&K>P)},Z=$.getTime();o.useEffect(()=>{if(te)return;const A=nt($.getFullYear(),$.getMonth());W(K=>K.getTime()===A.getTime()?K:A)},[te,Z]);const se=A=>{if(ee)return;if(!B(A))throw new RangeError(`MonthSelector: refusing to emit ${Vt(A)}, which lies outside the selectable months.`);te||W(A);const K=A.getFullYear()*100+(A.getMonth()+1);n?.(A,K)},_=q.getTime(),z=B(q),re=o.useMemo(()=>{if(me!==null){for(let K=me.length-1;K>=0;K--)if(me[K].getTime()<_)return me[K];return null}const A=nt(q.getFullYear(),q.getMonth()-1);return B(A)?A:null},[me,_,E,P]),ie=o.useMemo(()=>{if(me!==null){for(const K of me)if(K.getTime()>_)return K;return null}const A=nt(q.getFullYear(),q.getMonth()+1);return B(A)?A:null},[me,_,E,P]),We=ee||re===null,Se=ee||ie===null,Le=()=>{re!==null&&se(re)},ye=()=>{ie!==null&&se(ie)},Ge=A=>{if(!A)return;const[K,Ce]=A.split("-"),Ne=Number(K),He=Number(Ce)-1;if(!(Number.isInteger(Ne)&&Number.isInteger(He)))return;const fe=nt(Ne,He);B(fe)&&se(fe)},Ze=A=>{Ge(A.target.value)},at=A=>{Ge(A.target.value)},Ve=Vt(q),st=qe("month",q,void 0,oe),X=D?Vt(D):void 0,Q=y?Vt(y):void 0,ge=o.useMemo(()=>c!=="dropdown"?[]:me!==null?io(me,oe):D===null||y===null?[]:io(Ea(D,y),oe),[c,me,E,P,oe]),b=z?Ve:"",S=L?"border-amber-300 bg-amber-50 text-amber-900 focus:border-amber-500 focus:ring-amber-500 dark:border-amber-900/50 dark:bg-amber-950/20 dark:text-amber-200":"border-gray-300 bg-gray-100 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500",j=`period-slider-native-date-field mx-1 my-auto w-28 rounded-md border py-0.5 px-1 text-center font-mono text-xs tabular-nums dark:placeholder:text-gray-400 disabled:opacity-50 ${S}`,Me=`mx-1 my-auto w-28 appearance-none rounded-md border px-1 py-0.5 text-center font-mono text-xs tabular-nums [text-align-last:center] [text-align:center] disabled:opacity-50 ${S}`;return h.jsxs("div",{className:`inline-flex w-38 items-center ${s}`,style:k,"data-out-of-range":z?void 0:"true",children:[h.jsx("button",{type:"button","aria-label":ne,disabled:We,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:Le,children:h.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200"})}),c==="dropdown"?h.jsxs("select",{"aria-label":ce,disabled:ee,className:Me,value:b,onChange:at,children:[z?null:h.jsx("option",{value:"",disabled:!0,className:"text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400",children:st}),ge.map(A=>h.jsx("option",{value:A.value,className:"text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100",children:A.label},A.value))]}):h.jsx("input",{"aria-label":ce,disabled:ee,className:j,value:Ve,min:X,max:Q,onChange:Ze,type:"month"}),h.jsx("button",{type:"button","aria-label":C,disabled:Se,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:ye,children:h.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200"})}),a]})},Co=o.memo(Na,(e,t)=>{const r=e.value??e.initialDate,n=t.value??t.initialDate,a=r?r.getFullYear()*12+r.getMonth():null,c=n?n.getFullYear()*12+n.getMonth():null;if(a!==c||e.variant!==t.variant||e.disabled!==t.disabled||e.className!==t.className||e.style!==t.style||e.isWarning!==t.isWarning||e.minYear!==t.minYear||e.maxYear!==t.maxYear)return!1;const l=e.minDate?e.minDate.getFullYear()*12+e.minDate.getMonth():null,u=t.minDate?t.minDate.getFullYear()*12+t.minDate.getMonth():null;if(l!==u)return!1;const w=e.maxDate?e.maxDate.getFullYear()*12+e.maxDate.getMonth():null,f=t.maxDate?t.maxDate.getFullYear()*12+t.maxDate.getMonth():null;return!(w!==f||e.allowedMonths!==t.allowedMonths||e.onChange!==t.onChange||e.children!==t.children||e.prevMonthAriaLabel!==t.prevMonthAriaLabel||e.nextMonthAriaLabel!==t.nextMonthAriaLabel||e.selectAriaLabel!==t.selectAriaLabel||e.locale!==t.locale)});Co.displayName="MonthSelector";function nr(e,t,r){if(!(r instanceof Date)||Number.isNaN(r.getTime()))throw new RangeError(`${e}: ${t} is required and must be a valid Date (received: ${String(r)})`)}function Wr(e,t,r){if(nr(e,"minDate",t),nr(e,"maxDate",r),r.getTime()<=t.getTime())throw new RangeError(`${e}: maxDate must be strictly later than minDate (minDate: ${t.toISOString()}, maxDate: ${r.toISOString()})`)}function Hr(e,t,r){if(!Array.isArray(r)||r.length!==2)throw new RangeError(`${e}: ${t} is required and must be a [lower, upper] Date tuple (received: ${String(r)})`);if(nr(e,`${t}[0]`,r[0]),nr(e,`${t}[1]`,r[1]),r[0].getTime()>r[1].getTime())throw new RangeError(`${e}: ${t} upper must not be earlier than lower (lower: ${r[0].toISOString()}, upper: ${r[1].toISOString()})`)}function jr(e,t,r,n,a,c){if(r.getTime()<n.getTime()||r.getTime()>a.getTime())throw new RangeError(`${e}: ${t} must lie within ${c} (value: ${r.toISOString()}, lower: ${n.toISOString()}, upper: ${a.toISOString()})`)}function Or(e,t,r,n,a,c){jr(e,`${t}[0]`,r[0],n,a,c),jr(e,`${t}[1]`,r[1],n,a,c)}function Ue(e,t,r){return e<t?t:e>r?r:e}function Fr(e,t,r,n,a,c){if(r!==!0)return[];const l=e[0].getTime(),u=e[1].getTime();return vt(n,t,a,c).filter(w=>w.getTime()>=l&&w.getTime()<=u)}function rr(e,t,r,n){if(n.length===0)return Ue(e,r[0],r[1]);const a=n[be(n,e,t)];return a.getTime()===e.getTime()?e:a}function Yr(e,t,r,n){const a=rr(e[0],t,r,n),c=rr(e[1],t,r,n);return[a,c<a?a:c]}function Ur(e,t,r,n){const a=be(e,r,t)+n;return e[Math.max(0,Math.min(e.length-1,a))]}function Br(e){const t=o.useRef(e),r=t.current,n=e,a=Object.keys(r),c=Object.keys(n);return a.length===c.length&&c.every(u=>Object.is(r[u],n[u]))||(t.current=e),t.current}function Ya(e){const{unit:t,minDate:r,maxDate:n,initialRange:a,onChangeRange:c,...l}=e;Wr("usePeriodSliderRange",r,n),Hr("usePeriodSliderRange","initialRange",a),Or("usePeriodSliderRange","initialRange",a,r,n,"[minDate, maxDate]");const u=Br(l),w=o.useRef(a),[f,T]=o.useState(a);let L=f;const s=[Ue(f[0],r,n),Ue(f[1],r,n)];(s[0]!==f[0]||s[1]!==f[1])&&(L=s,T(s));const k=o.useRef(L);k.current=L;const ee=o.useRef({minDate:r,maxDate:n,allowedDates:u.allowedDates});ee.current={minDate:r,maxDate:n,allowedDates:u.allowedDates};const ne=o.useRef(c);ne.current=c;const C=o.useCallback(p=>{const{minDate:D,maxDate:y}=ee.current,E=Ue(p[0],D,y),P=Ue(p[1],D,y),G=k.current;E.getTime()===G[0].getTime()&&P.getTime()===G[1].getTime()||(k.current=[E,P],T([E,P]),ne.current?.(E,P))},[]),ce=o.useCallback(p=>{const D=k.current,y=p.getTime()>D[1].getTime()?p:D[1];C([p,y])},[C]),oe=o.useCallback(p=>{const D=k.current,y=p.getTime()<D[0].getTime()?p:D[0];C([y,p])},[C]),$=o.useCallback((p,D)=>{C([p,D])},[C]),V=o.useCallback(p=>{const{minDate:D,maxDate:y,allowedDates:E}=ee.current,P=k.current,G=vt(E,t,D,y);if(G.length>0){C([Ur(G,t,P[0],p),Ur(G,t,P[1],p)]);return}C([Ee(t,P[0],p),Ee(t,P[1],p)])},[t,C]),W=o.useCallback(()=>{C(w.current)},[C]),te=o.useMemo(()=>({value:L[0],onChange:ce,minDate:r,maxDate:L[1],unit:t}),[L[0],L[1],ce,r,t]),q=o.useMemo(()=>({value:L[1],onChange:oe,minDate:L[0],maxDate:n,unit:t}),[L[0],L[1],oe,n,t]),F=o.useMemo(()=>({...u,mode:"range",unit:t,range:L,minDate:r,maxDate:n,onChangeRange:$}),[u,t,L,r,n,$]);return{range:L,lowerDate:L[0],upperDate:L[1],setRange:T,setLowerDate:ce,setUpperDate:oe,shiftRange:V,resetRange:W,startSelectorProps:te,endSelectorProps:q,sliderProps:F}}function Va(e){const{unit:t,minDate:r,maxDate:n,initialValue:a,onChangePoint:c,...l}=e;Wr("usePeriodSliderPoint",r,n),nr("usePeriodSliderPoint","initialValue",a),jr("usePeriodSliderPoint","initialValue",a,r,n,"[minDate, maxDate]");const u=Br(l),w=o.useRef(a),[f,T]=o.useState(a);let L=f;const s=Ue(f,r,n);s!==f&&(L=s,T(s));const k=o.useRef(L);k.current=L;const ee=o.useRef({minDate:r,maxDate:n,allowedDates:u.allowedDates});ee.current={minDate:r,maxDate:n,allowedDates:u.allowedDates};const ne=o.useRef(c);ne.current=c;const C=o.useCallback(W=>{const{minDate:te,maxDate:q}=ee.current,F=Ue(W,te,q);F.getTime()!==k.current.getTime()&&(k.current=F,T(F),ne.current?.(F))},[]),ce=o.useCallback(W=>{const{minDate:te,maxDate:q,allowedDates:F}=ee.current,p=vt(F,t,te,q);if(p.length>0){C(Ur(p,t,k.current,W));return}C(Ee(t,k.current,W))},[t,C]),oe=o.useCallback(()=>{C(w.current)},[C]),$=o.useMemo(()=>({value:L,onChange:C,minDate:r,maxDate:n,unit:t}),[L,C,r,n,t]),V=o.useMemo(()=>({...u,mode:"point",unit:t,value:L,minDate:r,maxDate:n,onChangePoint:C}),[u,t,L,r,n,C]);return{value:L,setValue:T,shiftValue:ce,resetValue:oe,selectorProps:$,sliderProps:V}}function Ha(e){const{unit:t,minDate:r,maxDate:n,initialMacroRange:a,initialMicroRange:c,macroUnit:l=t,microUnit:u=t,onChangeMacroRange:w,onChangeMicroRange:f,...T}=e;Wr("useVernierSliderRange",r,n),Hr("useVernierSliderRange","initialMacroRange",a),Hr("useVernierSliderRange","initialMicroRange",c),Or("useVernierSliderRange","initialMacroRange",a,r,n,"[minDate, maxDate]");const L=ht(l,u,a,r,n);Or("useVernierSliderRange","initialMicroRange",c,L[0],L[1],"the initial macro window");const s=Br(T),k=o.useRef(a),ee=o.useRef(c),[ne,C]=o.useState(a),[ce,oe]=o.useState(c);let $=ne;const V=[Ue(ne[0],r,n),Ue(ne[1],r,n)];(V[0]!==ne[0]||V[1]!==ne[1])&&($=V,C(V));const W=o.useMemo(()=>ht(l,u,$,r,n),[l,u,$,r,n]),te=o.useMemo(()=>Fr(W,u,s.microIsDiscrete,s.microAllowedDates??s.allowedDates,r,n),[W,u,s.microIsDiscrete,s.microAllowedDates,s.allowedDates,r,n]),q=o.useMemo(()=>s.macroIsDiscrete===!0?vt(s.macroAllowedDates??s.allowedDates,l,r,n):[],[s.macroIsDiscrete,s.macroAllowedDates,s.allowedDates,l,r,n]),F=o.useRef(q);F.current=q;let p=ce;const D=Yr(ce,u,W,te);(D[0]!==ce[0]||D[1]!==ce[1])&&(p=D,oe(D));const y=o.useRef($);y.current=$;const E=o.useRef(p);E.current=p;const P=o.useRef({minDate:r,maxDate:n,macroIsDiscrete:s.macroIsDiscrete,macroAllowedDates:s.macroAllowedDates,microIsDiscrete:s.microIsDiscrete,microAllowedDates:s.microAllowedDates,allowedDates:s.allowedDates});P.current={minDate:r,maxDate:n,macroIsDiscrete:s.macroIsDiscrete,macroAllowedDates:s.macroAllowedDates,microIsDiscrete:s.microIsDiscrete,microAllowedDates:s.microAllowedDates,allowedDates:s.allowedDates};const G=o.useRef(w);G.current=w;const me=o.useRef(f);me.current=f;const B=o.useCallback(b=>{const{minDate:S,maxDate:j}=P.current;return ht(l,u,b,S,j)},[l,u]),Z=o.useCallback(b=>{const{microIsDiscrete:S,microAllowedDates:j,allowedDates:Me,minDate:A,maxDate:K}=P.current;return Fr(b,u,S,j??Me,A,K)},[u]),se=o.useCallback((b,S)=>{const j=y.current,Me=E.current;(b[0].getTime()!==j[0].getTime()||b[1].getTime()!==j[1].getTime())&&(y.current=b,C(b),G.current?.(b[0],b[1])),(S[0].getTime()!==Me[0].getTime()||S[1].getTime()!==Me[1].getTime())&&(E.current=S,oe(S),me.current?.(S[0],S[1]))},[]),_=o.useCallback((b,S)=>{const{minDate:j,maxDate:Me}=P.current,A=[Ue(b,j,Me),Ue(S,j,Me)],K=B(A);se(A,Yr(E.current,u,K,Z(K)))},[u,B,Z,se]),z=o.useCallback((b,S)=>{const j=B(y.current);se(y.current,Yr([b,S],u,j,Z(j)))},[u,B,Z,se]),re=o.useCallback(b=>{const S=y.current[1],j=b>S?b:S;_(b,j)},[_]),ie=o.useCallback(b=>{const S=y.current[0],j=b<S?b:S;_(j,b)},[_]),We=o.useCallback(b=>{const S=E.current[1],j=b>S?b:S;z(b,j)},[z]),Se=o.useCallback(b=>{const S=E.current[0],j=b<S?b:S;z(j,b)},[z]),Le=o.useCallback(b=>{const{minDate:S,maxDate:j}=P.current,Me=y.current,A=F.current;if(A.length>0){const Ne=be(A,Me[0],l)+b,He=be(A,Me[1],l)+b;if(Ne<0||He>A.length-1)return;_(A[Ne],A[He]);return}const K=Ee(l,Me[0],b),Ce=Ee(l,Me[1],b);K<S||Ce>j||_(K,Ce)},[l,_]),ye=o.useCallback(b=>{const S=y.current,j=E.current,Me=B(S),[A,K]=Me,Ce=Z(Me);if(Ce.length>0){const fe=be(Ce,j[0],u)+b,we=be(Ce,j[1],u)+b;if(fe<0||we>Ce.length-1)return;z(Ce[fe],Ce[we]);return}const Ne=Ee(u,j[0],b),He=Ee(u,j[1],b);Ne<A||He>K||z(Ne,He)},[u,B,Z,z]),Ge=o.useCallback(()=>{const b=k.current,S=B(b);se(b,Yr(ee.current,u,S,Z(S)))},[u,B,Z,se]),[Ze,at]=W,Ve=o.useMemo(()=>({value:$[0],onChange:re,minDate:r,maxDate:$[1],unit:l}),[$,re,r,l]),st=o.useMemo(()=>({value:$[1],onChange:ie,minDate:$[0],maxDate:n,unit:l}),[$,ie,n,l]),X=o.useMemo(()=>({value:p[0],onChange:We,minDate:Ze,maxDate:p[1],unit:u}),[p,We,Ze,u]),Q=o.useMemo(()=>({value:p[1],onChange:Se,minDate:p[0],maxDate:at,unit:u}),[p,Se,at,u]),ge=o.useMemo(()=>({...s,mode:"vernier",unit:t,macroUnit:l,microUnit:u,minDate:r,maxDate:n,macroRange:$,microRange:p,onChangeMacroRange:_,onChangeMicroRange:z}),[s,t,l,u,r,n,$,p,_,z]);return{macroRange:$,setMacroRange:C,microRange:p,setMicroRange:oe,setMacroLowerDate:re,setMacroUpperDate:ie,setMicroLowerDate:We,setMicroUpperDate:Se,shiftMacroRange:Le,shiftMicroRange:ye,resetVernier:Ge,macroStartSelectorProps:Ve,macroEndSelectorProps:st,microStartSelectorProps:X,microEndSelectorProps:Q,sliderProps:ge}}function ja(e){const{unit:t,minDate:r,maxDate:n,initialMacroRange:a,initialMicroValue:c,macroUnit:l=t,microUnit:u=t,onChangeMacroRange:w,onChangeMicroPoint:f,...T}=e;Wr("useVernierSliderPoint",r,n),Hr("useVernierSliderPoint","initialMacroRange",a),nr("useVernierSliderPoint","initialMicroValue",c),Or("useVernierSliderPoint","initialMacroRange",a,r,n,"[minDate, maxDate]");const L=ht(l,u,a,r,n);jr("useVernierSliderPoint","initialMicroValue",c,L[0],L[1],"the initial macro window");const s=Br(T),k=o.useRef(a),ee=o.useRef(c),[ne,C]=o.useState(a),[ce,oe]=o.useState(c);let $=ne;const V=[Ue(ne[0],r,n),Ue(ne[1],r,n)];(V[0]!==ne[0]||V[1]!==ne[1])&&($=V,C(V));const W=o.useMemo(()=>ht(l,u,$,r,n),[l,u,$,r,n]),te=o.useMemo(()=>Fr(W,u,s.microIsDiscrete,s.microAllowedDates??s.allowedDates,r,n),[W,u,s.microIsDiscrete,s.microAllowedDates,s.allowedDates,r,n]),q=o.useMemo(()=>s.macroIsDiscrete===!0?vt(s.macroAllowedDates??s.allowedDates,l,r,n):[],[s.macroIsDiscrete,s.macroAllowedDates,s.allowedDates,l,r,n]),F=o.useRef(q);F.current=q;let p=ce;const D=rr(ce,u,W,te);D!==ce&&(p=D,oe(D));const y=o.useRef($);y.current=$;const E=o.useRef(p);E.current=p;const P=o.useRef({minDate:r,maxDate:n,macroIsDiscrete:s.macroIsDiscrete,macroAllowedDates:s.macroAllowedDates,microIsDiscrete:s.microIsDiscrete,microAllowedDates:s.microAllowedDates,allowedDates:s.allowedDates});P.current={minDate:r,maxDate:n,macroIsDiscrete:s.macroIsDiscrete,macroAllowedDates:s.macroAllowedDates,microIsDiscrete:s.microIsDiscrete,microAllowedDates:s.microAllowedDates,allowedDates:s.allowedDates};const G=o.useRef(w);G.current=w;const me=o.useRef(f);me.current=f;const B=o.useCallback(X=>{const{minDate:Q,maxDate:ge}=P.current;return ht(l,u,X,Q,ge)},[l,u]),Z=o.useCallback(X=>{const{microIsDiscrete:Q,microAllowedDates:ge,allowedDates:b,minDate:S,maxDate:j}=P.current;return Fr(X,u,Q,ge??b,S,j)},[u]),se=o.useCallback((X,Q)=>{const ge=y.current,b=E.current;(X[0].getTime()!==ge[0].getTime()||X[1].getTime()!==ge[1].getTime())&&(y.current=X,C(X),G.current?.(X[0],X[1])),Q.getTime()!==b.getTime()&&(E.current=Q,oe(Q),me.current?.(Q))},[]),_=o.useCallback((X,Q)=>{const{minDate:ge,maxDate:b}=P.current,S=[Ue(X,ge,b),Ue(Q,ge,b)],j=B(S);se(S,rr(E.current,u,j,Z(j)))},[u,B,Z,se]),z=o.useCallback(X=>{const Q=B(y.current);se(y.current,rr(X,u,Q,Z(Q)))},[u,B,Z,se]),re=o.useCallback(X=>{const Q=y.current[1],ge=X>Q?X:Q;_(X,ge)},[_]),ie=o.useCallback(X=>{const Q=y.current[0],ge=X<Q?X:Q;_(ge,X)},[_]),We=o.useCallback(X=>{const{minDate:Q,maxDate:ge}=P.current,b=y.current,S=F.current;if(S.length>0){const A=be(S,b[0],l)+X,K=be(S,b[1],l)+X;if(A<0||K>S.length-1)return;_(S[A],S[K]);return}const j=Ee(l,b[0],X),Me=Ee(l,b[1],X);j<Q||Me>ge||_(j,Me)},[l,_]),Se=o.useCallback(X=>{const Q=y.current,ge=B(Q),b=Z(ge);if(b.length>0){z(Ur(b,u,E.current,X));return}z(Ee(u,E.current,X))},[u,B,Z,z]),Le=o.useCallback(()=>{const X=k.current,Q=B(X);se(X,rr(ee.current,u,Q,Z(Q)))},[u,B,Z,se]),[ye,Ge]=W,Ze=o.useMemo(()=>({value:$[0],onChange:re,minDate:r,maxDate:$[1],unit:l}),[$,re,r,l]),at=o.useMemo(()=>({value:$[1],onChange:ie,minDate:$[0],maxDate:n,unit:l}),[$,ie,n,l]),Ve=o.useMemo(()=>({value:p,onChange:z,minDate:ye,maxDate:Ge,unit:u}),[p,z,ye,Ge,u]),st=o.useMemo(()=>({...s,mode:"vernier",unit:t,macroUnit:l,microUnit:u,minDate:r,maxDate:n,macroRange:$,microValue:p,onChangeMacroRange:_,onChangeMicroPoint:z}),[s,t,l,u,r,n,$,p,_,z]);return{macroRange:$,setMacroRange:C,microValue:p,setMicroValue:oe,setMacroLowerDate:re,setMacroUpperDate:ie,setMicroDate:z,shiftMacroRange:We,shiftMicroValue:Se,resetVernier:Le,macroStartSelectorProps:Ze,macroEndSelectorProps:at,microSelectorProps:Ve,sliderProps:st}}function lo(e){const t=new Date(e,0,1);return t.setFullYear(e),t}function Vr(e,t){if(e!==void 0&&(!(e instanceof Date)||Number.isNaN(e.getTime())))throw new RangeError(`YearSelector: \`${t}\` must be a valid Date, received ${String(e)}.`)}function so(e,t){if(e!==void 0&&!Number.isInteger(e))throw new RangeError(`YearSelector: \`${t}\` must be an integer year, received ${String(e)}.`)}function Oa(e){if(e!==void 0)try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{throw new RangeError(`YearSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`)}}function co(e,t,r){const n=e===void 0?null:e,a=t===void 0?null:t.getFullYear();return n!==null&&a!==null?r(n,a):n!==null?n:a}const Fa=e=>{const{value:t,initialDate:r,onChange:n,children:a,minYear:c,maxYear:l,minDate:u,maxDate:w,className:f="",style:T,disabled:L=!1,prevYearAriaLabel:s="Previous year",nextYearAriaLabel:k="Next year",selectAriaLabel:ee="Year",locale:ne}=e;Vr(t,"value"),Vr(r,"initialDate"),Vr(u,"minDate"),Vr(w,"maxDate"),so(c,"minYear"),so(l,"maxYear"),Oa(ne);const C=t??r;if(C===void 0)throw new RangeError("YearSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected year is never inferred from the wall clock.");const[ce,oe]=o.useState(()=>C.getFullYear()),$=u?.getTime(),V=w?.getTime(),W=o.useMemo(()=>co(c,u,Math.max),[c,$]),te=o.useMemo(()=>co(l,w,Math.min),[l,V]);if(W===null||te===null)throw new RangeError("YearSelector: a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`) are both required; the year option list is never invented.");if(W>te)throw new RangeError(`YearSelector: the resolved lower bound ${W} is after the resolved upper bound ${te}.`);const q=t!==void 0,F=t!==void 0?t.getFullYear():ce,p=F<W||F>te,D=C.getTime();o.useEffect(()=>{q||oe(C.getFullYear())},[q,D]);const y=z=>z>=W&&z<=te,E=z=>{if(!L){if(!y(z))throw new RangeError(`YearSelector: refusing to emit ${z}, which lies outside the declared bounds ${W}-${te}.`);q||oe(z),n?.(lo(z),z)}},P=y(F-1)?F-1:null,G=y(F+1)?F+1:null,me=L||P===null,B=L||G===null,Z=()=>{P!==null&&E(P)},se=()=>{G!==null&&E(G)},_=o.useMemo(()=>{const z=[];for(let re=te;re>=W;re--)z.push(re);return p&&(z.push(F),z.sort((re,ie)=>ie-re)),z},[W,te,p,F]);return h.jsxs("div",{className:`inline-flex w-32 items-center ${f}`,style:T,children:[h.jsx("button",{type:"button","aria-label":s,disabled:me,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:Z,children:h.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-r-[6px] border-r-slate-500 border-solid hover:border-r-slate-700 dark:border-r-slate-400 dark:hover:border-r-slate-200"})}),h.jsx("select",{"aria-label":ee,disabled:L,className:"mx-1 my-auto w-18 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500",value:F,onChange:z=>{if(!z.target.value)return;const re=Number(z.target.value);Number.isInteger(re)&&E(re)},children:_.map(z=>h.jsx("option",{value:z,className:"text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100",children:qe("year",lo(z),void 0,ne)},z))}),h.jsx("button",{type:"button","aria-label":k,disabled:B,className:"relative my-auto inline-flex h-5 w-4 cursor-pointer items-center justify-center rounded p-0 after:absolute after:inset-[-14px] after:content-[''] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:opacity-40",onClick:se,children:h.jsx("span",{className:"h-0 w-0 border-y-[6px] border-y-transparent border-l-[6px] border-l-slate-500 border-solid hover:border-l-slate-700 dark:border-l-slate-400 dark:hover:border-l-slate-200"})}),a]})},$o=o.memo(Fa,(e,t)=>{const r=e.value??e.initialDate,n=t.value??t.initialDate,a=r?r.getFullYear():null,c=n?n.getFullYear():null;return!(a!==c||e.disabled!==t.disabled||e.className!==t.className||e.style!==t.style||e.minYear!==t.minYear||e.maxYear!==t.maxYear||e.minDate?.getFullYear()!==t.minDate?.getFullYear()||e.maxDate?.getFullYear()!==t.maxDate?.getFullYear()||e.onChange!==t.onChange||e.children!==t.children||e.prevYearAriaLabel!==t.prevYearAriaLabel||e.nextYearAriaLabel!==t.nextYearAriaLabel||e.selectAriaLabel!==t.selectAriaLabel||e.locale!==t.locale)});$o.displayName="YearSelector";exports.COLOR_SCHEME_PALETTES=uo;exports.DateSelector=Lo;exports.MonthSelector=Co;exports.PeriodSlider=So;exports.YearSelector=$o;exports.addUnit=Ee;exports.areStylesEqual=To;exports.calculateConnectDragValues=ho;exports.calculateHandleDragValues=hn;exports.calculateKeyboardActionValues=bo;exports.calculateLabelSlant=Mn;exports.calculateVernierMacroDrag=yo;exports.calculateVernierMicroDrag=Ro;exports.decode=ae;exports.encode=de;exports.findNearestDateIndex=be;exports.formatLabel=qe;exports.formatScreenReaderLabel=Yt;exports.getActiveDragHandle=go;exports.getMacroWindowEndDate=fo;exports.getMacroWindowStartDate=mo;exports.getSortedAllowedDates=vt;exports.normalizeDateByUnit=Ke;exports.resolveMacroWindow=ht;exports.resolveVernierRailZone=xn;exports.resolveVernierTargetHandle=po;exports.resolveWheelStep=vo;exports.usePeriodSliderPoint=Va;exports.usePeriodSliderRange=Ya;exports.useVernierSliderPoint=ja;exports.useVernierSliderRange=Ha;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),Ve=require("date-fns"),i=require("react"),qa=120,Fn="data-drag-snap",zn="--ps-drag-snap-duration",kr={flat:["--ps-drag-low","--ps-drag-high"],macro:["--ps-drag-macro-low","--ps-drag-macro-high"],micro:["--ps-drag-micro-low","--ps-drag-micro-high"]},Mo=["low","high"],vo=["tx","ty","rot"],gn={flat:{low:"--ps-drag-label-low",high:"--ps-drag-label-high"},macro:{low:"--ps-drag-macro-label-low",high:"--ps-drag-macro-label-high"},micro:{low:"--ps-drag-micro-label-low",high:"--ps-drag-micro-label-high"}},ra=(e,t)=>`${e}-${t}`,Un=(e,t,r)=>`var(${ra(e,t)}, ${r})`,Pi=(e,t,r)=>{const n=gn[t];for(const a of Mo)for(const l of vo)e.style.setProperty(ra(n[a],l),r[a][l])},xo=e=>Math.max(0,Math.min(1,e)),ln=(e,t,r,n)=>{const a=xo(t);if(e==="point")return[a,a];const l=e==="low"?n:r;return[Math.min(a,l),Math.max(a,l)]},na=(e,t,r)=>{const n=r-t,a=Math.max(0,Math.min(1-n,t+e));return[a,a+n]},hn=(e,t,r,n)=>{const a=xo(t);return e==="low"?a>n?"high":"low":a<r?"low":"high"},Bn=(e,t,r,n)=>{if(r){const s=(1-e)*100,u=(1-t)*100;return n?`M 12 ${u} L 12 ${s} L 20 100 L 20 0 Z`:`M 12 0 L 12 100 L 20 ${s} L 20 ${u} Z`}const a=e*100,l=t*100;return n?`M ${a} 12 L ${l} 12 L 100 20 L 0 20 Z`:`M 0 12 L 100 12 L ${l} 20 L ${a} 20 Z`},At=(e,t)=>`var(${e}, ${t}%)`,Ai=(e,t,r,n)=>{const[a,l]=kr[t];e.style.setProperty(a,`${r*100}%`),e.style.setProperty(l,`${n*100}%`)},Ei=e=>{for(const[t,r]of Object.values(kr))e.style.removeProperty(t),e.style.removeProperty(r);for(const t of Object.values(gn))for(const r of Mo)for(const n of vo)e.style.removeProperty(ra(t[r],n))},Wn=(e,t)=>e!==null&&t!==null&&"nodeType"in t&&e.contains(t),Za=new Set(["hidden","clip","scroll","auto","overlay"]),Ja=["paint","strict","content"],Ci=["layout","paint","strict","content"],$i=["transform","perspective","filter"],Pr=e=>e!==void 0&&e!==""&&e!=="none",ki=e=>e.position==="fixed"?"fixed":e.position==="absolute"?"absolute":null,Ii=(e,t)=>t==="absolute"&&Pr(e.position)&&e.position!=="static"||Pr(e.transform)||Pr(e.perspective)||Pr(e.filter)||Pr(e.backdropFilter)||Ci.some(r=>e.contain.includes(r))?!0:$i.some(r=>e.willChange.includes(r)),Vi=(e,t,r,n,a,l)=>{const s=t.ownerDocument.defaultView;if(s===null)return!1;const u=e.getBoundingClientRect();if(u.width===0||u.height===0)return!1;const g=n?0:r,h=n?r:0;if(a<u.left-g||a>=u.right+g||l<u.top-h||l>=u.bottom+h)return!1;const R=s.getComputedStyle(t);if(R.visibility!=="visible")return!1;let L=null;for(let c=t;c!==null;c=c.parentElement){const T=c===t?R:s.getComputedStyle(c);if(L!==null&&!Ii(T,L))continue;const q=Za.has(T.overflowX)||Ja.some(S=>T.contain.includes(S)),J=Za.has(T.overflowY)||Ja.some(S=>T.contain.includes(S));if(q||J){const S=c.getBoundingClientRect();if(q&&(a<S.left||a>=S.right)||J&&(l<S.top||l>=S.bottom))return!1}L=ki(T)}return!0},Xn=new Map,Ni=(e,t)=>{if(!(t.shiftKey&&t.cancelable))return;for(const a of e)if(a.ownsHit(t.target)){a.step(t);return}let r=null,n=Number.POSITIVE_INFINITY;for(const a of e){const l=a.distanceToRailPx(t.clientX,t.clientY);l===null||l>=n||(r=a,n=l)}r?.step(t)},Yi=(e,t)=>{let r=Xn.get(e);if(r===void 0){const l=new Set,s=u=>Ni(l,u);r={participants:l,listener:s},Xn.set(e,r),e.addEventListener("wheel",s,{passive:!1,capture:!0})}const{participants:n,listener:a}=r;return n.add(t),()=>{n.delete(t),!(n.size>0)&&(Xn.delete(e),e.removeEventListener("wheel",a,{capture:!0}))}},Vr="gap-[11px]",ct=6,ut=ct*2,Et=ct*4/3,Oi={left:`0,${ut/2} ${ct},0 ${ct},${ut}`,right:`${Et},${ut/2} ${Et-ct},0 ${Et-ct},${ut}`,up:`${ut/2},0 0,${ct} ${ut},${ct}`,down:`${ut/2},${Et} 0,${Et-ct} ${ut},${Et-ct}`},Gn=e=>{e.preventDefault(),e.stopPropagation()},Hi={onMouseDownCapture:Gn,onMouseUpCapture:Gn,onClickCapture:Gn},_i="period-slider-step",ji=`${_i} relative inline-flex size-[22px] shrink-0 items-center justify-center rounded-md after:absolute after:content-['']`,Fi="transition-colors motion-reduce:transition-none not-aria-disabled:cursor-pointer aria-disabled:cursor-not-allowed focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-600 dark:focus-visible:ring-blue-400 forced-colors:not-aria-disabled:hover:text-[Highlight] forced-colors:aria-disabled:text-[GrayText]",zi={control:"text-slate-500 not-aria-disabled:hover:bg-slate-500/15 not-aria-disabled:hover:text-slate-900 not-aria-disabled:active:bg-slate-500/25 aria-disabled:text-slate-500/40 dark:text-slate-400 dark:not-aria-disabled:hover:text-slate-50 dark:aria-disabled:text-slate-400/40",rail:"border border-slate-300 bg-white text-slate-700 shadow-2xs not-aria-disabled:hover:border-slate-400 not-aria-disabled:hover:bg-slate-100 not-aria-disabled:hover:text-slate-900 not-aria-disabled:active:bg-slate-200 aria-disabled:border-slate-300/40 aria-disabled:bg-white/40 aria-disabled:text-slate-700/40 aria-disabled:shadow-none dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:not-aria-disabled:hover:border-slate-500 dark:not-aria-disabled:hover:bg-slate-700 dark:not-aria-disabled:hover:text-white dark:not-aria-disabled:active:bg-slate-600 dark:aria-disabled:border-slate-700/40 dark:aria-disabled:bg-slate-800/40 dark:aria-disabled:text-slate-200/40"},en="after:inset-[calc((100%-var(--ps-target-size))/2)]",Qa={horizontal:"px-[19px]",vertical:"py-[19px]"},Ui={control:{left:en,right:en,up:en,down:en},rail:{left:"after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:left-[calc(100%-var(--ps-target-size)+4px)] after:-right-[4px]",right:"after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:-left-[4px] after:right-[calc(100%-var(--ps-target-size)+4px)]",up:"after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:top-[calc(100%-var(--ps-target-size)+4px)] after:-bottom-[4px]",down:"after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:-top-[4px] after:bottom-[calc(100%-var(--ps-target-size)+4px)]"}},jt=({direction:e,neighbour:t,disabled:r,canStep:n,onStep:a,ariaLabel:l,className:s,ref:u})=>{const g=e==="up"||e==="down",h=g?ut:Et,R=g?Et:ut,L=r||!n;return w.jsx("button",{ref:u,type:"button","aria-label":l,disabled:r,"aria-disabled":L?!0:void 0,...L?Hi:null,onClick:L?void 0:a,className:`${s===void 0?"":`${s} `}${ji} ${Fi} ${zi[t]} ${Ui[t][e]}`,children:w.jsx("svg",{"aria-hidden":"true",focusable:"false","data-arrow":e,width:h,height:R,viewBox:`0 0 ${h} ${R}`,fill:"currentColor",className:"pointer-events-none block shrink-0",children:w.jsx("polygon",{points:Oi[e]})})})},Do={"blue-rose":{macro:"#0284c7",macroLight:"#38bdf8",micro:"#e11d48",microLight:"#fb7185",accent:"#0284c7"},"indigo-amber":{macro:"#4f46e5",macroLight:"#818cf8",micro:"#d97706",microLight:"#fbbf24",accent:"#4f46e5"},"teal-emerald":{macro:"#0d9488",macroLight:"#2dd4bf",micro:"#059669",microLight:"#34d399",accent:"#0d9488"},"violet-fuchsia":{macro:"#7c3aed",macroLight:"#a78bfa",micro:"#c026d3",microLight:"#e879f9",accent:"#7c3aed"},"slate-sky":{macro:"#475569",macroLight:"#94a3b8",micro:"#0284c7",microLight:"#38bdf8",accent:"#475569"},monochrome:{macro:"#52525b",macroLight:"#a1a1aa",micro:"#18181b",microLight:"#71717a",accent:"#27272a"}},Ze=e=>e instanceof Date&&!Number.isNaN(e.getTime()),Me=e=>e instanceof Date?Number.isNaN(e.getTime())?"Invalid Date":e.toISOString():String(e),We=(e,t)=>{if(!Ze(t))throw new RangeError(`normalizeDateByUnit: d must be a valid Date (received: ${Me(t)})`);const r=new Date(t.getTime());return e==="year"?(r.setMonth(0,1),r.setHours(0,0,0,0)):(e==="month"&&r.setDate(1),r.setHours(0,0,0,0)),r},K=(e,t)=>{const r=We(e,t),n=r.getFullYear(),a=r.getMonth()+1,l=r.getDate();if(e==="year")return n;if(e==="month")return n*12+(a-1);const s=new Date(0);return s.setUTCFullYear(n,a-1,l),s.setUTCHours(0,0,0,0),Math.floor(s.getTime()/(1440*60*1e3))},ne=(e,t)=>{const r=new Date(0);if(r.setHours(0,0,0,0),e==="year")return r.setFullYear(t,0,1),r;if(e==="month"){const a=Math.floor(t/12),l=t-a*12;return r.setFullYear(a,l,1),r}const n=new Date(t*24*60*60*1e3);return r.setFullYear(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()),r},$e=(e,t,r)=>{if(!Ze(t))throw new RangeError(`addUnit: d must be a valid Date (received: ${Me(t)})`);return e==="year"?Ve.addYears(t,r):e==="month"?Ve.addMonths(t,r):Ve.addDays(t,r)},po=(e,t,r)=>{if(!Ze(r))throw new RangeError(`getMacroWindowStartDate: d must be a valid Date (received: ${Me(r)})`);return We(t,We(e,r))},Ro=(e,t,r)=>{if(!Ze(r))throw new RangeError(`getMacroWindowEndDate: d must be a valid Date (received: ${Me(r)})`);if(e===t)return We(t,r);const n=r.getFullYear(),a=r.getMonth();if(e==="year"){if(t==="month")return new Date(n,11,1);if(t==="day")return new Date(n,11,31)}return e==="month"&&t==="day"?new Date(n,a+1,0):We(t,r)},eo=(e,t,r)=>e<t?t:e>r?r:e,mt=(e,t,r,n,a)=>{if(Ir("macroRange",r,"resolveMacroWindow"),!Ze(n))throw new RangeError(`resolveMacroWindow: minDate must be a valid Date (received: ${Me(n)})`);if(!Ze(a))throw new RangeError(`resolveMacroWindow: maxDate must be a valid Date (received: ${Me(a)})`);if(a.getTime()<n.getTime())throw new RangeError(`resolveMacroWindow: maxDate must not precede minDate (minDate: ${Me(n)}, maxDate: ${Me(a)})`);return[We(t,eo(po(e,t,r[0]),n,a)),We(t,eo(Ro(e,t,r[1]),n,a))]},Bi={year:{year:"numeric"},month:{year:"numeric",month:"2-digit"},day:{year:"numeric",month:"2-digit",day:"2-digit"}},to=new Map,Wi=(e,t)=>{const r=`${e}\0${t}`,n=to.get(r);if(n!==void 0)return n;const a=new Intl.DateTimeFormat(t,Bi[e]);return to.set(r,a),a},Xi=(e,t)=>{const r=String(t.getFullYear()).padStart(4,"0");if(e==="year")return r;const n=String(t.getMonth()+1).padStart(2,"0");if(e==="month")return`${r}-${n}`;const a=String(t.getDate()).padStart(2,"0");return`${r}-${n}-${a}`},Be=(e,t,r,n)=>Ze(t)?r?r(t):n===void 0?Xi(e,t):Wi(e,n).format(t):"",Ot=(e,t,r,n)=>Be(e,t,r,n),me=(e,t,r)=>{if(!e||e.length===0||e.length===1)return 0;const n=K(r,t);let a=0,l=e.length-1;if(n<=K(r,e[a]))return 0;if(n>=K(r,e[l]))return l;for(;a<=l;){const g=a+l>>1,h=K(r,e[g]);if(h===n)return g;h<n?a=g+1:l=g-1}const s=Math.abs(K(r,e[a])-n),u=Math.abs(K(r,e[l])-n);return s<u?a:l},vt=(e,t,r,n)=>{if(!Array.isArray(e)||e.length===0)return[];const a=K(t,r),l=K(t,n),s=new Map;for(const u of e){const g=We(t,u),h=K(t,g);h<a||h>l||s.has(h)||s.set(h,g)}if(s.size===0)throw new RangeError(`getSortedAllowedDates: every allowedDates entry falls outside [minDate, maxDate] (minDate: ${Me(r)}, maxDate: ${Me(n)}, entries: ${e.length})`);return Array.from(s.keys()).sort((u,g)=>u-g).map(u=>s.get(u))},tn=(e,t,r,n)=>{const a=e.length-1;if(a<=0)return 0;const l=me(e,n,t);if(r==="time"){const s=e[0].getTime(),u=e[a].getTime()-s;return u<=0?0:Math.max(0,Math.min(1,(e[l].getTime()-s)/u))}return l/a},rn=(e,t,r,n)=>{const a=e.length-1;if(a<=0)return 0;const l=Math.max(0,Math.min(1,n));if(r==="time"){const s=e[0].getTime(),u=e[a].getTime()-s;return u<=0?0:me(e,new Date(s+l*u),t)}return Math.max(0,Math.min(a,Math.round(l*a)))},ea=(e,t,r,n,a,l,s)=>{let u=r,g=n;return s?(u=t,g=t):e==="low"?t>n?(u=n,g=t):u=t:t<r?(g=r,u=t):g=t,[Math.max(a,Math.min(l,u)),Math.max(a,Math.min(l,g))]},So=({posDiffPct:e,startLowVal:t,startHighVal:r,rangeMin:n,rangeMax:a,isDiscrete:l,sortedAllowedDates:s,snapMode:u,unit:g})=>{if(l){const q=s.length-1;if(q<=0)return[0,0];const J=Math.max(0,Math.min(q,Math.round(t))),S=Math.max(J,Math.min(q,Math.round(r)));if(u==="time"){const O=s[0].getTime(),z=s[q].getTime(),ae=s[J].getTime(),G=s[S].getTime()-ae;let U=ae+e*(z-O),P=U+G;U<O&&(U=O,P=O+G),P>z&&(P=z,U=z-G);const y=me(s,new Date(U),g),A=me(s,new Date(P),g);return[y,Math.max(y,A)]}const se=Math.round(e*q);let re=J+se,$=S+se;return re<0&&($+=-re,re=0),$>q&&(re-=$-q,$=q),[Math.max(0,Math.min(q,re)),Math.max(0,Math.min(q,$))]}const h=q=>Math.max(n,Math.min(a,q)),R=a-n;if(R<=0)return[h(t),h(r)];const L=Math.round(e*R);let c=t+L,T=r+L;return c<n&&(T+=n-c,c=n),T>a&&(c-=T-a,T=a),[h(c),h(T)]},Lo=(e,t,r,n,a,l,s,u)=>{let g=0,h=!1,R=!1;switch(e){case"ArrowRight":case"ArrowUp":g=u;break;case"ArrowLeft":case"ArrowDown":g=-u;break;case"PageUp":g=u*5;break;case"PageDown":g=-u*5;break;case"Home":h=!0;break;case"End":R=!0;break;default:return null}if(s){let T=r;return h?T=a:R?T=l:T=Math.max(a,Math.min(l,r+g)),[T,T]}let L=r,c=n;return t==="low"?h?L=a:R?L=n:L=Math.max(a,Math.min(n,r+g)):h?c=r:R?c=l:c=Math.max(r,Math.min(l,n+g)),[L,c]},yo=8,To=2,Po=16,Gi=12,Ki=90,Ao=(e,t,r)=>{const n=r*Math.PI/180,a=Math.abs(Math.sin(n)),l=Math.abs(Math.cos(n));return{alongPx:(e*l+t*a)/2,acrossPx:(e*a+t*l)/2}},aa=(e,t)=>{const r=t?.estimatedHeightPx??Po,a=yo+(t?.anchorGapY??To)+r/2,l=e==="top"?-a:a;return{lowAngleDeg:0,highAngleDeg:0,lowOffsetX:0,highOffsetX:0,lowOffsetY:l,highOffsetY:l,isSlanted:!1,proximity:0}},oa=(e,t,r,n="top",a)=>{const l=a?.estimatedWidthPx,s=a?.estimatedHeightPx??Po,u=a?.paddingPx??Gi,g=a?.maxAngleDeg??Ki,h=yo+(a?.anchorGapY??To),R=aa(n,a);if(!(Number.isFinite(r)&&r>0)||l===void 0||!Number.isFinite(l)||l<=0)return R;const L=Math.max(0,t-e)/100*r,c=l+u;if(L>=c)return R;const T=Math.max(0,Math.min(1,(c-L)/c)),J=T*T*T*(T*(T*6-15)+10)*g,S=n==="top"?-J:J,se=Ao(l,s,J),re=h+se.acrossPx,$=n==="top"?-re:+re,O=2*se.alongPx,z=Math.max(0,(O+u-L)/2);return{lowAngleDeg:S,highAngleDeg:S,lowOffsetX:-z,highOffsetX:z,lowOffsetY:$,highOffsetY:$,isSlanted:T>.001,proximity:T}},Eo=e=>({...e,lowOffsetX:0,highOffsetX:0}),ia=(e,t)=>{const r=t==="macro-top"||t==="macro-left",n=e<0;return r&&n||!(r||n)?"macro":"micro"},Co=(e,t,r)=>{const n=Math.abs(e)>Math.abs(t)?e:t;return!Number.isFinite(n)||n===0?0:(r?n<0:n>0)?1:-1};function $o(e,t,r,n,a,l,s="macro-top",u=.05,g=!0,h="range"){if(ia(t,s)==="macro"){const c=Math.abs(e-r),T=Math.abs(e-n);return c<=u&&c<=T?"macro-low":T<=u&&T<c?"macro-high":g&&e>=r&&e<=n?"macro-connect":c<T?"macro-low":"macro-high"}if(h==="point")return"micro-point";const R=Math.abs(e-a),L=Math.abs(e-l);return R<=u&&R<=L?"micro-low":L<=u&&L<R?"micro-high":g&&e>=a&&e<=l?"micro-connect":R<L?"micro-low":"micro-high"}function ko(e,t,r,n,a){if(e==="macro-connect"){const[h,R]=na(t-r,n,a);return[h,R,"macro-connect"]}const l=e==="macro-low"?"low":"high",[s,u]=ln(l,t,n,a),g=hn(l,t,n,a);return[s,u,g==="low"?"macro-low":"macro-high"]}function Io(e,t,r,n,a){if(e==="micro-point"){const[h]=ln("point",t,n,a);return[h,h,"micro-point"]}if(e==="micro-connect"){const[h,R]=na(t-r,n,a);return[h,R,"micro-connect"]}const l=e==="micro-low"?"low":"high",[s,u]=ln(l,t,n,a),g=hn(l,t,n,a);return[s,u,g==="low"?"micro-low":"micro-high"]}const Cr=i.memo(({type:e,isTop:t=!0,isVertical:r=!1,isLeft:n=!0})=>{let a,l;r?(a=n?"M 7.375 0.625 A 7.375 7.375 0 0 0 7.375 15.375 Z":"M 0.625 0.625 A 7.375 7.375 0 0 1 0.625 15.375 Z",l=`period-slider-knob period-slider-knob-svg is-vertical ${n?"is-semicircle-left":"is-semicircle-right"}`):(a=t?"M 0.625 7.375 A 7.375 7.375 0 0 1 15.375 7.375 Z":"M 0.625 0.625 A 7.375 7.375 0 0 0 15.375 0.625 Z",l=`period-slider-knob period-slider-knob-svg ${t?"is-semicircle-top":"is-semicircle-bottom"}`);const s=e==="macro"?"period-slider-knob-path-macro":"period-slider-knob-path-micro";return w.jsx("svg",{className:l,width:r?"8":"16",height:r?"16":"8",viewBox:r?"0 0 8 16":"0 0 16 8",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:w.jsx("path",{d:a,className:s,shapeRendering:"geometricPrecision",strokeWidth:"1.25"})})});Cr.displayName="VernierKnobSvg";const qi=(e,t)=>{if(!Ze(e))throw new RangeError(`PeriodSlider: minDate is required and must be a valid Date (received: ${Me(e)})`);if(!Ze(t))throw new RangeError(`PeriodSlider: maxDate is required and must be a valid Date (received: ${Me(t)})`);if(t.getTime()<=e.getTime())throw new RangeError(`PeriodSlider: maxDate must be strictly later than minDate (minDate: ${Me(e)}, maxDate: ${Me(t)})`)},Ir=(e,t,r="PeriodSlider")=>{if(!Array.isArray(t)||t.length!==2)throw new RangeError(`${r}: ${e} is required and must be a [start, end] Date tuple (received: ${Me(t)})`);const[n,a]=t;if(!Ze(n))throw new RangeError(`${r}: ${e}[0] must be a valid Date (received: ${Me(n)})`);if(!Ze(a))throw new RangeError(`${r}: ${e}[1] must be a valid Date (received: ${Me(a)})`);if(a.getTime()<n.getTime())throw new RangeError(`${r}: ${e} must not be inverted (start: ${Me(n)}, end: ${Me(a)})`)},ta=(e,t)=>{if(!Ze(t))throw new RangeError(`PeriodSlider: ${e} must be a valid Date (received: ${Me(t)})`)},Mt=(e,t,r,n,a)=>{const l=K(r,t);if(l<K(r,n)||l>K(r,a))throw new RangeError(`PeriodSlider: ${e} must lie within [minDate, maxDate] (received: ${Me(t)}, minDate: ${Me(n)}, maxDate: ${Me(a)})`)},Zi=(e,t,r)=>{if(e.mode==="range"){for(const n of["range","defaultRange"]){const a=e[n];a!==void 0&&(Ir(n,a),Mt(`${n}[0]`,a[0],e.unit,t,r),Mt(`${n}[1]`,a[1],e.unit,t,r))}return}if(e.mode==="point")for(const n of["value","defaultValue"]){const a=e[n];a!==void 0&&(ta(n,a),Mt(n,a,e.unit,t,r))}},Ji=(e,t,r)=>{Ir("macroRange",e.macroRange);const n=e.microUnit??e.unit,a=e.microRange!==void 0||e.defaultMicroRange!==void 0||e.onChangeMicroRange!==void 0,l=e.microValue!==void 0||e.defaultMicroValue!==void 0||e.onChangeMicroPoint!==void 0;if(a&&l)throw new RangeError("PeriodSlider: vernier mode takes either a micro range (microRange / defaultMicroRange / onChangeMicroRange) or a micro point (microValue / defaultMicroValue / onChangeMicroPoint), never both");if(l){if(e.microValue!==void 0)return ta("microValue",e.microValue),Mt("microValue",e.microValue,n,t,r),{shape:"point",selection:[e.microValue,e.microValue]};if(e.defaultMicroValue!==void 0)return ta("defaultMicroValue",e.defaultMicroValue),Mt("defaultMicroValue",e.defaultMicroValue,n,t,r),{shape:"point",selection:[e.defaultMicroValue,e.defaultMicroValue]};throw new RangeError("PeriodSlider: vernier point mode requires a micro selection; supply microValue (controlled) or defaultMicroValue (uncontrolled)")}if(e.microRange!==void 0)return Ir("microRange",e.microRange),Mt("microRange[0]",e.microRange[0],n,t,r),Mt("microRange[1]",e.microRange[1],n,t,r),{shape:"range",selection:e.microRange};if(e.defaultMicroRange!==void 0)return Ir("defaultMicroRange",e.defaultMicroRange),Mt("defaultMicroRange[0]",e.defaultMicroRange[0],n,t,r),Mt("defaultMicroRange[1]",e.defaultMicroRange[1],n,t,r),{shape:"range",selection:e.defaultMicroRange};throw a?new RangeError("PeriodSlider: vernier range mode requires a micro selection; supply microRange (controlled) or defaultMicroRange (uncontrolled)"):new RangeError("PeriodSlider: vernier mode requires a micro selection; supply microRange / defaultMicroRange for a period, or microValue / defaultMicroValue for a point")},Ar=(e,t,r,n,a,l,s,u)=>{const g=me(e,n,t),h=me(e,a,t);return s?g:u?h:Math.max(g,Math.min(h,me(e,r,t)+l))},Kn=e=>{e.timerId!==null&&clearTimeout(e.timerId),e.timerId=null,e.emit=null},Qi=(e,t)=>{try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{throw new RangeError(`PeriodSlider: ${e} must be a valid BCP 47 language tag (received: ${JSON.stringify(t)})`)}},sr=()=>{const[e,t]=i.useState(null),r=i.useRef(null),n=i.useCallback(a=>{if(r.current?.disconnect(),r.current=null,a===null){t(null);return}if(typeof ResizeObserver>"u")return;const l=new ResizeObserver(s=>{for(const u of s){const g=u.borderBoxSize?.[0];g!==void 0&&t(h=>h!==null&&Math.abs(h.widthPx-g.inlineSize)<.5&&Math.abs(h.heightPx-g.blockSize)<.5?h:{widthPx:g.inlineSize,heightPx:g.blockSize})}});l.observe(a),r.current=l},[]);return i.useEffect(()=>()=>{r.current?.disconnect(),r.current=null},[]),[n,e]},qn=(e,t)=>{const r=on(e,t);return r===null?void 0:{estimatedWidthPx:r.widthPx,estimatedHeightPx:r.heightPx}},on=(e,t)=>e===null||t===null?null:{widthPx:Math.max(e.widthPx,t.widthPx),heightPx:Math.max(e.heightPx,t.heightPx)},el=e=>{const t={};let r=0;for(const a of e){const{side:l,box:s}=a;if(s===null)continue;let u;if(a.reach==="inline-size")u=s.widthPx,r=Math.max(r,s.heightPx/2);else{const g=Ao(s.widthPx,s.heightPx,a.angleDeg);u=a.centreOffsetPx===null?2*g.acrossPx:Math.abs(a.centreOffsetPx)+g.acrossPx,r=Math.max(r,g.alongPx+Math.abs(a.alongPushPx))}t[`--ps-label-reach-${l}`]=`${Math.ceil(u)}px`}if(Object.keys(t).length===0)return;const n=Math.ceil(r);return t["--ps-label-reach-main"]=`${n}px`,{style:t,mainPx:n}},ro=(e,t,r)=>({tx:`calc(-50% + ${e}px)`,ty:`${t}px`,rot:`${r}deg`}),no=(e,t,r)=>({tx:`calc(-50% + ${e}px)`,ty:`calc(-50% + ${t}px)`,rot:`${r}deg`}),sn=(e,t)=>({"--ps-tooltip-tx":Un(e,"tx",t.tx),"--ps-tooltip-ty":Un(e,"ty",t.ty),"--ps-tooltip-rot":Un(e,"rot",t.rot)}),Zn=(e,t,r,n)=>{const a=aa(n.labelPosition,n.config);if(!n.isSlantable)return{slant:a,lowStyle:void 0,highStyle:void 0,placements:null};const l=oa(t*100,r*100,n.trackLengthPx,n.labelPosition,n.config),s=n.isMerged?Eo(l):l,u=gn[e],g={low:ro(s.lowOffsetX,s.lowOffsetY-a.lowOffsetY,s.lowAngleDeg),high:ro(s.highOffsetX,s.highOffsetY-a.highOffsetY,s.highAngleDeg)};return{slant:s,lowStyle:sn(u.low,g.low),highStyle:sn(u.high,g.high),placements:g}},ao={"--ps-tooltip-origin":"100% 50%","--ps-tooltip-tx":"0px","--ps-tooltip-ty":"-50%","--ps-tooltip-rot":"0deg"},oo=(e,t,r)=>{const n=aa(r.labelPosition,r.config);if(r.isVertical)return{slant:n,lowStyle:ao,highStyle:ao,placements:null};const a=r.autoSlantLabels&&!r.isPointMode;let l=n;if(a){const g=oa(e,t,r.trackLengthPx,r.labelPosition,r.config);l=r.isMerged?Eo(g):g}const s=gn.flat,u={low:no(l.lowOffsetX,l.lowOffsetY,l.lowAngleDeg),high:no(l.highOffsetX,l.highOffsetY,l.highAngleDeg)};return{slant:l,lowStyle:{"--ps-tooltip-origin":"50% 50%",...sn(s.low,u.low)},highStyle:{"--ps-tooltip-origin":"50% 50%",...sn(s.high,u.high)},placements:a?u:null}},tl={horizontal:{decrease:"left",increase:"right"},vertical:{decrease:"down",increase:"up"}},rl={horizontal:{decrease:"period-slider-stepper-prev",increase:"period-slider-stepper-next"},vertical:{decrease:"period-slider-stepper-prev period-slider-stepper-down",increase:"period-slider-stepper-next period-slider-stepper-up"}},io={horizontal:"px-[calc(var(--ps-target-size)/2)]",vertical:"py-[calc(var(--ps-target-size)/2)]"},nl={horizontal:{withSteppers:`grid-cols-[auto_minmax(0,1fr)_auto] ${Vr} ${Qa.horizontal}`,railOnly:`grid-cols-[minmax(0,1fr)] ${io.horizontal}`},vertical:{withSteppers:`grid-rows-[auto_minmax(0,1fr)_auto] ${Vr} ${Qa.vertical}`,railOnly:`grid-rows-[minmax(0,1fr)] ${io.vertical}`}},lo={horizontal:{leading:"col-start-1 row-start-1",rail:"col-start-2 row-start-1",railOnly:"col-start-1 row-start-1",trailing:"col-start-3 row-start-1"},vertical:{leading:"col-start-1 row-start-1",rail:"col-start-1 row-start-2",railOnly:"col-start-1 row-start-1",trailing:"col-start-1 row-start-3"}},so=(e,t)=>{e.setPointerCapture(t)},al=e=>{const{unit:t,minDate:r,maxDate:n,allowedDates:a,snapMode:l="index",disabled:s=!1,className:u="",showStepper:g=!0,tooltipStyle:h="always",labelPosition:R="top",autoSlantLabels:L=!0,isVertical:c=!1,hideConnectBar:T=!1,showTicks:q=!1,colorScheme:J="blue-rose",locale:S,decreaseAriaLabel:se="Decrease",increaseAriaLabel:re="Increase"}=e;qi(r,n),Zi(e,r,n),S!==void 0&&Qi("locale",S);const $=e.mode==="vernier"?Ji(e,r,n):null,O=$!==null&&$.shape==="point",z=Do[J],ae=i.useId(),G=i.useRef(e),U=r.getTime(),P=n.getTime(),y=i.useMemo(()=>vt(a,t,r,n),[a,t,U,P]),A=y.length>0,{rangeMin:N,rangeMax:I}=i.useMemo(()=>A?{rangeMin:0,rangeMax:y.length-1}:{rangeMin:K(t,r),rangeMax:K(t,n)},[A,y,t,U,P]),te=e.mode==="point",le=i.useCallback(o=>{if(A){const d=Math.max(0,Math.min(y.length-1,Math.round(o)));return y[d]}return ne(t,Math.round(o))},[A,y,t]),B=i.useCallback(o=>{if(o===void 0)return N;const d=We(t,o);return A?me(y,d,t):K(t,d)},[A,y,t,N]),[Z,j]=i.useState(()=>$===null?null:$.selection);let H=Z??($===null?null:$.selection);if(O&&H!==null&&H[0].getTime()!==H[1].getTime()){const o=[H[0],H[0]];H=o,j(o)}const ue=e.mode==="vernier"?e.microValue?.getTime():void 0,fe=i.useMemo(()=>e.mode!=="vernier"||e.microValue===void 0?null:[e.microValue,e.microValue],[e.mode,ue]),oe=e.mode!=="vernier"?null:O?fe??H:e.microRange!==void 0?e.microRange:H,He=e.mode==="range"?e.range?.[0]??e.defaultRange?.[0]:e.mode==="vernier"?oe?.[0]:void 0,Te=e.mode==="range"?e.range?.[1]??e.defaultRange?.[1]:e.mode==="vernier"?oe?.[1]:void 0,Re=e.mode==="point"?e.value??e.defaultValue:void 0,Se=e.mode==="point"?Re?.getTime():He?.getTime(),Xe=e.mode==="range"?Te?.getTime():Se,[_e,Je]=i.useMemo(()=>{if(e.mode==="point"){const m=B(Re);return[m,m]}const o=B(He),d=B(Te);return[Math.min(o,d),Math.max(o,d)]},[e.mode,Se,Xe,B,Re,He,Te]),je=e.mode==="point"?e.value!==void 0:e.mode==="range"?e.range!==void 0:O?e.microValue!==void 0:e.microRange!==void 0,[nt,W]=i.useState(()=>[_e,Je]),[F,Q]=i.useState(null),[x,Y]=i.useState(null),D=i.useRef(null),[X,ce]=i.useState("high"),[he,Le]=i.useState(null),[Ne,Qe]=i.useState(null),be=F?F[0]:je?_e:nt[0],we=F?F[1]:je?Je:nt[1],Nr=i.useRef([be,we]),de=e.mode==="vernier",Ct=e.mode==="vernier"?e.vernierOrientation??(c?"macro-left":"macro-top"):"macro-top",C=Ct==="macro-top"||Ct==="macro-left",Ft=e.mode==="vernier"?e.showVernierProjection??!0:!1,la=e.mode==="vernier"?e.showVernierTicks??!0:!1,v=e.mode==="vernier"?e.showHairline??!0:!1,b=de?e.macroUnit??t:t,M=de?e.microUnit??t:t,mr=de?e.macroIsDiscrete??!1:A,ft=de?e.microIsDiscrete??!1:A,at=de?e.macroAllowedDates??a:a,sa=de?e.microAllowedDates??a:a,Yr=de?e.formatMacroLabel??e.formatLabel:e.formatLabel,Or=de?e.formatMicroLabel??e.formatLabel:e.formatLabel,_o=e.mode==="vernier"?e.macroRange[0].getTime():void 0,jo=e.mode==="vernier"?e.macroRange[1].getTime():void 0,Fo=He?.getTime(),zo=Te?.getTime(),[Fe,Hr]=i.useState(null),xt=i.useRef(null),[fr,zt]=i.useState(()=>O?"micro-point":"micro-high");let Ce=fr;const Mn=O?fr==="micro-low"||fr==="micro-high"||fr==="micro-connect"?"micro-point":null:fr==="micro-point"?"micro-high":null;Mn!==null&&(Ce=Mn,zt(Mn));const Pe=i.useMemo(()=>K(b,r),[U,b]),Ge=i.useMemo(()=>{const o=K(b,n);if(de&&o<=Pe)throw new RangeError(`PeriodSlider: macroUnit "${b}" cannot distinguish minDate from maxDate (minDate: ${Me(r)}, maxDate: ${Me(n)})`);return o},[de,U,P,Pe,b]),De=i.useMemo(()=>de?vt(at,b,r,n):[],[de,at,b,U,P]),ke=i.useMemo(()=>e.mode!=="vernier"?Pe:Math.max(Pe,Math.min(Ge,K(b,e.macroRange[0]))),[e.mode,_o,Pe,Ge,b]),Ie=i.useMemo(()=>e.mode!=="vernier"?Ge:Math.max(Pe,Math.min(Ge,K(b,e.macroRange[1]))),[e.mode,jo,Pe,Ge,b]),gt=i.useMemo(()=>ne(b,ke),[b,ke]),$t=i.useMemo(()=>ne(b,Ie),[b,Ie]),_r=i.useMemo(()=>e.mode!=="vernier"?[r,n]:mt(b,M,[gt,$t],r,n),[e.mode,gt,$t,b,M,U,P]),ve=i.useMemo(()=>K(M,_r[0]),[M,_r]),ye=i.useMemo(()=>K(M,_r[1]),[M,_r]),ca=i.useMemo(()=>de?vt(sa,M,r,n):[],[de,sa,M,U,P]),vn=(o,d)=>ca.filter(m=>{const f=K(M,m);return f>=o&&f<=d}),ie=i.useMemo(()=>vn(ve,ye),[ca,M,ve,ye]),Ut=mr&&De.length>0,et=ft&&ie.length>0,Dt=(o,d,m,f)=>d.length>0?K(M,d[me(d,o,M)]):Math.max(m,Math.min(f,K(M,o))),Bt=et?ie:[],Ae=i.useMemo(()=>oe===null?ve:Dt(oe[0],Bt,ve,ye),[Fo,ve,ye,M,oe,Bt]),Ye=i.useMemo(()=>oe===null?ye:Dt(oe[1],Bt,ve,ye),[zo,ve,ye,M,oe,Bt]),pt=i.useMemo(()=>ne(M,Ae),[M,Ae]),Rt=i.useMemo(()=>ne(M,Ye),[M,Ye]),ua=!de||oe===null?null:{macroUnit:b,macroLowEnc:ke,macroHighEnc:Ie,microUnit:M,microLowEnc:K(M,oe[0]),microHighEnc:K(M,oe[1])},xn=i.useRef(ua),jr=Math.max(1,Ge-Pe),tt=Ut?tn(De,b,l,gt):Math.max(0,Math.min(1,(ke-Pe)/jr)),ot=Math.max(tt,Ut?tn(De,b,l,$t):Math.min(1,(Ie-Pe)/jr)),Fr=Math.max(1,ye-ve),Wt=et?tn(ie,M,l,pt):Math.max(0,Math.min(1,(Ae-ve)/Fr)),gr=Math.max(Wt,et?tn(ie,M,l,Rt):Math.min(1,(Ye-ve)/Fr)),Dn=i.useRef({timerId:null,emit:null}),zr=i.useRef({timerId:null,emit:null}),Ur=i.useRef({timerId:null,emit:null});i.useEffect(()=>{const o=[Dn,zr,Ur];return()=>{for(const d of o)Kn(d.current)}},[]);const Xt=i.useCallback((o,d,m)=>{Kn(o);const{debounceMs:f}=G.current;if(m||!f||f<=0){d();return}o.emit=d,o.timerId=setTimeout(()=>{o.timerId=null,o.emit=null,d()},f)},[]),da=i.useCallback(o=>{const d=o.emit;Kn(o),d?.()},[]),Gt=i.useCallback(o=>new Date(Math.min(Math.max(o.getTime(),U),P)),[U,P]),St=i.useCallback((o,d,m=!1)=>{const[f,p]=Nr.current;if((G.current.mode==="point"?o===f:o===f&&d===p)&&Dn.current.timerId===null)return;const V=le(o),k=le(d),ee=()=>{const ge=G.current;ge.mode==="point"?ge.onChangePoint?.(V):ge.mode==="range"&&ge.onChangeRange?.(V,k)};Xt(Dn.current,ee,m)},[le,Xt]),kt=i.useCallback((o,d,m=!1)=>{const f=xn.current;if(G.current.mode!=="vernier"||f===null)return;const p=Gt(o),E=Gt(d);K(f.macroUnit,p)===f.macroLowEnc&&K(f.macroUnit,E)===f.macroHighEnc&&zr.current.timerId===null||Xt(zr.current,()=>{const V=G.current;V.mode==="vernier"&&V.onChangeMacroRange?.(p,E)},m)},[Gt,Xt]),Ke=i.useCallback((o,d,m=!1)=>{const f=G.current,p=xn.current;if(f.mode!=="vernier"||p===null)return;const E=Gt(o),V=Gt(d);K(p.microUnit,E)===p.microLowEnc&&K(p.microUnit,V)===p.microHighEnc&&Ur.current.timerId===null||((O?f.microValue===void 0:f.microRange===void 0)&&j([E,V]),Xt(Ur.current,()=>{const k=G.current;if(k.mode==="vernier"){if(O){k.onChangeMicroPoint?.(E);return}k.onChangeMicroRange?.(E,V)}},m))},[Gt,Xt,O]),ma=i.useCallback((o,d=!1)=>{Ke(o,o,d)},[Ke]),It=i.useCallback(o=>{if(A&&l==="time"&&y.length>1){const f=Math.max(0,Math.min(y.length-1,Math.round(o))),p=y[0].getTime(),V=y[y.length-1].getTime()-p;if(V<=0)return 0;const k=y[f].getTime();return Math.max(0,Math.min(100,(k-p)/V*100))}const d=I-N;if(d<=0)return 0;const m=(o-N)/d*100;return Math.max(0,Math.min(100,m))},[A,l,y,N,I]),pn=i.useCallback(o=>{const d=Math.max(0,Math.min(100,o));if(A){if(l==="time"&&y.length>1){const p=y[0].getTime(),V=y[y.length-1].getTime()-p,k=p+d/100*V;return me(y,new Date(k),t)}const f=Math.round(d/100*(y.length-1));return Math.max(0,Math.min(y.length-1,f))}const m=N+d/100*(I-N);return Math.round(m)},[A,l,y,N,I,t]),hr=i.useRef(null),fa=i.useRef(null),ga=i.useRef(0),ze=i.useRef(null),Rn=i.useRef(null),ha=i.useRef(null),ba=i.useRef(null),[Sn,wa]=i.useState(0),[Uo,Kt]=sr(),[Bo,Ma]=sr(),[Wo,va]=sr(),[Xo,xa]=sr(),[Go,Ln]=sr(),[Ko,Da]=sr(),qo=te?Kt===null?void 0:{estimatedWidthPx:Kt.widthPx,estimatedHeightPx:Kt.heightPx}:qn(Kt,Ma),yn=!te&&be===we,Tn=ke===Ie,Pn=!O&&Ae===Ye,Zo=C?"top":"bottom",Jo=C?"bottom":"top",pa=L&&!c,Qo=pa&&!O,An={isPointMode:te,isVertical:c,autoSlantLabels:L,isMerged:yn,trackLengthPx:Sn,labelPosition:R,config:qo},En={trackLengthPx:Sn,labelPosition:Zo,config:qn(va,xa),isMerged:Tn,isSlantable:pa},Cn={trackLengthPx:Sn,labelPosition:Jo,config:qn(Ln,Da),isMerged:Pn,isSlantable:Qo};i.useEffect(()=>{const o=ze.current;if(!o)return;const d=()=>{const f=o.getBoundingClientRect(),p=c?f.height:f.width;p>0&&wa(E=>Math.abs(E-p)<.5?E:p)};if(d(),typeof ResizeObserver<"u"){const f=new ResizeObserver(p=>{for(const E of p){const V=c?E.contentRect.height:E.contentRect.width;V>0&&wa(k=>Math.abs(k-V)<.5?k:V)}});return f.observe(o),()=>f.disconnect()}const m=o.ownerDocument.defaultView;if(m)return m.addEventListener("resize",d),()=>m.removeEventListener("resize",d)},[c]);const qt=i.useCallback((o,d,m)=>{const f=c?m.height:m.width;if(!(Number.isFinite(f)&&f>0))return null;const p=c?m.bottom-d:o-m.left;return Number.isFinite(p)?Math.max(0,Math.min(1,p/f)):null},[c]),Ra=i.useCallback((o,d)=>{const m=ze.current;if(!m)return null;const f=qt(o,d,m.getBoundingClientRect());return f===null?null:f*100},[qt]),br=i.useRef(null),ht=i.useRef(null),Br=i.useRef({macroLowRatio:tt,macroHighRatio:ot,isVertical:c,isMacroFirstRail:C}),Sa=i.useRef({flat:An,macro:En,micro:Cn});i.useLayoutEffect(()=>{Br.current={macroLowRatio:tt,macroHighRatio:ot,isVertical:c,isMacroFirstRail:C},Sa.current={flat:An,macro:En,micro:Cn},G.current=e,Nr.current=[be,we],xn.current=ua,D.current=x,xt.current=Fe});const La=(o,d)=>{const m=Br.current;Rn.current?.setAttribute("d",Bn(o,d,m.isVertical,m.isMacroFirstRail))},ei=(o,d,m)=>{const f=Sa.current;return o==="flat"?oo(d*100,m*100,f.flat).placements:Zn(o,d,m,o==="macro"?f.macro:f.micro).placements},wr=(o,d,m)=>{const f=ze.current;if(!f)return;br.current={rail:o,lowRatio:d,highRatio:m},Ai(f,o,d,m);const p=ei(o,d,m);p!==null&&Pi(f,o,p),o==="macro"&&La(d,m)},Vt=i.useCallback(()=>{ht.current!==null&&(clearTimeout(ht.current),ht.current=null);const o=ze.current;o&&(o.removeAttribute(Fn),o.style.removeProperty(zn))},[]),ya=()=>{const o=ze.current;if(br.current===null||!o){br.current=null;return}br.current=null,ht.current!==null&&clearTimeout(ht.current),o.style.setProperty(zn,`${qa}ms`),o.setAttribute(Fn,"true"),Ei(o),La(Br.current.macroLowRatio,Br.current.macroHighRatio),ht.current=setTimeout(()=>{ht.current=null,o.removeAttribute(Fn),o.style.removeProperty(zn)},qa)};i.useLayoutEffect(()=>{const o=br.current;o!==null&&wr(o.rail,o.lowRatio,o.highRatio)}),i.useEffect(()=>()=>{ht.current!==null&&clearTimeout(ht.current)},[]);const Mr=i.useRef(null),vr=i.useRef(null),it=i.useRef(null),$n=i.useRef(null),xr=i.useRef(null),Lt=i.useCallback(()=>Mr.current!==null||vr.current!==null,[]),Ta=o=>{if(s)return;if(de){const _=vr.current;if(!_||o.pointerId!==_.pointerId||!ze.current)return;const rt=qt(o.clientX,o.clientY,ze.current.getBoundingClientRect());if(rt===null)return;if(_.handle==="macro-low"||_.handle==="macro-high"||_.handle==="macro-connect"){const[Ee,pe,bt]=ko(_.handle,rt,_.startPointerRatio,_.startMacroLowRatio,_.startMacroHighRatio);wr("macro",Ee,pe),bt!==xt.current&&(xt.current=bt,Hr(bt),zt(bt));let Ue,st;if(Ut){const yt=rn(De,b,l,Ee),Tt=Math.max(yt,rn(De,b,l,pe));Ue=De[yt],st=De[Tt]}else{const yt=Math.round(Pe+Ee*jr),Tt=Math.round(Pe+pe*jr);Ue=ne(b,yt),st=ne(b,Tt)}const Sr=`${Ue.getTime()}_${st.getTime()}`;Sr!==$n.current&&($n.current=Sr,kt(Ue,st));const[wt,Yt]=mt(b,M,[Ue,st],r,n),_n=K(M,wt),jn=K(M,Yt),Wa=ft?vn(_n,jn):[];let nr,ar;if(_.handle==="macro-connect"){const yt=wt,Tt=Yt;let or,ir;if(b==="year"){const Pt=Ue.getFullYear()-_.startMacroLowDate.getFullYear();or=$e("year",_.initialMicroLowDate,Pt),ir=$e("year",_.initialMicroHighDate,Pt)}else if(b==="month"){const Pt=(Ue.getFullYear()-_.startMacroLowDate.getFullYear())*12+(Ue.getMonth()-_.startMacroLowDate.getMonth());or=$e("month",_.initialMicroLowDate,Pt),ir=$e("month",_.initialMicroHighDate,Pt)}else{const Pt=Math.round((Ue.getTime()-_.startMacroLowDate.getTime())/864e5);or=$e("day",_.initialMicroLowDate,Pt),ir=$e("day",_.initialMicroHighDate,Pt)}const lr=yt.getTime(),Lr=Tt.getTime(),Ka=_.initialMicroHighDate.getTime()-_.initialMicroLowDate.getTime();let yr=or.getTime(),Tr=ir.getTime();yr<lr&&(yr=lr,Tr=Math.min(Lr,yr+Ka)),Tr>Lr&&(Tr=Lr,yr=Math.max(lr,Tr-Ka)),nr=We(M,new Date(yr)),ar=We(M,new Date(Tr))}else{const yt=wt.getTime(),Tt=Yt.getTime(),or=_.initialMicroLowDate.getTime(),ir=_.initialMicroHighDate.getTime(),lr=Math.max(yt,Math.min(Tt,or)),Lr=Math.max(lr,Math.min(Tt,ir));nr=We(M,new Date(lr)),ar=We(M,new Date(Lr))}const Xa=Dt(nr,Wa,_n,jn),Ti=Math.max(Xa,Dt(ar,Wa,_n,jn));nr=ne(M,Xa),ar=ne(M,Ti);const Ga=`${nr.getTime()}_${ar.getTime()}`;Ga!==xr.current&&(xr.current=Ga,Ke(nr,ar))}else if(_.handle==="micro-low"||_.handle==="micro-high"||_.handle==="micro-connect"||_.handle==="micro-point"){const[Ee,pe,bt]=Io(_.handle,rt,_.startPointerRatio,_.startMicroLowRatio,_.startMicroHighRatio);wr("micro",Ee,pe),bt!==xt.current&&(xt.current=bt,Hr(bt),zt(bt));let Ue,st;if(et){const wt=rn(ie,M,l,Ee),Yt=Math.max(wt,rn(ie,M,l,pe));Ue=ie[wt],st=ie[Yt]}else{const wt=Dt(ne(M,Math.round(ve+Ee*Fr)),Bt,ve,ye),Yt=Math.max(wt,Dt(ne(M,Math.round(ve+pe*Fr)),Bt,ve,ye));Ue=ne(M,wt),st=ne(M,Yt)}const Sr=`${Ue.getTime()}_${st.getTime()}`;Sr!==xr.current&&(xr.current=Sr,Ke(Ue,st))}return}const d=Mr.current;if(!d||o.pointerId!==d.pointerId||!ze.current)return;const m=ze.current.getBoundingClientRect(),f=c?o.clientY:o.clientX,p=c?m.height:m.width;if(!(Number.isFinite(p)&&p>0))return;if(d.handle==="connect"){const _=c?(d.startPointerPos-f)/p:(f-d.startPointerPos)/p,[rt,Ee]=na(_,d.startLowRatio,d.startHighRatio);wr("flat",rt,Ee);const pe=So({posDiffPct:_,startLowVal:d.startLowVal,startHighVal:d.startHighVal,rangeMin:N,rangeMax:I,isDiscrete:A,sortedAllowedDates:y,snapMode:l,unit:t});if(it.current&&it.current[0]===pe[0]&&it.current[1]===pe[1])return;it.current=pe,Q(pe),St(pe[0],pe[1],!1);return}const E=qt(o.clientX,o.clientY,m);if(E===null)return;const[V,k]=ln(te?"point":d.handle,E,d.startLowRatio,d.startHighRatio);wr("flat",V,k);const ee=pn(E*100),[ge,xe]=ea(d.handle,ee,d.startLowVal,d.startHighVal,N,I,te);if((!it.current||it.current[0]!==ge||it.current[1]!==xe)&&(it.current=[ge,xe],Q([ge,xe]),St(ge,xe,!1)),!te&&(d.handle==="low"||d.handle==="high")){const _=hn(d.handle,E,d.startLowRatio,d.startHighRatio);D.current!==_&&(D.current=_,Y(_),ce(_))}},Pa=o=>{if(de){const f=vr.current;if(!f||o.pointerId!==f.pointerId)return;ya(),$n.current=null,xr.current=null,vr.current=null,xt.current=null,Hr(null),da(zr.current),da(Ur.current);return}const d=Mr.current;if(!d||o.pointerId!==d.pointerId)return;ya();const m=it.current??F;m&&(St(m[0],m[1],!0),W(m)),it.current=null,Q(null),Mr.current=null,D.current=null,Y(null)},kn=i.useRef(Ta),Aa=i.useRef(Pa);i.useLayoutEffect(()=>{kn.current=Ta,Aa.current=Pa});const Ea=x!==null||Fe!==null;i.useEffect(()=>{if(!Ea)return;const o=hr.current?.ownerDocument.defaultView;if(!o)return;const d=f=>kn.current(f),m=f=>Aa.current(f);return o.addEventListener("pointermove",d),o.addEventListener("pointerup",m),o.addEventListener("pointercancel",m),o.addEventListener("lostpointercapture",m),()=>{o.removeEventListener("pointermove",d),o.removeEventListener("pointerup",m),o.removeEventListener("pointercancel",m),o.removeEventListener("lostpointercapture",m)}},[Ea]);const In=i.useCallback((o,d,m,f)=>{Vt(),so(o,d),Mr.current={pointerId:d,handle:m,startPointerPos:f,startLowVal:be,startHighVal:we,startLowRatio:It(be)/100,startHighRatio:It(we)/100},D.current=m,Y(m),m!=="connect"&&ce(m)},[be,we,It]),Ca=i.useCallback((o,d,m,f)=>{G.current.mode==="vernier"&&(Vt(),so(o,d),vr.current={pointerId:d,handle:m,startPointerRatio:f,startMacroLowRatio:tt,startMacroHighRatio:ot,startMicroLowRatio:Wt,startMicroHighRatio:gr,startMacroLowDate:gt,initialMicroLowDate:pt,initialMicroHighDate:Rt},xt.current=m,Hr(m),zt(m))},[tt,ot,Wt,gr,gt,pt,Rt]),$a=o=>d=>{if(s||Lt())return;d.stopPropagation(),d.preventDefault(),ce(o);const m=c?d.clientY:d.clientX;In(d.currentTarget,d.pointerId,o,m)},ka=o=>()=>{s||D.current!==null||ce(o)},Wr=o=>()=>{s||xt.current!==null||zt(o)},Zt=o=>d=>{if(s||Lt())return;d.stopPropagation(),d.preventDefault();const m=ze.current;if(!m)return;const f=qt(d.clientX,d.clientY,m.getBoundingClientRect());f!==null&&Ca(d.currentTarget,d.pointerId,o,f)},ti=o=>{if(s||T||Lt())return;o.stopPropagation(),o.preventDefault();const d=c?o.clientY:o.clientX;In(o.currentTarget,o.pointerId,"connect",d)},ri=o=>{if(s||Lt())return;if(de){const k=ze.current;if(!k)return;const ee=k.getBoundingClientRect(),ge=qt(o.clientX,o.clientY,ee);if(ge===null)return;const xe=c?o.clientX-(ee.left+ee.width/2):o.clientY-(ee.top+ee.height/2),_=$o(ge,xe,tt,ot,Wt,gr,Ct,void 0,!T,O?"point":"range");Ca(o.currentTarget,o.pointerId,_,ge),kn.current(o.nativeEvent);return}const d=Ra(o.clientX,o.clientY);if(d===null)return;const m=pn(d);let f="low";if(!te){const k=Math.abs(m-be),ee=Math.abs(m-we);k<ee?f="low":ee<k?f="high":f=m>we?"high":"low"}ce(f);const[p,E]=ea(f,m,be,we,N,I,te);Q([p,E]),St(p,E,!0);const V=c?o.clientY:o.clientX;In(o.currentTarget,o.pointerId,f,V)},ni=o=>{if(s||de||x!==null)return;const d=Ra(o.clientX,o.clientY);if(d===null)return;const m=pn(d);Le(m),Qe(It(m))},ai=()=>{Le(null),Qe(null)},Ia=o=>d=>{if(s||Lt())return;ce(o);const m=Lo(d.key,o,be,we,N,I,te,1);m&&(d.preventDefault(),Vt(),je||W(m),St(m[0],m[1],!0))},Jt=(o,d)=>{if(oe===null)return;const[m,f]=mt(b,M,[o,d],r,n),p=K(M,m),E=K(M,f),V=ft?vn(p,E):[],k=Dt(oe[0],V,p,E),ee=Math.max(k,Dt(oe[1],V,p,E));Ke(ne(M,k),ne(M,ee),!0)},Xr=o=>d=>{if(s||!de||e.mode!=="vernier"||Lt())return;zt(o);let m=0,f=!1,p=!1;switch(d.key){case"ArrowRight":case"ArrowUp":m=1;break;case"ArrowLeft":case"ArrowDown":m=-1;break;case"PageUp":m=5;break;case"PageDown":m=-5;break;case"Home":f=!0;break;case"End":p=!0;break;default:return}if(d.preventDefault(),Vt(),o==="macro-low"){const E=ne(b,ke),V=ne(b,Ie);if(Ut){const ge=Ar(De,b,E,De[0],V,m,f,p);if(ge===me(De,E,b))return;const xe=De[ge];kt(xe,V,!0),Jt(xe,V);return}let k;if(f?k=Pe:p?k=Ie:k=Math.max(Pe,Math.min(Ie,ke+m)),k===ke)return;const ee=ne(b,k);kt(ee,V,!0),Jt(ee,V)}else if(o==="macro-high"){const E=ne(b,ke),V=ne(b,Ie);if(Ut){const ge=Ar(De,b,V,E,De[De.length-1],m,f,p);if(ge===me(De,V,b))return;const xe=De[ge];kt(E,xe,!0),Jt(E,xe);return}let k;if(f?k=ke:p?k=Ge:k=Math.max(ke,Math.min(Ge,Ie+m)),k===Ie)return;const ee=ne(b,k);kt(E,ee,!0),Jt(E,ee)}else if(o==="micro-low"){const E=ne(M,Ae),V=ne(M,Ye);if(et){const ee=Ar(ie,M,E,ie[0],V,m,f,p);if(ee===me(ie,E,M))return;Ke(ie[ee],V,!0);return}let k;if(f?k=ve:p?k=Ye:k=Math.max(ve,Math.min(Ye,Ae+m)),k===Ae)return;Ke(ne(M,k),V,!0)}else if(o==="micro-high"){const E=ne(M,Ae),V=ne(M,Ye);if(et){const ee=Ar(ie,M,V,E,ie[ie.length-1],m,f,p);if(ee===me(ie,V,M))return;Ke(E,ie[ee],!0);return}let k;if(f?k=Ae:p?k=ye:k=Math.max(Ae,Math.min(ye,Ye+m)),k===Ye)return;Ke(E,ne(M,k),!0)}else if(o==="micro-point"){const E=ne(M,Ae);if(et){const k=Ar(ie,M,E,ie[0],ie[ie.length-1],m,f,p);if(k===me(ie,E,M))return;ma(ie[k],!0);return}let V;if(f?V=ve:p?V=ye:V=Math.max(ve,Math.min(ye,Ae+m)),V===Ae)return;ma(ne(M,V),!0)}},oi=o=>{if(e.mode!=="vernier")return;if(Vt(),Ut){const V=De.length-1,k=me(De,gt,b),ee=me(De,$t,b),ge=ee-k;let xe=k+o,_=ee+o;if(o<0&&xe<0?(xe=0,_=Math.min(V,ge)):o>0&&_>V&&(_=V,xe=Math.max(0,V-ge)),xe===k&&_===ee)return;const rt=De[xe],Ee=De[_];kt(rt,Ee,!0),Jt(rt,Ee);return}const d=Ie-ke;let m=ke+o,f=Ie+o;if(o<0&&m<Pe?(m=Pe,f=Math.min(Ge,m+d)):o>0&&f>Ge&&(f=Ge,m=Math.max(Pe,f-d)),m===ke&&f===Ie)return;const p=ne(b,m),E=ne(b,f);kt(p,E,!0),Jt(p,E)},Vn=i.useCallback(o=>{const d=G.current;if(!(d.disabled||Lt()))if(Vt(),d.mode==="point"){const m=Math.max(N,Math.min(I,be+o));je||W([m,m]),St(m,m,!0)}else if(d.mode==="vernier"){if(et){const ge=ie.length-1,xe=me(ie,pt,M),_=me(ie,Rt,M),rt=_-xe;let Ee=xe+o,pe=_+o;o<0&&Ee<0?(Ee=0,pe=Math.min(ge,rt)):o>0&&pe>ge&&(pe=ge,Ee=Math.max(0,ge-rt)),(Ee!==xe||pe!==_)&&Ke(ie[Ee],ie[pe],!0);return}const m=Ae,f=Ye,p=ve,E=ye,V=f-m;let k=m+o,ee=f+o;o<0&&k<p?(k=p,ee=Math.min(E,k+V)):o>0&&ee>E&&(ee=E,k=Math.max(p,ee-V)),(k!==m||ee!==f)&&Ke(ne(M,k),ne(M,ee),!0)}else{const m=we-be;let f=be+o,p=we+o;o<0&&f<N?(f=N,p=Math.min(I,f+m)):o>0&&p>I&&(p=I,f=Math.max(N,p-m)),f<=p&&(je||W([f,p]),St(f,p,!0))}},[be,we,N,I,je,St,Ke,Ae,Ye,ve,ye,M,et,ie,pt,Rt,Vt]),Va=o=>!s&&Wn(hr.current,o),Na=(o,d)=>{const m=fa.current,f=ze.current,p=hr.current;if(s||m===null||f===null||p===null||!Vi(m,p,ga.current,c,o,d))return null;const E=f.getBoundingClientRect();return Math.abs(c?o-(E.left+E.width/2):d-(E.top+E.height/2))},Ya=o=>{if(s||Lt())return;const d=Co(o.deltaX,o.deltaY,c);if(d===0)return;o.preventDefault();const m=o.target,f=Wn(ha.current,m)||Wn(ba.current,m);if(!de||f){Vn(d);return}const p=ze.current;if(!p)return;const E=p.getBoundingClientRect(),V=c?o.clientX-(E.left+E.width/2):o.clientY-(E.top+E.height/2);if(ia(V,Ct)==="macro"){oi(d);return}Vn(d)},Gr=i.useRef({ownsWheelHit:Va,distanceToRailPx:Na,stepFromRangeAreaWheel:Ya});i.useLayoutEffect(()=>{Gr.current={ownsWheelHit:Va,distanceToRailPx:Na,stepFromRangeAreaWheel:Ya}}),i.useEffect(()=>{const o=hr.current?.ownerDocument.defaultView;if(o)return Yi(o,{ownsHit:d=>Gr.current.ownsWheelHit(d),distanceToRailPx:(d,m)=>Gr.current.distanceToRailPx(d,m),step:d=>Gr.current.stepFromRangeAreaWheel(d)})},[]);const Kr=It(be),qr=It(we),Nn=le(be),Yn=le(we),On=oo(Kr,qr,An),Dr=On.slant,pr=x==="low"||x!=="high"&&X==="low",Rr=!te&&(x==="high"||x!=="low"&&X==="high"),ii=Tn&&Ce!=="macro-low",li=Tn&&Ce==="macro-low",si=Pn&&Ce!=="micro-low",ci=Pn&&Ce==="micro-low",Qt=Zn("macro",tt,ot,En),er=Zn("micro",Wt,gr,Cn),ui=Math.min(Kr,qr),di=Math.max(Kr,qr),[Oa,Ha]=kr.flat,[mi,fi]=kr.macro,[gi,hi]=kr.micro,_a=At(Oa,Kr),ja=At(Ha,qr),Hn=At(Oa,ui),Fa=`calc(${At(Ha,di)} - ${Hn})`,tr=At(mi,tt*100),Zr=At(fi,ot*100),rr=At(gi,Wt*100),Jr=At(hi,gr*100),bi=c?{bottom:Hn,height:Fa,top:"auto",left:"0",right:"0"}:{left:Hn,width:Fa,top:"0",bottom:"0"},wi=Math.max(.01,ot-tt),za=Math.max(.06,Math.min(.25,.28*Math.sqrt(wi))),Mi=c?{bottom:_a,left:"50%",transform:"translate(-50%, 50%)",zIndex:pr?40:30}:{left:_a,top:"50%",transform:"translate(-50%, -50%)",zIndex:pr?40:30},vi=c?{bottom:ja,left:"50%",transform:"translate(-50%, 50%)",zIndex:Rr?40:30}:{left:ja,top:"50%",transform:"translate(-50%, -50%)",zIndex:Rr?40:30},xi=c?{bottom:`${Ne}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${Ne}%`,top:"50%",transform:"translate(-50%, -50%)"},Ua=he!==null?le(he):null,Di=h!=="hover"&&he!==null&&(he===be||!te&&he===we),pi=et?K(M,ie[0]):ve,Ri=et?K(M,ie[ie.length-1]):ye,Si=de?Ae>pi:be>N,Li=de?Ye<Ri:we<I,Qr=el(de?[{side:C?"before":"after",box:on(va,xa),...c?{reach:"inline-size"}:{reach:"rotated",angleDeg:Qt.slant.lowAngleDeg,centreOffsetPx:null,alongPushPx:Qt.slant.lowOffsetX}},{side:C?"after":"before",box:O?Ln:on(Ln,Da),...c?{reach:"inline-size"}:{reach:"rotated",angleDeg:er.slant.lowAngleDeg,centreOffsetPx:null,alongPushPx:er.slant.lowOffsetX}}]:[{side:c||R==="top"?"before":"after",box:te?Kt:on(Kt,Ma),...c?{reach:"inline-size"}:{reach:"rotated",angleDeg:Dr.lowAngleDeg,centreOffsetPx:Dr.lowOffsetY,alongPushPx:Dr.lowOffsetX}}]),yi=Qr===void 0?e.style:{...e.style,...Qr.style};i.useLayoutEffect(()=>{ga.current=Qr===void 0?0:Qr.mainPx});const lt=O?"micro-point":"micro-low",Nt=s?"cursor-not-allowed opacity-50":"cursor-pointer",Ba=o=>{const d=c?"vertical":"horizontal",m=o==="decrease",f=c?!m:m;return w.jsx(jt,{ref:m?ha:ba,neighbour:"rail",direction:tl[d][o],disabled:s,canStep:m?Si:Li,onStep:()=>Vn(m?-1:1),ariaLabel:m?se:re,className:`period-slider-stepper-btn ${rl[d][o]} ${lo[d][f?"leading":"trailing"]}`})};return w.jsxs("div",{ref:hr,style:yi,className:`period-slider grid select-none place-items-center ${nl[c?"vertical":"horizontal"][g?"withSteppers":"railOnly"]} ${u}`,"data-disabled":s?"true":void 0,"data-unit":t,"data-mode":e.mode,"data-orientation":c?"vertical":"horizontal","data-label-position":R,"data-color-scheme":J,children:[w.jsx("div",{ref:fa,"data-range-area":"true","aria-hidden":"true",className:"period-slider-range-area"}),g&&Ba(c?"increase":"decrease"),w.jsx("div",{ref:ze,"data-testid":"period-slider-track","data-orientation":c?"vertical":"horizontal","data-vernier-orientation":de?Ct:void 0,className:`period-slider-track relative touch-none rounded-full ${lo[c?"vertical":"horizontal"][g?"rail":"railOnly"]} ${Nt}`,onPointerDown:ri,onPointerMove:ni,onPointerLeave:ai,children:de?w.jsxs(w.Fragment,{children:[Ft&&(c?w.jsxs("svg",{className:"period-slider-vernier-projection is-vertical",role:"presentation","aria-hidden":"true",width:"32",height:"100%",viewBox:"0 0 32 100",preserveAspectRatio:"none",children:[w.jsx("defs",{children:w.jsxs("linearGradient",{id:ae,x1:"0",y1:"0",x2:"1",y2:"0",children:[w.jsx("stop",{offset:"0%",stopColor:C?z.macro:z.micro,stopOpacity:"0.28"}),w.jsx("stop",{offset:"100%",stopColor:C?z.micro:z.macro,stopOpacity:za})]})}),w.jsx("path",{ref:Rn,"data-testid":"period-slider-vernier-projection",d:Bn(tt,ot,c,C),fill:`url(#${ae})`})]}):w.jsxs("svg",{className:"period-slider-vernier-projection",role:"presentation","aria-hidden":"true",width:"100%",height:"32",viewBox:"0 0 100 32",preserveAspectRatio:"none",children:[w.jsx("defs",{children:w.jsxs("linearGradient",{id:ae,x1:"0",y1:"0",x2:"0",y2:"1",children:[w.jsx("stop",{offset:"0%",stopColor:C?z.macro:z.micro,stopOpacity:"0.28"}),w.jsx("stop",{offset:"100%",stopColor:C?z.micro:z.macro,stopOpacity:za})]})}),w.jsx("path",{ref:Rn,"data-testid":"period-slider-vernier-projection",d:Bn(tt,ot,c,C),fill:`url(#${ae})`})]})),!T&&w.jsxs(w.Fragment,{children:[w.jsx("div",{"data-testid":"period-slider-connect-macro",className:"period-slider-connect-macro",style:c?{bottom:`calc(${tr} - 8px)`,height:`calc(${Zr} - ${tr} + 16px)`}:{left:`calc(${tr} - 8px)`,width:`calc(${Zr} - ${tr} + 16px)`},onPointerDown:Zt("macro-connect")}),!O&&w.jsx("div",{"data-testid":"period-slider-connect-micro",className:"period-slider-connect-micro",style:c?{bottom:`calc(${rr} - 8px)`,height:`calc(${Jr} - ${rr} + 16px)`}:{left:`calc(${rr} - 8px)`,width:`calc(${Jr} - ${rr} + 16px)`},onPointerDown:Zt("micro-connect")})]}),la&&w.jsxs("div",{className:"period-slider-vernier-ticks pointer-events-none absolute inset-0",children:[[.2,.4,.6,.8].map(o=>w.jsx("div",{"data-testid":"period-slider-tick","data-tick-scale":"macro",className:"period-slider-tick period-slider-tick-macro",style:c?{bottom:`${o*100}%`}:{left:`${o*100}%`}},`macro-tick-${o}`)),[.1,.2,.3,.4,.5,.6,.7,.8,.9].map(o=>w.jsx("div",{"data-testid":"period-slider-tick","data-tick-scale":"micro",className:"period-slider-tick period-slider-tick-micro",style:c?{bottom:`${o*100}%`}:{left:`${o*100}%`}},`micro-tick-${o}`))]}),w.jsxs("div",{tabIndex:s?-1:0,role:"slider","aria-label":e.macroLowerAriaLabel??"Macro range start","aria-disabled":s?"true":void 0,"aria-valuemin":Pe,"aria-valuemax":Ie,"aria-valuenow":ke,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(gt,b):Ot(b,gt,Yr,S),"aria-orientation":c?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${c?"is-vertical":""} group absolute touch-none ${c?C?"after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:right-0 after:-left-4":"after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:-right-4 after:left-0":C?"after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:-top-4 after:bottom-0":"after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:top-0 after:-bottom-4"} after:content-[''] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 dark:focus-visible:ring-blue-400 ${Nt}`,style:c?{bottom:tr,left:C?0:"auto",right:C?"auto":0,transform:C?"translate(-100%, 50%)":"translate(100%, 50%)",zIndex:Fe==="macro-low"||Ce==="macro-low"?30:15}:{left:tr,top:C?0:"auto",bottom:C?"auto":0,transform:C?"translate(-50%, -100%)":"translate(-50%, 100%)",zIndex:Fe==="macro-low"||Ce==="macro-low"?30:15},onPointerDown:Zt("macro-low"),onKeyDown:Xr("macro-low"),onFocus:Wr("macro-low"),"data-active":Fe==="macro-low"?"true":void 0,"data-front":Ce==="macro-low"?"true":void 0,"data-vernier-pos":c?C?"left":"right":C?"top":"bottom","data-handle-type":"macro-low",children:[w.jsx(Cr,{type:"macro",isTop:C,isVertical:c,isLeft:C}),v&&w.jsx("div",{"data-testid":"period-slider-hairline",className:"period-slider-hairline"}),h!=="hover"&&w.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${h==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":h,"data-duplicate":ii?"true":void 0,"data-slanted":Qt.slant.isSlanted?"true":void 0,ref:Wo,style:Qt.lowStyle,children:Be(b,gt,Yr,S)})]}),w.jsxs("div",{tabIndex:s?-1:0,role:"slider","aria-label":e.macroUpperAriaLabel??"Macro range end","aria-disabled":s?"true":void 0,"aria-valuemin":ke,"aria-valuemax":Ge,"aria-valuenow":Ie,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText($t,b):Ot(b,$t,Yr,S),"aria-orientation":c?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${c?"is-vertical":""} group absolute touch-none ${c?C?"after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:right-0 after:-left-4":"after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:-right-4 after:left-0":C?"after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:-top-4 after:bottom-0":"after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:top-0 after:-bottom-4"} after:content-[''] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 dark:focus-visible:ring-blue-400 ${Nt}`,style:c?{bottom:Zr,left:C?0:"auto",right:C?"auto":0,transform:C?"translate(-100%, 50%)":"translate(100%, 50%)",zIndex:Fe==="macro-high"||Ce==="macro-high"?30:15}:{left:Zr,top:C?0:"auto",bottom:C?"auto":0,transform:C?"translate(-50%, -100%)":"translate(-50%, 100%)",zIndex:Fe==="macro-high"||Ce==="macro-high"?30:15},onPointerDown:Zt("macro-high"),onKeyDown:Xr("macro-high"),onFocus:Wr("macro-high"),"data-active":Fe==="macro-high"?"true":void 0,"data-front":Ce==="macro-high"?"true":void 0,"data-vernier-pos":c?C?"left":"right":C?"top":"bottom","data-handle-type":"macro-high",children:[w.jsx(Cr,{type:"macro",isTop:C,isVertical:c,isLeft:C}),v&&w.jsx("div",{"data-testid":"period-slider-hairline",className:"period-slider-hairline"}),h!=="hover"&&w.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${h==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":h,"data-duplicate":li?"true":void 0,"data-slanted":Qt.slant.isSlanted?"true":void 0,ref:Xo,style:Qt.highStyle,children:Be(b,$t,Yr,S)})]}),w.jsxs("div",{tabIndex:s?-1:0,role:"slider","aria-label":O?e.pointAriaLabel??"Micro selected date":e.lowerAriaLabel??"Micro range start","aria-disabled":s?"true":void 0,"aria-valuemin":ve,"aria-valuemax":O?ye:Ye,"aria-valuenow":Ae,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(pt,M):Ot(M,pt,Or,S),"aria-orientation":c?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${c?"is-vertical":""} group absolute touch-none ${c?C?"after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:-right-4 after:left-0":"after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:right-0 after:-left-4":C?"after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:top-0 after:-bottom-4":"after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:-top-4 after:bottom-0"} after:content-[''] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 dark:focus-visible:ring-blue-400 ${Nt}`,style:c?{bottom:rr,left:C?"auto":0,right:C?0:"auto",transform:C?"translate(100%, 50%)":"translate(-100%, 50%)",zIndex:Fe===lt||Ce===lt?30:20}:{left:rr,top:C?"auto":0,bottom:C?0:"auto",transform:C?"translate(-50%, 100%)":"translate(-50%, -100%)",zIndex:Fe===lt||Ce===lt?30:20},onPointerDown:Zt(lt),onKeyDown:Xr(lt),onFocus:Wr(lt),"data-active":Fe===lt?"true":void 0,"data-front":Ce===lt?"true":void 0,"data-vernier-pos":c?C?"right":"left":C?"bottom":"top","data-handle-type":lt,children:[w.jsx(Cr,{type:"micro",isTop:!C,isVertical:c,isLeft:!C}),v&&w.jsx("div",{"data-testid":"period-slider-hairline",className:"period-slider-hairline"}),h!=="hover"&&w.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${h==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":h,"data-duplicate":si?"true":void 0,"data-slanted":er.slant.isSlanted?"true":void 0,ref:Go,style:er.lowStyle,children:Be(M,pt,Or,S)})]}),!O&&w.jsxs("div",{tabIndex:s?-1:0,role:"slider","aria-label":e.upperAriaLabel??"Micro range end","aria-disabled":s?"true":void 0,"aria-valuemin":Ae,"aria-valuemax":ye,"aria-valuenow":Ye,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(Rt,M):Ot(M,Rt,Or,S),"aria-orientation":c?"vertical":"horizontal",className:`period-slider-handle period-slider-handle-vernier ${c?"is-vertical":""} group absolute touch-none ${c?C?"after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:-right-4 after:left-0":"after:absolute after:inset-y-[calc((100%-var(--ps-target-size))/2)] after:right-0 after:-left-4":C?"after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:top-0 after:-bottom-4":"after:absolute after:inset-x-[calc((100%-var(--ps-target-size))/2)] after:-top-4 after:bottom-0"} after:content-[''] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 dark:focus-visible:ring-blue-400 ${Nt}`,style:c?{bottom:Jr,left:C?"auto":0,right:C?0:"auto",transform:C?"translate(100%, 50%)":"translate(-100%, 50%)",zIndex:Fe==="micro-high"||Ce==="micro-high"?30:20}:{left:Jr,top:C?"auto":0,bottom:C?0:"auto",transform:C?"translate(-50%, 100%)":"translate(-50%, -100%)",zIndex:Fe==="micro-high"||Ce==="micro-high"?30:20},onPointerDown:Zt("micro-high"),onKeyDown:Xr("micro-high"),onFocus:Wr("micro-high"),"data-active":Fe==="micro-high"?"true":void 0,"data-front":Ce==="micro-high"?"true":void 0,"data-vernier-pos":c?C?"right":"left":C?"bottom":"top","data-handle-type":"micro-high",children:[w.jsx(Cr,{type:"micro",isTop:!C,isVertical:c,isLeft:!C}),v&&w.jsx("div",{"data-testid":"period-slider-hairline",className:"period-slider-hairline"}),h!=="hover"&&w.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${h==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":h,"data-duplicate":ci?"true":void 0,"data-slanted":er.slant.isSlanted?"true":void 0,ref:Ko,style:er.highStyle,children:Be(M,Rt,Or,S)})]})]}):w.jsxs(w.Fragment,{children:[!T&&w.jsx("div",{"data-testid":"period-slider-connect",className:"period-slider-connect absolute rounded-full",style:bi,onPointerDown:ti}),q&&A&&y.length>1&&w.jsx("div",{className:"period-slider-ticks pointer-events-none absolute inset-0",children:y.map((o,d)=>{const m=K(t,o),f=It(d),p=c?{bottom:`${f}%`,left:"50%",transform:"translate(-50%, 50%)"}:{left:`${f}%`,top:"50%",transform:"translate(-50%, -50%)"};return w.jsx("div",{"data-testid":"period-slider-tick",className:"period-slider-tick absolute h-1.5 w-1.5 rounded-full",style:p},`tick-${m}`)})}),!s&&he!==null&&Ne!==null&&x===null&&Ua&&w.jsxs("div",{"data-testid":"period-slider-hover-guide",className:"period-slider-hover-guide pointer-events-none absolute h-2 w-2",style:xi,children:[w.jsx("div",{"data-testid":"period-slider-hover-dot",className:"period-slider-hover-dot h-full w-full rounded-full border border-white/80 bg-[var(--aqps-accent-light)] shadow-[0_0_6px_var(--aqps-accent-glow)] dark:border-slate-800"}),w.jsx("div",{"data-testid":"period-slider-hover-tooltip","data-duplicate":Di?"true":void 0,className:`period-slider-hover-tooltip ${R==="bottom"&&!c?"period-slider-hover-tooltip-bottom":""} rounded bg-slate-800/90 px-2 py-0.5 font-medium text-white text-xs shadow-lg backdrop-blur-xs dark:bg-slate-900/90`,children:Be(t,Ua,e.formatLabel,S)})]}),w.jsxs("div",{tabIndex:s?-1:0,role:"slider","aria-label":te?e.pointAriaLabel??"Selected date":e.lowerAriaLabel??"Range start","aria-disabled":s?"true":void 0,"aria-valuemin":N,"aria-valuemax":te?I:we,"aria-valuenow":be,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(Nn,t):Ot(t,Nn,e.formatLabel,S),"aria-orientation":c?"vertical":"horizontal",className:`period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[calc((100%-var(--ps-target-size))/2)] after:content-[''] focus-visible:outline-hidden ${Nt}`,style:Mi,onPointerDown:$a("low"),onKeyDown:Ia("low"),onFocus:ka("low"),"data-active":x==="low"?"true":void 0,"data-front":pr?"true":void 0,children:[w.jsx("div",{"data-testid":"period-slider-knob",className:`period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] dark:group-focus-visible:ring-blue-400 ${x==="low"?"":"shadow-md"}`}),h!=="hover"&&w.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${h==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":h,"data-label-position":R,"data-slanted":Dr.isSlanted?"true":void 0,"data-front":pr?"true":void 0,"data-duplicate":yn&&!pr?"true":void 0,ref:Uo,style:On.lowStyle,children:Be(t,Nn,e.formatLabel,S)})]}),!te&&w.jsxs("div",{tabIndex:s?-1:0,role:"slider","aria-label":e.upperAriaLabel??"Range end","aria-disabled":s?"true":void 0,"aria-valuemin":be,"aria-valuemax":I,"aria-valuenow":we,"aria-valuetext":e.formatAriaValueText?e.formatAriaValueText(Yn,t):Ot(t,Yn,e.formatLabel,S),"aria-orientation":c?"vertical":"horizontal",className:`period-slider-handle group absolute h-4 w-4 touch-none after:absolute after:inset-[calc((100%-var(--ps-target-size))/2)] after:content-[''] focus-visible:outline-hidden ${Nt}`,style:vi,onPointerDown:$a("high"),onKeyDown:Ia("high"),onFocus:ka("high"),"data-active":x==="high"?"true":void 0,"data-front":Rr?"true":void 0,children:[w.jsx("div",{"data-testid":"period-slider-knob",className:`period-slider-knob h-full w-full rounded-full border-2 border-white bg-[var(--aqps-accent-color)] group-focus-visible:ring-2 group-focus-visible:ring-blue-600 group-focus-visible:ring-offset-2 dark:border-slate-800 dark:bg-[var(--aqps-accent-light)] dark:group-focus-visible:ring-blue-400 ${x==="high"?"":"shadow-md"}`}),h!=="hover"&&w.jsx("div",{className:`period-slider-tooltip absolute whitespace-nowrap font-medium shadow-md ${h==="balloon"?"period-slider-tooltip-balloon":""}`,"data-tooltip-style":h,"data-label-position":R,"data-slanted":Dr.isSlanted?"true":void 0,"data-front":Rr?"true":void 0,"data-duplicate":yn&&!Rr?"true":void 0,ref:Bo,style:On.highStyle,children:Be(t,Yn,e.formatLabel,S)})]})]})}),g&&Ba(c?"decrease":"increase")]})},Jn=(e,t)=>{if(e===t)return!0;if(!(e&&t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r].getTime()!==t[r].getTime())return!1;return!0},Vo=(e,t)=>{if(e===t)return!0;if(!(e&&t))return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const a of r)if(e[a]!==t[a])return!1;return!0},ol=(e,t)=>e===t?!0:e.mode!==t.mode||e.unit!==t.unit||e.minDate.getTime()!==t.minDate.getTime()||e.maxDate.getTime()!==t.maxDate.getTime()||e.labelPosition!==t.labelPosition||e.autoSlantLabels!==t.autoSlantLabels||e.isVertical!==t.isVertical||e.hideConnectBar!==t.hideConnectBar||e.showTicks!==t.showTicks||e.disabled!==t.disabled||e.showStepper!==t.showStepper||e.debounceMs!==t.debounceMs||e.tooltipStyle!==t.tooltipStyle||e.colorScheme!==t.colorScheme||e.className!==t.className||!Vo(e.style,t.style)||e.snapMode!==t.snapMode||e.formatLabel!==t.formatLabel||e.locale!==t.locale||e.lowerAriaLabel!==t.lowerAriaLabel||e.upperAriaLabel!==t.upperAriaLabel||e.pointAriaLabel!==t.pointAriaLabel||e.macroLowerAriaLabel!==t.macroLowerAriaLabel||e.macroUpperAriaLabel!==t.macroUpperAriaLabel||e.decreaseAriaLabel!==t.decreaseAriaLabel||e.increaseAriaLabel!==t.increaseAriaLabel||e.formatAriaValueText!==t.formatAriaValueText||!Jn(e.allowedDates,t.allowedDates)?!1:e.mode==="point"&&t.mode==="point"?!((e.value?.getTime()??null)!==(t.value?.getTime()??null)||(e.defaultValue?.getTime()??null)!==(t.defaultValue?.getTime()??null)||e.onChangePoint!==t.onChangePoint):e.mode==="range"&&t.mode==="range"?!((e.range?.[0]?.getTime()??null)!==(t.range?.[0]?.getTime()??null)||(e.range?.[1]?.getTime()??null)!==(t.range?.[1]?.getTime()??null)||(e.defaultRange?.[0]?.getTime()??null)!==(t.defaultRange?.[0]?.getTime()??null)||(e.defaultRange?.[1]?.getTime()??null)!==(t.defaultRange?.[1]?.getTime()??null)||e.onChangeRange!==t.onChangeRange):e.mode==="vernier"&&t.mode==="vernier"?!((e.microRange?.[0]?.getTime()??null)!==(t.microRange?.[0]?.getTime()??null)||(e.microRange?.[1]?.getTime()??null)!==(t.microRange?.[1]?.getTime()??null)||(e.defaultMicroRange?.[0]?.getTime()??null)!==(t.defaultMicroRange?.[0]?.getTime()??null)||(e.defaultMicroRange?.[1]?.getTime()??null)!==(t.defaultMicroRange?.[1]?.getTime()??null)||(e.microValue?.getTime()??null)!==(t.microValue?.getTime()??null)||(e.defaultMicroValue?.getTime()??null)!==(t.defaultMicroValue?.getTime()??null)||e.macroRange[0].getTime()!==t.macroRange[0].getTime()||e.macroRange[1].getTime()!==t.macroRange[1].getTime()||e.vernierOrientation!==t.vernierOrientation||e.showVernierProjection!==t.showVernierProjection||e.showVernierTicks!==t.showVernierTicks||e.showHairline!==t.showHairline||e.macroUnit!==t.macroUnit||e.microUnit!==t.microUnit||e.macroIsDiscrete!==t.macroIsDiscrete||e.microIsDiscrete!==t.microIsDiscrete||e.formatMacroLabel!==t.formatMacroLabel||e.formatMicroLabel!==t.formatMicroLabel||e.onChangeMicroRange!==t.onChangeMicroRange||e.onChangeMicroPoint!==t.onChangeMicroPoint||e.onChangeMacroRange!==t.onChangeMacroRange||!Jn(e.macroAllowedDates,t.macroAllowedDates)||!Jn(e.microAllowedDates,t.microAllowedDates)):!1,No=i.memo(al,ol);No.displayName="PeriodSlider";const dt=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t},$r=(e,t)=>{if(Number.isNaN(t.getTime()))throw new RangeError(`DateSelector: "${e}" must be a valid Date (received ${String(t)})`)},il=e=>{if(e!==void 0)try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{throw new RangeError(`DateSelector: "locale" must be a valid BCP 47 language tag (received ${JSON.stringify(e)})`)}},_t=(e,t,r)=>{const n=new Date(e,t-1,r);return n.setFullYear(e),n.setHours(0,0,0,0),n},co=e=>_t(e,1,1),ll=e=>_t(e,12,31),sl={year:{year:"numeric"},month:{month:"2-digit"},day:{day:"2-digit"}},cl={year:4,month:2,day:2},ul={year:e=>e.getFullYear(),month:e=>e.getMonth()+1,day:e=>e.getDate()},uo=new Map,dl=(e,t)=>{const r=`${e}\0${t}`,n=uo.get(r);if(n!==void 0)return n;const a=new Intl.DateTimeFormat(t,sl[e]);return uo.set(r,a),a},Qn=(e,t,r)=>r===void 0?String(ul[e](t)).padStart(cl[e],"0"):dl(e,r).format(t),ml=(e,t,r)=>{const n=t?.getTime()??null,a=r?.getTime()??null,l=new Map;return e.forEach((s,u)=>{$r(`allowedDates[${u}]`,s);const g=dt(s),h=g.getTime();n!==null&&h<n||a!==null&&h>a||l.has(h)||l.set(h,g)}),Array.from(l.keys()).sort((s,u)=>s-u).map(s=>l.get(s))},fl=(e,t)=>{const r=[];let n=dt(e);const a=dt(t).getTime();for(;n.getTime()<=a;)r.push(n),n=Ve.addDays(n,1);return r},mo=(e,t)=>{const r=[];for(let n=e.length-1;n>=0;n--)r.push({label:Be("day",e[n],void 0,t),value:Ve.format(e[n],"yyyy-MM-dd")});return r},gl=e=>{const{value:t,initialDate:r,onChange:n,children:a,minYear:l,maxYear:s,minDate:u,maxDate:g,allowedDates:h,variant:R="date",className:L="",style:c,disabled:T=!1,prevDateAriaLabel:q="Previous day",nextDateAriaLabel:J="Next day",selectAriaLabel:S="Date",yearAriaLabel:se="Year",monthAriaLabel:re="Month",dayAriaLabel:$="Day",locale:O,formatYearOption:z,formatMonthOption:ae,formatDayOption:G}=e;if(il(O),t!==void 0&&$r("value",t),r!==void 0&&$r("initialDate",r),u!==void 0&&$r("minDate",u),g!==void 0&&$r("maxDate",g),l!==void 0&&!Number.isInteger(l))throw new RangeError(`DateSelector: "minYear" must be an integer year (received ${String(l)})`);if(s!==void 0&&!Number.isInteger(s))throw new RangeError(`DateSelector: "maxYear" must be an integer year (received ${String(s)})`);if(R==="split-dropdown"&&h!==void 0)throw new RangeError('DateSelector: variant="split-dropdown" cannot honour "allowedDates"; use variant="dropdown" or variant="date" for a discrete date set');const U=t??r;if(U===void 0)throw new RangeError("DateSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected date is never inferred from the wall clock.");const[P,y]=i.useState(()=>dt(U)),A=t!==void 0,N=t?.getTime(),I=i.useMemo(()=>t!==void 0?dt(t):P,[N,P]),te=u?.getTime(),le=g?.getTime(),B=i.useMemo(()=>{const v=u?dt(u):null,b=l!==void 0?co(l):null;return v===null?b:b===null||v.getTime()>=b.getTime()?v:b},[te,l]),Z=i.useMemo(()=>{const v=g?dt(g):null,b=s!==void 0?ll(s):null;return v===null?b:b===null||v.getTime()<=b.getTime()?v:b},[le,s]),j=B?.getTime()??null,H=Z?.getTime()??null;if(B!==null&&Z!==null&&B.getTime()>Z.getTime())throw new RangeError(`DateSelector: the resolved range is empty (min ${Ve.format(B,"yyyy-MM-dd")} is after max ${Ve.format(Z,"yyyy-MM-dd")})`);if(R!=="date"&&h===void 0&&(B===null||Z===null))throw new RangeError(`DateSelector: variant="${R}" needs a bounded range; supply minDate/minYear and maxDate/maxYear${R==="dropdown"?' or supply "allowedDates"':""}`);const ue=h===void 0?null:h.map(v=>v.getTime()).join(","),fe=i.useMemo(()=>h===void 0?null:ml(h,B,Z),[ue,j,H]),oe=v=>{const b=v.getTime();return fe!==null?fe.some(M=>M.getTime()===b):!(j!==null&&b<j||H!==null&&b>H)},He=U.getTime();i.useEffect(()=>{A||y(dt(U))},[A,He]);const Te=v=>{if(T)return;const b=dt(v);oe(b)&&(A||y(b),n?.(b))},Re=I.getTime(),Se=oe(I),Xe=i.useMemo(()=>{if(fe!==null){for(let b=fe.length-1;b>=0;b--)if(fe[b].getTime()<Re)return fe[b];return null}const v=Ve.addDays(new Date(Re),-1);return oe(v)?v:null},[fe,Re,j,H]),_e=i.useMemo(()=>{if(fe!==null){for(const b of fe)if(b.getTime()>Re)return b;return null}const v=Ve.addDays(new Date(Re),1);return oe(v)?v:null},[fe,Re,j,H]),Je=()=>{Xe!==null&&Te(Xe)},je=()=>{_e!==null&&Te(_e)},nt=v=>{if(v.target.value){const b=Ve.parseISO(v.target.value);Number.isNaN(b.getTime())||Te(b)}},W=v=>{if(v.target.value){const b=Ve.parseISO(v.target.value);Number.isNaN(b.getTime())||Te(b)}},F=I.getFullYear(),Q=I.getMonth()+1,x=I.getDate(),Y=i.useMemo(()=>R!=="dropdown"?[]:fe!==null?mo(fe,O):B===null||Z===null?[]:mo(fl(B,Z),O),[R,fe,j,H,O]),D=i.useMemo(()=>{if(R!=="split-dropdown"||B===null||Z===null)return[];const v=[];for(let b=Z.getFullYear();b>=B.getFullYear();b--)v.push(b);return v},[R,j,H]),X=i.useMemo(()=>{if(R!=="split-dropdown"||B===null||Z===null)return[];const v=B,b=Z,M=F===v.getFullYear()?v.getMonth()+1:1,mr=F===b.getFullYear()?b.getMonth()+1:12,ft=[];for(let at=M;at<=mr;at++)ft.push(at);return ft},[R,j,H,F]),ce=i.useMemo(()=>{if(R!=="split-dropdown"||B===null||Z===null)return[];const v=B,b=Z,M=F===v.getFullYear()&&Q===v.getMonth()+1?v.getDate():1,mr=F===b.getFullYear()&&Q===b.getMonth()+1?b.getDate():Ve.getDaysInMonth(new Date(Re)),ft=[];for(let at=M;at<=mr;at++)ft.push(at);return ft},[R,j,H,Re,F,Q]),he=(v,b,M)=>M>Ve.getDaysInMonth(_t(v,b,1))?!1:oe(_t(v,b,M)),Le=(v,b,M)=>{he(v,b,M)&&Te(_t(v,b,M))},Ne=v=>z?z(v):Qn("year",co(v),O),Qe=v=>ae?ae(v):Qn("month",_t(F,v,1),O),be=v=>G?G(v):Qn("day",_t(F,Q,v),O),we=Ve.format(I,"yyyy-MM-dd"),Nr=Be("day",I,void 0,O),de=B?Ve.format(B,"yyyy-MM-dd"):void 0,Ct=Z?Ve.format(Z,"yyyy-MM-dd"):void 0,C=Se?we:"",Ft="text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400";return w.jsxs("div",{className:`inline-flex items-center ${Vr} ${L}`,style:c,"data-variant":R,"data-out-of-range":Se?void 0:"true",children:[w.jsx(jt,{neighbour:"control",direction:"left",disabled:T,canStep:Xe!==null,onStep:Je,ariaLabel:q}),R==="dropdown"?w.jsxs("select",{"aria-label":S,disabled:T,className:"w-28 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500",value:C,onChange:W,children:[Se?null:w.jsx("option",{value:"",disabled:!0,className:Ft,children:Nr}),Y.map(v=>w.jsx("option",{value:v.value,className:"text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100",children:v.label},v.value))]}):R==="split-dropdown"?w.jsxs("div",{className:"inline-flex items-center gap-1",children:[w.jsxs("select",{"aria-label":se,disabled:T,className:"rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",value:Se?F:"",onChange:v=>Le(Number(v.target.value),Q,x),children:[Se?null:w.jsx("option",{value:"",disabled:!0,className:Ft,children:Ne(F)}),D.map(v=>w.jsx("option",{value:v,disabled:!he(v,Q,x),className:"dark:bg-slate-700 dark:text-slate-100",children:Ne(v)},v))]}),w.jsxs("select",{"aria-label":re,disabled:T,className:"rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",value:Se?Q:"",onChange:v=>Le(F,Number(v.target.value),x),children:[Se?null:w.jsx("option",{value:"",disabled:!0,className:Ft,children:Qe(Q)}),X.map(v=>w.jsx("option",{value:v,disabled:!he(F,v,x),className:"dark:bg-slate-700 dark:text-slate-100",children:Qe(v)},v))]}),w.jsxs("select",{"aria-label":$,disabled:T,className:"rounded-md border border-gray-300 bg-gray-50 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100",value:Se?x:"",onChange:v=>Le(F,Q,Number(v.target.value)),children:[Se?null:w.jsx("option",{value:"",disabled:!0,className:Ft,children:be(x)}),ce.map(v=>w.jsx("option",{value:v,className:"dark:bg-slate-700 dark:text-slate-100",children:be(v)},v))]})]}):w.jsx("input",{"aria-label":S,disabled:T,className:"period-slider-native-date-field w-28 rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500 dark:placeholder:text-gray-400",value:we,min:de,max:Ct,onChange:nt,type:"date"}),w.jsx(jt,{neighbour:"control",direction:"right",disabled:T,canStep:_e!==null,onStep:je,ariaLabel:J}),a]})},cr=e=>e===void 0?null:dt(e).getTime(),Yo=i.memo(gl,(e,t)=>!(cr(e.value??e.initialDate)!==cr(t.value??t.initialDate)||cr(e.minDate)!==cr(t.minDate)||cr(e.maxDate)!==cr(t.maxDate)||e.variant!==t.variant||e.disabled!==t.disabled||e.className!==t.className||e.style!==t.style||e.minYear!==t.minYear||e.maxYear!==t.maxYear||e.onChange!==t.onChange||e.allowedDates!==t.allowedDates||e.children!==t.children||e.prevDateAriaLabel!==t.prevDateAriaLabel||e.nextDateAriaLabel!==t.nextDateAriaLabel||e.selectAriaLabel!==t.selectAriaLabel||e.yearAriaLabel!==t.yearAriaLabel||e.monthAriaLabel!==t.monthAriaLabel||e.dayAriaLabel!==t.dayAriaLabel||e.locale!==t.locale||e.formatYearOption!==t.formatYearOption||e.formatMonthOption!==t.formatMonthOption||e.formatDayOption!==t.formatDayOption));Yo.displayName="DateSelector";function qe(e,t){const r=e+Math.floor(t/12),n=(t%12+12)%12,a=new Date(r,n,1);return a.setFullYear(r),a}function Ht(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function Er(e,t){if(e!==void 0&&(!(e instanceof Date)||Number.isNaN(e.getTime())))throw new RangeError(`MonthSelector: \`${t}\` must be a valid Date, received ${String(e)}.`)}function fo(e,t){if(e!==void 0&&!Number.isInteger(e))throw new RangeError(`MonthSelector: \`${t}\` must be an integer year, received ${String(e)}.`)}function hl(e){if(e!==void 0)try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{throw new RangeError(`MonthSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`)}}function bl(e,t){const r=e===void 0?null:qe(e,0),n=t===void 0?null:qe(t.getFullYear(),t.getMonth());return r!==null&&n!==null?r>=n?r:n:r!==null?r:n}function wl(e,t){const r=e===void 0?null:qe(e,11),n=t===void 0?null:qe(t.getFullYear(),t.getMonth());return r!==null&&n!==null?r<=n?r:n:r!==null?r:n}function Ml(e,t,r){const n=new Map;for(const a of e){const l=qe(a.getFullYear(),a.getMonth());t!==null&&l<t||r!==null&&l>r||n.has(l.getTime())||n.set(l.getTime(),l)}return Array.from(n.values()).sort((a,l)=>a.getTime()-l.getTime())}function vl(e,t){const r=e.getFullYear()*12+e.getMonth(),n=t.getFullYear()*12+t.getMonth(),a=[];for(let l=r;l<=n;l++)a.push(qe(Math.floor(l/12),l%12));return a}function go(e,t){const r=[];for(let n=e.length-1;n>=0;n--)r.push({label:Be("month",e[n],void 0,t),value:Ht(e[n])});return r}const xl=e=>{const{value:t,initialDate:r,onChange:n,children:a,variant:l="date",minYear:s,maxYear:u,minDate:g,maxDate:h,allowedMonths:R,isWarning:L=!1,className:c="",style:T,disabled:q=!1,prevMonthAriaLabel:J="Previous month",nextMonthAriaLabel:S="Next month",selectAriaLabel:se="Month",locale:re}=e;hl(re),Er(t,"value"),Er(r,"initialDate"),Er(g,"minDate"),Er(h,"maxDate"),fo(s,"minYear"),fo(u,"maxYear"),R?.forEach((D,X)=>{Er(D,`allowedMonths[${X}]`)});const $=t??r;if($===void 0)throw new RangeError("MonthSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected month is never inferred from the wall clock.");const[O,z]=i.useState(()=>qe($.getFullYear(),$.getMonth())),ae=t!==void 0,G=i.useMemo(()=>t!==void 0?qe(t.getFullYear(),t.getMonth()):O,[t?.getTime(),O]),U=g?.getTime(),P=h?.getTime(),y=i.useMemo(()=>bl(s,g),[s,U]),A=i.useMemo(()=>wl(u,h),[u,P]),N=y?.getTime()??null,I=A?.getTime()??null;if(y!==null&&A!==null&&y>A)throw new RangeError(`MonthSelector: the resolved lower bound ${Ht(y)} is after the resolved upper bound ${Ht(A)}.`);if(l==="dropdown"&&R===void 0&&(y===null||A===null))throw new RangeError('MonthSelector: variant="dropdown" requires a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`), or `allowedMonths`; the option window is never invented.');const te=R===void 0?null:R.map(D=>D.getTime()).join(","),le=i.useMemo(()=>R===void 0?null:Ml(R,y,A),[te,N,I]),B=D=>{const X=D.getTime();return le!==null?le.some(ce=>ce.getTime()===X):!(N!==null&&X<N||I!==null&&X>I)},Z=$.getTime();i.useEffect(()=>{if(ae)return;const D=qe($.getFullYear(),$.getMonth());z(X=>X.getTime()===D.getTime()?X:D)},[ae,Z]);const j=D=>{if(q)return;if(!B(D))throw new RangeError(`MonthSelector: refusing to emit ${Ht(D)}, which lies outside the selectable months.`);ae||z(D);const X=D.getFullYear()*100+(D.getMonth()+1);n?.(D,X)},H=G.getTime(),ue=B(G),fe=i.useMemo(()=>{if(le!==null){for(let X=le.length-1;X>=0;X--)if(le[X].getTime()<H)return le[X];return null}const D=qe(G.getFullYear(),G.getMonth()-1);return B(D)?D:null},[le,H,N,I]),oe=i.useMemo(()=>{if(le!==null){for(const X of le)if(X.getTime()>H)return X;return null}const D=qe(G.getFullYear(),G.getMonth()+1);return B(D)?D:null},[le,H,N,I]),He=()=>{fe!==null&&j(fe)},Te=()=>{oe!==null&&j(oe)},Re=D=>{if(!D)return;const[X,ce]=D.split("-"),he=Number(X),Le=Number(ce)-1;if(!(Number.isInteger(he)&&Number.isInteger(Le)))return;const Ne=qe(he,Le);B(Ne)&&j(Ne)},Se=D=>{Re(D.target.value)},Xe=D=>{Re(D.target.value)},_e=Ht(G),Je=Be("month",G,void 0,re),je=y?Ht(y):void 0,nt=A?Ht(A):void 0,W=i.useMemo(()=>l!=="dropdown"?[]:le!==null?go(le,re):y===null||A===null?[]:go(vl(y,A),re),[l,le,N,I,re]),F=ue?_e:"",Q=L?"border-amber-300 bg-amber-50 text-amber-900 focus:border-amber-500 focus:ring-amber-500 dark:border-amber-900/50 dark:bg-amber-950/20 dark:text-amber-200":"border-gray-300 bg-gray-100 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500",x=`period-slider-native-date-field w-28 rounded-md border py-0.5 px-1 text-center font-mono text-xs tabular-nums dark:placeholder:text-gray-400 disabled:opacity-50 ${Q}`,Y=`w-28 appearance-none rounded-md border px-1 py-0.5 text-center font-mono text-xs tabular-nums [text-align-last:center] [text-align:center] disabled:opacity-50 ${Q}`;return w.jsxs("div",{className:`inline-flex items-center ${Vr} ${c}`,style:T,"data-out-of-range":ue?void 0:"true",children:[w.jsx(jt,{neighbour:"control",direction:"left",disabled:q,canStep:fe!==null,onStep:He,ariaLabel:J}),l==="dropdown"?w.jsxs("select",{"aria-label":se,disabled:q,className:Y,value:F,onChange:Xe,children:[ue?null:w.jsx("option",{value:"",disabled:!0,className:"text-center font-mono text-gray-500 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-400",children:Je}),W.map(D=>w.jsx("option",{value:D.value,className:"text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100",children:D.label},D.value))]}):w.jsx("input",{"aria-label":se,disabled:q,className:x,value:_e,min:je,max:nt,onChange:Se,type:"month"}),w.jsx(jt,{neighbour:"control",direction:"right",disabled:q,canStep:oe!==null,onStep:Te,ariaLabel:S}),a]})},Oo=i.memo(xl,(e,t)=>{const r=e.value??e.initialDate,n=t.value??t.initialDate,a=r?r.getFullYear()*12+r.getMonth():null,l=n?n.getFullYear()*12+n.getMonth():null;if(a!==l||e.variant!==t.variant||e.disabled!==t.disabled||e.className!==t.className||e.style!==t.style||e.isWarning!==t.isWarning||e.minYear!==t.minYear||e.maxYear!==t.maxYear)return!1;const s=e.minDate?e.minDate.getFullYear()*12+e.minDate.getMonth():null,u=t.minDate?t.minDate.getFullYear()*12+t.minDate.getMonth():null;if(s!==u)return!1;const g=e.maxDate?e.maxDate.getFullYear()*12+e.maxDate.getMonth():null,h=t.maxDate?t.maxDate.getFullYear()*12+t.maxDate.getMonth():null;return!(g!==h||e.allowedMonths!==t.allowedMonths||e.onChange!==t.onChange||e.children!==t.children||e.prevMonthAriaLabel!==t.prevMonthAriaLabel||e.nextMonthAriaLabel!==t.nextMonthAriaLabel||e.selectAriaLabel!==t.selectAriaLabel||e.locale!==t.locale)});Oo.displayName="MonthSelector";function dr(e,t,r){if(!(r instanceof Date)||Number.isNaN(r.getTime()))throw new RangeError(`${e}: ${t} is required and must be a valid Date (received: ${String(r)})`)}function bn(e,t,r){if(dr(e,"minDate",t),dr(e,"maxDate",r),r.getTime()<=t.getTime())throw new RangeError(`${e}: maxDate must be strictly later than minDate (minDate: ${t.toISOString()}, maxDate: ${r.toISOString()})`)}function cn(e,t,r){if(!Array.isArray(r)||r.length!==2)throw new RangeError(`${e}: ${t} is required and must be a [lower, upper] Date tuple (received: ${String(r)})`);if(dr(e,`${t}[0]`,r[0]),dr(e,`${t}[1]`,r[1]),r[0].getTime()>r[1].getTime())throw new RangeError(`${e}: ${t} upper must not be earlier than lower (lower: ${r[0].toISOString()}, upper: ${r[1].toISOString()})`)}function un(e,t,r,n,a,l,s){const u=K(r,n);if(u<K(r,a)||u>K(r,l))throw new RangeError(`${e}: ${t} must lie within ${s} (value: ${n.toISOString()}, lower: ${a.toISOString()}, upper: ${l.toISOString()})`)}function dn(e,t,r,n,a,l,s){un(e,`${t}[0]`,r,n[0],a,l,s),un(e,`${t}[1]`,r,n[1],a,l,s)}function Oe(e,t,r){return e<t?t:e>r?r:e}function mn(e,t,r,n,a,l){if(r!==!0)return[];const s=e[0].getTime(),u=e[1].getTime();return vt(n,t,a,l).filter(g=>g.getTime()>=s&&g.getTime()<=u)}function ur(e,t,r,n){if(n.length===0)return Oe(e,r[0],r[1]);const a=n[me(n,e,t)];return a.getTime()===e.getTime()?e:a}function nn(e,t,r,n){const a=ur(e[0],t,r,n),l=ur(e[1],t,r,n);return[a,l<a?a:l]}function fn(e,t,r,n){const a=me(e,r,t)+n;return e[Math.max(0,Math.min(e.length-1,a))]}function wn(e){const t=i.useRef(e),r=t.current,n=e,a=Object.keys(r),l=Object.keys(n);return a.length===l.length&&l.every(u=>Object.is(r[u],n[u]))||(t.current=e),t.current}function Dl(e){const{unit:t,minDate:r,maxDate:n,initialRange:a,onChangeRange:l,...s}=e;bn("usePeriodSliderRange",r,n),cn("usePeriodSliderRange","initialRange",a),dn("usePeriodSliderRange","initialRange",t,a,r,n,"[minDate, maxDate]");const u=wn(s),g=i.useRef(a),[h,R]=i.useState(a);let L=h;const c=[Oe(h[0],r,n),Oe(h[1],r,n)];(c[0]!==h[0]||c[1]!==h[1])&&(L=c,R(c));const T=i.useRef(L);T.current=L;const q=i.useRef({minDate:r,maxDate:n,allowedDates:u.allowedDates});q.current={minDate:r,maxDate:n,allowedDates:u.allowedDates};const J=i.useRef(l);J.current=l;const S=i.useCallback(P=>{const{minDate:y,maxDate:A}=q.current,N=Oe(P[0],y,A),I=Oe(P[1],y,A),te=T.current;N.getTime()===te[0].getTime()&&I.getTime()===te[1].getTime()||(T.current=[N,I],R([N,I]),J.current?.(N,I))},[]),se=i.useCallback(P=>{const y=T.current,A=P.getTime()>y[1].getTime()?P:y[1];S([P,A])},[S]),re=i.useCallback(P=>{const y=T.current,A=P.getTime()<y[0].getTime()?P:y[0];S([A,P])},[S]),$=i.useCallback((P,y)=>{S([P,y])},[S]),O=i.useCallback(P=>{const{minDate:y,maxDate:A,allowedDates:N}=q.current,I=T.current,te=vt(N,t,y,A);if(te.length>0){S([fn(te,t,I[0],P),fn(te,t,I[1],P)]);return}S([$e(t,I[0],P),$e(t,I[1],P)])},[t,S]),z=i.useCallback(()=>{S(g.current)},[S]),ae=i.useMemo(()=>({value:L[0],onChange:se,minDate:r,maxDate:L[1],unit:t}),[L[0],L[1],se,r,t]),G=i.useMemo(()=>({value:L[1],onChange:re,minDate:L[0],maxDate:n,unit:t}),[L[0],L[1],re,n,t]),U=i.useMemo(()=>({...u,mode:"range",unit:t,range:L,minDate:r,maxDate:n,onChangeRange:$}),[u,t,L,r,n,$]);return{range:L,lowerDate:L[0],upperDate:L[1],setRange:R,setLowerDate:se,setUpperDate:re,shiftRange:O,resetRange:z,startSelectorProps:ae,endSelectorProps:G,sliderProps:U}}function pl(e){const{unit:t,minDate:r,maxDate:n,initialValue:a,onChangePoint:l,...s}=e;bn("usePeriodSliderPoint",r,n),dr("usePeriodSliderPoint","initialValue",a),un("usePeriodSliderPoint","initialValue",t,a,r,n,"[minDate, maxDate]");const u=wn(s),g=i.useRef(a),[h,R]=i.useState(a);let L=h;const c=Oe(h,r,n);c!==h&&(L=c,R(c));const T=i.useRef(L);T.current=L;const q=i.useRef({minDate:r,maxDate:n,allowedDates:u.allowedDates});q.current={minDate:r,maxDate:n,allowedDates:u.allowedDates};const J=i.useRef(l);J.current=l;const S=i.useCallback(z=>{const{minDate:ae,maxDate:G}=q.current,U=Oe(z,ae,G);U.getTime()!==T.current.getTime()&&(T.current=U,R(U),J.current?.(U))},[]),se=i.useCallback(z=>{const{minDate:ae,maxDate:G,allowedDates:U}=q.current,P=vt(U,t,ae,G);if(P.length>0){S(fn(P,t,T.current,z));return}S($e(t,T.current,z))},[t,S]),re=i.useCallback(()=>{S(g.current)},[S]),$=i.useMemo(()=>({value:L,onChange:S,minDate:r,maxDate:n,unit:t}),[L,S,r,n,t]),O=i.useMemo(()=>({...u,mode:"point",unit:t,value:L,minDate:r,maxDate:n,onChangePoint:S}),[u,t,L,r,n,S]);return{value:L,setValue:R,shiftValue:se,resetValue:re,selectorProps:$,sliderProps:O}}function Rl(e){const{unit:t,minDate:r,maxDate:n,initialMacroRange:a,initialMicroRange:l,macroUnit:s=t,microUnit:u=t,onChangeMacroRange:g,onChangeMicroRange:h,...R}=e;bn("useVernierSliderRange",r,n),cn("useVernierSliderRange","initialMacroRange",a),cn("useVernierSliderRange","initialMicroRange",l),dn("useVernierSliderRange","initialMacroRange",s,a,r,n,"[minDate, maxDate]");const L=mt(s,u,a,r,n);dn("useVernierSliderRange","initialMicroRange",u,l,L[0],L[1],"the initial macro window");const c=wn(R),T=i.useRef(a),q=i.useRef(l),[J,S]=i.useState(a),[se,re]=i.useState(l);let $=J;const O=[Oe(J[0],r,n),Oe(J[1],r,n)];(O[0]!==J[0]||O[1]!==J[1])&&($=O,S(O));const z=i.useMemo(()=>mt(s,u,$,r,n),[s,u,$,r,n]),ae=i.useMemo(()=>mn(z,u,c.microIsDiscrete,c.microAllowedDates??c.allowedDates,r,n),[z,u,c.microIsDiscrete,c.microAllowedDates,c.allowedDates,r,n]),G=i.useMemo(()=>c.macroIsDiscrete===!0?vt(c.macroAllowedDates??c.allowedDates,s,r,n):[],[c.macroIsDiscrete,c.macroAllowedDates,c.allowedDates,s,r,n]),U=i.useRef(G);U.current=G;let P=se;const y=nn(se,u,z,ae);(y[0]!==se[0]||y[1]!==se[1])&&(P=y,re(y));const A=i.useRef($);A.current=$;const N=i.useRef(P);N.current=P;const I=i.useRef({minDate:r,maxDate:n,macroIsDiscrete:c.macroIsDiscrete,macroAllowedDates:c.macroAllowedDates,microIsDiscrete:c.microIsDiscrete,microAllowedDates:c.microAllowedDates,allowedDates:c.allowedDates});I.current={minDate:r,maxDate:n,macroIsDiscrete:c.macroIsDiscrete,macroAllowedDates:c.macroAllowedDates,microIsDiscrete:c.microIsDiscrete,microAllowedDates:c.microAllowedDates,allowedDates:c.allowedDates};const te=i.useRef(g);te.current=g;const le=i.useRef(h);le.current=h;const B=i.useCallback(x=>{const{minDate:Y,maxDate:D}=I.current;return mt(s,u,x,Y,D)},[s,u]),Z=i.useCallback(x=>{const{microIsDiscrete:Y,microAllowedDates:D,allowedDates:X,minDate:ce,maxDate:he}=I.current;return mn(x,u,Y,D??X,ce,he)},[u]),j=i.useCallback((x,Y)=>{const D=A.current,X=N.current;(x[0].getTime()!==D[0].getTime()||x[1].getTime()!==D[1].getTime())&&(A.current=x,S(x),te.current?.(x[0],x[1])),(Y[0].getTime()!==X[0].getTime()||Y[1].getTime()!==X[1].getTime())&&(N.current=Y,re(Y),le.current?.(Y[0],Y[1]))},[]),H=i.useCallback((x,Y)=>{const{minDate:D,maxDate:X}=I.current,ce=[Oe(x,D,X),Oe(Y,D,X)],he=B(ce);j(ce,nn(N.current,u,he,Z(he)))},[u,B,Z,j]),ue=i.useCallback((x,Y)=>{const D=B(A.current);j(A.current,nn([x,Y],u,D,Z(D)))},[u,B,Z,j]),fe=i.useCallback(x=>{const Y=A.current[1],D=x>Y?x:Y;H(x,D)},[H]),oe=i.useCallback(x=>{const Y=A.current[0],D=x<Y?x:Y;H(D,x)},[H]),He=i.useCallback(x=>{const Y=N.current[1],D=x>Y?x:Y;ue(x,D)},[ue]),Te=i.useCallback(x=>{const Y=N.current[0],D=x<Y?x:Y;ue(D,x)},[ue]),Re=i.useCallback(x=>{const{minDate:Y,maxDate:D}=I.current,X=A.current,ce=U.current;if(ce.length>0){const Ne=me(ce,X[0],s)+x,Qe=me(ce,X[1],s)+x;if(Ne<0||Qe>ce.length-1)return;H(ce[Ne],ce[Qe]);return}const he=$e(s,X[0],x),Le=$e(s,X[1],x);he<Y||Le>D||H(he,Le)},[s,H]),Se=i.useCallback(x=>{const Y=A.current,D=N.current,X=B(Y),[ce,he]=X,Le=Z(X);if(Le.length>0){const be=me(Le,D[0],u)+x,we=me(Le,D[1],u)+x;if(be<0||we>Le.length-1)return;ue(Le[be],Le[we]);return}const Ne=$e(u,D[0],x),Qe=$e(u,D[1],x);Ne<ce||Qe>he||ue(Ne,Qe)},[u,B,Z,ue]),Xe=i.useCallback(()=>{const x=T.current,Y=B(x);j(x,nn(q.current,u,Y,Z(Y)))},[u,B,Z,j]),[_e,Je]=z,je=i.useMemo(()=>({value:$[0],onChange:fe,minDate:r,maxDate:$[1],unit:s}),[$,fe,r,s]),nt=i.useMemo(()=>({value:$[1],onChange:oe,minDate:$[0],maxDate:n,unit:s}),[$,oe,n,s]),W=i.useMemo(()=>({value:P[0],onChange:He,minDate:_e,maxDate:P[1],unit:u}),[P,He,_e,u]),F=i.useMemo(()=>({value:P[1],onChange:Te,minDate:P[0],maxDate:Je,unit:u}),[P,Te,Je,u]),Q=i.useMemo(()=>({...c,mode:"vernier",unit:t,macroUnit:s,microUnit:u,minDate:r,maxDate:n,macroRange:$,microRange:P,onChangeMacroRange:H,onChangeMicroRange:ue}),[c,t,s,u,r,n,$,P,H,ue]);return{macroRange:$,setMacroRange:S,microRange:P,setMicroRange:re,setMacroLowerDate:fe,setMacroUpperDate:oe,setMicroLowerDate:He,setMicroUpperDate:Te,shiftMacroRange:Re,shiftMicroRange:Se,resetVernier:Xe,macroStartSelectorProps:je,macroEndSelectorProps:nt,microStartSelectorProps:W,microEndSelectorProps:F,sliderProps:Q}}function Sl(e){const{unit:t,minDate:r,maxDate:n,initialMacroRange:a,initialMicroValue:l,macroUnit:s=t,microUnit:u=t,onChangeMacroRange:g,onChangeMicroPoint:h,...R}=e;bn("useVernierSliderPoint",r,n),cn("useVernierSliderPoint","initialMacroRange",a),dr("useVernierSliderPoint","initialMicroValue",l),dn("useVernierSliderPoint","initialMacroRange",s,a,r,n,"[minDate, maxDate]");const L=mt(s,u,a,r,n);un("useVernierSliderPoint","initialMicroValue",u,l,L[0],L[1],"the initial macro window");const c=wn(R),T=i.useRef(a),q=i.useRef(l),[J,S]=i.useState(a),[se,re]=i.useState(l);let $=J;const O=[Oe(J[0],r,n),Oe(J[1],r,n)];(O[0]!==J[0]||O[1]!==J[1])&&($=O,S(O));const z=i.useMemo(()=>mt(s,u,$,r,n),[s,u,$,r,n]),ae=i.useMemo(()=>mn(z,u,c.microIsDiscrete,c.microAllowedDates??c.allowedDates,r,n),[z,u,c.microIsDiscrete,c.microAllowedDates,c.allowedDates,r,n]),G=i.useMemo(()=>c.macroIsDiscrete===!0?vt(c.macroAllowedDates??c.allowedDates,s,r,n):[],[c.macroIsDiscrete,c.macroAllowedDates,c.allowedDates,s,r,n]),U=i.useRef(G);U.current=G;let P=se;const y=ur(se,u,z,ae);y!==se&&(P=y,re(y));const A=i.useRef($);A.current=$;const N=i.useRef(P);N.current=P;const I=i.useRef({minDate:r,maxDate:n,macroIsDiscrete:c.macroIsDiscrete,macroAllowedDates:c.macroAllowedDates,microIsDiscrete:c.microIsDiscrete,microAllowedDates:c.microAllowedDates,allowedDates:c.allowedDates});I.current={minDate:r,maxDate:n,macroIsDiscrete:c.macroIsDiscrete,macroAllowedDates:c.macroAllowedDates,microIsDiscrete:c.microIsDiscrete,microAllowedDates:c.microAllowedDates,allowedDates:c.allowedDates};const te=i.useRef(g);te.current=g;const le=i.useRef(h);le.current=h;const B=i.useCallback(W=>{const{minDate:F,maxDate:Q}=I.current;return mt(s,u,W,F,Q)},[s,u]),Z=i.useCallback(W=>{const{microIsDiscrete:F,microAllowedDates:Q,allowedDates:x,minDate:Y,maxDate:D}=I.current;return mn(W,u,F,Q??x,Y,D)},[u]),j=i.useCallback((W,F)=>{const Q=A.current,x=N.current;(W[0].getTime()!==Q[0].getTime()||W[1].getTime()!==Q[1].getTime())&&(A.current=W,S(W),te.current?.(W[0],W[1])),F.getTime()!==x.getTime()&&(N.current=F,re(F),le.current?.(F))},[]),H=i.useCallback((W,F)=>{const{minDate:Q,maxDate:x}=I.current,Y=[Oe(W,Q,x),Oe(F,Q,x)],D=B(Y);j(Y,ur(N.current,u,D,Z(D)))},[u,B,Z,j]),ue=i.useCallback(W=>{const F=B(A.current);j(A.current,ur(W,u,F,Z(F)))},[u,B,Z,j]),fe=i.useCallback(W=>{const F=A.current[1],Q=W>F?W:F;H(W,Q)},[H]),oe=i.useCallback(W=>{const F=A.current[0],Q=W<F?W:F;H(Q,W)},[H]),He=i.useCallback(W=>{const{minDate:F,maxDate:Q}=I.current,x=A.current,Y=U.current;if(Y.length>0){const ce=me(Y,x[0],s)+W,he=me(Y,x[1],s)+W;if(ce<0||he>Y.length-1)return;H(Y[ce],Y[he]);return}const D=$e(s,x[0],W),X=$e(s,x[1],W);D<F||X>Q||H(D,X)},[s,H]),Te=i.useCallback(W=>{const F=A.current,Q=B(F),x=Z(Q);if(x.length>0){ue(fn(x,u,N.current,W));return}ue($e(u,N.current,W))},[u,B,Z,ue]),Re=i.useCallback(()=>{const W=T.current,F=B(W);j(W,ur(q.current,u,F,Z(F)))},[u,B,Z,j]),[Se,Xe]=z,_e=i.useMemo(()=>({value:$[0],onChange:fe,minDate:r,maxDate:$[1],unit:s}),[$,fe,r,s]),Je=i.useMemo(()=>({value:$[1],onChange:oe,minDate:$[0],maxDate:n,unit:s}),[$,oe,n,s]),je=i.useMemo(()=>({value:P,onChange:ue,minDate:Se,maxDate:Xe,unit:u}),[P,ue,Se,Xe,u]),nt=i.useMemo(()=>({...c,mode:"vernier",unit:t,macroUnit:s,microUnit:u,minDate:r,maxDate:n,macroRange:$,microValue:P,onChangeMacroRange:H,onChangeMicroPoint:ue}),[c,t,s,u,r,n,$,P,H,ue]);return{macroRange:$,setMacroRange:S,microValue:P,setMicroValue:re,setMacroLowerDate:fe,setMacroUpperDate:oe,setMicroDate:ue,shiftMacroRange:He,shiftMicroValue:Te,resetVernier:Re,macroStartSelectorProps:_e,macroEndSelectorProps:Je,microSelectorProps:je,sliderProps:nt}}function ho(e){const t=new Date(e,0,1);return t.setFullYear(e),t}function an(e,t){if(e!==void 0&&(!(e instanceof Date)||Number.isNaN(e.getTime())))throw new RangeError(`YearSelector: \`${t}\` must be a valid Date, received ${String(e)}.`)}function bo(e,t){if(e!==void 0&&!Number.isInteger(e))throw new RangeError(`YearSelector: \`${t}\` must be an integer year, received ${String(e)}.`)}function Ll(e){if(e!==void 0)try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{throw new RangeError(`YearSelector: \`locale\` must be a valid BCP 47 language tag, received ${JSON.stringify(e)}.`)}}function wo(e,t,r){const n=e===void 0?null:e,a=t===void 0?null:t.getFullYear();return n!==null&&a!==null?r(n,a):n!==null?n:a}const yl=e=>{const{value:t,initialDate:r,onChange:n,children:a,minYear:l,maxYear:s,minDate:u,maxDate:g,className:h="",style:R,disabled:L=!1,prevYearAriaLabel:c="Previous year",nextYearAriaLabel:T="Next year",selectAriaLabel:q="Year",locale:J}=e;an(t,"value"),an(r,"initialDate"),an(u,"minDate"),an(g,"maxDate"),bo(l,"minYear"),bo(s,"maxYear"),Ll(J);const S=t??r;if(S===void 0)throw new RangeError("YearSelector: either `value` (controlled) or `initialDate` (uncontrolled) is required; the selected year is never inferred from the wall clock.");const[se,re]=i.useState(()=>S.getFullYear()),$=u?.getTime(),O=g?.getTime(),z=i.useMemo(()=>wo(l,u,Math.max),[l,$]),ae=i.useMemo(()=>wo(s,g,Math.min),[s,O]);if(z===null||ae===null)throw new RangeError("YearSelector: a lower bound (`minYear` or `minDate`) and an upper bound (`maxYear` or `maxDate`) are both required; the year option list is never invented.");if(z>ae)throw new RangeError(`YearSelector: the resolved lower bound ${z} is after the resolved upper bound ${ae}.`);const G=t!==void 0,U=t!==void 0?t.getFullYear():se,P=U<z||U>ae,y=S.getTime();i.useEffect(()=>{G||re(S.getFullYear())},[G,y]);const A=j=>j>=z&&j<=ae,N=j=>{if(!L){if(!A(j))throw new RangeError(`YearSelector: refusing to emit ${j}, which lies outside the declared bounds ${z}-${ae}.`);G||re(j),n?.(ho(j),j)}},I=A(U-1)?U-1:null,te=A(U+1)?U+1:null,le=()=>{I!==null&&N(I)},B=()=>{te!==null&&N(te)},Z=i.useMemo(()=>{const j=[];for(let H=ae;H>=z;H--)j.push(H);return P&&(j.push(U),j.sort((H,ue)=>ue-H)),j},[z,ae,P,U]);return w.jsxs("div",{className:`inline-flex items-center ${Vr} ${h}`,style:R,children:[w.jsx(jt,{neighbour:"control",direction:"left",disabled:L,canStep:I!==null,onStep:le,ariaLabel:c}),w.jsx("select",{"aria-label":q,disabled:L,className:"w-18 appearance-none rounded-md border border-gray-300 bg-gray-100 px-1 py-0.5 text-center font-mono text-gray-900 text-xs tabular-nums [text-align-last:center] [text-align:center] focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:focus:border-blue-500 dark:focus:ring-blue-500",value:U,onChange:j=>{if(!j.target.value)return;const H=Number(j.target.value);Number.isInteger(H)&&N(H)},children:Z.map(j=>w.jsx("option",{value:j,className:"text-center font-mono text-gray-900 tabular-nums [text-align-last:center] [text-align:center] dark:bg-slate-700 dark:text-slate-100",children:Be("year",ho(j),void 0,J)},j))}),w.jsx(jt,{neighbour:"control",direction:"right",disabled:L,canStep:te!==null,onStep:B,ariaLabel:T}),a]})},Ho=i.memo(yl,(e,t)=>{const r=e.value??e.initialDate,n=t.value??t.initialDate,a=r?r.getFullYear():null,l=n?n.getFullYear():null;return!(a!==l||e.disabled!==t.disabled||e.className!==t.className||e.style!==t.style||e.minYear!==t.minYear||e.maxYear!==t.maxYear||e.minDate?.getFullYear()!==t.minDate?.getFullYear()||e.maxDate?.getFullYear()!==t.maxDate?.getFullYear()||e.onChange!==t.onChange||e.children!==t.children||e.prevYearAriaLabel!==t.prevYearAriaLabel||e.nextYearAriaLabel!==t.nextYearAriaLabel||e.selectAriaLabel!==t.selectAriaLabel||e.locale!==t.locale)});Ho.displayName="YearSelector";exports.COLOR_SCHEME_PALETTES=Do;exports.DateSelector=Yo;exports.MonthSelector=Oo;exports.PeriodSlider=No;exports.YearSelector=Ho;exports.addUnit=$e;exports.areStylesEqual=Vo;exports.calculateConnectDragValues=So;exports.calculateHandleDragValues=ea;exports.calculateKeyboardActionValues=Lo;exports.calculateLabelSlant=oa;exports.calculateVernierMacroDrag=ko;exports.calculateVernierMicroDrag=Io;exports.decode=ne;exports.encode=K;exports.findNearestDateIndex=me;exports.formatLabel=Be;exports.formatScreenReaderLabel=Ot;exports.getMacroWindowEndDate=Ro;exports.getMacroWindowStartDate=po;exports.getSortedAllowedDates=vt;exports.normalizeDateByUnit=We;exports.resolveDraggedEdge=hn;exports.resolveMacroWindow=mt;exports.resolveVernierRailZone=ia;exports.resolveVernierTargetHandle=$o;exports.resolveWheelStep=Co;exports.usePeriodSliderPoint=pl;exports.usePeriodSliderRange=Dl;exports.useVernierSliderPoint=Sl;exports.useVernierSliderRange=Rl;
|
package/dist/index.d.cts
CHANGED
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
*/
|
|
18
18
|
export type { DateSelectorProps } from './DateSelector.js';
|
|
19
19
|
export { DateSelector } from './DateSelector.js';
|
|
20
|
+
export { resolveDraggedEdge } from './dragPresentation.js';
|
|
20
21
|
export type { MonthSelectorProps } from './MonthSelector.js';
|
|
21
22
|
export { MonthSelector } from './MonthSelector.js';
|
|
22
23
|
export type { AccessibleSliderLabels, BasePeriodSliderProps, BasePeriodSliderVernierProps, ColorSchemePalette, ConnectDragValueOptions, LabelSlantConfig, LabelSlantResult, PeriodSliderColorScheme, PeriodSliderLabelPosition, PeriodSliderPointProps, PeriodSliderProps, PeriodSliderRangeProps, PeriodSliderSnapMode, PeriodSliderUnit, PeriodSliderVernierPointProps, PeriodSliderVernierProps, PeriodSliderVernierRangeProps, VernierHandle, VernierMicroShape, } from './PeriodSlider.js';
|
|
23
|
-
export { addUnit, areStylesEqual, COLOR_SCHEME_PALETTES, calculateConnectDragValues, calculateHandleDragValues, calculateKeyboardActionValues, calculateLabelSlant, calculateVernierMacroDrag, calculateVernierMicroDrag, decode, encode, findNearestDateIndex, formatLabel, formatScreenReaderLabel,
|
|
24
|
+
export { addUnit, areStylesEqual, COLOR_SCHEME_PALETTES, calculateConnectDragValues, calculateHandleDragValues, calculateKeyboardActionValues, calculateLabelSlant, calculateVernierMacroDrag, calculateVernierMicroDrag, decode, encode, findNearestDateIndex, formatLabel, formatScreenReaderLabel, getMacroWindowEndDate, getMacroWindowStartDate, getSortedAllowedDates, normalizeDateByUnit, PeriodSlider, resolveMacroWindow, resolveVernierRailZone, resolveVernierTargetHandle, resolveWheelStep, } from './PeriodSlider.js';
|
|
24
25
|
export type { SelectorProps, UsePeriodSliderPointOptions, UsePeriodSliderPointReturn, UsePeriodSliderRangeOptions, UsePeriodSliderRangeReturn, UseVernierSliderPointOptions, UseVernierSliderPointReturn, UseVernierSliderRangeOptions, UseVernierSliderRangeReturn, } from './usePeriodSlider.js';
|
|
25
26
|
export { usePeriodSliderPoint, usePeriodSliderRange, useVernierSliderPoint, useVernierSliderRange, } from './usePeriodSlider.js';
|
|
26
27
|
export type { YearSelectorProps } from './YearSelector.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
*/
|
|
18
18
|
export type { DateSelectorProps } from './DateSelector.js';
|
|
19
19
|
export { DateSelector } from './DateSelector.js';
|
|
20
|
+
export { resolveDraggedEdge } from './dragPresentation.js';
|
|
20
21
|
export type { MonthSelectorProps } from './MonthSelector.js';
|
|
21
22
|
export { MonthSelector } from './MonthSelector.js';
|
|
22
23
|
export type { AccessibleSliderLabels, BasePeriodSliderProps, BasePeriodSliderVernierProps, ColorSchemePalette, ConnectDragValueOptions, LabelSlantConfig, LabelSlantResult, PeriodSliderColorScheme, PeriodSliderLabelPosition, PeriodSliderPointProps, PeriodSliderProps, PeriodSliderRangeProps, PeriodSliderSnapMode, PeriodSliderUnit, PeriodSliderVernierPointProps, PeriodSliderVernierProps, PeriodSliderVernierRangeProps, VernierHandle, VernierMicroShape, } from './PeriodSlider.js';
|
|
23
|
-
export { addUnit, areStylesEqual, COLOR_SCHEME_PALETTES, calculateConnectDragValues, calculateHandleDragValues, calculateKeyboardActionValues, calculateLabelSlant, calculateVernierMacroDrag, calculateVernierMicroDrag, decode, encode, findNearestDateIndex, formatLabel, formatScreenReaderLabel,
|
|
24
|
+
export { addUnit, areStylesEqual, COLOR_SCHEME_PALETTES, calculateConnectDragValues, calculateHandleDragValues, calculateKeyboardActionValues, calculateLabelSlant, calculateVernierMacroDrag, calculateVernierMicroDrag, decode, encode, findNearestDateIndex, formatLabel, formatScreenReaderLabel, getMacroWindowEndDate, getMacroWindowStartDate, getSortedAllowedDates, normalizeDateByUnit, PeriodSlider, resolveMacroWindow, resolveVernierRailZone, resolveVernierTargetHandle, resolveWheelStep, } from './PeriodSlider.js';
|
|
24
25
|
export type { SelectorProps, UsePeriodSliderPointOptions, UsePeriodSliderPointReturn, UsePeriodSliderRangeOptions, UsePeriodSliderRangeReturn, UseVernierSliderPointOptions, UseVernierSliderPointReturn, UseVernierSliderRangeOptions, UseVernierSliderRangeReturn, } from './usePeriodSlider.js';
|
|
25
26
|
export { usePeriodSliderPoint, usePeriodSliderRange, useVernierSliderPoint, useVernierSliderRange, } from './usePeriodSlider.js';
|
|
26
27
|
export type { YearSelectorProps } from './YearSelector.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,YAAY,EACR,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,EAC5B,kBAAkB,EAClB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAChB,6BAA6B,EAC7B,wBAAwB,EACxB,6BAA6B,EAC7B,aAAa,EACb,iBAAiB,GACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACH,OAAO,EACP,cAAc,EACd,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,6BAA6B,EAC7B,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,MAAM,EACN,MAAM,EACN,oBAAoB,EACpB,WAAW,EACX,uBAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACvD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,YAAY,EACR,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,EAC5B,kBAAkB,EAClB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAChB,6BAA6B,EAC7B,wBAAwB,EACxB,6BAA6B,EAC7B,aAAa,EACb,iBAAiB,GACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACH,OAAO,EACP,cAAc,EACd,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,6BAA6B,EAC7B,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,MAAM,EACN,MAAM,EACN,oBAAoB,EACpB,WAAW,EACX,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,gBAAgB,GACnB,MAAM,gBAAgB,CAAA;AAIvB,YAAY,EACR,aAAa,EACb,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,GAC9B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACH,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACxB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA"}
|