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