@wistia/vhs 2.31.1-beta.8cd67de4.2a9202d → 2.31.1-beta.9aa4b541.9dd94eb

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/dist/index.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license VHS v2.31.1-beta.8cd67de4.2a9202d
3
+ * @license VHS v2.31.1-beta.9aa4b541.9dd94eb
4
4
  *
5
5
  * Copyright (c) 2021-2023, Wistia, Inc. and its affiliates.
6
6
  *
@@ -236,7 +236,7 @@
236
236
  ${Go}
237
237
  }
238
238
  `,Qa=({text:e,children:t,focusable:r=!1,...n})=>{let o=O(e)?e:t;return r?(0,p0.jsx)(ZB,{...n,children:o}):(0,p0.jsx)(jB,{...n,children:o})};Qa.displayName="ScreenReaderOnly_VHS";i();i();var dn=require("react"),O7=G(require("styled-components"));i();i();var ql,WB=new Uint8Array(16);function d0(){if(!ql&&(ql=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ql))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ql(WB)}i();var gt=[];for(let e=0;e<256;++e)gt.push((e+256).toString(16).slice(1));function T7(e,t=0){return gt[e[t+0]]+gt[e[t+1]]+gt[e[t+2]]+gt[e[t+3]]+"-"+gt[e[t+4]]+gt[e[t+5]]+"-"+gt[e[t+6]]+gt[e[t+7]]+"-"+gt[e[t+8]]+gt[e[t+9]]+"-"+gt[e[t+10]]+gt[e[t+11]]+gt[e[t+12]]+gt[e[t+13]]+gt[e[t+14]]+gt[e[t+15]]}i();i();var UB=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),m0={randomUUID:UB};function KB(e,t,r){if(m0.randomUUID&&!t&&!e)return m0.randomUUID();e=e||{};let n=e.random||(e.rng||d0)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return T7(n)}var js=KB;i();var Wn=G(require("styled-components"));i();i();i();var P7=require("styled-components"),br=()=>(0,P7.useTheme)();var A7=(e,t)=>{if(!e.hasOwnProperty(t))throw new Error(`\`${String(t)}\` is not a defined theme color, check argument passed to \`useThemeColor\``);return e[t]},Re=(e=null)=>{let t=br().color;if(!Object.keys({...t}).length)throw new Error("The `useThemeColor` hook could not find any defined colors. A possible cause of this error is that your component is not wrapped in a theme provider such as `<VHSProvider />`");return e===null?t:Array.isArray(e)?e.map(n=>A7(t,n)):A7(t,e)};var h0=require("react/jsx-runtime"),jo=8,Zs=Wn.default.div`
239
- color: ${({overrideFontColor:e})=>e??"white"};
239
+ color: ${({fontColorOverride:e})=>e??"white"};
240
240
  font-size: 12px;
241
241
  font-weight: ${({theme:e})=>e.font.weight.regular};
242
242
  line-height: 18px;
@@ -313,7 +313,7 @@
313
313
  background: ${({backgroundColor:e})=>e};
314
314
  border: solid 1px ${({backgroundColor:e})=>e};
315
315
  border-radius: 4px;
316
- color: ${({overrideFontColor:e})=>e??"white"};
316
+ color: ${({fontColorOverride:e})=>e??"white"};
317
317
  display: ${({active:e,forceState:t})=>e||t==="open"?"block":"none"};
318
318
  position: absolute;
319
319
  transition: all ${({theme:e})=>e.duration.productive.moderate};
@@ -325,12 +325,12 @@
325
325
  }
326
326
 
327
327
  ${({direction:e})=>{switch(e){case"top":return qB;case"bottom":return XB;case"left":return YB;case"right":return JB;default:return}}}
328
- `,$7=({id:e,active:t,direction:r,children:n,forceState:o,shouldWrap:a,overrideBackgroundColor:s,overrideFontColor:u})=>{let l=Re("grey900");return(0,h0.jsx)(QB,{active:t,"aria-hidden":!t,backgroundColor:s??l,"data-testid":"tooltip-content",direction:r,forceState:o,id:e,overrideFontColor:u,shouldWrap:a,children:(0,h0.jsx)(Zs,{overrideFontColor:u,children:n})})};i();i();var ei=require("react/jsx-runtime"),ti=({children:e,maxChars:t,terminator:r="...",breakOnWords:n=!1})=>{if(ge(e))return null;let o=e.length+r.length>=t;if(!Ft(e)||t<=0||!o)return(0,ei.jsx)(ei.Fragment,{children:e});let a=e.slice(0,t-r.length);if(n){let s=Math.max(a.lastIndexOf(" "),a.lastIndexOf(`
328
+ `,$7=({id:e,active:t,direction:r,children:n,forceState:o,shouldWrap:a,backgroundColorOverride:s,fontColorOverride:u})=>{let l=Re("grey900");return(0,h0.jsx)(QB,{active:t,"aria-hidden":!t,backgroundColor:s??l,"data-testid":"tooltip-content",direction:r,fontColorOverride:u,forceState:o,id:e,shouldWrap:a,children:(0,h0.jsx)(Zs,{fontColorOverride:u,children:n})})};i();i();var ei=require("react/jsx-runtime"),ti=({children:e,maxChars:t,terminator:r="...",breakOnWords:n=!1})=>{if(ge(e))return null;let o=e.length+r.length>=t;if(!Ft(e)||t<=0||!o)return(0,ei.jsx)(ei.Fragment,{children:e});let a=e.slice(0,t-r.length);if(n){let s=Math.max(a.lastIndexOf(" "),a.lastIndexOf(`
329
329
  `));a=a.slice(0,s)}return a=`${a.trim()}${r}`,(0,ei.jsx)(ei.Fragment,{children:a})};ti.displayName="Truncate_VHS";var Un=require("react/jsx-runtime"),eR=e=>`${e}${js()}`,tR=O7.default.div`
330
330
  display: inline-block;
331
331
  position: relative;
332
332
  width: inherit;
333
- `,Kn=({label:e,direction:t="top",duration:r=2e3,eventType:n="hover",forceState:o=void 0,maxChars:a=null,children:s,id:u=null,shouldWrap:l=!1,overrideBackgroundColor:c,overrideFontColor:p,...m})=>{let[h,g]=(0,dn.useState)(!1),v=(0,dn.useMemo)(()=>u??eR("ra-tooltip-"),[u]),f=(0,dn.useRef)(null),b=(0,dn.useRef)(null),C=()=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{g(!1)},r)},x=()=>{g(!0),r&&(clearTimeout(b.current??void 0),C())},D=()=>g(!0),E=()=>g(!1),P=()=>x(),w=()=>g(!1);if((0,dn.useEffect)(()=>{let M=_=>{if(h){if(f.current===null||f.current.contains(_.target))return;g(!1)}};return r||document.addEventListener("mousedown",M,!1),()=>{b.current&&clearTimeout(b.current),document.removeEventListener("mousedown",M,!1)}},[h,b,r]),Ft(e)&&!e.length)return(0,Un.jsx)(Un.Fragment,{children:s});let T=e;return a!==null&&(T=(0,Un.jsx)(ti,{breakOnWords:!0,maxChars:a,children:e})),(0,Un.jsxs)(tR,{"aria-labelledby":v,role:"tooltip",...(()=>{let M={onFocus:P,onMouseLeave:E,onMouseOver:D,onBlur:w},_={onClick:x,ref:f};return n==="hover"?M:_})(),...m,children:[(0,Un.jsx)($7,{active:h,direction:t,forceState:o,id:v,overrideBackgroundColor:c,overrideFontColor:p,shouldWrap:l,children:T}),s]})};Kn.displayName="Tooltip_VHS";var qn=require("react/jsx-runtime");var rR=Xn.css`
333
+ `,Kn=({label:e,direction:t="top",duration:r=2e3,eventType:n="hover",forceState:o=void 0,maxChars:a=null,children:s,id:u=null,shouldWrap:l=!1,backgroundColorOverride:c,fontColorOverride:p,...m})=>{let[h,g]=(0,dn.useState)(!1),v=(0,dn.useMemo)(()=>u??eR("ra-tooltip-"),[u]),f=(0,dn.useRef)(null),b=(0,dn.useRef)(null),C=()=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{g(!1)},r)},x=()=>{g(!0),r&&(clearTimeout(b.current??void 0),C())},D=()=>g(!0),E=()=>g(!1),P=()=>x(),w=()=>g(!1);if((0,dn.useEffect)(()=>{let M=_=>{if(h){if(f.current===null||f.current.contains(_.target))return;g(!1)}};return r||document.addEventListener("mousedown",M,!1),()=>{b.current&&clearTimeout(b.current),document.removeEventListener("mousedown",M,!1)}},[h,b,r]),Ft(e)&&!e.length)return(0,Un.jsx)(Un.Fragment,{children:s});let T=e;return a!==null&&(T=(0,Un.jsx)(ti,{breakOnWords:!0,maxChars:a,children:e})),(0,Un.jsxs)(tR,{"aria-labelledby":v,role:"tooltip",...(()=>{let M={onFocus:P,onMouseLeave:E,onMouseOver:D,onBlur:w},_={onClick:x,ref:f};return n==="hover"?M:_})(),...m,children:[(0,Un.jsx)($7,{active:h,backgroundColorOverride:c,direction:t,fontColorOverride:p,forceState:o,id:v,shouldWrap:l,children:T}),s]})};Kn.displayName="Tooltip_VHS";var qn=require("react/jsx-runtime");var rR=Xn.css`
334
334
  max-height: 16px;
335
335
  max-width: 16px;
336
336
  min-height: 16px;
@@ -2377,6 +2377,7 @@
2377
2377
  border: 1px solid ${e=>e.theme.color.brandBlue500};
2378
2378
  }
2379
2379
  `,pj=({latestDate:e,shouldPreventFuture:t})=>e||(t?ha(new Date):void 0),os=({onChange:e,onSelectedRangePartChange:t,range:r,earliestDate:n,latestDate:o,shouldPreventFuture:a=!1,width:s="100%",onErrorChange:u})=>{let[l,c]=(0,jt.useState)(An),[p,m]=(0,jt.useState)(0),[h,g]=(0,jt.useState)([]),v=(0,jt.useRef)(null),[f,b]=(0,jt.useState)([0,-1]),C=ct(f)||ct(f[1])||ct(f[0])?0:f[1]-f[0],x=Ur(l),D=(0,jt.useCallback)(E=>{let P=hw({range:E,maxDate:pj({latestDate:o,shouldPreventFuture:a}),minDate:n});dw(E)&&(c(W3(E)),!P.length&&te(e)&&e(gw(E))),g(P)},[n,o,a,e]);return(0,jt.useEffect)(()=>{g([]),c(W3(r))},[r]),(0,jt.useEffect)(()=>{te(u)&&u(h)},[h,u]),(0,jt.useEffect)(()=>{if(C===p){m(0);let E=Ru(f,1,Co);b(E)}},[p,f,C]),(0,jt.useEffect)(()=>{vw(v,f[0],f[1]),te(t)&&t(Cw(f))},[f,l,v,t]),(0,Iu.jsxs)("div",{children:[!!h.length&&(0,Iu.jsx)(uw,{messages:h}),(0,Iu.jsx)(fj,{ref:v,"data-testid":"range-selector-input",onBlur:()=>{if(p!==C&&p!==0){let E=lf(l);O(E)&&D(E)}b([0,-1])},onFocus:()=>{if(yw(l)!==-1){let P=Co[0];if(O(P)){let{start:w,end:T}=P;b([w,T])}}},onKeyDown:E=>{let P={event:E,currentSelection:f,keyCount:p,valueParts:x,selectionLength:C};if(!lw(E)){E.preventDefault();return}if(cw(E)){let{nextValue:w,nextKeyCount:T,shouldApply:F}=ww(P),M=lf(w);F&&te(M)?D(M):c(w),m(T)}if(fw(E)){let{nextSelection:w,nextKeyCount:T}=Ew(P);te(w)&&b(w),m(T);let F=lf(l);te(F)&&D(F)}},onMouseDown:pw,onMouseUp:()=>{m(0),b(bw(v,Co))},readOnly:!0,type:"text",value:l,width:s})]})};os.displayName="RangeSelectorInput_VHS";var He=require("react/jsx-runtime"),dj=dr.default.div`
2380
+ text-align: left;
2380
2381
  width: 240px;
2381
2382
  `,mj=({tooltipText:e})=>(0,He.jsx)(Kn,{direction:"right",label:(0,He.jsx)(dj,{children:e}),shouldWrap:!0,children:(0,He.jsx)(Se,{size:"md",style:{verticalAlign:"text-bottom"},type:"question-mark"})}),Sw=e=>e.toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit"}),hj=({start:e,end:t})=>`${Sw(e)} - ${Sw(t)}`,gj=(e,t)=>Gt(e.start,t.start)&&Gt(e.end,t.end),vj=dr.default.div`
