@deephaven/embed-chart 0.37.4-logout.1 → 0.37.4-logout.17
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/build/assets/{App-c616daee.js → App-e9cb33ce.js} +2 -2
- package/build/assets/{App-c616daee.js.map → App-e9cb33ce.js.map} +1 -1
- package/build/assets/index-0e86c69a.js +9 -0
- package/build/assets/index-0e86c69a.js.map +1 -0
- package/build/assets/index-d295a2b4.css +6 -0
- package/build/assets/{index-87bb02fb.js → index-e43a389c.js} +2 -2
- package/build/assets/index-e43a389c.js.map +1 -0
- package/build/assets/logo-8e1e546e.png +0 -0
- package/build/assets/plotly-24e988bc.js +7 -0
- package/build/assets/plotly-24e988bc.js.map +1 -0
- package/build/assets/useConnection-1a8db09b.js +2 -0
- package/build/assets/useConnection-1a8db09b.js.map +1 -0
- package/build/assets/vendor-24ebff0f.js +1179 -0
- package/build/assets/vendor-24ebff0f.js.map +1 -0
- package/build/index.html +3 -3
- package/package.json +14 -14
- package/build/assets/index-04780174.css +0 -6
- package/build/assets/index-3a60cd3b.js +0 -9
- package/build/assets/index-3a60cd3b.js.map +0 -1
- package/build/assets/index-87bb02fb.js.map +0 -1
- package/build/assets/plotly-c2893d76.js +0 -7
- package/build/assets/plotly-c2893d76.js.map +0 -1
- package/build/assets/useConnection-86e993b6.js +0 -2
- package/build/assets/useConnection-86e993b6.js.map +0 -1
- package/build/assets/vendor-b7e5da9f.js +0 -1175
- package/build/assets/vendor-b7e5da9f.js.map +0 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var Rs=Object.defineProperty;var js=(s,i,e)=>i in s?Rs(s,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[i]=e;var p=(s,i,e)=>(js(s,typeof i!="symbol"?i+"":i,e),e);import{A as d,B as f,G as w,P as Ls,C as l,D as be,E,R as bn,M as Mt,K as Ge,L as Q,F as q,N as Ce,O as Ps,Q as Fs,S as Us,T as $s,U as _s,V as Ct,$ as Vs,W as Te,X as Bs,Y as Hs,Z as Ks,_ as Cn,a0 as Ws,a1 as Gs}from"./vendor-b7e5da9f.js";import{T as oe,L as U,c as qs,e as zs,M as Nt,f as kt,g as vn,h as Zs,i as Xs,j as Js,k as Qs,l as Ys,m as xn,n as ei,o as ti,p as ni,q as si,r as ii,s as Sn,t as oi,u as ai,b as Me,w as yn,A as li,x as ri}from"./index-87bb02fb.js";import{c as G,i as ht,d as En,e as In,a as ci,C as di,f as wn,g as ui,h as Qe,j as Fe,k as Tn,B as hi,l as pi,m as mi,D as fi,n as gi,o as bi,b as Mn,F as vt,I as Ci,S as vi,p as xi,T as Si,q as yi,r as Ei,t as Ii,P as Jt,v as wi,w as Ti}from"./useConnection-86e993b6.js";import{x as yl,u as El}from"./useConnection-86e993b6.js";import"./helpers-042e6b4d.js";class xt extends d.Component{constructor(e){super(e);p(this,"element");p(this,"container");p(this,"rAF");this.handleEnter=this.handleEnter.bind(this),this.handleExit=this.handleExit.bind(this),this.handleBlur=this.handleBlur.bind(this),this.element=document.createElement("div"),this.element.className="popper-container",this.container=w.createRef(),this.rAF=0;const{isShown:t}=this.props;this.state={show:t,popper:null}}componentDidUpdate(e){const{isShown:t}=this.props;e.isShown!==t&&(t?(cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{this.show()})):this.hide())}componentWillUnmount(){this.destroyPopper(!1)}getVisibleElement(e){return e==null||e.clientHeight>0||e.clientWidth>0?e:this.getVisibleElement(e.parentElement)}initPopper(){let{popper:e}=this.state;const{closeOnBlur:t,referenceObject:n}=this.props;if(e||this.container.current===null)return;let{options:o}=this.props;o={placement:"auto",modifiers:{preventOverflow:{boundariesElement:"viewport"}},...o},document.body.appendChild(this.element);let a=this.getVisibleElement(this.container.current);a==null&&(a=this.container.current),e=new Ls(n||a,this.element,o),e.scheduleUpdate(),cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{if(t&&!this.element.contains(document.activeElement)){const r=this.element.firstElementChild;r instanceof HTMLElement&&r.focus()}}),this.setState({popper:e})}destroyPopper(e=!0){cancelAnimationFrame(this.rAF);const{popper:t}=this.state;t&&(t.destroy(),document.body.contains(this.element)&&document.body.removeChild(this.element),e&&this.setState({popper:null}))}show(){this.initPopper(),this.setState({show:!0})}hide(){this.setState({show:!1})}scheduleUpdate(){const{popper:e}=this.state;e&&e.scheduleUpdate()}handleBlur(e){e.relatedTarget instanceof HTMLElement&&(this.element.contains(e.relatedTarget)||this.hide())}handleEnter(){const{onEntered:e}=this.props;e()}handleExit(){const{onExited:e}=this.props,{show:t}=this.state;t||this.destroyPopper(),e()}renderContent(){const{className:e,children:t,timeout:n,interactive:o,closeOnBlur:a}=this.props,{show:r}=this.state;return l.jsx(be,{in:r,timeout:n,classNames:"popper-transition",onEntered:this.handleEnter,onExited:this.handleExit,children:l.jsx("div",{onClick:c=>{c.stopPropagation()},onKeyDown:c=>{c.key==="Escape"&&this.hide()},className:E("popper",{interactive:o},e),onBlur:a?this.handleBlur:void 0,tabIndex:a?-1:void 0,role:"presentation",children:l.jsxs("div",{className:"popper-content",children:[t,l.jsx("div",{className:"popper-arrow","x-arrow":""})]})})})}render(){const{popper:e}=this.state,{"data-testid":t}=this.props;return l.jsx("div",{className:"popper-parent-container",ref:this.container,style:{display:"none"},"data-testid":t,children:e&&bn.createPortal(this.renderContent(),this.element)})}}p(xt,"propTypes",{children:f.node.isRequired,options:f.shape({}),className:f.string,timeout:f.number,onEntered:f.func,onExited:f.func,isShown:f.bool,closeOnBlur:f.bool,interactive:f.bool,referenceObject:f.shape({}),"data-testid":f.string}),p(xt,"defaultProps",{options:{},className:"",timeout:oe.transitionMs,onEntered(){},onExited(){},isShown:!1,interactive:!1,closeOnBlur:!1,referenceObject:null,"data-testid":void 0});const Ne=xt;var H=(s=>(s.DEBUG="D",s.LOG="L",s.WARN="W",s.ERROR="E",s.UNCAUGHT_ERROR="U",s))(H||{});function ke(s,i){return new CustomEvent(s,{detail:i})}class Mi{constructor(){p(this,"isEnabled",!1);p(this,"debug");p(this,"log");p(this,"warn");p(this,"error");p(this,"eventTarget");p(this,"handleUncaughtError",i=>{const e=[];i.error!=null&&e.push(i.error),i.message&&e.push(i.message),this.eventTarget.dispatchEvent(ke("U",e))});this.debug=console.debug,this.log=console.log,this.warn=console.warn,this.error=console.error,this.eventTarget=new Mt}enable(){this.isEnabled||(console.debug=(...i)=>{this.eventTarget.dispatchEvent(ke("D",i)),this.debug.apply(console,i)},console.log=(...i)=>{this.eventTarget.dispatchEvent(ke("L",i)),this.log.apply(console,i)},console.warn=(...i)=>{this.eventTarget.dispatchEvent(ke("W",i)),this.warn.apply(console,i)},console.error=(...i)=>{this.eventTarget.dispatchEvent(ke("E",i)),this.error.apply(console,i)},window.addEventListener("error",this.handleUncaughtError),U.setLogLevel(U.level),this.isEnabled=!0)}disable(){this.isEnabled&&(console.debug=this.debug,console.log=this.log,console.warn=this.warn,console.error=this.error,window.removeEventListener("error",this.handleUncaughtError),U.setLogLevel(U.level),this.isEnabled=!1)}addEventListener(i,e){this.eventTarget.addEventListener(i,e)}removeEventListener(i,e){this.eventTarget.removeEventListener(i,e)}}const Ni=Mi;class qe{constructor(i){p(this,"history");p(this,"offset");p(this,"limit");p(this,"isEnabled");p(this,"proxy");this.history=[],this.offset=0,this.limit=1e4,this.isEnabled=!1,this.proxy=i,this.addHistory=this.addHistory.bind(this)}static formatMessages(i){return i.map(t=>{if(typeof t=="string")return t;let n="";try{n=JSON.stringify(t)}catch{n=t.toString()}return n==="{}"?t.toString():n}).join(" ")}static formatStack(i,e){if(i==="")return"";let t=i.split(`
|
|
2
|
-
`).map(n=>n.trim());switch(e){case H.ERROR:t=t.splice(i[0]==="Error"?4:3);break;case H.UNCAUGHT_ERROR:t=t.splice(i[0]==="Error"?3:2);break}return t!=null?` ${t.join(`
|
|
3
|
-
`)}`:""}enable(){this.isEnabled||(this.proxy.addEventListener(H.DEBUG,this.addHistory),this.proxy.addEventListener(H.LOG,this.addHistory),this.proxy.addEventListener(H.WARN,this.addHistory),this.proxy.addEventListener(H.ERROR,this.addHistory),this.proxy.addEventListener(H.UNCAUGHT_ERROR,this.addHistory),this.isEnabled=!0)}disable(){this.isEnabled&&(this.proxy.removeEventListener(H.DEBUG,this.addHistory),this.proxy.removeEventListener(H.LOG,this.addHistory),this.proxy.removeEventListener(H.WARN,this.addHistory),this.proxy.removeEventListener(H.ERROR,this.addHistory),this.proxy.removeEventListener(H.UNCAUGHT_ERROR,this.addHistory),this.isEnabled=!1)}addHistory({type:i,detail:e}){const t={type:i,messages:e,time:new Date};switch(i){case H.ERROR:case H.UNCAUGHT_ERROR:t.stack=Error().stack;break}this.history[this.offset%this.limit]=t,this.offset+=1}getHistory(){if(this.offset>this.limit){const i=this.offset%this.limit;this.history=this.history.slice(i).concat(this.history.slice(0,i)),this.offset=this.limit}return this.history}getFormattedHistory(){return this.getHistory().map(e=>`${e.time.toISOString()} ${e.type} ${qe.formatMessages(e.messages)}`+(e.stack!=null?`
|
|
4
|
-
${qe.formatStack(e.stack,e.type)}`:"")).join(`
|
|
5
|
-
`)}}const ki=qe,Oi=Object.freeze(Object.defineProperty({__proto__:null,Log:U,LogHistory:ki,LogProxy:Ni,Logger:qs,LoggerLevel:zs,default:U},Symbol.toStringTag,{value:"Module"})),Di=U.module("Tooltip"),W=class extends d.Component{constructor(e){super(e);p(this,"container");p(this,"popper");p(this,"parent");p(this,"timer");this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowMouseMove=this.handleWindowMouseMove.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleTimeout=this.handleTimeout.bind(this),this.handleExited=this.handleExited.bind(this),this.stopShowingTooltip=this.stopShowingTooltip.bind(this),this.container=w.createRef(),this.popper=w.createRef(),this.parent=null,this.timer=null,this.state={isShown:!1}}static handleHidden(){W.shownTooltipCount-=1,W.shownTooltipCount===0&&(W.lastHiddenTime=Date.now())}static handleShown(){W.shownTooltipCount+=1}componentDidMount(){this.startListening();const{timeout:e}=this.props;e===0&&this.show()}componentDidUpdate(e,t){const{isShown:n}=t,{isShown:o}=this.state;o!==n&&(o?W.handleShown():W.handleHidden())}componentWillUnmount(){this.stopListening(),this.stopListeningWindow(),this.stopTimer();const{isShown:e}=this.state;e&&W.handleHidden()}startListening(){if(!this.container.current||!this.container.current.parentElement){Di.error("Tooltip doesn't have a container or a parent set!");return}this.parent=this.container.current.parentElement,this.parent.addEventListener("mousemove",this.handleMouseMove),this.parent.addEventListener("mouseleave",this.handleMouseLeave),this.parent.addEventListener("mousedown",this.stopShowingTooltip)}stopListening(){this.parent&&(this.parent.removeEventListener("mousemove",this.handleMouseMove),this.parent.removeEventListener("mouseleave",this.handleMouseLeave),this.parent.removeEventListener("mousedown",this.stopShowingTooltip))}startListeningWindow(){window.addEventListener("mousemove",this.handleWindowMouseMove,!0),window.addEventListener("contextmenu",this.stopShowingTooltip,!0),window.addEventListener("wheel",this.handleWheel)}stopListeningWindow(){window.removeEventListener("mousemove",this.handleWindowMouseMove,!0),window.removeEventListener("contextmenu",this.stopShowingTooltip,!0),window.removeEventListener("wheel",this.handleWheel)}handleMouseMove(){this.startTimer()}handleWheel(){const{isShown:e}=this.state;this.popper.current&&this.parent&&e&&!this.popper.current.element.matches(":hover")&&!this.parent.matches(":hover")&&(this.stopTimer(),this.hide())}handleMouseLeave(){const{isShown:e}=this.state;this.stopTimer();const{interactive:t}=this.props;!t&&e&&this.hide()}handleTimeout(){this.show()}handleWindowMouseMove(e){const t=e.clientX,n=e.clientY,{isShown:o}=this.state;if(!this.popper.current||!this.parent)return;const a=this.popper.current.element.getBoundingClientRect(),r=this.parent.getBoundingClientRect();t>=a.left&&t<=a.left+a.width&&n>=a.top&&n<=a.top+a.height?this.handleMouseMove():t>=r.left&&t<=r.left+r.width&&n>=r.top&&n<=r.top+r.height?this.handleMouseMove():o&&(this.stopTimer(),this.hide())}startTimer(){this.stopTimer();const{timeout:e,reshowTimeout:t}=this.props;let n=e;(W.shownTooltipCount>0||Date.now()-W.lastHiddenTime<W.triggerReshowThreshold)&&(n=t),this.timer=window.setTimeout(this.handleTimeout,n)}stopTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=null)}show(){var t;const{isShown:e}=this.state;if(this.stopTimer(),!e){(t=this.popper.current)==null||t.show(),this.setState({isShown:!0});const{interactive:n}=this.props;n&&this.startListeningWindow()}}hide(){var e;(e=this.popper.current)==null||e.hide(),this.stopListeningWindow()}update(){var e;(e=this.popper.current)==null||e.scheduleUpdate()}handleExited(){this.setState({isShown:!1});const{onExited:e}=this.props;e()}stopShowingTooltip(){const{isShown:e}=this.state;this.stopTimer(),e&&this.hide()}render(){const{interactive:e,children:t,referenceObject:n,popperClassName:o,"data-testid":a,onEntered:r}=this.props,{isShown:c}=this.state;let{options:u}=this.props;return u={placement:"bottom",...u},l.jsx("div",{ref:this.container,style:{display:"none"},"data-testid":a,children:l.jsx(Ne,{className:E(o),options:u,ref:this.popper,onEntered:r,onExited:this.handleExited,interactive:e,referenceObject:n,children:l.jsxs("div",{className:"tooltip-content",children:[" ",c&&t]})})})}};let le=W;p(le,"defaultTimeout",500),p(le,"defaultReshowTimeout",100),p(le,"triggerReshowThreshold",300),p(le,"shownTooltipCount",0),p(le,"lastHiddenTime",Date.now()),p(le,"defaultProps",{interactive:!1,options:{},popperClassName:"",reshowTimeout:W.defaultReshowTimeout,timeout:W.defaultTimeout,onEntered:()=>{},onExited:()=>{},"data-testid":void 0});const Ot=le;const Ai=100;var Nn=(s=>(s.UP="UP",s.DOWN="DOWN",s))(Nn||{});const ce=class extends d.Component{constructor(e){super(e);p(this,"popper");p(this,"cbContainer");p(this,"menuContainer");p(this,"input");p(this,"getCachedFilteredOptions",Q((e,t)=>e.filter(n=>n.title.toLowerCase().indexOf(t.toLowerCase())>=0)));let{popperOptions:t}=this.props;t={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...t},this.state={title:"",filteredOptions:[],keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,invalid:!1,popperOptions:t},this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handelInputFocus=this.handelInputFocus.bind(this),this.handleInputClick=this.handleInputClick.bind(this),this.updateInputValue=Ge(this.updateInputValue,Ai),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=w.createRef(),this.cbContainer=w.createRef(),this.menuContainer=w.createRef(),this.input=w.createRef()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}getValueAndValidate(e){if(!e)return this.setState({invalid:!1}),{value:e,isValid:!1};const{options:t}=this.props,n=t.filter(o=>o.title.toLowerCase()===e.toLowerCase());return n.length<1?(this.setState({invalid:!0}),{value:e,isValid:!1}):(this.setState({invalid:!1}),{value:n[0].value,isValid:!0})}updateInputValue(e){const{menuIsOpen:t}=this.state,{value:n,isValid:o}=this.getValueAndValidate(e);t&&this.processFilterChange(e),this.fireOnChange(n,o)}fireOnChange(e,t=!0){const{onChange:n}=this.props;n(e,t)}processFilterChange(e){var r;const{options:t}=this.props,{menuIsOpen:n}=this.state,o=e?this.getCachedFilteredOptions(t,e):t,a=o.length===1&&o[0].title===e;if(this.setState({filteredOptions:o,keyboardOptionIndex:0}),a&&n){this.closeMenu();return}(r=this.popper.current)==null||r.scheduleUpdate()}resetValue(){this.setState({title:""}),this.fireOnChange("")}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var a;const{filteredOptions:t,keyboardOptionIndex:n}=this.state,o=t[n];switch(e.key){case"Enter":case"ArrowRight":e.stopPropagation(),e.preventDefault(),o!=null&&(this.setState({title:o.title,invalid:!1}),this.fireOnChange(o.value)),this.closeMenu(),(a=this.input.current)==null||a.focus();break;case"ArrowUp":e.stopPropagation(),e.preventDefault(),this.navigateMenu(ce.MENU_NAVIGATION_DIRECTION.UP);break;case"ArrowDown":e.stopPropagation(),e.preventDefault(),this.navigateMenu(ce.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Tab":if(e.stopPropagation(),e.preventDefault(),e.shiftKey){this.navigateMenu(ce.MENU_NAVIGATION_DIRECTION.UP);break}this.navigateMenu(ce.MENU_NAVIGATION_DIRECTION.DOWN);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.closeMenu();break}}navigateMenu(e){const{filteredOptions:t,keyboardOptionIndex:n}=this.state;let o=n;e===ce.MENU_NAVIGATION_DIRECTION.UP?n>0?(o=(o-1)%t.length,this.setState({keyboardOptionIndex:o})):n===0&&(o=t.length-1,this.setState({keyboardOptionIndex:o})):e===ce.MENU_NAVIGATION_DIRECTION.DOWN&&n<t.length&&(o=(o+1)%t.length,this.setState({keyboardOptionIndex:o})),this.scrollOptionIntoView(o)}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;n?this.handleMenuKeyDown(e):e.key==="Enter"?t():e.key==="Escape"?(this.resetValue(),e.preventDefault(),e.stopPropagation()):e.key==="ArrowRight"||e.key==="ArrowLeft"||e.key==="Tab"||e.key==="Shift"||this.openMenu()}handleInputChange(e){this.setState({title:e.target.value}),this.updateInputValue(e.target.value)}handleOptionClick(e){var t;this.setState({title:e.title,invalid:!1}),this.fireOnChange(e.value),this.closeMenu(),(t=this.input.current)==null||t.focus()}handelInputFocus(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputClick(){const{menuIsOpen:e}=this.state;e||this.openMenu()}handleInputBlur(e){const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuBlur(e){e.relatedTarget===this.input.current||e.relatedTarget instanceof Element&&this.popper.current!==null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;(e=this.input.current)==null||e.focus()}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}openMenu(){const{title:e}=this.state;this.processFilterChange(e),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var t;(t=this.popper.current)==null||t.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1,keyboardOptionIndex:0}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}scrollOptionIntoView(e){var t;this.menuContainer.current&&((t=this.menuContainer.current.children.item(e))==null||t.scrollIntoView({behavior:"smooth",block:"nearest"}))}renderMenuElement(){const{inputWidth:e}=this.state;return l.jsx("div",{className:E("aci-options"),ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,style:{width:e},onBlur:this.handleMenuBlur,children:this.renderOptions()})}renderOptions(){const{noMatchText:e}=this.props,{title:t,filteredOptions:n}=this.state;return t&&n.length===0?l.jsx("div",{className:"no-match",children:e}):n.map((o,a)=>this.renderOption(o,a))}renderOption(e,t){const{keyboardOptionIndex:n}=this.state,o=`option-${t}-${e.value}`;return l.jsx("button",{type:"button",className:E("aci-option-btn",{"keyboard-active":n===t}),onClick:()=>this.handleOptionClick(e),onFocus:()=>this.setState({keyboardOptionIndex:t}),children:e.title},o)}render(){const{options:e,inputPlaceholder:t,disabled:n,className:o,defaultTitle:a,spellCheck:r,"data-testid":c}=this.props,{title:u,menuIsOpen:h,popperOptions:m,invalid:g}=this.state;return l.jsxs("div",{className:"aci-container",ref:this.cbContainer,children:[l.jsx("input",{value:u||a,className:E("form-control",o,"aci-input",{"is-invalid":g&&!h}),ref:this.input,onChange:this.handleInputChange,placeholder:t||e[0].title,disabled:n,onFocus:this.handelInputFocus,onClick:this.handleInputClick,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:r,"data-testid":c}),l.jsx(Ne,{ref:this.popper,options:m,className:E("aci-options-popper interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})}};let Se=ce;p(Se,"propTypes",{options:f.arrayOf(f.shape({title:f.string.isRequired,value:f.string.isRequired})).isRequired,popperOptions:f.shape({}),onChange:f.func,inputPlaceholder:f.string,disabled:f.bool,className:f.string,defaultTitle:f.string,spellCheck:f.bool,onEnter:f.func,noMatchText:f.string,"data-testid":f.string}),p(Se,"defaultProps",{onChange(){},inputPlaceholder:"",disabled:!1,className:"",defaultTitle:"",popperOptions:null,spellCheck:!0,onEnter(){},noMatchText:"No matching items found","data-testid":void 0}),p(Se,"MENU_NAVIGATION_DIRECTION",Nn);const Ri=Se;function Dt({className:s="",value:i,onChange:e,spellCheck:t=!1,placeholder:n="",disabled:o=!1,delimiter:a="",id:r="","data-testid":c}){const[u,h]=d.useState(i),[m,g]=d.useState(!1),b=d.useRef(null);d.useEffect(function(){h(i)},[i]);function y(D){return D.trim().split(a).filter(O=>O).join(`
|
|
6
|
-
${a.trim()}`)}function x(D){return D.split(`
|
|
7
|
-
`).map(O=>O.trim()).join(" ")}function T(){if(!b.current)return;b.current.style.height="0";const D=b.current.scrollHeight+(b.current.offsetHeight-b.current.clientHeight);D>0&&(b.current.style.height=`${D}px`)}function j(D){let O=D.target.value;m&&(a&&(O=y(O)),g(!1)),h(O),e(O)}function $(){b.current&&(a&&(h(y(u)),T()),b.current.scrollLeft=0)}function C(){b.current&&document.activeElement!==b.current&&b.current.focus()}function P(){a&&(h(x(u)),e(x(u)))}function N(){g(!0)}return d.useEffect(function(){T()},[u]),l.jsx("textarea",{ref:b,id:r,className:E(s,"auto-resize-textarea form-control"),placeholder:n,value:u,rows:1,onChange:j,onFocus:$,onMouseDown:C,onBlur:P,onPaste:N,spellCheck:t,disabled:o,"data-testid":c})}Dt.propTypes={value:f.string.isRequired,onChange:f.func.isRequired,className:f.string,placeholder:f.string,spellCheck:f.bool,disabled:f.bool,delimiter:f.string,id:f.string,"data-testid":f.string};Dt.defaultProps={className:"",id:"",placeholder:"",disabled:!1,spellCheck:!1,delimiter:"","data-testid":void 0};function Ue(s){const{children:i,className:e,style:t,"data-testid":n}=s;return l.jsx("div",{className:E("btn-group",e),style:t,role:"group","data-testid":n,children:i})}Ue.displayName="ButtonGroup";Ue.propTypes={children:f.node.isRequired,className:f.string,style:f.object,"data-testid":f.string};Ue.defaultProps={className:null,style:{},"data-testid":void 0};const ji=["primary","secondary","tertiary","success","danger","inline","ghost"],Li=["group-end"];function Pi(s,i){switch(s){case"primary":return"btn-primary";case"secondary":return"btn-outline-primary";case"tertiary":return"btn-secondary";case"success":return"btn-success";case"danger":return"btn-danger";case"inline":return"btn-inline";case"ghost":return E("btn-link",{"btn-link-icon":i,"btn-link-icon-only":i})}}function Fi(s){switch(s){case"group-end":return E("pl-2","pr-3")}}const Ye=w.forwardRef((s,i)=>{const{kind:e,variant:t,type:n,tooltip:o,icon:a,disabled:r=!1,active:c,onClick:u,onContextMenu:h,onMouseDown:m,onMouseUp:g,onMouseEnter:b,onMouseLeave:y,onKeyDown:x,className:T,style:j,children:$,tabIndex:C,"data-testid":P,"aria-label":N}=s,D=Boolean(a&&$==null),O=Pi(e,D);let B;t&&(B=Fi(t));let ne;a&&(ne=w.isValidElement(a)?a:l.jsx(q,{icon:a}));let A;o!==void 0&&(A=typeof o=="string"?l.jsx(Ot,{children:o}):o);let R=N;N===void 0&&D&&o!=null&&typeof o=="string"&&(R=o);const _=l.jsxs("button",{"data-testid":P,ref:i,type:n,className:E("btn",O,B,{active:c},T),onClick:u,onContextMenu:h,onMouseUp:g,onMouseDown:m,onMouseEnter:b,onMouseLeave:y,onKeyDown:x,style:j,disabled:r,tabIndex:C,"aria-label":R,children:[a&&ne,$,o!=null&&!r&&A]});return r?l.jsxs("span",{className:"btn-disabled-wrapper",children:[_,o!==void 0&&A]}):_});Ye.displayName="Button";Ye.propTypes={kind:f.oneOf(ji).isRequired,variant:f.oneOf(Li),type:f.oneOf(["submit","reset","button"]),tooltip(s){const{tooltip:i,icon:e,children:t}=s;return i===void 0&&e!=null&&t==null?new Error("Tooltip is required for icon only buttons"):null},icon(s){const{children:i,icon:e}=s;return e==null&&i==null?new Error("Icon is required if no children are provided"):i==null&&!w.isValidElement(e)&&(e==null||e.iconName===""||e.iconName==null)?new Error("Icon must be react element or fontawesome IconDefinition"):null},disabled:f.bool,active:f.bool,onClick(s){const{onClick:i,type:e}=s;return e==="button"&&typeof i!="function"?new Error("type button requires an onClick function"):i!==void 0&&typeof i!="function"?new Error("onClick must be a function"):null},onContextMenu:f.func,onMouseUp:f.func,onMouseDown:f.func,onMouseEnter:f.func,onMouseLeave:f.func,onKeyDown:f.func,tabIndex:f.number,children:f.node,className:f.string,style:f.object,"data-testid":f.string};Ye.defaultProps={type:"button",onClick:void 0,onContextMenu:void 0,onMouseUp:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,onKeyDown:void 0,variant:void 0,tooltip:void 0,icon:void 0,disabled:!1,active:void 0,tabIndex:void 0,children:void 0,className:void 0,style:{},"data-testid":void 0};const Y=Ye;function Ui({className:s,icon:i,isOpen:e,subtitle:t,title:n}){return l.jsx(Nt,{isOpen:e,className:s,children:l.jsx(kt,{children:l.jsxs("div",{className:"info-modal",children:[i!=null&&l.jsx("div",{className:"message-icon",children:l.jsx(q,{icon:i})}),l.jsx("div",{className:"message-header",children:n}),t!=null&&l.jsx("div",{className:"message-content",children:t})]})})})}function kn({className:s="modal-footer",children:i,"data-testid":e}){return l.jsx("div",{className:s,"data-testid":e,children:i})}function At(s){const{isOpen:i,headerText:e,bodyText:t,onCancel:n,onConfirm:o,onDiscard:a,onModalDisable:r,cancelButtonText:c="Cancel",confirmButtonText:u="Okay",discardButtonText:h="Discard",isConfirmDanger:m=!1,children:g,"data-testid":b}=s,y=d.useRef(null),x=d.useRef(null),T=d.useCallback(()=>{x.current!==null&&x.current.checked&&r&&r(),o()},[o,r]),j=d.useCallback(()=>{var C;(C=y.current)==null||C.focus()},[]);let $="";return i&&($=typeof t=="function"?t():t),l.jsxs(Nt,{isOpen:i,className:"theme-bg-light",onOpened:j,children:[l.jsx(vn,{closeButton:!1,children:e}),l.jsx(kt,{children:$}),l.jsxs(kn,{children:[r&&l.jsxs("div",{className:"custom-control custom-checkbox form-group mr-auto",children:[l.jsx("input",{type:"checkbox",className:"custom-control-input",id:"move-confirmation-checkbox",defaultChecked:!1,ref:x,"data-testid":b!==void 0?`${b}-checkbox-confirm`:void 0}),l.jsx("label",{className:"custom-control-label",htmlFor:"move-confirmation-checkbox",children:"Don't ask me again"})]}),a&&l.jsx(Y,{kind:"secondary",className:"mr-auto","data-dismiss":"modal",onClick:a,"data-testid":b!==void 0?`${b}-btn-discard`:void 0,children:h}),n&&l.jsx(Y,{kind:"secondary","data-dismiss":"modal",onClick:n,"data-testid":b!==void 0?`${b}-btn-cancel`:void 0,children:c}),l.jsxs(Ue,{children:[l.jsx(Y,{kind:m?"danger":"primary",onClick:T,ref:y,"data-testid":b!==void 0?`${b}-btn-confirm`:void 0,children:u}),g]})]})]})}At.propTypes={isOpen:f.bool.isRequired,headerText:f.string.isRequired,bodyText:f.oneOfType([f.string,f.func]).isRequired,onCancel:f.func,onConfirm:f.func.isRequired,onDiscard:f.func,onModalDisable:f.func,cancelButtonText:f.string,confirmButtonText:f.string,discardButtonText:f.string,children:f.node,"data-testid":f.string};At.defaultProps={children:void 0,cancelButtonText:"Cancel",confirmButtonText:"Okay",discardButtonText:"Discard",onCancel:void 0,onDiscard:void 0,onModalDisable:void 0,"data-testid":void 0};const et=w.forwardRef((s,i)=>{const{children:e,className:t,disabled:n,onClick:o,style:a,id:r}=s;return l.jsx("button",{ref:i,type:"button",className:E("btn",t),onClick:o,style:a,disabled:n,id:r,children:e})});et.displayName="Button";et.propTypes={children:f.node,className:f.string,disabled:f.bool,onClick:f.func,style:f.shape({}),id:f.string};et.defaultProps={children:null,className:"",disabled:!1,onClick:()=>null,style:{},id:""};const $i=et;function _i({className:s,isFlipped:i,children:e,"data-testid":t}){const n=c=>{if(e.length!==2)throw new Error("CardFlip requires 2 children to function");return e[c]},o=d.useRef(null),a=d.useCallback(c=>{c.target===c.currentTarget&&document.body.classList.add("card-flip--is-flipping")},[]),r=d.useCallback(c=>{c.target===c.currentTarget&&document.body.classList.remove("card-flip--is-flipping")},[]);return d.useEffect(function(){if(!o.current)throw Error("ref undefined");o.current.addEventListener("transitionstart",a);const u=o.current;return function(){if(u!=null)return u.removeEventListener("transitionstart",a)}},[a]),l.jsxs("div",{className:E(s,{"card-flip--show-front":i,"card-flip--show-back":!i}),"data-testid":t,children:[l.jsx("div",{className:"card-flip--back",children:n(0)}),l.jsx("div",{ref:o,className:"card-flip--front",onTransitionEnd:r,children:n(1)})]})}const Qt=U.module("GlobalContextAction");class Vi extends d.Component{constructor(i){super(i),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.body.addEventListener("contextmenu",this.handleContextMenu),document.body.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.body.removeEventListener("contextmenu",this.handleContextMenu),document.body.removeEventListener("keydown",this.handleKeyDown)}handleContextMenu(i){const e=i;e.contextActions==null&&(e.contextActions=[]);const{action:t}=this.props;t.title==null&&!t.menuElement||(e.contextActions==null&&(e.contextActions=[]),e.contextActions.push(t),Qt.debug("Received context menu event at global action! Menu items are now: ",e.contextActions))}handleKeyDown(i){var t;const{action:e}=this.props;!G.actionsDisabled&&e.shortcut!==void 0&&e.shortcut.matchesEvent(i)&&(Qt.debug("Global hotkey matched!",i),(t=e.action)==null||t.call(e,i),i.preventDefault(),i.stopPropagation())}render(){return null}}const Bi=Vi;class Hi extends d.Component{render(){const{actions:i,"data-testid":e}=this.props,t=[];for(let n=0;n<i.length;n+=1){const o=i[n],{shortcut:a}=o;if(o.title!=null||o.menuElement||a){const r=l.jsx(Bi,{action:o,"data-testid":e},`${o.title}.${a==null?void 0:a.id}`);t.push(r)}}return t}}const Ki=Hi;const $e=U.module("ContextActions");class On extends d.Component{constructor(e){super(e);p(this,"container");this.handleContextMenu=this.handleContextMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.container=w.createRef(),this.state={globalActions:[],keyboardActions:[]}}static triggerMenu(e,t,n,o){if(o.length===0)return;const a=new MouseEvent("contextmenu",{clientX:t,clientY:n,bubbles:!0,cancelable:!0});a.contextActions=o,e.dispatchEvent(a)}static getDerivedStateFromProps(e){if(e.actions==null||!Array.isArray(e.actions))return{globalActions:[],keyboardActions:[]};const t=e.actions.filter(o=>!ht(o)&&typeof o!="function"&&o.isGlobal),n=e.actions.filter(o=>!ht(o)&&typeof o!="function"&&(o.isGlobal===void 0||!o.isGlobal)&&o.shortcut!=null);return{globalActions:t,keyboardActions:n}}componentDidMount(){var e;(e=this.container.current)!=null&&e.parentElement&&(this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.addEventListener("keydown",this.handleKeyDown))}componentWillUnmount(){var e;(e=this.container.current)!=null&&e.parentElement&&(this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu),this.container.current.parentElement.removeEventListener("keydown",this.handleKeyDown))}handleContextMenu(e){const{ignoreClassNames:t=[]}=this.props;if(t.length>0){let o=e.target;for(;o!=null;){const{classList:a}=o,r=t.find(c=>a.contains(c));if(r!==void 0){$e.debug2(`Contextmenu event ignored based on the target className "${r}"`);return}o=o.parentElement}}if(G.isContextActionEvent(e)||(e.contextActions=[]),!G.isContextActionEvent(e))return;const{actions:n}=this.props;if(n!=null){let o=n;Array.isArray(o)&&(o=o.filter(a=>ht(a)||typeof a=="function"||a.isGlobal===void 0||!a.isGlobal)),e.contextActions=e.contextActions.concat(o)}$e.debug("Received context menu event! Menu items are now: ",e.contextActions)}handleKeyDown(e){var n;const{keyboardActions:t}=this.state;for(let o=0;o<t.length;o+=1){const a=t[o];!G.actionsDisabled&&a.shortcut!=null&&a.shortcut.matchesEvent(e)&&($e.debug("Context hotkey matched!",e),(n=a.action)==null||n.call(a,e),e.stopPropagation(),e.preventDefault(),$e.debug2("Matched hotkey returned false, key event not consumed"))}}render(){const{"data-testid":e}=this.props,{globalActions:t}=this.state;return l.jsx("div",{className:"context-actions-listener",ref:this.container,"data-testid":e,children:l.jsx(Ki,{actions:t})})}}p(On,"groups",{default:null,high:100,medium:5e3,low:1e4,global:1e5,edit:100});const Wi=On,Gi=()=>{};async function qi(s){const{clipboard:i}=navigator;if(i!==void 0)try{return navigator.clipboard.writeText(s)}catch{return Yt(s)}Yt(s)}function Yt(s){const i=document.activeElement,e=document.createElement("textarea");e.value=s,document.body.appendChild(e),e.focus(),e.select();const t=document.execCommand("copy");if(document.body.removeChild(e),i instanceof HTMLElement&&i.focus(),!t)throw new Error("Unable to execute copy command")}class Dn extends CustomEvent{constructor(i,e){super(i,e)}}class Rt{static isValidRange(i){return i!=null&&i.length===2&&Number.isInteger(i[0])&&Number.isInteger(i[1])&&i[0]<=i[1]}static validateRange(i){if(!Rt.isValidRange(i))throw new Error(`Invalid range! ${i}`)}static isSelected(i,e){for(let t=0;t<i.length;t+=1){const n=i[t],o=n[0],a=n[1];if(o<=e&&e<=a)return!0}return!1}static selectRange(i,e){let[t,n]=e;const o=[...i];for(let a=o.length-1;a>=0;a-=1){const r=o[a],c=r[0],u=r[1];if(c<=t&&n<=u)return o;t<=u&&c<=n&&(t=Math.min(t,c),n=Math.max(n,u),o.splice(a,1))}return o.push([t,n]),o}static deselectRange(i,e){const[t,n]=e,o=[...i];for(let a=o.length-1;a>=0;a-=1){const r=o[a],c=r[0],u=r[1];if(!(n<c||u<t))if(c<t&&n<u){o[a]=[c,t-1],o.splice(a+1,0,[n+1,u]);break}else t<=c&&u<=n?o.splice(a,1):c<t?o[a]=[c,t-1]:o[a]=[n+1,u]}return o}static count(i){return i.reduce((e,t)=>e+(t[1]-t[0]+1),0)}static getItemsInRanges(i,e){return e.reduce((t,n)=>{const o=[...t];for(let a=n[0];a<=n[1];a+=1)o.push(i[a]);return o},[])}}const ie=Rt,qt=class{static formatElapsedTime(i){if(typeof i!="number"||!Number.isInteger(i))throw new Error(`${i} is not a number that can be expressed as a formatted time`);const e=Math.floor(i/3600),t=Math.floor(i%3600/60),n=i%60;return`${e>0?`${e}h `:""}${t>0||e>0?`${t}m `:""}${i>=60?`${n}s`.padStart(3,"0"):`${n}s`}`}static formatTime(i){if(typeof i!="number"||!Number.isInteger(i)||i<0)throw new Error(`${i} is not a number that can be expressed as a formatted time`);const e=String(Math.floor(i/(60*60))).padStart(2,"0"),t=i%(60*60),n=String(Math.floor(t/60)).padStart(2,"0"),o=t%60,a=String(Math.ceil(o)).padStart(2,"0");return`${e}:${n}:${a}`}static isTimeString(i){return new RegExp(qt.TIME_PATTERN).test(i)}static parseTime(i){if(i==null||typeof i!="string")throw new Error(`${i} is not a valid string`);const e=i.split(":");if(e.length!==3)throw new Error(`${i} is not a time string that can be parsed`);return Number(e[0])*60*60+Number(e[1])*60+Number(e[2])}};let Oe=qt;p(Oe,"TIME_PATTERN","([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]"),p(Oe,"TIME_ZONES",Object.freeze([{label:"Tokyo UTC+9 No DST",value:"Asia/Tokyo"},{label:"Seoul UTC+9 No DST",value:"Asia/Seoul"},{label:"Hong Kong UTC+8 No DST",value:"Asia/Hong_Kong"},{label:"Singapore UTC+8 No DST",value:"Asia/Singapore"},{label:"Kolkata UTC+5:30 No DST",value:"Asia/Kolkata"},{label:"Berlin UTC+1",value:"Europe/Berlin"},{label:"UTC UTC±0 No DST",value:"UTC"},{label:"London UTC±0",value:"Europe/London"},{label:"Sao Paulo UTC-2",value:"America/Sao_Paulo"},{label:"Newfoundland UTC-3:30",value:"America/St_Johns"},{label:"Halifax UTC-4",value:"America/Halifax"},{label:"New York UTC−5",value:"America/New_York"},{label:"Chicago UTC-6",value:"America/Chicago"},{label:"Denver UTC-7",value:"America/Denver"},{label:"Los Angeles UTC-8",value:"America/Los_Angeles"},{label:"Anchorage UTC-9",value:"America/Anchorage"},{label:"Honolulu UTC-10 No DST",value:"Pacific/Honolulu"},{label:"Zurich UTC+1",value:"Europe/Zurich"},{label:"Amsterdam UTC+1",value:"Europe/Amsterdam"},{label:"Taipei UTC+8 No DST",value:"Asia/Taipei"},{label:"Sydney UTC+10",value:"Australia/Sydney"}]));const De=Oe,de=class extends d.Component{static handleEnter(i){const e=i;e.style.height="0"}static handleEntering(i){const e=i;e.style.height=`${de.getHeight(e)}px`}static handleExiting(i){const e=i;e.style.height="0"}static handleExit(i){const e=i;e.style.height=`${de.getHeight(e)}px`}static getHeight(i){const e=i.scrollWidth-i.clientWidth;return i.scrollHeight-e}constructor(i){super(i),this.handleEntered=this.handleEntered.bind(this)}handleEntered(i){const e=i;e.style.height="";const{autoFocusOnShow:t}=this.props;if(t!==void 0&&t){const n=e.querySelector("input, select, textarea");n!=null&&n.focus()}}render(){const{children:i,className:e,in:t,"data-testid":n}=this.props;return l.jsx(be,{in:t,classNames:{enterActive:"collapsing",enterDone:"collapse show",exitActive:"collapsing",exitDone:"collapse"},onEnter:de.handleEnter,onEntering:de.handleEntering,onEntered:this.handleEntered,onExit:de.handleExit,onExiting:de.handleExiting,timeout:350,children:o=>l.jsx("div",{className:E({collapse:o==="exited"},e),"data-testid":n,children:i})})}};let Ae=de;p(Ae,"propTypes",{className:f.string,in:f.bool.isRequired,children:f.node.isRequired,autoFocusOnShow:f.bool,"data-testid":f.string}),p(Ae,"defaultProps",{className:"",autoFocusOnShow:!1,"data-testid":void 0});const zi=Ae;function An(s){const i=d.useRef();return d.useEffect(function(){i.current=s}),i.current}function jt(s){const i=d.useRef(null);return d.useEffect(function(){s&&(typeof s=="function"?s(i.current):s.current=i.current)}),i}const Zi=3500,Xi=U.module("useCopyToClipboard");function Rn(){const[s,i]=d.useState(!1),e=d.useRef(null),t=d.useCallback(n=>{qi(n).then(()=>{i(!0)}).catch(o=>Xi.error(`Unable to copy ${n}`,`
|
|
8
|
-
`,o))},[]);return d.useEffect(()=>(e.current&&clearTimeout(e.current),s&&(e.current=setTimeout(()=>{i(!1)},Zi)),()=>{e.current&&clearTimeout(e.current)}),[s]),[s,t]}function jn(s,i,{autoLoad:e=!0}={}){const[t,n]=d.useState(null),[o,a]=d.useState(null),[r,c]=d.useState(!1),u=d.useCallback(async()=>{c(!0);try{const h=await s(...i);n(h),a(null)}catch(h){n(null),a(h)}finally{c(!1)}},[s,...i]);return d.useEffect(()=>{e&&u()},[e,u]),{data:t,error:o,isError:o!=null,isLoading:r,reload:u}}const Ji=Object.freeze(Object.defineProperty({__proto__:null,useContextOrThrow:En,useCopyToClipboard:Rn,useForwardedRef:jt,usePrevious:An,usePromiseFactory:jn},Symbol.toStringTag,{value:"Module"})),tt=w.forwardRef((s,i)=>{const{checked:e=!1,children:t,className:n,disabled:o,inputClassName:a,isInvalid:r,labelClassName:c,name:u,onChange:h,"data-testid":m}=s,[g]=d.useState(Ce()),b=jt(i);d.useEffect(function(){b.current&&(b.current.indeterminate=e===null)},[b,e]);const y=d.useCallback(x=>{b.current&&(b.current.indeterminate=e===null),h&&h(x)},[b,e,h]);return l.jsxs("div",{className:E("custom-control custom-checkbox",n),children:[l.jsx("input",{type:"checkbox",ref:b,checked:e??!1,className:E("custom-control-input",a,{"is-invalid":r}),disabled:o,id:g,name:u,onChange:y,"data-testid":m}),l.jsx("label",{className:E("custom-control-label",c),htmlFor:g,children:t})]})});tt.displayName="Checkbox";tt.propTypes={checked:(s,i)=>{const{[i]:e}=s;return e!==null&&typeof e!="boolean"?new Error("Checked must be a boolean or null for indeterminate"):null},children:f.node.isRequired,className:f.string,disabled:f.bool,inputClassName:f.string,isInvalid:f.bool,labelClassName:f.string,name:f.string,onChange:f.func,"data-testid":f.string};tt.defaultProps={checked:!1,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const ze=tt;class Ln extends d.PureComponent{constructor(e){super(e);p(this,"inputField");this.inputField=w.createRef()}focus(){var e;(e=this.inputField.current)==null||e.focus()}render(){const{value:e,placeholder:t,onBlur:n,onChange:o,className:a,disabled:r,matchCount:c,id:u,onKeyDown:h,"data-testid":m}=this.props;return l.jsxs("div",{className:E("search-group",a),children:[l.jsx("input",{type:"search",value:e,onBlur:n,onChange:o,onKeyDown:h,className:"form-control",disabled:r,placeholder:t,ref:this.inputField,id:u,"data-testid":m}),c!=null&&l.jsx("span",{className:"search-match",children:c}),l.jsx("span",{className:"search-icon",children:l.jsx(q,{icon:Zs})})]})}}p(Ln,"defaultProps",{placeholder:"Search",className:"",matchCount:null,onKeyDown(){},id:"","data-testid":void 0});const nt=Ln;var Pn=(s=>(s.UP="UP",s.DOWN="DOWN",s))(Pn||{});const we=class extends d.Component{constructor(e){super(e);p(this,"popper");p(this,"cbContainer");p(this,"toggleButton");p(this,"menuContainer");p(this,"input");p(this,"searchInput");p(this,"getCachedFilteredOptions",Q((e,t)=>e.filter(n=>n.title.toLowerCase().indexOf(t.toLowerCase())>=0||n.value.toLowerCase().indexOf(t.toLowerCase())>=0)));this.state={value:"",filter:"",filteredOptions:e.options,keyboardOptionIndex:-1,menuIsOpen:!1,inputWidth:100},this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.handleMenuBlur=this.handleMenuBlur.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleInputBlur=this.handleInputBlur.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.popper=w.createRef(),this.cbContainer=w.createRef(),this.toggleButton=w.createRef(),this.menuContainer=w.createRef(),this.input=w.createRef(),this.searchInput=w.createRef()}componentDidUpdate(){const{menuIsOpen:e,keyboardOptionIndex:t}=this.state;e&&t>=0&&this.scrollOptionIntoView()}setInputWidth(){this.cbContainer.current&&this.setState({inputWidth:this.cbContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.input.current)==null||e.focus()}resetValue(){this.setState({value:""})}updateInputValue(e){const{onChange:t}=this.props;this.setState({value:e}),t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var c,u;const{filter:t,filteredOptions:n,keyboardOptionIndex:o}=this.state,{options:a}=this.props,r=t?n:a;switch(e.key){case"Enter":((c=r[o])==null?void 0:c.value)!=null&&this.updateInputValue(r[o].value),this.closeMenu(),(u=this.input.current)==null||u.focus(),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(we.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(we.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":t!==""?(this.setState({filter:""}),e.stopPropagation()):this.closeMenu();break;case"Tab":!e.shiftKey&&o===r.length-1&&this.closeMenu();break}}handleMenuNavigation(e){const{filter:t,filteredOptions:n,keyboardOptionIndex:o}=this.state,{options:a}=this.props,c=(t?n:a).length;let u=0;switch(e){case we.MENU_NAVIGATION_DIRECTION.UP:u=-1;break;case we.MENU_NAVIGATION_DIRECTION.DOWN:u=1;break}u!==0&&this.setState({keyboardOptionIndex:(o+u+c)%c})}handleInputKeyDown(e){const{onEnter:t}=this.props,{menuIsOpen:n}=this.state;e.key==="ArrowDown"||e.key==="ArrowUp"?n||this.openMenu():e.key==="Enter"&&t()}handleInputChange(e){this.updateInputValue(e.target.value)}handleOptionClick(e){var c;const t=Number(e.currentTarget.value),{filter:n,filteredOptions:o}=this.state,{options:a}=this.props,r=n?o:a;this.updateInputValue(r[t].value),this.closeMenu(),(c=this.input.current)==null||c.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleFilterChange(e){var a;const{options:t}=this.props,n=e.target.value,o=this.getCachedFilteredOptions(t,n);this.setState({filter:n,filteredOptions:o,keyboardOptionIndex:0}),(a=this.popper.current)==null||a.scheduleUpdate()}handleMenuBlur(e){e.relatedTarget instanceof Element&&this.popper.current!=null&&this.popper.current.element.contains(e.relatedTarget)||e.relatedTarget===this.toggleButton.current||this.closeMenu(!1)}handleInputBlur(e){const{menuIsOpen:t}=this.state;t&&e.relatedTarget instanceof Element&&this.popper.current!=null&&this.popper.current.element.contains(e.relatedTarget)||this.closeMenu(!1)}handleMenuOpened(){var e;this.scrollOptionIntoView(),(e=this.searchInput.current)==null||e.focus()}handleMenuExited(){var t;const{menuIsOpen:e}=this.state;e&&(this.setState({menuIsOpen:!1}),(t=this.popper.current)==null||t.hide()),this.setState({filter:""})}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0}),window.requestAnimationFrame(()=>{var e;(e=this.popper.current)==null||e.show()})}closeMenu(e=!0){var t,n;this.setState({menuIsOpen:!1}),e&&((t=this.input.current)==null||t.focus()),(n=this.popper.current)==null||n.hide()}updateKeyboardIndex(){const{value:e,filter:t,filteredOptions:n}=this.state,{options:o}=this.props,r=(t?n:o).findIndex(c=>c.value===e);this.setState({keyboardOptionIndex:r})}scrollOptionIntoView(){var t;const e=(t=this.menuContainer.current)==null?void 0:t.querySelector(".cb-option-btn.keyboard-active");e instanceof HTMLElement&&e.scrollIntoView({block:"nearest",inline:"nearest"})}renderMenuElement(){const{searchPlaceholder:e}=this.props,{filter:t,inputWidth:n}=this.state;return l.jsxs("div",{className:"cb-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:o=>{o.stopPropagation()},style:{width:n},onBlur:this.handleMenuBlur,children:[l.jsx("div",{className:"cb-search-input-container",children:l.jsx(nt,{value:t,ref:this.searchInput,onChange:this.handleFilterChange,className:"cb-search-input",placeholder:e})}),l.jsx("div",{className:"cb-options-container",children:l.jsx("div",{className:"cb-options",children:this.renderOptions()})})]})}renderOptions(){const{options:e}=this.props,{keyboardOptionIndex:t,filter:n,filteredOptions:o}=this.state;return(n?o:e).map((r,c)=>{const u=`option-${c}-${r.value}`;return l.jsx("button",{type:"button",value:c,className:E("cb-option-btn",{"keyboard-active":t===c}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:r.title},u)})}render(){const{options:e,inputPlaceholder:t,disabled:n,className:o,defaultValue:a,spellCheck:r,"data-testid":c}=this.props,{value:u}=this.state;let{popperOptions:h}=this.props;return h={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...h},l.jsxs("div",{className:"input-group cb-container",ref:this.cbContainer,children:[l.jsx("input",{value:u||a,className:E("form-control",o,"cb-input"),ref:this.input,onChange:this.handleInputChange,placeholder:t||(e[0]!=null?e[0].title:void 0),disabled:n,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,spellCheck:r,"data-testid":c!==void 0?`${c}-input`:void 0}),l.jsx("div",{className:"input-group-append cb-dropdown",children:l.jsxs("button",{type:"button",className:"btn cb-btn form-control",ref:this.toggleButton,onClick:this.toggleMenu,onKeyDown:this.handleInputKeyDown,disabled:n,"data-testid":c!==void 0?`${c}-btn`:void 0,children:[l.jsx(q,{icon:Xs}),l.jsx(Ne,{ref:this.popper,options:h,className:E("combobox interactive"),onEntered:this.handleMenuOpened,onExited:this.handleMenuExited,children:this.renderMenuElement()})]})})]})}};let me=we;p(me,"MENU_NAVIGATION_DIRECTION",Pn),p(me,"DROP_DOWN_MENU_HEIGHT",200),p(me,"propTypes",{options:f.arrayOf(f.shape({title:f.string.isRequired,value:f.string.isRequired})).isRequired,popperOptions:f.shape({title:f.string.isRequired,value:f.string.isRequired}),onChange:f.func,inputPlaceholder:f.string,searchPlaceholder:f.string,disabled:f.bool,className:f.string,defaultValue:f.string,spellCheck:f.bool,onEnter:f.func,"data-testid":f.string}),p(me,"defaultProps",{onChange(){},inputPlaceholder:"",searchPlaceholder:"Search",disabled:!1,className:"",defaultValue:"",popperOptions:null,spellCheck:!0,onEnter(){},"data-testid":void 0});const Qi=me;function Yi({copy:s,kind:i="ghost",tooltip:e="Copy",className:t,"data-testid":n,children:o}){const[a,r]=Rn();return l.jsx(Y,{kind:i,className:t,"data-testid":n,icon:a?Js:Qs,tooltip:a?"Copied":e,onClick:()=>{r(typeof s=="function"?s():s)},children:o})}function st(s,i,e){return s.substring(0,i)+e+s.substring(i+1)}function Fn(s,i,e){return s.length<e?`${s}${i.substring(s.length,e)}`:s}function St(s,i){let{length:e}=s;for(let t=s.length-1;t>=0&&i[t]===s[t];t-=1)e=t;return s.substring(0,e)}const ee=U.module("MaskedInput"),ve={FORWARD:"forward",BACKWARD:"backward",NONE:"none"},_e=" ",Un=w.forwardRef((s,i)=>{const{className:e,example:t,getNextSegmentValue:n=(M,I,v)=>v,getPreferredReplacementString:o=st,onChange:a=()=>!1,onSelect:r=()=>!1,onSubmit:c,pattern:u,placeholder:h,selection:m,value:g,onFocus:b=()=>!1,onBlur:y=()=>!1,"data-testid":x}=s,T=jt(i),j=d.useMemo(()=>Array.isArray(t)?t:[t],[t]),$=d.useMemo(()=>j[0].replace(/[a-zA-Z0-9]/g,_e),[j]);d.useEffect(function(){var I;if(m!=null){ee.debug("setting selection...",m);const{selectionStart:v,selectionEnd:L,selectionDirection:k}=m;(I=T.current)==null||I.setSelectionRange(v,L,k),ee.debug("selection set!")}},[m,T]);const C=d.useCallback(M=>{let I=M,v=M;const L=j.length>0?j[0]:g;for(let S=I-1;S>=0&&/[a-zA-Z0-9]/g.test(L.charAt(S));S-=1)I=S;for(let S=v;S<L.length&&/[a-zA-Z0-9]/g.test(L.charAt(S));S+=1)v=S+1;const k=I===v?ve.NONE:ve.BACKWARD;return{selectionStart:I,selectionEnd:v,selectionDirection:k}},[j,g]);function P(M,I,v=M.length){let L="";for(let k=0;k<v;k+=1)M.charAt(k)!==_e?L=L.concat(M[k]):L=L.concat(I[k]);return L=L.concat(I.substring(v)),L}function N(M,I=M.length){const v=new RegExp(`^${u}$`);if(v.test(M))return!0;for(let L=0;L<j.length;L+=1){const k=P(M,j[L],I);if(v.test(k))return!0}return!1}function D(M){const I=C(M),v=I.selectionEnd+1;return v>=g.length?I:C(v)}function O(M){const I=C(M),v=I.selectionStart-1;return v<=0?I:C(v)}function B(M,I){const v=C(M),L=g.substring(v.selectionStart,v.selectionEnd),k=n(v,I,L,g),S=g.substring(0,v.selectionStart)+k+g.substring(v.selectionEnd);N(S,v.selectionEnd)&&(a(S),r(v))}const ne=d.useCallback(M=>{const{selectionStart:I=0,selectionEnd:v=0,selectionDirection:L="none"}=M.target;if(I===null||v===null||L===null){ee.error("Selection attempted on non-text input element",M.target);return}if(ee.debug2("handleSelect",I,v,L),!(m!=null&&I===m.selectionStart&&v===m.selectionEnd)){if(m!=null&&I===g.length&&v===g.length&&M.nativeEvent.type!=="mouseup"){r({...m});return}if(I===v){const k=C(I);ee.debug("Selection segment from ",I,v,"=>",k),r(k)}else r({selectionStart:I,selectionEnd:v,selectionDirection:L})}},[C,r,m,g]),A=d.useCallback(M=>{if(!T.current)return;ee.debug("handleSelectCapture",M);const I=T.current.selectionStart??0;I===g.length&&m!=null&&I!==m.selectionStart&&(M.preventDefault(),M.stopPropagation())},[T,m,g]);function R(M){if(M.preventDefault(),M.stopPropagation(),!T.current)return;const{key:I}=M,{selectionStart:v=0,selectionEnd:L=0}=T.current;if(v===null||L===null){ee.error("Selection arrow nvaigation attempted on non-text input element",M.target);return}I==="ArrowLeft"?r(O(v)):I==="ArrowRight"?r(D(L)):I==="ArrowUp"?B(v,-1):I==="ArrowDown"&&B(v,1)}function _(M){if(!T.current)return;ee.debug("handleKeyDown",M);const{key:I}=M,{selectionStart:v=0,selectionEnd:L=0}=T.current;if(v===null||L===null){ee.error("Selection key event on non-text input element",M.target);return}if(I==="Enter"){c==null||c(M);return}if(I.startsWith("Arrow")){R(M);return}if(I==="Delete"||I==="Backspace"){if(M.preventDefault(),M.stopPropagation(),L>=St(g,$).length){const S=g.substring(0,v===L?v-1:v),F=St(S,$);F!==g&&(a(F),r({selectionStart:F.length,selectionEnd:F.length,selectionDirection:ve.NONE}));return}if(v!==L){const S=g.substring(0,v)+g.substring(v,L).replace(/[a-zA-Z0-9]/g,_e)+g.substring(L);ee.debug("Range ",v,L,"deleted, setting value",S),a(S),r({selectionStart:v,selectionEnd:v,selectionDirection:ve.NONE})}else if(v>0)for(let S=v-1;S>=0;S-=1){const F=g.substring(0,S)+g.substring(S,v).replace(/[a-zA-Z0-9]/g,_e)+g.substring(v);if(F!==g){a(F),r({selectionStart:S,selectionEnd:S,selectionDirection:ve.NONE});return}}return}if(M.altKey||M.metaKey||M.ctrlKey||I.length>1)return;M.preventDefault(),M.stopPropagation();const k=Array.from(new Set([I,I.toUpperCase(),I.toLowerCase()]));for(let S=0;S<k.length;S+=1){const F=k[S],X=/[a-zA-Z0-9]/g.test(F)?j[0].length-1:v;for(let z=v;z<=X;z+=1){const As=Fn(g,j[0],z+1),ct=o(As,z,F,v,L);if(N(ct,z+1)){const Zt=C(z),dt=z+1;let ut={selectionStart:dt,selectionEnd:dt,selectionDirection:ve.NONE};if(dt>=Zt.selectionEnd){const Xt=D(z);Xt.selectionStart!==Zt.selectionStart&&(ut=Xt)}ee.debug("handleKeyDown",I,"=>",ct,ut),a(ct),r(ut);return}}}}return l.jsx("input",{ref:T,className:E("form-control masked-input",e),type:"text",pattern:u,placeholder:h,value:g,onChange:()=>{},onKeyDown:_,onSelect:ne,onSelectCapture:A,onFocus:b,onBlur:y,"data-testid":x})});Un.defaultProps={className:"",placeholder:void 0,onChange(){},onSelect(){},getNextSegmentValue:(s,i,e)=>e,getPreferredReplacementString:st,selection:void 0,onFocus(){},onBlur(){},"data-testid":void 0};const it=Un,eo=U.module("TimeInput"),to="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]",no=["00:00:00","12:34:56","23:59:59"],$n=w.forwardRef((s,i)=>{const{allowValueWrapping:e=!0,className:t="",onChange:n=()=>!1,value:o=0,onFocus:a=()=>!1,onBlur:r=()=>!1,onSelect:c=()=>!1,"data-testid":u}=s,[h,m]=d.useState(De.formatTime(o)),[g,b]=d.useState(),y=d.useRef(null);d.useImperativeHandle(i,()=>({focus:()=>{var C;(C=y.current)==null||C.focus()},setSelection:C=>{var P;(P=y.current)==null||P.focus(),b(C)}}),[]),d.useEffect(function(){m(De.formatTime(o))},[o]);function x(C,P,N){const D=C.selectionStart===0?24:60;let O=parseInt(N,10)-P;return Number.isNaN(O)?O=0:e?O=(O%D+D)%D:O=Math.min(Math.max(0,O),D-1),`${O}`.padStart(2,"0")}function T(C,P,N,D,O){return D===0&&O===2&&P===1&&parseInt(N,10)>1?`0${N}${C.substring(2)}`:st(C,P,N)}function j(C){eo.debug("handleChange",C),m(C),De.isTimeString(C)&&n(De.parseTime(C))}const $=d.useCallback(C=>{b(C),c(C)},[c]);return l.jsx(it,{ref:y,className:t,example:no,getNextSegmentValue:x,getPreferredReplacementString:T,onChange:j,onSelect:$,pattern:to,selection:g,value:h,onFocus:a,onBlur:r,"data-testid":u})});$n.defaultProps={allowValueWrapping:!0,className:"",onChange:()=>!1,onSelect:()=>!1,value:0,onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const Ze=$n;var bt;let so=(bt=class extends d.PureComponent{constructor(e){super(e);p(this,"container");p(this,"oldFocus");p(this,"rAF");this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.container=w.createRef(),this.oldFocus=document.activeElement,this.rAF=0;const{options:t}=e,n=t.initialKeyboardIndex??-1;this.state={menuItems:[],keyboardIndex:n,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.rAF=window.requestAnimationFrame(()=>{var t;(t=this.container.current)==null||t.focus();const{onMenuOpened:e}=this.props;e(this)})}componentDidUpdate(e){const{actions:t}=this.props;e.actions!==t&&this.initMenu()}componentWillUnmount(){cancelAnimationFrame(this.rAF)}getKeyboardIndex(){const{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){const{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){const{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){const{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){cancelAnimationFrame(this.rAF),this.setState({menuItems:[]});const{actions:e}=this.props,t=G.getMenuItems(e,!1);t.length>0&&this.setState(n=>({menuItems:G.sortActions(n.menuItems.concat(t))}))}handleKeyDown(e){const{menuItems:t}=this.state,n=this.getKeyboardIndex();let o=n;if(e.key==="Enter"||e.key===" "){n!=null&&n>=0&&n<t.length&&this.handleMenuItemClick(t[n],e);return}e.key==="Escape"?o=null:e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey===!0?o=G.getNextMenuItem(o??0,-1,t):(e.key==="ArrowDown"||e.key==="Tab"&&e.shiftKey===!1)&&(o=G.getNextMenuItem(o??0,1,t)),n!==o&&(o!==null?this.setKeyboardIndex(o):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}closeMenu(e=!1){const{closeMenu:t,onMenuClosed:n}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),n(this)})}handleCloseMenu(){this.closeMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation(),e!=null&&(e.disabled===void 0||!e.disabled)&&e.action!=null&&(e.action(),this.closeMenu(!0))}handleMenuItemMouseMove(e){const{menuItems:t}=this.state,n=t.indexOf(e);this.setMouseIndex(n)}handleMouseLeave(){this.setMouseIndex(-1)}render(){const e=[],{"data-testid":t}=this.props,{keyboardIndex:n,menuItems:o,mouseIndex:a}=this.state;for(let c=0;c<o.length;c+=1){const u=o[c];c>0&&u.group!==o[c-1].group&&e.push(l.jsx("hr",{},`${c}.separator`));const h=l.jsx(In,{isKeyboardSelected:n===c,isMouseSelected:a===c,menuItem:u,closeMenu:this.handleCloseMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:()=>!1},c);e.push(h)}const{menuStyle:r}=this.props;return l.jsx("div",{className:"context-menu-container",style:{...r},ref:this.container,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,role:"menuitem",tabIndex:0,"data-testid":t,children:e})}},p(bt,"defaultProps",{closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0}),bt);const io=so;class _n extends d.PureComponent{constructor(e){super(e);p(this,"container");p(this,"parent");p(this,"popper");p(this,"isOpen");this.handleClick=this.handleClick.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.handleExited=this.handleExited.bind(this),this.container=w.createRef(),this.parent=null,this.popper=w.createRef(),this.isOpen=!1}componentDidMount(){var t;const{isShown:e}=this.props;e===null?(t=this.container.current)!=null&&t.parentElement&&(this.parent=this.container.current.parentElement,this.parent.addEventListener("click",this.handleClick)):e&&this.openMenu()}componentDidUpdate(e){const{isShown:t}=this.props;e.isShown!==t&&(t!==null&&t?window.requestAnimationFrame(()=>{this.openMenu()}):this.closeMenu())}componentWillUnmount(){this.parent&&this.parent.removeEventListener("click",this.handleClick)}closeMenu(){var e;(e=this.popper.current)==null||e.hide()}openMenu(){this.popper.current&&!this.isOpen&&(this.popper.current.show(),this.isOpen=!0)}scheduleUpdate(){var e;(e=this.popper.current)==null||e.scheduleUpdate()}handleClick(e){e.preventDefault(),e.stopPropagation(),this.openMenu()}handleCloseMenu(){this.closeMenu()}handleExited(){this.isOpen=!1;const{onMenuClosed:e}=this.props;e()}render(){const{actions:e,onMenuOpened:t,popperClassName:n,"data-testid":o}=this.props,{menuStyle:a}=this.props;let{options:r,popperOptions:c}=this.props;return c={placement:"bottom",...c},r={separateKeyboardMouse:!0,...r},l.jsx("div",{className:"menu-actions-listener",ref:this.container,"data-testid":o,children:l.jsx(Ne,{ref:this.popper,options:c,className:E("menu-popper",n),onExited:this.handleExited,closeOnBlur:!0,interactive:!0,children:l.jsx(io,{actions:e,closeMenu:this.handleCloseMenu,onMenuOpened:t,options:r,menuStyle:a})})})}}p(_n,"defaultProps",{isShown:null,onMenuClosed(){},onMenuOpened(){},options:{},popperOptions:{},popperClassName:"",menuStyle:{},"data-testid":void 0});const Vn=_n;const en=-1;var Bn=(s=>(s.UP="UP",s.DOWN="DOWN",s))(Bn||{});const se=class extends d.Component{constructor(e){super(e);p(this,"csContainer");p(this,"menuContainer");p(this,"button");p(this,"input");const{value:t,valueToTime:n}=e;this.toggleMenu=this.toggleMenu.bind(this),this.handleMenuKeyDown=this.handleMenuKeyDown.bind(this),this.closeMenu=this.closeMenu.bind(this),this.handleOptionClick=this.handleOptionClick.bind(this),this.handleOptionFocus=this.handleOptionFocus.bind(this),this.handleMenuOpened=this.handleMenuOpened.bind(this),this.handleMenuExited=this.handleMenuExited.bind(this),this.handleCustomInput=this.handleCustomInput.bind(this),this.csContainer=w.createRef(),this.menuContainer=w.createRef(),this.button=w.createRef(),this.input=w.createRef(),this.state={keyboardOptionIndex:0,menuIsOpen:!1,inputWidth:100,customTime:n(t),inputFocused:!1}}getSelectedText(){const{options:e,value:t,placeholder:n}=this.props,{customTime:o}=this.state;if(t===null)return n;for(let a=0;a<e.length;a+=1){const r=e[a];if(r.value===t)return r.title}return De.formatTime(o)}setInputWidth(){this.csContainer.current&&this.setState({inputWidth:this.csContainer.current.getBoundingClientRect().width})}focus(){var e;(e=this.button.current)==null||e.focus()}updateInputValue(e){const{onChange:t}=this.props;t(e)}handleResize(){this.setInputWidth()}handleMenuKeyDown(e){var a;const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:o}=this.props;switch(e.key){case"Enter":case" ":n?this.updateFromCustom():this.updateInputValue(o[t].value),this.closeMenu(),(a=this.button.current)==null||a.focus(),e.stopPropagation(),e.preventDefault();break;case"Tab":e.shiftKey?this.handleMenuNavigation(se.MENU_NAVIGATION_DIRECTION.UP):this.handleMenuNavigation(se.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"ArrowUp":this.handleMenuNavigation(se.MENU_NAVIGATION_DIRECTION.UP),e.stopPropagation(),e.preventDefault();break;case"ArrowDown":this.handleMenuNavigation(se.MENU_NAVIGATION_DIRECTION.DOWN),e.stopPropagation(),e.preventDefault();break;case"Escape":this.closeMenu();break}}handleMenuNavigation(e){const{keyboardOptionIndex:t,inputFocused:n}=this.state,{options:o}=this.props,a=o.length;let r=t;switch(e){case se.MENU_NAVIGATION_DIRECTION.UP:if(!n&&t===0){this.focusInput();break}else n&&this.focusOption(t);t>0&&!n?(r=(r-1)%a,this.setState({keyboardOptionIndex:r})):t===0&&(r=a-1,this.setState({keyboardOptionIndex:r})),this.scrollOptionIntoView(r);break;case se.MENU_NAVIGATION_DIRECTION.DOWN:if(!n&&t===a-1){this.focusInput();break}else n&&this.focusOption(t);t<a&&!(n&&t===0)&&(r=(r+1)%a,this.setState({keyboardOptionIndex:r})),this.scrollOptionIntoView(r);break}}handleOptionClick(e){const t=Number(e.currentTarget.value),{options:n,timeToValue:o}=this.props,{customTime:a}=this.state;if(t===en){const r=o(a);this.updateAndClose(r)}else this.updateAndClose(n[t].value)}updateAndClose(e){var t;this.updateInputValue(e),this.closeMenu(),(t=this.button.current)==null||t.focus()}handleOptionFocus(e){this.setState({keyboardOptionIndex:Number(e.target.value)})}handleMenuOpened(){var r;const{options:e,value:t}=this.props,{keyboardOptionIndex:n}=this.state;this.scrollOptionIntoView(n);const o=(r=this.menuContainer.current)==null?void 0:r.querySelector(".cs-option-btn.keyboard-active");if(o instanceof HTMLElement&&o.focus(),t===null)return;e.map(c=>c.value).indexOf(t)<0&&this.focusInput()}focusInput(){var e;(e=this.input.current)==null||e.focus()}focusOption(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children!=null){const o=t.children.item(e);o instanceof HTMLElement&&o.focus()}}handleMenuExited(){const{menuIsOpen:e}=this.state;e&&this.setState({menuIsOpen:!1,keyboardOptionIndex:0})}handleCustomInput(e){const{timeToValue:t}=this.props,n=t(e);this.updateInputValue(n),this.setState({customTime:e})}updateFromCustom(){const{timeToValue:e}=this.props,{customTime:t}=this.state,n=e(t);this.updateInputValue(n)}toggleMenu(e){const{menuIsOpen:t}=this.state;t?this.closeMenu():this.openMenu(),e.stopPropagation()}openMenu(){this.updateKeyboardIndex(),this.setInputWidth(),this.setState({menuIsOpen:!0})}closeMenu(e=!0){var t;this.setState({menuIsOpen:!1}),e&&((t=this.button.current)==null||t.focus())}updateKeyboardIndex(){const{options:e,value:t}=this.props;if(t===null)return;const n=e.map(o=>o.value).indexOf(t);n>0&&this.setState({keyboardOptionIndex:n})}scrollOptionIntoView(e){var n;const t=(n=this.menuContainer.current)==null?void 0:n.querySelector(".cs-options");if(t&&t.children!=null){const o=t.children.item(e);o instanceof HTMLElement&&o.offsetTop>se.DROP_DOWN_MENU_HEIGHT?t.scrollTop=o.offsetTop-se.DROP_DOWN_MENU_HEIGHT:(o instanceof HTMLElement&&o.offsetTop<0||e===0)&&(t.scrollTop=0)}}renderMenuElement(){const{inputWidth:e}=this.state;return l.jsx("div",{className:"cs-menu-container",ref:this.menuContainer,role:"presentation",onKeyDown:this.handleMenuKeyDown,onClick:t=>{t.stopPropagation()},style:{width:e},children:l.jsx("div",{className:"cs-options-container",children:l.jsx("div",{className:"cs-options",children:this.renderOptions()})})})}renderOptions(){const{options:e,value:t,icon:n,customText:o}=this.props,{keyboardOptionIndex:a,customTime:r,inputFocused:c}=this.state;let u=!1;const h=[];for(let m=0;m<e.length;m+=1){const g=e[m],b=`option-${m}-${g.value}`;u=u||g.value===t,h.push(l.jsxs("button",{type:"button",value:m,className:E("cs-option-btn",{"keyboard-active":a===m&&!c}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[g.value===t&&l.jsx(q,{icon:n,className:"mr-2"}),g.value!==t&&l.jsx("span",{className:"mr-4"}),g.title]},b))}return h.push(l.jsx("hr",{className:"cs-divider"},"option-divider")),h.push(l.jsxs("button",{type:"button",value:en,className:E("cs-option-btn",{"keyboard-active":c}),onClick:this.handleOptionClick,onFocus:this.handleOptionFocus,children:[!u&&t!==null?l.jsx(q,{icon:n,className:"mr-2"}):l.jsx("span",{className:"mr-4"}),o]},"option-custom-label")),h.push(l.jsxs("div",{className:"cs-custom-container",children:[l.jsx("span",{className:"mr-2"}),l.jsx(Ze,{ref:this.input,onChange:this.handleCustomInput,value:r,onFocus:()=>this.setState({inputFocused:!0}),onBlur:()=>this.setState({inputFocused:!1})},"option-input"),l.jsx("span",{className:"ml-2"})]},"cs-custom-container")),h.push(l.jsx("hr",{className:"mb-2"},"option-end")),h}render(){const{disabled:e,invalid:t,value:n,"data-testid":o}=this.props,{menuIsOpen:a}=this.state;let{popperOptions:r}=this.props;return r={placement:"bottom-end",modifiers:{preventOverflow:{enabled:!1}},...r},l.jsx("div",{className:"input-group cs-container context-menu",ref:this.csContainer,"data-testid":o,children:l.jsx("div",{className:E("input-group-append cs-dropdown",{"cs-dropdown-invalid":t}),children:l.jsxs("button",{type:"button",className:E("btn cs-btn form-control",{"cs-btn-invalid":t}),ref:this.button,onClick:this.toggleMenu,disabled:e,children:[l.jsx("span",{className:E({"text-muted":n===null}),children:this.getSelectedText()}),l.jsx("span",{children:l.jsx(q,{icon:xn,className:"cs-caret"})}),l.jsx(Vn,{isShown:a,actions:{menuElement:this.renderMenuElement()},popperOptions:r,popperClassName:"CustomTimeSelect",onMenuOpened:this.handleMenuOpened,onMenuClosed:this.handleMenuExited,menuStyle:{maxWidth:"100rem"}})]})})})}};let ye=se;p(ye,"MENU_NAVIGATION_DIRECTION",Bn),p(ye,"DROP_DOWN_MENU_HEIGHT",125),p(ye,"defaultProps",{onChange(){},value:null,disabled:!1,popperOptions:{},icon:Ys,customText:"Custom",placeholder:"Select a time",valueToTime:e=>e===null?0:Math.round(e/1e3),timeToValue:e=>e*1e3,invalid:!1,"data-testid":void 0});const oo=ye;function xe(s,i,e,t,n){const o=t-e+1;return`${((parseInt(i,10)-s-e)%o+o)%o+e}`.padStart(n,"0")}function Hn(s,i,e){const{selectionStart:t}=s;return t===0?xe(i,e,1900,2099,4):t===5?xe(i,e,1,12,2):t===8?xe(i,e,1,31,2):t===11?xe(i,e,0,23,2):t===17||t===14?xe(i,e,0,59,2):t===20||t===24||t===28?xe(i,e,0,999,3):e}function yt(s){const i=s.substring(0,23),e=s.substring(23,26),t=s.substring(26);return[i,e,t].filter(n=>n!=="").join("")}const ao=U.module("DateTimeInput"),lo="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",ro="([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}[0-9]{3}[0-9]{3}",co=`${lo} ${ro}`,He="2022-01-01",Kn=`${He} 00:00:00.000000000`,uo="YYYY-MM-DD HH:MM:SS.SSSSSSSSS";function tn(s){return s!=null&&s.length>=He.length?`${s.substring(0,He.length)}${s.substring(He.length).replace(/\u2007/g,"0")}${Kn.substring(s.length)}`:s}function nn(s){return s.replace(/\u200B/g,"")}const ho=[yt(Kn)],Lt=w.forwardRef((s,i)=>{const{className:e="",onChange:t=()=>{},defaultValue:n="",onFocus:o=()=>{},onBlur:a=()=>{},onSubmit:r,"data-testid":c}=s,[u,h]=d.useState(n.length>0?yt(n):""),[m,g]=d.useState(),b=d.useCallback(x=>{ao.debug("handleChange",x),h(x),t(tn(nn(x)))},[t]),y=d.useCallback(()=>{const x=nn(u),T=tn(x);T!==x&&h(yt(T)),a()},[u,a]);return l.jsx("div",{className:"d-flex flex-row align-items-center",children:l.jsx(it,{ref:i,className:E(e),example:ho,getNextSegmentValue:Hn,onChange:b,onSelect:g,onSubmit:r,pattern:co,placeholder:uo,selection:m,value:u,onFocus:o,onBlur:y,"data-testid":c})})});Lt.displayName="DateTimeInput";Lt.defaultProps={className:"",onChange:()=>{},defaultValue:"",onFocus:()=>{},onBlur:()=>{},"data-testid":void 0};const po=Lt,mo=U.module("DateInput"),fo="[12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])",go=["2000-01-01","2022-12-31"],bo="YYYY-MM-DD",Pt=w.forwardRef((s,i)=>{const{className:e="",onChange:t=()=>{},defaultValue:n="",onFocus:o=()=>{},onBlur:a=()=>{},"data-testid":r}=s,[c,u]=d.useState(n),[h,m]=d.useState(),g=d.useCallback(b=>{mo.debug("handleChange",b),u(b),t(b)},[t]);return l.jsx("div",{className:"d-flex flex-row align-items-center",children:l.jsx(it,{ref:i,className:E(e),example:go,getNextSegmentValue:Hn,onChange:g,onSelect:m,pattern:fo,placeholder:bo,selection:h,value:c,onFocus:o,onBlur:a,"data-testid":r})})});Pt.displayName="DateInput";Pt.defaultProps={className:"",onChange:()=>!1,defaultValue:"",onFocus:()=>!1,onBlur:()=>!1,"data-testid":void 0};const Co=Pt;class Wn extends d.PureComponent{constructor(e){super(e);p(this,"searchInput");this.searchInput=w.createRef(),this.handleChange=this.handleChange.bind(this),this.sendUpdate=Ge(this.sendUpdate.bind(this),e.debounceMs),this.state={value:e.value}}componentDidUpdate(e){const{value:t}=this.props;e.value!==t&&this.setState({value:t})}focus(){var e;(e=this.searchInput.current)==null||e.focus()}handleChange(e){this.setState({value:e.target.value},this.sendUpdate)}sendUpdate(){const{onChange:e}=this.props,{value:t}=this.state;e(t)}render(){const{placeholder:e,className:t,matchCount:n,id:o,"data-testid":a}=this.props,{value:r}=this.state;return l.jsx(nt,{value:r,placeholder:e,onChange:this.handleChange,className:t,matchCount:n,ref:this.searchInput,id:o,"data-testid":a})}}p(Wn,"defaultProps",{placeholder:"Search",className:"",matchCount:null,debounceMs:250,id:"","data-testid":void 0});const vo=Wn;const xo=U.module("ItemListItem"),zt=class extends d.Component{constructor(e){super(e);p(this,"itemRef");this.handleBlur=this.handleBlur.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleClick=this.handleClick.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDrag=this.handleDrag.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.itemRef=w.createRef()}static handleKeyDown(){return xo.log("ItemListItem.handleKeyDown false"),!1}handleBlur(e){const{itemIndex:t,onBlur:n}=this.props;n(t,e)}handleFocus(e){const{itemIndex:t,onFocus:n}=this.props;n(t,e)}handleClick(e){const{itemIndex:t,onClick:n}=this.props;n(t,e)}handleContextMenu(e){const{itemIndex:t,onContextMenu:n}=this.props;n(t,e)}handleDragStart(e){const{itemIndex:t,onDragStart:n}=this.props;n(t,e)}handleDrag(e){const{itemIndex:t,onDrag:n}=this.props;n(t,e)}handleDragOver(e){e.preventDefault();const{itemIndex:t,onDragOver:n}=this.props;n(t,e)}handleDragEnd(e){const{itemIndex:t,onDragEnd:n}=this.props;n(t,e)}handleDrop(e){const{itemIndex:t,onDrop:n}=this.props;n(t,e)}handleDoubleClick(e){const{itemIndex:t,onDoubleClick:n}=this.props;n(t,e)}handleMouseMove(e){const{itemIndex:t,onMouseMove:n}=this.props;n(t,e)}handleMouseDown(e){const{itemIndex:t,onMouseDown:n}=this.props;n(t,e)}handleMouseUp(e){const{itemIndex:t,onMouseUp:n}=this.props;n(t,e)}render(){const{isDraggable:e,isFocused:t,isSelected:n,style:o,children:a,"data-testid":r}=this.props;return l.jsx("div",{className:E("item-list-item",{active:n},{"is-focused":t},{"is-draggable":e}),onKeyDown:zt.handleKeyDown,onContextMenuCapture:this.handleContextMenu,onClick:this.handleClick,onDrag:this.handleDrag,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDrop:this.handleDrop,onDoubleClick:this.handleDoubleClick,onMouseDown:this.handleMouseDown,onMouseMove:this.handleMouseMove,onMouseUp:this.handleMouseUp,tabIndex:-1,ref:this.itemRef,role:"listitem",style:o,onFocus:this.handleFocus,onBlur:this.handleBlur,draggable:e,"data-testid":r,children:a})}};let Ke=zt;p(Ke,"defaultProps",{children:null,isDraggable:!1,isFocused:!1,isSelected:!1,itemIndex:0,"data-testid":void 0,onBlur(){},onClick(){},onContextMenu(){},onDragStart(){},onDrag(){},onDragOver(){},onDragEnd(){},onDrop(){},onDoubleClick(){},onFocus(){},onMouseDown(){},onMouseMove(){},onMouseUp(){},style:{}});const Gn=Ke;const sn=U.module("ItemList"),on=5,ge=class extends d.PureComponent{constructor(e){super(e);p(this,"list");p(this,"listContainer");p(this,"getItemSelected",Q((e,t)=>ie.isSelected(t,e),{max:ge.CACHE_SIZE}));p(this,"getCachedItem",Q((e,t,n,o,a,r,c,u)=>{const h=r({item:n,itemIndex:e,isFocused:o,isSelected:a,style:c});return l.jsx(Gn,{onContextMenu:this.handleItemContextMenu,onDoubleClick:this.handleItemDoubleClick,onMouseDown:this.handleItemMouseDown,onFocus:this.handleItemFocus,onBlur:this.handleItemBlur,disableSelect:u,onMouseMove:this.handleItemMouseMove,onMouseUp:this.handleItemMouseUp,isFocused:o,isSelected:a,itemIndex:e,style:c,children:h},t)},{max:ge.CACHE_SIZE}));p(this,"getOuterElement",Q(e=>{const t=w.forwardRef((n,o)=>l.jsx("div",{ref:o,tabIndex:-1,onKeyDown:e,role:"presentation",...n}));return t.displayName="ItemListOuterElement",t}));p(this,"getInnerElement",Q(()=>{const e=w.forwardRef((t,n)=>l.jsx("div",{className:"item-list-inner-element",ref:n,...t}));return e.displayName="ItemListInnerElement",e}));p(this,"getItemData",Q((e,t,n)=>({items:e,selectedRanges:t,renderItem:n})));this.handleItemBlur=this.handleItemBlur.bind(this),this.handleItemContextMenu=this.handleItemContextMenu.bind(this),this.handleItemFocus=this.handleItemFocus.bind(this),this.handleItemDoubleClick=this.handleItemDoubleClick.bind(this),this.handleItemMouseDown=this.handleItemMouseDown.bind(this),this.handleItemMouseMove=this.handleItemMouseMove.bind(this),this.handleItemMouseUp=this.handleItemMouseUp.bind(this),this.handleItemsRendered=this.handleItemsRendered.bind(this),this.handleWindowMouseUp=this.handleWindowMouseUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleResize=this.handleResize.bind(this),this.renderInnerElement=this.renderInnerElement.bind(this),this.list=w.createRef(),this.listContainer=w.createRef();const{isStickyBottom:t,selectedRanges:n}=e;this.state={focusIndex:null,mouseDownIndex:null,selectedRanges:n,overscanStartIndex:0,height:null,isDragging:!1,isStuckToBottom:t,scrollOffset:null,mouseX:null,mouseY:null}}static renderItem({item:e}){return l.jsx("div",{className:"item-list-item-content",children:e!=null&&(e.displayValue??e.value??`${e}`)})}componentDidUpdate(e,t){const{selectedRanges:n,itemCount:o}=this.props,{focusIndex:a,isStuckToBottom:r,scrollOffset:c,height:u,selectedRanges:h}=this.state;if(r&&!this.isListAtBottom()&&o>0&&this.scrollToBottom(),(c!==t.scrollOffset||u!==t.height)&&this.sendViewportUpdate(),n!==e.selectedRanges&&n!==h)this.setSelectedRanges(n);else if(h!==t.selectedRanges){const{onSelectionChange:m}=this.props;m(h)}if(a!==t.focusIndex){const{onFocusChange:m}=this.props;m(a)}}componentWillUnmount(){window.removeEventListener("mouseup",this.handleWindowMouseUp)}focus(){var e;(e=this.listContainer.current)==null||e.focus()}restoreScrollPosition(){var t;const{scrollOffset:e}=this.state;e!=null&&((t=this.listContainer.current)==null||t.scrollTo(0,e))}getElement(e){if(this.listContainer.current==null)return null;const{focusSelector:t}=this.props,{overscanStartIndex:n}=this.state,o=this.listContainer.current.querySelectorAll(t),a=e-n;return o[a]}focusItem(e){const{disableSelect:t}=this.props;if(t)return;this.setState({focusIndex:e});const n=this.getElement(e);n instanceof HTMLElement&&n.focus()}scrollToItem(e){const t=this.getElement(e);t!=null&&t.scrollIntoView({block:"center"})}handleItemContextMenu(e,t){const{selectedRanges:n}=this.state,a=ie.isSelected(n,e)||G.isModifierKeyDown(t);this.toggleSelect(e,t.shiftKey,a,!1)}handleItemDoubleClick(e,t){const{isDoubleClickSelect:n,onSelect:o}=this.props;n&&this.setState(({selectedRanges:a})=>({selectedRanges:ie.selectRange(a,[e,e])}),()=>{o(e,t)})}handleItemMouseDown(e,t){const{selectedRanges:n}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(t.button===2&&n.length===0){this.focusItem(e),this.selectItem(e);return}t.button!=null&&t.button!==0||(this.setState({mouseDownIndex:e,mouseX:t.clientX,mouseY:t.clientY}),window.addEventListener("mouseup",this.handleWindowMouseUp))}}handleItemBlur(e,t){sn.debug2("item blur",e,t.currentTarget,t.relatedTarget),(!t.relatedTarget||this.listContainer.current&&t.relatedTarget instanceof HTMLElement&&!this.listContainer.current.contains(t.relatedTarget))&&this.setState({focusIndex:null})}handleItemFocus(e,t){sn.debug2("item focus",e,t.target),this.setState(n=>{const{focusIndex:o}=n;return o!==e?{focusIndex:e}:null})}handleItemMouseMove(e,t){const{isDragSelect:n,isMultiSelect:o,disableSelect:a}=this.props,{mouseDownIndex:r,selectedRanges:c,mouseX:u,mouseY:h}=this.state;if(r==null||a)return;const m=Math.abs(t.clientX-(u??0)),g=Math.abs(t.clientY-(h??0));m>on&&g>on&&this.setState({isDragging:!0}),(n||r===e)&&(this.focusItem(e),o?(!n&&!this.getItemSelected(e,c)&&!G.isModifierKeyDown(t)&&this.deselectAll(),this.selectRange([Math.min(r,e),Math.max(r,e)])):this.toggleSelect(e,t.shiftKey,G.isModifierKeyDown(t),!1))}handleItemMouseUp(e,t){const{isDeselectOnClick:n,isDoubleClickSelect:o,onSelect:a}=this.props,{mouseDownIndex:r,isDragging:c}=this.state;if(!(t.target instanceof HTMLElement&&["button","select","input","textarea"].indexOf(t.target.tagName.toLowerCase())!==-1)){if(r===e&&!c){const u=t.shiftKey,h=G.isModifierKeyDown(t);this.focusItem(e),this.toggleSelect(e,u,h,n),!o&&!u&&!h&&a(e,t)}this.resetMouseState()}}handleItemsRendered({overscanStartIndex:e}){this.setState({overscanStartIndex:e})}handleResize({height:e}){this.setState({height:e})}handleMouseLeave(){this.setState({mouseDownIndex:null})}handleWindowMouseUp(){this.resetMouseState(),window.removeEventListener("mouseup",this.handleWindowMouseUp)}handleKeyDown(e){var c;const{isMultiSelect:t,itemCount:n,onSelect:o}=this.props,{focusIndex:a}=this.state;let r=a;if(e.key==="Enter"||e.key===" "){!t&&r!=null&&this.setState({selectedRanges:[[r,r]]},()=>{r!=null&&o(r,e)});return}if(e.key==="ArrowUp")r!=null&&r>=0?r=Math.max(0,r-1):r=n-1;else if(e.key==="ArrowDown")r!=null&&r>=0?r=Math.min(r+1,n-1):r=0;else return;if(a!==r){e.stopPropagation(),e.preventDefault(),this.focusItem(r);const{selectedRanges:u}=this.state;if(e.shiftKey&&u.length>0){const h=u[u.length-1];this.selectRange([Math.min(r,h[0]),Math.max(r,h[1])])}else this.deselectAll(),r!==null?this.selectItem(r):(c=this.listContainer.current)==null||c.focus();this.scrollIntoView(r)}}handleScroll({scrollUpdateWasRequested:e,scrollOffset:t}){this.setState(n=>{if(e)return{scrollOffset:t};const{isStickyBottom:o}=this.props,{height:a}=n;return{isStuckToBottom:o&&this.isListAtBottom({scrollOffset:t,height:a}),scrollOffset:t}})}resetMouseState(){this.setState({mouseDownIndex:null,isDragging:!1})}scrollToBottom(){const{itemCount:e}=this.props;this.list.current&&this.list.current.scrollToItem(e)}scrollIntoView(e){this.list.current&&this.list.current.scrollToItem(e)}toggleSelect(e,t,n,o=!0){const{isMultiSelect:a}=this.props,{selectedRanges:r}=this.state;if(a&&t&&r.length>0){const c=r[r.length-1];this.selectRange([Math.min(c[0],e),Math.max(e,c[1])])}else a&&r.length===1&&r[0][0]===e&&r[0][1]===e?o&&this.deselectItem(e):a&&n?this.getItemSelected(e,r)?o&&this.deselectItem(e):this.selectItem(e):(this.deselectAll(),this.selectItem(e))}deselectAll(){const{itemCount:e}=this.props;this.deselectRange([0,e])}deselectItem(e){this.deselectRange([e,e])}deselectRange(e){ie.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:ie.deselectRange(t,e)}))}selectItem(e){const{disableSelect:t}=this.props;t||this.selectRange([e,e])}selectRange(e){ie.validateRange(e),this.setState(({selectedRanges:t})=>({selectedRanges:ie.selectRange(t,e)}))}setSelectedRanges(e){this.setState({selectedRanges:e})}sendViewportUpdate(){const{scrollOffset:e,height:t}=this.state;if(e!=null&&t!=null){const{onViewportChange:n,rowHeight:o}=this.props,a=Math.floor(e/o),r=a+Math.ceil(t/o);n(a,r)}}isListAtBottom({scrollOffset:e,height:t}=this.state){if(t==null||e==null)return!1;const{itemCount:n,rowHeight:o}=this.props;return e+t>=n*o}renderInnerElement({index:e,style:t}){const{items:n,offset:o,renderItem:a,disableSelect:r}=this.props,{focusIndex:c,selectedRanges:u}=this.state;if(e<o||e>=o+n.length)return null;const h=n[e-o];return this.getCachedItem(e,e,h,e===c&&!r,this.getItemSelected(e,u),a,t,r)}render(){const{items:e,itemCount:t,overscanCount:n,renderItem:o,rowHeight:a,"data-testid":r}=this.props,{selectedRanges:c,isStuckToBottom:u}=this.state;return l.jsx(Ps,{className:"item-list-auto-sizer",onResize:this.handleResize,children:({width:h,height:m})=>l.jsx(Fs,{className:"item-list-scroll-pane",height:m,width:h,initialScrollOffset:u?t*a:0,itemCount:t,itemSize:a,itemData:this.getItemData(e,c,o),onScroll:this.handleScroll,onItemsRendered:this.handleItemsRendered,ref:this.list,outerElementType:this.getOuterElement(this.handleKeyDown),outerRef:this.listContainer,innerElementType:this.getInnerElement(),overscanCount:n,"data-testid":r,children:this.renderInnerElement})})}};let te=ge;p(te,"CACHE_SIZE",1e3),p(te,"DEFAULT_ROW_HEIGHT",20),p(te,"DEFAULT_OVERSCAN",10),p(te,"defaultProps",{offset:0,items:[],rowHeight:ge.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!1,isDragSelect:!0,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},overscanCount:ge.DEFAULT_OVERSCAN,renderItem:ge.renderItem,selectedRanges:[],focusSelector:".item-list-item","data-testid":void 0});const ue=class extends d.PureComponent{constructor(e){super(e);p(this,"itemList");p(this,"getCachedDraggableItem",Q((e,t,n,o,a,r,c,u)=>l.jsx(Us,{draggableId:ue.getDraggableId(e,o),index:o,isDragDisabled:c,children:h=>l.jsx("div",{role:"menuitem",className:"draggable-item-list-item",ref:h.innerRef,tabIndex:-1,...h.draggableProps,...h.dragHandleProps,children:t({item:n,itemIndex:o,isFocused:a,isSelected:r,style:u,isClone:!1})})},o),{max:te.CACHE_SIZE}));p(this,"getCachedRenderDraggableItem",Q((e,t,n)=>({item:o,itemIndex:a,isFocused:r,isSelected:c,style:u})=>this.getCachedDraggableItem(e,n,o,a,r,c,t,u),{max:1}));p(this,"getCachedRenderClone",Q((e,t,n,o)=>(a,r,c)=>{const{selectedCount:u}=this.state,{draggableProps:h,dragHandleProps:m,innerRef:g}=a,{index:b}=c.source,y=t[b-n];return l.jsx("div",{className:E("draggable-item-list-dragging-item-container",e),...h,...m,ref:g,children:l.jsx("div",{className:E("draggable-item-list-dragging-item",{"two-dragged":u===2},{"multiple-dragged":u>2}),children:o({item:y,itemIndex:b,isFocused:!1,isSelected:!0,style:{},isClone:!0,selectedCount:u})})})},{max:1}));this.handleSelectionChange=this.handleSelectionChange.bind(this),this.itemList=w.createRef(),this.state={selectedCount:0}}static renderHandle(){return l.jsxs("div",{children:[l.jsx(Ot,{children:"Drag to re-order"}),l.jsx(q,{icon:ei})]})}static renderBadge({text:e}){return e!=null&&e.length>0?l.jsx("span",{className:"number-badge",children:e}):null}static renderTextItem({text:e,badgeText:t="",className:n=""}){return l.jsxs("div",{className:E("item-list-item-content","draggable-item-list-item-content",n),children:[l.jsx("span",{className:"title",children:e}),ue.renderBadge({text:t}),ue.renderHandle()]})}static renderItem({item:e,isClone:t,selectedCount:n}){const o=e!=null?e.displayValue??e.value??`${e}`:"",a=t!==void 0&&t?`${n}`:"",r=t!==void 0&&t?"item-list-item-clone":"";return ue.renderTextItem({text:o,badgeText:a,className:r})}static getDraggableId(e,t){return`${e}/${t}`}static getDraggableIndex(e){const t=e.split("/").pop();return parseInt(t!==void 0?t:"",10)}selectItem(e){var t;(t=this.itemList.current)==null||t.selectItem(e)}focusItem(e){var t;(t=this.itemList.current)==null||t.focusItem(e)}scrollToItem(e){var t;(t=this.itemList.current)==null||t.scrollToItem(e)}handleSelectionChange(e){this.setState({selectedCount:ie.count(e)});const{onSelectionChange:t}=this.props;t(e)}render(){const{className:e,draggablePrefix:t,draggingItemClassName:n,droppableId:o,isDoubleClickSelect:a,isDragDisabled:r,isDropDisabled:c,isMultiSelect:u,isStickyBottom:h,itemCount:m,items:g,offset:b,onFocusChange:y,onSelect:x,onViewportChange:T,renderItem:j,rowHeight:$,selectedRanges:C,style:P,"data-testid":N}=this.props;return l.jsx($s,{isDropDisabled:c,droppableId:o,mode:"virtual",renderClone:this.getCachedRenderClone(n,g,b,j),"data-testid":N,children:(D,O)=>l.jsx("div",{role:"menu",className:E("draggable-item-list",e,{"is-drop-disabled":c,"is-drag-disabled":r,"is-dragging-from-this":O.draggingFromThisWith,"is-dragging-over":O.isDraggingOver,"is-dropping":O.draggingOverWith}),style:P,ref:D.innerRef,...D.droppableProps,children:l.jsx(te,{focusSelector:".draggable-item-list-item",isDoubleClickSelect:a,isDragSelect:!1,isMultiSelect:u,isStickyBottom:h,itemCount:m,items:g,onFocusChange:y,onSelect:x,onSelectionChange:this.handleSelectionChange,onViewportChange:T,offset:b,ref:this.itemList,renderItem:this.getCachedRenderDraggableItem(t,r,j),rowHeight:$,selectedRanges:C})})})}};let Re=ue;p(Re,"DEFAULT_ROW_HEIGHT",30),p(Re,"defaultProps",{className:"",draggingItemClassName:"",offset:0,items:[],rowHeight:ue.DEFAULT_ROW_HEIGHT,isDeselectOnClick:!0,isDoubleClickSelect:!0,isDropDisabled:!1,isDragDisabled:!1,isMultiSelect:!1,isStickyBottom:!1,disableSelect:!1,style:null,onFocusChange(){},onSelect(){},onSelectionChange(){},onViewportChange(){},renderItem:ue.renderItem,selectedRanges:[],draggablePrefix:"draggable-item",droppableId:"droppable-item-list","data-testid":void 0});const So=Re;class Xe{static reorder(i,e,t,n){const o=i===t?Xe.adjustDestinationIndex(n,e):n,a=Xe.removeItems(i,e);return t.splice(o,0,...a),a}static removeItems(i,e){const t=[],n=e.map((o,a)=>({range:o,index:a})).sort((o,a)=>a.range[0]-o.range[0]);for(let o=0;o<n.length;o+=1){const{range:a,index:r}=n[o],[c,u]=a;t[r]=i.splice(c,u-c+1)}return _s(t)}static adjustDestinationIndex(i,e){let t=i;for(let n=0;n<e.length;n+=1){const[o,a]=e[n];if(o>i)break;t-=Math.min(a,i-1)-o+1}return t}static startDragging(){document.documentElement.classList.add("drag-pointer-events-none")}static stopDragging(){document.documentElement.classList.remove("drag-pointer-events-none")}}const yo=Xe;function Eo(s){const{isInvalid:i=!1,items:e,onAdd:t=()=>{},onDelete:n=()=>{},validate:o=()=>null}=s,[a,r]=d.useState(null),[c,u]=d.useState([]),[h,m]=d.useState(""),g=d.useCallback(C=>{u(C)},[]),b=d.useCallback(()=>{n(ie.getItemsInRanges(e,c)),u([])},[e,c,n]),y=d.useCallback(()=>{if(h==="")return;const C=o(h);C==null?(t(h),m("")):r(C)},[h,t,o]),x=d.useCallback(C=>{const{value:P}=C.target;m(P),r(P===""?null:o(P))},[o]),T=d.useCallback(()=>{u([])},[]),j=d.useCallback(C=>{C.key==="Enter"&&y()},[y]),$=d.useMemo(()=>14+Ct(e.length,1,6)*te.DEFAULT_ROW_HEIGHT,[e.length]);return l.jsxs("div",{className:E("editable-item-list-container",{"is-invalid":i}),children:[l.jsx("div",{style:{height:$},children:l.jsx(te,{itemCount:e.length,items:e.map((C,P)=>({value:C,isSelected:ie.isSelected(c,P)})),offset:0,selectedRanges:c,onSelectionChange:g,isMultiSelect:!0})}),l.jsxs("div",{className:"d-flex flex-row pt-2",children:[l.jsx("div",{className:"d-flex flex-grow-1",children:l.jsx("input",{className:E("form-control",{"is-invalid":a!=null}),placeholder:"Enter value",type:"text",value:h,onChange:x,onFocus:T,onKeyDown:j})}),l.jsxs("div",{className:"d-flex align-items-start mt-1 ml-2",children:[l.jsx(Y,{kind:"ghost",onClick:y,disabled:a!=null||h==="",icon:ti,tooltip:"Add new item","data-testid":"add-item-button"}),l.jsx(Y,{kind:"ghost",onClick:b,disabled:c.length===0,icon:ni,tooltip:"Delete selected items","data-testid":"delete-item-button"})]})]})]})}const Pe=class extends d.Component{static isParentSelected(i,e){const t=e.get(i);if(t===void 0)return!1;if(typeof t=="boolean")return t;const n=Array.from(t.values()).includes(!0),o=Array.from(t.values()).includes(!1);return n&&o?null:n}constructor(i){super(i),this.toggleMenu=this.toggleMenu.bind(this),this.toggleValueFor=this.toggleValueFor.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.state={menuIsOpen:!1}}toggleMenu(i){i.stopPropagation(),i.preventDefault(),this.setState(e=>{const{menuIsOpen:t}=e;return{menuIsOpen:!t}})}toggleValueFor(i,e){const{valueMap:t,onUpdateValueMap:n}=this.props,o=new Map(t),a=o.get(i);if(a instanceof Map){const c=new Map(a);if(e!=null)c.set(e,a.get(e)===void 0);else{const u=Pe.isParentSelected(i,o),h=u==null||!u;a.forEach((m,g)=>c.set(g,h))}o.set(i,c)}else o.set(i,a==null||!a);const r=o.get(i);if(e===void 0&&r!==void 0&&typeof r!="boolean"){const c=Pe.isParentSelected(i,t);c!=null&&c?r.forEach((u,h)=>r.set(h,!1)):r.forEach((u,h)=>r.set(h,!0))}n(o)}setAllValues(i){const{valueMap:e,onUpdateValueMap:t}=this.props,n=new Map;e.forEach((o,a)=>{if(typeof o=="boolean")n.set(a,i);else{const r=new Map;o.forEach((c,u)=>r.set(u,i)),n.set(a,r)}}),t(n)}selectAll(){this.setAllValues(!0)}clear(){this.setAllValues(!1)}renderMenuElement(){const{valueMap:i,"data-testid":e}=this.props;return l.jsxs("div",{className:"hcm-menu-container",children:[Array.from(i.entries()).map(([t,n])=>l.jsxs("div",{children:[l.jsx(ze,{className:"hcm-parent",checked:Pe.isParentSelected(t,i),onChange:()=>this.toggleValueFor(t),children:t}),n!==void 0&&typeof n!="boolean"&&Array.from(n.entries()).map(([o,a])=>l.jsx(ze,{className:"hcm-child",checked:a,onChange:()=>this.toggleValueFor(t,o),children:o},o))]},t)),l.jsx(Y,{kind:"ghost",onClick:this.selectAll,"data-testid":e!==void 0?`${e}-btn-select-all`:void 0,children:"Select All"}),l.jsx(Y,{kind:"ghost",onClick:this.clear,"data-testid":e!==void 0?`${e}-btn-clear`:void 0,children:"Clear"})]})}render(){const{menuText:i,className:e,icon:t,id:n,"data-testid":o}=this.props,{menuIsOpen:a}=this.state;return l.jsxs("button",{type:"button",className:E("btn hcm-btn",e),onClick:this.toggleMenu,id:n,"data-testid":o,children:[l.jsxs("span",{children:[t&&l.jsx(q,{icon:t,className:"hcm-icon mr-1"}),i]}),l.jsx(q,{icon:xn,className:"hcm-icon ml-1"}),l.jsx(Ne,{options:{placement:"bottom"},isShown:a,onExited:()=>{this.setState({menuIsOpen:!1})},closeOnBlur:!0,interactive:!0,children:this.renderMenuElement()})]})}};let We=Pe;p(We,"defaultProps",{className:"",icon:null,id:"","data-testid":void 0});const Io=We;function qn({on:s,id:i,className:e,isInvalid:t,disabled:n=!1,onClick:o,"data-testid":a}){return l.jsx("button",{type:"button",className:E("btn","btn-switch",e,{active:s},{"is-invalid":t}),id:i,onClick:o,disabled:n,"data-testid":a,children:l.jsx("div",{className:"handle"})})}function an(s){return s.isOn!==void 0}function zn({item:s,onSelect:i=()=>{},"data-testid":e}){const{icon:t,subtitle:n,title:o}=s,a=d.useMemo(()=>an(s)?()=>{s.onChange(!s.isOn)}:i,[s,i]);return l.jsxs("div",{className:"btn btn-navigation-menu-item","data-testid":`menu-item-${o}`,onClick:a,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&a()},tabIndex:0,role:"menuitem",children:[t!==void 0&&l.jsx("div",{className:"icon",children:l.jsx(q,{icon:t})}),l.jsx("div",{className:"title",children:o}),n!==void 0&&l.jsx("div",{className:"shortcut",children:n}),l.jsx("div",{className:"accessory","data-testid":e,children:an(s)?l.jsx(qn,{on:s.isOn,onClick:r=>{r.stopPropagation(),a()}}):l.jsx(q,{icon:si})})]})}function wo({items:s,onSelect:i=()=>{},"data-testid":e}){return l.jsx("div",{className:"navigation-menu-view","data-testid":e,children:l.jsx("ul",{className:"navigation-menu-list",children:s.map((t,n)=>l.jsx("li",{children:l.jsx(zn,{item:t,onSelect:()=>{i(n)}})},t.title))})})}function To({children:s,onBack:i,onClose:e,title:t,"data-testid":n}){return l.jsxs("div",{className:"navigation-page","data-testid":n,children:[l.jsxs("div",{className:"navigation-title-bar",children:[l.jsx("div",{className:"navigation-left-buttons",children:i!==void 0&&l.jsx(Y,{kind:"ghost",className:"btn-back","data-testid":"btn-page-back",onClick:i,icon:ii,children:"Back"})}),l.jsx("div",{className:"navigation-title",children:t}),l.jsx("div",{className:"navigation-right-buttons",children:e!==void 0&&l.jsx(Y,{kind:"ghost",className:"btn-close px-2 m-1","data-testid":"btn-page-close",onClick:e,icon:Sn,tooltip:"Close"})})]}),l.jsx("div",{className:"navigation-content",children:s})]})}function Mo({children:s,"data-testid":i}){const e=d.useMemo(()=>w.Children.toArray(s),[s]),t=An(e),[n,o]=d.useState(e[e.length-1]),[a,r]=d.useState(null),[c,u]=d.useState(null);d.useEffect(function(){if(t===void 0||e===t)return;const b=e[e.length-1];e.length===t.length||t.length===0||a!==null||c!==null?a!==null&&b!==a?r(b):b!==c&&b!==n&&o(b):e.length>t.length?r(b):e.length<t.length&&(o(b),u(t[t.length-1]))},[e,t,a,c,n]);const h=d.useCallback(()=>{o(a),r(null)},[a]),m=d.useCallback(()=>{u(null)},[]);return l.jsxs("div",{className:"navigation-stack",children:[l.jsx("div",{className:"main-view","data-testid":i,children:n}),l.jsx(be,{in:c!=null,timeout:oe.transitionMidMs,classNames:"slide-right",onEntered:m,children:l.jsx(l.Fragment,{children:c!=null&&l.jsx("div",{className:"popping-view",children:c})})}),l.jsx(be,{in:a!=null,timeout:oe.transitionMidMs,classNames:"slide-left",onEntered:h,children:l.jsx(l.Fragment,{children:a!=null&&l.jsx("div",{className:"pushing-view",children:a})})})]})}function No({children:s,disabled:i,value:e,"data-testid":t}){return l.jsx("option",{value:e,disabled:i,"data-testid":t,children:s})}function ko(s){const{children:i,disabled:e=!1,name:t,onChange:n,value:o="","data-testid":a}=s,[r]=d.useState(t??Ce());return l.jsx(l.Fragment,{children:w.Children.map(i,c=>c?w.cloneElement(c,{name:r,onChange:c.props.onChange??n,checked:o===c.props.value,disabled:c.props.disabled??e,"data-testid":a}):null)})}const Ft=w.forwardRef((s,i)=>{const{checked:e,children:t,className:n="",disabled:o=!1,inputClassName:a="",isInvalid:r=!1,labelClassName:c="",name:u,onChange:h,value:m,"data-testid":g}=s,[b]=d.useState(Ce());return l.jsxs("div",{className:E("custom-control custom-radio",n),children:[l.jsx("input",{type:"radio",id:b,"data-testid":g,name:u,ref:i,className:E("custom-control-input",a,{"is-invalid":r}),checked:e,disabled:o,value:m,onChange:h}),l.jsx("label",{className:E("custom-control-label",c),htmlFor:b,children:t})]})});Ft.displayName="RadioItem";Ft.defaultProps={checked:void 0,className:"",disabled:!1,inputClassName:"",isInvalid:!1,labelClassName:"",name:void 0,onChange:void 0,"data-testid":void 0};const Oo=Ft;const Do=.025,Ao=.9,Ro=.1,jo=.618,pt=oe["primary-dark"],ln=80,Lo=oe["gray-800"],Po=oe["gray-900"],pe={SIZE:8,DOT_SIZE:2,FILL_OPACITY:.25},re=18,Fo=250,Uo=60*1e3,$o=w.memo(()=>{const s=d.useRef(null),i=d.useRef(null),[e,t]=d.useState(!1),n=window.devicePixelRatio;let o,a,r,c,u,h=null,m=[];function g(){i.current!=null&&(r=i.current.offsetWidth,c=i.current.offsetHeight),s.current!=null&&(s.current.style.width=`${r}px`,s.current.style.height=`${c}px`,s.current.width=r*n,s.current.height=c*n),o==null||o.scale(n,n)}function b(){const A=document.createElement("canvas");A.width=pe.SIZE,A.height=pe.SIZE;const R=A.getContext("2d");return R!=null&&(R.fillStyle=pt,R.fillRect(0,0,pe.DOT_SIZE,pe.DOT_SIZE),R.fillStyle=pt+Math.round(255*pe.FILL_OPACITY).toString(16).padStart(2,"0"),R.fillRect(0,0,pe.SIZE,pe.SIZE)),R==null?void 0:R.createPattern(A,"repeat")}function y(A){const R=Math.random()-.5;let _=Do*R;return A<Ro?_=Math.abs(_):A>Ao&&(_=-Math.abs(_)),A+_}function x(){const A=[];let R=jo;for(let _=0;_<r+re;_+=1)R=y(R),A.push(R);return A}function T(){for(;m.length>=r+re;)m.pop();for(;m.length<r+re;)m.push(y(m[m.length-1]))}function j(A,R){R.beginPath(),R.moveTo(-1,c+1),R.lineTo(-1,c*A[0]);for(let _=0;_<A.length;_+=1)R.lineTo(_,c*A[_]);R.lineTo(r+re,c*A[A.length-1]),R.lineTo(r+re,c+1),R.closePath()}function $(A){A.beginPath();for(let R=1;R<r;R+=ln)A.moveTo(R,0),A.lineTo(R,c);for(let R=1;R<c;R+=ln)A.moveTo(0,R),A.lineTo(r,R)}function C(A){h=h??A,ci(o),o.fillStyle=Po,o.fillRect(0,0,r,c),$(o),o.lineWidth=1,o.strokeStyle=Lo,o.stroke();const R=((h??0)-(A??0))/(1e3/re);if(o.translate(R,0),j(m,o),o.lineWidth=2,o.strokeStyle=pt,o.stroke(),o.translate(-R,0),a!=null&&(o.fillStyle=a),o.fill(),o.setTransform(n,0,0,n,0,0),(A??0)-(h??0)>1e3/re){const _=Math.floor(((A??0)-(h??0))/(1e3/re));for(let M=0;M<_;M+=1)m.shift(),m.push(y(m[m.length-1]));h=A}u!=null&&cancelAnimationFrame(u),u=requestAnimationFrame(C)}const P=Ge(()=>{u=requestAnimationFrame(A=>{g(),T(),t(!1),C(A)})},Fo,{leading:!0});function N(){t(!0),u!=null&&cancelAnimationFrame(u),u=null,h=null}const D=Ge(()=>{N()},Uo);function O(){u==null&&(t(!1),g(),T(),u=requestAnimationFrame(C)),D()}function B(){document.hasFocus()&&O()}function ne(){u!=null&&cancelAnimationFrame(u),D(),P()}return d.useEffect(()=>{var A;return o=(A=s.current)==null?void 0:A.getContext("2d",{alpha:!1}),g(),m=x(),a=b(),C(),D(),window.addEventListener("resize",ne),window.addEventListener("focus",O),window.addEventListener("blur",N),window.addEventListener("mousemove",B),window.addEventListener("keydown",B),()=>{u!=null&&cancelAnimationFrame(u),window.removeEventListener("resize",ne),window.removeEventListener("focus",O),window.removeEventListener("blur",N),window.removeEventListener("mousemove",B),window.removeEventListener("keydown",B),D.cancel(),P.cancel()}},[]),l.jsx("div",{className:"random-area-plot-animation-container",ref:i,children:l.jsx("canvas",{ref:s,className:e?"shade":""})})}),Zn=$o;function _o({children:s,onBlur:i,onChange:e,className:t,defaultValue:n,name:o,value:a,disabled:r,"data-testid":c}){const u=d.useCallback(h=>{e(h.target.value)},[e]);return l.jsx("select",{className:E("custom-select",t),onBlur:i,onChange:u,defaultValue:n,value:a,name:o,disabled:r,"data-testid":c,children:s})}class Xn extends d.PureComponent{constructor(e){super(e);p(this,"list");p(this,"topRow");p(this,"bottomRow");p(this,"getCachedItem",Q((e,t,n,o,a,r,c)=>{const u={height:a},h=o??n;return l.jsx("li",{className:"value-list-item",style:u,tabIndex:-1,children:l.jsx(ze,{checked:r,disabled:c,onChange:()=>this.handleSelect(e),children:h})},t)},{max:1e3}));p(this,"getCachedItems",Q((e,t,n,o)=>{const a=[];for(let r=0;r<e.length;r+=1){const c=e[r],{value:u,displayValue:h,isSelected:m}=c,g=n+r,b=g,y=this.getCachedItem(g,b,u,h,t,m,o);a.push(y)}return a},{max:1}));this.handleBlur=this.handleBlur.bind(this),this.handleScroll=this.handleScroll.bind(this),this.handleSelect=this.handleSelect.bind(this),this.list=w.createRef(),this.topRow=null,this.bottomRow=null}componentDidMount(){this.sendViewportUpdate()}componentDidUpdate(){this.sendViewportUpdate()}handleBlur(e){if(!e.relatedTarget||this.list.current&&e.relatedTarget instanceof HTMLElement&&!this.list.current.contains(e.relatedTarget)){const{onBlur:t}=this.props;t==null||t(e)}}handleScroll(){this.sendViewportUpdate()}handleSelect(e){const{items:t,offset:n,onSelect:o}=this.props,a=e-n;if(a>=0&&a<t.length){const r=t[a],{value:c}=r;o(e,c)}else o(e,null)}sendViewportUpdate(){if(!this.list.current||this.list.current.clientHeight===0)return;const{onViewportChange:e,rowHeight:t}=this.props,n=this.list.current.scrollTop,o=n+this.list.current.clientHeight,a=Math.floor(n/t),r=Math.ceil(o/t);(this.topRow!==a||this.bottomRow!==r)&&(this.topRow=a,this.bottomRow=r,e(a,r))}getElement(e){return this.list.current==null?null:this.list.current.querySelectorAll(".value-list-item")[e]}scrollIntoView(e){const t=this.getElement(e);t==null||t.scrollIntoView({block:"center"})}render(){const{className:e,disabled:t,isInvalid:n,items:o,itemCount:a,offset:r,rowHeight:c,"data-testid":u}=this.props,h=this.getCachedItems(o,c,r,t);return l.jsx("div",{className:E("select-value-list-scroll-pane h-100 w-100",{"is-invalid":n},e),onBlur:this.handleBlur,onScroll:this.handleScroll,ref:this.list,"data-testid":u,children:l.jsx("div",{className:"select-value-list",style:{height:a*c},children:l.jsx("ol",{className:"select-value-list-content",style:{position:"absolute",height:o.length*c,top:r*c,left:0},children:h})})})}}p(Xn,"defaultProps",{disabled:!1,rowHeight:21,onBlur:()=>{},"data-testid":void 0});const Jn=Xn,rn=U.module("Shortcut");var J=(s=>(s.CTRL="MODIFIER_CTRL",s.CMD="MODIFIER_CMD",s.ALT="MODIFIER_ALT",s.OPTION="MODIFIER_OPTION",s.SHIFT="MODIFIER_SHIFT",s))(J||{}),K=(s=>(s.A="A",s.B="B",s.C="C",s.D="D",s.E="E",s.F="F",s.G="G",s.H="H",s.I="I",s.J="J",s.K="K",s.L="L",s.M="M",s.N="N",s.O="O",s.P="P",s.Q="Q",s.R="R",s.S="S",s.T="T",s.U="U",s.V="V",s.W="W",s.X="X",s.Y="Y",s.Z="Z",s.ZERO="0",s.ONE="1",s.TWO="2",s.THREE="3",s.FOUR="4",s.FIVE="5",s.SIX="6",s.SEVEN="7",s.EIGHT="8",s.NINE="9",s.BACKSPACE="Backspace",s.ESCAPE="Escape",s.ENTER="Enter",s.DELETE="Delete",s.SLASH="/",s.QUESTION_MARK="?",s.BACKSLASH="\\",s.PIPE="|",s.MINUS="-",s.UNDERSCORE="_",s.EQUALS="=",s.PLUS="+",s.BACKTICK="`",s.TILDE="~",s.COMMA=",",s.LEFT_CHEVRON="<",s.PERIOD=".",s.RIGHT_CHEVRON=">",s.SEMICOLON=";",s.COLON=":",s.SINGLE_QUOTE="'",s.DOUBLE_QUOTE='"',s.LEFT_BRACKET="[",s.RIGHT_BRACKET="]",s.LEFT_CURLY="{",s.RIGHT_CURLY="}",s.F1="F1",s.F2="F2",s.F3="F3",s.F4="F4",s.F5="F5",s.F6="F6",s.F7="F7",s.F8="F8",s.F9="F9",s.F10="F10",s.F11="F11",s.F12="F12",s))(K||{});const Vo=new Set(["Enter","Delete","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),V=class extends Mt{constructor({id:e,shortcut:t,macShortcut:n,isEditable:o=!0,name:a,tooltip:r}){super();p(this,"id");p(this,"name");p(this,"tooltip");p(this,"isEditable");p(this,"defaultKeyState");p(this,"keyState");this.id=e,this.name=a,this.tooltip=r,this.isEditable=o;const u=V.isMacPlatform?n:t;this.defaultKeyState=V.createKeyState(u),this.keyState=this.defaultKeyState}static isAllowedKey(e){return Object.values(K).includes(e)}static isValidKeyState(e){const{keyValue:t}=e;return t===null?!0:!V.isMacPlatform&&e.metaKey||!V.isAllowedKey(t)?!1:!(!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey)||Vo.has(t)}static createKeyState(e){const t={altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,keyValue:e[e.length-1]};return e.forEach(n=>{switch(n){case"MODIFIER_CTRL":t.ctrlKey=!0;break;case"MODIFIER_ALT":case"MODIFIER_OPTION":t.altKey=!0;break;case"MODIFIER_CMD":t.metaKey=!0;break;case"MODIFIER_SHIFT":t.shiftKey=!0;break}}),t}static getKeyStateFromEvent(e){const{key:t,keyCode:n}=e;let o="";return t==="Shift"||t==="Meta"||t==="Control"||t==="Alt"?o="":!V.isAllowedKey(t)&&V.isAllowedKey(String.fromCharCode(n))?o=String.fromCharCode(n):o=t,{keyValue:o,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}}static getWindowsDisplayText(e){let t="";return e.ctrlKey&&(t+="Ctrl+"),e.altKey&&(t+="Alt+"),e.shiftKey&&(t+="Shift+"),e.keyValue==="Escape"?t+="Esc":e.keyValue!==null&&(t+=e.keyValue),t}static getMacDisplayText(e){let t="";switch(e.ctrlKey&&(t+="⌃"),e.altKey&&(t+="⌥"),e.shiftKey&&(t+="⇧"),e.metaKey&&(t+="⌘"),e.keyValue){case"Enter":t+="⏎";break;case"Escape":t+="⎋";break;case"Backspace":t+="⌫";break;case"Delete":t+="⌦";break;case null:break;default:t+=e.keyValue}return t}static doKeyStatesMatch(e,t){var n,o;return((n=e.keyValue)==null?void 0:n.toUpperCase())===((o=t.keyValue)==null?void 0:o.toUpperCase())&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey&&e.shiftKey===t.shiftKey}static getDisplayText(e){return e.keyValue===null?"":V.isMacPlatform?V.getMacDisplayText(e):V.getWindowsDisplayText(e)}getDisplayText(){return V.getDisplayText(this.keyState)}getKeyState(){return this.keyState}setKeyState(e){V.isValidKeyState(e)?(rn.debug2(`Shortcut ${this.id} updated to ${JSON.stringify(e)}`),this.keyState=e,this.dispatchEvent(new Dn("onUpdate",{detail:this}))):rn.debug2(`Shortcut ${this.id} tried to update to invalid keyState ${JSON.stringify(e)}`)}getDefaultKeyState(){return this.defaultKeyState}isDefault(){return V.doKeyStatesMatch(this.getDefaultKeyState(),this.getKeyState())}setToNull(){this.setKeyState(V.NULL_KEY_STATE)}isNull(){return V.doKeyStatesMatch(this.keyState,V.NULL_KEY_STATE)}setToDefault(){this.setKeyState(this.defaultKeyState)}matchesKeyState(e){return V.doKeyStatesMatch(e,this.keyState)}matchesEvent(e){return this.matchesKeyState(V.getKeyStateFromEvent(e))}};let Ee=V;p(Ee,"NULL_KEY_STATE",{metaKey:!1,shiftKey:!1,altKey:!1,ctrlKey:!1,keyValue:null}),p(Ee,"isMacPlatform",G.isMacPlatform());const cn=U.module("ShortcutRegistry");class Bo extends Mt{constructor(){super(...arguments);p(this,"shortcutMap",new Map);p(this,"shortcutsByCategory",new Map)}createAndAdd(e){const t=new Ee(e);return this.add(t)}add(e){var o;const t=this.shortcutMap.get(e.id);if(t)return cn.warn(`Skipping attempt to add duplicate shortcut ID to registry: ${e.id}`),t;cn.debug2(`Adding shortcut to registry: ${e.id}`),e.addEventListener("onUpdate",({detail:a})=>this.dispatchEvent(new Dn("onUpdate",{detail:a})));const n=e.id.split(".")[0];return this.shortcutMap.set(e.id,e),this.shortcutsByCategory.has(n)?(o=this.shortcutsByCategory.get(n))==null||o.push(e):this.shortcutsByCategory.set(n,[e]),e}get(e){return this.shortcutMap.get(e)}getConflictingShortcuts(e){return Array.from(this.shortcutMap.values()).filter(t=>!t.isNull()&&t.matchesKeyState(e))}}const Ho=Object.freeze(new Bo),fe=Ho,Ko={COPY:fe.createAndAdd({id:"GLOBAL.COPY",name:"Copy",shortcut:[J.CTRL,K.C],macShortcut:[J.CMD,K.C],isEditable:!1}),PASTE:fe.createAndAdd({id:"GLOBAL.PASTE",name:"Paste",shortcut:[J.CTRL,K.V],macShortcut:[J.CMD,K.V],isEditable:!1}),SAVE:fe.createAndAdd({id:"GLOBAL.SAVE",name:"Save",shortcut:[J.CTRL,K.S],macShortcut:[J.CMD,K.S],isEditable:!1}),SELECT_ALL:fe.createAndAdd({id:"GLOBAL.SELECT_ALL",name:"Select All",shortcut:[J.CTRL,K.A],macShortcut:[J.CMD,K.A],isEditable:!1}),LINKER:fe.createAndAdd({id:"GLOBAL.LINKER",name:"Linker",shortcut:[J.CTRL,K.L],macShortcut:[J.CMD,K.L]}),LINKER_CLOSE:fe.createAndAdd({id:"GLOBAL.LINKER_CLOSE",name:"Close Linker Overlay",shortcut:[K.ESCAPE],macShortcut:[K.ESCAPE],isEditable:!1})},Wo=Ko;const Ut=w.forwardRef((s,i)=>{const{children:e,className:t,disabled:n,id:o,isLinked:a,isLinkedSource:r,isInvalid:c,onClick:u,onMouseEnter:h,onMouseLeave:m,style:g,"data-testid":b}=s;return l.jsxs("button",{ref:i,type:"button",className:E("btn-socketed",{"btn-socketed-linked":a!==void 0&&a||r},{"btn-socketed-linked-source":r},{"is-invalid":c},t),id:o,onClick:u,onMouseEnter:h,onMouseLeave:m,style:g,disabled:n,"data-testid":b,children:[e,l.jsx(q,{icon:oi,className:"linked btn-socketed-icon",transform:"down-1"}),l.jsx(q,{icon:ai,className:"is-invalid btn-socketed-icon"})]})});Ut.displayName="SocketedButton";Ut.defaultProps={children:void 0,className:"",disabled:!1,id:void 0,isLinked:!1,isLinkedSource:!1,isInvalid:!1,onClick:void 0,onMouseEnter:void 0,onMouseLeave:void 0,style:void 0,"data-testid":void 0};const Go=Ut,qo={"dh-spectrum-theme--dark":"_dh-spectrum-theme--dark_i6xja_5"},zo={"dh-spectrum-theme--light":"_dh-spectrum-theme--light_16vb7_5"},{global:Zo,light:Xo,dark:Jo,medium:Qo,large:Yo}=Vs,ea={global:Zo,light:{...Xo,...zo},dark:{...Jo,...qo},medium:Qo,large:Yo},ta="_track_535ju_30",na="_handle_535ju_13",sa="_ticks_535ju_98",Qn={"handle-size":"15px","popover-width":"90px","time-slider":"_time-slider_535ju_3","time-slider-popovers":"_time-slider-popovers_535ju_8","handle-popper":"_handle-popper_535ju_13","flex-spacer":"_flex-spacer_535ju_26",track:ta,"track-fills":"_track-fills_535ju_37","track-fill":"_track-fill_535ju_37","track-fill-start":"_track-fill-start_535ju_55","track-fill-middle":"_track-fill-middle_535ju_56","track-fill-end":"_track-fill-end_535ju_59","handle-track":"_handle-track_535ju_62",handle:na,ticks:sa,"tick-labels":"_tick-labels_535ju_116","tick-label":"_tick-label_535ju_116","tick-label-wrapper":"_tick-label-wrapper_535ju_132"};const Ve=parseInt(Qn["handle-size"],10),dn=parseInt(Qn["popover-width"],10),Z=24*60*60-1,un=5*60;function ia({startTime:s,endTime:i,onChange:e,isStartModified:t=!1,isEndModified:n=!1,"data-testid":o}){const[a,r]=d.useState(s),[c,u]=d.useState(i),h=d.useRef(null);d.useEffect(function(){r(s),u(i)},[s,i]);const m=d.useCallback((y,x)=>{let T=y,j=x;T===j&&(j<Z?j+=1:T-=1),r(T),u(j),e({startTime:T,endTime:j})},[r,u,e]),g=d.useCallback(y=>{m(y,c)},[m,c]),b=d.useCallback(y=>{m(a,y)},[m,a]);return l.jsxs("div",{className:"time-slider","data-testid":o,children:[l.jsx(oa,{startTime:a,endTime:c,onStartTimeChange:g,onEndTimeChange:b,isStartModified:t,isEndModified:n}),l.jsxs("div",{className:"track",ref:h,children:[l.jsx(aa,{startTime:a,endTime:c}),l.jsx("div",{className:"ticks",children:Array(24).fill(null).map((y,x)=>l.jsx("div",{className:"tick"},x))}),l.jsx(hn,{track:h,time:a,setTime:g}),l.jsx(hn,{track:h,time:c,setTime:b})]}),l.jsxs("div",{className:"tick-labels",children:[l.jsx("div",{className:"tick-label",children:"0:00"}),l.jsx("div",{className:"tick-label-wrapper",children:Array(24).fill(null).map((y,x)=>l.jsx("div",{className:"tick-label",children:`${x+1}:00`},x))})]})]})}function oa(s){const{startTime:i,endTime:e,onStartTimeChange:t,onEndTimeChange:n,isStartModified:o,isEndModified:a,"data-testid":r}=s,c=i>e,[u,h]=d.useState(c?e:i),[m,g]=d.useState(c?i:e),b=d.useRef(null),y=d.useRef(null),x=d.useRef(null),T=d.useRef(null);d.useEffect(function(){h(i>e?e:i),g(i>e?i:e)},[i,e]),d.useEffect(function(){var D,O;x.current!==null&&((D=y.current)==null||D.setSelection(x.current)),T.current!==null&&((O=b.current)==null||O.setSelection(T.current))},[c]);function j(N){i<=e?t(N):n(N)}function $(N){i<=e?n(N):t(N)}const C=d.useCallback(N=>{x.current=N,T.current=null},[]),P=d.useCallback(N=>{x.current=null,T.current=N},[]);return l.jsxs("div",{className:"time-slider-popovers",children:[l.jsx("div",{className:"flex",style:{flexBasis:`calc(${u/Z*100}% - ${dn/2}px)`}}),l.jsxs("div",{className:"handle-popper",children:[l.jsx("label",{className:E({modified:c?a:o}),children:c?"End Time":"Start Time"}),l.jsx(Ze,{ref:b,allowValueWrapping:!1,value:u,onChange:j,onSelect:C,"data-testid":r!==void 0?`${r}-input-1`:void 0})]}),l.jsx("div",{className:"flex-spacer"}),l.jsxs("div",{className:"handle-popper",children:[l.jsx("label",{className:E({modified:c?o:a}),children:c?"Start Time":"End Time"}),l.jsx(Ze,{ref:y,allowValueWrapping:!1,value:m,onChange:$,onSelect:P,"data-testid":r!==void 0?`${r}-input-2`:void 0})]}),l.jsx("div",{className:"flex",style:{flexBasis:`calc(${(Z-m)/Z*100}% - ${dn/2}px)`}})]})}function aa(s){const{startTime:i,endTime:e,"data-testid":t}=s;return l.jsxs("div",{className:"track-fills","data-testid":t,children:[i>e&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"track-fill track-fill-start",style:{transform:`scaleX(${e/Z})`}}),l.jsx("div",{className:"track-fill track-fill-end",style:{transform:`scaleX(${(Z-i)/Z})`}})]}),i<e&&l.jsx("div",{className:"track-fill track-fill-middle",style:{transform:`translateX(${i/Z*100}%) scaleX(${(e-i)/Z})`}})]})}function hn(s){const{track:i,time:e,setTime:t,"data-testid":n}=s,o=d.useMemo(()=>{let b=Ve/2;return e<3600?b=e/3600*(Ve/2):e>23*3600&&(b=Ve/2+1/(Z-23*3600)*(e-23*3600)*(Ve/2)),`translateX(calc(${e/Z*100}% - ${b}px))`},[e]),a=d.useCallback(g=>{if(!i.current)return 0;const b=i.current.getBoundingClientRect(),y=Math.max(g-b.left,0),x=Z*Math.min(1,y/b.width),T=un*Math.round(x/un);return Math.min(Z,T)},[i]),r=d.useCallback(({clientX:g})=>{t(a(g))},[t,a]),c=d.useCallback(({clientX:g})=>{t(a(g)),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",c),document.documentElement.classList.remove("drag-pointer-events-none")},[t,a,r]),u=d.useCallback(()=>{window.addEventListener("mousemove",r),window.addEventListener("mouseup",c),document.documentElement.classList.add("drag-pointer-events-none")},[r,c]),h=d.useCallback(()=>{window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",c),document.documentElement.classList.remove("drag-pointer-events-none")},[r,c]),m=d.useCallback(()=>{u()},[u]);return d.useEffect(function(){return()=>{h()}},[h]),l.jsx("div",{className:"handle-track",style:{transform:o},children:l.jsx("button",{className:"handle",type:"button","aria-label":"Change time",onMouseDown:m,"data-testid":n})})}function Yn({buttons:s,isShown:i=!1,classNames:e,message:t,type:n,onClick:o,onDismiss:a,"data-testid":r}){const c=s&&s.length!==0;return l.jsx(be,{in:i,timeout:oe.transitionMs,classNames:"toast-notification-slide-up",mountOnEnter:!0,unmountOnExit:!0,children:l.jsxs("div",{className:E("toast-notification",e,n),role:"presentation",onClick:o,onKeyPress:o,"data-testid":r,children:[l.jsx("div",{className:"message-container",children:l.jsx("span",{className:"message",children:t})}),l.jsx(be,{in:c,timeout:oe.transitionSlowMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:l.jsx("div",{className:"buttons-container",children:s})}),a&&l.jsx(Y,{kind:"ghost",icon:Sn,tooltip:"Close notification",className:"my-2",onClick:a})]})})}Yn.TYPE=Object.freeze({ERROR:"error"});function la(s){const{children:i,className:e,labelText:t,hintText:n,isModified:o,validationError:a,showValidationError:r=!0,"data-testid":c,id:u}=s,{current:h}=d.useRef(u??Ce());return l.jsxs(l.Fragment,{children:[l.jsx("label",{className:E("validate-label",e,{modified:o}),htmlFor:h,"data-testid":c,children:t}),w.Children.toArray(i).map(m=>w.isValidElement(m)?w.cloneElement(m,{className:E(m.props.className,{"is-invalid":a})}):l.jsx("div",{className:E(e),children:m})),n!==void 0&&l.jsx("small",{className:"form-text text-muted",children:n}),a!==void 0&&r&&l.jsx("p",{className:"validate-label-error text-danger",children:a})]})}const ra=Object.freeze(Object.defineProperty({__proto__:null,AutoCompleteInput:Ri,AutoResizeTextarea:Dt,BasicModal:At,Button:Y,ButtonGroup:Ue,ButtonOld:$i,CardFlip:_i,Checkbox:ze,Collapse:zi,ComboBox:Qi,ContextActionUtils:G,ContextActions:Wi,ContextMenuItem:In,ContextMenuRoot:di,CopyButton:Yi,CustomTimeSelect:oo,DEFAULT_GET_PREFERRED_REPLACEMENT_STRING:st,DateInput:Co,DateTimeInput:po,DebouncedSearchInput:vo,DragUtils:yo,DraggableItemList:So,DropdownMenu:Vn,EditableItemList:Eo,GLOBAL_SHORTCUTS:Wo,HierarchicalCheckboxMenu:Io,InfoModal:Ui,ItemList:te,ItemListItem:Gn,KEY:K,LoadingOverlay:Me,LoadingSpinner:yn,MODIFIER:J,MaskedInput:it,Menu:wo,MenuItem:zn,Modal:Nt,ModalBody:kt,ModalFooter:kn,ModalHeader:vn,Option:No,Page:To,Popper:Ne,RadioGroup:ko,RadioItem:Oo,RandomAreaPlotAnimation:Zn,SearchInput:nt,Select:_o,SelectValueList:Jn,Shortcut:Ee,ShortcutRegistry:fe,SocketedButton:Go,Stack:Mo,ThemeExport:oe,TimeInput:Ze,TimeSlider:ia,ToastNotification:Yn,Tooltip:Ot,UISwitch:qn,ValidateLabelInput:la,fillToLength:Fn,themeDHDefault:ea,trimTrailingMask:St},Symbol.toStringTag,{value:"Module"})),ca=Object.freeze(Object.defineProperty({__proto__:null,ApiBootstrap:li,ApiContext:ri,ClientBootstrap:wn,ClientContext:ui,useApi:Qe,useClient:Fe},Symbol.toStringTag,{value:"Module"})),es=1e4;function da(s,i,e=es){return new Promise((t,n)=>{let o;const a=setTimeout(()=>{o==null||o(),n(new Tn(`Variable ${i} not found`))},e);function r(c){const u=c.created.find(h=>h.title===i);u!=null&&(clearTimeout(a),o==null||o(),t(u))}o=s.subscribeToFieldUpdates(r)})}const mt=U.module("MessageUtils"),ts="io.deephaven.message.LoginOptions.request",ns="io.deephaven.message.SessionDetails.request",ss="io.deephaven.broadcast",$t="io.deephaven.broadcast.Login",is="io.deephaven.broadcast.Logout";function ot(s){const i=s;return i!=null&&typeof i.id=="string"&&typeof i.message=="string"}function os(s){return ot(s)&&s.message===$t}function as(s){return ot(s)&&s.message===is}function ls(s){const i=s;return i!=null&&typeof i.id=="string"}function _t(s,i=Ce(),e){return{message:s,id:i,payload:e}}function ua(s,i){return{id:s,payload:i}}async function Vt(s,i=3e4){if(window.opener==null)throw new Error("window.opener is null, unable to send request.");return new Promise((e,t)=>{let n;const o=Ce(),a=r=>{const{data:c}=r;if(!ls(c)){mt.debug("Ignoring non-deephaven response",c);return}if(mt.debug("Received message",c),(c==null?void 0:c.id)!==o){mt.debug("Ignore message, id doesn't match",c);return}window.clearTimeout(n),window.removeEventListener("message",a),e(c.payload)};window.addEventListener("message",a),n=window.setTimeout(()=>{window.removeEventListener("message",a),t(new Tn("Request timed out"))},i),window.opener.postMessage(_t(s,o),"*")})}class rs extends Error{constructor(){super(...arguments);p(this,"isNoConsolesError",!0)}}function cs(s){return s.isNoConsolesError}const Ie=U.module("SessionUtils");function ha(s){return Ie.info(`Starting connection to '${s}'...`),new dh.IdeConnection(s)}async function ds(s,i){Ie.info("Getting console types...");const e=await s.getConsoleTypes();if(e.length===0)throw new rs("No console types available");Ie.info("Available types:",e);const t=e[0];Ie.info("Starting session with type",t);const n=await s.startSession(t),o={type:t,id:Ce.generate()};return Ie.info("Console session established",o),{session:n,config:o,connection:s,details:i}}function pa(s,i){return Ie.info("createCoreClient",s),new dh.CoreClient(s,i)}async function ma(){return Vt(ns)}async function fa(){switch(new URLSearchParams(window.location.search).get("authProvider")){case"parent":return ma()}return{}}async function ga(s,i){let e;try{e=await ds(s,i)}catch(t){if(!cs(t))throw t}return e}const ba=U.module("ViewportDataUtils");function us(s,i){return String(s.offsetInSnapshot+i)}function hs(s,i,e){return function(n){if(s==null)return;const{offset:o,rows:a}=n.detail;ba.debug("table updated",n.detail),a.forEach(r=>{const c=e(r,s.columns),u={key:us(r,o),item:c};i.getItem(u.key)!=null?i.update(u.key,u):i.append(u)})}}function ps(s,i){return i.reduce((e,t)=>(e[t.name]=s.get(t),e),{})}function*ms(s){for(let i=0;i<s;++i)yield{key:String(i)}}function at(s){return s==null||Bt(s)?0:s.size}function Bt(s){return"isClosed"in s?s.isClosed:!1}function fs(s,i,e,t){const n=s+i-1,[o,a]=[0,t-1],r=Ct(s-e,o,a),c=Ct(n+e,o,a);return[r,c]}const Ca=Object.freeze(Object.defineProperty({__proto__:null,BROADCAST_CHANNEL_NAME:ss,BROADCAST_LOGIN_MESSAGE:$t,BROADCAST_LOGOUT_MESSAGE:is,BooleanColumnFormatter:hi,CharColumnFormatter:pi,DateTimeColumnFormatter:mi,DateUtils:fi,DecimalColumnFormatter:gi,DefaultColumnFormatter:bi,FETCH_TIMEOUT:es,Formatter:Mn,FormatterUtils:vt,IntegerColumnFormatter:Ci,LOGIN_OPTIONS_REQUEST:ts,NoConsolesError:rs,SESSION_DETAILS_REQUEST:ns,StringColumnFormatter:vi,TableColumnFormatter:xi,TableUtils:Si,createConnection:ha,createCoreClient:pa,createKeyFromOffsetRow:us,createOnTableUpdatedHandler:hs,createSessionWrapper:ds,defaultRowDeserializer:ps,fetchVariableDefinition:da,generateEmptyKeyedItems:ms,getColumnFormats:yi,getDateTimeFormatterOptions:Ei,getSessionDetails:fa,getSize:at,isBroadcastLoginMessage:os,isBroadcastLogoutMessage:as,isClosed:Bt,isCustomColumnFormatDefined:Ii,isMessage:ot,isNoConsolesError:cs,isResponse:ls,loadSessionWrapper:ga,makeMessage:_t,makeResponse:ua,padFirstAndLastRow:fs,requestParentResponse:Vt},Symbol.toStringTag,{value:"Module"})),pn=U.module("useTableListener"),va=(s,i,e)=>d.useEffect(function(){if(s==null){pn.debug2("Emitter undefined, skipping addEventListener",i);return}return pn.debug2("Adding listener",i),s.addEventListener(i,e)},[s,i,e]),je=va;class xa extends Error{constructor(){super(...arguments);p(this,"isColumnNameError",!0)}}const Sa=xa;class ya extends Error{constructor(){super(...arguments);p(this,"isTableDisconnectError",!0)}}const Ea=ya,Be=U.module("useTable"),Ia=(s,i,e,t)=>{const n=Qe(),[o,a]=d.useState(void 0),[r,c]=d.useState([]),[u,h]=d.useState(null),[m,g]=d.useState(null);d.useEffect(()=>{if(t===void 0){a(s==null?void 0:s.columns),h(null);return}try{a(s==null?void 0:s.findColumns(t)),h(null)}catch(T){Be.error("Column not found",T,t),h(new Sa("Invalid columnNames argument"))}},[s,t]),d.useEffect(()=>{if(!o||!s){Be.debug2("Table or column not initialized, skip viewport update.");return}Be.debug2("Setting viewport",i,e),s.setViewport(i,e,o)},[o,s,i,e]);const b=d.useCallback(({detail:T})=>{if(!o){Be.error("Columns not initialized.");return}const j=o.map($=>T.rows.map(C=>C.get($)));c(j)},[o]),y=d.useCallback(()=>{g(new Ea("Table disconnected"))},[]),x=d.useCallback(()=>{g(null)},[]);return je(s,n.Table.EVENT_UPDATED,b),je(s,n.Table.EVENT_DISCONNECT,y),je(s,n.Table.EVENT_RECONNECT,x),{columns:o,data:r,error:m??u}},gs=Ia,wa=(s,i,e,t)=>{const n=d.useMemo(()=>[t],[t]),{columns:o=[],data:a=[],error:r}=gs(s,i,e,n);return{column:o[0],data:a[0],error:r}},bs=wa;const ae=U.module("TableInput"),ft=250;function Ht(s){const{className:i=void 0,columnName:e,settings:t,defaultValue:n=[],isInvalid:o=!1,onChange:a=()=>!1,onBlur:r=()=>!1,table:c}=s,u=d.useRef(null),h=d.useMemo(()=>{const k=vt.getColumnFormats(t),S=vt.getDateTimeFormatterOptions(t),{defaultDecimalFormatOptions:F={},defaultIntegerFormatOptions:X={}}=t;return new Mn(k,S,F,X)},[t]),[m,g]=d.useState(""),[b,y]=d.useState(new Set(n)),[x,T]=d.useState(),j=d.useRef(null),$=Math.min((x==null?void 0:x.size)??0,ft),{column:C,data:P,error:N}=bs(x,0,ft-1,e),D=d.useCallback(k=>C?h.getFormattedString(k,C.type,C.name):`${k}`,[C,h]),[O,B]=d.useMemo(()=>{const k=new Set(b),S=[];if(P==null)return[S,null];if(P.forEach(F=>{const X=`${F}`,z=b.has(X);z&&k.delete(X),S.push({value:X,displayValue:D(F),isSelected:z})}),k.size>0){ae.debug2("Selection has items that are missing from the viewport");const F=new Set(b);return Array.from(k).forEach(X=>{F.delete(X)}),[S,F]}return[S,null]},[P,b,D]);d.useEffect(()=>{B!==null&&(y(B),a(Array.from(B)))},[a,B]);const ne=d.useCallback(async k=>{try{const S=await k;ae.debug("Table resolved",S),T(S)}catch(S){if(Jt.isCanceled(S))return;ae.error(S)}},[]);d.useEffect(()=>{const k=Jt.makeCancelable(c);return ne(k),()=>{ae.debug2("Cancel table promise"),k.cancel()}},[c,ne]);const A=d.useCallback(k=>{var X;const{value:S}=k.target;g(S);const F=O.findIndex(z=>z.displayValue.includes(S));F>-1?(ae.debug2(`Found ${S} at index ${F}`),(X=j.current)==null||X.scrollIntoView(F)):ae.debug2(`${S} not found`)},[O,j]),R=d.useCallback(k=>{if(ae.debug("handleSelect",k),k>=O.length){ae.error("Invalid index",k);return}const S=O[k].value,F=new Set(b);O[k].isSelected?F.delete(S):F.add(S),y(F),a(Array.from(F))},[a,O,b]),_=d.useCallback(()=>{const k=O.map(F=>F.value),S=new Set(k);y(S),a(k)},[O,a]),M=d.useCallback(()=>{y(new Set),a([])},[a]),I=d.useCallback(()=>{},[]),v=d.useCallback(k=>{var F;const{relatedTarget:S}=k;ae.debug("handleChildBlur",S,S instanceof HTMLElement,u.current,(F=u.current)==null?void 0:F.contains(S)),(!S||u.current&&S instanceof HTMLElement&&!u.current.contains(S))&&r()},[r]),L=O.length===0;return l.jsxs("div",{ref:u,className:E("table-input-container d-flex flex-column position-relative",i),children:[l.jsx(nt,{disabled:!!N||L,value:m,placeholder:"Search",onChange:A,className:"mb-2 d-flex",onBlur:v}),l.jsx(Jn,{className:"table-input-list",disabled:x===void 0||L,isInvalid:o,items:L?[{value:"Empty",isSelected:!1}]:O,itemCount:$,offset:0,onSelect:R,onViewportChange:I,ref:j,onBlur:v}),x&&l.jsxs("div",{className:"meta-row",children:[l.jsx("div",{className:"d-flex align-items-center text-muted small",children:x!=null&&x.size>$&&l.jsxs(l.Fragment,{children:["Table is too large, showing the first ",ft," items."]})}),l.jsxs("div",{children:[l.jsx("button",{type:"button",className:"btn btn-link",onBlur:v,onClick:_,children:"Select All"}),l.jsx("button",{type:"button",className:"btn btn-link mr-a",onBlur:v,onClick:M,children:"Clear"})]})]}),x==null||N&&l.jsx("div",{className:"h-100 w-100 position-absolute",children:l.jsx(Me,{isLoaded:x!=null,isLoading:x==null&&N==null,errorMessage:(N==null?void 0:N.message)??null})})]})}Ht.displayName="TableInput";Ht.defaultProps={isInvalid:!1,className:void 0};const mn=U.module("useBroadcastChannel");function lt(s=Gi,i=ss){const e=d.useMemo(()=>new BroadcastChannel(i),[i]);return d.useEffect(()=>()=>{e.close()},[e]),d.useEffect(()=>{e.onmessage=t=>{const{data:n}=t;if(!ot(n)){mn.debug("Ignoring non-deephaven message",n);return}mn.debug("event received",n),s(t)}},[e,s]),e}function rt(s,i){const e=d.useCallback(t=>{os(t.data)?s==null||s(t.data):as(t.data)&&(i==null||i(t.data))},[s,i]);lt(e)}const Je="io.deephaven.web.client.auth.refreshToken",Cs=d.createContext(null);function Et(){const s=Te.get(Je);return s!=null?JSON.parse(s):null}function It(s){if(s!=null){const i=JSON.stringify({bytes:s.bytes,expiry:s.expiry}),e=new Date(s.expiry);Te.set(Je,i,{secure:!0,sameSite:"strict",expires:e})}else Te.remove(Je)}function vs({children:s}){const i=Qe(),e=Fe(),t=lt(),[n,o]=d.useState(Et());d.useEffect(function(){return e.addEventListener(i.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,h=>{const{detail:m}=h;It(m),o(m)})},[i,t,e,n]);const a=d.useCallback(()=>{o(Et())},[]),r=d.useCallback(()=>{It(null),o(null)},[]);return rt(a,r),l.jsx(Cs.Provider,{value:n,children:s})}function xs(s){const i=Bs({});return d.useEffect(()=>{s&&(i.items.length&&i.remove(...i.items.map(({key:e})=>e)),i.insert(0,...ms(at(s))))},[s]),i}function Ta(s,...i){const e=d.useCallback(async()=>(s==null?void 0:s.selectDistinct(s.findColumns(i)))??null,[s,...i]),{data:t,error:n,isError:o,isLoading:a}=jn(e,[]);return d.useEffect(()=>()=>{t==null||t.close()},[t]),{distinctTable:t,error:n,isError:o,isLoading:a}}function Ss(s,i,e){return d.useCallback(function(n){const[o,a]=fs(n,i,e,at(s));s==null||s.setViewport(o,a)},[s,e,i])}function Ma({table:s,viewportSize:i=10,viewportPadding:e=50,deserializeRow:t=ps}){const n=xs(s),o=Ss(s,i,e);return je(s,dh.Table.EVENT_UPDATED,hs(s,n,t)),d.useEffect(()=>{s&&!Bt(s)&&o(0)},[s,o]),{viewportData:n,size:at(s),setViewport:o}}const Na=Object.freeze(Object.defineProperty({__proto__:null,REFRESH_TOKEN_KEY:Je,RefreshTokenBootstrap:vs,RefreshTokenContext:Cs,TableInput:Ht,readRefreshToken:Et,storeRefreshToken:It,useBroadcastChannel:lt,useBroadcastLoginListener:rt,useInitializeViewportData:xs,useSelectDistinctTable:Ta,useSetPaddedViewportCallback:Ss,useTable:gs,useTableColumn:bs,useTableListener:je,useViewportData:Ma},Symbol.toStringTag,{value:"Module"})),ys=d.createContext(!1);function ka({fontClassNames:s=["fira-sans-regular","fira-sans-bold","fira-mono"],children:i}){const[e,t]=d.useState(!1);return d.useEffect(function(){document.fonts.ready.then(()=>{t(!0)})},[]),l.jsxs(l.Fragment,{children:[l.jsx(ys.Provider,{value:e,children:i}),l.jsx("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:s.map(n=>l.jsx("p",{className:n,children:"preload"},n))})]})}function Es(s){if(s==null)return!1;const i=s;return i.Component!==void 0&&typeof i.isAvailable=="function"}const Is="io.deephaven.auth.AnonymousAuthenticationHandler",Oa="io.deephaven.authentication.psk.PskAuthenticationHandler",fn=U.module("AuthPluginBase");function Kt({children:s,getLoginOptions:i}){const e=Fe(),[t,n]=d.useState(),[o,a]=d.useState(!1);return d.useEffect(()=>{let r=!1;function c(){if(r)throw new wi("Login canceled.")}async function u(){try{const h=await i();c(),fn.info("Logging in..."),await e.login(h),c(),a(!0)}catch(h){r||(fn.error("Unable to login:",h),n(h),a(!1))}}return u(),()=>{r=!0}},[e,i]),o?l.jsx(l.Fragment,{children:s}):l.jsx(Me,{"data-testid":"auth-base-loading",isLoading:t==null,isLoaded:!1,errorMessage:t!=null?`${t}`:null})}const Da=d.createContext({}),Wt=d.createContext({}),Aa={canLogout:!1};function Ra({children:s}){const i=Qe(),e=d.useCallback(async()=>({type:i.CoreClient.LOGIN_TYPE_ANONYMOUS}),[i]);return l.jsx(Kt,{getLoginOptions:e,children:l.jsx(Wt.Provider,{value:Aa,children:s})})}const ja={Component:Ra,isAvailable:s=>s.includes(Is)},ws=ja,La=U.module("AuthPluginParent"),Pa={canLogout:!1};function Fa(){return La.info("Logging in by delegating to parent window..."),Vt(ts)}function Ua(){return new URLSearchParams(window.location.search).get("authProvider")??""}function $a({children:s}){return l.jsx(Kt,{getLoginOptions:Fa,children:l.jsx(Wt.Provider,{value:Pa,children:s})})}const _a={Component:$a,isAvailable:()=>window.opener!=null&&Ua()==="parent"},Ts=_a;function Ms({children:s,errorMessage:i,isLoggingIn:e=!1,onSubmit:t}){return l.jsxs("form",{className:"login-form",onSubmit:n=>{n.preventDefault(),n.stopPropagation(),t==null||t(n)},children:[l.jsx("div",{className:"flex-spacer"}),l.jsxs("div",{className:"flex-wrapper",children:[l.jsx("fieldset",{disabled:e,className:"container-fluid",children:s}),l.jsx("div",{className:"form-group d-flex justify-content-end align-items-center mb-0",children:l.jsxs("button",{type:"submit",className:E("btn btn-primary",{"btn-spinner":e},{"btn-cancelable":e}),"data-testid":"btn-login",children:[e&&l.jsxs("span",{children:[l.jsx(yn,{}),l.jsx("span",{className:"btn-normal-content",children:"Logging in"}),l.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!e&&"Login"]})})]}),l.jsx("div",{className:"flex-spacer",children:i!=null&&l.jsx("p",{className:"error-message mb-0",role:"alert",children:`${i}`})})]})}function Ns({children:s}){return l.jsxs("div",{className:"login-container",children:[l.jsx(Zn,{}),l.jsxs("div",{className:"login-box",children:[l.jsx("div",{className:"logo",children:l.jsx("img",{src:"/logo",alt:"Deephaven Data Labs"})}),s,l.jsxs("p",{className:"footer",children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})}const wt="io.deephaven.authentication.psk.PskAuthenticationHandler",ks="psk",Tt="io.deephaven.web.client.auth.psk.token",Le=U.module("AuthPluginPsk");function Va(){return new URLSearchParams(window.location.search).get(ks)}function Ba(){Le.debug2("clearWindowToken");const s=new URLSearchParams(window.location.search);s.delete(ks);let i=`${s}`;i.length>0&&(i=`?${i}`);const e=`${window.location.pathname}${i}${window.location.hash}`;window.history.replaceState(null,"",e)}function gn(){return Te.get(Tt)??null}function gt(s){Le.debug2("Storing token in cookie",s),s!=null?Te.set(Tt,s,{secure:!0,sameSite:"strict"}):Te.remove(Tt)}function Ha({children:s}){const i=Fe(),e=d.useRef(null),t=d.useRef(null),[n,o]=d.useState(),[a,r]=d.useState(!1),[c,u]=d.useState(!1),[h,m]=d.useState(!1),[g,b]=d.useState(""),y=d.useCallback(async(C,P=!0)=>{Le.info("Logging in..."),m(!0);let N=null;try{if(N=i.login({type:wt,token:C}),t.current=N,await N,Le.info("Logged in successfully"),t.current!==N)return;gt(C),u(!0)}catch(D){if(t.current!==N)return;r(!0),P&&o((D==null?void 0:D.detail)??"Unable to login: Verify credentials.")}m(!1)},[i]),x=d.useCallback(()=>{t.current=null,m(!1)},[]),T=d.useCallback(async()=>{Le.debug("onLogin");const C=gn();c||h||C==null||y(C,!1)},[c,h,y]),j=d.useCallback(()=>{gt(null)},[]);rt(T,j),d.useEffect(()=>{let C=!1;async function P(){const N=Va()??gn();if(Ba(),N==null){r(!0);return}m(!0);try{await i.login({type:wt,token:N}),C||(gt(N),u(!0),m(!1))}catch{C||(r(!0),m(!1))}}return P(),()=>{C=!0}},[i]);const $=d.useCallback(()=>{h?x():y(g)},[x,h,y,g]);return d.useEffect(function(){var P;(P=e.current)==null||P.focus()},[e,a]),l.jsxs(l.Fragment,{children:[c&&s,a&&l.jsx(be,{in:!c,timeout:oe.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:l.jsx(Ns,{children:l.jsx(Ms,{errorMessage:n!=null?`${n}`:void 0,isLoggingIn:h,onSubmit:$,children:l.jsxs("div",{className:"form-group",children:[l.jsx("label",{htmlFor:"auth-psk-token-input",children:"Token"}),l.jsx("input",{id:"auth-psk-token-input",name:"token",className:"input-token form-control",type:"text",autoComplete:"username",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",ref:e,value:g,onChange:C=>{o(void 0),b(C.target.value)}})]})})})}),l.jsx(Me,{"data-testid":"auth-psk-loading",isLoaded:c||a,isLoading:!c&&!a})]})}const Ka={Component:Ha,isAvailable:s=>s.includes(wt)},Os=Ka,Wa=Object.freeze(Object.defineProperty({__proto__:null,AUTH_HANDLER_TYPE_ANONYMOUS:Is,AUTH_HANDLER_TYPE_PSK:Oa,AuthPluginAnonymous:ws,AuthPluginBase:Kt,AuthPluginParent:Ts,AuthPluginPsk:Os,Login:Ns,LoginForm:Ms,UserOverrideContext:Da,UserPermissionsOverrideContext:Wt,isAuthPlugin:Es},Symbol.toStringTag,{value:"Module"})),Ds={react:w,"react-dom":bn,redux:Hs,"react-redux":Ks,"@deephaven/auth-plugins":Wa,"@deephaven/components":ra,"@deephaven/jsapi-bootstrap":ca,"@deephaven/jsapi-components":Na,"@deephaven/jsapi-utils":Ca,"@deephaven/log":Oi,"@deephaven/react-hooks":Ji},Ga=Cn.createRequires(()=>Ds),qa=Cn.createRemoteComponent({requires:Ga}),za=qa,Za=Ws.createRequires(Ds),Xa=Gs({requires:Za}),Ja=Xa,he=U.module("@deephaven/app-utils.PluginUtils");function bl(s,i){const e=new URL(`${i}.js`,s),t=w.forwardRef((n,o)=>l.jsx(za,{url:e.href,render:({err:a,Component:r})=>{if(a!=null&&a!==""){const c=`Error loading plugin ${i} from ${e} due to ${a}`;return he.error(c),l.jsx("div",{className:"error-message",children:`${c}`})}return l.jsx(r,{ref:o,...n})}}));return t.pluginName=i,t.displayName="Plugin",t}async function Qa(s){return await Ja(s)}async function Ya(s){const i=await fetch(s);if(!i.ok)throw new Error(i.statusText);try{return await i.json()}catch{throw new Error("Could not be parsed as JSON")}}async function el(s){he.debug("Loading plugins...");try{const i=await Ya(`${s}/manifest.json`);if(!Array.isArray(i.plugins))throw new Error("Plugin manifest JSON does not contain plugins array");he.debug("Plugin manifest loaded:",i);const e=[];for(let o=0;o<i.plugins.length;o+=1){const{name:a,main:r}=i.plugins[o],c=`${s}/${a}/${r}`;e.push(Qa(c))}const t=await Promise.allSettled(e),n=new Map;for(let o=0;o<t.length;o+=1){const a=t[o],{name:r}=i.plugins[o];a.status==="fulfilled"?n.set(r,a.value):he.error(`Unable to load plugin ${r}`,a.reason)}return he.info("Plugins loaded:",n),n}catch(i){return he.error("Unable to load plugins:",i),new Map}}function tl(s){var i;return((i=s.get("AuthHandlers"))==null?void 0:i.split(","))??[]}function nl(s,i,e){const t=tl(i),n=[...s.entries()].filter(([,c])=>Es(c.AuthPlugin)).map(([c,u])=>[c,u.AuthPlugin]);n.push(...e??[]);const o=n.filter(([c,u])=>u.isAvailable(t,i));if(o.length===0)throw new Error(`No login plugins found, please register a login plugin for auth handlers: ${t}`);o.length>1&&he.warn("More than one login plugin available, will use the first one: ",o.map(([c])=>c).join(", "));const[a,r]=o[0];return he.info("Using LoginPlugin",a),r.Component}const Gt=d.createContext(null);function sl({pluginsUrl:s,children:i}){const[e,t]=d.useState(null);return d.useEffect(function(){let o=!1;async function a(){const r=await el(s);o||t(r)}return a(),()=>{o=!0}},[s]),l.jsx(Gt.Provider,{value:e,children:i})}function il(){const s=lt();return d.useEffect(function(){s.postMessage(_t($t))},[s]),null}const ol=new Map([["@deephaven/auth-plugins.AuthPluginPsk",Os],["@deephaven/auth-plugins.AuthPluginParent",Ts],["@deephaven/auth-plugins.AuthPluginAnonymous",ws]]);function al({children:s}){const i=Fe(),e=d.useContext(Gt),[t,n]=d.useState(),[o,a]=d.useState();d.useEffect(function(){let h=!1;async function m(){try{const g=await i.getAuthConfigValues();h||n(new Map(g))}catch(g){h||a(g)}}return m(),()=>{h=!0}},[i]);const r=d.useMemo(()=>{if(!(e==null||t==null))try{return nl(e,t,ol)}catch(u){a(u)}},[t,e]),c=r==null||t==null;return c||o!=null?l.jsx(Me,{isLoading:c,errorMessage:o!=null?`${o}`:void 0}):l.jsx(r,{authConfigValues:t,children:l.jsxs(l.Fragment,{children:[l.jsx(il,{}),s]})})}function ll(s){return new URL(s,`${window.location}`)}function rl(){return new URLSearchParams(window.location.search).get("envoyPrefix")}function cl(){const s=rl();return s!=null?{headers:{"envoy-prefix":s}}:{headers:{}}}function dl({children:s}){return d.useContext(ys)?l.jsx(l.Fragment,{children:s}):l.jsx(Me,{"data-testid":"fonts-loaded-loading"})}function Cl({apiUrl:s,fontClassNames:i,pluginsUrl:e,children:t}){const n=ll(s).origin,o=d.useMemo(()=>cl(),[]),[a,r]=d.useState(0),c=d.useCallback(()=>{},[]),u=d.useCallback(()=>{r(h=>h+1)},[]);return rt(c,u),l.jsx(ka,{fontClassNames:i,children:l.jsx(sl,{pluginsUrl:e,children:l.jsx(wn,{serverUrl:n,options:o,children:l.jsx(vs,{children:l.jsx(al,{children:l.jsx(Ti,{children:l.jsx(dl,{children:t})})})})},a)})})}function vl(){return En(Gt,"No Plugins available in usePlugins. Was code wrapped in PluginsBootstrap or PluginsContext.Provider?")}export{Cl as AppBootstrap,al as AuthBootstrap,Ti as ConnectionBootstrap,yl as ConnectionContext,ka as FontBootstrap,dl as FontsLoaded,ys as FontsLoadedContext,sl as PluginsBootstrap,Gt as PluginsContext,za as RemoteComponent,tl as getAuthHandlers,nl as getAuthPluginComponent,ll as getBaseUrl,cl as getConnectOptions,rl as getEnvoyPrefix,bl as loadComponentPlugin,Ya as loadJson,Qa as loadModulePlugin,el as loadModulePlugins,El as useConnection,vl as usePlugins};
|
|
9
|
-
//# sourceMappingURL=index-3a60cd3b.js.map
|