2382
2383
  padding: ${({theme:e})=>`0 ${e.spacing.space03}`};
@@ -2409,8 +2410,8 @@
2409
2410
  display: flex;
2410
2411
  font-size: 15px;
2411
2412
  justify-content: space-between;
2412
- min-width: 120px;
2413
2413
  padding: ${({theme:e})=>e.spacing.space03};
2414
+ width: 100%;
2414
2415
 
2415
2416
  &:hover {
2416
2417
  background: ${e=>e.theme.color.grey100};
@@ -2450,8 +2451,19 @@
2450
2451
  padding: ${({theme:e})=>e.spacing.space05};
2451
2452
  width: 100%;
2452
2453
  `,Tj=dr.default.span`
2453
- text-wrap: nowrap;
2454
- `,pf=({align:e="left",buttonVariant:t="secondary",earliestDate:r,latestDate:n,format:o=hj,footerText:a,onChange:s,presets:u=[],range:l={end:new Date,start:new Date},shouldPreventFuture:c=!1})=>{let[p,m]=(0,$n.useState)(l),[h,g]=(0,$n.useState)(!1),[v,f]=(0,$n.useState)(!0),[b,C]=(0,$n.useState)("end"),[x,D]=(0,$n.useState)([]),E=br();return(0,$n.useEffect)(()=>{m(l)},[l]),(0,$n.useEffect)(()=>{let w=()=>{g(!1),m(l)};return h&&window.addEventListener("click",w),()=>{window.removeEventListener("click",w)}},[h,l,m]),(0,He.jsxs)(bj,{"data-testid":"rangeselector-test-identifer",onClick:w=>w.stopPropagation(),children:[(0,He.jsx)(yj,{"data-testid":"trigger",icon:(0,He.jsx)(Se,{size:"sm",type:"caret-down"}),iconPosition:"end",inputButtonOverride:t==="input",onClick:()=>g(!h),variant:t==="input"?"tertiary":t,children:o(l)}),h?(0,He.jsxs)(wj,{align:e,hasPresets:!!u.length,children:[(0,He.jsxs)(Ej,{children:[!!u.length&&(0,He.jsx)(Ui,{"data-testid":"presets",style:{marginBottom:0,borderRight:`1px solid ${E.color.grey400}`,padding:"12px"},variant:"unbulleted",children:u.map(({label:w,value:T,tooltipText:F})=>(0,He.jsx)(ho,{children:(0,He.jsx)(Cj,{"data-testid":w?.replaceAll(" ","_"),isActive:gj(p,T),onClick:()=>{m(T)},children:(0,He.jsxs)(Tj,{children:[w," ",F!==void 0?(0,He.jsx)(mj,{tooltipText:F}):null]})})},w))}),(0,He.jsx)(Dj,{children:(0,He.jsxs)(vj,{children:[(0,He.jsx)(os,{earliestDate:r,latestDate:n,onChange:w=>{m(w)},onErrorChange:D,onSelectedRangePartChange:C,range:p,shouldPreventFuture:c,width:"100%"}),(0,He.jsx)(ts,{earliestDate:r,latestDate:n,onChange:w=>{m(w)},onIsValidChange:f,range:p,rangePartToShow:b,shouldPreventFuture:c})]})})]}),(0,He.jsx)(xj,{}),(0,He.jsxs)(Sj,{children:[(0,He.jsx)("div",{children:a}),(0,He.jsxs)(jr,{align:"right",children:[(0,He.jsx)(Xe,{onClick:()=>{m(l),g(!1)},style:{marginLeft:0},variant:"secondary",children:"Cancel"}),(0,He.jsx)(Xe,{"data-testid":"apply-button",disabled:!!x.length||!v,onMouseUp:()=>{s&&s(p),g(!1)},children:"Apply"})]})]})]}):null]})};pf.displayName="RangeSelector_VHS";i();var is=G(require("styled-components"));i();i();i();i();function ku(e,t){return ku=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},ku(e,t)}function K3(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ku(e,t)}var va=G(require("react"),1);function q3(e){return e&&e.stopPropagation&&e.stopPropagation(),e&&e.preventDefault&&e.preventDefault(),!1}function X3(e){return e==null?[]:Array.isArray(e)?e.slice():[e]}function df(e){return e!==null&&e.length===1?e[0]:e.slice()}function mf(e){Object.keys(e).forEach(t=>{typeof document<"u"&&document.addEventListener(t,e[t],!1)})}function ga(e,t){return Y3(function(r,n){let o=r;return o<=n.min&&(o=n.min),o>=n.max&&(o=n.max),o}(e,t),t)}function Y3(e,t){let r=(e-t.min)%t.step,n=e-r;return 2*Math.abs(r)>=t.step&&(n+=r>0?t.step:-t.step),parseFloat(n.toFixed(5))}var J3=function(e){function t(n){var o;(o=e.call(this,n)||this).onKeyUp=()=>{o.onEnd()},o.onMouseUp=()=>{o.onEnd(o.getMouseEventMap())},o.onTouchEnd=u=>{u.preventDefault(),o.onEnd(o.getTouchEventMap())},o.onBlur=()=>{o.setState({index:-1},o.onEnd(o.getKeyDownEventMap()))},o.onMouseMove=u=>{o.setState({pending:!0});let l=o.getMousePosition(u),c=o.getDiffPosition(l[0]),p=o.getValueFromPosition(c);o.move(p)},o.onTouchMove=u=>{if(u.touches.length>1)return;o.setState({pending:!0});let l=o.getTouchPosition(u);if(o.isScrolling===void 0){let m=l[0]-o.startPosition[0],h=l[1]-o.startPosition[1];o.isScrolling=Math.abs(h)>Math.abs(m)}if(o.isScrolling)return void o.setState({index:-1});let c=o.getDiffPosition(l[0]),p=o.getValueFromPosition(c);o.move(p)},o.onKeyDown=u=>{if(!(u.ctrlKey||u.shiftKey||u.altKey||u.metaKey))switch(o.setState({pending:!0}),u.key){case"ArrowLeft":case"ArrowDown":case"Left":case"Down":u.preventDefault(),o.moveDownByStep();break;case"ArrowRight":case"ArrowUp":case"Right":case"Up":u.preventDefault(),o.moveUpByStep();break;case"Home":u.preventDefault(),o.move(o.props.min);break;case"End":u.preventDefault(),o.move(o.props.max);break;case"PageDown":u.preventDefault(),o.moveDownByStep(o.props.pageFn(o.props.step));break;case"PageUp":u.preventDefault(),o.moveUpByStep(o.props.pageFn(o.props.step))}},o.onSliderMouseDown=u=>{if(!o.props.disabled&&u.button!==2){if(o.setState({pending:!0}),!o.props.snapDragDisabled){let l=o.getMousePosition(u);o.forceValueFromPosition(l[0],c=>{o.start(c,l[0]),mf(o.getMouseEventMap())})}q3(u)}},o.onSliderClick=u=>{if(!o.props.disabled&&o.props.onSliderClick&&!o.hasMoved){let l=o.getMousePosition(u),c=ga(o.calcValue(o.calcOffsetFromPosition(l[0])),o.props);o.props.onSliderClick(c)}},o.createOnKeyDown=u=>l=>{o.props.disabled||(o.start(u),mf(o.getKeyDownEventMap()),q3(l))},o.createOnMouseDown=u=>l=>{if(o.props.disabled||l.button===2)return;o.setState({pending:!0});let c=o.getMousePosition(l);o.start(u,c[0]),mf(o.getMouseEventMap()),q3(l)},o.createOnTouchStart=u=>l=>{if(o.props.disabled||l.touches.length>1)return;o.setState({pending:!0});let c=o.getTouchPosition(l);o.startPosition=c,o.isScrolling=void 0,o.start(u,c[0]),mf(o.getTouchEventMap()),function(p){p.stopPropagation&&p.stopPropagation()}(l)},o.handleResize=()=>{let u=window.setTimeout(()=>{o.pendingResizeTimeouts.shift(),o.resize()},0);o.pendingResizeTimeouts.push(u)},o.renderThumb=(u,l)=>{let c=o.props.thumbClassName+" "+o.props.thumbClassName+"-"+l+" "+(o.state.index===l?o.props.thumbActiveClassName:""),p={ref:h=>{o["thumb"+l]=h},key:o.props.thumbClassName+"-"+l,className:c,style:u,onMouseDown:o.createOnMouseDown(l),onTouchStart:o.createOnTouchStart(l),onFocus:o.createOnKeyDown(l),tabIndex:0,role:"slider","aria-orientation":o.props.orientation,"aria-valuenow":o.state.value[l],"aria-valuemin":o.props.min,"aria-valuemax":o.props.max,"aria-label":Array.isArray(o.props.ariaLabel)?o.props.ariaLabel[l]:o.props.ariaLabel,"aria-labelledby":Array.isArray(o.props.ariaLabelledby)?o.props.ariaLabelledby[l]:o.props.ariaLabelledby,"aria-disabled":o.props.disabled},m={index:l,value:df(o.state.value),valueNow:o.state.value[l]};return o.props.ariaValuetext&&(p["aria-valuetext"]=typeof o.props.ariaValuetext=="string"?o.props.ariaValuetext:o.props.ariaValuetext(m)),o.props.renderThumb(p,m)},o.renderTrack=(u,l,c)=>{let p={key:o.props.trackClassName+"-"+u,className:o.props.trackClassName+" "+o.props.trackClassName+"-"+u,style:o.buildTrackStyle(l,o.state.upperBound-c)},m={index:u,value:df(o.state.value)};return o.props.renderTrack(p,m)};let a=X3(n.value);a.length||(a=X3(n.defaultValue)),o.pendingResizeTimeouts=[];let s=[];for(let u=0;u<a.length;u+=1)a[u]=ga(a[u],n),s.push(u);return o.resizeObserver=null,o.resizeElementRef=va.default.createRef(),o.state={index:-1,upperBound:0,sliderLength:0,value:a,zIndices:s},o}K3(t,e);var r=t.prototype;return r.componentDidMount=function(){typeof window<"u"&&(this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.resizeElementRef.current),this.resize())},t.getDerivedStateFromProps=function(n,o){let a=X3(n.value);return a.length?o.pending?null:{value:a.map(s=>ga(s,n))}:null},r.componentDidUpdate=function(){this.state.upperBound===0&&this.resize()},r.componentWillUnmount=function(){this.clearPendingResizeTimeouts(),this.resizeObserver&&this.resizeObserver.disconnect()},r.onEnd=function(n){n&&function(o){Object.keys(o).forEach(a=>{typeof document<"u"&&document.removeEventListener(a,o[a],!1)})}(n),this.hasMoved&&this.fireChangeEvent("onAfterChange"),this.setState({pending:!1}),this.hasMoved=!1},r.getValue=function(){return df(this.state.value)},r.getClosestIndex=function(n){let o=Number.MAX_VALUE,a=-1,{value:s}=this.state,u=s.length;for(let l=0;l<u;l+=1){let c=this.calcOffset(s[l]),p=Math.abs(n-c);p<o&&(o=p,a=l)}return a},r.getMousePosition=function(n){return[n["page"+this.axisKey()],n["page"+this.orthogonalAxisKey()]]},r.getTouchPosition=function(n){let o=n.touches[0];return[o["page"+this.axisKey()],o["page"+this.orthogonalAxisKey()]]},r.getKeyDownEventMap=function(){return{keydown:this.onKeyDown,keyup:this.onKeyUp,focusout:this.onBlur}},r.getMouseEventMap=function(){return{mousemove:this.onMouseMove,mouseup:this.onMouseUp}},r.getTouchEventMap=function(){return{touchmove:this.onTouchMove,touchend:this.onTouchEnd}},r.getValueFromPosition=function(n){let o=n/(this.state.sliderLength-this.state.thumbSize)*(this.props.max-this.props.min);return ga(this.state.startValue+o,this.props)},r.getDiffPosition=function(n){let o=n-this.state.startPosition;return this.props.invert&&(o*=-1),o},r.resize=function(){let{slider:n,thumb0:o}=this;if(!n||!o)return;let a=this.sizeKey(),s=n.getBoundingClientRect(),u=n[a],l=s[this.posMaxKey()],c=s[this.posMinKey()],p=o.getBoundingClientRect()[a.replace("client","").toLowerCase()],m=u-p,h=Math.abs(l-c);this.state.upperBound===m&&this.state.sliderLength===h&&this.state.thumbSize===p||this.setState({upperBound:m,sliderLength:h,thumbSize:p})},r.calcOffset=function(n){let o=this.props.max-this.props.min;return o===0?0:(n-this.props.min)/o*this.state.upperBound},r.calcValue=function(n){return n/this.state.upperBound*(this.props.max-this.props.min)+this.props.min},r.calcOffsetFromPosition=function(n){let{slider:o}=this,a=o.getBoundingClientRect(),s=a[this.posMaxKey()],u=a[this.posMinKey()],l=n-(window["page"+this.axisKey()+"Offset"]+(this.props.invert?s:u));return this.props.invert&&(l=this.state.sliderLength-l),l-=this.state.thumbSize/2,l},r.forceValueFromPosition=function(n,o){let a=this.calcOffsetFromPosition(n),s=this.getClosestIndex(a),u=ga(this.calcValue(a),this.props),l=this.state.value.slice();l[s]=u;for(let c=0;c<l.length-1;c+=1)if(l[c+1]-l[c]<this.props.minDistance)return;this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0,this.setState({value:l},()=>{o(s),this.fireChangeEvent("onChange")})},r.clearPendingResizeTimeouts=function(){do{let n=this.pendingResizeTimeouts.shift();clearTimeout(n)}while(this.pendingResizeTimeouts.length)},r.start=function(n,o){let a=this["thumb"+n];a&&a.focus();let{zIndices:s}=this.state;s.splice(s.indexOf(n),1),s.push(n),this.setState(u=>({startValue:u.value[n],startPosition:o!==void 0?o:u.startPosition,index:n,zIndices:s}))},r.moveUpByStep=function(n){n===void 0&&(n=this.props.step);let o=this.state.value[this.state.index],a=ga(this.props.invert&&this.props.orientation==="horizontal"?o-n:o+n,this.props);this.move(Math.min(a,this.props.max))},r.moveDownByStep=function(n){n===void 0&&(n=this.props.step);let o=this.state.value[this.state.index],a=ga(this.props.invert&&this.props.orientation==="horizontal"?o+n:o-n,this.props);this.move(Math.max(a,this.props.min))},r.move=function(n){let o=this.state.value.slice(),{index:a}=this.state,{length:s}=o,u=o[a];if(n===u)return;this.hasMoved||this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0;let{pearling:l,max:c,min:p,minDistance:m}=this.props;if(!l){if(a>0){let h=o[a-1];n<h+m&&(n=h+m)}if(a<s-1){let h=o[a+1];n>h-m&&(n=h-m)}}o[a]=n,l&&s>1&&(n>u?(this.pushSucceeding(o,m,a),function(h,g,v,f){for(let b=0;b<h;b+=1){let C=f-b*v;g[h-1-b]>C&&(g[h-1-b]=C)}}(s,o,m,c)):n<u&&(this.pushPreceding(o,m,a),function(h,g,v,f){for(let b=0;b<h;b+=1){let C=f+b*v;g[b]<C&&(g[b]=C)}}(s,o,m,p))),this.setState({value:o},this.fireChangeEvent.bind(this,"onChange"))},r.pushSucceeding=function(n,o,a){let s,u;for(s=a,u=n[s]+o;n[s+1]!==null&&u>n[s+1];s+=1,u=n[s]+o)n[s+1]=Y3(u,this.props)},r.pushPreceding=function(n,o,a){for(let s=a,u=n[s]-o;n[s-1]!==null&&u<n[s-1];s-=1,u=n[s]-o)n[s-1]=Y3(u,this.props)},r.axisKey=function(){return this.props.orientation==="vertical"?"Y":"X"},r.orthogonalAxisKey=function(){return this.props.orientation==="vertical"?"X":"Y"},r.posMinKey=function(){return this.props.orientation==="vertical"?this.props.invert?"bottom":"top":this.props.invert?"right":"left"},r.posMaxKey=function(){return this.props.orientation==="vertical"?this.props.invert?"top":"bottom":this.props.invert?"left":"right"},r.sizeKey=function(){return this.props.orientation==="vertical"?"clientHeight":"clientWidth"},r.fireChangeEvent=function(n){this.props[n]&&this.props[n](df(this.state.value),this.state.index)},r.buildThumbStyle=function(n,o){let a={position:"absolute",touchAction:"none",willChange:this.state.index>=0?this.posMinKey():void 0,zIndex:this.state.zIndices.indexOf(o)+1};return a[this.posMinKey()]=n+"px",a},r.buildTrackStyle=function(n,o){let a={position:"absolute",willChange:this.state.index>=0?this.posMinKey()+","+this.posMaxKey():void 0};return a[this.posMinKey()]=n,a[this.posMaxKey()]=o,a},r.buildMarkStyle=function(n){var o;return(o={position:"absolute"})[this.posMinKey()]=n,o},r.renderThumbs=function(n){let{length:o}=n,a=[];for(let u=0;u<o;u+=1)a[u]=this.buildThumbStyle(n[u],u);let s=[];for(let u=0;u<o;u+=1)s[u]=this.renderThumb(a[u],u);return s},r.renderTracks=function(n){let o=[],a=n.length-1;o.push(this.renderTrack(0,0,n[0]));for(let s=0;s<a;s+=1)o.push(this.renderTrack(s+1,n[s],n[s+1]));return o.push(this.renderTrack(a+1,n[a],this.state.upperBound)),o},r.renderMarks=function(){let{marks:n}=this.props,o=this.props.max-this.props.min+1;return typeof n=="boolean"?n=Array.from({length:o}).map((a,s)=>s):typeof n=="number"&&(n=Array.from({length:o}).map((a,s)=>s).filter(a=>a%n==0)),n.map(parseFloat).sort((a,s)=>a-s).map(a=>{let s=this.calcOffset(a),u={key:a,className:this.props.markClassName,style:this.buildMarkStyle(s)};return this.props.renderMark(u)})},r.render=function(){let n=[],{value:o}=this.state,a=o.length;for(let c=0;c<a;c+=1)n[c]=this.calcOffset(o[c],c);let s=this.props.withTracks?this.renderTracks(n):null,u=this.renderThumbs(n),l=this.props.marks?this.renderMarks():null;return va.default.createElement("div",{ref:c=>{this.slider=c,this.resizeElementRef.current=c},style:{position:"relative"},className:this.props.className+(this.props.disabled?" disabled":""),onMouseDown:this.onSliderMouseDown,onClick:this.onSliderClick},s,u,l)},t}(va.default.Component);J3.displayName="ReactSlider",J3.defaultProps={min:0,max:100,step:1,pageFn:e=>10*e,minDistance:0,defaultValue:0,orientation:"horizontal",className:"slider",thumbClassName:"thumb",thumbActiveClassName:"active",trackClassName:"track",markClassName:"mark",withTracks:!0,pearling:!1,disabled:!1,snapDragDisabled:!1,invert:!1,marks:[],renderThumb:e=>va.default.createElement("div",e),renderTrack:e=>va.default.createElement("div",e),renderMark:e=>va.default.createElement("span",e)};var Q3=J3;var as=require("react/jsx-runtime"),Tw="4px",Pj=is.css`
2454
+ text-align: left;
2455
+ white-space: nowrap;
2456
+
2457
+ &&::before {
2458
+ content: attr(title);
2459
+ display: block;
2460
+ font-weight: bold;
2461
+ height: 0;
2462
+ overflow: hidden;
2463
+ visibility: hidden;
2464
+ width: calc(100% + 40px);
2465
+ }
2466
+ `,pf=({align:e="left",buttonVariant:t="secondary",earliestDate:r,latestDate:n,format:o=hj,footerText:a,onChange:s,presets:u=[],range:l={end:new Date,start:new Date},shouldPreventFuture:c=!1})=>{let[p,m]=(0,$n.useState)(l),[h,g]=(0,$n.useState)(!1),[v,f]=(0,$n.useState)(!0),[b,C]=(0,$n.useState)("end"),[x,D]=(0,$n.useState)([]),E=br();return(0,$n.useEffect)(()=>{m(l)},[l]),(0,$n.useEffect)(()=>{let w=()=>{g(!1),m(l)};return h&&window.addEventListener("click",w),()=>{window.removeEventListener("click",w)}},[h,l,m]),(0,He.jsxs)(bj,{"data-testid":"rangeselector-test-identifer",onClick:w=>w.stopPropagation(),children:[(0,He.jsx)(yj,{"data-testid":"trigger",icon:(0,He.jsx)(Se,{size:"sm",type:"caret-down"}),iconPosition:"end",inputButtonOverride:t==="input",onClick:()=>g(!h),variant:t==="input"?"tertiary":t,children:o(l)}),h?(0,He.jsxs)(wj,{align:e,hasPresets:!!u.length,children:[(0,He.jsxs)(Ej,{children:[!!u.length&&(0,He.jsx)(Ui,{"data-testid":"presets",style:{marginBottom:0,borderRight:`1px solid ${E.color.grey400}`,padding:"12px"},variant:"unbulleted",children:u.map(({label:w,value:T,tooltipText:F})=>(0,He.jsx)(ho,{children:(0,He.jsx)(Cj,{"data-testid":w?.replaceAll(" ","_"),isActive:gj(p,T),onClick:()=>{m(T)},children:(0,He.jsxs)(Tj,{title:`${w}___`,children:[w," ",F!==void 0?(0,He.jsx)(mj,{tooltipText:F}):null]})})},w))}),(0,He.jsx)(Dj,{children:(0,He.jsxs)(vj,{children:[(0,He.jsx)(os,{earliestDate:r,latestDate:n,onChange:w=>{m(w)},onErrorChange:D,onSelectedRangePartChange:C,range:p,shouldPreventFuture:c,width:"100%"}),(0,He.jsx)(ts,{earliestDate:r,latestDate:n,onChange:w=>{m(w)},onIsValidChange:f,range:p,rangePartToShow:b,shouldPreventFuture:c})]})})]}),(0,He.jsx)(xj,{}),(0,He.jsxs)(Sj,{children:[(0,He.jsx)("div",{children:a}),(0,He.jsxs)(jr,{align:"right",children:[(0,He.jsx)(Xe,{onClick:()=>{m(l),g(!1)},style:{marginLeft:0},variant:"secondary",children:"Cancel"}),(0,He.jsx)(Xe,{"data-testid":"apply-button",disabled:!!x.length||!v,onMouseUp:()=>{s&&s(p),g(!1)},children:"Apply"})]})]})]}):null]})};pf.displayName="RangeSelector_VHS";i();var is=G(require("styled-components"));i();i();i();i();function ku(e,t){return ku=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},ku(e,t)}function K3(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ku(e,t)}var va=G(require("react"),1);function q3(e){return e&&e.stopPropagation&&e.stopPropagation(),e&&e.preventDefault&&e.preventDefault(),!1}function X3(e){return e==null?[]:Array.isArray(e)?e.slice():[e]}function df(e){return e!==null&&e.length===1?e[0]:e.slice()}function mf(e){Object.keys(e).forEach(t=>{typeof document<"u"&&document.addEventListener(t,e[t],!1)})}function ga(e,t){return Y3(function(r,n){let o=r;return o<=n.min&&(o=n.min),o>=n.max&&(o=n.max),o}(e,t),t)}function Y3(e,t){let r=(e-t.min)%t.step,n=e-r;return 2*Math.abs(r)>=t.step&&(n+=r>0?t.step:-t.step),parseFloat(n.toFixed(5))}var J3=function(e){function t(n){var o;(o=e.call(this,n)||this).onKeyUp=()=>{o.onEnd()},o.onMouseUp=()=>{o.onEnd(o.getMouseEventMap())},o.onTouchEnd=u=>{u.preventDefault(),o.onEnd(o.getTouchEventMap())},o.onBlur=()=>{o.setState({index:-1},o.onEnd(o.getKeyDownEventMap()))},o.onMouseMove=u=>{o.setState({pending:!0});let l=o.getMousePosition(u),c=o.getDiffPosition(l[0]),p=o.getValueFromPosition(c);o.move(p)},o.onTouchMove=u=>{if(u.touches.length>1)return;o.setState({pending:!0});let l=o.getTouchPosition(u);if(o.isScrolling===void 0){let m=l[0]-o.startPosition[0],h=l[1]-o.startPosition[1];o.isScrolling=Math.abs(h)>Math.abs(m)}if(o.isScrolling)return void o.setState({index:-1});let c=o.getDiffPosition(l[0]),p=o.getValueFromPosition(c);o.move(p)},o.onKeyDown=u=>{if(!(u.ctrlKey||u.shiftKey||u.altKey||u.metaKey))switch(o.setState({pending:!0}),u.key){case"ArrowLeft":case"ArrowDown":case"Left":case"Down":u.preventDefault(),o.moveDownByStep();break;case"ArrowRight":case"ArrowUp":case"Right":case"Up":u.preventDefault(),o.moveUpByStep();break;case"Home":u.preventDefault(),o.move(o.props.min);break;case"End":u.preventDefault(),o.move(o.props.max);break;case"PageDown":u.preventDefault(),o.moveDownByStep(o.props.pageFn(o.props.step));break;case"PageUp":u.preventDefault(),o.moveUpByStep(o.props.pageFn(o.props.step))}},o.onSliderMouseDown=u=>{if(!o.props.disabled&&u.button!==2){if(o.setState({pending:!0}),!o.props.snapDragDisabled){let l=o.getMousePosition(u);o.forceValueFromPosition(l[0],c=>{o.start(c,l[0]),mf(o.getMouseEventMap())})}q3(u)}},o.onSliderClick=u=>{if(!o.props.disabled&&o.props.onSliderClick&&!o.hasMoved){let l=o.getMousePosition(u),c=ga(o.calcValue(o.calcOffsetFromPosition(l[0])),o.props);o.props.onSliderClick(c)}},o.createOnKeyDown=u=>l=>{o.props.disabled||(o.start(u),mf(o.getKeyDownEventMap()),q3(l))},o.createOnMouseDown=u=>l=>{if(o.props.disabled||l.button===2)return;o.setState({pending:!0});let c=o.getMousePosition(l);o.start(u,c[0]),mf(o.getMouseEventMap()),q3(l)},o.createOnTouchStart=u=>l=>{if(o.props.disabled||l.touches.length>1)return;o.setState({pending:!0});let c=o.getTouchPosition(l);o.startPosition=c,o.isScrolling=void 0,o.start(u,c[0]),mf(o.getTouchEventMap()),function(p){p.stopPropagation&&p.stopPropagation()}(l)},o.handleResize=()=>{let u=window.setTimeout(()=>{o.pendingResizeTimeouts.shift(),o.resize()},0);o.pendingResizeTimeouts.push(u)},o.renderThumb=(u,l)=>{let c=o.props.thumbClassName+" "+o.props.thumbClassName+"-"+l+" "+(o.state.index===l?o.props.thumbActiveClassName:""),p={ref:h=>{o["thumb"+l]=h},key:o.props.thumbClassName+"-"+l,className:c,style:u,onMouseDown:o.createOnMouseDown(l),onTouchStart:o.createOnTouchStart(l),onFocus:o.createOnKeyDown(l),tabIndex:0,role:"slider","aria-orientation":o.props.orientation,"aria-valuenow":o.state.value[l],"aria-valuemin":o.props.min,"aria-valuemax":o.props.max,"aria-label":Array.isArray(o.props.ariaLabel)?o.props.ariaLabel[l]:o.props.ariaLabel,"aria-labelledby":Array.isArray(o.props.ariaLabelledby)?o.props.ariaLabelledby[l]:o.props.ariaLabelledby,"aria-disabled":o.props.disabled},m={index:l,value:df(o.state.value),valueNow:o.state.value[l]};return o.props.ariaValuetext&&(p["aria-valuetext"]=typeof o.props.ariaValuetext=="string"?o.props.ariaValuetext:o.props.ariaValuetext(m)),o.props.renderThumb(p,m)},o.renderTrack=(u,l,c)=>{let p={key:o.props.trackClassName+"-"+u,className:o.props.trackClassName+" "+o.props.trackClassName+"-"+u,style:o.buildTrackStyle(l,o.state.upperBound-c)},m={index:u,value:df(o.state.value)};return o.props.renderTrack(p,m)};let a=X3(n.value);a.length||(a=X3(n.defaultValue)),o.pendingResizeTimeouts=[];let s=[];for(let u=0;u<a.length;u+=1)a[u]=ga(a[u],n),s.push(u);return o.resizeObserver=null,o.resizeElementRef=va.default.createRef(),o.state={index:-1,upperBound:0,sliderLength:0,value:a,zIndices:s},o}K3(t,e);var r=t.prototype;return r.componentDidMount=function(){typeof window<"u"&&(this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.resizeElementRef.current),this.resize())},t.getDerivedStateFromProps=function(n,o){let a=X3(n.value);return a.length?o.pending?null:{value:a.map(s=>ga(s,n))}:null},r.componentDidUpdate=function(){this.state.upperBound===0&&this.resize()},r.componentWillUnmount=function(){this.clearPendingResizeTimeouts(),this.resizeObserver&&this.resizeObserver.disconnect()},r.onEnd=function(n){n&&function(o){Object.keys(o).forEach(a=>{typeof document<"u"&&document.removeEventListener(a,o[a],!1)})}(n),this.hasMoved&&this.fireChangeEvent("onAfterChange"),this.setState({pending:!1}),this.hasMoved=!1},r.getValue=function(){return df(this.state.value)},r.getClosestIndex=function(n){let o=Number.MAX_VALUE,a=-1,{value:s}=this.state,u=s.length;for(let l=0;l<u;l+=1){let c=this.calcOffset(s[l]),p=Math.abs(n-c);p<o&&(o=p,a=l)}return a},r.getMousePosition=function(n){return[n["page"+this.axisKey()],n["page"+this.orthogonalAxisKey()]]},r.getTouchPosition=function(n){let o=n.touches[0];return[o["page"+this.axisKey()],o["page"+this.orthogonalAxisKey()]]},r.getKeyDownEventMap=function(){return{keydown:this.onKeyDown,keyup:this.onKeyUp,focusout:this.onBlur}},r.getMouseEventMap=function(){return{mousemove:this.onMouseMove,mouseup:this.onMouseUp}},r.getTouchEventMap=function(){return{touchmove:this.onTouchMove,touchend:this.onTouchEnd}},r.getValueFromPosition=function(n){let o=n/(this.state.sliderLength-this.state.thumbSize)*(this.props.max-this.props.min);return ga(this.state.startValue+o,this.props)},r.getDiffPosition=function(n){let o=n-this.state.startPosition;return this.props.invert&&(o*=-1),o},r.resize=function(){let{slider:n,thumb0:o}=this;if(!n||!o)return;let a=this.sizeKey(),s=n.getBoundingClientRect(),u=n[a],l=s[this.posMaxKey()],c=s[this.posMinKey()],p=o.getBoundingClientRect()[a.replace("client","").toLowerCase()],m=u-p,h=Math.abs(l-c);this.state.upperBound===m&&this.state.sliderLength===h&&this.state.thumbSize===p||this.setState({upperBound:m,sliderLength:h,thumbSize:p})},r.calcOffset=function(n){let o=this.props.max-this.props.min;return o===0?0:(n-this.props.min)/o*this.state.upperBound},r.calcValue=function(n){return n/this.state.upperBound*(this.props.max-this.props.min)+this.props.min},r.calcOffsetFromPosition=function(n){let{slider:o}=this,a=o.getBoundingClientRect(),s=a[this.posMaxKey()],u=a[this.posMinKey()],l=n-(window["page"+this.axisKey()+"Offset"]+(this.props.invert?s:u));return this.props.invert&&(l=this.state.sliderLength-l),l-=this.state.thumbSize/2,l},r.forceValueFromPosition=function(n,o){let a=this.calcOffsetFromPosition(n),s=this.getClosestIndex(a),u=ga(this.calcValue(a),this.props),l=this.state.value.slice();l[s]=u;for(let c=0;c<l.length-1;c+=1)if(l[c+1]-l[c]<this.props.minDistance)return;this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0,this.setState({value:l},()=>{o(s),this.fireChangeEvent("onChange")})},r.clearPendingResizeTimeouts=function(){do{let n=this.pendingResizeTimeouts.shift();clearTimeout(n)}while(this.pendingResizeTimeouts.length)},r.start=function(n,o){let a=this["thumb"+n];a&&a.focus();let{zIndices:s}=this.state;s.splice(s.indexOf(n),1),s.push(n),this.setState(u=>({startValue:u.value[n],startPosition:o!==void 0?o:u.startPosition,index:n,zIndices:s}))},r.moveUpByStep=function(n){n===void 0&&(n=this.props.step);let o=this.state.value[this.state.index],a=ga(this.props.invert&&this.props.orientation==="horizontal"?o-n:o+n,this.props);this.move(Math.min(a,this.props.max))},r.moveDownByStep=function(n){n===void 0&&(n=this.props.step);let o=this.state.value[this.state.index],a=ga(this.props.invert&&this.props.orientation==="horizontal"?o+n:o-n,this.props);this.move(Math.max(a,this.props.min))},r.move=function(n){let o=this.state.value.slice(),{index:a}=this.state,{length:s}=o,u=o[a];if(n===u)return;this.hasMoved||this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0;let{pearling:l,max:c,min:p,minDistance:m}=this.props;if(!l){if(a>0){let h=o[a-1];n<h+m&&(n=h+m)}if(a<s-1){let h=o[a+1];n>h-m&&(n=h-m)}}o[a]=n,l&&s>1&&(n>u?(this.pushSucceeding(o,m,a),function(h,g,v,f){for(let b=0;b<h;b+=1){let C=f-b*v;g[h-1-b]>C&&(g[h-1-b]=C)}}(s,o,m,c)):n<u&&(this.pushPreceding(o,m,a),function(h,g,v,f){for(let b=0;b<h;b+=1){let C=f+b*v;g[b]<C&&(g[b]=C)}}(s,o,m,p))),this.setState({value:o},this.fireChangeEvent.bind(this,"onChange"))},r.pushSucceeding=function(n,o,a){let s,u;for(s=a,u=n[s]+o;n[s+1]!==null&&u>n[s+1];s+=1,u=n[s]+o)n[s+1]=Y3(u,this.props)},r.pushPreceding=function(n,o,a){for(let s=a,u=n[s]-o;n[s-1]!==null&&u<n[s-1];s-=1,u=n[s]-o)n[s-1]=Y3(u,this.props)},r.axisKey=function(){return this.props.orientation==="vertical"?"Y":"X"},r.orthogonalAxisKey=function(){return this.props.orientation==="vertical"?"X":"Y"},r.posMinKey=function(){return this.props.orientation==="vertical"?this.props.invert?"bottom":"top":this.props.invert?"right":"left"},r.posMaxKey=function(){return this.props.orientation==="vertical"?this.props.invert?"top":"bottom":this.props.invert?"left":"right"},r.sizeKey=function(){return this.props.orientation==="vertical"?"clientHeight":"clientWidth"},r.fireChangeEvent=function(n){this.props[n]&&this.props[n](df(this.state.value),this.state.index)},r.buildThumbStyle=function(n,o){let a={position:"absolute",touchAction:"none",willChange:this.state.index>=0?this.posMinKey():void 0,zIndex:this.state.zIndices.indexOf(o)+1};return a[this.posMinKey()]=n+"px",a},r.buildTrackStyle=function(n,o){let a={position:"absolute",willChange:this.state.index>=0?this.posMinKey()+","+this.posMaxKey():void 0};return a[this.posMinKey()]=n,a[this.posMaxKey()]=o,a},r.buildMarkStyle=function(n){var o;return(o={position:"absolute"})[this.posMinKey()]=n,o},r.renderThumbs=function(n){let{length:o}=n,a=[];for(let u=0;u<o;u+=1)a[u]=this.buildThumbStyle(n[u],u);let s=[];for(let u=0;u<o;u+=1)s[u]=this.renderThumb(a[u],u);return s},r.renderTracks=function(n){let o=[],a=n.length-1;o.push(this.renderTrack(0,0,n[0]));for(let s=0;s<a;s+=1)o.push(this.renderTrack(s+1,n[s],n[s+1]));return o.push(this.renderTrack(a+1,n[a],this.state.upperBound)),o},r.renderMarks=function(){let{marks:n}=this.props,o=this.props.max-this.props.min+1;return typeof n=="boolean"?n=Array.from({length:o}).map((a,s)=>s):typeof n=="number"&&(n=Array.from({length:o}).map((a,s)=>s).filter(a=>a%n==0)),n.map(parseFloat).sort((a,s)=>a-s).map(a=>{let s=this.calcOffset(a),u={key:a,className:this.props.markClassName,style:this.buildMarkStyle(s)};return this.props.renderMark(u)})},r.render=function(){let n=[],{value:o}=this.state,a=o.length;for(let c=0;c<a;c+=1)n[c]=this.calcOffset(o[c],c);let s=this.props.withTracks?this.renderTracks(n):null,u=this.renderThumbs(n),l=this.props.marks?this.renderMarks():null;return va.default.createElement("div",{ref:c=>{this.slider=c,this.resizeElementRef.current=c},style:{position:"relative"},className:this.props.className+(this.props.disabled?" disabled":""),onMouseDown:this.onSliderMouseDown,onClick:this.onSliderClick},s,u,l)},t}(va.default.Component);J3.displayName="ReactSlider",J3.defaultProps={min:0,max:100,step:1,pageFn:e=>10*e,minDistance:0,defaultValue:0,orientation:"horizontal",className:"slider",thumbClassName:"thumb",thumbActiveClassName:"active",trackClassName:"track",markClassName:"mark",withTracks:!0,pearling:!1,disabled:!1,snapDragDisabled:!1,invert:!1,marks:[],renderThumb:e=>va.default.createElement("div",e),renderTrack:e=>va.default.createElement("div",e),renderMark:e=>va.default.createElement("span",e)};var Q3=J3;var as=require("react/jsx-runtime"),Tw="4px",Pj=is.css`
2455
2467
  opacity: 0.5;
2456
2468
 
2457
2469
  & * {